openharmony 鸿蒙 capi-video-output-h

2026-08-25 浏览 (1)

video_output.h

Overview

The file declares the video output concepts.

File to include: <ohcamera/video_output.h>

Library: libohcamera.so

System capability: SystemCapability.Multimedia.Camera.Core

Since: 11

Related module: OH_Camera

Summary

Structs

Nametypedef KeywordDescription
VideoOutput_CallbacksVideoOutput_CallbacksDescribes the callbacks related to video output.
Camera_VideoOutputCamera_VideoOutputDescribes the video output object.
You can use OH_CameraManager_CreateVideoOutput to create such an object.

Functions

Nametypedef KeywordDescription
typedef void (*OH_VideoOutput_OnFrameStart)(Camera_VideoOutput* videoOutput)OH_VideoOutput_OnFrameStartDefines the callback defined in the VideoOutput_Callbacks struct and used to report video output frame start events.
typedef void (*OH_VideoOutput_OnFrameEnd)(Camera_VideoOutput* videoOutput, int32_t frameCount)OH_VideoOutput_OnFrameEndDefines the callback defined in the VideoOutput_Callbacks struct and used to report video output frame end events.
typedef void (*OH_VideoOutput_OnError)(Camera_VideoOutput* videoOutput, Camera_ErrorCode errorCode)OH_VideoOutput_OnErrorDefines the callback defined in the VideoOutput_Callbacks struct and used to report video output errors.
Camera_ErrorCode OH_VideoOutput_RegisterCallback(Camera_VideoOutput* videoOutput, VideoOutput_Callbacks* callback)-Registers a callback to listen for video output events.
Camera_ErrorCode OH_VideoOutput_UnregisterCallback(Camera_VideoOutput* videoOutput, VideoOutput_Callbacks* callback)-Unregisters the callback used to listen for video output events.
Camera_ErrorCode OH_VideoOutput_Start(Camera_VideoOutput* videoOutput)-Starts video output.
Camera_ErrorCode OH_VideoOutput_Stop(Camera_VideoOutput* videoOutput)-Stops video output.
Camera_ErrorCode OH_VideoOutput_Release(Camera_VideoOutput* videoOutput)-Releases a VideoOutput instance.
Camera_ErrorCode OH_VideoOutput_GetActiveProfile(Camera_VideoOutput* videoOutput, Camera_VideoProfile** profile)-Obtains the profile of a VideoOutput instance.
Camera_ErrorCode OH_VideoOutput_DeleteProfile(Camera_VideoProfile* profile)-Deletes the profile of a VideoOutput instance.
Camera_ErrorCode OH_VideoOutput_IsMirrorSupported(Camera_VideoOutput* videoOutput, bool* isSupported)-Checks whether a video output supports mirror mode.
Camera_ErrorCode OH_VideoOutput_EnableMirror(Camera_VideoOutput* videoOutput, bool mirrorMode)-Enables or disables mirror mode for a video output.
Camera_ErrorCode OH_VideoOutput_GetVideoRotation(Camera_VideoOutput* videoOutput, int deviceDegree, Camera_ImageRotation* imageRotation)-Obtains the rotation angle of a video.
Camera_ErrorCode OH_VideoOutput_GetVideoRotationWithoutDeviceDegree(Camera_VideoOutput* videoOutput, Camera_ImageRotation* imageRotation)-Obtains the rotation angle of a video.
Camera_ErrorCode OH_VideoOutput_GetSupportedFrameRates(Camera_VideoOutput* videoOutput, Camera_FrameRateRange** frameRateRange, uint32_t* size)-Obtains the list of frame rates supported by a VideoOutput instance.
Camera_ErrorCode OH_VideoOutput_DeleteFrameRates(Camera_VideoOutput* videoOutput, Camera_FrameRateRange* frameRateRange)-Deletes the frame rate list.
Camera_ErrorCode OH_VideoOutput_SetFrameRate(Camera_VideoOutput* videoOutput, int32_t minFps, int32_t maxFps)-Sets the frame rates for a VideoOutput instance.
Camera_ErrorCode OH_VideoOutput_GetActiveFrameRate(Camera_VideoOutput* videoOutput, Camera_FrameRateRange* frameRateRange)-Obtains the active frame rates of a VideoOutput instance.

Function Description

OH_VideoOutput_OnFrameStart()

typedef void (*OH_VideoOutput_OnFrameStart)(Camera_VideoOutput* videoOutput)

Description

Defines the callback defined in the VideoOutput_Callbacks struct and used to report video output frame start events.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput instance that transfers the callback.

OH_VideoOutput_OnFrameEnd()

typedef void (*OH_VideoOutput_OnFrameEnd)(Camera_VideoOutput* videoOutput, int32_t frameCount)

Description

Defines the callback defined in the VideoOutput_Callbacks struct and used to report video output frame end events.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput instance that transfers the callback.
int32_t frameCountNumber of frames to be included in the callback.

OH_VideoOutput_OnError()

typedef void (*OH_VideoOutput_OnError)(Camera_VideoOutput* videoOutput, Camera_ErrorCode errorCode)

Description

Defines the callback defined in the VideoOutput_Callbacks struct and used to report video output errors.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput instance that transfers the callback.
Camera_ErrorCode errorCodeError code reported during video output.

See also

CAMERA_SERVICE_FATAL_ERROR

OH_VideoOutput_RegisterCallback()

Camera_ErrorCode OH_VideoOutput_RegisterCallback(Camera_VideoOutput* videoOutput, VideoOutput_Callbacks* callback)

Description

Registers a callback to listen for video output events.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
VideoOutput_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_VideoOutput_UnregisterCallback()

Camera_ErrorCode OH_VideoOutput_UnregisterCallback(Camera_VideoOutput* videoOutput, VideoOutput_Callbacks* callback)

Description

Unregisters the callback used to listen for video output events.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
VideoOutput_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_VideoOutput_Start()

Camera_ErrorCode OH_VideoOutput_Start(Camera_VideoOutput* videoOutput)

Description

Starts video output.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput 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_VideoOutput_Stop()

Camera_ErrorCode OH_VideoOutput_Stop(Camera_VideoOutput* videoOutput)

Description

Stops video output.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput 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_VideoOutput_Release()

Camera_ErrorCode OH_VideoOutput_Release(Camera_VideoOutput* videoOutput)

Description

Releases a VideoOutput instance.

Since: 11

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput 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_VideoOutput_GetActiveProfile()

Camera_ErrorCode OH_VideoOutput_GetActiveProfile(Camera_VideoOutput* videoOutput, Camera_VideoProfile** profile)

Description

Obtains the profile of a VideoOutput instance.

Since: 12

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput instance for which the profile is to be obtained.
Camera_VideoProfile** profileDouble pointer to the video 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_VideoOutput_DeleteProfile()

Camera_ErrorCode OH_VideoOutput_DeleteProfile(Camera_VideoProfile* profile)

Description

Deletes the profile of a VideoOutput instance.

Since: 12

Parameters

NameDescription
Camera_VideoProfile* profilePointer to the profile to delete.

Returns

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

OH_VideoOutput_IsMirrorSupported()

 Camera_ErrorCode OH_VideoOutput_IsMirrorSupported(Camera_VideoOutput* videoOutput, bool* isSupported)

Description

Checks whether a video output supports mirror mode.

Since: 15

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
bool* isSupportedPointer to the check result for the support of mirror 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_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_VideoOutput_EnableMirror()

 Camera_ErrorCode OH_VideoOutput_EnableMirror(Camera_VideoOutput* videoOutput, bool mirrorMode)

Description

Enables or disables mirror mode for a video output.

Since: 15

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
bool mirrorModeWhether to enable or disable mirror mode. 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_VideoOutput_GetVideoRotation()

 Camera_ErrorCode OH_VideoOutput_GetVideoRotation(Camera_VideoOutput* videoOutput, int deviceDegree, Camera_ImageRotation* imageRotation)

Description

Obtains the rotation angle of a video.

Since: 12

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
int deviceDegreeClockwise rotation angle of the device relative to the natural direction (the charging port faces downward).
Camera_ImageRotation* imageRotationPointer to the rotation angle of the video output.

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

Camera_ErrorCode OH_VideoOutput_GetVideoRotationWithoutDeviceDegree(Camera_VideoOutput* videoOutput, Camera_ImageRotation* imageRotation)

Description

Obtains the rotation angle of a video.

Since: 23

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
Camera_ImageRotation* imageRotationPointer to the rotation angle of the video output.

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

Camera_ErrorCode OH_VideoOutput_GetSupportedFrameRates(Camera_VideoOutput* videoOutput, Camera_FrameRateRange** frameRateRange, uint32_t* size)

Description

Obtains the list of frame rates supported by a VideoOutput instance.

Since: 12

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
Camera_FrameRateRange** frameRateRangeDouble pointer to the list of frame rates, if the function is successfully called.
uint32_t* sizePointer to the size of the list of frame rates.

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

Camera_ErrorCode OH_VideoOutput_DeleteFrameRates(Camera_VideoOutput* videoOutput, Camera_FrameRateRange* frameRateRange)

Description

Deletes the frame rate list.

Since: 12

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
Camera_FrameRateRange* frameRateRangePointer to the list of frame rates to delete.

Returns

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

OH_VideoOutput_SetFrameRate()

Camera_ErrorCode OH_VideoOutput_SetFrameRate(Camera_VideoOutput* videoOutput, int32_t minFps, int32_t maxFps)

Description

Sets the frame rates for a VideoOutput instance.

Since: 12

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the VideoOutput instance for which the frame rates are to be set.
int32_t minFpsMinimum frame rate.
int32_t maxFpsMaximum frame rate.

Returns

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

OH_VideoOutput_GetActiveFrameRate()

Camera_ErrorCode OH_VideoOutput_GetActiveFrameRate(Camera_VideoOutput* videoOutput, Camera_FrameRateRange* frameRateRange)

Description

Obtains the active frame rates of a VideoOutput instance.

Since: 12

Parameters

NameDescription
Camera_VideoOutput* videoOutputPointer to the target VideoOutput instance.
Camera_FrameRateRange* frameRateRangePointer to the frame rate range, if the function is successfully called.

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.

你可能感兴趣的鸿蒙文章

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