1/*
2 * Copyright (c) 2023 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/**
17 * @file Types.h
18 *
19 * @brief Declares data types
20 * used by the Hardware Driver Interfaces (HDIs) of this module.
21 *
22 * @since 4.0
23 * @version 1.1
24 */
25
26package ohos.hdi.camera.v1_1;
27sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable;
28
29import ohos.hdi.camera.v1_0.Types;
30
31/**
32 * @brief Enumerates types of the extended stream information.
33 */
34enum ExtendedStreamInfoType {
35    /**
36     * Extended stream information of quick thumbnail.
37     */
38    EXTENDED_STREAM_INFO_QUICK_THUMBNAIL = 0,
39};
40
41/**
42 * @brief Defines the extended information of a normal stream.
43 */
44struct ExtendedStreamInfo {
45    /**
46     * Type of the extended stream information.
47     */
48    enum ExtendedStreamInfoType type;
49
50    /**
51     * Image width.
52     */
53    int width;
54
55    /**
56     * Image height.
57     */
58    int height;
59
60    /**
61     * Image format.
62     */
63    int format;
64
65    /**
66     * Image color space.
67     */
68    int dataspace;
69
70    /**
71     * Producer handle provided by the graphics layer for quick thumbnail.
72     */
73    BufferProducerSequenceable bufferQueue;
74};
75
76/**
77 * @brief Defines the stream information, which is used to pass configuration parameters during stream creation.
78 */
79struct StreamInfo_V1_1 {
80    /**
81     * The last version of stream info
82     */
83    struct StreamInfo v1_0;
84
85    /**
86     * Optional extended stream informations.
87     */
88    struct ExtendedStreamInfo[] extendedStreamInfos;
89};
90
91/**
92 * @brief Defines the prelaunch configuration, which is used by {@link Prelaunch}.
93 */
94struct PrelaunchConfig {
95    /**
96     * Camera ID, which uniquely identifies a camera device.
97     */
98    String cameraId;
99
100    /**
101     * Stream infos used in stream prelaunch mode, which can be ignored currently.
102     */
103    struct StreamInfo_V1_1[] streamInfos_V1_1;
104
105    /**
106     * Indicates the prelaunch configuration parameters.
107     */
108    unsigned char[] setting;
109};
110
111/**
112 * @brief Enumerates stream operation modes.
113 */
114enum OperationMode_V1_1 {
115    /**
116     * Normal mode, which supports both photo and video scenes
117     */
118    NORMAL = 0,
119
120    /**
121     * Capture mode, which dedicated to photo scene
122     * IF this mode is implemented, then the NORMAL mode should no longer be implemented
123     */
124    CAPTURE = 1,
125
126    /**
127     * Video mode, which dedicated to video secne
128     * IF this mode is implemented, then the NORMAL mode should no longer be implemented
129     */
130    VIDEO = 2,
131
132    /**
133     * Portrait mode, which dedicated to portrait photo secne
134     */
135    PORTRAIT = 3,
136
137    /**
138     * Night mode, which dedicated to night shooting scene
139     */
140    NIGHT = 4,
141
142    /**
143     * Professional mode, which dedicated to professional photo scene
144     */
145    PROFESSIONAL = 5,
146
147    /**
148     * Slow motion mode, which dedicated to capturing slow motion
149     */
150    SLOW_MOTION = 6,
151};
152