Agora Java API Reference for Android
Public Member Functions | List of all members
agora::rtc::IExtensionVideoEncoder Class Referenceabstract
Inheritance diagram for agora::rtc::IExtensionVideoEncoder:
agora::RefCountInterface

Public Member Functions

virtual int initVideoEncoder (ExtensionVideoCodecSettings codec_settings)=0
 
virtual int32_t registerEncoderCallback (IExtensionEncoderCallback *callback)=0
 
virtual int encode (agora_refptr< IVideoFrame > frame, VIDEO_FRAME_TYPE frame_type)=0
 
virtual int32_t releaseVideoEncoder ()=0
 
virtual int32_t setRates (uint32_t bitrate_kbps, uint32_t framerate)=0
 
virtual void querySupportCodecDataFormat (media::base::VIDEO_PIXEL_FORMAT *data_format, int &size)=0
 
virtual int setAdvancedCodecProperty (const char *key, const char *json_value)=0
 
virtual int getAdvancedCodecProperty (const char *key, char *json_value, int &length) const =0
 
- Public Member Functions inherited from agora::RefCountInterface
virtual void AddRef () const =0
 
virtual RefCountReleaseStatus Release () const =0
 
virtual bool HasOneRef () const =0
 

Member Function Documentation

◆ initVideoEncoder()

virtual int agora::rtc::IExtensionVideoEncoder::initVideoEncoder ( ExtensionVideoCodecSettings  codec_settings)
pure virtual

Initializes the video encoder with the specified codec settings.

Parameters
codec_settingsThe 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()

virtual int32_t agora::rtc::IExtensionVideoEncoder::registerEncoderCallback ( IExtensionEncoderCallback callback)
pure virtual

Registers a callback function to handle encoding events or notifications.

Parameters
callbackA pointer to the encoder callback interface.
Returns
  • 0: Registration succeeded.
  • < 0: Registration failed, possibly due to an invalid callback pointer.

◆ encode()

virtual int agora::rtc::IExtensionVideoEncoder::encode ( agora_refptr< IVideoFrame frame,
VIDEO_FRAME_TYPE  frame_type 
)
pure virtual

Encodes a video frame.

Parameters
frameA reference to the video frame to be encoded.
frame_typeThe 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_kbpsThe target bitrate in kilobits per second.
framerateThe target framerate in frames per second.
Returns
  • 0: Rate allocation succeeded.
  • < 0: Rate allocation failed, possibly due to invalid parameters or internal errors.

◆ querySupportCodecDataFormat()

virtual void agora::rtc::IExtensionVideoEncoder::querySupportCodecDataFormat ( media::base::VIDEO_PIXEL_FORMAT *  data_format,
int &  size 
)
pure virtual

Queries the supported codec data formats.

Parameters
data_formatA pointer to an array where supported pixel formats will be filled.
sizeAn 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
keyThe pointer to the property name.
bufThe pointer to the buffer of this private property.
buf_sizeThe 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
nameThe pointer to the property name.
bufThe pointer to the buffer of this advanced codec property.
buf_sizeThe 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.