Agora RTC Objective-C API Reference Refactor

NGIAgoraVideoMixerSource.h
Go to the documentation of this file.
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 VIDEO_ORIENTATION rotation;
28
29 MixerLayoutConfig() : x(0), y(0), width(0), height(0), zOrder(0), alpha(1.0), mirror(false), image_path(NULL), rotation(VIDEO_ORIENTATION::VIDEO_ORIENTATION_0) {}
30 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), rotation(VIDEO_ORIENTATION::VIDEO_ORIENTATION_0) {}
31 };
32
33 enum ImageType {
34 kUnknownPic,
35 kPng,
36 kJpeg,
37 kGif
38 };
39
46 class IVideoMixerSource : public RefCountInterface {
47 public:
56 virtual int addVideoTrack(const char* id, agora_refptr<IVideoTrack> track, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
65 virtual int removeVideoTrack(const char* id, agora_refptr<IVideoTrack> track, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
75 virtual int setStreamLayout(const char* id, const MixerLayoutConfig& config, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
84 virtual int delStreamLayout(const char* id, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
93 virtual int addImageSource(const char* id, const MixerLayoutConfig& config, ImageType type = kPng, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
101 virtual int delImageSource(const char* id, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
105 virtual int clearLayout(aosl_ref_t ares = AOSL_REF_INVALID) = 0;
112 virtual int refresh(aosl_ref_t ares = AOSL_REF_INVALID) = 0;
123 virtual int setBackground(uint32_t width, uint32_t height, int fps, uint32_t color_argb = 0, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
134 virtual int setBackground(uint32_t width, uint32_t height, int fps, const char* url, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
142 virtual int setRotation(uint8_t rotation, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
149 virtual int getAvgMixerDelay() = 0;
157 virtual int setMasterClockSource(const char* id = NULL, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
158 };
159
160 } //namespace rtc
161 } // namespace agora
agora::rtc::MixerLayoutConfig::mirror
bool mirror
Definition: NGIAgoraVideoMixerSource.h:25
agora::rtc::IVideoMixerSource::getAvgMixerDelay
virtual int getAvgMixerDelay()=0
AgoraBase.h
agora::agora_refptr
Definition: AgoraRefPtr.h:44
agora::rtc::MixerLayoutConfig::MixerLayoutConfig
MixerLayoutConfig(int ox, int oy, int w, int h, int order)
Definition: NGIAgoraVideoMixerSource.h:30
agora::rtc::IVideoMixerSource::setMasterClockSource
virtual int setMasterClockSource(const char *id=NULL, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::MixerLayoutConfig
Definition: NGIAgoraVideoMixerSource.h:18
agora::rtc::MixerLayoutConfig::rotation
VIDEO_ORIENTATION rotation
Definition: NGIAgoraVideoMixerSource.h:27
agora::rtc::MixerLayoutConfig::y
int32_t y
Definition: NGIAgoraVideoMixerSource.h:20
agora::rtc::kUnknownPic
@ kUnknownPic
Definition: NGIAgoraVideoMixerSource.h:34
agora::rtc::MixerLayoutConfig::image_path
const char * image_path
Definition: NGIAgoraVideoMixerSource.h:26
agora::rtc::kPng
@ kPng
Definition: NGIAgoraVideoMixerSource.h:35
agora::rtc::IVideoMixerSource::removeVideoTrack
virtual int removeVideoTrack(const char *id, agora_refptr< IVideoTrack > track, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora
Definition: AgoraAtomicOps.h:21
agora::rtc::MixerLayoutConfig::MixerLayoutConfig
MixerLayoutConfig()
Definition: NGIAgoraVideoMixerSource.h:29
agora::rtc::IVideoMixerSource::refresh
virtual int refresh(aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IVideoMixerSource::delImageSource
virtual int delImageSource(const char *id, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::MixerLayoutConfig::width
int32_t width
Definition: NGIAgoraVideoMixerSource.h:21
agora::rtc::ImageType
ImageType
Definition: NGIAgoraVideoMixerSource.h:33
agora::rtc::IVideoMixerSource
Definition: NGIAgoraVideoMixerSource.h:46
agora::rtc::kGif
@ kGif
Definition: NGIAgoraVideoMixerSource.h:37
agora::rtc::IVideoMixerSource::clearLayout
virtual int clearLayout(aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::kJpeg
@ kJpeg
Definition: NGIAgoraVideoMixerSource.h:36
agora::rtc::MixerLayoutConfig::alpha
float alpha
Definition: NGIAgoraVideoMixerSource.h:24
agora::rtc::VIDEO_ORIENTATION
VIDEO_ORIENTATION
The clockwise rotation of the video.
Definition: AgoraBase.h:1001
agora::rtc::IVideoMixerSource::delStreamLayout
virtual int delStreamLayout(const char *id, aosl_ref_t ares=AOSL_REF_INVALID)=0
AgoraRefPtr.h
agora::rtc::MixerLayoutConfig::zOrder
int32_t zOrder
Definition: NGIAgoraVideoMixerSource.h:23
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::rtc::IVideoMixerSource::setRotation
virtual int setRotation(uint8_t rotation, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::MixerLayoutConfig::height
int32_t height
Definition: NGIAgoraVideoMixerSource.h:22
agora::RefCountInterface
Definition: AgoraRefPtr.h:31
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::IVideoMixerSource::setStreamLayout
virtual int setStreamLayout(const char *id, const MixerLayoutConfig &config, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IVideoMixerSource::addVideoTrack
virtual int addVideoTrack(const char *id, agora_refptr< IVideoTrack > track, 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
IAgoraService.h
agora::rtc::VIDEO_ORIENTATION_0
@ VIDEO_ORIENTATION_0
Definition: AgoraBase.h:1005
agora::rtc::MixerLayoutConfig::x
int32_t x
Definition: NGIAgoraVideoMixerSource.h:19