Agora Server Gateway SDK C++ API Reference
Public Member Functions | List of all members
agora::rtc::IVideoMixerSource Class Referenceabstract

#include <NGIAgoraVideoMixerSource.h>

Public Member Functions

virtual int addVideoTrack (const char *id, agora_refptr< IVideoTrack > track, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int removeVideoTrack (const char *id, agora_refptr< IVideoTrack > track, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int setStreamLayout (const char *id, const MixerLayoutConfig &config, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int delStreamLayout (const char *id, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int addImageSource (const char *id, const MixerLayoutConfig &config, ImageType type=kPng, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int delImageSource (const char *id, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int clearLayout (aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int refresh (aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int setBackground (uint32_t width, uint32_t height, int fps, uint32_t color_argb=0, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int setBackground (uint32_t width, uint32_t height, int fps, const char *url, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int setRotation (uint8_t rotation, aosl_ref_t ares=AOSL_REF_INVALID)=0
 
virtual int getAvgMixerDelay ()=0
 

Detailed Description

The IVideoMixerSource class is a multi-in-multi-out video source which receives video streams from multiple local or remote video tracks and generates mixed video stream in user defined output format. When only one video track is added to the mixer, it forwards the incoming video frames to its sinks.

Member Function Documentation

◆ addImageSource()

virtual int agora::rtc::IVideoMixerSource::addImageSource ( const char *  id,
const MixerLayoutConfig config,
ImageType  type = kPng,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Adds an image source to the mixer with its layout configuration on the mixer canvas.

Parameters
idThe unique id of the image.
configThe layout configuration.
typeThe image type.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ addVideoTrack()

virtual int agora::rtc::IVideoMixerSource::addVideoTrack ( const char *  id,
agora_refptr< IVideoTrack track,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Adds a video track for mixing.

Parameters
idThe unique id of the stream.
trackThe video track to mix.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ clearLayout()

virtual int agora::rtc::IVideoMixerSource::clearLayout ( aosl_ref_t  ares = AOSL_REF_INVALID)
pure virtual

Clears all the layout settings set previously.

Parameters
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ delImageSource()

virtual int agora::rtc::IVideoMixerSource::delImageSource ( const char *  id,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Deletes an image source to the mixer.

Parameters
idThe unique id of the image.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ delStreamLayout()

virtual int agora::rtc::IVideoMixerSource::delStreamLayout ( const char *  id,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Removes the user layout from the mixer canvas.

Parameters
idThe unique id of the stream.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ getAvgMixerDelay()

virtual int agora::rtc::IVideoMixerSource::getAvgMixerDelay ( )
pure virtual

Gets the average delay (ms) introduced by the mixer module, which includes the average mixing delay plus the encoder delay.

Returns
Average delay in ms.

◆ refresh()

virtual int agora::rtc::IVideoMixerSource::refresh ( aosl_ref_t  ares = AOSL_REF_INVALID)
pure virtual

Refreshes the user layout on the mixer canvas.

Parameters
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ removeVideoTrack()

virtual int agora::rtc::IVideoMixerSource::removeVideoTrack ( const char *  id,
agora_refptr< IVideoTrack track,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Removes the video track.

Parameters
idThe unique id of the stream.
trackThe instance of the video track that you want to remove from the mixer.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ setBackground() [1/2]

virtual int agora::rtc::IVideoMixerSource::setBackground ( uint32_t  width,
uint32_t  height,
int  fps,
const char *  url,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Sets the mixer canvas background to override the default configuration.

Parameters
widthWidth of the canvas.
heightHeight of the canvas.
fpsfps of the mixed video stream.
urlURL of the canvas background image.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ setBackground() [2/2]

virtual int agora::rtc::IVideoMixerSource::setBackground ( uint32_t  width,
uint32_t  height,
int  fps,
uint32_t  color_argb = 0,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Sets the mixer canvas background to override the default configuration.

Parameters
widthWidth of the canvas.
heightHeight of the canvas.
fpsfps of the mixed video stream.
color_argbMixer canvas background color in argb.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ setRotation()

virtual int agora::rtc::IVideoMixerSource::setRotation ( uint8_t  rotation,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Sets the rotation of the mixed video stream

Parameters
rotationThe rotation angle:
  • 0: none
  • 1: 90°
  • 2: 180°
  • 3: 270°
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

◆ setStreamLayout()

virtual int agora::rtc::IVideoMixerSource::setStreamLayout ( const char *  id,
const MixerLayoutConfig config,
aosl_ref_t  ares = AOSL_REF_INVALID 
)
pure virtual

Configures the layout of video frames coming from a specific track by ID on the mixer canvas.

Parameters
idThe unique id of the stream.
configThe layout configuration.
aresThis parameter is used for the SDK lifecycle protection. Fill in the default value.
Returns
  • 0: Success.
  • <0: Failure.

The documentation for this class was generated from the following file: