harmony 鸿蒙avrecorder.h
avrecorder.h
Overview
The avrecorder.h file declares the AVRecorder APIs. Applications can use the APIs to record media data.
Library: libavrecorder.so
File to include: <multimedia/player_framework/avrecorder.h>
System capability: SystemCapability.Multimedia.Media.AVRecorder
Since: 18
Related module: AVRecorder
Summary
Functions
Name | Description |
---|---|
OH_AVRecorder * OH_AVRecorder_Create (void) | Creates an AVRecorder instance. After this function is successfully called, the AVRecorder transitions to the AVRECORDER_IDLE state. |
OH_AVErrCode OH_AVRecorder_Prepare (OH_AVRecorder *recorder, OH_AVRecorder_Config *config) | Sets AVRecorder parameters to prepare for recording. This function must be called after OH_AVRecorder_Start is successfully triggered. After this function is successfully called, the AVRecorder transitions to the AVRECORDER_PREPARED state. |
OH_AVErrCode OH_AVRecorder_GetAVRecorderConfig (OH_AVRecorder *recorder, OH_AVRecorder_Config **config) | Obtains the AVRecorder configuration. This function must be called after the recording preparation is complete. config must be set to a null pointer. The framework layer allocates and releases the memory in a unified manner to avoid issues with memory management, such as leaks or double freeing. |
OH_AVErrCode OH_AVRecorder_GetInputSurface (OH_AVRecorder *recorder, OHNativeWindow **window) | Obtains an input surface. This function must be called after OH_AVRecorder_Prepare is successfully triggered and before OH_AVRecorder_Start is called. |
OH_AVErrCode OH_AVRecorder_UpdateRotation (OH_AVRecorder *recorder, int32_t rotation) | Updates the video rotation angle. This function must be called after OH_AVRecorder_Prepare is successfully triggered and before OH_AVRecorder_Start is called. |
OH_AVErrCode OH_AVRecorder_Start (OH_AVRecorder *recorder) | Starts recording. This function must be called after OH_AVRecorder_Prepare is successfully triggered. After this function is successfully called, the AVRecorder transitions to the AVRECORDER_STARTED state. |
OH_AVErrCode OH_AVRecorder_Pause (OH_AVRecorder *recorder) | Pauses recording. This function must be called after OH_AVRecorder_Start is successfully triggered and the AVRecorder is in the AVRECORDER_STARTED state. After this function is successfully called, the AVRecorder transitions to the AVRECORDER_PAUSED state. |
OH_AVErrCode OH_AVRecorder_Resume (OH_AVRecorder *recorder) | Resumes recording. This function must be called after OH_AVRecorder_Pause is successfully triggered and the AVRecorder is in the AVRECORDER_PAUSED state. After this function is successfully called, the AVRecorder transitions to the AVRECORDER_STARTED state. |
OH_AVErrCode OH_AVRecorder_Stop (OH_AVRecorder *recorder) | Stops recording. This function must be called after OH_AVRecorder_Start is successfully triggered. After this function is successfully called, the AVRecorder transitions to the AVRECORDER_STOPPED state. |
OH_AVErrCode OH_AVRecorder_Reset (OH_AVRecorder *recorder) | Resets the recording state. This function must be called when the AVRecorder is not in the AVRECORDER_RELEASED state. After this function is successfully called, the AVRecorder transitions to the AVRECORDER_IDLE state. |
OH_AVErrCode OH_AVRecorder_Release (OH_AVRecorder *recorder) | Releases recording resources. After this API is successfully called, the AVRecorder transitions to the AVRECORDER_RELEASED state. The recorder memory will be released. The application layer must explicitly set the recorder to a null pointer to avoid access to wild pointers. |
OH_AVErrCode OH_AVRecorder_GetAvailableEncoder (OH_AVRecorder *recorder, OH_AVRecorder_EncoderInfo **info, int32_t *length) | Obtains the available encoders and encoder information of the AVRecorder. info must be set to a null pointer. The framework layer allocates and releases the memory in a unified manner to avoid issues with memory management, such as leaks or double freeing. |
OH_AVErrCode OH_AVRecorder_SetStateCallback (OH_AVRecorder *recorder, OH_AVRecorder_OnStateChange callback, void *userData) | Sets a state callback so that the application can respond to state change events generated by the AVRecorder. This function must be called before OH_AVRecorder_Start is called. |
OH_AVErrCode OH_AVRecorder_SetErrorCallback (OH_AVRecorder *recorder, OH_AVRecorder_OnError callback, void *userData) | Sets an error callback so that the application can respond to error events generated by the AVRecorder. This function must be called before OH_AVRecorder_Start is called. |
OH_AVErrCode OH_AVRecorder_SetUriCallback (OH_AVRecorder *recorder, OH_AVRecorder_OnUri callback, void *userData) | Sets a URI callback so that the application can respond to URI events generated by the AVRecorder. This function must be called before OH_AVRecorder_Start is called. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙OH_AVRecorder_Config
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦