harmony 鸿蒙VideoProcessing
VideoProcessing
Overview
The VideoProcessing module provides the APIs for video processing. It provides video processing capabilities, including color space conversion, metadata generation, and video scaling.
Since: 12
Summary
Files
Name | Description |
---|---|
video_processing.h | Declares the video processing functions. |
video_processing_types.h | Declares the video processing types. |
Structs
Name | Description |
---|---|
struct VideoProcessing_ColorSpaceInfo | Describes the color space information of video processing. |
Types
Name | Description |
---|---|
typedef struct OH_VideoProcessing OH_VideoProcessing | Defines a struct for the video processing object. |
typedef struct NativeWindow OHNativeWindow | Defines a struct for the NativeWindow object. |
typedef struct OH_AVFormat OH_AVFormat | Defines a struct for the OH_AVFormat object. |
typedef struct VideoProcessing_ColorSpaceInfo VideoProcessing_ColorSpaceInfo | Defines a struct for the color space information of video processing. |
typedef enum VideoDetailEnhancer_QualityLevel VideoDetailEnhancer_QualityLevel | Defines an enum for the quality levels for detail enhancement. |
typedef enum VideoProcessing_ErrorCode VideoProcessing_ErrorCode | Defines an enum for the video processing error codes. |
typedef enum VideoProcessing_State VideoProcessing_State | Defines an enum for the video processing states. |
typedef struct VideoProcessing_Callback VideoProcessing_Callback | Defines a struct for the video processing callback object. |
typedef void(* OH_VideoProcessingCallback_OnError) (OH_VideoProcessing *videoProcessor, VideoProcessing_ErrorCode error, void *userData) | Defines a pointer to the callback function for reporting an error during video processing. |
typedef void(* OH_VideoProcessingCallback_OnState) (OH_VideoProcessing *videoProcessor, VideoProcessing_State state, void *userData) | Defines a pointer to the callback function for reporting the video processing state. |
typedef void(* OH_VideoProcessingCallback_OnNewOutputBuffer) (OH_VideoProcessing *videoProcessor, uint32_t index, void *userData) | Defines a pointer to the callback function for reporting the data filled in the output buffer. |
Enums
Name | Description |
---|---|
VideoDetailEnhancer_QualityLevel { VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_NONE, VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_LOW, VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM, VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH } |
Enumerates the quality levels for detail enhancement. |
VideoProcessing_ErrorCode { VIDEO_PROCESSING_SUCCESS, VIDEO_PROCESSING_ERROR_INVALID_PARAMETER = 401, VIDEO_PROCESSING_ERROR_UNKNOWN = 29210001, VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED, VIDEO_PROCESSING_ERROR_CREATE_FAILED, VIDEO_PROCESSING_ERROR_PROCESS_FAILED, VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING, VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED, VIDEO_PROCESSING_ERROR_NO_MEMORY, VIDEO_PROCESSING_ERROR_INVALID_INSTANCE, VIDEO_PROCESSING_ERROR_INVALID_VALUE } |
Enumerates the video processing error codes. |
VideoProcessing_State { VIDEO_PROCESSING_STATE_RUNNING, VIDEO_PROCESSING_STATE_STOPPED } |
Enumerates the video processing states. |
Functions
Variables
Name | Description |
---|---|
const int32_t VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION | Instance created for color space conversion during video processing. |
const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION | Instance created for metadata generation during video processing. |
const int32_t VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER | Instance for detail enhancement during video processing. |
const char * VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL | Pointer to the quality level of video detail enhancement. |
Type Description
OH_AVFormat
typedef struct OH_AVFormat OH_AVFormat
Description
Defines a struct for the OH_AVFormat object.
Since: 12
OH_VideoProcessing
typedef struct OH_VideoProcessing OH_VideoProcessing
Description
Defines a struct for the video processing object.
Define a null pointer to OH_VideoProcessing. Before OH_VideoProcessing_Create is called to create a video processing instance, the pointer must be null. You can create different video processing instances with different processing types.
Since: 12
OH_VideoProcessingCallback_OnError
typedef void(* OH_VideoProcessingCallback_OnError) (OH_VideoProcessing *videoProcessor, VideoProcessing_ErrorCode error, void *userData)
Description
Defines a pointer to the callback function for reporting an error during video processing.
The following error codes are defined in VideoProcessing_ErrorCode:
VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING: unsupported processing. For example, conversion between the color space types for input and output is not supported.
VIDEO_PROCESSING_ERROR_INVALID_VALUE: invalid video attribute. For example, the video color space is invalid.
VIDEO_PROCESSING_ERROR_NO_MEMORY: out of memory.
VIDEO_PROCESSING_ERROR_PROCESS_FAILED: An error occurs during the processing.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to the video processing instance. |
error | Error code reported. |
userData | Pointer to user-defined data. |
OH_VideoProcessingCallback_OnNewOutputBuffer
typedef void(* OH_VideoProcessingCallback_OnNewOutputBuffer) (OH_VideoProcessing *videoProcessor, uint32_t index, void *userData)
Description
Defines a pointer to the callback function for reporting the data filled in the output buffer.
After data is filled in each new output buffer, the index of the buffer is reported. Call OH_VideoProcessing_RenderOutputBuffer to process rendering based on the index and output the buffer. If this callback function is not registered, the data filled in the output buffer is not reported. Instead, the data is directly processed, rendered, and output.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to the video processing instance. |
index | Index of the output buffer. |
userData | Pointer to user-defined data. |
OH_VideoProcessingCallback_OnState
typedef void(* OH_VideoProcessingCallback_OnState) (OH_VideoProcessing *videoProcessor, VideoProcessing_State state, void *userData)
Description
Defines a pointer to the callback function for reporting the video processing state.
After OH_VideoProcessing_Start is called, the video processing state changes to VIDEO_PROCESSING_STATE_RUNNING. After OH_VideoProcessing_Stop is called and all buffers finishes processing, the state changes to VIDEO_PROCESSING_STATE_STOPPED. For details, see VideoProcessing_State.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to the video processing instance. |
state | Video processing state. For details, see VideoProcessing_State. |
userData | Pointer to user-defined data. |
OHNativeWindow
typedef struct NativeWindow OHNativeWindow
Description
Defines a struct for the NativeWindow object.
Since: 12
VideoDetailEnhancer_QualityLevel
typedef enum VideoDetailEnhancer_QualityLevel VideoDetailEnhancer_QualityLevel
Description
Defines an enum for the quality levels for detail enhancement.
For details about the enumerated values, see VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL. For details about how to set the quality level, see the development guide.
See also: OH_VideoProcessing_SetParameter and OH_VideoProcessing_GetParameter
Since: 12
VideoProcessing_Callback
typedef struct VideoProcessing_Callback VideoProcessing_Callback
Description
Defines a struct for the video processing callback object.
Define a null pointer to VideoProcessing_Callback. Before OH_VideoProcessingCallback_Create is called to create a video processing callback object, the pointer must be null. The callback object is registered by calling OH_VideoProcessing_RegisterCallback.
Since: 12
VideoProcessing_ColorSpaceInfo
typedef struct VideoProcessing_ColorSpaceInfo VideoProcessing_ColorSpaceInfo
Description
Defines a struct for the color space information of video processing.
See also: OH_VideoProcessing_IsColorSpaceConversionSupported
Since: 12
VideoProcessing_ErrorCode
typedef enum VideoProcessing_ErrorCode VideoProcessing_ErrorCode
Description
Defines an enum for the video processing error codes.
Since: 12
VideoProcessing_State
typedef enum VideoProcessing_State VideoProcessing_State
Description
Defines an enum for the video processing states.
The video processing state is reported through the callback function OH_VideoProcessingCallback_OnState.
Since: 12
Enum Description
VideoDetailEnhancer_QualityLevel
enum VideoDetailEnhancer_QualityLevel
Description
Enumerates the quality levels for detail enhancement.
For details about the enumerated values, see VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL. For details about how to set the quality level, see the development guide.
See also: OH_VideoProcessing_SetParameter and OH_VideoProcessing_GetParameter
Since: 12
Value | Description |
---|---|
VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_NONE | No detail enhancement. |
VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_LOW | Low-quality detail enhancement, which features fast speed. This is the default value. |
VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM | Medium-quality detail enhancement, which features moderate speed. |
VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH | High-quality detail enhancement, which features slow speed. |
VideoProcessing_ErrorCode
enum VideoProcessing_ErrorCode
Description
Enumerates the video processing error codes.
Since: 12
Value | Description |
---|---|
VIDEO_PROCESSING_SUCCESS | The processing is successful. |
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER | An input parameter is invalid. This error code is returned in the following cases: 1 - The input or output video buffer is either invalid or empty. 2 - The provided parameter is invalid or missing. 3 - The requested processing type is invalid. |
VIDEO_PROCESSING_ERROR_UNKNOWN | An unknown error occurs. For example, the GPU computing or memcpy fails. |
VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED | The global video processing environment, for example, the GPU environment, fails to be initialized. |
VIDEO_PROCESSING_ERROR_CREATE_FAILED | Creating the video processing instance fails. For example, the total number of instances exceeds the upper limit. |
VIDEO_PROCESSING_ERROR_PROCESS_FAILED | The processing fails. For example, the processing times out. |
VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING | The processing type is not supported. You can call OH_VideoProcessing_Is*XXX*Supported to check whether a specific processing type is supported. |
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED | The operation is not allowed. For example, the function is called in an incorrect running state. |
VIDEO_PROCESSING_ERROR_NO_MEMORY | Insufficient memory. |
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE | The video processing instance is invalid, for example, a null instance. |
VIDEO_PROCESSING_ERROR_INVALID_VALUE | The input value is invalid. This error code is returned in the following cases: 1 - The width and height of the video buffer are inappropriate or the color space is incorrect. 2 - The parameter contains an invalid value. For example, the quality level of detail enhancement is incorrect. |
VideoProcessing_State
enum VideoProcessing_State
Description
Enumerates the video processing states.
The video processing state is reported through the callback function OH_VideoProcessingCallback_OnState.
Since: 12
Value | Description |
---|---|
VIDEO_PROCESSING_STATE_RUNNING | Video processing is in progress. |
VIDEO_PROCESSING_STATE_STOPPED | Video processing stopped. |
Function Description
OH_VideoProcessing_Create()
VideoProcessing_ErrorCode OH_VideoProcessing_Create (OH_VideoProcessing ** videoProcessor, int type )
Description
Creates a video processing instance.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Double pointer to the video processing instance created. Before any input, *videoProcessor must be a null pointer. |
type | Video processing type. The processing type of an instance cannot be changed. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The video processing instance is created successfully.
VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING: The video processing type is not supported. For example, if metadata generation is not supported, VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING is returned.
VIDEO_PROCESSING_ERROR_CREATE_FAILED: The video processing instance fails to be created.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or the pointer to the instance is not null.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: The video processing type is invalid.
OH_VideoProcessing_DeinitializeEnvironment()
VideoProcessing_ErrorCode OH_VideoProcessing_DeinitializeEnvironment (void )
Description
Releases the global video processing environment.
Before calling this API, you must call OH_VideoProcessing_InitializeEnvironment to initialize the environment. Generally, this function is called when the main process is about to exit. Do not call this function when a video processing instance is running.
Since: 12
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The processing is successful.
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED: A video processing instance is not destroyed or OH_VideoProcessing_InitializeEnvironment is not called to initialize the environment.
OH_VideoProcessing_Destroy()
VideoProcessing_ErrorCode OH_VideoProcessing_Destroy (OH_VideoProcessing * videoProcessor)
Description
Destroys a video processing instance.
Before destroying the instance, call OH_VideoProcessing_Stop to stop it.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to the video processing instance. You are advised to set the pointer to a null pointer after the instance is destroyed. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The instance is destroyed.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED: The instance is still running.
OH_VideoProcessing_GetParameter()
VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter (OH_VideoProcessing * videoProcessor, OH_AVFormat * parameter )
Description
Obtains video processing parameters.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
parameter | Pointer to a video processing parameter instance. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The parameters are obtained.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: The parameter is empty.
OH_VideoProcessing_GetSurface()
VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface (OH_VideoProcessing * videoProcessor, OHNativeWindow ** window )
Description
Obtains a surface for video processing.
An input surface must be created before video processing starts, it must be destroyed by calling OH_NativeWindow_DestroyNativeWindow when it is no longer needed.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
window | Double pointer to the input surface. For example, the input surface pointer can point to an output surface of the video decoder. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The processing is successful.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: The window is a null pointer or the pointer to the window is not null.
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED: The surface fails to be created, an input surface has been created, or the video processing instance is running.
OH_VideoProcessing_InitializeEnvironment()
VideoProcessing_ErrorCode OH_VideoProcessing_InitializeEnvironment (void )
Description
Initializes the global video processing environment.
This function is optional. It is called only once when the main process is started to initialize the global video processing environment. This reduces the duration for running OH_VideoProcessing_Create. The global video processing environment must be released by calling OH_VideoProcessing_DeinitializeEnvironment. For details about how and when to release the environment, see OH_VideoProcessing_DeinitializeEnvironment.
Since: 12
Returns
Result code defined in VideoProcessing_ErrorCode.
- VIDEO_PROCESSING_SUCCESS: The initialization is successful.
- VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED: The initialization fails.
If the operation fails, check whether the GPU works properly.
OH_VideoProcessing_IsColorSpaceConversionSupported()
bool OH_VideoProcessing_IsColorSpaceConversionSupported (const VideoProcessing_ColorSpaceInfo * sourceVideoInfo, const VideoProcessing_ColorSpaceInfo * destinationVideoInfo )
Description
Checks whether color space conversion is supported during video processing.
Since: 12
Parameters
Name | Description |
---|---|
sourceVideoInfo | Pointer to the color space information of the input video. |
destinationVideoInfo | Pointer to the color space information of the output video. |
Returns
Check result. The value true means that color space conversion is supported, and false means the opposite.
OH_VideoProcessing_IsMetadataGenerationSupported()
bool OH_VideoProcessing_IsMetadataGenerationSupported (const VideoProcessing_ColorSpaceInfo * sourceVideoInfo)
Description
Checks whether metadata generation is supported during video processing.
Since: 12
Parameters
Name | Description |
---|---|
sourceVideoInfo | Pointer to the color space information of the input video. |
Returns
Check result. The value true means that metadata generation is supported; false means the opposite.
OH_VideoProcessing_RegisterCallback()
VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback (OH_VideoProcessing * videoProcessor, const VideoProcessing_Callback * callback, void * userData )
Description
Registers a callback for video processing.
The callback function should be registered before video processing starts. During video processing, it cannot be registered.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
callback | Pointer to the callback function. |
userData | Pointer to user-defined data. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The callback function is registered.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: The callback function pointer is null.
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED: The instance is still running.
OH_VideoProcessing_RenderOutputBuffer()
VideoProcessing_ErrorCode OH_VideoProcessing_RenderOutputBuffer (OH_VideoProcessing * videoProcessor, uint32_t index )
Description
Renders and processes the buffer, and then outputs it.
If the callback function OH_VideoProcessingCallback_OnNewOutputBuffer is set, the buffer index is returned through the callback function after the output buffer is ready.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
index | Index of the output buffer. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The processing is successful.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: The index is invalid.
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED: The callback function OH_VideoProcessingCallback_OnNewOutputBuffer is not set or the instance is stopped.
OH_VideoProcessing_SetParameter()
VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter (OH_VideoProcessing * videoProcessor, const OH_AVFormat * parameter )
Description
Sets video processing parameters.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
parameter | Pointer to a video processing parameter instance. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The parameters are successfully set.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: The parameter is empty.
VIDEO_PROCESSING_ERROR_INVALID_VALUE: Some attributes of a parameter are invalid, for example, unsupported parameter value.
VIDEO_PROCESSING_ERROR_NO_MEMORY: Memory allocation fails.
OH_VideoProcessing_SetSurface()
VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface (OH_VideoProcessing * videoProcessor, const OHNativeWindow * window )
Description
Sets an output surface for video processing.
An output surface must be set before video processing starts.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
window | Pointer to the output surface. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The output surface is successfully set.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: The window is a null pointer.
OH_VideoProcessing_Start()
VideoProcessing_ErrorCode OH_VideoProcessing_Start (OH_VideoProcessing * videoProcessor)
Description
Starts video processing.
After video processing starts, the callback OH_VideoProcessingCallback_OnState reports the VIDEO_PROCESSING_STATE_RUNNING state. For details, see VideoProcessing_State.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The processing is successful.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED: No output surface is set, no input surface is created, or the instance is running.
OH_VideoProcessing_Stop()
VideoProcessing_ErrorCode OH_VideoProcessing_Stop (OH_VideoProcessing * videoProcessor)
Description
Stops video processing.
After video processing stops, the callback OH_VideoProcessingCallback_OnState reports the VIDEO_PROCESSING_STATE_STOPPED state. For details, see VideoProcessing_State.
Since: 12
Parameters
Name | Description |
---|---|
videoProcessor | Pointer to a video processing instance. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The processing is successful.
VIDEO_PROCESSING_ERROR_INVALID_INSTANCE: The instance is null or is not a video processing instance.
VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED: The instance is stopped.
OH_VideoProcessingCallback_BindOnError()
VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnError (VideoProcessing_Callback * callback, OH_VideoProcessingCallback_OnError onError )
Description
Binds the callback function OH_VideoProcessingCallback_OnError to a video processing callback object.
Since: 12
Parameters
Name | Description |
---|---|
callback | Pointer to a callback object. |
onError | Callback function to bind. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The binding is successful.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: callback or onError is null.
OH_VideoProcessingCallback_BindOnNewOutputBuffer()
VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnNewOutputBuffer (VideoProcessing_Callback * callback, OH_VideoProcessingCallback_OnNewOutputBuffer onNewOutputBuffer )
Description
Binds the callback function OH_VideoProcessingCallback_OnNewOutputBuffer to a video processing callback object.
Since: 12
Parameters
Name | Description |
---|---|
callback | Pointer to a callback object. |
onNewOutputBuffer | Callback function to bind. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The binding is successful.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: callback is null.
OH_VideoProcessingCallback_BindOnState()
VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnState (VideoProcessing_Callback * callback, OH_VideoProcessingCallback_OnState onState )
Description
Binds the callback function OH_VideoProcessingCallback_OnState to a video processing callback object.
Since: 12
Parameters
Name | Description |
---|---|
callback | Pointer to a callback object. |
onState | Callback function to bind. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The binding is successful.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: callback or onState is null.
OH_VideoProcessingCallback_Create()
VideoProcessing_ErrorCode OH_VideoProcessingCallback_Create (VideoProcessing_Callback ** callback)
Description
Creates a video processing callback object.
Since: 12
Parameters
Name | Description |
---|---|
callback | Double pointer to the video processing callback object. Before creating a callback object, *callback must be a null pointer. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The callback object is created.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: callback is null or *callback is not null.
VIDEO_PROCESSING_ERROR_NO_MEMORY if the memory is insufficient.
OH_VideoProcessingCallback_Destroy()
VideoProcessing_ErrorCode OH_VideoProcessingCallback_Destroy (VideoProcessing_Callback * callback)
Description
Destroys a video processing callback object.
The video processing callback object can be destroyed after the callback function is registered.
Since: 12
Parameters
Name | Description |
---|---|
callback | Pointer to the callback object. You are advised to set the pointer to a null pointer after the callback object is destroyed. |
Returns
Result code defined in VideoProcessing_ErrorCode.
VIDEO_PROCESSING_SUCCESS: The callback object is destroyed.
VIDEO_PROCESSING_ERROR_INVALID_PARAMETER: callback is null.
Variable Description
VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL
const char* VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL
Description
Pointer to the quality level of video detail enhancement.
For details about the available options, see VideoDetailEnhancer_QualityLevel. You can call OH_VideoProcessing_SetParameter to set the quality level, and call OH_VideoProcessing_GetParameter to obtain the quality level.
Since: 12
VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION
const int32_t VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION
Description
Instance created for color space conversion during video processing.
Call OH_VideoProcessing_Create to create such an instance for color space conversion. If color space conversion is not supported, VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING defined in VideoProcessing_ErrorCode is returned.
Since: 12
VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER
const int32_t VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER
Description
Instance for detail enhancement during video processing.
Call OH_VideoProcessing_Create to create such an instance for detail enhancement. If detail enhancement is not supported, VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING defined in VideoProcessing_ErrorCode is returned.
Since: 12
VIDEO_PROCESSING_TYPE_METADATA_GENERATION
const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION
Description
Instance created for metadata generation during video processing.
Call OH_VideoProcessing_Create to create such an instance for metadata generation. If metadata generation is not supported, VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING defined in VideoProcessing_ErrorCode is returned.
Since: 12
你可能感兴趣的鸿蒙文章
harmony 鸿蒙OH_AVRecorder_Config
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦