1 /*
2  * Copyright (c) 2021-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_SERVICE_IPC_INTERFACE_CODE_H
17 #define OHOS_CAMERA_SERVICE_IPC_INTERFACE_CODE_H
18 
19 /* SAID: 3008 */
20 namespace OHOS {
21 namespace CameraStandard {
22 /**
23  * @brief Camera device remote request code for IPC.
24  *
25  * @since 1.0
26  * @version 1.0
27  */
28 enum class CameraDeviceInterfaceCode {
29     CAMERA_DEVICE_OPEN = 0,
30     CAMERA_DEVICE_CLOSE,
31     CAMERA_DEVICE_RELEASE,
32     CAMERA_DEVICE_SET_CALLBACK,
33     CAMERA_DEVICE_UPDATE_SETTNGS,
34     CAMERA_DEVICE_GET_ENABLED_RESULT,
35     CAMERA_DEVICE_ENABLED_RESULT,
36     CAMERA_DEVICE_DISABLED_RESULT,
37     CAMERA_DEVICE_GET_STATUS,
38     CAMERA_DEVICE_SET_USED_POS
39 };
40 
41 /**
42  * @brief Camera service callback remote request code for IPC.
43  *
44  * @since 1.0
45  * @version 1.0
46  */
47 enum CameraServiceCallbackInterfaceCode {
48     CAMERA_CALLBACK_STATUS_CHANGED = 0,
49     CAMERA_CALLBACK_FLASHLIGHT_STATUS_CHANGED
50 };
51 
52 /**
53  * @brief Camera mute service callback remote request code for IPC.
54  *
55  * @since 1.0
56  * @version 1.0
57  */
58 enum CameraMuteServiceCallbackInterfaceCode {
59     CAMERA_CALLBACK_MUTE_MODE = 0
60 };
61 
62 /**
63  * @brief Torch service callback remote request code for IPC.
64  *
65  * @since 1.0
66  * @version 1.0
67  */
68 enum TorchServiceCallbackInterfaceCode {
69     TORCH_CALLBACK_TORCH_STATUS_CHANGE = 0
70 };
71 
72 /**
73  * @brief Fold service callback remote request code for IPC.
74  *
75  * @since 1.0
76  * @version 1.0
77  */
78 enum FoldServiceCallbackInterfaceCode {
79     FOLD_CALLBACK_FOLD_STATUS_CHANGE = 0
80 };
81 
82 /**
83  * @brief Camera service remote request code for IPC.
84  *
85  * @since 1.0
86  * @version 1.0
87  */
88 enum CameraServiceInterfaceCode {
89     CAMERA_SERVICE_CREATE_DEVICE = 0,
90     CAMERA_SERVICE_SET_CAMERA_CALLBACK,
91     CAMERA_SERVICE_SET_MUTE_CALLBACK,
92     CAMERA_SERVICE_SET_TORCH_CALLBACK,
93     CAMERA_SERVICE_GET_CAMERAS,
94     CAMERA_SERVICE_CREATE_CAPTURE_SESSION,
95     CAMERA_SERVICE_CREATE_PHOTO_OUTPUT,
96     CAMERA_SERVICE_CREATE_PREVIEW_OUTPUT,
97     CAMERA_SERVICE_CREATE_DEFERRED_PREVIEW_OUTPUT,
98     CAMERA_SERVICE_CREATE_VIDEO_OUTPUT,
99     CAMERA_SERVICE_SET_LISTENER_OBJ,
100     CAMERA_SERVICE_CREATE_METADATA_OUTPUT,
101     CAMERA_SERVICE_MUTE_CAMERA,
102     CAMERA_SERVICE_IS_CAMERA_MUTED,
103     CAMERA_SERVICE_PRE_LAUNCH_CAMERA,
104     CAMERA_SERVICE_SET_PRE_LAUNCH_CAMERA,
105     CAMERA_SERVICE_SET_TORCH_LEVEL,
106     CAMERA_SERVICE_PRE_SWITCH_CAMERA,
107     CAMERA_SERVICE_CREATE_DEFERRED_PHOTO_PROCESSING_SESSION,
108     CAMERA_SERVICE_GET_CAMERA_IDS,
109     CAMERA_SERVICE_GET_CAMERA_ABILITY,
110     CAMERA_SERVICE_DESTROY_STUB_OBJ,
111     CAMERA_SERVICE_MUTE_CAMERA_PERSIST,
112     CAMERA_SERVICE_PROXY_FOR_FREEZE,
113     CAMERA_SERVICE_RESET_ALL_FREEZE_STATUS,
114     CAMERA_SERVICE_GET_DM_DEVICE_INFOS,
115     CAMERA_SERVICE_SET_FOLD_CALLBACK,
116     CAMERA_SERVICE_GET_CAMERA_OUTPUT_STATUS,
117     CAMERA_SERVICE_CREATE_DEPTH_DATA_OUTPUT,
118     CAMERA_SERVICE_CREATE_DEFERRED_VIDEO_PROCESSING_SESSION,
119     CAMERA_SERVICE_REQUIRE_MEMORY_SIZE,
120 };
121 
122 /**
123  * @brief Camera service remote request code for DH IPC.
124  *
125  * @since 1.0
126  * @version 1.0
127  */
128 enum CameraServiceDHInterfaceCode {
129     CAMERA_SERVICE_ALLOW_OPEN_BY_OHSIDE = 101,
130     CAMERA_SERVICE_NOTIFY_CAMERA_STATE = 102,
131     CAMERA_SERVICE_NOTIFY_CLOSE_CAMERA = 2,
132     CAMERA_SERVICE_NOTIFY_MUTE_CAMERA = 4,
133     CAMERA_SERVICE_SET_PEER_CALLBACK = 104,
134     CAMERA_SERVICE_UNSET_PEER_CALLBACK = 105
135 };
136 
137 /**
138  * @brief Capture session remote request code for IPC.
139  *
140  * @since 1.0
141  * @version 1.0
142  */
143 enum CaptureSessionInterfaceCode {
144     CAMERA_CAPTURE_SESSION_BEGIN_CONFIG = 0,
145     CAMERA_CAPTURE_SESSION_ADD_INPUT,
146     CAMERA_CAPTURE_SESSION_CAN_ADD_INPUT,
147     CAMERA_CAPTURE_SESSION_ADD_OUTPUT,
148     CAMERA_CAPTURE_SESSION_REMOVE_INPUT,
149     CAMERA_CAPTURE_SESSION_REMOVE_OUTPUT,
150     CAMERA_CAPTURE_SESSION_COMMIT_CONFIG,
151     CAMERA_CAPTURE_SESSION_START,
152     CAMERA_CAPTURE_SESSION_STOP,
153     CAMERA_CAPTURE_SESSION_RELEASE,
154     CAMERA_CAPTURE_SESSION_SET_CALLBACK,
155     CAMERA_CAPTURE_GET_SESSION_STATE,
156     CAMERA_CAPTURE_GET_ACTIVE_COLOR_SPACE,
157     CAMERA_CAPTURE_SET_COLOR_SPACE,
158     CAMERA_CAPTURE_SESSION_SET_SMOOTH_ZOOM,
159     CAMERA_CAPTURE_SESSION_SET_FEATURE_MODE,
160     CAMERA_CAPTURE_SESSION_ENABLE_MOTION_PHOTO,
161     CAMERA_CAPTURE_SESSION_START_MOVING_PHOTO_CAPTURE,
162     CAMERA_CAPTURE_SESSION_CREATE_MEDIA_LIBRARY_MANAGER,
163     CAMERA_CAPTURE_SESSION_SET_PREVIEW_ROTATE,
164     CAMERA_CAPTURE_SESSION_CREATE_MEDIA_LIBRARY_MANAGER_PICTURE,
165 };
166 
167 /**
168  * @brief Stream capture remote request code for IPC.
169  *
170  * @since 1.0
171  * @version 1.0
172  */
173 enum StreamCaptureInterfaceCode {
174     CAMERA_STREAM_CAPTURE_START = 0,
175     CAMERA_STREAM_CAPTURE_CANCEL,
176     CAMERA_STREAM_CAPTURE_SET_CALLBACK,
177     CAMERA_STREAM_CAPTURE_RELEASE,
178     CAMERA_SERVICE_SET_THUMBNAIL,
179     CAMERA_STREAM_CAPTURE_CONFIRM,
180     CAMERA_SERVICE_ENABLE_DEFERREDTYPE,
181     CAMERA_STREAM_GET_DEFERRED_PHOTO,
182     CAMERA_STREAM_GET_DEFERRED_VIDEO,
183     CAMERA_STREAM_SET_BUFFER_PRODUCER_INFO,
184     CAMERA_STREAM_SET_VIDEO_CODEC_TYPE,
185     CAMERA_STREAM_ENABLE_RAW_DELIVERY,
186     CAMERA_PHOTO_ROTATION,
187     CAMERA_CAPTURE_DFX,
188 };
189 
190 /**
191  * @brief Stream repeat remote request code for IPC.
192  *
193  * @since 1.0
194  * @version 1.0
195  */
196 enum StreamRepeatInterfaceCode {
197     CAMERA_START_VIDEO_RECORDING = 0,
198     CAMERA_STOP_VIDEO_RECORDING,
199     CAMERA_STREAM_REPEAT_SET_CALLBACK,
200     CAMERA_STREAM_REPEAT_RELEASE,
201     CAMERA_ADD_DEFERRED_SURFACE,
202     CAMERA_FORK_SKETCH_STREAM_REPEAT,
203     CAMERA_REMOVE_SKETCH_STREAM_REPEAT,
204     CAMERA_UPDATE_SKETCH_RATIO,
205     CAMERA_STREAM_FRAME_RANGE_SET,
206     CAMERA_ENABLE_SECURE_STREAM,
207     CAMERA_ENABLE_STREAM_MIRROR,
208     CAMERA_ATTACH_META_SURFACE,
209     CAMERA_PRIVIEW_ROTATION,
210     CAMERA_API_VERSION
211 };
212 
213 /**
214  * @brief Stream metadata remote request code for IPC.
215  *
216  * @since 1.0
217  * @version 1.0
218  */
219 enum StreamMetadataInterfaceCode {
220     CAMERA_STREAM_META_START = 0,
221     CAMERA_STREAM_META_STOP,
222     CAMERA_STREAM_META_RELEASE,
223     CAMERA_STREAM_META_SET_CALLBACK,
224     CAMERA_STREAM_META_ENABLE_RESULTS,
225     CAMERA_STREAM_META_DISABLE_RESULTS
226 };
227 
228 /**
229  * @brief Stream depth data remote request code for IPC.
230  *
231  * @since 1.0
232  * @version 1.0
233  */
234 enum StreamDepthDataInterfaceCode {
235     CAMERA_STREAM_DEPTH_DATA_START = 0,
236     CAMERA_STREAM_DEPTH_DATA_STOP,
237     CAMERA_STREAM_DEPTH_DATA_SET_CALLBACK,
238     CAMERA_STREAM_DEPTH_DATA_ACCURACY_SET,
239     CAMERA_STREAM_DEPTH_DATA_RELEASE
240 };
241 
242 /**
243  * @brief Camera device callback remote request code for IPC.
244  *
245  * @since 1.0
246  * @version 1.0
247  */
248 enum CameraDeviceCallbackInterfaceCode {
249     CAMERA_DEVICE_ON_ERROR = 0,
250     CAMERA_DEVICE_ON_RESULT,
251 };
252 
253 enum StreamMetadataCallbackInterfaceCode {
254     CAMERA_META_OPERATOR_ON_RESULT = 0
255 };
256 
257 /**
258  * @brief Camera repeat stream callback remote request code for IPC.
259  *
260  * @since 1.0
261  * @version 1.0
262  */
263 enum StreamRepeatCallbackInterfaceCode {
264     CAMERA_STREAM_REPEAT_ON_FRAME_STARTED = 0,
265     CAMERA_STREAM_REPEAT_ON_FRAME_ENDED,
266     CAMERA_STREAM_REPEAT_ON_ERROR,
267     CAMERA_STREAM_SKETCH_STATUS_ON_CHANGED,
268     CAMERA_STREAM_REPEAT_VIDEO_DEFERRED_INFO
269 };
270 
271 /**
272  * @brief Camera depth stream callback remote request code for IPC.
273  *
274  * @since 1.0
275  * @version 1.0
276  */
277 enum StreamDepthDataCallbackInterfaceCode {
278     CAMERA_STREAM_DEPTH_DATA_ON_ERROR = 0
279 };
280 
281 /**
282  * @brief Camera capture stream callback remote request code for IPC.
283  *
284  * @since 1.0
285  * @version 1.0
286  */
287 enum StreamCaptureCallbackInterfaceCode {
288     CAMERA_STREAM_CAPTURE_ON_CAPTURE_STARTED = 0,
289     CAMERA_STREAM_CAPTURE_ON_CAPTURE_ENDED,
290     CAMERA_STREAM_CAPTURE_ON_CAPTURE_ERROR,
291     CAMERA_STREAM_CAPTURE_ON_FRAME_SHUTTER,
292     CAMERA_STREAM_CAPTURE_ON_CAPTURE_STARTED_V1_2,
293     CAMERA_STREAM_CAPTURE_ON_FRAME_SHUTTER_END,
294     CAMERA_STREAM_CAPTURE_ON_CAPTURE_READY
295 };
296 
297 /**
298 * @brief Capture session callback remote request code for IPC.
299 *
300 * @since 1.0
301 * @version 1.0
302 */
303 enum CaptureSessionCallbackInterfaceCode {
304     CAMERA_CAPTURE_SESSION_ON_ERROR = 0
305 };
306 } // namespace CameraStandard
307 } // namespace OHOS
308 #endif // OHOS_CAMERA_SERVICE_IPC_INTERFACE_CODE_H
309