• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# capture_session.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 capture session concepts.
11
12**File to include**: <ohcamera/capture_session.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| [CaptureSession_Callbacks](capi-oh-camera-capturesession-callbacks.md) | CaptureSession_Callbacks | Describes the callbacks used for a capture session.|
29| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md) | Camera_CaptureSession | Describes the capture session object.<br>You can use [OH_CameraManager_CreateCaptureSession](capi-camera-manager-h.md#oh_cameramanager_createcapturesession) to create such an object. |
30
31### Functions
32
33| Name| typedef Keyword| Description|
34| -- | -- | -- |
35| [typedef void (\*OH_CaptureSession_OnFocusStateChange)(Camera_CaptureSession* session, Camera_FocusState focusState)](#oh_capturesession_onfocusstatechange) | OH_CaptureSession_OnFocusStateChange | Defines the callback defined in the [CaptureSession_Callbacks](capi-oh-camera-capturesession-callbacks.md) struct and used to report focus status changes of a capture session.|
36| [typedef void (\*OH_CaptureSession_OnError)(Camera_CaptureSession* session, Camera_ErrorCode errorCode)](#oh_capturesession_onerror) | OH_CaptureSession_OnError | Defines the callback defined in the [CaptureSession_Callbacks](capi-oh-camera-capturesession-callbacks.md) struct and used to report capture session errors.|
37| [typedef void (\*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* session,Camera_SmoothZoomInfo* smoothZoomInfo)](#oh_capturesession_onsmoothzoominfo) | OH_CaptureSession_OnSmoothZoomInfo | Defines the callback invoked when smooth zoom is triggered for a capture session.|
38| [typedef void (\*OH_CaptureSession_OnAutoDeviceSwitchStatusChange)(Camera_CaptureSession* session,Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo)](#oh_capturesession_onautodeviceswitchstatuschange) | OH_CaptureSession_OnAutoDeviceSwitchStatusChange | Defines the callback used to listen for device switching events.|
39| [typedef void (\*OH_CaptureSession_OnSystemPressureLevelChange)(Camera_CaptureSession* session,Camera_SystemPressureLevel* systemPressureLevel)](#oh_capturesession_onsystempressurelevelchange) | OH_CaptureSession_OnSystemPressureLevelChange | Defines the callback used to listen for capture system pressure level changes.|
40| [typedef void (\*OH_CaptureSession_OnControlCenterEffectStatusChange)(Camera_CaptureSession* session,Camera_ControlCenterStatusInfo* controlCenterStatusInfo)](#oh_capturesession_oncontrolcentereffectstatuschange) | OH_CaptureSession_OnControlCenterEffectStatusChange | Defines the callback used to listen for effect status changes of a camera controller.|
41| [Camera_ErrorCode OH_CaptureSession_RegisterCallback(Camera_CaptureSession* session,CaptureSession_Callbacks* callback)](#oh_capturesession_registercallback) | - | Registers a callback to listen for capture session events.|
42| [Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* session,CaptureSession_Callbacks* callback)](#oh_capturesession_unregistercallback) | - | Unregisters the callback used to listen for capture session events.|
43| [Camera_ErrorCode OH_CaptureSession_RegisterSmoothZoomInfoCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)](#oh_capturesession_registersmoothzoominfocallback) | - | Registers a callback to listen for smooth zoom events.|
44| [Camera_ErrorCode OH_CaptureSession_UnregisterSmoothZoomInfoCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)](#oh_capturesession_unregistersmoothzoominfocallback) | - | Unregisters the callback used to listen for smooth zoom events.|
45| [Camera_ErrorCode OH_CaptureSession_SetSessionMode(Camera_CaptureSession* session, Camera_SceneMode sceneMode)](#oh_capturesession_setsessionmode) | - | Sets a session mode.<br>This function cannot be called after [OH_CaptureSession_BeginConfig](#oh_capturesession_beginconfig).<br>You are advised to call this function immediately after [OH_CameraManager_CreateCaptureSession](capi-camera-manager-h.md#oh_cameramanager_createcapturesession).|
46| [Camera_ErrorCode OH_CaptureSession_AddSecureOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)](#oh_capturesession_addsecureoutput) | - | Marks a preview output stream as secure output.|
47| [Camera_ErrorCode OH_CaptureSession_BeginConfig(Camera_CaptureSession* session)](#oh_capturesession_beginconfig) | - | Starts the configuration for a capture session.|
48| [Camera_ErrorCode OH_CaptureSession_CommitConfig(Camera_CaptureSession* session)](#oh_capturesession_commitconfig) | - | Commits the configuration for a capture session.|
49| [Camera_ErrorCode OH_CaptureSession_AddInput(Camera_CaptureSession* session, Camera_Input* cameraInput)](#oh_capturesession_addinput) | - | Adds a Camera_Input instance to a session.|
50| [Camera_ErrorCode OH_CaptureSession_RemoveInput(Camera_CaptureSession* session, Camera_Input* cameraInput)](#oh_capturesession_removeinput) | - | Removes a Camera_Input instance from a session.|
51| [Camera_ErrorCode OH_CaptureSession_AddPreviewOutput(Camera_CaptureSession* session,Camera_PreviewOutput* previewOutput)](#oh_capturesession_addpreviewoutput) | - | Adds a PreviewOutput instance to a session.|
52| [Camera_ErrorCode OH_CaptureSession_RemovePreviewOutput(Camera_CaptureSession* session,Camera_PreviewOutput* previewOutput)](#oh_capturesession_removepreviewoutput) | - | Removes a PreviewOutput instance from a session.|
53| [Camera_ErrorCode OH_CaptureSession_AddPhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)](#oh_capturesession_addphotooutput) | - | Adds a PhotoOutput instance to a session.|
54| [Camera_ErrorCode OH_CaptureSession_RemovePhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)](#oh_capturesession_removephotooutput) | - | Removes a PhotoOutput instance from a session.|
55| [Camera_ErrorCode OH_CaptureSession_AddVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)](#oh_capturesession_addvideooutput) | - | Adds a VideoOutput instance to a session.|
56| [Camera_ErrorCode OH_CaptureSession_RemoveVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)](#oh_capturesession_removevideooutput) | - | Removes a VideoOutput instance from a session.|
57| [Camera_ErrorCode OH_CaptureSession_AddMetadataOutput(Camera_CaptureSession* session,Camera_MetadataOutput* metadataOutput)](#oh_capturesession_addmetadataoutput) | - | Adds a MetadataOutput instance to a session.|
58| [Camera_ErrorCode OH_CaptureSession_RemoveMetadataOutput(Camera_CaptureSession* session,Camera_MetadataOutput* metadataOutput)](#oh_capturesession_removemetadataoutput) | - | Removes a MetadataOutput instance from a session.|
59| [Camera_ErrorCode OH_CaptureSession_Start(Camera_CaptureSession* session)](#oh_capturesession_start) | - | Starts a capture session.|
60| [Camera_ErrorCode OH_CaptureSession_Stop(Camera_CaptureSession* session)](#oh_capturesession_stop) | - | Stops a capture session.|
61| [Camera_ErrorCode OH_CaptureSession_Release(Camera_CaptureSession* session)](#oh_capturesession_release) | - | Releases a CaptureSession instance.|
62| [Camera_ErrorCode OH_CaptureSession_HasFlash(Camera_CaptureSession* session, bool* hasFlash)](#oh_capturesession_hasflash) | - | Checks whether the device has flash.|
63| [Camera_ErrorCode OH_CaptureSession_IsFlashModeSupported(Camera_CaptureSession* session,Camera_FlashMode flashMode, bool* isSupported)](#oh_capturesession_isflashmodesupported) | - | Checks whether a flash mode is supported.|
64| [Camera_ErrorCode OH_CaptureSession_GetFlashMode(Camera_CaptureSession* session, Camera_FlashMode* flashMode)](#oh_capturesession_getflashmode) | - | Obtains the flash mode in use.|
65| [Camera_ErrorCode OH_CaptureSession_SetFlashMode(Camera_CaptureSession* session, Camera_FlashMode flashMode)](#oh_capturesession_setflashmode) | - | Sets a flash mode for the device.|
66| [Camera_ErrorCode OH_CaptureSession_IsExposureModeSupported(Camera_CaptureSession* session,Camera_ExposureMode exposureMode, bool* isSupported)](#oh_capturesession_isexposuremodesupported) | - | Checks whether an exposure mode is supported.|
67| [Camera_ErrorCode OH_CaptureSession_GetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode* exposureMode)](#oh_capturesession_getexposuremode) | - | Obtains the exposure mode in use.|
68| [Camera_ErrorCode OH_CaptureSession_SetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode exposureMode)](#oh_capturesession_setexposuremode) | - | Sets an exposure mode for the device.|
69| [Camera_ErrorCode OH_CaptureSession_GetMeteringPoint(Camera_CaptureSession* session, Camera_Point* point)](#oh_capturesession_getmeteringpoint) | - | Obtains the metering point in use.|
70| [Camera_ErrorCode OH_CaptureSession_SetMeteringPoint(Camera_CaptureSession* session, Camera_Point point)](#oh_capturesession_setmeteringpoint) | - | Sets the metering point, which is the center point of the metering rectangle.|
71| [Camera_ErrorCode OH_CaptureSession_GetExposureBiasRange(Camera_CaptureSession* session, float* minExposureBias,float* maxExposureBias, float* step)](#oh_capturesession_getexposurebiasrange) | - | Obtains the exposure compensation values of the device.|
72| [Camera_ErrorCode OH_CaptureSession_SetExposureBias(Camera_CaptureSession* session, float exposureBias)](#oh_capturesession_setexposurebias) | - | Sets an exposure compensation value for the device.|
73| [Camera_ErrorCode OH_CaptureSession_GetExposureBias(Camera_CaptureSession* session, float* exposureBias)](#oh_capturesession_getexposurebias) | - | Obtains the exposure compensation value in use.|
74| [Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported(Camera_CaptureSession* session,Camera_FocusMode focusMode, bool* isSupported)](#oh_capturesession_isfocusmodesupported) | - | Checks whether a focus mode is supported.|
75| [Camera_ErrorCode OH_CaptureSession_GetFocusMode(Camera_CaptureSession* session, Camera_FocusMode* focusMode)](#oh_capturesession_getfocusmode) | - | Obtains the focus mode in use.|
76| [Camera_ErrorCode OH_CaptureSession_SetFocusMode(Camera_CaptureSession* session, Camera_FocusMode focusMode)](#oh_capturesession_setfocusmode) | - | Sets a focus mode for the device.|
77| [Camera_ErrorCode OH_CaptureSession_GetFocusPoint(Camera_CaptureSession* session, Camera_Point* focusPoint)](#oh_capturesession_getfocuspoint) | - | Obtains the focal point in use.|
78| [Camera_ErrorCode OH_CaptureSession_SetFocusPoint(Camera_CaptureSession* session, Camera_Point focusPoint)](#oh_capturesession_setfocuspoint) | - | Sets a focal point for the device.|
79| [Camera_ErrorCode OH_CaptureSession_GetZoomRatioRange(Camera_CaptureSession* session, float* minZoom, float* maxZoom)](#oh_capturesession_getzoomratiorange) | - | Obtains the supported zoom ratio range.|
80| [Camera_ErrorCode OH_CaptureSession_GetZoomRatio(Camera_CaptureSession* session, float* zoom)](#oh_capturesession_getzoomratio) | - | Obtains the zoom ratio in use.|
81| [Camera_ErrorCode OH_CaptureSession_SetZoomRatio(Camera_CaptureSession* session, float zoom)](#oh_capturesession_setzoomratio) | - | Sets a zoom ratio for the device.|
82| [Camera_ErrorCode OH_CaptureSession_IsVideoStabilizationModeSupported(Camera_CaptureSession* session,Camera_VideoStabilizationMode mode, bool* isSupported)](#oh_capturesession_isvideostabilizationmodesupported) | - | Checks whether a video stabilization mode is supported. |
83| [Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode(Camera_CaptureSession* session,Camera_VideoStabilizationMode* mode)](#oh_capturesession_getvideostabilizationmode) | - | Obtains the video stabilization mode in use.|
84| [Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode(Camera_CaptureSession* session,Camera_VideoStabilizationMode mode)](#oh_capturesession_setvideostabilizationmode) | - | Sets a video stabilization mode for the device.|
85| [Camera_ErrorCode OH_CaptureSession_CanAddInput(Camera_CaptureSession* session,Camera_Input* cameraInput, bool* isSuccessful)](#oh_capturesession_canaddinput) | - | Checks whether a Camera_Input instance can be added to a session.|
86| [Camera_ErrorCode OH_CaptureSession_CanAddPreviewOutput(Camera_CaptureSession* session,Camera_PreviewOutput* cameraOutput, bool* isSuccessful)](#oh_capturesession_canaddpreviewoutput) | - | Checks whether a PreviewOutput instance can be added to a session.|
87| [Camera_ErrorCode OH_CaptureSession_CanAddPhotoOutput(Camera_CaptureSession* session,Camera_PhotoOutput* cameraOutput, bool* isSuccessful)](#oh_capturesession_canaddphotooutput) | - | Checks whether a PhotoOutput instance can be added to a session.|
88| [Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput(Camera_CaptureSession* session,Camera_VideoOutput* cameraOutput, bool* isSuccessful)](#oh_capturesession_canaddvideooutput) | - | Checks whether a VideoOutput instance can be added to a session.|
89| [Camera_ErrorCode OH_CaptureSession_CanPreconfig(Camera_CaptureSession* session,Camera_PreconfigType preconfigType, bool* canPreconfig)](#oh_capturesession_canpreconfig) | - | Checks whether a preconfigured resolution type is supported.|
90| [Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio(Camera_CaptureSession* session,Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, bool* canPreconfig)](#oh_capturesession_canpreconfigwithratio) | - | Checks whether a preconfigured resolution type with an aspect ratio is supported.|
91| [Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session,Camera_PreconfigType preconfigType)](#oh_capturesession_preconfig) | - | Sets a preconfigured resolution type.|
92| [Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio(Camera_CaptureSession* session,Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio)](#oh_capturesession_preconfigwithratio) | - | Sets a preconfigured resolution type with an aspect ratio.|
93| [Camera_ErrorCode OH_CaptureSession_GetExposureValue(Camera_CaptureSession* session, float* exposureValue)](#oh_capturesession_getexposurevalue) | - | Obtains the exposure value.|
94| [Camera_ErrorCode OH_CaptureSession_GetFocalLength(Camera_CaptureSession* session, float* focalLength)](#oh_capturesession_getfocallength) | - | Obtains the current focal length.|
95| [Camera_ErrorCode OH_CaptureSession_SetSmoothZoom(Camera_CaptureSession* session,float targetZoom, Camera_SmoothZoomMode smoothZoomMode)](#oh_capturesession_setsmoothzoom) | - | Sets smooth zoom.|
96| [Camera_ErrorCode OH_CaptureSession_GetSupportedColorSpaces(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace** colorSpace, uint32_t* size)](#oh_capturesession_getsupportedcolorspaces) | - | Obtains the supported color spaces.|
97| [Camera_ErrorCode OH_CaptureSession_DeleteColorSpaces(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace* colorSpace)](#oh_capturesession_deletecolorspaces) | - | Deletes color spaces.|
98| [Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace* colorSpace)](#oh_capturesession_getactivecolorspace) | - | Obtains the active color space.|
99| [Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace colorSpace)](#oh_capturesession_setactivecolorspace) | - | Sets the active color space.|
100| [Camera_ErrorCode OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session,OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)](#oh_capturesession_registerautodeviceswitchstatuscallback) | - | Registers a callback to listen for device switching changes.|
101| [Camera_ErrorCode OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session,OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)](#oh_capturesession_unregisterautodeviceswitchstatuscallback) | - | Unregisters the callback used to listen for device switching changes.|
102| [Camera_ErrorCode OH_CaptureSession_IsAutoDeviceSwitchSupported(Camera_CaptureSession* session, bool* isSupported)](#oh_capturesession_isautodeviceswitchsupported) | - | Checks whether automatic device switching is supported.|
103| [Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* session, bool enabled)](#oh_capturesession_enableautodeviceswitch) | - | Enables or disables automatic device switching.|
104| [Camera_ErrorCode OH_CaptureSession_RegisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)](#oh_capturesession_registersystempressurelevelchangecallback) | - | Registers a callback to listen for capture system pressure level changes.|
105| [Camera_ErrorCode OH_CaptureSession_UnregisterSystemPressureLevelCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)](#oh_capturesession_unregistersystempressurelevelcallback) | - | Unregisters the callback used to listen for capture system pressure level changes.|
106| [Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization(Camera_CaptureSession* session, Camera_QualityPrioritization qualityPrioritization)](#oh_capturesession_setqualityprioritization) | - | Sets the priority level for video recording quality.<br>The default value is **HIGH_QUALITY**. Switching to **POWER_BALANCE** will compromise video recording quality to achieve lower power usage. The extent of power conservation achieved varies depending on the platform.|
107| [Camera_ErrorCode OH_CaptureSession_IsMacroSupported(Camera_CaptureSession* session, bool* isSupported)](#oh_capturesession_ismacrosupported) | - | Checks whether macro photography is supported.|
108| [Camera_ErrorCode OH_CaptureSession_EnableMacro(Camera_CaptureSession* session, bool enabled)](#oh_capturesession_enablemacro) | - | Enables or disables macro photography for the camera device.|
109| [Camera_ErrorCode OH_CaptureSession_SetWhiteBalance(Camera_CaptureSession* session, int32_t colorTemperature)](#oh_capturesession_setwhitebalance) | - | Sets the white balance color temperature.<br>Before the setting, you are advised to call [OH_CaptureSession_GetWhiteBalanceRange](#oh_capturesession_getwhitebalancerange) to obtain the supported white balance color temperature range.|
110| [Camera_ErrorCode OH_CaptureSession_GetWhiteBalance(Camera_CaptureSession* session, int32_t *colorTemperature)](#oh_capturesession_getwhitebalance) | - | Obtains the white balance color temperature.|
111| [Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode* whiteBalanceMode)](#oh_capturesession_getwhitebalancemode) | - | Obtains the white balance mode in use.|
112| [Camera_ErrorCode OH_CaptureSession_IsWhiteBalanceModeSupported(Camera_CaptureSession* session,Camera_WhiteBalanceMode whiteBalanceMode, bool* isSupported)](#oh_capturesession_iswhitebalancemodesupported) | - | Checks whether the specified white balance mode is supported.|
113| [Camera_ErrorCode OH_CaptureSession_SetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode whiteBalanceMode)](#oh_capturesession_setwhitebalancemode) | - | Sets a white balance mode.|
114| [Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceRange(Camera_CaptureSession* session, int32_t *minColorTemperature, int32_t *maxColorTemperature)](#oh_capturesession_getwhitebalancerange) | - | Obtains the supported white balance color temperature range.|
115| [Camera_ErrorCode OH_CaptureSession_IsControlCenterSupported(Camera_CaptureSession* session, bool* isSupported)](#oh_capturesession_iscontrolcentersupported) | - | Checks whether the camera controller is supported.|
116| [Camera_ErrorCode OH_CaptureSession_GetSupportedEffectType(Camera_CaptureSession* session,Camera_ControlCenterEffectType** types, uint32_t* size)](#oh_capturesession_getsupportedeffecttype) | - | Obtains the effect types supported by the camera controller.|
117| [Camera_ErrorCode OH_CaptureSession_DeleteSupportedEffectType(Camera_CaptureSession* session,Camera_ControlCenterEffectType* types, uint32_t size)](#oh_capturesession_deletesupportedeffecttype) | - | Deletes the effect types supported by the camera controller.|
118| [Camera_ErrorCode OH_CaptureSession_EnableControlCenter(Camera_CaptureSession* session, bool enabled)](#oh_capturesession_enablecontrolcenter) | - | Enables or disables the camera controller.|
119| [Camera_ErrorCode OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session,OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)](#oh_capturesession_registercontrolcentereffectstatuschangecallback) | - | Registers a callback to listen for effect status changes of a camera controller.|
120| [Camera_ErrorCode OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session,OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)](#oh_capturesession_unregistercontrolcentereffectstatuschangecallback) | - | Unregisters the callback used to listen for effect status changes of a camera controller.|
121
122## Function Description
123
124### OH_CaptureSession_OnFocusStateChange()
125
126```
127typedef void (*OH_CaptureSession_OnFocusStateChange)(Camera_CaptureSession* session, Camera_FocusState focusState)
128```
129
130**Description**
131
132Defines the callback defined in the [CaptureSession_Callbacks](capi-oh-camera-capturesession-callbacks.md) struct and used to report focus status changes of a capture session.
133
134**Since**: 11
135
136
137**Parameters**
138
139| Name| Description|
140| -- | -- |
141| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
142| [Camera_FocusState](capi-camera-h.md#camera_focusstate) focusState | Focus status.|
143
144### OH_CaptureSession_OnError()
145
146```
147typedef void (*OH_CaptureSession_OnError)(Camera_CaptureSession* session, Camera_ErrorCode errorCode)
148```
149
150**Description**
151
152Defines the callback defined in the [CaptureSession_Callbacks](capi-oh-camera-capturesession-callbacks.md) struct and used to report capture session errors.
153
154**Since**: 11
155
156
157**Parameters**
158
159| Name| Description|
160| -- | -- |
161| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
162| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) errorCode | Error code reported in a capture session.|
163
164**See also**
165
166[CAMERA_SERVICE_FATAL_ERROR](capi-camera-h.md#camera_errorcode)
167
168
169### OH_CaptureSession_OnSmoothZoomInfo()
170
171```
172typedef void (*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* session,Camera_SmoothZoomInfo* smoothZoomInfo)
173```
174
175**Description**
176
177Defines the callback invoked when smooth zoom is triggered for a capture session.
178
179**Since**: 12
180
181
182**Parameters**
183
184| Name| Description|
185| -- | -- |
186| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
187| [Camera_SmoothZoomInfo](capi-oh-camera-camera-smoothzoominfo.md)* smoothZoomInfo | Pointer to the smooth zoom information passed by the callback.|
188
189### OH_CaptureSession_OnAutoDeviceSwitchStatusChange()
190
191```
192typedef void (*OH_CaptureSession_OnAutoDeviceSwitchStatusChange)(Camera_CaptureSession* session,Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo)
193```
194
195**Description**
196
197Defines the callback used to listen for device switching events.
198
199**Since**: 13
200
201
202**Parameters**
203
204| Name| Description|
205| -- | -- |
206| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
207| [Camera_AutoDeviceSwitchStatusInfo](capi-oh-camera-camera-autodeviceswitchstatusinfo.md)* autoDeviceSwitchStatusInfo | Pointer to the device switching information passed by the callback.|
208
209### OH_CaptureSession_OnSystemPressureLevelChange()
210
211```
212typedef void (*OH_CaptureSession_OnSystemPressureLevelChange)(Camera_CaptureSession* session,Camera_SystemPressureLevel* systemPressureLevel)
213```
214
215**Description**
216
217Defines the callback used to listen for capture system pressure level changes.
218
219**Since**: 20
220
221
222**Parameters**
223
224| Name| Description|
225| -- | -- |
226| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
227| [Camera_SystemPressureLevel](capi-camera-h.md#camera_systempressurelevel)* systemPressureLevel | Pointer to the system pressure level passed by the callback.|
228
229### OH_CaptureSession_OnControlCenterEffectStatusChange()
230
231```
232typedef void (*OH_CaptureSession_OnControlCenterEffectStatusChange)(Camera_CaptureSession* session,Camera_ControlCenterStatusInfo* controlCenterStatusInfo)
233```
234
235**Description**
236
237Defines the callback used to listen for effect status changes of a camera controller.
238
239**Since**: 20
240
241
242**Parameters**
243
244| Name| Description|
245| -- | -- |
246| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
247| [Camera_ControlCenterStatusInfo](capi-oh-camera-camera-controlcenterstatusinfo.md)* controlCenterStatusInfo | Pointer to the effect status information passed by the callback.|
248
249### OH_CaptureSession_RegisterCallback()
250
251```
252Camera_ErrorCode OH_CaptureSession_RegisterCallback(Camera_CaptureSession* session,CaptureSession_Callbacks* callback)
253```
254
255**Description**
256
257Registers a callback to listen for capture session events.
258
259**Since**: 11
260
261
262**Parameters**
263
264| Name| Description|
265| -- | -- |
266| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
267| [CaptureSession_Callbacks](capi-oh-camera-capturesession-callbacks.md)* callback | Pointer to the target callback.|
268
269**Returns**
270
271| Type| Description|
272| -- | -- |
273| [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.|
274
275### OH_CaptureSession_UnregisterCallback()
276
277```
278Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* session,CaptureSession_Callbacks* callback)
279```
280
281**Description**
282
283Unregisters the callback used to listen for capture session events.
284
285**Since**: 11
286
287
288**Parameters**
289
290| Name| Description|
291| -- | -- |
292| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
293| [CaptureSession_Callbacks](capi-oh-camera-capturesession-callbacks.md)* callback | Pointer to the target callback.|
294
295**Returns**
296
297| Type| Description|
298| -- | -- |
299| [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.|
300
301### OH_CaptureSession_RegisterSmoothZoomInfoCallback()
302
303```
304Camera_ErrorCode OH_CaptureSession_RegisterSmoothZoomInfoCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)
305```
306
307**Description**
308
309Registers a callback to listen for smooth zoom events.
310
311**Since**: 12
312
313
314**Parameters**
315
316| Name| Description|
317| -- | -- |
318| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
319| [OH_CaptureSession_OnSmoothZoomInfo](#oh_capturesession_onsmoothzoominfo) smoothZoomInfoCallback | Pointer to the target callback.|
320
321**Returns**
322
323| Type| Description|
324| -- | -- |
325| [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.|
326
327### OH_CaptureSession_UnregisterSmoothZoomInfoCallback()
328
329```
330Camera_ErrorCode OH_CaptureSession_UnregisterSmoothZoomInfoCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)
331```
332
333**Description**
334
335Unregisters the callback used to listen for smooth zoom events.
336
337**Since**: 12
338
339
340**Parameters**
341
342| Name| Description|
343| -- | -- |
344| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
345| [OH_CaptureSession_OnSmoothZoomInfo](#oh_capturesession_onsmoothzoominfo) smoothZoomInfoCallback | Pointer to the target callback.|
346
347**Returns**
348
349| Type| Description|
350| -- | -- |
351| [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.|
352
353### OH_CaptureSession_SetSessionMode()
354
355```
356Camera_ErrorCode OH_CaptureSession_SetSessionMode(Camera_CaptureSession* session, Camera_SceneMode sceneMode)
357```
358
359**Description**
360
361Sets a session mode.
362
363This function cannot be called after [OH_CaptureSession_BeginConfig](#oh_capturesession_beginconfig).
364
365You are advised to call this function immediately after [OH_CameraManager_CreateCaptureSession](capi-camera-manager-h.md#oh_cameramanager_createcapturesession).
366
367**Since**: 12
368
369
370**Parameters**
371
372| Name| Description|
373| -- | -- |
374| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
375| [Camera_SceneMode](capi-camera-h.md#camera_scenemode) sceneMode | Scene mode.|
376
377**Returns**
378
379| Type| Description|
380| -- | -- |
381| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.<br>**CAMERA_SESSION_CONFIG_LOCKED**: The session configuration is locked.|
382
383### OH_CaptureSession_AddSecureOutput()
384
385```
386Camera_ErrorCode OH_CaptureSession_AddSecureOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)
387```
388
389**Description**
390
391Marks a preview output stream as secure output.
392
393**Since**: 12
394
395
396**Parameters**
397
398| Name| Description|
399| -- | -- |
400| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
401| [Camera_PreviewOutput](capi-oh-camera-camera-previewoutput.md)* previewOutput | Pointer to the target Camera_PreviewOutput instance.|
402
403**Returns**
404
405| Type| Description|
406| -- | -- |
407| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.<br>**CAMERA_SESSION_CONFIG_LOCKED**: The session configuration is locked.|
408
409### OH_CaptureSession_BeginConfig()
410
411```
412Camera_ErrorCode OH_CaptureSession_BeginConfig(Camera_CaptureSession* session)
413```
414
415**Description**
416
417Starts the configuration for a capture session.
418
419**Since**: 11
420
421
422**Parameters**
423
424| Name| Description|
425| -- | -- |
426| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
427
428**Returns**
429
430| Type| Description|
431| -- | -- |
432| [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_CONFIG_LOCKED**: The session configuration is locked.|
433
434### OH_CaptureSession_CommitConfig()
435
436```
437Camera_ErrorCode OH_CaptureSession_CommitConfig(Camera_CaptureSession* session)
438```
439
440**Description**
441
442Commits the configuration for a capture session.
443
444**Since**: 11
445
446
447**Parameters**
448
449| Name| Description|
450| -- | -- |
451| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
452
453**Returns**
454
455| Type| Description|
456| -- | -- |
457| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
458
459### OH_CaptureSession_AddInput()
460
461```
462Camera_ErrorCode OH_CaptureSession_AddInput(Camera_CaptureSession* session, Camera_Input* cameraInput)
463```
464
465**Description**
466
467Adds a Camera_Input instance to a session.
468
469**Since**: 11
470
471
472**Parameters**
473
474| Name| Description|
475| -- | -- |
476| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
477| [Camera_Input](capi-oh-camera-camera-input.md)* cameraInput | Pointer to the Camera_Input instance to add.|
478
479**Returns**
480
481| Type| Description|
482| -- | -- |
483| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
484
485### OH_CaptureSession_RemoveInput()
486
487```
488Camera_ErrorCode OH_CaptureSession_RemoveInput(Camera_CaptureSession* session, Camera_Input* cameraInput)
489```
490
491**Description**
492
493Removes a Camera_Input instance from a session.
494
495**Since**: 11
496
497
498**Parameters**
499
500| Name| Description|
501| -- | -- |
502| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
503| [Camera_Input](capi-oh-camera-camera-input.md)* cameraInput | Pointer to the Camera_Input instance to remove.|
504
505**Returns**
506
507| Type| Description|
508| -- | -- |
509| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
510
511### OH_CaptureSession_AddPreviewOutput()
512
513```
514Camera_ErrorCode OH_CaptureSession_AddPreviewOutput(Camera_CaptureSession* session,Camera_PreviewOutput* previewOutput)
515```
516
517**Description**
518
519Adds a PreviewOutput instance to a session.
520
521**Since**: 11
522
523
524**Parameters**
525
526| Name| Description|
527| -- | -- |
528| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
529| [Camera_PreviewOutput](capi-oh-camera-camera-previewoutput.md)* previewOutput | Pointer to the PreviewOutput instance to add.|
530
531**Returns**
532
533| Type| Description|
534| -- | -- |
535| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
536
537### OH_CaptureSession_RemovePreviewOutput()
538
539```
540Camera_ErrorCode OH_CaptureSession_RemovePreviewOutput(Camera_CaptureSession* session,Camera_PreviewOutput* previewOutput)
541```
542
543**Description**
544
545Removes a PreviewOutput instance from a session.
546
547**Since**: 11
548
549
550**Parameters**
551
552| Name| Description|
553| -- | -- |
554| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
555| [Camera_PreviewOutput](capi-oh-camera-camera-previewoutput.md)* previewOutput | Pointer to the PreviewOutput instance to remove.|
556
557**Returns**
558
559| Type| Description|
560| -- | -- |
561| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
562
563### OH_CaptureSession_AddPhotoOutput()
564
565```
566Camera_ErrorCode OH_CaptureSession_AddPhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)
567```
568
569**Description**
570
571Adds a PhotoOutput instance to a session.
572
573**Since**: 11
574
575
576**Parameters**
577
578| Name| Description|
579| -- | -- |
580| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
581| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance to add.|
582
583**Returns**
584
585| Type| Description|
586| -- | -- |
587| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
588
589### OH_CaptureSession_RemovePhotoOutput()
590
591```
592Camera_ErrorCode OH_CaptureSession_RemovePhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)
593```
594
595**Description**
596
597Removes a PhotoOutput instance from a session.
598
599**Since**: 11
600
601
602**Parameters**
603
604| Name| Description|
605| -- | -- |
606| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
607| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* photoOutput | Pointer to the PhotoOutput instance to remove.|
608
609**Returns**
610
611| Type| Description|
612| -- | -- |
613| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
614
615### OH_CaptureSession_AddVideoOutput()
616
617```
618Camera_ErrorCode OH_CaptureSession_AddVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)
619```
620
621**Description**
622
623Adds a VideoOutput instance to a session.
624
625**Since**: 11
626
627
628**Parameters**
629
630| Name| Description|
631| -- | -- |
632| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
633| [Camera_VideoOutput](capi-oh-camera-camera-videooutput.md)* videoOutput | Pointer to the VideoOutput instance to add.|
634
635**Returns**
636
637| Type| Description|
638| -- | -- |
639| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
640
641### OH_CaptureSession_RemoveVideoOutput()
642
643```
644Camera_ErrorCode OH_CaptureSession_RemoveVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)
645```
646
647**Description**
648
649Removes a VideoOutput instance from a session.
650
651**Since**: 11
652
653
654**Parameters**
655
656| Name| Description|
657| -- | -- |
658| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
659| [Camera_VideoOutput](capi-oh-camera-camera-videooutput.md)* videoOutput | Pointer to the VideoOutput instance to remove.|
660
661**Returns**
662
663| Type| Description|
664| -- | -- |
665| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
666
667### OH_CaptureSession_AddMetadataOutput()
668
669```
670Camera_ErrorCode OH_CaptureSession_AddMetadataOutput(Camera_CaptureSession* session,Camera_MetadataOutput* metadataOutput)
671```
672
673**Description**
674
675Adds a MetadataOutput instance to a session.
676
677**Since**: 11
678
679
680**Parameters**
681
682| Name| Description|
683| -- | -- |
684| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
685| [Camera_MetadataOutput](capi-oh-camera-camera-metadataoutput.md)* metadataOutput | Pointer to the MetadataOutput instance to add.|
686
687**Returns**
688
689| Type| Description|
690| -- | -- |
691| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
692
693### OH_CaptureSession_RemoveMetadataOutput()
694
695```
696Camera_ErrorCode OH_CaptureSession_RemoveMetadataOutput(Camera_CaptureSession* session,Camera_MetadataOutput* metadataOutput)
697```
698
699**Description**
700
701Removes a MetadataOutput instance from a session.
702
703**Since**: 11
704
705
706**Parameters**
707
708| Name| Description|
709| -- | -- |
710| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
711| [Camera_MetadataOutput](capi-oh-camera-camera-metadataoutput.md)* metadataOutput | Pointer to the MetadataOutput instance to remove.|
712
713**Returns**
714
715| Type| Description|
716| -- | -- |
717| [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_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
718
719### OH_CaptureSession_Start()
720
721```
722Camera_ErrorCode OH_CaptureSession_Start(Camera_CaptureSession* session)
723```
724
725**Description**
726
727Starts a capture session.
728
729**Since**: 11
730
731
732**Parameters**
733
734| Name| Description|
735| -- | -- |
736| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance to start.|
737
738**Returns**
739
740| Type| Description|
741| -- | -- |
742| [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_CONFIG**: The capture session is not configured.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
743
744### OH_CaptureSession_Stop()
745
746```
747Camera_ErrorCode OH_CaptureSession_Stop(Camera_CaptureSession* session)
748```
749
750**Description**
751
752Stops a capture session.
753
754**Since**: 11
755
756
757**Parameters**
758
759| Name| Description|
760| -- | -- |
761| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance to stop.|
762
763**Returns**
764
765| Type| Description|
766| -- | -- |
767| [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.|
768
769### OH_CaptureSession_Release()
770
771```
772Camera_ErrorCode OH_CaptureSession_Release(Camera_CaptureSession* session)
773```
774
775**Description**
776
777Releases a CaptureSession instance.
778
779**Since**: 11
780
781
782**Parameters**
783
784| Name| Description|
785| -- | -- |
786| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance to release.|
787
788**Returns**
789
790| Type| Description|
791| -- | -- |
792| [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.|
793
794### OH_CaptureSession_HasFlash()
795
796```
797Camera_ErrorCode OH_CaptureSession_HasFlash(Camera_CaptureSession* session, bool* hasFlash)
798```
799
800**Description**
801
802Checks whether the device has flash.
803
804**Since**: 11
805
806
807**Parameters**
808
809| Name| Description|
810| -- | -- |
811| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
812| bool* hasFlash | Pointer to the check result for whether the device has flash.|
813
814**Returns**
815
816| Type| Description|
817| -- | -- |
818| [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_CONFIG**: The capture session is not configured.|
819
820### OH_CaptureSession_IsFlashModeSupported()
821
822```
823Camera_ErrorCode OH_CaptureSession_IsFlashModeSupported(Camera_CaptureSession* session,Camera_FlashMode flashMode, bool* isSupported)
824```
825
826**Description**
827
828Checks whether a flash mode is supported.
829
830**Since**: 11
831
832
833**Parameters**
834
835| Name| Description|
836| -- | -- |
837| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
838| [Camera_FlashMode](capi-camera-h.md#camera_flashmode) flashMode | Flash mode to check.|
839| bool* isSupported | Pointer to the check result for the support of the flash mode.|
840
841**Returns**
842
843| Type| Description|
844| -- | -- |
845| [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_CONFIG**: The capture session is not configured.|
846
847### OH_CaptureSession_GetFlashMode()
848
849```
850Camera_ErrorCode OH_CaptureSession_GetFlashMode(Camera_CaptureSession* session, Camera_FlashMode* flashMode)
851```
852
853**Description**
854
855Obtains the flash mode in use.
856
857**Since**: 11
858
859
860**Parameters**
861
862| Name| Description|
863| -- | -- |
864| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
865| [Camera_FlashMode](capi-camera-h.md#camera_flashmode)* flashMode | Pointer to the flash mode.|
866
867**Returns**
868
869| Type| Description|
870| -- | -- |
871| [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_CONFIG**: The capture session is not configured.|
872
873### OH_CaptureSession_SetFlashMode()
874
875```
876Camera_ErrorCode OH_CaptureSession_SetFlashMode(Camera_CaptureSession* session, Camera_FlashMode flashMode)
877```
878
879**Description**
880
881Sets a flash mode for the device.
882
883**Since**: 11
884
885
886**Parameters**
887
888| Name| Description|
889| -- | -- |
890| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
891| [Camera_FlashMode](capi-camera-h.md#camera_flashmode) flashMode | Flash mode to set.|
892
893**Returns**
894
895| Type| Description|
896| -- | -- |
897| [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_CONFIG**: The capture session is not configured.|
898
899### OH_CaptureSession_IsExposureModeSupported()
900
901```
902Camera_ErrorCode OH_CaptureSession_IsExposureModeSupported(Camera_CaptureSession* session,Camera_ExposureMode exposureMode, bool* isSupported)
903```
904
905**Description**
906
907Checks whether an exposure mode is supported.
908
909**Since**: 11
910
911
912**Parameters**
913
914| Name| Description|
915| -- | -- |
916| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
917| [Camera_ExposureMode](capi-camera-h.md#camera_exposuremode) exposureMode | Exposure mode to check.|
918| bool* isSupported | Pointer to the check result for the support of the exposure mode.|
919
920**Returns**
921
922| Type| Description|
923| -- | -- |
924| [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_CONFIG**: The capture session is not configured.|
925
926### OH_CaptureSession_GetExposureMode()
927
928```
929Camera_ErrorCode OH_CaptureSession_GetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode* exposureMode)
930```
931
932**Description**
933
934Obtains the exposure mode in use.
935
936**Since**: 11
937
938
939**Parameters**
940
941| Name| Description|
942| -- | -- |
943| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
944| [Camera_ExposureMode](capi-camera-h.md#camera_exposuremode)* exposureMode | Pointer to the exposure mode.|
945
946**Returns**
947
948| Type| Description|
949| -- | -- |
950| [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_CONFIG**: The capture session is not configured.|
951
952### OH_CaptureSession_SetExposureMode()
953
954```
955Camera_ErrorCode OH_CaptureSession_SetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode exposureMode)
956```
957
958**Description**
959
960Sets an exposure mode for the device.
961
962**Since**: 11
963
964
965**Parameters**
966
967| Name| Description|
968| -- | -- |
969| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
970| [Camera_ExposureMode](capi-camera-h.md#camera_exposuremode) exposureMode | Exposure mode to set.|
971
972**Returns**
973
974| Type| Description|
975| -- | -- |
976| [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_CONFIG**: The capture session is not configured.|
977
978### OH_CaptureSession_GetMeteringPoint()
979
980```
981Camera_ErrorCode OH_CaptureSession_GetMeteringPoint(Camera_CaptureSession* session, Camera_Point* point)
982```
983
984**Description**
985
986Obtains the metering point in use.
987
988**Since**: 11
989
990
991**Parameters**
992
993| Name| Description|
994| -- | -- |
995| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
996| [Camera_Point](capi-oh-camera-camera-point.md)* point | Pointer to the metering point.|
997
998**Returns**
999
1000| Type| Description|
1001| -- | -- |
1002| [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_CONFIG**: The capture session is not configured.|
1003
1004### OH_CaptureSession_SetMeteringPoint()
1005
1006```
1007Camera_ErrorCode OH_CaptureSession_SetMeteringPoint(Camera_CaptureSession* session, Camera_Point point)
1008```
1009
1010**Description**
1011
1012Sets the metering point, which is the center point of the metering rectangle.
1013
1014**Since**: 11
1015
1016
1017**Parameters**
1018
1019| Name| Description|
1020| -- | -- |
1021| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1022| [Camera_Point](capi-oh-camera-camera-point.md) point | Metering point to set.|
1023
1024**Returns**
1025
1026| Type| Description|
1027| -- | -- |
1028| [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_CONFIG**: The capture session is not configured.|
1029
1030### OH_CaptureSession_GetExposureBiasRange()
1031
1032```
1033Camera_ErrorCode OH_CaptureSession_GetExposureBiasRange(Camera_CaptureSession* session, float* minExposureBias,float* maxExposureBias, float* step)
1034```
1035
1036**Description**
1037
1038Obtains the exposure compensation values of the device.
1039
1040**Since**: 11
1041
1042
1043**Parameters**
1044
1045| Name| Description|
1046| -- | -- |
1047| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1048| float* minExposureBias | Pointer to the minimum exposure compensation value.|
1049| float* maxExposureBias | Pointer to the maximum exposure compensation value.|
1050| float* step | Pointer to the exposure compensation step.|
1051
1052**Returns**
1053
1054| Type| Description|
1055| -- | -- |
1056| [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_CONFIG**: The capture session is not configured.|
1057
1058### OH_CaptureSession_SetExposureBias()
1059
1060```
1061Camera_ErrorCode OH_CaptureSession_SetExposureBias(Camera_CaptureSession* session, float exposureBias)
1062```
1063
1064**Description**
1065
1066Sets an exposure compensation value for the device.
1067
1068**Since**: 11
1069
1070
1071**Parameters**
1072
1073| Name| Description|
1074| -- | -- |
1075| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1076| float exposureBias | Exposure compensation value to set.|
1077
1078**Returns**
1079
1080| Type| Description|
1081| -- | -- |
1082| [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_CONFIG**: The capture session is not configured.|
1083
1084### OH_CaptureSession_GetExposureBias()
1085
1086```
1087Camera_ErrorCode OH_CaptureSession_GetExposureBias(Camera_CaptureSession* session, float* exposureBias)
1088```
1089
1090**Description**
1091
1092Obtains the exposure compensation value in use.
1093
1094**Since**: 11
1095
1096
1097**Parameters**
1098
1099| Name| Description|
1100| -- | -- |
1101| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1102| float* exposureBias | Pointer to the exposure compensation value.|
1103
1104**Returns**
1105
1106| Type| Description|
1107| -- | -- |
1108| [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_CONFIG**: The capture session is not configured.|
1109
1110### OH_CaptureSession_IsFocusModeSupported()
1111
1112```
1113Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported(Camera_CaptureSession* session,Camera_FocusMode focusMode, bool* isSupported)
1114```
1115
1116**Description**
1117
1118Checks whether a focus mode is supported.
1119
1120**Since**: 11
1121
1122
1123**Parameters**
1124
1125| Name| Description|
1126| -- | -- |
1127| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1128| [Camera_FocusMode](capi-camera-h.md#camera_focusmode) focusMode | Focus mode to check.|
1129| bool* isSupported | Pointer to the check result for the support of the focus mode.|
1130
1131**Returns**
1132
1133| Type| Description|
1134| -- | -- |
1135| [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_CONFIG**: The capture session is not configured.|
1136
1137### OH_CaptureSession_GetFocusMode()
1138
1139```
1140Camera_ErrorCode OH_CaptureSession_GetFocusMode(Camera_CaptureSession* session, Camera_FocusMode* focusMode)
1141```
1142
1143**Description**
1144
1145Obtains the focus mode in use.
1146
1147**Since**: 11
1148
1149
1150**Parameters**
1151
1152| Name| Description|
1153| -- | -- |
1154| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1155| [Camera_FocusMode](capi-camera-h.md#camera_focusmode)* focusMode | Pointer to the focus mode.|
1156
1157**Returns**
1158
1159| Type| Description|
1160| -- | -- |
1161| [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_CONFIG**: The capture session is not configured.|
1162
1163### OH_CaptureSession_SetFocusMode()
1164
1165```
1166Camera_ErrorCode OH_CaptureSession_SetFocusMode(Camera_CaptureSession* session, Camera_FocusMode focusMode)
1167```
1168
1169**Description**
1170
1171Sets a focus mode for the device.
1172
1173**Since**: 11
1174
1175
1176**Parameters**
1177
1178| Name| Description|
1179| -- | -- |
1180| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1181| [Camera_FocusMode](capi-camera-h.md#camera_focusmode) focusMode | Focus mode to set.|
1182
1183**Returns**
1184
1185| Type| Description|
1186| -- | -- |
1187| [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_CONFIG**: The capture session is not configured.|
1188
1189### OH_CaptureSession_GetFocusPoint()
1190
1191```
1192Camera_ErrorCode OH_CaptureSession_GetFocusPoint(Camera_CaptureSession* session, Camera_Point* focusPoint)
1193```
1194
1195**Description**
1196
1197Obtains the focal point in use.
1198
1199**Since**: 11
1200
1201
1202**Parameters**
1203
1204| Name| Description|
1205| -- | -- |
1206| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1207| [Camera_Point](capi-oh-camera-camera-point.md)* focusPoint | Pointer to the focal point.|
1208
1209**Returns**
1210
1211| Type| Description|
1212| -- | -- |
1213| [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_CONFIG**: The capture session is not configured.|
1214
1215### OH_CaptureSession_SetFocusPoint()
1216
1217```
1218Camera_ErrorCode OH_CaptureSession_SetFocusPoint(Camera_CaptureSession* session, Camera_Point focusPoint)
1219```
1220
1221**Description**
1222
1223Sets a focal point for the device.
1224
1225**Since**: 11
1226
1227
1228**Parameters**
1229
1230| Name| Description|
1231| -- | -- |
1232| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1233| [Camera_Point](capi-oh-camera-camera-point.md) focusPoint | Focal point to set.|
1234
1235**Returns**
1236
1237| Type| Description|
1238| -- | -- |
1239| [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_CONFIG**: The capture session is not configured.|
1240
1241### OH_CaptureSession_GetZoomRatioRange()
1242
1243```
1244Camera_ErrorCode OH_CaptureSession_GetZoomRatioRange(Camera_CaptureSession* session, float* minZoom, float* maxZoom)
1245```
1246
1247**Description**
1248
1249Obtains the supported zoom ratio range.
1250
1251**Since**: 11
1252
1253
1254**Parameters**
1255
1256| Name| Description|
1257| -- | -- |
1258| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1259| float* minZoom | Pointer to the minimum zoom ratio.|
1260| float* maxZoom | Pointer to the maximum zoom ratio.|
1261
1262**Returns**
1263
1264| Type| Description|
1265| -- | -- |
1266| [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_CONFIG**: The capture session is not configured.|
1267
1268### OH_CaptureSession_GetZoomRatio()
1269
1270```
1271Camera_ErrorCode OH_CaptureSession_GetZoomRatio(Camera_CaptureSession* session, float* zoom)
1272```
1273
1274**Description**
1275
1276Obtains the zoom ratio in use.
1277
1278**Since**: 11
1279
1280
1281**Parameters**
1282
1283| Name| Description|
1284| -- | -- |
1285| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1286| float* zoom | Pointer to the zoom ratio.|
1287
1288**Returns**
1289
1290| Type| Description|
1291| -- | -- |
1292| [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_CONFIG**: The capture session is not configured.|
1293
1294### OH_CaptureSession_SetZoomRatio()
1295
1296```
1297Camera_ErrorCode OH_CaptureSession_SetZoomRatio(Camera_CaptureSession* session, float zoom)
1298```
1299
1300**Description**
1301
1302Sets a zoom ratio for the device.
1303
1304**Since**: 11
1305
1306
1307**Parameters**
1308
1309| Name| Description|
1310| -- | -- |
1311| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1312| float zoom | Target zoom ratio.<br>It takes some time for the zoom ratio to take effect at the bottom layer. To obtain the correct zoom ratio, you need to wait for one to two frames.|
1313
1314**Returns**
1315
1316| Type| Description|
1317| -- | -- |
1318| [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_CONFIG**: The capture session is not configured.|
1319
1320### OH_CaptureSession_IsVideoStabilizationModeSupported()
1321
1322```
1323Camera_ErrorCode OH_CaptureSession_IsVideoStabilizationModeSupported(Camera_CaptureSession* session,Camera_VideoStabilizationMode mode, bool* isSupported)
1324```
1325
1326**Description**
1327
1328Checks whether a video stabilization mode is supported.
1329
1330**Since**: 11
1331
1332
1333**Parameters**
1334
1335| Name| Description|
1336| -- | -- |
1337| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1338| [Camera_VideoStabilizationMode](capi-camera-h.md#camera_videostabilizationmode) mode | Video stabilization mode to check.|
1339| bool* isSupported | Pointer to the check result for the support of the video stabilization mode.|
1340
1341**Returns**
1342
1343| Type| Description|
1344| -- | -- |
1345| [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_CONFIG**: The capture session is not configured.|
1346
1347### OH_CaptureSession_GetVideoStabilizationMode()
1348
1349```
1350Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode(Camera_CaptureSession* session,Camera_VideoStabilizationMode* mode)
1351```
1352
1353**Description**
1354
1355Obtains the video stabilization mode in use.
1356
1357**Since**: 11
1358
1359
1360**Parameters**
1361
1362| Name| Description|
1363| -- | -- |
1364| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1365| [Camera_VideoStabilizationMode](capi-camera-h.md#camera_videostabilizationmode)* mode | Pointer to the video stabilization mode.|
1366
1367**Returns**
1368
1369| Type| Description|
1370| -- | -- |
1371| [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_CONFIG**: The capture session is not configured.|
1372
1373### OH_CaptureSession_SetVideoStabilizationMode()
1374
1375```
1376Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode(Camera_CaptureSession* session,Camera_VideoStabilizationMode mode)
1377```
1378
1379**Description**
1380
1381Sets a video stabilization mode for the device.
1382
1383**Since**: 11
1384
1385
1386**Parameters**
1387
1388| Name| Description|
1389| -- | -- |
1390| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1391| [Camera_VideoStabilizationMode](capi-camera-h.md#camera_videostabilizationmode) mode | Video stabilization mode to set.|
1392
1393**Returns**
1394
1395| Type| Description|
1396| -- | -- |
1397| [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_CONFIG**: The capture session is not configured.|
1398
1399### OH_CaptureSession_CanAddInput()
1400
1401```
1402Camera_ErrorCode OH_CaptureSession_CanAddInput(Camera_CaptureSession* session,Camera_Input* cameraInput, bool* isSuccessful)
1403```
1404
1405**Description**
1406
1407Checks whether a Camera_Input instance can be added to a session.
1408
1409**Since**: 12
1410
1411
1412**Parameters**
1413
1414| Name| Description|
1415| -- | -- |
1416| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1417| [Camera_Input](capi-oh-camera-camera-input.md)* cameraInput | Pointer to the Camera_Input instance to check.|
1418| bool* isSuccessful | Pointer to the check result for whether the Camera_Input instance can be added to the session.|
1419
1420**Returns**
1421
1422| Type| Description|
1423| -- | -- |
1424| [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.|
1425
1426### OH_CaptureSession_CanAddPreviewOutput()
1427
1428```
1429Camera_ErrorCode OH_CaptureSession_CanAddPreviewOutput(Camera_CaptureSession* session,Camera_PreviewOutput* cameraOutput, bool* isSuccessful)
1430```
1431
1432**Description**
1433
1434Checks whether a PreviewOutput instance can be added to a session.
1435
1436**Since**: 12
1437
1438
1439**Parameters**
1440
1441| Name| Description|
1442| -- | -- |
1443| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1444| [Camera_PreviewOutput](capi-oh-camera-camera-previewoutput.md)* cameraOutput | Pointer to the PreviewOutput instance to check.|
1445| bool* isSuccessful | Pointer to the check result for whether the PreviewOutput instance can be added to the session.|
1446
1447**Returns**
1448
1449| Type| Description|
1450| -- | -- |
1451| [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.|
1452
1453### OH_CaptureSession_CanAddPhotoOutput()
1454
1455```
1456Camera_ErrorCode OH_CaptureSession_CanAddPhotoOutput(Camera_CaptureSession* session,Camera_PhotoOutput* cameraOutput, bool* isSuccessful)
1457```
1458
1459**Description**
1460
1461Checks whether a PhotoOutput instance can be added to a session.
1462
1463**Since**: 12
1464
1465
1466**Parameters**
1467
1468| Name| Description|
1469| -- | -- |
1470| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1471| [Camera_PhotoOutput](capi-oh-camera-camera-photooutput.md)* cameraOutput | Pointer to the PhotoOutput instance to check.|
1472| bool* isSuccessful | Pointer to the check result for whether the PhotoOutput instance can be added to the session.|
1473
1474**Returns**
1475
1476| Type| Description|
1477| -- | -- |
1478| [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.|
1479
1480### OH_CaptureSession_CanAddVideoOutput()
1481
1482```
1483Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput(Camera_CaptureSession* session,Camera_VideoOutput* cameraOutput, bool* isSuccessful)
1484```
1485
1486**Description**
1487
1488Checks whether a VideoOutput instance can be added to a session.
1489
1490**Since**: 12
1491
1492
1493**Parameters**
1494
1495| Name| Description|
1496| -- | -- |
1497| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1498| [Camera_VideoOutput](capi-oh-camera-camera-videooutput.md)* cameraOutput | Pointer to the VideoOutput instance to check.|
1499| bool* isSuccessful | Pointer to the check result for whether the VideoOutput instance can be added to the session.|
1500
1501**Returns**
1502
1503| Type| Description|
1504| -- | -- |
1505| [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.|
1506
1507### OH_CaptureSession_CanPreconfig()
1508
1509```
1510Camera_ErrorCode OH_CaptureSession_CanPreconfig(Camera_CaptureSession* session,Camera_PreconfigType preconfigType, bool* canPreconfig)
1511```
1512
1513**Description**
1514
1515Checks whether a preconfigured resolution type is supported.
1516
1517**Since**: 12
1518
1519
1520**Parameters**
1521
1522| Name| Description|
1523| -- | -- |
1524| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1525| [Camera_PreconfigType](capi-camera-h.md#camera_preconfigtype) preconfigType | Target preconfigured resolution type.|
1526| bool* canPreconfig | Pointer to the check result for the support of the preconfigured resolution type.|
1527
1528**Returns**
1529
1530| Type| Description|
1531| -- | -- |
1532| [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.|
1533
1534### OH_CaptureSession_CanPreconfigWithRatio()
1535
1536```
1537Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio(Camera_CaptureSession* session,Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, bool* canPreconfig)
1538```
1539
1540**Description**
1541
1542Checks whether a preconfigured resolution type with an aspect ratio is supported.
1543
1544**Since**: 12
1545
1546
1547**Parameters**
1548
1549| Name| Description|
1550| -- | -- |
1551| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1552| [Camera_PreconfigType](capi-camera-h.md#camera_preconfigtype) preconfigType | Target preconfigured resolution type.|
1553| [Camera_PreconfigRatio](capi-camera-h.md#camera_preconfigratio) preconfigRatio | Target preconfigured aspect ratio.|
1554| bool* canPreconfig | Pointer to the check result for the support of the preconfigured resolution type.|
1555
1556**Returns**
1557
1558| Type| Description|
1559| -- | -- |
1560| [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.|
1561
1562### OH_CaptureSession_Preconfig()
1563
1564```
1565Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session,Camera_PreconfigType preconfigType)
1566```
1567
1568**Description**
1569
1570Sets a preconfigured resolution type.
1571
1572**Since**: 12
1573
1574
1575**Parameters**
1576
1577| Name| Description|
1578| -- | -- |
1579| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1580| [Camera_PreconfigType](capi-camera-h.md#camera_preconfigtype) preconfigType | Target preconfigured resolution type.|
1581
1582**Returns**
1583
1584| Type| Description|
1585| -- | -- |
1586| [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.|
1587
1588### OH_CaptureSession_PreconfigWithRatio()
1589
1590```
1591Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio(Camera_CaptureSession* session,Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio)
1592```
1593
1594**Description**
1595
1596Sets a preconfigured resolution type with an aspect ratio.
1597
1598**Since**: 12
1599
1600
1601**Parameters**
1602
1603| Name| Description|
1604| -- | -- |
1605| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1606| [Camera_PreconfigType](capi-camera-h.md#camera_preconfigtype) preconfigType | Target preconfigured resolution type.|
1607| [Camera_PreconfigRatio](capi-camera-h.md#camera_preconfigratio) preconfigRatio | Target preconfigured aspect ratio.|
1608
1609**Returns**
1610
1611| Type| Description|
1612| -- | -- |
1613| [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.|
1614
1615### OH_CaptureSession_GetExposureValue()
1616
1617```
1618Camera_ErrorCode OH_CaptureSession_GetExposureValue(Camera_CaptureSession* session, float* exposureValue)
1619```
1620
1621**Description**
1622
1623Obtains the exposure value.
1624
1625**Since**: 12
1626
1627
1628**Parameters**
1629
1630| Name| Description|
1631| -- | -- |
1632| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1633| float* exposureValue | Pointer to the exposure value.|
1634
1635**Returns**
1636
1637| Type| Description|
1638| -- | -- |
1639| [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.|
1640
1641### OH_CaptureSession_GetFocalLength()
1642
1643```
1644Camera_ErrorCode OH_CaptureSession_GetFocalLength(Camera_CaptureSession* session, float* focalLength)
1645```
1646
1647**Description**
1648
1649Obtains the current focal length.
1650
1651**Since**: 12
1652
1653
1654**Parameters**
1655
1656| Name| Description|
1657| -- | -- |
1658| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1659| float* focalLength | Pointer to the focal length.|
1660
1661**Returns**
1662
1663| Type| Description|
1664| -- | -- |
1665| [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_CONFIG**: The capture session is not configured.|
1666
1667### OH_CaptureSession_SetSmoothZoom()
1668
1669```
1670Camera_ErrorCode OH_CaptureSession_SetSmoothZoom(Camera_CaptureSession* session,float targetZoom, Camera_SmoothZoomMode smoothZoomMode)
1671```
1672
1673**Description**
1674
1675Sets smooth zoom.
1676
1677**Since**: 12
1678
1679
1680**Parameters**
1681
1682| Name| Description|
1683| -- | -- |
1684| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1685| float targetZoom | Target zoom ratio.|
1686| [Camera_SmoothZoomMode](capi-camera-h.md#camera_smoothzoommode) smoothZoomMode | Smooth zoom mode.|
1687
1688**Returns**
1689
1690| Type| Description|
1691| -- | -- |
1692| [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_CONFIG**: The capture session is not configured.|
1693
1694### OH_CaptureSession_GetSupportedColorSpaces()
1695
1696```
1697Camera_ErrorCode OH_CaptureSession_GetSupportedColorSpaces(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace** colorSpace, uint32_t* size)
1698```
1699
1700**Description**
1701
1702Obtains the supported color spaces.
1703
1704**Since**: 12
1705
1706
1707**Parameters**
1708
1709| Name| Description|
1710| -- | -- |
1711| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1712| OH_NativeBuffer_ColorSpace** colorSpace | Double pointer to the list of supported color spaces, which are defined in the OH_NativeBuffer_ColorSpace struct, if the function is successfully called.|
1713| uint32_t* size | Pointer to the size of the list of supported color spaces.|
1714
1715**Returns**
1716
1717| Type| Description|
1718| -- | -- |
1719| [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_CONFIG**: The capture session is not configured.|
1720
1721### OH_CaptureSession_DeleteColorSpaces()
1722
1723```
1724Camera_ErrorCode OH_CaptureSession_DeleteColorSpaces(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace* colorSpace)
1725```
1726
1727**Description**
1728
1729Deletes color spaces.
1730
1731**Since**: 12
1732
1733
1734**Parameters**
1735
1736| Name| Description|
1737| -- | -- |
1738| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1739| [OH_NativeBuffer_ColorSpace](../apis-arkgraphics2d/capi-buffer-common-h.md#oh_nativebuffer_colorspace)* colorSpace | Pointer to the list of color spaces, which are defined in the OH_NativeBuffer_ColorSpace struct.|
1740
1741**Returns**
1742
1743| Type| Description|
1744| -- | -- |
1745| [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.|
1746
1747### OH_CaptureSession_GetActiveColorSpace()
1748
1749```
1750Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace* colorSpace)
1751```
1752
1753**Description**
1754
1755Obtains the active color space.
1756
1757**Since**: 12
1758
1759
1760**Parameters**
1761
1762| Name| Description|
1763| -- | -- |
1764| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1765| [OH_NativeBuffer_ColorSpace](../apis-arkgraphics2d/capi-buffer-common-h.md#oh_nativebuffer_colorspace)* colorSpace | Pointer to the OH_NativeBuffer_ColorSpace instance.|
1766
1767**Returns**
1768
1769| Type| Description|
1770| -- | -- |
1771| [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_CONFIG**: The capture session is not configured.|
1772
1773### OH_CaptureSession_SetActiveColorSpace()
1774
1775```
1776Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace(Camera_CaptureSession* session,OH_NativeBuffer_ColorSpace colorSpace)
1777```
1778
1779**Description**
1780
1781Sets the active color space.
1782
1783**Since**: 12
1784
1785
1786**Parameters**
1787
1788| Name| Description|
1789| -- | -- |
1790| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1791| [OH_NativeBuffer_ColorSpace](../apis-arkgraphics2d/capi-buffer-common-h.md#oh_nativebuffer_colorspace) colorSpace | Target OH_NativeBuffer_ColorSpace instance.|
1792
1793**Returns**
1794
1795| Type| Description|
1796| -- | -- |
1797| [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_CONFIG**: The capture session is not configured.|
1798
1799### OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback()
1800
1801```
1802Camera_ErrorCode OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session,OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)
1803```
1804
1805**Description**
1806
1807Registers a callback to listen for device switching changes.
1808
1809**Since**: 13
1810
1811
1812**Parameters**
1813
1814| Name| Description|
1815| -- | -- |
1816| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1817| [OH_CaptureSession_OnAutoDeviceSwitchStatusChange](#oh_capturesession_onautodeviceswitchstatuschange) autoDeviceSwitchStatusChange | Target callback.|
1818
1819**Returns**
1820
1821| Type| Description|
1822| -- | -- |
1823| [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.|
1824
1825### OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback()
1826
1827```
1828Camera_ErrorCode OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session,OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)
1829```
1830
1831**Description**
1832
1833Unregisters the callback used to listen for device switching changes.
1834
1835**Since**: 13
1836
1837
1838**Parameters**
1839
1840| Name| Description|
1841| -- | -- |
1842| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1843| [OH_CaptureSession_OnAutoDeviceSwitchStatusChange](#oh_capturesession_onautodeviceswitchstatuschange) autoDeviceSwitchStatusChange | Target callback.|
1844
1845**Returns**
1846
1847| Type| Description|
1848| -- | -- |
1849| [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.|
1850
1851### OH_CaptureSession_IsAutoDeviceSwitchSupported()
1852
1853```
1854Camera_ErrorCode OH_CaptureSession_IsAutoDeviceSwitchSupported(Camera_CaptureSession* session, bool* isSupported)
1855```
1856
1857**Description**
1858
1859Checks whether automatic device switching is supported.
1860
1861**Since**: 13
1862
1863
1864**Parameters**
1865
1866| Name| Description|
1867| -- | -- |
1868| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1869| bool* isSupported | Pointer to the check result for the support of automatic device switching.|
1870
1871**Returns**
1872
1873| Type| Description|
1874| -- | -- |
1875| [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_CONFIG**: The capture session is not configured.|
1876
1877### OH_CaptureSession_EnableAutoDeviceSwitch()
1878
1879```
1880Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* session, bool enabled)
1881```
1882
1883**Description**
1884
1885Enables or disables automatic device switching.
1886
1887**Since**: 13
1888
1889
1890**Parameters**
1891
1892| Name| Description|
1893| -- | -- |
1894| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1895| bool enabled | Whether to enable or disable automatic switching.|
1896
1897**Returns**
1898
1899| Type| Description|
1900| -- | -- |
1901| [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_CONFIG**: The capture session is not configured.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
1902
1903### OH_CaptureSession_RegisterSystemPressureLevelChangeCallback()
1904
1905```
1906Camera_ErrorCode OH_CaptureSession_RegisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)
1907```
1908
1909**Description**
1910
1911Registers a callback to listen for capture system pressure level changes.
1912
1913**Since**: 20
1914
1915
1916**Parameters**
1917
1918| Name| Description|
1919| -- | -- |
1920| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
1921| [OH_CaptureSession_OnSystemPressureLevelChange](#oh_capturesession_onsystempressurelevelchange) systemPressureLevelChange | Target callback, which is OH_CaptureSession_OnSystemPressureLevelChange.|
1922
1923**Returns**
1924
1925| Type| Description|
1926| -- | -- |
1927| [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.|
1928
1929### OH_CaptureSession_UnregisterSystemPressureLevelCallback()
1930
1931```
1932Camera_ErrorCode OH_CaptureSession_UnregisterSystemPressureLevelCallback(Camera_CaptureSession* session,OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)
1933```
1934
1935**Description**
1936
1937Unregisters the callback used to listen for capture system pressure level changes.
1938
1939**Since**: 20
1940
1941
1942**Parameters**
1943
1944| Name| Description|
1945| -- | -- |
1946| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
1947| [OH_CaptureSession_OnSystemPressureLevelChange](#oh_capturesession_onsystempressurelevelchange) systemPressureLevelChange | Target callback, which is OH_CaptureSession_OnSystemPressureLevelChange.|
1948
1949**Returns**
1950
1951| Type| Description|
1952| -- | -- |
1953| [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.|
1954
1955### OH_CaptureSession_SetQualityPrioritization()
1956
1957```
1958Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization(Camera_CaptureSession* session, Camera_QualityPrioritization qualityPrioritization)
1959```
1960
1961**Description**
1962
1963Sets the priority level for video recording quality.
1964
1965The default value is **HIGH_QUALITY**. Switching to **POWER_BALANCE** will compromise video recording quality to achieve lower power usage. The extent of power conservation achieved varies depending on the platform.
1966
1967**Since**: 14
1968
1969
1970**Parameters**
1971
1972| Name| Description|
1973| -- | -- |
1974| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
1975| [Camera_QualityPrioritization](capi-camera-h.md#camera_qualityprioritization) qualityPrioritization | Priority level to set. The default value is **HIGH_QUALITY**.|
1976
1977**Returns**
1978
1979| Type| Description|
1980| -- | -- |
1981| [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_CONFIG**: The capture session is not configured.|
1982
1983### OH_CaptureSession_IsMacroSupported()
1984
1985```
1986Camera_ErrorCode OH_CaptureSession_IsMacroSupported(Camera_CaptureSession* session, bool* isSupported)
1987```
1988
1989**Description**
1990
1991Checks whether macro photography is supported.
1992
1993**Since**: 19
1994
1995
1996**Parameters**
1997
1998| Name| Description|
1999| -- | -- |
2000| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2001| bool* isSupported | Pointer to the check result for the support of macro photography.|
2002
2003**Returns**
2004
2005| Type| Description|
2006| -- | -- |
2007| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | <br>**CAMERA_OK = 0**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The capture session is not configured.|
2008
2009### OH_CaptureSession_EnableMacro()
2010
2011```
2012Camera_ErrorCode OH_CaptureSession_EnableMacro(Camera_CaptureSession* session, bool enabled)
2013```
2014
2015**Description**
2016
2017Enables or disables macro photography for the camera device.
2018
2019**Since**: 19
2020
2021
2022**Parameters**
2023
2024| Name| Description|
2025| -- | -- |
2026| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2027| bool enabled | Whether to enable or disable macro capability.|
2028
2029**Returns**
2030
2031| Type| Description|
2032| -- | -- |
2033| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | <br>**CAMERA_OK = 0**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The capture session is not configured.<br>**CAMERA_OPERATION_NOT_ALLOWED**: The operation is not allowed.|
2034
2035### OH_CaptureSession_SetWhiteBalance()
2036
2037```
2038Camera_ErrorCode OH_CaptureSession_SetWhiteBalance(Camera_CaptureSession* session, int32_t colorTemperature)
2039```
2040
2041**Description**
2042
2043Sets the white balance color temperature.
2044
2045Before the setting, you are advised to call [OH_CaptureSession_GetWhiteBalanceRange](#oh_capturesession_getwhitebalancerange) to obtain the supported white balance color temperature range.
2046
2047**Since**: 20
2048
2049
2050**Parameters**
2051
2052| Name| Description|
2053| -- | -- |
2054| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2055| int32_t colorTemperature | White balance color temperature, in Kelvin.|
2056
2057**Returns**
2058
2059| Type| Description|
2060| -- | -- |
2061| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The setting is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The camera session is not configured.|
2062
2063### OH_CaptureSession_GetWhiteBalance()
2064
2065```
2066Camera_ErrorCode OH_CaptureSession_GetWhiteBalance(Camera_CaptureSession* session, int32_t *colorTemperature)
2067```
2068
2069**Description**
2070
2071Obtains the white balance color temperature.
2072
2073**Since**: 20
2074
2075
2076**Parameters**
2077
2078| Name| Description|
2079| -- | -- |
2080| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2081| int32_t *colorTemperature | Pointer to the white balance color temperature, in Kelvin.|
2082
2083**Returns**
2084
2085| Type| Description|
2086| -- | -- |
2087| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The function is successfully called.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The camera session is not configured.|
2088
2089### OH_CaptureSession_GetWhiteBalanceMode()
2090
2091```
2092Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode* whiteBalanceMode)
2093```
2094
2095**Description**
2096
2097Obtains the white balance mode in use.
2098
2099
2100**Parameters**
2101
2102| Name| Description|
2103| -- | -- |
2104| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2105| [Camera_WhiteBalanceMode](capi-camera-h.md#camera_whitebalancemode)* whiteBalanceMode | Pointer to the white balance mode.|
2106
2107**Returns**
2108
2109| Type| Description|
2110| -- | -- |
2111| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The function is successfully called.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The camera session is not configured.|
2112
2113### OH_CaptureSession_IsWhiteBalanceModeSupported()
2114
2115```
2116Camera_ErrorCode OH_CaptureSession_IsWhiteBalanceModeSupported(Camera_CaptureSession* session,Camera_WhiteBalanceMode whiteBalanceMode, bool* isSupported)
2117```
2118
2119**Description**
2120
2121Checks whether the specified white balance mode is supported.
2122
2123**Since**: 20
2124
2125
2126**Parameters**
2127
2128| Name| Description|
2129| -- | -- |
2130| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2131| [Camera_WhiteBalanceMode](capi-camera-h.md#camera_whitebalancemode) whiteBalanceMode | White balance mode.|
2132| bool* isSupported | Pointer to the check result for the support of the specified white balance mode. **true** if supported, **false** otherwise.|
2133
2134**Returns**
2135
2136| Type| Description|
2137| -- | -- |
2138| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The function is successfully called.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The camera session is not configured.|
2139
2140### OH_CaptureSession_SetWhiteBalanceMode()
2141
2142```
2143Camera_ErrorCode OH_CaptureSession_SetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode whiteBalanceMode)
2144```
2145
2146**Description**
2147
2148Sets a white balance mode.
2149
2150**Since**: 20
2151
2152
2153**Parameters**
2154
2155| Name| Description|
2156| -- | -- |
2157| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2158| [Camera_WhiteBalanceMode](capi-camera-h.md#camera_whitebalancemode) whiteBalanceMode | White balance mode.|
2159
2160**Returns**
2161
2162| Type| Description|
2163| -- | -- |
2164| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The setting is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The camera session is not configured.|
2165
2166### OH_CaptureSession_GetWhiteBalanceRange()
2167
2168```
2169Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceRange(Camera_CaptureSession* session, int32_t *minColorTemperature, int32_t *maxColorTemperature)
2170```
2171
2172**Description**
2173
2174Obtains the supported white balance color temperature range.
2175
2176**Since**: 20
2177
2178
2179**Parameters**
2180
2181| Name| Description|
2182| -- | -- |
2183| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2184| int32_t *minColorTemperature | Pointer to the minimum supported color temperature, in Kelvin.|
2185| int32_t *maxColorTemperature | Pointer to the maximum supported color temperature, in Kelvin.|
2186
2187**Returns**
2188
2189| Type| Description|
2190| -- | -- |
2191| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The function is successfully called.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The camera session is not configured.|
2192
2193### OH_CaptureSession_IsControlCenterSupported()
2194
2195```
2196Camera_ErrorCode OH_CaptureSession_IsControlCenterSupported(Camera_CaptureSession* session, bool* isSupported)
2197```
2198
2199**Description**
2200
2201Checks whether the camera controller is supported.
2202
2203**Since**: 20
2204
2205
2206**Parameters**
2207
2208| Name| Description|
2209| -- | -- |
2210| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2211| bool* isSupported | Pointer to the check result for the support of the camera controller. **true** if supported, **false** otherwise.|
2212
2213**Returns**
2214
2215| Type| Description|
2216| -- | -- |
2217| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK = 0**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The capture session is not configured.|
2218
2219### OH_CaptureSession_GetSupportedEffectType()
2220
2221```
2222Camera_ErrorCode OH_CaptureSession_GetSupportedEffectType(Camera_CaptureSession* session,Camera_ControlCenterEffectType** types, uint32_t* size)
2223```
2224
2225**Description**
2226
2227Obtains the effect types supported by the camera controller.
2228
2229**Since**: 20
2230
2231
2232**Parameters**
2233
2234| Name| Description|
2235| -- | -- |
2236| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2237| [Camera_ControlCenterEffectType](capi-camera-h.md#camera_controlcentereffecttype)** types | Double pointer to the list of supported effect types, which are defined in the Camera_ControlCenterEffectType struct, if the function is successfully called.|
2238| uint32_t* size | Pointer to the size of the list of supported effect types.|
2239
2240**Returns**
2241
2242| Type| Description|
2243| -- | -- |
2244| [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_CONFIG**: The capture session is not configured.|
2245
2246### OH_CaptureSession_DeleteSupportedEffectType()
2247
2248```
2249Camera_ErrorCode OH_CaptureSession_DeleteSupportedEffectType(Camera_CaptureSession* session,Camera_ControlCenterEffectType* types, uint32_t size)
2250```
2251
2252**Description**
2253
2254Deletes the effect types supported by the camera controller.
2255
2256**Since**: 20
2257
2258
2259**Parameters**
2260
2261| Name| Description|
2262| -- | -- |
2263| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2264| [Camera_ControlCenterEffectType](capi-camera-h.md#camera_controlcentereffecttype)* types | Pointer to the list of effect types, which are defined in the Camera_ControlCenterEffectType struct.|
2265| uint32_t size | Size of the list of supported effect types.|
2266
2267**Returns**
2268
2269| Type| Description|
2270| -- | -- |
2271| [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.|
2272
2273### OH_CaptureSession_EnableControlCenter()
2274
2275```
2276Camera_ErrorCode OH_CaptureSession_EnableControlCenter(Camera_CaptureSession* session, bool enabled)
2277```
2278
2279**Description**
2280
2281Enables or disables the camera controller.
2282
2283**Since**: 20
2284
2285
2286**Parameters**
2287
2288| Name| Description|
2289| -- | -- |
2290| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the target Camera_CaptureSession instance.|
2291| bool enabled | Whether to enable the camera controller. **true** to enable, **false** otherwise.|
2292
2293**Returns**
2294
2295| Type| Description|
2296| -- | -- |
2297| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK = 0**: The operation is successful.<br>**CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SESSION_NOT_CONFIG**: The capture session is not configured.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
2298
2299### OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback()
2300
2301```
2302Camera_ErrorCode OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session,OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)
2303```
2304
2305**Description**
2306
2307Registers a callback to listen for effect status changes of a camera controller.
2308
2309**Since**: 20
2310
2311
2312**Parameters**
2313
2314| Name| Description|
2315| -- | -- |
2316| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
2317| [OH_CaptureSession_OnControlCenterEffectStatusChange](#oh_capturesession_oncontrolcentereffectstatuschange) controlCenterEffectStatusChange | Target callback, which is OH_CaptureSession_OnControlCenterEffectStatusChange.|
2318
2319**Returns**
2320
2321| Type| Description|
2322| -- | -- |
2323| [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.|
2324
2325### OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback()
2326
2327```
2328Camera_ErrorCode OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session,OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)
2329```
2330
2331**Description**
2332
2333Unregisters the callback used to listen for effect status changes of a camera controller.
2334
2335**Since**: 20
2336
2337
2338**Parameters**
2339
2340| Name| Description|
2341| -- | -- |
2342| [Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | Pointer to the Camera_CaptureSession instance that transfers the callback.|
2343| [OH_CaptureSession_OnControlCenterEffectStatusChange](#oh_capturesession_oncontrolcentereffectstatuschange) controlCenterEffectStatusChange | Target callback, which is OH_CaptureSession_OnControlCenterEffectStatusChange.|
2344
2345**Returns**
2346
2347| Type| Description|
2348| -- | -- |
2349| [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.|
2350
2351<!--no_check-->