Agora RTC Objective-C API Reference  Refactor
Public Member Functions
IVideoMixerSource Class Referenceabstract

Inherits RefCountInterface.

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 abstracts a multi-in-multi-out video source which receives video streams from multiple local or remote video tracks and generate mixed video stream in user defined output format. When only one video track is added to the mixer, it simply forwards the incoming video frames to its sinks.

Member Function Documentation

◆ addVideoTrack()

virtual int addVideoTrack ( const char *  id,
agora_refptr< IVideoTrack track 
)
pure virtual

Add a video track for mixing.

Parameters
idThe unique id of the stream.
trackThe instance of the video track that you want mixer to receive its video stream.
Returns
0 - Success <0 - Failure

◆ removeVideoTrack()

virtual int removeVideoTrack ( const char *  id,
agora_refptr< IVideoTrack track 
)
pure virtual

Remove 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

◆ setStreamLayout()

virtual int setStreamLayout ( const char *  id,
const MixerLayoutConfig config 
)
pure virtual

Configures the layout of video frames comming from a specific track (indicated by uid) on the mixer canvas.

Parameters
idThe unique id of the stream.
configThe layout configuration
Returns
0 - Success <0 - Failure

◆ delStreamLayout()

virtual int delStreamLayout ( const char *  id)
pure virtual

Remove the user layout on the mixer canvas

Parameters
idThe unique id of the stream.
uidThe uid of the stream.
Returns
0 - Success <0 - Failure

◆ addImageSource()

virtual int addImageSource ( const char *  id,
const MixerLayoutConfig config,
ImageType  type = kPng 
)
pure virtual

Add a image source to the mixer with its layout configuration on the mixer canvas.

Parameters
idThe unique id of the image.
configThe layout configuration
Returns
0 - Success <0 - Failure

◆ delImageSource()

virtual int delImageSource ( const char *  id)
pure virtual

Delete a image source to the mixer.

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

◆ clearLayout()

virtual void clearLayout ( )
pure virtual

Clear all the layout settings set previously

◆ refresh()

virtual int refresh ( )
pure virtual

Refresh the user layout on the mixer canvas

Returns
0 - Success <0 - Failure

◆ setBackground() [1/2]

virtual int setBackground ( uint32_t  width,
uint32_t  height,
int  fps,
uint32_t  color_argb = 0 
)
pure virtual

Set 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

◆ setBackground() [2/2]

virtual int setBackground ( uint32_t  width,
uint32_t  height,
int  fps,
const char *  url 
)
pure virtual

Set 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

◆ setRotation()

virtual int setRotation ( uint8_t  rotation)
pure virtual

Set the rotation of the mixed video stream

Parameters
rotation:0:none,1:90°,2:180°,3:270°
Returns
0 - Success <0 - Failure

◆ getAvgMixerDelay()

virtual int getAvgMixerDelay ( )
pure virtual

Get the average delay in ms introduced by the mixer module, which includes the average mixing delay plus the encoder delay.

Returns
delay in ms

◆ AddRef()

virtual void AddRef ( ) const
pure virtualinherited

◆ Release()

virtual RefCountReleaseStatus Release ( ) const
pure virtualinherited

◆ HasOneRef()

virtual bool HasOneRef ( ) const
pure virtualinherited