Agora C++ API Reference for All Platforms

NGIAgoraVideoMixerSource.h
1 //
2 // Agora SDK
3 //
4 // Copyright (c) 2018 Agora.io. All rights reserved.
5 //
6
7 #pragma once // NOLINT(build/header_guard)
8
9 #include "AgoraBase.h"
10 #include "AgoraRefPtr.h"
11 #include "IAgoraService.h"
12
13 namespace agora {
14 namespace rtc {
15
16 class IVideoTrack;
17
18 struct MixerLayoutConfig {
19 int32_t x;
20 int32_t y;
21 int32_t width;
22 int32_t height;
23 int32_t zOrder; // larger zOrder prioritizes smaller ones
24 float alpha;
25 bool mirror;
26 const char* image_path; // url of the place holder picture
27
28 MixerLayoutConfig() : x(0), y(0), width(0), height(0), zOrder(0), alpha(1.0), mirror(false), image_path(NULL) {}
29 MixerLayoutConfig(int ox, int oy, int w, int h, int order) : x(ox), y(oy), width(w), height(h), zOrder(order), alpha(1.0), mirror(false), image_path(NULL) {}
30 };
31
32 enum ImageType {
33 kPng,
34 kJpeg,
35 kGif
36 };
37
44 class IVideoMixerSource : public RefCountInterface {
45 public:
54 virtual int addVideoTrack(const char* id, agora_refptr<IVideoTrack> track, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
63 virtual int removeVideoTrack(const char* id, agora_refptr<IVideoTrack> track, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
73 virtual int setStreamLayout(const char* id, const MixerLayoutConfig& config, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
82 virtual int delStreamLayout(const char* id, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
91 virtual int addImageSource(const char* id, const MixerLayoutConfig& config, ImageType type = kPng, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
99 virtual int delImageSource(const char* id, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
103 virtual int clearLayout(aosl_ref_t ares = AOSL_REF_INVALID) = 0;
110 virtual int refresh(aosl_ref_t ares = AOSL_REF_INVALID) = 0;
121 virtual int setBackground(uint32_t width, uint32_t height, int fps, uint32_t color_argb = 0, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
132 virtual int setBackground(uint32_t width, uint32_t height, int fps, const char* url, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
140 virtual int setRotation(uint8_t rotation, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
147 virtual int getAvgMixerDelay() = 0;
155 virtual int setMasterClockSource(const char* id = NULL, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
156 };
157
158 } //namespace rtc
159 } // namespace agora
agora::rtc::kJpeg
@ kJpeg
Definition: NGIAgoraVideoMixerSource.h:34
agora::rtc::IVideoMixerSource::setRotation
virtual int setRotation(uint8_t rotation, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IVideoMixerSource::setBackground
virtual int setBackground(uint32_t width, uint32_t height, int fps, uint32_t color_argb=0, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IVideoMixerSource::setStreamLayout
virtual int setStreamLayout(const char *id, const MixerLayoutConfig &config, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::kGif
@ kGif
Definition: NGIAgoraVideoMixerSource.h:35
agora::agora_refptr
Definition: AgoraRefPtr.h:44
agora::rtc::MixerLayoutConfig::y
int32_t y
Definition: NGIAgoraVideoMixerSource.h:20
agora::rtc::MixerLayoutConfig
Definition: NGIAgoraVideoMixerSource.h:18
agora::rtc::MixerLayoutConfig::MixerLayoutConfig
MixerLayoutConfig(int ox, int oy, int w, int h, int order)
Definition: NGIAgoraVideoMixerSource.h:29
agora::rtc::MixerLayoutConfig::width
int32_t width
Definition: NGIAgoraVideoMixerSource.h:21
agora
Definition: AgoraAtomicOps.h:21
agora::rtc::IVideoMixerSource::addImageSource
virtual int addImageSource(const char *id, const MixerLayoutConfig &config, ImageType type=kPng, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::MixerLayoutConfig::alpha
float alpha
Definition: NGIAgoraVideoMixerSource.h:24
agora::rtc::MixerLayoutConfig::x
int32_t x
Definition: NGIAgoraVideoMixerSource.h:19
agora::rtc::MixerLayoutConfig::mirror
bool mirror
Definition: NGIAgoraVideoMixerSource.h:25
agora::rtc::IVideoMixerSource::removeVideoTrack
virtual int removeVideoTrack(const char *id, agora_refptr< IVideoTrack > track, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::MixerLayoutConfig::height
int32_t height
Definition: NGIAgoraVideoMixerSource.h:22
agora::rtc::IVideoMixerSource
Definition: NGIAgoraVideoMixerSource.h:44
agora::rtc::IVideoMixerSource::clearLayout
virtual int clearLayout(aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::MixerLayoutConfig::image_path
const char * image_path
Definition: NGIAgoraVideoMixerSource.h:26
agora::rtc::IVideoMixerSource::addVideoTrack
virtual int addVideoTrack(const char *id, agora_refptr< IVideoTrack > track, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::ImageType
ImageType
Definition: NGIAgoraVideoMixerSource.h:32
agora::rtc::IVideoMixerSource::refresh
virtual int refresh(aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::kPng
@ kPng
Definition: NGIAgoraVideoMixerSource.h:33
agora::rtc::IVideoMixerSource::delImageSource
virtual int delImageSource(const char *id, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::MixerLayoutConfig::zOrder
int32_t zOrder
Definition: NGIAgoraVideoMixerSource.h:23
agora::rtc::MixerLayoutConfig::MixerLayoutConfig
MixerLayoutConfig()
Definition: NGIAgoraVideoMixerSource.h:28
agora::rtc::IVideoMixerSource::setBackground
virtual int setBackground(uint32_t width, uint32_t height, int fps, const char *url, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::RefCountInterface
Definition: AgoraRefPtr.h:31
agora::rtc::IVideoMixerSource::getAvgMixerDelay
virtual int getAvgMixerDelay()=0
agora::rtc::IVideoMixerSource::delStreamLayout
virtual int delStreamLayout(const char *id, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IVideoMixerSource::setMasterClockSource
virtual int setMasterClockSource(const char *id=NULL, aosl_ref_t ares=AOSL_REF_INVALID)=0
rtc
Definition: video_node_i.h:28