openharmony 鸿蒙 capi-photo-output-h

2026-08-25 浏览 (1)

photo_output.h

Overview

The file declares the photo output concepts.

File to include: <ohcamera/photo_output.h>

Library: libohcamera.so

System capability: SystemCapability.Multimedia.Camera.Core

Since: 11

Related module: OH_Camera

Summary

Structs

Nametypedef KeywordDescription
PhotoOutput_CallbacksPhotoOutput_CallbacksDescribes the callbacks related to photo output.
Camera_PhotoOutputCamera_PhotoOutputDescribes the photo output object.
You can use OH_CameraManager_CreatePhotoOutput to create such an object.

Functions

Nametypedef KeywordDescription
typedef void (*OH_PhotoOutput_OnFrameStart)(Camera_PhotoOutput* photoOutput)OH_PhotoOutput_OnFrameStartDefines the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame start events.
typedef void (*OH_PhotoOutput_OnFrameShutter)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* info)OH_PhotoOutput_OnFrameShutterDefines the callback defined in the PhotoOutput_Callbacks struct and used to report frame shutter events.
typedef void (*OH_PhotoOutput_OnFrameEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)OH_PhotoOutput_OnFrameEndDefines the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame end events.
typedef void (*OH_PhotoOutput_OnError)(Camera_PhotoOutput* photoOutput, Camera_ErrorCode errorCode)OH_PhotoOutput_OnErrorDefines the callback defined in the PhotoOutput_Callbacks struct and used to report photo output errors.
typedef void (*OH_PhotoOutput_CaptureEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)OH_PhotoOutput_CaptureEndDefines the callback invoked when the capture ends.
typedef void (*OH_PhotoOutput_CaptureStartWithInfo)(Camera_PhotoOutput* photoOutput, Camera_CaptureStartInfo* Info)OH_PhotoOutput_CaptureStartWithInfoDefines the callback invoked when the capture starts.
typedef void (*OH_PhotoOutput_OnFrameShutterEnd)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* Info)OH_PhotoOutput_OnFrameShutterEndDefines the callback invoked when frame shutter ends.
typedef void (*OH_PhotoOutput_CaptureReady)(Camera_PhotoOutput* photoOutput)OH_PhotoOutput_CaptureReadyDefines the callback invoked when the camera is ready to take photos. When the callback is received, the next capture can be performed.
typedef void (*OH_PhotoOutput_EstimatedCaptureDuration)(Camera_PhotoOutput* photoOutput, int64_t duration)OH_PhotoOutput_EstimatedCaptureDurationDefines the callback for the estimated capture duration.
typedef void (*OH_PhotoOutput_PhotoAvailable)(Camera_PhotoOutput* photoOutput, OH_PhotoNative* photo)OH_PhotoOutput_PhotoAvailableDefines the callback invoked when a high-resolution photo is available.
typedef void (*OH_PhotoOutput_PhotoAssetAvailable)(Camera_PhotoOutput* photoOutput, OH_MediaAsset* photoAsset)OH_PhotoOutput_PhotoAssetAvailableDefines the callback invoked when a photo asset is available.
Camera_ErrorCode OH_PhotoOutput_RegisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)-Registers a callback to listen for photo output events.
Camera_ErrorCode OH_PhotoOutput_UnregisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)-Unregisters the callback used to listen for photo output events.
Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureStartWithInfo callback)-Registers a callback to listen for capture start events.
Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree, Camera_ImageRotation* imageRotation)-Obtains the photo rotation angle.
Camera_ErrorCode OH_PhotoOutput_GetPhotoRotationWithoutDeviceDegree(Camera_PhotoOutput* photoOutput, Camera_ImageRotation* imageRotation)-Obtains the photo rotation angle.
Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureStartWithInfo callback)-Unregisters the callback used to listen for capture start events.
Camera_ErrorCode OH_PhotoOutput_RegisterCaptureEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureEnd callback)-Registers a callback to listen for capture end events.
Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureEnd callback)-Unregisters the callback used to listen for capture end events.
Camera_ErrorCode OH_PhotoOutput_RegisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_OnFrameShutterEnd callback)-Registers a callback to listen for frame shutter end events.
Camera_ErrorCode OH_PhotoOutput_UnregisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_OnFrameShutterEnd callback)-Unregisters the callback used to listen for frame shutter end events.
Camera_ErrorCode OH_PhotoOutput_RegisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureReady callback)-Registers a callback to listen for camera ready events. When the callback is received, the next capture can be performed.
Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureReady callback)-Unregisters the callback used to listen for camera ready events.
Camera_ErrorCode OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_EstimatedCaptureDuration callback)-Registers a callback to listen for estimated capture duration events.
Camera_ErrorCode OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_EstimatedCaptureDuration callback)-Unregisters the callback used to listen for estimated capture duration events.
Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAvailable callback)-Registers a callback to listen for photo availability events.
Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAvailable callback)-Unregisters the callback used to listen for photo availability events.
Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAssetAvailable callback)-Registers a callback to listen for photo asset availability events.
Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAssetAvailable callback)-Unregisters the callback used to listen for photo asset availability events.
Camera_ErrorCode OH_PhotoOutput_Capture(Camera_PhotoOutput* photoOutput)-Captures a photo.
This function must be called in prior to OH_PreviewOutput_Release. Otherwise, photo capture fails.
Camera_ErrorCode OH_PhotoOutput_Capture_WithCaptureSetting(Camera_PhotoOutput* photoOutput, Camera_PhotoCaptureSetting setting)-Captures a photo with photographing parameters.
Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput)-Releases a PhotoOutput instance.
Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)-Checks whether mirroring is supported.
Camera_ErrorCode OH_PhotoOutput_EnableMirror(Camera_PhotoOutput* photoOutput, bool enabled)-Enables dynamic photo capture.
Camera_ErrorCode OH_PhotoOutput_GetActiveProfile(Camera_PhotoOutput* photoOutput, Camera_Profile** profile)-Obtains the profile of a PhotoOutput instance.
Camera_ErrorCode OH_PhotoOutput_DeleteProfile(Camera_Profile* profile)-Deletes the profile of a PhotoOutput instance.
Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)-Checks whether moving photos are supported.
Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled)-Enables moving photos.
Camera_ErrorCode OH_PhotoOutput_IsPhotoQualityPrioritizationSupported(Camera_PhotoOutput* photoOutput, Camera_PhotoQualityPrioritization qualityPrioritization, bool* isSupported)-Checks whether the specified photo quality prioritization strategy is supported.
Camera_ErrorCode OH_PhotoOutput_SetPhotoQualityPrioritization(Camera_PhotoOutput* photoOutput, Camera_PhotoQualityPrioritization qualityPrioritization)-Sets the photo quality prioritization strategy.

Function Description

OH_PhotoOutput_OnFrameStart()

typedef void (*OH_PhotoOutput_OnFrameStart)(Camera_PhotoOutput* photoOutput)

Description

Defines the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame start events.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.

OH_PhotoOutput_OnFrameShutter()

typedef void (*OH_PhotoOutput_OnFrameShutter)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* info)

Description

Defines the callback defined in the PhotoOutput_Callbacks struct and used to report frame shutter events.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
Camera_FrameShutterInfo* infoPointer to the frame shutter information.

OH_PhotoOutput_OnFrameEnd()

typedef void (*OH_PhotoOutput_OnFrameEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)

Description

Defines the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame end events.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
int32_t frameCountNumber of frames to be included in the callback.

OH_PhotoOutput_OnError()

typedef void (*OH_PhotoOutput_OnError)(Camera_PhotoOutput* photoOutput, Camera_ErrorCode errorCode)

Description

Defines the callback defined in the PhotoOutput_Callbacks struct and used to report photo output errors.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
Camera_ErrorCode errorCodeError code reported during photo output.

See also

CAMERA_SERVICE_FATAL_ERROR

OH_PhotoOutput_CaptureEnd()

typedef void (*OH_PhotoOutput_CaptureEnd)(Camera_PhotoOutput* photoOutput, int32_t frameCount)

Description

Defines the callback invoked when the capture ends.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
int32_t frameCountNumber of frames to be included in the callback.

OH_PhotoOutput_CaptureStartWithInfo()

typedef void (*OH_PhotoOutput_CaptureStartWithInfo)(Camera_PhotoOutput* photoOutput, Camera_CaptureStartInfo* Info)

Description

Defines the callback invoked when the capture starts.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
Camera_CaptureStartInfo* InfoPointer to the capture start information passed by the callback.

OH_PhotoOutput_OnFrameShutterEnd()

typedef void (*OH_PhotoOutput_OnFrameShutterEnd)(Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* Info)

Description

Defines the callback invoked when frame shutter ends.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
Camera_FrameShutterInfo* InfoPointer to the frame shutter information.

OH_PhotoOutput_CaptureReady()

typedef void (*OH_PhotoOutput_CaptureReady)(Camera_PhotoOutput* photoOutput)

Description

Defines the callback invoked when the camera is ready to take photos. When the callback is received, the next capture can be performed.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.

OH_PhotoOutput_EstimatedCaptureDuration()

typedef void (*OH_PhotoOutput_EstimatedCaptureDuration)(Camera_PhotoOutput* photoOutput, int64_t duration)

Description

Defines the callback for the estimated capture duration.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
int64_t durationEstimated capture duration passed by the callback, measured in milliseconds.

OH_PhotoOutput_PhotoAvailable()

typedef void (*OH_PhotoOutput_PhotoAvailable)(Camera_PhotoOutput* photoOutput, OH_PhotoNative* photo)

Description

Defines the callback invoked when a high-resolution photo is available.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
OH_PhotoNative* photoPointer to OH_PhotoNative passed by the callback.

OH_PhotoOutput_PhotoAssetAvailable()

typedef void (*OH_PhotoOutput_PhotoAssetAvailable)(Camera_PhotoOutput* photoOutput, OH_MediaAsset* photoAsset)

Description

Defines the callback invoked when a photo asset is available.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the PhotoOutput instance that transfers the callback.
OH_MediaAsset* photoAssetPointer to the media asset passed by the callback.

OH_PhotoOutput_RegisterCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)

Description

Registers a callback to listen for photo output events.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
PhotoOutput_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_PhotoOutput_UnregisterCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback)

Description

Unregisters the callback used to listen for photo output events.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
PhotoOutput_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_PhotoOutput_RegisterCaptureStartWithInfoCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureStartWithInfo callback)

Description

Registers a callback to listen for capture start events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_CaptureStartWithInfo callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_GetPhotoRotation()

Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree, Camera_ImageRotation* imageRotation)

Description

Obtains the photo rotation angle.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
int deviceDegreeRotation angle of the device.
Camera_ImageRotation* imageRotationPointer to the rotation angle of the photo.

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_PhotoOutput_GetPhotoRotationWithoutDeviceDegree()

Camera_ErrorCode OH_PhotoOutput_GetPhotoRotationWithoutDeviceDegree(Camera_PhotoOutput* photoOutput, Camera_ImageRotation* imageRotation)

Description

Obtains the photo rotation angle.

Since: 23

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
Camera_ImageRotation* imageRotationPointer to the rotation angle of the photo.

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_PhotoOutput_UnregisterCaptureStartWithInfoCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureStartWithInfo callback)

Description

Unregisters the callback used to listen for capture start events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_CaptureStartWithInfo callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_RegisterCaptureEndCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterCaptureEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureEnd callback)

Description

Registers a callback to listen for capture end events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_CaptureEnd callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_UnregisterCaptureEndCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureEnd callback)

Description

Unregisters the callback used to listen for capture end events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_CaptureEnd callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_RegisterFrameShutterEndCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_OnFrameShutterEnd callback)

Description

Registers a callback to listen for frame shutter end events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_OnFrameShutterEnd callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_UnregisterFrameShutterEndCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_OnFrameShutterEnd callback)

Description

Unregisters the callback used to listen for frame shutter end events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_OnFrameShutterEnd callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_RegisterCaptureReadyCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureReady callback)

Description

Registers a callback to listen for camera ready events. When the callback is received, the next capture can be performed.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_CaptureReady callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_UnregisterCaptureReadyCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureReady callback)

Description

Unregisters the callback used to listen for camera ready events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_CaptureReady callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_EstimatedCaptureDuration callback)

Description

Registers a callback to listen for estimated capture duration events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_EstimatedCaptureDuration callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_EstimatedCaptureDuration callback)

Description

Unregisters the callback used to listen for estimated capture duration events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_EstimatedCaptureDuration callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_RegisterPhotoAvailableCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAvailable callback)

Description

Registers a callback to listen for photo availability events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_PhotoAvailable callbackTarget callback.

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_PhotoOutput_UnregisterPhotoAvailableCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAvailable callback)

Description

Unregisters the callback used to listen for photo availability events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_PhotoAvailable callbackTarget callback.

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_PhotoOutput_RegisterPhotoAssetAvailableCallback()

Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAssetAvailable callback)

Description

Registers a callback to listen for photo asset availability events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_PhotoAssetAvailable callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback()

Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_PhotoAssetAvailable callback)

Description

Unregisters the callback used to listen for photo asset availability events.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
OH_PhotoOutput_PhotoAssetAvailable callbackTarget callback.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_Capture()

Camera_ErrorCode OH_PhotoOutput_Capture(Camera_PhotoOutput* photoOutput)

Description

Captures a photo.
This function must be called in prior to OH_PreviewOutput_Release. Otherwise, photo capture fails.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput 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_RUNNING: The capture session is not running.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_PhotoOutput_Capture_WithCaptureSetting()

Camera_ErrorCode OH_PhotoOutput_Capture_WithCaptureSetting(Camera_PhotoOutput* photoOutput, Camera_PhotoCaptureSetting setting)

Description

Captures a photo with photographing parameters.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
Camera_PhotoCaptureSetting settingPhotographing parameters, which are defined in the Camera_PhotoCaptureSetting struct.

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_RUNNING: The capture session is not running.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_PhotoOutput_Release()

Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput)

Description

Releases a PhotoOutput instance.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.

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_PhotoOutput_IsMirrorSupported()

Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)

Description

Checks whether mirroring is supported.

Since: 11

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
bool* isSupportedPointer to the check result for the support of mirroring. 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_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_PhotoOutput_EnableMirror()

Camera_ErrorCode OH_PhotoOutput_EnableMirror(Camera_PhotoOutput* photoOutput, bool enabled)

Description

Enables dynamic photo capture.

Since: 13

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
bool enabledWhether to enable or disable dynamic photo capture. 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_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_PhotoOutput_GetActiveProfile()

Camera_ErrorCode OH_PhotoOutput_GetActiveProfile(Camera_PhotoOutput* photoOutput, Camera_Profile** profile)

Description

Obtains the profile of a PhotoOutput instance.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
Camera_Profile** profileDouble pointer to the photo output profile obtained.

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_PhotoOutput_DeleteProfile()

Camera_ErrorCode OH_PhotoOutput_DeleteProfile(Camera_Profile* profile)

Description

Deletes the profile of a PhotoOutput instance.

Since: 12

Parameters

NameDescription
Camera_Profile* profilePointer to the target PhotoOutput instance.

Returns

TypeDescription
Camera_ErrorCodeCAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_PhotoOutput_IsMovingPhotoSupported()

Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photoOutput, bool* isSupported)

Description

Checks whether moving photos are supported.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
bool* isSupportedPointer to the check result for the support of moving photos. 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_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_PhotoOutput_EnableMovingPhoto()

Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled)

Description

Enables or disables moving photos.

Since: 12

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
bool enabledWhether to enable moving photos. 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_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_PhotoOutput_IsPhotoQualityPrioritizationSupported()

Camera_ErrorCode OH_PhotoOutput_IsPhotoQualityPrioritizationSupported(Camera_PhotoOutput* photoOutput, Camera_PhotoQualityPrioritization qualityPrioritization, bool* isSupported)

Description

Checks whether the specified photo quality prioritization strategy is supported.

Since: 21

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
Camera_PhotoQualityPrioritization qualityPrioritizationPhoto quality prioritization strategy.
bool* isSupportedPointer to the check result for the support of the specified photo quality prioritization strategy. 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_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_PhotoOutput_SetPhotoQualityPrioritization()

Camera_ErrorCode OH_PhotoOutput_SetPhotoQualityPrioritization(Camera_PhotoOutput* photoOutput, Camera_PhotoQualityPrioritization qualityPrioritization)

Description

Sets the photo quality prioritization strategy.

Since: 21

Parameters

NameDescription
Camera_PhotoOutput* photoOutputPointer to the target PhotoOutput instance.
Camera_PhotoQualityPrioritization qualityPrioritizationPhoto quality prioritization strategy.

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.

你可能感兴趣的鸿蒙文章

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/mGGyWEOq