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)=0
 
virtual int removeVideoTrack (const char *id, agora_refptr< IVideoTrack > track)=0
 
virtual int setStreamLayout (const char *id, const MixerLayoutConfig &config)=0
 
virtual int delStreamLayout (const char *id)=0
 
virtual int addImageSource (const char *id, const MixerLayoutConfig &config, ImageType type=kPng)=0
 
virtual int delImageSource (const char *id)=0
 
virtual void clearLayout ()=0
 
virtual int refresh ()=0
 
virtual int setBackground (uint32_t width, uint32_t height, int fps, uint32_t color_argb=0)=0
 
virtual int setBackground (uint32_t width, uint32_t height, int fps, const char *url)=0
 
virtual int setRotation (uint8_t rotation)=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 
)
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.
Returns
  • 0: Success.
  • <0: Failure.

◆ addVideoTrack()

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

Adds a video track for mixing.

Parameters
idThe unique id of the stream.
trackThe video track to mix.
Returns
  • 0: Success.
  • <0: Failure.

◆ clearLayout()

virtual void agora::rtc::IVideoMixerSource::clearLayout ( )
pure virtual

Clears all the layout settings set previously.

◆ delImageSource()

virtual int agora::rtc::IVideoMixerSource::delImageSource ( const char *  id)
pure virtual

Deletes an image source to the mixer.

Parameters
idThe unique id of the image.
Returns
  • 0: Success.
  • <0: Failure.

◆ delStreamLayout()

virtual int agora::rtc::IVideoMixerSource::delStreamLayout ( const char *  id)
pure virtual

Removes the user layout from the mixer canvas.

Parameters
idThe unique id of the stream.
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 ( )
pure virtual

Refreshes the user layout on the mixer canvas.

Returns
  • 0: Success.
  • <0: Failure.

◆ removeVideoTrack()

virtual int agora::rtc::IVideoMixerSource::removeVideoTrack ( const char *  id,
agora_refptr< IVideoTrack track 
)
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.
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 
)
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.
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 
)
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.
Returns
  • 0: Success.
  • <0: Failure.

◆ setRotation()

virtual int agora::rtc::IVideoMixerSource::setRotation ( uint8_t  rotation)
pure virtual

Sets the rotation of the mixed video stream

Parameters
rotationThe rotation angle:
  • 0: none
  • 1: 90°
  • 2: 180°
  • 3: 270°
Returns
  • 0: Success.
  • <0: Failure.

◆ setStreamLayout()

virtual int agora::rtc::IVideoMixerSource::setStreamLayout ( const char *  id,
const MixerLayoutConfig config 
)
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.
Returns
  • 0: Success.
  • <0: Failure.

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