1 /* 2 * Copyright (c) 2021 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 HOS_CAMERA_STREAM_H 17 #define HOS_CAMERA_STREAM_H 18 19 #include "ibuffer.h" 20 #include "camera_metadata_info.h" 21 #include <memory> 22 23 namespace OHOS::Camera { 24 using ModeMeta = std::shared_ptr<OHOS::CameraStandard::CameraMetadata>; 25 using CaptureMeta = std::shared_ptr<OHOS::CameraStandard::CameraMetadata>; 26 27 struct StreamConfiguration { 28 int32_t id; 29 int32_t type; 30 uint32_t width; 31 uint32_t height; 32 uint32_t format; 33 uint64_t usage; 34 int32_t dataspace; 35 bool tunnelMode; 36 int32_t minFrameDuration; 37 int32_t encodeType; 38 uint32_t bufferCount; 39 int32_t maxBatchCaptureCount; 40 int32_t maxCaptureCount; 41 }; 42 43 struct DeviceStreamSetting { 44 int32_t streamId; 45 uint32_t bufferCount; 46 uint32_t width; 47 uint32_t height; 48 uint32_t format; 49 uint64_t usage; 50 CameraEncodeType encodeType; 51 /* other settings */ 52 }; 53 54 enum DynamicStreamSwitchMode { 55 DYNAMIC_STREAM_SWITCH_NOT_SUPPORT = 0, 56 DYNAMIC_STREAM_SWITCH_SUPPORT, 57 DYNAMIC_STREAM_SWITCH_NEED_INNER_RESTART, 58 }; 59 60 struct FrameSpec { 61 int64_t bufferPoolId_; 62 uint32_t bufferCount_; 63 std::shared_ptr<IBuffer> buffer_; 64 }; 65 } 66 #endif 67