1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_CAMERA_H_STREAM_COMMON_H 17 #define OHOS_CAMERA_H_STREAM_COMMON_H 18 19 #include "camera_metadata_info.h" 20 #include "istream_common.h" 21 #include "v1_0/istream_operator.h" 22 23 #include <refbase.h> 24 #include <iostream> 25 26 namespace OHOS { 27 namespace CameraStandard { 28 using namespace OHOS::HDI::Camera::V1_0; 29 class HStreamCommon : virtual public RefBase { 30 public: 31 HStreamCommon(StreamType streamType, sptr<OHOS::IBufferProducer> producer, 32 int32_t format, int32_t width, int32_t height); 33 virtual ~HStreamCommon(); 34 virtual int32_t LinkInput(sptr<IStreamOperator> streamOperator, 35 std::shared_ptr<OHOS::Camera::CameraMetadata> cameraAbility, int32_t streamId) = 0; 36 virtual void SetStreamInfo(StreamInfo &streamInfo) = 0; 37 virtual int32_t Release() = 0; 38 virtual void DumpStreamInfo(std::string& dumpString) = 0; 39 virtual bool IsReleaseStream() final; 40 virtual int32_t SetReleaseStream(bool isReleaseStream) final; 41 virtual int32_t GetStreamId() final; 42 virtual StreamType GetStreamType() final; 43 44 int32_t curCaptureID_; 45 int32_t streamId_; 46 int32_t format_; 47 int32_t width_; 48 int32_t height_; 49 sptr<OHOS::IBufferProducer> producer_; 50 sptr<IStreamOperator> streamOperator_; 51 std::shared_ptr<OHOS::Camera::CameraMetadata> cameraAbility_; 52 53 private: 54 StreamType streamType_; 55 bool isReleaseStream_; 56 }; 57 } // namespace CameraStandard 58 } // namespace OHOS 59 #endif // OHOS_CAMERA_H_STREAM_COMMON_H 60