/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef OHOS_CAMERA_H_STREAM_METADATA_H #define OHOS_CAMERA_H_STREAM_METADATA_H #define EXPORT_API __attribute__((visibility("default"))) #include "camera_metadata_info.h" #include "hstream_metadata_stub.h" #include "hstream_common.h" #include "v1_0/istream_operator.h" #include #include namespace OHOS { namespace CameraStandard { class EXPORT_API HStreamMetadata : public HStreamMetadataStub, public HStreamCommon { public: HStreamMetadata(sptr producer, int32_t format, std::vector metadataTypes); ~HStreamMetadata(); int32_t LinkInput(sptr streamOperator, std::shared_ptr cameraAbility) override; void SetStreamInfo(StreamInfo_V1_1& streamInfo) override; int32_t ReleaseStream(bool isDelay) override; int32_t Release() override; int32_t Start() override; int32_t Stop() override; int32_t SetCallback(sptr& callback) override; int32_t EnableMetadataType(std::vector metadataTypes) override; int32_t DisableMetadataType(std::vector metadataTypes) override; void DumpStreamInfo(CameraInfoDumper& infoDumper) override; int32_t OperatePermissionCheck(uint32_t interfaceCode) override; int32_t OnMetaResult(int32_t streamId, const std::vector& result); private: int32_t EnableOrDisableMetadataType(const std::vector& metadataTypes, const bool enable); void removeMetadataType(std::vector& vec1, std::vector& vec2); std::vector metadataObjectTypes_; std::mutex metadataTypeMutex_; std::atomic isStarted_ { false }; sptr streamMetadataCallback_; std::mutex callbackLock_; uint32_t majorVer_ = 0; uint32_t minorVer_ = 0; }; } // namespace CameraStandard } // namespace OHOS #endif // OHOS_CAMERA_H_STREAM_METADATA_H