capture_session.h
Overview
The file declares the capture session concepts.
File to include: <ohcamera/capture_session.h>
Library: libohcamera.so
System capability: SystemCapability.Multimedia.Camera.Core
Since: 11
Related module: OH_Camera
Summary
Structs
| Name | typedef Keyword | Description |
|---|---|---|
| CaptureSession_Callbacks | CaptureSession_Callbacks | Describes the callbacks used for a capture session. |
| Camera_CaptureSession | Camera_CaptureSession | Describes the capture session object. You can use OH_CameraManager_CreateCaptureSession to create such an object. |
Functions
Function Description
OH_CaptureSession_OnFocusStateChange()
typedef void (*OH_CaptureSession_OnFocusStateChange)(Camera_CaptureSession* session, Camera_FocusState focusState)
Description
Defines the callback defined in the CaptureSession_Callbacks struct and used to report focus status changes of a capture session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| Camera_FocusState focusState | Focus status. |
OH_CaptureSession_OnError()
typedef void (*OH_CaptureSession_OnError)(Camera_CaptureSession* session, Camera_ErrorCode errorCode)
Description
Defines the callback defined in the CaptureSession_Callbacks struct and used to report capture session errors.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| Camera_ErrorCode errorCode | Error code reported in a capture session. |
See also
OH_CaptureSession_OnSmoothZoomInfo()
typedef void (*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* session, Camera_SmoothZoomInfo* smoothZoomInfo)
Description
Defines the callback invoked when smooth zoom is triggered for a capture session.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| Camera_SmoothZoomInfo* smoothZoomInfo | Pointer to the smooth zoom information passed by the callback. |
OH_CaptureSession_OnAutoDeviceSwitchStatusChange()
typedef void (*OH_CaptureSession_OnAutoDeviceSwitchStatusChange)(Camera_CaptureSession* session, Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo)
Description
Defines the callback used to listen for device switching events.
Since: 13
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo | Pointer to the device switching information passed by the callback. |
OH_CaptureSession_OnSystemPressureLevelChange()
typedef void (*OH_CaptureSession_OnSystemPressureLevelChange)(Camera_CaptureSession* session, Camera_SystemPressureLevel systemPressureLevel)
Description
Defines the callback used to listen for capture system pressure level changes.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| Camera_SystemPressureLevel systemPressureLevel | Pointer to the system pressure level passed by the callback. |
OH_CaptureSession_OnControlCenterEffectStatusChange()
typedef void (*OH_CaptureSession_OnControlCenterEffectStatusChange)(Camera_CaptureSession* session, Camera_ControlCenterStatusInfo* controlCenterStatusInfo)
Description
Defines the callback used to listen for effect status changes of a camera controller.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| Camera_ControlCenterStatusInfo* controlCenterStatusInfo | Pointer to the effect status information passed by the callback. |
OH_CaptureSession_RegisterCallback()
Camera_ErrorCode OH_CaptureSession_RegisterCallback(Camera_CaptureSession* session, CaptureSession_Callbacks* callback)
Description
Registers a callback to listen for capture session events.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| CaptureSession_Callbacks* callback | Pointer to the target callback. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* session, CaptureSession_Callbacks* callback)
Description
Unregisters the callback used to listen for capture session events.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| CaptureSession_Callbacks* callback | Pointer to the target callback. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_RegisterSmoothZoomInfoCallback()
Camera_ErrorCode OH_CaptureSession_RegisterSmoothZoomInfoCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)
Description
Registers a callback to listen for smooth zoom events.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback | Pointer to the target callback. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterSmoothZoomInfoCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterSmoothZoomInfoCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)
Description
Unregisters the callback used to listen for smooth zoom events.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback | Pointer to the target callback. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_SetSessionMode()
Camera_ErrorCode OH_CaptureSession_SetSessionMode(Camera_CaptureSession* session, Camera_SceneMode sceneMode)
Description
Sets a session mode.
This API cannot be called after OH_CaptureSession_BeginConfig.
You are advised to call this function immediately after OH_CameraManager_CreateCaptureSession.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_SceneMode sceneMode | Scene mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_CONFIG_LOCKED: The session configuration is locked. |
OH_CaptureSession_AddSecureOutput()
Camera_ErrorCode OH_CaptureSession_AddSecureOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)
Description
Marks a preview output stream as secure output.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreviewOutput* previewOutput | Pointer to the target Camera_PreviewOutput instance. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_CONFIG_LOCKED: The session configuration is locked. |
OH_CaptureSession_BeginConfig()
Camera_ErrorCode OH_CaptureSession_BeginConfig(Camera_CaptureSession* session)
Description
Starts the configuration for a capture session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_CONFIG_LOCKED: The session configuration is locked. |
OH_CaptureSession_CommitConfig()
Camera_ErrorCode OH_CaptureSession_CommitConfig(Camera_CaptureSession* session)
Description
Commits the configuration for a capture session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_AddInput()
Camera_ErrorCode OH_CaptureSession_AddInput(Camera_CaptureSession* session, Camera_Input* cameraInput)
Description
Adds a Camera_Input instance to a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_Input* cameraInput | Pointer to the Camera_Input instance to add. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_RemoveInput()
Camera_ErrorCode OH_CaptureSession_RemoveInput(Camera_CaptureSession* session, Camera_Input* cameraInput)
Description
Removes a Camera_Input instance from a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_Input* cameraInput | Pointer to the Camera_Input instance to remove. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_AddPreviewOutput()
Camera_ErrorCode OH_CaptureSession_AddPreviewOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)
Description
Adds a PreviewOutput instance to a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreviewOutput* previewOutput | Pointer to the PreviewOutput instance to add. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_RemovePreviewOutput()
Camera_ErrorCode OH_CaptureSession_RemovePreviewOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)
Description
Removes a PreviewOutput instance from a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreviewOutput* previewOutput | Pointer to the PreviewOutput instance to remove. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_AddPhotoOutput()
Camera_ErrorCode OH_CaptureSession_AddPhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)
Description
Adds a PhotoOutput instance to a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PhotoOutput* photoOutput | Pointer to the PhotoOutput instance to add. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_RemovePhotoOutput()
Camera_ErrorCode OH_CaptureSession_RemovePhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)
Description
Removes a PhotoOutput instance from a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PhotoOutput* photoOutput | Pointer to the PhotoOutput instance to remove. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_AddVideoOutput()
Camera_ErrorCode OH_CaptureSession_AddVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)
Description
Adds a VideoOutput instance to a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_VideoOutput* videoOutput | Pointer to the Camera_VideoOutput instance to add. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_RemoveVideoOutput()
Camera_ErrorCode OH_CaptureSession_RemoveVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)
Description
Removes a VideoOutput instance from a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_VideoOutput* videoOutput | Pointer to the VideoOutput instance to remove. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_AddMetadataOutput()
Camera_ErrorCode OH_CaptureSession_AddMetadataOutput(Camera_CaptureSession* session, Camera_MetadataOutput* metadataOutput)
Description
Adds a MetadataOutput instance to a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_MetadataOutput* metadataOutput | Pointer to the MetadataOutput instance to add. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_RemoveMetadataOutput()
Camera_ErrorCode OH_CaptureSession_RemoveMetadataOutput(Camera_CaptureSession* session, Camera_MetadataOutput* metadataOutput)
Description
Removes a MetadataOutput instance from a session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_MetadataOutput* metadataOutput | Pointer to the MetadataOutput instance to remove. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_Start()
Camera_ErrorCode OH_CaptureSession_Start(Camera_CaptureSession* session)
Description
Starts a capture session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance to start. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_Stop()
Camera_ErrorCode OH_CaptureSession_Stop(Camera_CaptureSession* session)
Description
Stops a capture session.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance to stop. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_Release()
Camera_ErrorCode OH_CaptureSession_Release(Camera_CaptureSession* session)
Description
Releases a CaptureSession instance.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance to release. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_HasFlash()
Camera_ErrorCode OH_CaptureSession_HasFlash(Camera_CaptureSession* session, bool* hasFlash)
Description
Checks whether the device has flash.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| bool* hasFlash | Pointer to the check result for whether the device has flash. true if the device has flash, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_IsFlashModeSupported()
Camera_ErrorCode OH_CaptureSession_IsFlashModeSupported(Camera_CaptureSession* session, Camera_FlashMode flashMode, bool* isSupported)
Description
Checks whether a flash mode is supported.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_FlashMode flashMode | Flash mode to check. |
| bool* isSupported | Pointer to the check result for the support of the flash mode. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetFlashMode()
Camera_ErrorCode OH_CaptureSession_GetFlashMode(Camera_CaptureSession* session, Camera_FlashMode* flashMode)
Description
Obtains the flash mode in use.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_FlashMode* flashMode | Pointer to the flash mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetFlashMode()
Camera_ErrorCode OH_CaptureSession_SetFlashMode(Camera_CaptureSession* session, Camera_FlashMode flashMode)
Description
Sets a flash mode for the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_FlashMode flashMode | Flash mode to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_OnFlashStateChange()
typedef void (*OH_CaptureSession_OnFlashStateChange)(const Camera_CaptureSession* session, OH_Camera_FlashState flashState)
Description
Defines the callback used to listen for flash state changes of a camera capture session.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| OH_Camera_FlashState flashState | Flash state passed by the callback. |
OH_CaptureSession_RegisterFlashStateChangeCallback()
Camera_ErrorCode OH_CaptureSession_RegisterFlashStateChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnFlashStateChange flashStateChange)
Description
Registers a callback to listen for flash state changes.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnFlashStateChange flashStateChange | Callback to listen for flash state changes to register. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterFlashStateChangeCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterFlashStateChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnFlashStateChange flashStateChange)
Description
Unregisters the callback to listen for flash state changes.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnFlashStateChange flashStateChange | Callback to listen for flash state changes to unregister. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_IsExposureModeSupported()
Camera_ErrorCode OH_CaptureSession_IsExposureModeSupported(Camera_CaptureSession* session, Camera_ExposureMode exposureMode, bool* isSupported)
Description
Checks whether an exposure mode is supported.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_ExposureMode exposureMode | Exposure mode to check. |
| bool* isSupported | Pointer to the check result for the support of the exposure mode. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetExposureMode()
Camera_ErrorCode OH_CaptureSession_GetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode* exposureMode)
Description
Obtains the exposure mode in use. This API directly returns an invalid value if you have not set the exposure mode using OH_CaptureSession_SetExposureMode.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_ExposureMode* exposureMode | Pointer to the exposure mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetExposureMode()
Camera_ErrorCode OH_CaptureSession_SetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode exposureMode)
Description
Sets an exposure mode for the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_ExposureMode exposureMode | Exposure mode to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetMeteringPoint()
Camera_ErrorCode OH_CaptureSession_GetMeteringPoint(Camera_CaptureSession* session, Camera_Point* point)
Description
Obtains the metering point in use.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_Point* point | Pointer to the metering point. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetMeteringPoint()
Camera_ErrorCode OH_CaptureSession_SetMeteringPoint(Camera_CaptureSession* session, Camera_Point point)
Description
Sets the metering point, which is the center point of the metering rectangle.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_Point point | Metering point to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_IsExposureMeteringModeSupported()
Camera_ErrorCode OH_CaptureSession_IsExposureMeteringModeSupported(const Camera_CaptureSession* session, OH_Camera_ExposureMeteringMode exposureMeteringMode, bool* isSupported)
Description
Checks whether the specified exposure metering mode is supported.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_ExposureMeteringMode exposureMeteringMode | Exposure metering mode to check. |
| bool* isSupported | Whether the exposure mode is supported. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetExposureMeteringMode()
Camera_ErrorCode OH_CaptureSession_GetExposureMeteringMode(const Camera_CaptureSession* session, OH_Camera_ExposureMeteringMode* exposureMeteringMode)
Description
Obtains the exposure metering mode in use.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_ExposureMeteringMode* exposureMeteringMode | Exposure metering mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetExposureMeteringMode()
Camera_ErrorCode OH_CaptureSession_SetExposureMeteringMode(const Camera_CaptureSession* session, OH_Camera_ExposureMeteringMode exposureMeteringMode)
Description
Sets exposure metering mode.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_ExposureMeteringMode exposureMeteringMode | Exposure metering mode to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetSupportedISORange()
Camera_ErrorCode OH_CaptureSession_GetSupportedISORange(const Camera_CaptureSession* session, int32_t *minIsoValue, int32_t *maxIsoValue)
Description
Obtains the ISO range.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| int32_t *minIsoValue | Minimum ISO value. |
| int32_t *maxIsoValue | Maximum ISO value. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetIso()
Camera_ErrorCode OH_CaptureSession_GetIso(const Camera_CaptureSession* session, int32_t* isoValue)
Description
Obtains the ISO sensitivity or ISO speed (compliant with the ISO 12232:2006 standard).
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| int32_t* isoValue | ISO sensitivity or ISO speed. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetIso()
Camera_ErrorCode OH_CaptureSession_SetIso(const Camera_CaptureSession* session, int32_t isoValue)
Description
Sets the ISO sensitivity or ISO speed. The value must be within the range specified by OH_CaptureSession_GetSupportedISORange and takes effect only when the exposure mode is set to EXPOSURE_MODE_LOCKED.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| int32_t isoValue | Target ISO value to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetSupportedPhysicalApertures()
Camera_ErrorCode OH_CaptureSession_GetSupportedPhysicalApertures(const Camera_CaptureSession* session, OH_Camera_PhysicalAperture** apertures, uint32_t* size)
Description
Obtains the supported physical apertures. Call OH_CaptureSession_DeletePhysicalApertures to delete the supported physical apertures.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| OH_Camera_PhysicalAperture** apertures | Pointer to the array used to store physical aperture values. |
| uint32_t* size | Array size. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_DeletePhysicalApertures()
Camera_ErrorCode OH_CaptureSession_DeletePhysicalApertures(const Camera_CaptureSession* session, OH_Camera_PhysicalAperture* apertures, uint32_t size)
Description
Deletes the supported physical apertures.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_PhysicalAperture* apertures | Array of physical apertures to delete. |
| uint32_t size | Array size. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_GetPhysicalAperture()
Camera_ErrorCode OH_CaptureSession_GetPhysicalAperture(const Camera_CaptureSession* session, double* aperture)
Description
Obtains the physical aperture in use.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| double* aperture | Aperture value. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetPhysicalAperture()
Camera_ErrorCode OH_CaptureSession_SetPhysicalAperture(const Camera_CaptureSession* session, double aperture)
Description
Sets a physical aperture.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| double aperture | Aperture value to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetExposureBiasRange()
Camera_ErrorCode OH_CaptureSession_GetExposureBiasRange(Camera_CaptureSession* session, float* minExposureBias, float* maxExposureBias, float* step)
Description
Obtains the exposure compensation values of the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float* minExposureBias | Pointer to the minimum exposure compensation value. |
| float* maxExposureBias | Pointer to the maximum exposure compensation value. |
| float* step | Pointer to the exposure compensation step. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetExposureBias()
Camera_ErrorCode OH_CaptureSession_SetExposureBias(Camera_CaptureSession* session, float exposureBias)
Description
Sets an exposure compensation value for the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float exposureBias | Exposure compensation value to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetExposureBias()
Camera_ErrorCode OH_CaptureSession_GetExposureBias(Camera_CaptureSession* session, float* exposureBias)
Description
Obtains the exposure compensation value in use.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float* exposureBias | Pointer to the exposure compensation value. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetSupportedExposureDurationRange()
Camera_ErrorCode OH_CaptureSession_GetSupportedExposureDurationRange(const Camera_CaptureSession* session, int32_t* minExposureDuration, int32_t* maxExposureDuration)
Description
Obtains the supported exposure durations, in microseconds.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| int32_t* minExposureDuration | Minimum exposure duration. |
| int32_t* maxExposureDuration | Maximum exposure duration. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetExposureDuration()
Camera_ErrorCode OH_CaptureSession_SetExposureDuration(const Camera_CaptureSession* session, int32_t exposureDuration)
Description
Sets the exposure duration, in microseconds. If the sensor cannot use the set exposure duration, the system automatically adjusts it to a value closest to the set value and reports the value to the application by calling OH_CaptureSession_OnExposureDurationChange.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| int32_t exposureDuration | Target exposure duration to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetExposureDuration()
Camera_ErrorCode OH_CaptureSession_GetExposureDuration(const Camera_CaptureSession* session, int32_t* exposureDuration)
Description
Obtains the exposure duration, in microseconds.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| int32_t* exposureDuration | Exposure duration. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_OnExposureDurationChange()
typedef void (*OH_CaptureSession_OnExposureDurationChange)(const Camera_CaptureSession* session, int32_t exposureDuration)
Description
Defines the callback used to listen for exposure duration changes of a camera capture session.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| int32_t exposureDuration | Exposure duration passed by the callback. |
OH_CaptureSession_RegisterExposureInfoChangeCallback()
Camera_ErrorCode OH_CaptureSession_RegisterExposureInfoChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnExposureDurationChange exposureDurationChange)
Description
Registers a callback to listen for exposure information changes. After the exposure parameters are modified, the system returns the updated exposure information.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnExposureDurationChange exposureDurationChange | Callback to listen for exposure duration changes to register. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterExposureInfoChangeCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterExposureInfoChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnExposureDurationChange exposureDurationChange)
Description
Unregisters the callback to listen for exposure information changes. This method is called after the camera operation is complete.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnExposureDurationChange exposureDurationChange | Callback to listen for exposure duration changes to unregister. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_IsFocusModeSupported()
Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported(Camera_CaptureSession* session, Camera_FocusMode focusMode, bool* isSupported)
Description
Checks whether a focus mode is supported.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_FocusMode focusMode | Focus mode to check. |
| bool* isSupported | Pointer to the check result for the support of the focus mode. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetFocusMode()
Camera_ErrorCode OH_CaptureSession_GetFocusMode(Camera_CaptureSession* session, Camera_FocusMode* focusMode)
Description
Obtains the focus mode in use.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_FocusMode* focusMode | Pointer to the focus mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetFocusMode()
Camera_ErrorCode OH_CaptureSession_SetFocusMode(Camera_CaptureSession* session, Camera_FocusMode focusMode)
Description
Sets a focus mode for the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_FocusMode focusMode | Focus mode to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetFocusPoint()
Camera_ErrorCode OH_CaptureSession_GetFocusPoint(Camera_CaptureSession* session, Camera_Point* focusPoint)
Description
Obtains the focal point in use.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_Point* focusPoint | Pointer to the focal point. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetFocusPoint()
Camera_ErrorCode OH_CaptureSession_SetFocusPoint(Camera_CaptureSession* session, Camera_Point focusPoint)
Description
Sets a focal point for the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_Point focusPoint | Focal point to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetZoomRatioRange()
Camera_ErrorCode OH_CaptureSession_GetZoomRatioRange(Camera_CaptureSession* session, float* minZoom, float* maxZoom)
Description
Obtains the supported zoom ratio range.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float* minZoom | Pointer to the minimum zoom ratio. |
| float* maxZoom | Pointer to the maximum zoom ratio. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetZoomRatio()
Camera_ErrorCode OH_CaptureSession_GetZoomRatio(Camera_CaptureSession* session, float* zoom)
Description
Obtains the zoom ratio in use.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float* zoom | Pointer to the zoom ratio. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetZoomRatio()
Camera_ErrorCode OH_CaptureSession_SetZoomRatio(Camera_CaptureSession* session, float zoom)
Description
Sets a zoom ratio for the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float zoom | Target zoom ratio. 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. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_IsVideoStabilizationModeSupported()
Camera_ErrorCode OH_CaptureSession_IsVideoStabilizationModeSupported(Camera_CaptureSession* session, Camera_VideoStabilizationMode mode, bool* isSupported)
Description
Checks whether a video stabilization mode is supported.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_VideoStabilizationMode mode | Video stabilization mode to check. |
| bool* isSupported | Pointer to the check result for the support of the video stabilization mode. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetVideoStabilizationMode()
Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode(Camera_CaptureSession* session, Camera_VideoStabilizationMode* mode)
Description
Obtains the video stabilization mode in use.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_VideoStabilizationMode* mode | Pointer to the video stabilization mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetVideoStabilizationMode()
Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode(Camera_CaptureSession* session, Camera_VideoStabilizationMode mode)
Description
Sets a video stabilization mode for the device.
Since: 11
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_VideoStabilizationMode mode | Video stabilization mode to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_CanAddInput()
Camera_ErrorCode OH_CaptureSession_CanAddInput(Camera_CaptureSession* session, Camera_Input* cameraInput, bool* isSuccessful)
Description
Checks whether a Camera_Input instance can be added to a session.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_Input* cameraInput | Pointer to the Camera_Input instance to check. |
| bool* isSuccessful | Pointer to the check result for whether the Camera_Input instance can be added to the session. true if it can be added to the session, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_CanAddPreviewOutput()
Camera_ErrorCode OH_CaptureSession_CanAddPreviewOutput(Camera_CaptureSession* session, Camera_PreviewOutput* cameraOutput, bool* isSuccessful)
Description
Checks whether a PreviewOutput instance can be added to a session.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreviewOutput* cameraOutput | Pointer to the PreviewOutput instance to check. |
| bool* isSuccessful | Pointer to the check result for whether the PreviewOutput instance can be added to the session. true if it can be added to the session, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_CanAddPhotoOutput()
Camera_ErrorCode OH_CaptureSession_CanAddPhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* cameraOutput, bool* isSuccessful)
Description
Checks whether a PhotoOutput instance can be added to a session.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PhotoOutput* cameraOutput | Pointer to the PhotoOutput instance to check. |
| bool* isSuccessful | Pointer to the check result for whether the PhotoOutput instance can be added to the session. true if it can be added to the session, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_CanAddVideoOutput()
Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* cameraOutput, bool* isSuccessful)
Description
Checks whether a VideoOutput instance can be added to a session.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_VideoOutput* cameraOutput | Pointer to the Camera_VideoOutput instance to add. |
| bool* isSuccessful | Pointer to the check result for whether the VideoOutput instance can be added to the session. true if it can be added to the session, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_CanPreconfig()
Camera_ErrorCode OH_CaptureSession_CanPreconfig(Camera_CaptureSession* session, Camera_PreconfigType preconfigType, bool* canPreconfig)
Description
Checks whether a preconfigured resolution type is supported.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreconfigType preconfigType | Target preconfigured resolution type. |
| bool* canPreconfig | Pointer to the check result for the support of the preconfigured resolution type. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_CanPreconfigWithRatio()
Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio(Camera_CaptureSession* session, Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, bool* canPreconfig)
Description
Checks whether a preconfigured resolution type with an aspect ratio is supported.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreconfigType preconfigType | Target preconfigured resolution type. |
| Camera_PreconfigRatio preconfigRatio | Target preconfigured aspect ratio. |
| bool* canPreconfig | Pointer to the check result for the support of the preconfigured resolution type. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_Preconfig()
Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session, Camera_PreconfigType preconfigType)
Description
Sets a preconfigured resolution type.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreconfigType preconfigType | Target preconfigured resolution type. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_PreconfigWithRatio()
Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio(Camera_CaptureSession* session, Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio)
Description
Sets a preconfigured resolution type with an aspect ratio.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_PreconfigType preconfigType | Target preconfigured resolution type. |
| Camera_PreconfigRatio preconfigRatio | Target preconfigured aspect ratio. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_GetExposureValue()
Camera_ErrorCode OH_CaptureSession_GetExposureValue(Camera_CaptureSession* session, float* exposureValue)
Description
Obtains the exposure value.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float* exposureValue | Pointer to the exposure value. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_GetFocalLength()
Camera_ErrorCode OH_CaptureSession_GetFocalLength(Camera_CaptureSession* session, float* focalLength)
Description
Obtains the current focal length.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float* focalLength | Pointer to the focal length. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetFocusDistance()
Camera_ErrorCode OH_CaptureSession_GetFocusDistance(const Camera_CaptureSession* session, float* focusDistance)
Description
Obtains the focus distance in use. The value range is [0.0, 1.0], where 0.0 indicates the shortest achievable focus distance and 1.0 indicates the longest focus distance. The default value is 1.0.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| float* focusDistance | Focus distance. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or input device may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetFocusDistance()
Camera_ErrorCode OH_CaptureSession_SetFocusDistance(const Camera_CaptureSession* session, float focusDistance)
Description
Sets the focus distance. The value range is [0.0, 1.0], where 0.0 indicates the shortest achievable focus distance and 1.0 indicates the longest focus distance. The default value is 1.0.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| float focusDistance | Focus distance to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or input device may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_IsFocusDistanceSupported()
Camera_ErrorCode OH_CaptureSession_IsFocusDistanceSupported(const Camera_CaptureSession* session, bool* isSupported)
Description
Checks whether the focus distance can be set.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| bool* isSupported | Whether the focus distance is supported. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetSmoothZoom()
Camera_ErrorCode OH_CaptureSession_SetSmoothZoom(Camera_CaptureSession* session, float targetZoom, Camera_SmoothZoomMode smoothZoomMode)
Description
Sets smooth zoom.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float targetZoom | Target zoom ratio. |
| Camera_SmoothZoomMode smoothZoomMode | Smooth zoom mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetSupportedColorSpaces()
Camera_ErrorCode OH_CaptureSession_GetSupportedColorSpaces(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace** colorSpace, uint32_t* size)
Description
Obtains the supported color spaces.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| 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. |
| uint32_t* size | Pointer to the size of the list of supported color spaces. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_DeleteColorSpaces()
Camera_ErrorCode OH_CaptureSession_DeleteColorSpaces(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace* colorSpace)
Description
Deletes color spaces.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| OH_NativeBuffer_ColorSpace* colorSpace | Pointer to the list of color spaces, which are defined in the OH_NativeBuffer_ColorSpace struct. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_GetActiveColorSpace()
Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace* colorSpace)
Description
Obtains the active color space.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| OH_NativeBuffer_ColorSpace* colorSpace | Pointer to the OH_NativeBuffer_ColorSpace instance. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetActiveColorSpace()
Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace colorSpace)
Description
Sets the active color space.
Since: 12
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| OH_NativeBuffer_ColorSpace colorSpace | Target OH_NativeBuffer_ColorSpace instance. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback()
Camera_ErrorCode OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)
Description
Registers a callback to listen for device switching changes.
Since: 13
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange | Target callback. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)
Description
Unregisters the callback used to listen for device switching changes.
Since: 13
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange | Target callback. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_IsAutoDeviceSwitchSupported()
Camera_ErrorCode OH_CaptureSession_IsAutoDeviceSwitchSupported(Camera_CaptureSession* session, bool* isSupported)
Description
Checks whether automatic device switching is supported.
Since: 13
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| bool* isSupported | Pointer to the check result for the support of automatic device switching. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_EnableAutoDeviceSwitch()
Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* session, bool enabled)
Description
Enables or disables automatic device switching.
Since: 13
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| bool enabled | Whether to enable or disable automatic switching. true to enable, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_RegisterSystemPressureLevelChangeCallback()
Camera_ErrorCode OH_CaptureSession_RegisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)
Description
Registers a callback to listen for capture system pressure level changes.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange | Target callback, which is OH_CaptureSession_OnSystemPressureLevelChange. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterSystemPressureLevelChangeCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)
Description
Unregisters the callback used to listen for capture system pressure level changes.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange | Target callback, which is OH_CaptureSession_OnSystemPressureLevelChange. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_SetQualityPrioritization()
Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization(Camera_CaptureSession* session, Camera_QualityPrioritization qualityPrioritization)
Description
Sets the priority level for video recording quality.
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. It is recommended that this API be called between OH_CaptureSession_CommitConfig and OH_CaptureSession_Start.
Since: 14
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_QualityPrioritization qualityPrioritization | Priority level to set. The default value is HIGH_QUALITY. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_IsMacroSupported()
Camera_ErrorCode OH_CaptureSession_IsMacroSupported(Camera_CaptureSession* session, bool* isSupported)
Description
Checks whether macro photography is supported.
Since: 19
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| bool* isSupported | Pointer to the check result for the support of macro photography. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK = 0: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_EnableMacro()
Camera_ErrorCode OH_CaptureSession_EnableMacro(Camera_CaptureSession* session, bool enabled)
Description
Enables or disables macro photography for the camera device.
Since: 19
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| bool enabled | Whether to enable or disable macro capability. true to enable, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK = 0: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. |
OH_CaptureSession_SetWhiteBalance()
Camera_ErrorCode OH_CaptureSession_SetWhiteBalance(Camera_CaptureSession* session, int32_t colorTemperature)
Description
Sets the white balance color temperature.
Before setting this parameter, you are advised to use OH_CaptureSession_GetWhiteBalanceRange to obtain the supported white balance color temperature range.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| int32_t colorTemperature | Color temperature, in Kelvin. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The setting is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The camera session is not configured. |
OH_CaptureSession_GetWhiteBalance()
Camera_ErrorCode OH_CaptureSession_GetWhiteBalance(Camera_CaptureSession* session, int32_t *colorTemperature)
Description
Obtains the white balance color temperature.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| int32_t *colorTemperature | Color temperature, in Kelvin. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The function is successfully called. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The camera session is not configured. |
OH_CaptureSession_GetWhiteBalanceMode()
Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode* whiteBalanceMode)
Description
Obtains the white balance mode in use.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_WhiteBalanceMode* whiteBalanceMode | Pointer to the white balance mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The function is successfully called. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The camera session is not configured. |
OH_CaptureSession_IsWhiteBalanceModeSupported()
Camera_ErrorCode OH_CaptureSession_IsWhiteBalanceModeSupported(Camera_CaptureSession* session, Camera_WhiteBalanceMode whiteBalanceMode, bool* isSupported)
Description
Checks whether the specified white balance mode is supported.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_WhiteBalanceMode whiteBalanceMode | White balance mode. |
| bool* isSupported | Pointer to the check result for the support of the specified white balance mode. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The function is successfully called. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The camera session is not configured. |
OH_CaptureSession_SetWhiteBalanceMode()
Camera_ErrorCode OH_CaptureSession_SetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode whiteBalanceMode)
Description
Sets a white balance mode.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_WhiteBalanceMode whiteBalanceMode | Pointer to the white balance mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The setting is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The camera session is not configured. |
OH_CaptureSession_GetWhiteBalanceRange()
Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceRange(Camera_CaptureSession* session, int32_t *minColorTemperature, int32_t *maxColorTemperature)
Description
Obtains the supported white balance color temperature range.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| int32_t *minColorTemperature | Pointer to the minimum supported color temperature, in Kelvin. |
| int32_t *maxColorTemperature | Pointer to the maximum supported color temperature, in Kelvin. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The function is successfully called. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The camera session is not configured. |
OH_CaptureSession_IsControlCenterSupported()
Camera_ErrorCode OH_CaptureSession_IsControlCenterSupported(Camera_CaptureSession* session, bool* isSupported)
Description
Checks whether the camera controller is supported.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| bool* isSupported | Pointer to the check result for the support of the camera controller. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK = 0: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetSupportedEffectTypes()
Camera_ErrorCode OH_CaptureSession_GetSupportedEffectTypes(Camera_CaptureSession* session, Camera_ControlCenterEffectType** types, uint32_t* size)
Description
Obtains the effect types supported by the camera controller.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| 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. |
| uint32_t* size | Pointer to the size of the list of supported effect types. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_DeleteSupportedEffectTypes()
Camera_ErrorCode OH_CaptureSession_DeleteSupportedEffectTypes(Camera_CaptureSession* session, Camera_ControlCenterEffectType* types, uint32_t size)
Description
Deletes the effect types supported by the camera controller.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| Camera_ControlCenterEffectType* types | Pointer to the list of effect types, which are defined in the Camera_ControlCenterEffectType struct. |
| uint32_t size | Size of the list of supported effect types. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_EnableControlCenter()
Camera_ErrorCode OH_CaptureSession_EnableControlCenter(Camera_CaptureSession* session, bool enabled)
Description
Enables or disables the camera controller.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| bool enabled | Whether to enable the camera controller. true to enable, false otherwise. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK = 0: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal. |
OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback()
Camera_ErrorCode OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)
Description
Registers a callback to listen for effect status changes of a camera controller.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange | Target callback, which is OH_CaptureSession_OnControlCenterEffectStatusChange. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)
Description
Unregisters the callback used to listen for effect status changes of a camera controller.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
| OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange | Target callback, which is OH_CaptureSession_OnControlCenterEffectStatusChange. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_OnMacroStatusChange()
typedef void (*OH_CaptureSession_OnMacroStatusChange)(Camera_CaptureSession* session, bool isMacroDetected)
Description
Defines the callback used to listen for macro status changes of a camera session.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| bool isMacroDetected | Whether the camera is in macro mode. true if the camera is in macro mode, false otherwise. |
OH_CaptureSession_RegisterMacroStatusChangeCallback()
Camera_ErrorCode OH_CaptureSession_RegisterMacroStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange)
Description
Registers a callback to listen for macro status changes of a camera session.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnMacroStatusChange macroStatusChange | Callback used to return the macro status change. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterMacroStatusChangeCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterMacroStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange)
Description
Unregisters the callback used to listen for macro status changes of a camera session.
Since: 20
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnMacroStatusChange macroStatusChange | Callback used to return the macro status change. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_OnIsoChange()
typedef void (*OH_CaptureSession_OnIsoChange)(Camera_CaptureSession* session, int32_t isoValue)
Description
Defines the callback used to listen for ISO changes in a camera session.
Since: 22
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| int32_t isoValue | ISO value obtained in the callback. |
OH_CaptureSession_RegisterIsoChangeCallback()
Camera_ErrorCode OH_CaptureSession_RegisterIsoChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnIsoChange isoChange)
Description
Registers a callback to listen for ISO changes.
Since: 22
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnIsoChange isoChange | Callback of the OH_CaptureSession_OnIsoChange type, which is used to listen for ISO changes. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_UnregisterIsoChangeCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterIsoChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnIsoChange isoChange)
Description
Unregisters the callback used to listen for ISO changes.
Since: 22
Parameters
| Name | Description |
|---|---|
| Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_CaptureSession_OnIsoChange isoChange | Callback of the OH_CaptureSession_OnIsoChange type, which is used to listen for ISO changes. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. |
OH_CaptureSession_GetRAWCaptureZoomRatioRange()
Camera_ErrorCode OH_CaptureSession_GetRAWCaptureZoomRatioRange(const Camera_CaptureSession* session, float* minZoom, float* maxZoom)
Description
Obtains the supported zoom range of the physical camera during shooting in RAW format.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the target Camera_CaptureSession instance. |
| float* minZoom | Minimum zoom ratio. |
| float* maxZoom | Maximum zoom ratio. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. The session or camera status may be abnormal. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_IsOISModeSupported()
Camera_ErrorCode OH_CaptureSession_IsOISModeSupported(const Camera_CaptureSession* session, OH_Camera_OISMode oisMode, bool* isSupported)
Description
Checks whether the optical image stabilization (OIS) mode is supported.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_OISMode oisMode | OIS mode to check. |
| bool* isSupported | Whether the device supports the mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetSupportedOISBiasRange()
Camera_ErrorCode OH_CaptureSession_GetSupportedOISBiasRange(const Camera_CaptureSession* session, OH_Camera_OISAxes oisAxis, float* minBias, float* maxBias, float* step)
Description
Obtains the offset range supported on the specified OIS axis.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_OISAxes oisAxis | OIS axis. |
| float* minBias | Minimum offset. |
| float* maxBias | Maximum offset. |
| float* step | Offset step. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetCurrentOISMode()
Camera_ErrorCode OH_CaptureSession_GetCurrentOISMode(const Camera_CaptureSession* session, OH_Camera_OISMode* oisMode)
Description
Obtains the OIS mode.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_OISMode* oisMode | OIS mode. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_GetCurrentCustomOISBias()
Camera_ErrorCode OH_CaptureSession_GetCurrentCustomOISBias(const Camera_CaptureSession* session, float* pitchBias, float* yawBias)
Description
Obtains the custom offsets on all OIS axes.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| float* pitchBias | Offset on the pitch axis. |
| float* yawBias | Offset on the yaw axis. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetOISMode()
Camera_ErrorCode OH_CaptureSession_SetOISMode(const Camera_CaptureSession* session, OH_Camera_OISMode oisMode)
Description
Sets the OIS mode.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| OH_Camera_OISMode oisMode | OIS mode to set. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |
OH_CaptureSession_SetOISModeCustom()
Camera_ErrorCode OH_CaptureSession_SetOISModeCustom(const Camera_CaptureSession* session, float pitchBias, float yawBias)
Description
Sets the custom offset for an OIS axis.
Since: 24
Parameters
| Name | Description |
|---|---|
| const Camera_CaptureSession* session | Pointer to the Camera_CaptureSession instance. |
| float pitchBias | Offset on the pitch axis. |
| float yawBias | Offset on the yaw axis. |
Returns
| Type | Description |
|---|---|
| Camera_ErrorCode | CAMERA_OK: The operation is successful. CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect. CAMERA_OPERATION_NOT_ALLOWED: The operation is not allowed. CAMERA_SESSION_NOT_CONFIG: The capture session is not configured. |