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