• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# photo_output.h
2<!--Kit: Camera Kit-->
3<!--Subsystem: Multimedia-->
4<!--Owner: @qano-->
5<!--SE: @leo_ysl-->
6<!--TSE: @xchaosioda-->
7
8## Overview
9
10The file declares the photo output concepts.
11
12**File to include**: <ohcamera/photo_output.h>
13
14**Library**: libohcamera.so
15
16**System capability**: SystemCapability.Multimedia.Camera.Core
17
18**Since**: 11
19
20**Related module**: [OH_Camera](capi-oh-camera.md)
21
22## Summary
23
24### Structs
25
26| Name| typedef Keyword| Description|
27| -- | -- | -- |
28| [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) | PhotoOutput_Callbacks | Describes the callbacks related to photo output.|
29| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md) | Camera_PhotoOutput | Describes the photo output object.<br>You can use [OH_CameraManager_CreatePhotoOutput](capi-camera-manager-h.md#oh_cameramanager_createphotooutput) to create such an object. |
30
31### Functions
32
33| Name| typedef Keyword| Description|
34| -- | -- | -- |
35| [typedef void (\*OH_PhotoOutput_OnFrameStart)(Camera_PhotoOutput* photoOutput)](#oh_photooutput_onframestart) | OH_PhotoOutput_OnFrameStart | Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report photo output frame start events.|
36| [typedef void (\*OH_PhotoOutput_OnFrameShutter)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* info)](#oh_photooutput_onframeshutter) | OH_PhotoOutput_OnFrameShutter | Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report frame shutter events.|
37| [typedef void (\*OH_PhotoOutput_OnFrameEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)](#oh_photooutput_onframeend) | OH_PhotoOutput_OnFrameEnd | Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report photo output frame end events.|
38| [typedef void (\*OH_PhotoOutput_OnError)(Camera_PhotoOutput* photoOutput, Camera_ErrorCode errorCode)](#oh_photooutput_onerror) | OH_PhotoOutput_OnError | Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report photo output errors.|
39| [typedef void (\*OH_PhotoOutput_CaptureEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)](#oh_photooutput_captureend) | OH_PhotoOutput_CaptureEnd | Defines the callback invoked when the capture ends.|
40| [typedef void (\*OH_PhotoOutput_CaptureStartWithInfo)(Camera_PhotoOutput* photoOutput, Camera_CaptureStartInfo* Info)](#oh_photooutput_capturestartwithinfo) | OH_PhotoOutput_CaptureStartWithInfo | Defines the callback invoked when the capture starts.|
41| [typedef void (\*OH_PhotoOutput_OnFrameShutterEnd)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* Info)](#oh_photooutput_onframeshutterend) | OH_PhotoOutput_OnFrameShutterEnd | Defines the callback invoked when frame shutter ends.|
42| [typedef void (\*OH_PhotoOutput_CaptureReady)(Camera_PhotoOutput* photoOutput)](#oh_photooutput_captureready) | OH_PhotoOutput_CaptureReady | Defines the callback invoked when the camera is ready to take photos. When the callback is received, the next capture can be performed.|
43| [typedef void (\*OH_PhotoOutput_EstimatedCaptureDuration)(Camera_PhotoOutput* photoOutput, int64_t duration)](#oh_photooutput_estimatedcaptureduration) | OH_PhotoOutput_EstimatedCaptureDuration | Defines the callback for the estimated capture duration.|
44| [typedef void (\*OH_PhotoOutput_PhotoAvailable)(Camera_PhotoOutput* photoOutput, OH_PhotoNative* photo)](#oh_photooutput_photoavailable) | OH_PhotoOutput_PhotoAvailable | Defines the callback invoked when a high-resolution photo is available.|
45| [typedef void (\*OH_PhotoOutput_PhotoAssetAvailable)(Camera_PhotoOutput* photoOutput, OH_MediaAsset* photoAsset)](#oh_photooutput_photoassetavailable) | OH_PhotoOutput_PhotoAssetAvailable | Defines the callback invoked when a photo asset is available.|
46| [Camera_ErrorCode OH_PhotoOutput_RegisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)](#oh_photooutput_registercallback) | - | Registers a callback to listen for photo output events.|
47| [Camera_ErrorCode OH_PhotoOutput_UnregisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)](#oh_photooutput_unregistercallback) | - | Unregisters the callback used to listen for photo output events.|
48| [Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureStartWithInfo callback)](#oh_photooutput_registercapturestartwithinfocallback) | - | Registers a callback to listen for capture start events.|
49| [Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree,Camera_ImageRotation* imageRotation)](#oh_photooutput_getphotorotation) | - | Obtains the photo rotation angle.|
50| [Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureStartWithInfo callback)](#oh_photooutput_unregistercapturestartwithinfocallback) | - | Unregisters the callback used to listen for capture start events.|
51| [Camera_ErrorCode OH_PhotoOutput_RegisterCaptureEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureEnd callback)](#oh_photooutput_registercaptureendcallback) | - | Registers a callback to listen for capture end events.|
52| [Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureEnd callback)](#oh_photooutput_unregistercaptureendcallback) | - | Unregisters the callback used to listen for capture end events.|
53| [Camera_ErrorCode OH_PhotoOutput_RegisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_OnFrameShutterEnd callback)](#oh_photooutput_registerframeshutterendcallback) | - | Registers a callback to listen for frame shutter end events.|
54| [Camera_ErrorCode OH_PhotoOutput_UnregisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_OnFrameShutterEnd callback)](#oh_photooutput_unregisterframeshutterendcallback) | - | Unregisters the callback used to listen for frame shutter end events.|
55| [Camera_ErrorCode OH_PhotoOutput_RegisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureReady callback)](#oh_photooutput_registercapturereadycallback) | - | Registers a callback to listen for camera ready events. When the callback is received, the next capture can be performed.|
56| [Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureReady callback)](#oh_photooutput_unregistercapturereadycallback) | - | Unregisters the callback used to listen for camera ready events.|
57| [Camera_ErrorCode OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_EstimatedCaptureDuration callback)](#oh_photooutput_registerestimatedcapturedurationcallback) | - | Registers a callback to listen for estimated capture duration events.|
58| [Camera_ErrorCode OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_EstimatedCaptureDuration callback)](#oh_photooutput_unregisterestimatedcapturedurationcallback) | - | Unregisters the callback used to listen for estimated capture duration events.|
59| [Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAvailable callback)](#oh_photooutput_registerphotoavailablecallback) | - | Registers a callback to listen for photo availability events.|
60| [Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAvailable callback)](#oh_photooutput_unregisterphotoavailablecallback) | - | Unregisters the callback used to listen for photo availability events.|
61| [Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAssetAvailable callback)](#oh_photooutput_registerphotoassetavailablecallback) | - | Registers a callback to listen for photo asset availability events.|
62| [Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAssetAvailable callback)](#oh_photooutput_unregisterphotoassetavailablecallback) | - | Unregisters the callback used to listen for photo asset availability events.|
63| [Camera_ErrorCode OH_PhotoOutput_Capture(Camera_PhotoOutput* photoOutput)](#oh_photooutput_capture) | - | Captures a photo.<br>This function must be called in prior to [OH_PreviewOutput_Release](capi-preview-output-h.md#oh_previewoutput_release). Otherwise, photo capture fails.|
64| [Camera_ErrorCode OH_PhotoOutput_Capture_WithCaptureSetting(Camera_PhotoOutput* photoOutput,Camera_PhotoCaptureSetting setting)](#oh_photooutput_capture_withcapturesetting) | - | Captures a photo with photographing parameters.|
65| [Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput)](#oh_photooutput_release) | - | Releases a PhotoOutput instance.|
66| [Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)](#oh_photooutput_ismirrorsupported) | - | Checks whether mirroring is supported.|
67| [Camera_ErrorCode OH_PhotoOutput_EnableMirror(Camera_PhotoOutput* photoOutput, bool enabled)](#oh_photooutput_enablemirror) | - | Enables dynamic photo capture.|
68| [Camera_ErrorCode OH_PhotoOutput_GetActiveProfile(Camera_PhotoOutput* photoOutput, Camera_Profile** profile)](#oh_photooutput_getactiveprofile) | - | Obtains the profile of a PhotoOutput instance.|
69| [Camera_ErrorCode OH_PhotoOutput_DeleteProfile(Camera_Profile* profile)](#oh_photooutput_deleteprofile) | - | Deletes the profile of a PhotoOutput instance.|
70| [Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)](#oh_photooutput_ismovingphotosupported) | - | Checks whether moving photos are supported.|
71| [Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled)](#oh_photooutput_enablemovingphoto) | - | Enables moving photos.|
72
73## Function Description
74
75### OH_PhotoOutput_OnFrameStart()
76
77```
78typedef void (*OH_PhotoOutput_OnFrameStart)(Camera_PhotoOutput* photoOutput)
79```
80
81**Description**
82
83Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report photo output frame start events.
84
85**Since**: 11
86
87
88**Parameters**
89
90| Name| Description|
91| -- | -- |
92| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
93
94### OH_PhotoOutput_OnFrameShutter()
95
96```
97typedef void (*OH_PhotoOutput_OnFrameShutter)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* info)
98```
99
100**Description**
101
102Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report frame shutter events.
103
104**Since**: 11
105
106
107**Parameters**
108
109| Name| Description|
110| -- | -- |
111| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
112| [Camera_FrameShutterInfo](capi-oh-camera-camera-frameshutterinfo.md)* info | Pointer to the frame shutter information.|
113
114### OH_PhotoOutput_OnFrameEnd()
115
116```
117typedef void (*OH_PhotoOutput_OnFrameEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)
118```
119
120**Description**
121
122Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report photo output frame end events.
123
124**Since**: 11
125
126
127**Parameters**
128
129| Name| Description|
130| -- | -- |
131| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
132|  int32_t frameCount | Number of frames to be included in the callback.|
133
134### OH_PhotoOutput_OnError()
135
136```
137typedef void (*OH_PhotoOutput_OnError)(Camera_PhotoOutput* photoOutput, Camera_ErrorCode errorCode)
138```
139
140**Description**
141
142Defines the callback defined in the [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md) struct and used to report photo output errors.
143
144**Since**: 11
145
146
147**Parameters**
148
149| Name| Description|
150| -- | -- |
151| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
152|  [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) errorCode | Error code reported during photo output.|
153
154**See also**
155
156[CAMERA_SERVICE_FATAL_ERROR](capi-camera-h.md#camera_errorcode)
157
158### OH_PhotoOutput_CaptureEnd()
159
160```
161typedef void (*OH_PhotoOutput_CaptureEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)
162```
163
164**Description**
165
166Defines the callback invoked when the capture ends.
167
168**Since**: 12
169
170
171**Parameters**
172
173| Name| Description|
174| -- | -- |
175| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
176|  int32_t frameCount | Number of frames to be included in the callback.|
177
178### OH_PhotoOutput_CaptureStartWithInfo()
179
180```
181typedef void (*OH_PhotoOutput_CaptureStartWithInfo)(Camera_PhotoOutput* photoOutput, Camera_CaptureStartInfo* Info)
182```
183
184**Description**
185
186Defines the callback invoked when the capture starts.
187
188**Since**: 12
189
190
191**Parameters**
192
193| Name| Description|
194| -- | -- |
195| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
196|  [Camera_CaptureStartInfo](capi-oh-camera-camera-capturestartinfo.md)* Info | Pointer to the capture start information passed by the callback.|
197
198### OH_PhotoOutput_OnFrameShutterEnd()
199
200```
201typedef void (*OH_PhotoOutput_OnFrameShutterEnd)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* Info)
202```
203
204**Description**
205
206Defines the callback invoked when frame shutter ends.
207
208**Since**: 12
209
210
211**Parameters**
212
213| Name| Description|
214| -- | -- |
215| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
216| [Camera_FrameShutterInfo](capi-oh-camera-camera-frameshutterinfo.md)* info | Pointer to the frame shutter information.|
217
218### OH_PhotoOutput_CaptureReady()
219
220```
221typedef void (*OH_PhotoOutput_CaptureReady)(Camera_PhotoOutput* photoOutput)
222```
223
224**Description**
225
226Defines the callback invoked when the camera is ready to take photos. When the callback is received, the next capture can be performed.
227
228**Since**: 12
229
230
231**Parameters**
232
233| Name| Description|
234| -- | -- |
235| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
236
237### OH_PhotoOutput_EstimatedCaptureDuration()
238
239```
240typedef void (*OH_PhotoOutput_EstimatedCaptureDuration)(Camera_PhotoOutput* photoOutput, int64_t duration)
241```
242
243**Description**
244
245Defines the callback for the estimated capture duration.
246
247**Since**: 12
248
249
250**Parameters**
251
252| Name| Description|
253| -- | -- |
254| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
255|  int64_t duration | Estimated capture duration passed by the callback.|
256
257### OH_PhotoOutput_PhotoAvailable()
258
259```
260typedef void (*OH_PhotoOutput_PhotoAvailable)(Camera_PhotoOutput* photoOutput, OH_PhotoNative* photo)
261```
262
263**Description**
264
265Defines the callback invoked when a high-resolution photo is available.
266
267**Since**: 12
268
269
270**Parameters**
271
272| Name| Description|
273| -- | -- |
274| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
275|  [OH_PhotoNative](capi-oh-camera-oh-photonative.md)* photo | Pointer to OH_PhotoNative passed by the callback.|
276
277### OH_PhotoOutput_PhotoAssetAvailable()
278
279```
280typedef void (*OH_PhotoOutput_PhotoAssetAvailable)(Camera_PhotoOutput* photoOutput, OH_MediaAsset* photoAsset)
281```
282
283**Description**
284
285Defines the callback invoked when a photo asset is available.
286
287**Since**: 12
288
289
290**Parameters**
291
292| Name| Description|
293| -- | -- |
294| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
295|  [OH_MediaAsset](../apis-media-library-kit/capi-mediaassetmanager-oh-mediaasset.md)* photoAsset | Pointer to the media asset passed by the callback.|
296
297### OH_PhotoOutput_RegisterCallback()
298
299```
300Camera_ErrorCode OH_PhotoOutput_RegisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)
301```
302
303**Description**
304
305Registers a callback to listen for photo output events.
306
307**Since**: 11
308
309
310**Parameters**
311
312| Name| Description|
313| -- | -- |
314| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
315| [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md)* callback | Pointer to the target callback.|
316
317**Returns**
318
319| Type| Description|
320| -- | -- |
321| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
322
323### OH_PhotoOutput_UnregisterCallback()
324
325```
326Camera_ErrorCode OH_PhotoOutput_UnregisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)
327```
328
329**Description**
330
331Unregisters the callback used to listen for photo output events.
332
333**Since**: 11
334
335
336**Parameters**
337
338| Name| Description|
339| -- | -- |
340| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
341| [PhotoOutput_Callbacks](capi-oh-camera-photooutput-callbacks.md)* callback | Pointer to the target callback.|
342
343**Returns**
344
345| Type| Description|
346| -- | -- |
347| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
348
349### OH_PhotoOutput_RegisterCaptureStartWithInfoCallback()
350
351```
352Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureStartWithInfo callback)
353```
354
355**Description**
356
357Registers a callback to listen for capture start events.
358
359**Since**: 12
360
361
362**Parameters**
363
364| Name| Description|
365| -- | -- |
366| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
367| [OH_PhotoOutput_CaptureStartWithInfo](#oh_photooutput_capturestartwithinfo) callback | Target callback.|
368
369**Returns**
370
371| Type| Description|
372| -- | -- |
373| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
374
375### OH_PhotoOutput_GetPhotoRotation()
376
377```
378Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree,Camera_ImageRotation* imageRotation)
379```
380
381**Description**
382
383Obtains the photo rotation angle.
384
385**Since**: 12
386
387
388**Parameters**
389
390| Name| Description|
391| -- | -- |
392| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance used to obtain the rotation angle.|
393| int deviceDegree | Rotation angle of the device.|
394| [Camera_ImageRotation](capi-camera-h.md#camera_imagerotation)* imageRotation | Pointer to the rotation angle of the photo.|
395
396**Returns**
397
398| Type| Description|
399| -- | -- |
400| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
401
402### OH_PhotoOutput_UnregisterCaptureStartWithInfoCallback()
403
404```
405Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureStartWithInfo callback)
406```
407
408**Description**
409
410Unregisters the callback used to listen for capture start events.
411
412**Since**: 12
413
414
415**Parameters**
416
417| Name| Description|
418| -- | -- |
419| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
420| [OH_PhotoOutput_CaptureStartWithInfo](#oh_photooutput_capturestartwithinfo) callback | Target callback.|
421
422**Returns**
423
424| Type| Description|
425| -- | -- |
426| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
427
428### OH_PhotoOutput_RegisterCaptureEndCallback()
429
430```
431Camera_ErrorCode OH_PhotoOutput_RegisterCaptureEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureEnd callback)
432```
433
434**Description**
435
436Registers a callback to listen for capture end events.
437
438**Since**: 12
439
440
441**Parameters**
442
443| Name| Description|
444| -- | -- |
445| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
446| [OH_PhotoOutput_CaptureEnd](#oh_photooutput_captureend) callback | Target callback.|
447
448**Returns**
449
450| Type| Description|
451| -- | -- |
452| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
453
454### OH_PhotoOutput_UnregisterCaptureEndCallback()
455
456```
457Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureEnd callback)
458```
459
460**Description**
461
462Unregisters the callback used to listen for capture end events.
463
464**Since**: 12
465
466
467**Parameters**
468
469| Name| Description|
470| -- | -- |
471| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
472| [OH_PhotoOutput_CaptureEnd](#oh_photooutput_captureend) callback | Target callback.|
473
474**Returns**
475
476| Type| Description|
477| -- | -- |
478| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
479
480### OH_PhotoOutput_RegisterFrameShutterEndCallback()
481
482```
483Camera_ErrorCode OH_PhotoOutput_RegisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_OnFrameShutterEnd callback)
484```
485
486**Description**
487
488Registers a callback to listen for frame shutter end events.
489
490**Since**: 12
491
492
493**Parameters**
494
495| Name| Description|
496| -- | -- |
497| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
498| [OH_PhotoOutput_OnFrameShutterEnd](#oh_photooutput_onframeshutterend) callback | Target callback.|
499
500**Returns**
501
502| Type| Description|
503| -- | -- |
504| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
505
506### OH_PhotoOutput_UnregisterFrameShutterEndCallback()
507
508```
509Camera_ErrorCode OH_PhotoOutput_UnregisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_OnFrameShutterEnd callback)
510```
511
512**Description**
513
514Unregisters the callback used to listen for frame shutter end events.
515
516**Since**: 12
517
518
519**Parameters**
520
521| Name| Description|
522| -- | -- |
523| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
524| [OH_PhotoOutput_OnFrameShutterEnd](#oh_photooutput_onframeshutterend) callback | Target callback.|
525
526**Returns**
527
528| Type| Description|
529| -- | -- |
530| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
531
532### OH_PhotoOutput_RegisterCaptureReadyCallback()
533
534```
535Camera_ErrorCode OH_PhotoOutput_RegisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureReady callback)
536```
537
538**Description**
539
540Registers a callback to listen for camera ready events. When the callback is received, the next capture can be performed.
541
542**Since**: 12
543
544
545**Parameters**
546
547| Name| Description|
548| -- | -- |
549| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
550| [OH_PhotoOutput_CaptureReady](#oh_photooutput_captureready) callback | Target callback.|
551
552**Returns**
553
554| Type| Description|
555| -- | -- |
556| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
557
558### OH_PhotoOutput_UnregisterCaptureReadyCallback()
559
560```
561Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_CaptureReady callback)
562```
563
564**Description**
565
566Unregisters the callback used to listen for camera ready events.
567
568**Since**: 12
569
570
571**Parameters**
572
573| Name| Description|
574| -- | -- |
575| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
576| [OH_PhotoOutput_CaptureReady](#oh_photooutput_captureready) callback | Target callback.|
577
578**Returns**
579
580| Type| Description|
581| -- | -- |
582| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
583
584### OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback()
585
586```
587Camera_ErrorCode OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_EstimatedCaptureDuration callback)
588```
589
590**Description**
591
592Registers a callback to listen for estimated capture duration events.
593
594**Since**: 12
595
596
597**Parameters**
598
599| Name| Description|
600| -- | -- |
601| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
602| [OH_PhotoOutput_EstimatedCaptureDuration](#oh_photooutput_estimatedcaptureduration) callback | Target callback.|
603
604**Returns**
605
606| Type| Description|
607| -- | -- |
608| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
609
610### OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback()
611
612```
613Camera_ErrorCode OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_EstimatedCaptureDuration callback)
614```
615
616**Description**
617
618Unregisters the callback used to listen for estimated capture duration events.
619
620**Since**: 12
621
622
623**Parameters**
624
625| Name| Description|
626| -- | -- |
627| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
628| [OH_PhotoOutput_EstimatedCaptureDuration](#oh_photooutput_estimatedcaptureduration) callback | Target callback.|
629
630**Returns**
631
632| Type| Description|
633| -- | -- |
634| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
635
636### OH_PhotoOutput_RegisterPhotoAvailableCallback()
637
638```
639Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAvailable callback)
640```
641
642**Description**
643
644Registers a callback to listen for photo availability events.
645
646**Since**: 12
647
648
649**Parameters**
650
651| Name| Description|
652| -- | -- |
653| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
654| [OH_PhotoOutput_PhotoAvailable](#oh_photooutput_photoavailable) callback | Target callback.|
655
656**Returns**
657
658| Type| Description|
659| -- | -- |
660| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
661
662### OH_PhotoOutput_UnregisterPhotoAvailableCallback()
663
664```
665Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAvailable callback)
666```
667
668**Description**
669
670Unregisters the callback used to listen for photo availability events.
671
672**Since**: 12
673
674
675**Parameters**
676
677| Name| Description|
678| -- | -- |
679| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
680| [OH_PhotoOutput_PhotoAvailable](#oh_photooutput_photoavailable) callback | Target callback.|
681
682**Returns**
683
684| Type| Description|
685| -- | -- |
686| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
687
688### OH_PhotoOutput_RegisterPhotoAssetAvailableCallback()
689
690```
691Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAssetAvailable callback)
692```
693
694**Description**
695
696Registers a callback to listen for photo asset availability events.
697
698**Since**: 12
699
700
701**Parameters**
702
703| Name| Description|
704| -- | -- |
705| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
706| [OH_PhotoOutput_PhotoAssetAvailable](#oh_photooutput_photoassetavailable) callback | Target callback.|
707
708**Returns**
709
710| Type| Description|
711| -- | -- |
712| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
713
714### OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback()
715
716```
717Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput,OH_PhotoOutput_PhotoAssetAvailable callback)
718```
719
720**Description**
721
722Unregisters the callback used to listen for photo asset availability events.
723
724**Since**: 12
725
726
727**Parameters**
728
729| Name| Description|
730| -- | -- |
731| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance that transfers the callback.|
732| [OH_PhotoOutput_PhotoAssetAvailable](#oh_photooutput_photoassetavailable) callback | Target callback.|
733
734**Returns**
735
736| Type| Description|
737| -- | -- |
738| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
739
740### OH_PhotoOutput_Capture()
741
742```
743Camera_ErrorCode OH_PhotoOutput_Capture(Camera_PhotoOutput* photoOutput)
744```
745
746**Description**
747
748Captures a photo.
749
750This function must be called in prior to [OH_PreviewOutput_Release](capi-preview-output-h.md#oh_previewoutput_release). Otherwise, photo capture fails.
751
752**Since**: 11
753
754
755**Parameters**
756
757| Name| Description|
758| -- | -- |
759| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance used for capturing the photo.|
760
761**Returns**
762
763| Type| Description|
764| -- | -- |
765| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_RUNNING**: The capture session is not running.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
766
767### OH_PhotoOutput_Capture_WithCaptureSetting()
768
769```
770Camera_ErrorCode OH_PhotoOutput_Capture_WithCaptureSetting(Camera_PhotoOutput* photoOutput,Camera_PhotoCaptureSetting setting)
771```
772
773**Description**
774
775Captures a photo with photographing parameters.
776
777**Since**: 11
778
779
780**Parameters**
781
782| Name| Description|
783| -- | -- |
784| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance used for capturing the photo.|
785| [Camera_PhotoCaptureSetting](capi-oh-camera-camera-photocapturesetting.md) setting | Photographing parameters, which are defined in the [Camera_PhotoCaptureSetting](capi-oh-camera-camera-photocapturesetting.md) struct.|
786
787**Returns**
788
789| Type| Description|
790| -- | -- |
791| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_RUNNING**: The capture session is not running.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
792
793### OH_PhotoOutput_Release()
794
795```
796Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput)
797```
798
799**Description**
800
801Releases a PhotoOutput instance.
802
803**Since**: 11
804
805
806**Parameters**
807
808| Name| Description|
809| -- | -- |
810| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance to release.|
811
812**Returns**
813
814| Type| Description|
815| -- | -- |
816| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
817
818### OH_PhotoOutput_IsMirrorSupported()
819
820```
821Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)
822```
823
824**Description**
825
826Checks whether mirroring is supported.
827
828**Since**: 11
829
830
831**Parameters**
832
833| Name| Description|
834| -- | -- |
835| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance to check.|
836| bool* isSupported | Pointer to the result that specifies whether mirroring is supported.|
837
838**Returns**
839
840| Type| Description|
841| -- | -- |
842| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
843
844### OH_PhotoOutput_EnableMirror()
845
846```
847Camera_ErrorCode OH_PhotoOutput_EnableMirror(Camera_PhotoOutput* photoOutput, bool enabled)
848```
849
850**Description**
851
852Enables dynamic photo capture.
853
854**Since**: 13
855
856
857**Parameters**
858
859| Name| Description|
860| -- | -- |
861| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance used to enable dynamic photo capture.|
862| bool enabled | Whether to enable or disable dynamic photo capture. **true** to enable, **false** otherwise.|
863
864**Returns**
865
866| Type| Description|
867| -- | -- |
868| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
869
870### OH_PhotoOutput_GetActiveProfile()
871
872```
873Camera_ErrorCode OH_PhotoOutput_GetActiveProfile(Camera_PhotoOutput* photoOutput, Camera_Profile** profile)
874```
875
876**Description**
877
878Obtains the profile of a PhotoOutput instance.
879
880**Since**: 12
881
882
883**Parameters**
884
885| Name| Description|
886| -- | -- |
887| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance for which the profile is to be obtained.|
888| [Camera_Profile](capi-oh-camera-camera-profile.md)** profile | Double pointer to the photo output profile obtained.|
889
890**Returns**
891
892| Type| Description|
893| -- | -- |
894| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
895
896### OH_PhotoOutput_DeleteProfile()
897
898```
899Camera_ErrorCode OH_PhotoOutput_DeleteProfile(Camera_Profile* profile)
900```
901
902**Description**
903
904Deletes the profile of a PhotoOutput instance.
905
906**Since**: 12
907
908
909**Parameters**
910
911| Name| Description|
912| -- | -- |
913| [Camera_Profile](capi-oh-camera-camera-profile.md)* profile | Pointer to the PhotoOutput instance for which the profile is to be deleted.|
914
915**Returns**
916
917| Type| Description|
918| -- | -- |
919| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.|
920
921### OH_PhotoOutput_IsMovingPhotoSupported()
922
923```
924Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)
925```
926
927**Description**
928
929Checks whether moving photos are supported.
930
931**Since**: 12
932
933
934**Parameters**
935
936| Name| Description|
937| -- | -- |
938| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance to check.|
939| bool* isSupported | Pointer to the result indicating whether moving photos are supported.|
940
941**Returns**
942
943| Type| Description|
944| -- | -- |
945| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
946
947### OH_PhotoOutput_EnableMovingPhoto()
948
949```
950Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled)
951```
952
953**Description**
954
955Enables moving photos.
956
957**Required permissions**: ohos.permission.MICROPHONE
958
959**Since**: 12
960
961
962**Parameters**
963
964| Name| Description|
965| -- | -- |
966| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance used to enable moving photos.|
967| bool enabled | Whether to enable or disable moving photos.|
968
969**Returns**
970
971| Type| Description|
972| -- | -- |
973| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
974