#include <AgoraExtensions.h>
Inherits agora::RefCountInterface.
◆ initVideoEncoder()
Initializes the video encoder with the specified codec settings.
- Parameters
-
| codec_settings | The video codec settings that define how the video should be encoded. |
- Returns
- 0: Initialization succeeded.
- < 0: Initialization failed, possibly due to invalid settings or internal errors.
◆ registerEncoderCallback()
Registers a callback function to handle encoding events or notifications.
- Parameters
-
| callback | A pointer to the encoder callback interface. |
- Returns
- 0: Registration succeeded.
- < 0: Registration failed, possibly due to an invalid callback pointer.
◆ encode()
Encodes a video frame.
- Parameters
-
| frame | A reference to the video frame to be encoded. |
| frame_type | The type of the video frame (e.g., keyframe, delta frame). |
- Returns
- 0: Encoding succeeded.
- < 0: Encoding failed, possibly due to invalid frame data or internal errors.
◆ releaseVideoEncoder()
| virtual int32_t agora::rtc::IExtensionVideoEncoder::releaseVideoEncoder |
( |
| ) |
|
|
pure virtual |
Releases the resources used by the video encoder.
- Returns
- 0: Release succeeded.
- < 0: Release failed, possibly due to the encoder not being initialized or internal errors.
◆ setRates()
| virtual int32_t agora::rtc::IExtensionVideoEncoder::setRates |
( |
uint32_t | bitrate_kbps, |
|
|
uint32_t | framerate ) |
|
pure virtual |
Sets the rates for the encoder, specifying the target bitrate and framerate.
- Parameters
-
| bitrate_kbps | The target bitrate in kilobits per second. |
| framerate | The target framerate in frames per second. |
- Returns
- 0: Rate allocation succeeded.
- < 0: Rate allocation failed, possibly due to invalid parameters or internal errors.
◆ querySupportCodecDataFormat()
Queries the supported codec data formats.
- Parameters
-
| data_format | A pointer to an array where supported pixel formats will be filled. |
| size | An input/output parameter; initially holds the size of the array, and will be updated with the actual number of formats filled. |
◆ setAdvancedCodecProperty()
| virtual int agora::rtc::IExtensionVideoEncoder::setAdvancedCodecProperty |
( |
const char * | key, |
|
|
const char * | json_value ) |
|
pure virtual |
Sets a advanced codec property in the IExtensionVideoEncoder class.
- Parameters
-
| key | The pointer to the property name. |
| buf | The pointer to the buffer of this private property. |
| buf_size | The buffer size of this private property. |
- Returns
- The actual size of the private property, if the method call succeeds.
- -1, if the method call fails.
◆ getAdvancedCodecProperty()
| virtual int agora::rtc::IExtensionVideoEncoder::getAdvancedCodecProperty |
( |
const char * | key, |
|
|
char * | json_value, |
|
|
int & | length ) const |
|
pure virtual |
Gets a advanced codec property in the IExtensionVideoEncoder class.
- Parameters
-
| name | The pointer to the property name. |
| buf | The pointer to the buffer of this advanced codec property. |
| buf_size | The buffer size of this advanced codec property. |
- Returns
- The actual size of the advanced codec property, if the method call succeeds.
- -1, if the method call fails.