openharmony 鸿蒙 capi-capture-session-h

2026-08-25 浏览 (1)

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

Nametypedef KeywordDescription
CaptureSession_CallbacksCaptureSession_CallbacksDescribes the callbacks used for a capture session.
Camera_CaptureSessionCamera_CaptureSessionDescribes the capture session object.
You can use OH_CameraManager_CreateCaptureSession to create such an object.

Functions

Nametypedef KeywordDescription
typedef void (*OH_CaptureSession_OnFocusStateChange)(Camera_CaptureSession* session, Camera_FocusState focusState)OH_CaptureSession_OnFocusStateChangeDefines the callback defined in the CaptureSession_Callbacks struct and used to report focus status changes of a capture session.
typedef void (*OH_CaptureSession_OnError)(Camera_CaptureSession* session, Camera_ErrorCode errorCode)OH_CaptureSession_OnErrorDefines the callback defined in the CaptureSession_Callbacks struct and used to report capture session errors.
typedef void (*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* session, Camera_SmoothZoomInfo* smoothZoomInfo)OH_CaptureSession_OnSmoothZoomInfoDefines the callback invoked when smooth zoom is triggered for a capture session.
typedef void (*OH_CaptureSession_OnAutoDeviceSwitchStatusChange)(Camera_CaptureSession* session, Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo)OH_CaptureSession_OnAutoDeviceSwitchStatusChangeDefines the callback used to listen for device switching events.
typedef void (*OH_CaptureSession_OnSystemPressureLevelChange)(Camera_CaptureSession* session, Camera_SystemPressureLevel systemPressureLevel)OH_CaptureSession_OnSystemPressureLevelChangeDefines the callback used to listen for capture system pressure level changes.
typedef void (*OH_CaptureSession_OnControlCenterEffectStatusChange)(Camera_CaptureSession* session, Camera_ControlCenterStatusInfo* controlCenterStatusInfo)OH_CaptureSession_OnControlCenterEffectStatusChangeDefines the callback used to listen for effect status changes of a camera controller.
Camera_ErrorCode OH_CaptureSession_RegisterCallback(Camera_CaptureSession* session, CaptureSession_Callbacks* callback)-Registers a callback to listen for capture session events.
Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* session, CaptureSession_Callbacks* callback)-Unregisters the callback used to listen for capture session events.
Camera_ErrorCode OH_CaptureSession_RegisterSmoothZoomInfoCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)-Registers a callback to listen for smooth zoom events.
Camera_ErrorCode OH_CaptureSession_UnregisterSmoothZoomInfoCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback)-Unregisters the callback used to listen for smooth zoom events.
Camera_ErrorCode OH_CaptureSession_SetSessionMode(Camera_CaptureSession* session, Camera_SceneMode sceneMode)-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.
Camera_ErrorCode OH_CaptureSession_AddSecureOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)-Marks a preview output stream as secure output.
Camera_ErrorCode OH_CaptureSession_BeginConfig(Camera_CaptureSession* session)-Starts the configuration for a capture session.
Camera_ErrorCode OH_CaptureSession_CommitConfig(Camera_CaptureSession* session)-Commits the configuration for a capture session.
Camera_ErrorCode OH_CaptureSession_AddInput(Camera_CaptureSession* session, Camera_Input* cameraInput)-Adds a Camera_Input instance to a session.
Camera_ErrorCode OH_CaptureSession_RemoveInput(Camera_CaptureSession* session, Camera_Input* cameraInput)-Removes a Camera_Input instance from a session.
Camera_ErrorCode OH_CaptureSession_AddPreviewOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)-Adds a PreviewOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemovePreviewOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput)-Removes a PreviewOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_AddPhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)-Adds a PhotoOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemovePhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput)-Removes a PhotoOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_AddVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)-Adds a VideoOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemoveVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput)-Removes a VideoOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_AddMetadataOutput(Camera_CaptureSession* session, Camera_MetadataOutput* metadataOutput)-Adds a MetadataOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemoveMetadataOutput(Camera_CaptureSession* session, Camera_MetadataOutput* metadataOutput)-Removes a MetadataOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_Start(Camera_CaptureSession* session)-Starts a capture session.
Camera_ErrorCode OH_CaptureSession_Stop(Camera_CaptureSession* session)-Stops a capture session.
Camera_ErrorCode OH_CaptureSession_Release(Camera_CaptureSession* session)-Releases a CaptureSession instance.
Camera_ErrorCode OH_CaptureSession_HasFlash(Camera_CaptureSession* session, bool* hasFlash)-Checks whether the device has flash.
Camera_ErrorCode OH_CaptureSession_IsFlashModeSupported(Camera_CaptureSession* session, Camera_FlashMode flashMode, bool* isSupported)-Checks whether a flash mode is supported.
Camera_ErrorCode OH_CaptureSession_GetFlashMode(Camera_CaptureSession* session, Camera_FlashMode* flashMode)-Obtains the flash mode in use.
Camera_ErrorCode OH_CaptureSession_SetFlashMode(Camera_CaptureSession* session, Camera_FlashMode flashMode)-Sets a flash mode for the device.
typedef void (*OH_CaptureSession_OnFlashStateChange)(const Camera_CaptureSession* session, OH_Camera_FlashState flashState)OH_CaptureSession_OnFlashStateChangeDefines the callback used to listen for flash state changes of a camera capture session.
Camera_ErrorCode OH_CaptureSession_RegisterFlashStateChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnFlashStateChange flashStateChange)-Registers a callback to listen for flash state changes.
Camera_ErrorCode OH_CaptureSession_UnregisterFlashStateChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnFlashStateChange flashStateChange)-Unregisters the callback to listen for flash state changes.
Camera_ErrorCode OH_CaptureSession_IsExposureModeSupported(Camera_CaptureSession* session, Camera_ExposureMode exposureMode, bool* isSupported)-Checks whether an exposure mode is supported.
Camera_ErrorCode OH_CaptureSession_GetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode* exposureMode)-Obtains the exposure mode in use.
Camera_ErrorCode OH_CaptureSession_SetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode exposureMode)-Sets an exposure mode for the device.
Camera_ErrorCode OH_CaptureSession_GetMeteringPoint(Camera_CaptureSession* session, Camera_Point* point)-Obtains the metering point in use.
Camera_ErrorCode OH_CaptureSession_SetMeteringPoint(Camera_CaptureSession* session, Camera_Point point)-Sets the metering point, which is the center point of the metering rectangle.
Camera_ErrorCode OH_CaptureSession_IsExposureMeteringModeSupported(const Camera_CaptureSession* session, OH_Camera_ExposureMeteringMode exposureMeteringMode, bool* isSupported)-Checks whether the specified exposure metering mode is supported.
Camera_ErrorCode OH_CaptureSession_GetExposureMeteringMode(const Camera_CaptureSession* session, OH_Camera_ExposureMeteringMode* exposureMeteringMode)-Obtains the exposure metering mode in use.
Camera_ErrorCode OH_CaptureSession_SetExposureMeteringMode(const Camera_CaptureSession* session, OH_Camera_ExposureMeteringMode exposureMeteringMode)-Sets exposure metering mode.
Camera_ErrorCode OH_CaptureSession_GetSupportedISORange(const Camera_CaptureSession* session, int32_t *minIsoValue, int32_t *maxIsoValue)-Obtains the ISO range.
Camera_ErrorCode OH_CaptureSession_GetIso(const Camera_CaptureSession* session, int32_t* isoValue)-Obtains the ISO sensitivity or ISO speed (compliant with the ISO 12232:2006 standard).
Camera_ErrorCode OH_CaptureSession_SetIso(const Camera_CaptureSession* session, int32_t isoValue)-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.
Camera_ErrorCode OH_CaptureSession_GetSupportedPhysicalApertures(const Camera_CaptureSession* session, OH_Camera_PhysicalAperture** apertures, uint32_t* size)-Obtains the supported physical apertures. Call OH_CaptureSession_DeletePhysicalApertures to delete the supported physical apertures.
Camera_ErrorCode OH_CaptureSession_DeletePhysicalApertures(const Camera_CaptureSession* session, OH_Camera_PhysicalAperture* apertures, uint32_t size)-Deletes the supported physical apertures.
Camera_ErrorCode OH_CaptureSession_GetPhysicalAperture(const Camera_CaptureSession* session, double* aperture)-Obtains the physical aperture in use.
Camera_ErrorCode OH_CaptureSession_SetPhysicalAperture(const Camera_CaptureSession* session, double aperture)-Sets a physical aperture.
Camera_ErrorCode OH_CaptureSession_GetExposureBiasRange(Camera_CaptureSession* session, float* minExposureBias, float* maxExposureBias, float* step)-Obtains the exposure compensation values of the device.
Camera_ErrorCode OH_CaptureSession_SetExposureBias(Camera_CaptureSession* session, float exposureBias)-Sets an exposure compensation value for the device.
Camera_ErrorCode OH_CaptureSession_GetExposureBias(Camera_CaptureSession* session, float* exposureBias)-Obtains the exposure compensation value in use.
Camera_ErrorCode OH_CaptureSession_GetSupportedExposureDurationRange(const Camera_CaptureSession* session, int32_t* minExposureDuration, int32_t* maxExposureDuration)-Obtains the supported exposure durations, in microseconds.
Camera_ErrorCode OH_CaptureSession_SetExposureDuration(const Camera_CaptureSession* session, int32_t exposureDuration)-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.
Camera_ErrorCode OH_CaptureSession_GetExposureDuration(const Camera_CaptureSession* session, int32_t* exposureDuration)-Obtains the exposure duration, in microseconds.
typedef void (*OH_CaptureSession_OnExposureDurationChange)(const Camera_CaptureSession* session, int32_t exposureDuration)OH_CaptureSession_OnExposureDurationChangeDefines the callback used to listen for exposure duration changes of a camera capture session.
Camera_ErrorCode OH_CaptureSession_RegisterExposureInfoChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnExposureDurationChange exposureDurationChange)-Registers a callback to listen for exposure information changes. After the exposure parameters are modified, the system returns the updated exposure information.
Camera_ErrorCode OH_CaptureSession_UnregisterExposureInfoChangeCallback(const Camera_CaptureSession* session, OH_CaptureSession_OnExposureDurationChange exposureDurationChange)-Unregisters the callback to listen for exposure information changes. This method is called after the camera operation is complete.
Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported(Camera_CaptureSession* session, Camera_FocusMode focusMode, bool* isSupported)-Checks whether a focus mode is supported.
Camera_ErrorCode OH_CaptureSession_GetFocusMode(Camera_CaptureSession* session, Camera_FocusMode* focusMode)-Obtains the focus mode in use.
Camera_ErrorCode OH_CaptureSession_SetFocusMode(Camera_CaptureSession* session, Camera_FocusMode focusMode)-Sets a focus mode for the device.
Camera_ErrorCode OH_CaptureSession_GetFocusPoint(Camera_CaptureSession* session, Camera_Point* focusPoint)-Obtains the focal point in use.
Camera_ErrorCode OH_CaptureSession_SetFocusPoint(Camera_CaptureSession* session, Camera_Point focusPoint)-Sets a focal point for the device.
Camera_ErrorCode OH_CaptureSession_GetZoomRatioRange(Camera_CaptureSession* session, float* minZoom, float* maxZoom)-Obtains the supported zoom ratio range.
Camera_ErrorCode OH_CaptureSession_GetZoomRatio(Camera_CaptureSession* session, float* zoom)-Obtains the zoom ratio in use.
Camera_ErrorCode OH_CaptureSession_SetZoomRatio(Camera_CaptureSession* session, float zoom)-Sets a zoom ratio for the device.
Camera_ErrorCode OH_CaptureSession_IsVideoStabilizationModeSupported(Camera_CaptureSession* session, Camera_VideoStabilizationMode mode, bool* isSupported)-Checks whether a video stabilization mode is supported.
Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode(Camera_CaptureSession* session, Camera_VideoStabilizationMode* mode)-Obtains the video stabilization mode in use.
Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode(Camera_CaptureSession* session, Camera_VideoStabilizationMode mode)-Sets a video stabilization mode for the device.
Camera_ErrorCode OH_CaptureSession_CanAddInput(Camera_CaptureSession* session, Camera_Input* cameraInput, bool* isSuccessful)-Checks whether a Camera_Input instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanAddPreviewOutput(Camera_CaptureSession* session, Camera_PreviewOutput* cameraOutput, bool* isSuccessful)-Checks whether a PreviewOutput instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanAddPhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* cameraOutput, bool* isSuccessful)-Checks whether a PhotoOutput instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* cameraOutput, bool* isSuccessful)-Checks whether a VideoOutput instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanPreconfig(Camera_CaptureSession* session, Camera_PreconfigType preconfigType, bool* canPreconfig)-Checks whether a preconfigured resolution type is supported.
Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio(Camera_CaptureSession* session, Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, bool* canPreconfig)-Checks whether a preconfigured resolution type with an aspect ratio is supported.
Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session, Camera_PreconfigType preconfigType)-Sets a preconfigured resolution type.
Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio(Camera_CaptureSession* session, Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio)-Sets a preconfigured resolution type with an aspect ratio.
Camera_ErrorCode OH_CaptureSession_GetExposureValue(Camera_CaptureSession* session, float* exposureValue)-Obtains the exposure value.
Camera_ErrorCode OH_CaptureSession_GetFocalLength(Camera_CaptureSession* session, float* focalLength)-Obtains the current focal length.
Camera_ErrorCode OH_CaptureSession_GetFocusDistance(const Camera_CaptureSession* session, float* focusDistance)-Obtains 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.
Camera_ErrorCode OH_CaptureSession_SetFocusDistance(const Camera_CaptureSession* session, float focusDistance)-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.
Camera_ErrorCode OH_CaptureSession_IsFocusDistanceSupported(const Camera_CaptureSession* session, bool* isSupported)-Checks whether the focus distance can be set.
Camera_ErrorCode OH_CaptureSession_SetSmoothZoom(Camera_CaptureSession* session, float targetZoom, Camera_SmoothZoomMode smoothZoomMode)-Sets smooth zoom.
Camera_ErrorCode OH_CaptureSession_GetSupportedColorSpaces(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace** colorSpace, uint32_t* size)-Obtains the supported color spaces.
Camera_ErrorCode OH_CaptureSession_DeleteColorSpaces(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace* colorSpace)-Deletes color spaces.
Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace* colorSpace)-Obtains the active color space.
Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace colorSpace)-Sets the active color space.
Camera_ErrorCode OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)-Registers a callback to listen for device switching changes.
Camera_ErrorCode OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange)-Unregisters the callback used to listen for device switching changes.
Camera_ErrorCode OH_CaptureSession_IsAutoDeviceSwitchSupported(Camera_CaptureSession* session, bool* isSupported)-Checks whether automatic device switching is supported.
Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* session, bool enabled)-Enables or disables automatic device switching.
Camera_ErrorCode OH_CaptureSession_RegisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)-Registers a callback to listen for capture system pressure level changes.
Camera_ErrorCode OH_CaptureSession_UnregisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange)-Unregisters the callback used to listen for capture system pressure level changes.
Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization(Camera_CaptureSession* session, Camera_QualityPrioritization qualityPrioritization)-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.
Camera_ErrorCode OH_CaptureSession_IsMacroSupported(Camera_CaptureSession* session, bool* isSupported)-Checks whether macro photography is supported.
Camera_ErrorCode OH_CaptureSession_EnableMacro(Camera_CaptureSession* session, bool enabled)-Enables or disables macro photography for the camera device.
Camera_ErrorCode OH_CaptureSession_SetWhiteBalance(Camera_CaptureSession* session, int32_t colorTemperature)-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.
Camera_ErrorCode OH_CaptureSession_GetWhiteBalance(Camera_CaptureSession* session, int32_t *colorTemperature)-Obtains the white balance color temperature.
Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode* whiteBalanceMode)-Obtains the white balance mode in use.
Camera_ErrorCode OH_CaptureSession_IsWhiteBalanceModeSupported(Camera_CaptureSession* session, Camera_WhiteBalanceMode whiteBalanceMode, bool* isSupported)-Checks whether the specified white balance mode is supported.
Camera_ErrorCode OH_CaptureSession_SetWhiteBalanceMode(Camera_CaptureSession* session, Camera_WhiteBalanceMode whiteBalanceMode)-Sets a white balance mode.
Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceRange(Camera_CaptureSession* session, int32_t *minColorTemperature, int32_t *maxColorTemperature)-Obtains the supported white balance color temperature range.
Camera_ErrorCode OH_CaptureSession_IsControlCenterSupported(Camera_CaptureSession* session, bool* isSupported)-Checks whether the camera controller is supported.
Camera_ErrorCode OH_CaptureSession_GetSupportedEffectTypes(Camera_CaptureSession* session, Camera_ControlCenterEffectType** types, uint32_t* size)-Obtains the effect types supported by the camera controller.
Camera_ErrorCode OH_CaptureSession_DeleteSupportedEffectTypes(Camera_CaptureSession* session, Camera_ControlCenterEffectType* types, uint32_t size)-Deletes the effect types supported by the camera controller.
Camera_ErrorCode OH_CaptureSession_EnableControlCenter(Camera_CaptureSession* session, bool enabled)-Enables or disables the camera controller.
Camera_ErrorCode OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)-Registers a callback to listen for effect status changes of a camera controller.
Camera_ErrorCode OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange)-Unregisters the callback used to listen for effect status changes of a camera controller.
typedef void (*OH_CaptureSession_OnMacroStatusChange)(Camera_CaptureSession* session, bool isMacroDetected)OH_CaptureSession_OnMacroStatusChangeDefines the callback used to listen for macro status changes of a camera session.
Camera_ErrorCode OH_CaptureSession_RegisterMacroStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange)-Registers a callback to listen for macro status changes of a camera session.
Camera_ErrorCode OH_CaptureSession_UnregisterMacroStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange)-Unregisters the callback used to listen for macro status changes of a camera session.
typedef void (*OH_CaptureSession_OnIsoChange)(Camera_CaptureSession* session, int32_t isoValue)OH_CaptureSession_OnIsoChangeDefines the callback used to listen for ISO changes in a camera session.
Camera_ErrorCode OH_CaptureSession_RegisterIsoChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnIsoChange isoChange)-Registers a callback to listen for ISO changes.
Camera_ErrorCode OH_CaptureSession_UnregisterIsoChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnIsoChange isoChange)-Unregisters the callback used to listen for ISO changes.
Camera_ErrorCode OH_CaptureSession_GetRAWCaptureZoomRatioRange(const Camera_CaptureSession* session, float* minZoom, float* maxZoom)-Obtains the supported zoom range of the physical camera during shooting in RAW format.
Camera_ErrorCode OH_CaptureSession_IsOISModeSupported(const Camera_CaptureSession* session, OH_Camera_OISMode oisMode, bool* isSupported)-Checks whether the optical image stabilization (OIS) mode is supported.
Camera_ErrorCode OH_CaptureSession_GetSupportedOISBiasRange(const Camera_CaptureSession* session, OH_Camera_OISAxes oisAxis, float* minBias, float* maxBias, float* step)-Obtains the offset range supported on the specified OIS axis.
Camera_ErrorCode OH_CaptureSession_GetCurrentOISMode(const Camera_CaptureSession* session, OH_Camera_OISMode* oisMode)-Obtains the OIS mode.
Camera_ErrorCode OH_CaptureSession_GetCurrentCustomOISBias(const Camera_CaptureSession* session, float* pitchBias, float* yawBias)-Obtains the custom offsets on all OIS axes.
Camera_ErrorCode OH_CaptureSession_SetOISMode(const Camera_CaptureSession* session, OH_Camera_OISMode oisMode)-Sets the OIS mode.
Camera_ErrorCode OH_CaptureSession_SetOISModeCustom(const Camera_CaptureSession* session, float pitchBias, float yawBias)-Sets the custom offset for an OIS axis.

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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
Camera_FocusState focusStateFocus 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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
Camera_ErrorCode errorCodeError code reported in a capture session.

See also

CAMERA_SERVICE_FATAL_ERROR

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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
Camera_SmoothZoomInfo* smoothZoomInfoPointer 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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfoPointer 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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
Camera_SystemPressureLevel systemPressureLevelPointer 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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
Camera_ControlCenterStatusInfo* controlCenterStatusInfoPointer 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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
CaptureSession_Callbacks* callbackPointer to the target callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
CaptureSession_Callbacks* callbackPointer to the target callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallbackPointer to the target callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallbackPointer to the target callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_SceneMode sceneModeScene mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreviewOutput* previewOutputPointer to the target Camera_PreviewOutput instance.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_Input* cameraInputPointer to the Camera_Input instance to add.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_Input* cameraInputPointer to the Camera_Input instance to remove.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreviewOutput* previewOutputPointer to the PreviewOutput instance to add.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreviewOutput* previewOutputPointer to the PreviewOutput instance to remove.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance to add.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance to remove.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_VideoOutput* videoOutputPointer to the Camera_VideoOutput instance to add.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_VideoOutput* videoOutputPointer to the VideoOutput instance to remove.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_MetadataOutput* metadataOutputPointer to the MetadataOutput instance to add.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_MetadataOutput* metadataOutputPointer to the MetadataOutput instance to remove.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance to start.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance to stop.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance to release.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
bool* hasFlashPointer to the check result for whether the device has flash. true if the device has flash, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_FlashMode flashModeFlash mode to check.
bool* isSupportedPointer to the check result for the support of the flash mode. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_FlashMode* flashModePointer to the flash mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_FlashMode flashModeFlash mode to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
OH_Camera_FlashState flashStateFlash 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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnFlashStateChange flashStateChangeCallback to listen for flash state changes to register.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnFlashStateChange flashStateChangeCallback to listen for flash state changes to unregister.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_ExposureMode exposureModeExposure mode to check.
bool* isSupportedPointer to the check result for the support of the exposure mode. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_ExposureMode* exposureModePointer to the exposure mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_ExposureMode exposureModeExposure mode to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_Point* pointPointer to the metering point.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_Point pointMetering point to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_ExposureMeteringMode exposureMeteringModeExposure metering mode to check.
bool* isSupportedWhether the exposure mode is supported.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_ExposureMeteringMode* exposureMeteringModeExposure metering mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_ExposureMeteringMode exposureMeteringModeExposure metering mode to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
int32_t *minIsoValueMinimum ISO value.
int32_t *maxIsoValueMaximum ISO value.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
int32_t* isoValueISO sensitivity or ISO speed.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
int32_t isoValueTarget ISO value to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
OH_Camera_PhysicalAperture** aperturesPointer to the array used to store physical aperture values.
uint32_t* sizeArray size.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_PhysicalAperture* aperturesArray of physical apertures to delete.
uint32_t sizeArray size.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
double* apertureAperture value.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
double apertureAperture value to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float* minExposureBiasPointer to the minimum exposure compensation value.
float* maxExposureBiasPointer to the maximum exposure compensation value.
float* stepPointer to the exposure compensation step.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float exposureBiasExposure compensation value to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float* exposureBiasPointer to the exposure compensation value.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
int32_t* minExposureDurationMinimum exposure duration.
int32_t* maxExposureDurationMaximum exposure duration.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
int32_t exposureDurationTarget exposure duration to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
int32_t* exposureDurationExposure duration.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
int32_t exposureDurationExposure 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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnExposureDurationChange exposureDurationChangeCallback to listen for exposure duration changes to register.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnExposureDurationChange exposureDurationChangeCallback to listen for exposure duration changes to unregister.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_FocusMode focusModeFocus mode to check.
bool* isSupportedPointer to the check result for the support of the focus mode. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_FocusMode* focusModePointer to the focus mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_FocusMode focusModeFocus mode to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_Point* focusPointPointer to the focal point.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_Point focusPointFocal point to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float* minZoomPointer to the minimum zoom ratio.
float* maxZoomPointer to the maximum zoom ratio.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float* zoomPointer to the zoom ratio.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float zoomTarget 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

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_VideoStabilizationMode modeVideo stabilization mode to check.
bool* isSupportedPointer to the check result for the support of the video stabilization mode. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_VideoStabilizationMode* modePointer to the video stabilization mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_VideoStabilizationMode modeVideo stabilization mode to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_Input* cameraInputPointer to the Camera_Input instance to check.
bool* isSuccessfulPointer 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

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreviewOutput* cameraOutputPointer to the PreviewOutput instance to check.
bool* isSuccessfulPointer 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

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PhotoOutput* cameraOutputPointer to the PhotoOutput instance to check.
bool* isSuccessfulPointer 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

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_VideoOutput* cameraOutputPointer to the Camera_VideoOutput instance to add.
bool* isSuccessfulPointer 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

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreconfigType preconfigTypeTarget preconfigured resolution type.
bool* canPreconfigPointer to the check result for the support of the preconfigured resolution type. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreconfigType preconfigTypeTarget preconfigured resolution type.
Camera_PreconfigRatio preconfigRatioTarget preconfigured aspect ratio.
bool* canPreconfigPointer to the check result for the support of the preconfigured resolution type. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreconfigType preconfigTypeTarget preconfigured resolution type.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_PreconfigType preconfigTypeTarget preconfigured resolution type.
Camera_PreconfigRatio preconfigRatioTarget preconfigured aspect ratio.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float* exposureValuePointer to the exposure value.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float* focalLengthPointer to the focal length.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
float* focusDistanceFocus distance.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
float focusDistanceFocus distance to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
bool* isSupportedWhether the focus distance is supported.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float targetZoomTarget zoom ratio.
Camera_SmoothZoomMode smoothZoomModeSmooth zoom mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
OH_NativeBuffer_ColorSpace** colorSpaceDouble 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* sizePointer to the size of the list of supported color spaces.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
OH_NativeBuffer_ColorSpace* colorSpacePointer to the list of color spaces, which are defined in the OH_NativeBuffer_ColorSpace struct.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
OH_NativeBuffer_ColorSpace* colorSpacePointer to the OH_NativeBuffer_ColorSpace instance.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
OH_NativeBuffer_ColorSpace colorSpaceTarget OH_NativeBuffer_ColorSpace instance.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChangeTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChangeTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
bool* isSupportedPointer to the check result for the support of automatic device switching. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
bool enabledWhether to enable or disable automatic switching. true to enable, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChangeTarget callback, which is OH_CaptureSession_OnSystemPressureLevelChange.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChangeTarget callback, which is OH_CaptureSession_OnSystemPressureLevelChange.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_QualityPrioritization qualityPrioritizationPriority level to set. The default value is HIGH_QUALITY.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
bool* isSupportedPointer to the check result for the support of macro photography. true if supported, false otherwise.

Returns

TypeDescription
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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
bool enabledWhether to enable or disable macro capability. true to enable, false otherwise.

Returns

TypeDescription
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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
int32_t colorTemperatureColor temperature, in Kelvin.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
int32_t *colorTemperatureColor temperature, in Kelvin.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_WhiteBalanceMode* whiteBalanceModePointer to the white balance mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_WhiteBalanceMode whiteBalanceModeWhite balance mode.
bool* isSupportedPointer to the check result for the support of the specified white balance mode. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_WhiteBalanceMode whiteBalanceModePointer to the white balance mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
int32_t *minColorTemperaturePointer to the minimum supported color temperature, in Kelvin.
int32_t *maxColorTemperaturePointer to the maximum supported color temperature, in Kelvin.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
bool* isSupportedPointer to the check result for the support of the camera controller. true if supported, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_ControlCenterEffectType** typesDouble pointer to the list of supported effect types, which are defined in the Camera_ControlCenterEffectType struct, if the function is successfully called.
uint32_t* sizePointer to the size of the list of supported effect types.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
Camera_ControlCenterEffectType* typesPointer to the list of effect types, which are defined in the Camera_ControlCenterEffectType struct.
uint32_t sizeSize of the list of supported effect types.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
bool enabledWhether to enable the camera controller. true to enable, false otherwise.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChangeTarget callback, which is OH_CaptureSession_OnControlCenterEffectStatusChange.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance that transfers the callback.
OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChangeTarget callback, which is OH_CaptureSession_OnControlCenterEffectStatusChange.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
bool isMacroDetectedWhether 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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnMacroStatusChange macroStatusChangeCallback used to return the macro status change.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnMacroStatusChange macroStatusChangeCallback used to return the macro status change.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
int32_t isoValueISO 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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnIsoChange isoChangeCallback of the OH_CaptureSession_OnIsoChange type, which is used to listen for ISO changes.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_CaptureSession_OnIsoChange isoChangeCallback of the OH_CaptureSession_OnIsoChange type, which is used to listen for ISO changes.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the target Camera_CaptureSession instance.
float* minZoomMinimum zoom ratio.
float* maxZoomMaximum zoom ratio.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_OISMode oisModeOIS mode to check.
bool* isSupportedWhether the device supports the mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_OISAxes oisAxisOIS axis.
float* minBiasMinimum offset.
float* maxBiasMaximum offset.
float* stepOffset step.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_OISMode* oisModeOIS mode.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
float* pitchBiasOffset on the pitch axis.
float* yawBiasOffset on the yaw axis.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
OH_Camera_OISMode oisModeOIS mode to set.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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

NameDescription
const Camera_CaptureSession* sessionPointer to the Camera_CaptureSession instance.
float pitchBiasOffset on the pitch axis.
float yawBiasOffset on the yaw axis.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_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.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-oh-camera-capturesession-callbacks

openharmony 鸿蒙 arkts-apis-camera-OIS

openharmony 鸿蒙 capi-oh-camera-camera-devicequeryinfo

openharmony 鸿蒙 capi-oh-camera-camera-frameraterange

openharmony 鸿蒙 capi-oh-camera-camera-outputcapability

openharmony 鸿蒙 arkts-apis-camera-Photo

openharmony 鸿蒙 capi-oh-camera-camera-profile

openharmony 鸿蒙 capi-oh-camera-camera-manager

openharmony 鸿蒙 capi-oh-camera-previewoutput-callbacks

openharmony 鸿蒙 arkts-apis-camera-ManualExposureQuery

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/We4gYlMR