Agora Java API Reference for Android
AgoraBase.h
1 //
2 // Agora Engine SDK
3 //
4 // Created by Sting Feng in 2017-11.
5 // Copyright (c) 2017 Agora.io. All rights reserved.
6 //
7 
8 // This header file is included by both high level and low level APIs,
9 #pragma once // NOLINT(build/header_guard)
10 
11 #include <stdarg.h>
12 #include <stddef.h>
13 #include <stdio.h>
14 #include <string.h>
15 #include <cassert>
16 
17 #include "IAgoraParameter.h"
18 #include "AgoraMediaBase.h"
19 #include "AgoraRefPtr.h"
20 
21 #define MAX_PATH_260 (260)
22 
23 #if defined(_WIN32)
24 
25 #ifndef WIN32_LEAN_AND_MEAN
26 #define WIN32_LEAN_AND_MEAN
27 #endif // !WIN32_LEAN_AND_MEAN
28 #if defined(__aarch64__)
29 #include <arm64intr.h>
30 #endif
31 #include <Windows.h>
32 
33 #if defined(AGORARTC_EXPORT)
34 #define AGORA_API extern "C" __declspec(dllexport)
35 #else
36 #define AGORA_API extern "C" __declspec(dllimport)
37 #endif // AGORARTC_EXPORT
38 
39 #define AGORA_CALL __cdecl
40 
41 #elif defined(__APPLE__)
42 
43 #include <TargetConditionals.h>
44 
45 #define AGORA_API extern "C" __attribute__((visibility("default")))
46 #define AGORA_CALL
47 
48 #elif defined(__ANDROID__) || defined(__linux__)
49 
50 #define AGORA_API extern "C" __attribute__((visibility("default")))
51 #define AGORA_CALL
52 
53 #else // !_WIN32 && !__APPLE__ && !(__ANDROID__ || __linux__)
54 
55 #define AGORA_API extern "C"
56 #define AGORA_CALL
57 
58 #endif // _WIN32
59 
60 #ifndef OPTIONAL_ENUM_SIZE_T
61 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
62 #define OPTIONAL_ENUM_SIZE_T enum : size_t
63 #else
64 #define OPTIONAL_ENUM_SIZE_T enum
65 #endif
66 #endif
67 
68 #ifndef OPTIONAL_NULLPTR
69 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
70 #define OPTIONAL_NULLPTR nullptr
71 #else
72 #define OPTIONAL_NULLPTR NULL
73 #endif
74 #endif
75 
76 namespace agora {
77 namespace commons {
78 namespace cjson {
79 class JsonWrapper;
80 } // namespace cjson
81 } // namespace commons
82 
83 typedef commons::cjson::JsonWrapper any_document_t;
84 
85 namespace base {
86 class IEngineBase;
87 
89  public:
90  virtual int setParameters(const char* parameters) = 0;
91  virtual int getParameters(const char* key, any_document_t& result) = 0;
92  virtual ~IParameterEngine() {}
93 };
94 } // namespace base
95 
96 namespace util {
97 
98 template <class T>
99 class AutoPtr {
100  protected:
101  typedef T value_type;
102  typedef T* pointer_type;
103 
104  public:
105  explicit AutoPtr(pointer_type p = NULL) : ptr_(p) {}
106 
107  ~AutoPtr() {
108  if (ptr_) {
109  ptr_->release();
110  ptr_ = NULL;
111  }
112  }
113 
114  operator bool() const { return (ptr_ != NULL); }
115 
116  value_type& operator*() const { return *get(); }
117 
118  pointer_type operator->() const { return get(); }
119 
120  pointer_type get() const { return ptr_; }
121 
122  pointer_type release() {
123  pointer_type ret = ptr_;
124  ptr_ = 0;
125  return ret;
126  }
127 
128  void reset(pointer_type ptr = NULL) {
129  if (ptr != ptr_ && ptr_) {
130  ptr_->release();
131  }
132 
133  ptr_ = ptr;
134  }
135 
136  template <class C1, class C2>
137  bool queryInterface(C1* c, C2 iid) {
138  pointer_type p = NULL;
139  if (c && !c->queryInterface(iid, reinterpret_cast<void**>(&p))) {
140  reset(p);
141  }
142 
143  return (p != NULL);
144  }
145 
146  private:
147  AutoPtr(const AutoPtr&);
148  AutoPtr& operator=(const AutoPtr&);
149 
150  private:
151  pointer_type ptr_;
152 };
153 
154 template <class T>
155 class CopyableAutoPtr : public AutoPtr<T> {
156  typedef typename AutoPtr<T>::pointer_type pointer_type;
157 
158  public:
159  explicit CopyableAutoPtr(pointer_type p = 0) : AutoPtr<T>(p) {}
160  explicit CopyableAutoPtr(const CopyableAutoPtr& rhs) { this->reset(rhs.clone()); }
161  CopyableAutoPtr& operator=(const CopyableAutoPtr& rhs) {
162  if (this != &rhs) this->reset(rhs.clone());
163  return *this;
164  }
165  pointer_type clone() const {
166  if (!this->get()) return NULL;
167  return this->get()->clone();
168  }
169 };
170 
171 class IString {
172  public:
173  virtual bool empty() const = 0;
174  virtual const char* c_str() = 0;
175  virtual const char* data() = 0;
176  virtual size_t length() = 0;
177  virtual IString* clone() = 0;
178  virtual void release() = 0;
179  virtual ~IString() {}
180 };
182 
183 class IIterator {
184  public:
185  virtual void* current() = 0;
186  virtual const void* const_current() const = 0;
187  virtual bool next() = 0;
188  virtual void release() = 0;
189  virtual ~IIterator() {}
190 };
191 
192 class IContainer {
193  public:
194  virtual IIterator* begin() = 0;
195  virtual size_t size() const = 0;
196  virtual void release() = 0;
197  virtual ~IContainer() {}
198 };
199 
200 template <class T>
202  IIterator* p;
203 
204  public:
205  typedef T value_type;
206  typedef value_type& reference;
207  typedef const value_type& const_reference;
208  typedef value_type* pointer;
209  typedef const value_type* const_pointer;
210  explicit AOutputIterator(IIterator* it = NULL) : p(it) {}
211  ~AOutputIterator() {
212  if (p) p->release();
213  }
214  AOutputIterator(const AOutputIterator& rhs) : p(rhs.p) {}
215  AOutputIterator& operator++() {
216  p->next();
217  return *this;
218  }
219  bool operator==(const AOutputIterator& rhs) const {
220  if (p && rhs.p)
221  return p->current() == rhs.p->current();
222  else
223  return valid() == rhs.valid();
224  }
225  bool operator!=(const AOutputIterator& rhs) const { return !this->operator==(rhs); }
226  reference operator*() { return *reinterpret_cast<pointer>(p->current()); }
227  const_reference operator*() const { return *reinterpret_cast<const_pointer>(p->const_current()); }
228  bool valid() const { return p && p->current() != NULL; }
229 };
230 
231 template <class T>
232 class AList {
233  IContainer* container;
234  bool owner;
235 
236  public:
237  typedef T value_type;
238  typedef value_type& reference;
239  typedef const value_type& const_reference;
240  typedef value_type* pointer;
241  typedef const value_type* const_pointer;
242  typedef size_t size_type;
245 
246  public:
247  AList() : container(NULL), owner(false) {}
248  AList(IContainer* c, bool take_ownership) : container(c), owner(take_ownership) {}
249  ~AList() { reset(); }
250  void reset(IContainer* c = NULL, bool take_ownership = false) {
251  if (owner && container) container->release();
252  container = c;
253  owner = take_ownership;
254  }
255  iterator begin() { return container ? iterator(container->begin()) : iterator(NULL); }
256  iterator end() { return iterator(NULL); }
257  size_type size() const { return container ? container->size() : 0; }
258  bool empty() const { return size() == 0; }
259 };
260 
261 } // namespace util
262 
266 enum CHANNEL_PROFILE_TYPE {
272  CHANNEL_PROFILE_COMMUNICATION = 0,
278  CHANNEL_PROFILE_LIVE_BROADCASTING = 1,
283  CHANNEL_PROFILE_GAME = 2,
290  CHANNEL_PROFILE_CLOUD_GAMING = 3,
291 
297  CHANNEL_PROFILE_COMMUNICATION_1v1 = 4,
298 
304  CHANNEL_PROFILE_LIVE_BROADCASTING_2 = 5,
305 };
306 
310 enum WARN_CODE_TYPE {
315  WARN_INVALID_VIEW = 8,
320  WARN_INIT_VIDEO = 16,
325  WARN_PENDING = 20,
330  WARN_NO_AVAILABLE_CHANNEL = 103,
336  WARN_LOOKUP_CHANNEL_TIMEOUT = 104,
341  WARN_LOOKUP_CHANNEL_REJECTED = 105,
347  WARN_OPEN_CHANNEL_TIMEOUT = 106,
352  WARN_OPEN_CHANNEL_REJECTED = 107,
353 
354  // sdk: 100~1000
358  WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111,
362  WARN_SET_CLIENT_ROLE_TIMEOUT = 118,
366  WARN_OPEN_CHANNEL_INVALID_TICKET = 121,
370  WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122,
374  WARN_CHANNEL_CONNECTION_UNRECOVERABLE = 131,
378  WARN_CHANNEL_CONNECTION_IP_CHANGED = 132,
382  WARN_CHANNEL_CONNECTION_PORT_CHANGED = 133,
385  WARN_CHANNEL_SOCKET_ERROR = 134,
389  WARN_AUDIO_MIXING_OPEN_ERROR = 701,
393  WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014,
397  WARN_ADM_RUNTIME_RECORDING_WARNING = 1016,
401  WARN_ADM_RECORD_AUDIO_SILENCE = 1019,
405  WARN_ADM_PLAYOUT_MALFUNCTION = 1020,
409  WARN_ADM_RECORD_MALFUNCTION = 1021,
416  WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD = 1029,
420  WARN_ADM_IOS_SAMPLERATE_CHANGE = 1030,
424  WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031,
428  WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032,
436  WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040,
440  WARN_APM_HOWLING = 1051,
444  WARN_ADM_GLITCH_STATE = 1052,
448  WARN_ADM_IMPROPER_SETTINGS = 1053,
452  WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
457  WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
465  WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324,
466 };
467 
471 enum ERROR_CODE_TYPE {
475  ERR_OK = 0,
476  // 1~1000
480  ERR_FAILED = 1,
485  ERR_INVALID_ARGUMENT = 2,
492  ERR_NOT_READY = 3,
496  ERR_NOT_SUPPORTED = 4,
500  ERR_REFUSED = 5,
504  ERR_BUFFER_TOO_SMALL = 6,
508  ERR_NOT_INITIALIZED = 7,
512  ERR_INVALID_STATE = 8,
517  ERR_NO_PERMISSION = 9,
523  ERR_TIMEDOUT = 10,
528  ERR_CANCELED = 11,
534  ERR_TOO_OFTEN = 12,
540  ERR_BIND_SOCKET = 13,
545  ERR_NET_DOWN = 14,
551  ERR_NET_NOBUFS = 15,
557  ERR_JOIN_CHANNEL_REJECTED = 17,
564  ERR_LEAVE_CHANNEL_REJECTED = 18,
568  ERR_ALREADY_IN_USE = 19,
573  ERR_ABORTED = 20,
578  ERR_INIT_NET_ENGINE = 21,
583  ERR_RESOURCE_LIMITED = 22,
589  ERR_INVALID_APP_ID = 101,
594  ERR_INVALID_CHANNEL_NAME = 102,
600  ERR_NO_SERVER_RESOURCES = 103,
613  ERR_TOKEN_EXPIRED = 109,
630  ERR_INVALID_TOKEN = 110,
635  ERR_CONNECTION_INTERRUPTED = 111, // only used in web sdk
640  ERR_CONNECTION_LOST = 112, // only used in web sdk
645  ERR_NOT_IN_CHANNEL = 113,
650  ERR_SIZE_TOO_LARGE = 114,
655  ERR_BITRATE_LIMIT = 115,
660  ERR_TOO_MANY_DATA_STREAMS = 116,
664  ERR_STREAM_MESSAGE_TIMEOUT = 117,
668  ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119,
673  ERR_DECRYPTION_FAILED = 120,
677  ERR_INVALID_USER_ID = 121,
681  ERR_CLIENT_IS_BANNED_BY_SERVER = 123,
685  ERR_WATERMARK_PARAM = 124,
689  ERR_WATERMARK_PATH = 125,
693  ERR_WATERMARK_PNG = 126,
697  ERR_WATERMARKR_INFO = 127,
701  ERR_WATERMARK_ARGB = 128,
705  ERR_WATERMARK_READ = 129,
711  ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130,
712 
716  ERR_LICENSE_CREDENTIAL_INVALID = 131,
717 
718  // Licensing, keep the license error code same as the main version
719  ERR_CERT_RAW = 157,
720  ERR_CERT_JSON_PART = 158,
721  ERR_CERT_JSON_INVAL = 159,
722  ERR_CERT_JSON_NOMEM = 160,
723  ERR_CERT_CUSTOM = 161,
724  ERR_CERT_CREDENTIAL = 162,
725  ERR_CERT_SIGN = 163,
726  ERR_CERT_FAIL = 164,
727  ERR_CERT_BUF = 165,
728  ERR_CERT_NULL = 166,
729  ERR_CERT_DUEDATE = 167,
730  ERR_CERT_REQUEST = 168,
731 
732  // PcmSend Error num
733  ERR_PCMSEND_FORMAT =200, // unsupport pcm format
734  ERR_PCMSEND_BUFFEROVERFLOW = 201, // buffer overflow, the pcm send rate too quickly
735 
737  // signaling: 400~600
738  ERR_LOGOUT_OTHER = 400, //
739  ERR_LOGOUT_USER = 401, // logout by user
740  ERR_LOGOUT_NET = 402, // network failure
741  ERR_LOGOUT_KICKED = 403, // login in other device
742  ERR_LOGOUT_PACKET = 404, //
743  ERR_LOGOUT_TOKEN_EXPIRED = 405, // token expired
744  ERR_LOGOUT_OLDVERSION = 406, //
745  ERR_LOGOUT_TOKEN_WRONG = 407,
746  ERR_LOGOUT_ALREADY_LOGOUT = 408,
747  ERR_LOGIN_OTHER = 420,
748  ERR_LOGIN_NET = 421,
749  ERR_LOGIN_FAILED = 422,
750  ERR_LOGIN_CANCELED = 423,
751  ERR_LOGIN_TOKEN_EXPIRED = 424,
752  ERR_LOGIN_OLD_VERSION = 425,
753  ERR_LOGIN_TOKEN_WRONG = 426,
754  ERR_LOGIN_TOKEN_KICKED = 427,
755  ERR_LOGIN_ALREADY_LOGIN = 428,
756  ERR_JOIN_CHANNEL_OTHER = 440,
757  ERR_SEND_MESSAGE_OTHER = 440,
758  ERR_SEND_MESSAGE_TIMEOUT = 441,
759  ERR_QUERY_USERNUM_OTHER = 450,
760  ERR_QUERY_USERNUM_TIMEOUT = 451,
761  ERR_QUERY_USERNUM_BYUSER = 452,
762  ERR_LEAVE_CHANNEL_OTHER = 460,
763  ERR_LEAVE_CHANNEL_KICKED = 461,
764  ERR_LEAVE_CHANNEL_BYUSER = 462,
765  ERR_LEAVE_CHANNEL_LOGOUT = 463,
766  ERR_LEAVE_CHANNEL_DISCONNECTED = 464,
767  ERR_INVITE_OTHER = 470,
768  ERR_INVITE_REINVITE = 471,
769  ERR_INVITE_NET = 472,
770  ERR_INVITE_PEER_OFFLINE = 473,
771  ERR_INVITE_TIMEOUT = 474,
772  ERR_INVITE_CANT_RECV = 475,
774  // 1001~2000
778  ERR_LOAD_MEDIA_ENGINE = 1001,
782  ERR_START_CALL = 1002,
786  ERR_START_CAMERA = 1003,
790  ERR_START_VIDEO_RENDER = 1004,
796  ERR_ADM_GENERAL_ERROR = 1005,
800  ERR_ADM_JAVA_RESOURCE = 1006,
804  ERR_ADM_SAMPLE_RATE = 1007,
809  ERR_ADM_INIT_PLAYOUT = 1008,
813  ERR_ADM_START_PLAYOUT = 1009,
817  ERR_ADM_STOP_PLAYOUT = 1010,
822  ERR_ADM_INIT_RECORDING = 1011,
826  ERR_ADM_START_RECORDING = 1012,
830  ERR_ADM_STOP_RECORDING = 1013,
835  ERR_ADM_RUNTIME_PLAYOUT_ERROR = 1015,
839  ERR_ADM_RUNTIME_RECORDING_ERROR = 1017,
843  ERR_ADM_RECORD_AUDIO_FAILED = 1018,
848  ERR_ADM_INIT_LOOPBACK = 1022,
853  ERR_ADM_START_LOOPBACK = 1023,
858  ERR_ADM_NO_PERMISSION = 1027,
862  ERR_ADM_RECORD_AUDIO_IS_ACTIVE = 1033,
866  ERR_ADM_ANDROID_JNI_JAVA_RESOURCE = 1101,
872  ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY = 1108,
878  ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY = 1109,
886  ERR_ADM_ANDROID_JNI_JAVA_START_RECORD = 1111,
894  ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK = 1112,
899  ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR = 1115,
901  ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE = 1151,
903  ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER = 1153,
905  ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD = 1156,
907  ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER = 1157,
909  ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD = 1160,
916  ERR_ADM_IOS_INPUT_NOT_AVAILABLE = 1201,
920  ERR_ADM_IOS_ACTIVATE_SESSION_FAIL = 1206,
925  ERR_ADM_IOS_VPIO_INIT_FAIL = 1210,
930  ERR_ADM_IOS_VPIO_REINIT_FAIL = 1213,
935  ERR_ADM_IOS_VPIO_RESTART_FAIL = 1214,
936  ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL = 1219,
938  ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO = 1221,
946  ERR_ADM_WIN_CORE_INIT = 1301,
953  ERR_ADM_WIN_CORE_INIT_RECORDING = 1303,
960  ERR_ADM_WIN_CORE_INIT_PLAYOUT = 1306,
966  ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL = 1307,
973  ERR_ADM_WIN_CORE_START_RECORDING = 1309,
980  ERR_ADM_WIN_CORE_CREATE_REC_THREAD = 1311,
989  ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP = 1314,
996  ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD = 1319,
1005  ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP = 1320,
1011  ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
1017  ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
1027  ERR_ADM_WIN_WAVE_INIT = 1351,
1036  ERR_ADM_WIN_WAVE_INIT_RECORDING = 1353,
1045  ERR_ADM_WIN_WAVE_INIT_MICROPHONE = 1354,
1054  ERR_ADM_WIN_WAVE_INIT_PLAYOUT = 1355,
1063  ERR_ADM_WIN_WAVE_INIT_SPEAKER = 1356,
1072  ERR_ADM_WIN_WAVE_START_RECORDING = 1357,
1081  ERR_ADM_WIN_WAVE_START_PLAYOUT = 1358,
1085  ERR_ADM_NO_RECORDING_DEVICE = 1359,
1089  ERR_ADM_NO_PLAYOUT_DEVICE = 1360,
1090 
1091  // VDM error code starts from 1500
1095  ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501,
1096 
1097  // VDM error code starts from 1500
1101  ERR_VDM_WIN_DEVICE_IN_USE = 1502,
1102 
1103  // VCM error code starts from 1600
1107  ERR_VCM_UNKNOWN_ERROR = 1600,
1112  ERR_VCM_ENCODER_INIT_ERROR = 1601,
1116  ERR_VCM_ENCODER_ENCODE_ERROR = 1602,
1120  ERR_VCM_ENCODER_SET_ERROR = 1603,
1121 };
1122 
1123 typedef const char* user_id_t;
1124 typedef void* view_t;
1125 
1129 struct UserInfo {
1139  bool hasAudio;
1145  bool hasVideo;
1146 
1147  UserInfo() : hasAudio(false), hasVideo(false) {}
1148 };
1149 
1150 typedef util::AList<UserInfo> UserList;
1151 
1152 // Shared between Agora Service and Rtc Engine
1153 namespace rtc {
1154 
1158 enum USER_OFFLINE_REASON_TYPE {
1162  USER_OFFLINE_QUIT = 0,
1168  USER_OFFLINE_DROPPED = 1,
1172  USER_OFFLINE_BECOME_AUDIENCE = 2,
1173 };
1174 
1175 enum INTERFACE_ID_TYPE {
1176  AGORA_IID_AUDIO_DEVICE_MANAGER = 1,
1177  AGORA_IID_VIDEO_DEVICE_MANAGER = 2,
1178  AGORA_IID_PARAMETER_ENGINE = 3,
1179  AGORA_IID_MEDIA_ENGINE = 4,
1180  AGORA_IID_AUDIO_ENGINE = 5,
1181  AGORA_IID_VIDEO_ENGINE = 6,
1182  AGORA_IID_RTC_CONNECTION = 7,
1183  AGORA_IID_SIGNALING_ENGINE = 8,
1184  AGORA_IID_MEDIA_ENGINE_REGULATOR = 9,
1185 };
1186 
1190 enum QUALITY_TYPE {
1195  QUALITY_UNKNOWN = 0,
1199  QUALITY_EXCELLENT = 1,
1204  QUALITY_GOOD = 2,
1208  QUALITY_POOR = 3,
1212  QUALITY_BAD = 4,
1216  QUALITY_VBAD = 5,
1220  QUALITY_DOWN = 6,
1224  QUALITY_UNSUPPORTED = 7,
1228  QUALITY_DETECTING
1229 };
1230 
1234 enum FIT_MODE_TYPE {
1239  MODE_COVER = 1,
1240 
1246  MODE_CONTAIN = 2,
1247 };
1248 
1252 enum VIDEO_ORIENTATION {
1256  VIDEO_ORIENTATION_0 = 0,
1260  VIDEO_ORIENTATION_90 = 90,
1264  VIDEO_ORIENTATION_180 = 180,
1268  VIDEO_ORIENTATION_270 = 270
1269 };
1270 
1274 enum FRAME_RATE {
1278  FRAME_RATE_FPS_1 = 1,
1282  FRAME_RATE_FPS_7 = 7,
1286  FRAME_RATE_FPS_10 = 10,
1290  FRAME_RATE_FPS_15 = 15,
1294  FRAME_RATE_FPS_24 = 24,
1298  FRAME_RATE_FPS_30 = 30,
1302  FRAME_RATE_FPS_60 = 60,
1303 };
1304 
1305 enum FRAME_WIDTH {
1306  FRAME_WIDTH_640 = 640,
1307 };
1308 
1309 enum FRAME_HEIGHT {
1310  FRAME_HEIGHT_360 = 360,
1311 };
1312 
1313 
1317 enum VIDEO_FRAME_TYPE {
1319  VIDEO_FRAME_TYPE_BLANK_FRAME = 0,
1321  VIDEO_FRAME_TYPE_KEY_FRAME = 3,
1323  VIDEO_FRAME_TYPE_DELTA_FRAME = 4,
1325  VIDEO_FRAME_TYPE_B_FRAME = 5,
1327  VIDEO_FRAME_TYPE_DROPPABLE_FRAME = 6,
1329  VIDEO_FRAME_TYPE_UNKNOW
1330 };
1331 
1335 enum ORIENTATION_MODE {
1343  ORIENTATION_MODE_ADAPTIVE = 0,
1351  ORIENTATION_MODE_FIXED_LANDSCAPE = 1,
1359  ORIENTATION_MODE_FIXED_PORTRAIT = 2,
1360 };
1361 
1365 enum DEGRADATION_PREFERENCE {
1369  MAINTAIN_QUALITY = 0,
1373  MAINTAIN_FRAMERATE = 1,
1377  MAINTAIN_BALANCED = 2,
1381  MAINTAIN_RESOLUTION = 3,
1385  DISABLED = 100,
1386 };
1387 
1395  int width;
1399  int height;
1400  VideoDimensions() : width(640), height(480) {}
1401  VideoDimensions(int w, int h) : width(w), height(h) {}
1402  bool operator==(const VideoDimensions& rhs) const {
1403  return width == rhs.width && height == rhs.height;
1404  }
1405 };
1406 
1416 const int STANDARD_BITRATE = 0;
1417 
1425 const int COMPATIBLE_BITRATE = -1;
1426 
1430 const int DEFAULT_MIN_BITRATE = -1;
1431 
1435 const int DEFAULT_MIN_BITRATE_EQUAL_TO_TARGET_BITRATE = -2;
1436 
1440 enum VIDEO_CODEC_TYPE {
1444  VIDEO_CODEC_VP8 = 1,
1448  VIDEO_CODEC_H264 = 2,
1452  VIDEO_CODEC_H265 = 3,
1456  VIDEO_CODEC_VP9 = 5,
1460  VIDEO_CODEC_GENERIC = 6,
1464  VIDEO_CODEC_GENERIC_H264 = 7,
1468  VIDEO_CODEC_GENERIC_JPEG = 20,
1469 };
1470 
1474 enum AUDIO_CODEC_TYPE {
1478  AUDIO_CODEC_OPUS = 1,
1479  // kIsac = 2,
1483  AUDIO_CODEC_PCMA = 3,
1487  AUDIO_CODEC_PCMU = 4,
1491  AUDIO_CODEC_G722 = 5,
1492  // kIlbc = 6,
1494  // AUDIO_CODEC_AAC = 7,
1498  AUDIO_CODEC_AACLC = 8,
1502  AUDIO_CODEC_HEAAC = 9,
1506  AUDIO_CODEC_JC1 = 10,
1507  AUDIO_CODEC_HEAAC2 = 11,
1508 };
1509 
1513 enum AUDIO_ENCODING_TYPE {
1517  AUDIO_ENCODING_TYPE_AAC_16000_LOW = 0x010101,
1521  AUDIO_ENCODING_TYPE_AAC_16000_MEDIUM = 0x010102,
1525  AUDIO_ENCODING_TYPE_AAC_32000_LOW = 0x010201,
1529  AUDIO_ENCODING_TYPE_AAC_32000_MEDIUM = 0x010202,
1533  AUDIO_ENCODING_TYPE_AAC_32000_HIGH = 0x010203,
1537  AUDIO_ENCODING_TYPE_AAC_48000_MEDIUM = 0x010302,
1541  AUDIO_ENCODING_TYPE_AAC_48000_HIGH = 0x010303,
1542 
1546  AUDIO_ENCODING_TYPE_OPUS_16000_LOW = 0x020101,
1550  AUDIO_ENCODING_TYPE_OPUS_16000_MEDIUM = 0x020102,
1554  AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM = 0x020302,
1558  AUDIO_ENCODING_TYPE_OPUS_48000_HIGH = 0x020303,
1559 };
1560 
1564 enum WATERMARK_FIT_MODE {
1569  FIT_MODE_COVER_POSITION,
1574  FIT_MODE_USE_IMAGE_RATIO
1575 };
1576 
1582  : speech(true),
1583  sendEvenIfEmpty(true) {}
1584 
1590  bool speech;
1597 
1598 };
1599 
1605  : codec(AUDIO_CODEC_AACLC),
1606  sampleRateHz(0),
1607  samplesPerChannel(0),
1608  numberOfChannels(0) {}
1609 
1611  : codec(rhs.codec),
1619  AUDIO_CODEC_TYPE codec;
1638 };
1644 
1646  : sampleCount(rhs.sampleCount),
1647  samplesOut(rhs.samplesOut),
1649  ntpTimeMs(rhs.ntpTimeMs) {}
1650 
1654  size_t sampleCount;
1655 
1656  // Output
1660  size_t samplesOut;
1664  int64_t elapsedTimeMs;
1668  int64_t ntpTimeMs;
1669 };
1673 enum H264PacketizeMode {
1677  NonInterleaved = 0, // Mode 1 - STAP-A, FU-A is allowed
1681  SingleNalUnit, // Mode 0 - only single NALU allowed
1682 };
1683 
1687 enum VIDEO_STREAM_TYPE {
1691  VIDEO_STREAM_HIGH = 0,
1695  VIDEO_STREAM_LOW = 1,
1696 };
1697 
1703  : codecType(VIDEO_CODEC_H264),
1704  width(0),
1705  height(0),
1706  framesPerSecond(0),
1707  frameType(VIDEO_FRAME_TYPE_BLANK_FRAME),
1708  rotation(VIDEO_ORIENTATION_0),
1709  trackId(0),
1710  renderTimeMs(0),
1711  internalSendTs(0),
1712  uid(0),
1713  streamType(VIDEO_STREAM_HIGH) {}
1714 
1716  : codecType(rhs.codecType),
1717  width(rhs.width),
1718  height(rhs.height),
1720  frameType(rhs.frameType),
1721  rotation(rhs.rotation),
1722  trackId(rhs.trackId),
1725  uid(rhs.uid),
1726  streamType(rhs.streamType) {}
1727 
1728  EncodedVideoFrameInfo& operator=(const EncodedVideoFrameInfo& rhs) {
1729  if (this == &rhs) return *this;
1730  codecType = rhs.codecType;
1731  width = rhs.width;
1732  height = rhs.height;
1734  frameType = rhs.frameType;
1735  rotation = rhs.rotation;
1736  trackId = rhs.trackId;
1737  renderTimeMs = rhs.renderTimeMs;
1739  uid = rhs.uid;
1740  streamType = rhs.streamType;
1741  return *this;
1742  }
1746  VIDEO_CODEC_TYPE codecType;
1750  int width;
1754  int height;
1765  VIDEO_FRAME_TYPE frameType;
1769  VIDEO_ORIENTATION rotation;
1773  int trackId; // This can be reserved for multiple video tracks, we need to create different ssrc
1774  // and additional payload for later implementation.
1778  int64_t renderTimeMs;
1782  uint64_t internalSendTs;
1786  uid_t uid;
1790  VIDEO_STREAM_TYPE streamType;
1791 };
1792 
1796 enum VIDEO_MIRROR_MODE_TYPE {
1800  VIDEO_MIRROR_MODE_AUTO = 0,
1804  VIDEO_MIRROR_MODE_ENABLED = 1,
1808  VIDEO_MIRROR_MODE_DISABLED = 2,
1809 };
1810 
1818  VIDEO_CODEC_TYPE codecType;
1881  int bitrate;
1882 
1902  ORIENTATION_MODE orientationMode;
1907  DEGRADATION_PREFERENCE degradationPreference;
1908 
1912  VIDEO_MIRROR_MODE_TYPE mirrorMode;
1913 
1914  VideoEncoderConfiguration(const VideoDimensions& d, int f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mirror = VIDEO_MIRROR_MODE_DISABLED)
1915  : codecType(VIDEO_CODEC_H264),
1916  dimensions(d),
1917  frameRate(f),
1918  bitrate(b),
1919  minBitrate(DEFAULT_MIN_BITRATE),
1920  orientationMode(m),
1921  degradationPreference(MAINTAIN_QUALITY),
1922  mirrorMode(mirror) {}
1923  VideoEncoderConfiguration(int width, int height, int f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mirror = VIDEO_MIRROR_MODE_DISABLED)
1924  : codecType(VIDEO_CODEC_H264),
1925  dimensions(width, height),
1926  frameRate(f),
1927  bitrate(b),
1928  minBitrate(DEFAULT_MIN_BITRATE),
1929  orientationMode(m),
1930  degradationPreference(MAINTAIN_QUALITY),
1931  mirrorMode(mirror) {}
1932  VideoEncoderConfiguration(const VideoEncoderConfiguration& config)
1933  : codecType(config.codecType),
1934  dimensions(config.dimensions),
1935  frameRate(config.frameRate),
1936  bitrate(config.bitrate),
1937  minBitrate(config.minBitrate),
1940  mirrorMode(config.mirrorMode) {}
1941  VideoEncoderConfiguration()
1942  : codecType(VIDEO_CODEC_H264),
1943  dimensions(FRAME_WIDTH_640, FRAME_HEIGHT_360),
1944  frameRate(FRAME_RATE_FPS_15),
1945  bitrate(STANDARD_BITRATE),
1946  minBitrate(DEFAULT_MIN_BITRATE),
1947  orientationMode(ORIENTATION_MODE_ADAPTIVE),
1948  degradationPreference(MAINTAIN_QUALITY),
1949  mirrorMode(VIDEO_MIRROR_MODE_DISABLED) {}
1950 
1951  VideoEncoderConfiguration& operator=(const VideoEncoderConfiguration& rhs) {
1952  if (this == &rhs) return *this;
1953  codecType = rhs.codecType;
1954  dimensions = rhs.dimensions;
1955  frameRate = rhs.frameRate;
1956  bitrate = rhs.bitrate;
1957  minBitrate = rhs.minBitrate;
1958  orientationMode = rhs.orientationMode;
1959  degradationPreference = rhs.degradationPreference;
1960  mirrorMode = rhs.mirrorMode;
1961  return *this;
1962  }
1963 };
1964 
1973  bool ordered;
1974 };
1975 
1987  int bitrate;
1992  SimulcastStreamConfig() : dimensions(160, 120), bitrate(65), framerate(5) {}
1993  bool operator==(const SimulcastStreamConfig& rhs) const {
1994  return dimensions == rhs.dimensions && bitrate == rhs.bitrate && framerate == rhs.framerate;
1995  }
1996 };
1997 
2001 struct Rectangle {
2005  int x;
2009  int y;
2013  int width;
2017  int height;
2018 
2019  Rectangle() : x(0), y(0), width(0), height(0) {}
2020  Rectangle(int xx, int yy, int ww, int hh) : x(xx), y(yy), width(ww), height(hh) {}
2021 };
2022 
2028  float xRatio;
2032  float yRatio;
2036  float widthRatio;
2037 
2038  WatermarkRatio() : xRatio(0.0), yRatio(0.0), widthRatio(0.0) {}
2039  WatermarkRatio(float x, float y, float width) : xRatio(x), yRatio(y), widthRatio(width) {}
2040 };
2041 
2066  WATERMARK_FIT_MODE mode;
2067 
2069  : visibleInPreview(false)
2070  , positionInLandscapeMode(0, 0, 0, 0)
2071  , positionInPortraitMode(0, 0, 0, 0)
2072  , mode(FIT_MODE_COVER_POSITION)
2073  {}
2074 };
2075 
2079 struct RtcStats {
2083  unsigned int duration;
2087  unsigned int txBytes;
2091  unsigned int rxBytes;
2095  unsigned int txAudioBytes;
2099  unsigned int txVideoBytes;
2103  unsigned int rxAudioBytes;
2107  unsigned int rxVideoBytes;
2111  unsigned short txKBitRate;
2115  unsigned short rxKBitRate;
2119  unsigned short rxAudioKBitRate;
2123  unsigned short txAudioKBitRate;
2127  unsigned short rxVideoKBitRate;
2131  unsigned short txVideoKBitRate;
2135  unsigned short lastmileDelay;
2139  unsigned int userCount;
2143  double cpuAppUsage;
2218  RtcStats() :
2219  duration(0),
2220  txBytes(0),
2221  rxBytes(0),
2222  txAudioBytes(0),
2223  txVideoBytes(0),
2224  rxAudioBytes(0),
2225  rxVideoBytes(0),
2226  txKBitRate(0),
2227  rxKBitRate(0),
2228  rxAudioKBitRate(0),
2229  txAudioKBitRate(0),
2230  rxVideoKBitRate(0),
2231  txVideoKBitRate(0),
2232  lastmileDelay(0),
2233  userCount(0),
2234  cpuAppUsage(0.0),
2235  cpuTotalUsage(0.0),
2236  memoryAppUsageRatio(0.0),
2237  memoryTotalUsageRatio(0.0),
2239  connectTimeMs(0),
2249  txPacketLossRate(0),
2250  rxPacketLossRate(0) {}
2251 };
2252 
2256 enum VIDEO_SOURCE_TYPE {
2259  VIDEO_SOURCE_CAMERA_PRIMARY,
2260  VIDEO_SOURCE_CAMERA = VIDEO_SOURCE_CAMERA_PRIMARY,
2263  VIDEO_SOURCE_CAMERA_SECONDARY,
2266  VIDEO_SOURCE_SCREEN_PRIMARY,
2267  VIDEO_SOURCE_SCREEN = VIDEO_SOURCE_SCREEN_PRIMARY,
2270  VIDEO_SOURCE_SCREEN_SECONDARY,
2273  VIDEO_SOURCE_CUSTOM,
2276  VIDEO_SOURCE_MEDIA_PLAYER,
2279  VIDEO_SOURCE_RTC_IMAGE_PNG,
2282  VIDEO_SOURCE_RTC_IMAGE_JPEG,
2285  VIDEO_SOURCE_RTC_IMAGE_GIF,
2288  VIDEO_SOURCE_REMOTE,
2291  VIDEO_SOURCE_TRANSCODED,
2292 
2293  VIDEO_SOURCE_UNKNOWN = 100
2294 };
2295 
2299 enum CLIENT_ROLE_TYPE {
2303  CLIENT_ROLE_BROADCASTER = 1,
2307  CLIENT_ROLE_AUDIENCE = 2,
2308 };
2309 
2311 enum AUDIENCE_LATENCY_LEVEL_TYPE
2312 {
2314  AUDIENCE_LATENCY_LEVEL_LOW_LATENCY = 1,
2316  AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY = 2,
2317 };
2318 
2322 {
2326  AUDIENCE_LATENCY_LEVEL_TYPE audienceLatencyLevel;
2328  : audienceLatencyLevel(AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY) {}
2329 };
2330 
2336 {
2340  uid_t uid;
2344  int quality;
2399  RemoteAudioStats() :
2400  uid(0),
2401  quality(0),
2403  jitterBufferDelay(0),
2404  audioLossRate(0),
2405  numChannels(0),
2406  receivedSampleRate(0),
2407  receivedBitrate(0),
2408  totalFrozenTime(0),
2409  frozenRate(0),
2410  mosValue(0) {}
2411 };
2412 
2416 enum AUDIO_PROFILE_TYPE {
2424  AUDIO_PROFILE_DEFAULT = 0,
2428  AUDIO_PROFILE_SPEECH_STANDARD = 1,
2432  AUDIO_PROFILE_MUSIC_STANDARD = 2,
2437  AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3,
2441  AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4,
2445  AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5,
2449  AUDIO_PROFILE_IOT = 6,
2450  AUDIO_PROFILE_NUM = 7
2451 };
2452 
2456 enum AUDIO_SCENARIO_TYPE {
2460  AUDIO_SCENARIO_DEFAULT = 0,
2466  AUDIO_SCENARIO_GAME_STREAMING = 3,
2472  AUDIO_SCENARIO_CHATROOM = 5,
2476  AUDIO_SCENARIO_HIGH_DEFINITION = 6,
2480  AUDIO_SCENARIO_CHORUS = 7,
2484  AUDIO_SCENARIO_NUM = 8,
2485 };
2486 
2490 struct VideoFormat {
2491  OPTIONAL_ENUM_SIZE_T {
2493  kMaxWidthInPixels = 3840,
2495  kMaxHeightInPixels = 2160,
2497  kMaxFps = 60,
2498  };
2499 
2503  int width; // Number of pixels.
2507  int height; // Number of pixels.
2511  int fps;
2512  VideoFormat() : width(FRAME_WIDTH_640), height(FRAME_HEIGHT_360), fps(FRAME_RATE_FPS_15) {}
2513  VideoFormat(int w, int h, int f) : width(w), height(h), fps(f) {}
2514 };
2515 
2519 enum VIDEO_CONTENT_HINT {
2523  CONTENT_HINT_NONE,
2530  CONTENT_HINT_MOTION,
2536  CONTENT_HINT_DETAILS
2537 };
2538 
2542 enum LOCAL_AUDIO_STREAM_STATE {
2546  LOCAL_AUDIO_STREAM_STATE_STOPPED = 0,
2550  LOCAL_AUDIO_STREAM_STATE_RECORDING = 1,
2554  LOCAL_AUDIO_STREAM_STATE_ENCODING = 2,
2558  LOCAL_AUDIO_STREAM_STATE_FAILED = 3
2559 };
2560 
2564 enum LOCAL_AUDIO_STREAM_ERROR {
2568  LOCAL_AUDIO_STREAM_ERROR_OK = 0,
2572  LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1,
2576  LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2,
2580  LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3,
2585  LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4,
2589  LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5
2590 };
2591 
2594 enum LOCAL_VIDEO_STREAM_STATE {
2598  LOCAL_VIDEO_STREAM_STATE_STOPPED = 0,
2602  LOCAL_VIDEO_STREAM_STATE_CAPTURING = 1,
2606  LOCAL_VIDEO_STREAM_STATE_ENCODING = 2,
2610  LOCAL_VIDEO_STREAM_STATE_FAILED = 3
2611 };
2612 
2616 enum LOCAL_VIDEO_STREAM_ERROR {
2618  LOCAL_VIDEO_STREAM_ERROR_OK = 0,
2620  LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1,
2622  LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2,
2624  LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3,
2626  LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4,
2628  LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5,
2630  LOCAL_VIDEO_STREAM_ERROR_BACKGROUD = 6,
2632  LOCAL_VIDEO_STREAM_ERROR_MULTIPLE_FOREGROUND_APPS = 7,
2634  LOCAL_VIDEO_STREAM_ERROR_SYSTEM_PRESSURE = 8
2635 };
2636 
2640 enum REMOTE_AUDIO_STATE
2641 {
2648  REMOTE_AUDIO_STATE_STOPPED = 0, // Default state, audio is started or remote user disabled/muted audio stream
2652  REMOTE_AUDIO_STATE_STARTING = 1, // The first audio frame packet has been received
2659  REMOTE_AUDIO_STATE_DECODING = 2, // The first remote audio frame has been decoded or fronzen state ends
2664  REMOTE_AUDIO_STATE_FROZEN = 3, // Remote audio is frozen, probably due to network issue
2669  REMOTE_AUDIO_STATE_FAILED = 4, // Remote audio play failed
2670 };
2671 
2675 enum REMOTE_AUDIO_STATE_REASON
2676 {
2680  REMOTE_AUDIO_REASON_INTERNAL = 0,
2684  REMOTE_AUDIO_REASON_NETWORK_CONGESTION = 1,
2688  REMOTE_AUDIO_REASON_NETWORK_RECOVERY = 2,
2693  REMOTE_AUDIO_REASON_LOCAL_MUTED = 3,
2698  REMOTE_AUDIO_REASON_LOCAL_UNMUTED = 4,
2703  REMOTE_AUDIO_REASON_REMOTE_MUTED = 5,
2708  REMOTE_AUDIO_REASON_REMOTE_UNMUTED = 6,
2712  REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7,
2713 };
2714 
2716 enum REMOTE_VIDEO_STATE {
2722  REMOTE_VIDEO_STATE_STOPPED = 0,
2725  REMOTE_VIDEO_STATE_STARTING = 1,
2732  REMOTE_VIDEO_STATE_DECODING = 2,
2737  REMOTE_VIDEO_STATE_FROZEN = 3,
2741  REMOTE_VIDEO_STATE_FAILED = 4,
2742 };
2744 enum REMOTE_VIDEO_STATE_REASON {
2748  REMOTE_VIDEO_STATE_REASON_INTERNAL = 0,
2749 
2753  REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION = 1,
2754 
2758  REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY = 2,
2759 
2763  REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED = 3,
2764 
2768  REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED = 4,
2769 
2773  REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED = 5,
2774 
2778  REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED = 6,
2779 
2783  REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE = 7,
2784 
2788  REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK = 8,
2789 
2793  REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY = 9,
2794 
2798  REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_LOW = 10,
2802  REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_HIGH = 11,
2803 
2804 };
2805 
2811  VideoTrackInfo()
2812  : isLocal(false), ownerUserId(NULL), trackId(0), channelId(OPTIONAL_NULLPTR)
2813  , streamType(VIDEO_STREAM_HIGH), codecType(VIDEO_CODEC_H264)
2814  , encodedFrameOnly(false), sourceType(VIDEO_SOURCE_CAMERA_PRIMARY) {}
2815 
2821  bool isLocal;
2825  user_id_t ownerUserId;
2829  track_id_t trackId;
2833  const char* channelId;
2837  VIDEO_STREAM_TYPE streamType;
2841  VIDEO_CODEC_TYPE codecType;
2851  VIDEO_SOURCE_TYPE sourceType;
2852 };
2853 
2857 enum REMOTE_VIDEO_DOWNSCALE_LEVEL {
2861  REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE,
2865  REMOTE_VIDEO_DOWNSCALE_LEVEL_1,
2869  REMOTE_VIDEO_DOWNSCALE_LEVEL_2,
2873  REMOTE_VIDEO_DOWNSCALE_LEVEL_3,
2877  REMOTE_VIDEO_DOWNSCALE_LEVEL_4,
2878 };
2879 
2887  uid_t uid;
2888 
2892  unsigned int volume; // [0,255]
2893 
2894  AudioVolumeInfo() : uid(0), volume(0) {}
2895 };
2896 
2901  public:
2902  virtual ~IPacketObserver() {}
2906  struct Packet {
2910  const unsigned char* buffer;
2914  unsigned int size;
2915 
2916  Packet() : buffer(NULL), size(0) {}
2917  };
2925  virtual bool onSendAudioPacket(Packet& packet) = 0;
2933  virtual bool onSendVideoPacket(Packet& packet) = 0;
2941  virtual bool onReceiveAudioPacket(Packet& packet) = 0;
2949  virtual bool onReceiveVideoPacket(Packet& packet) = 0;
2950 };
2955  public:
2965  virtual bool OnEncodedVideoImageReceived(const uint8_t* imageBuffer, size_t length,
2966  const EncodedVideoFrameInfo& videoEncodedFrameInfo) = 0;
2967 
2968  virtual ~IVideoEncodedImageReceiver() {}
2969 };
2970 
2974 enum AUDIO_SAMPLE_RATE_TYPE {
2978  AUDIO_SAMPLE_RATE_32000 = 32000,
2982  AUDIO_SAMPLE_RATE_44100 = 44100,
2986  AUDIO_SAMPLE_RATE_48000 = 48000,
2987 };
2991 enum VIDEO_CODEC_PROFILE_TYPE {
2995  VIDEO_CODEC_PROFILE_BASELINE = 66,
2999  VIDEO_CODEC_PROFILE_MAIN = 77,
3003  VIDEO_CODEC_PROFILE_HIGH = 100,
3004 };
3005 
3009 enum AUDIO_CODEC_PROFILE_TYPE {
3013  AUDIO_CODEC_PROFILE_LC_AAC = 0,
3017  AUDIO_CODEC_PROFILE_HE_AAC = 1,
3018 };
3019 
3025 {
3046 };
3047 
3048 
3052 enum RTMP_STREAM_PUBLISH_STATE {
3059  RTMP_STREAM_PUBLISH_STATE_IDLE = 0,
3065  RTMP_STREAM_PUBLISH_STATE_CONNECTING = 1,
3070  RTMP_STREAM_PUBLISH_STATE_RUNNING = 2,
3080  RTMP_STREAM_PUBLISH_STATE_RECOVERING = 3,
3085  RTMP_STREAM_PUBLISH_STATE_FAILURE = 4,
3086 };
3087 
3091 enum RTMP_STREAM_PUBLISH_ERROR {
3095  RTMP_STREAM_PUBLISH_ERROR_FAILED = -1,
3099  RTMP_STREAM_PUBLISH_ERROR_OK = 0,
3105  RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT = 1,
3109  RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2,
3114  RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3,
3119  RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4,
3123  RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5,
3127  RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6,
3131  RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7,
3135  RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8,
3139  RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9,
3143  RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10,
3148  RTMP_STREAM_PUBLISH_ERROR_CDN_ERROR = 11,
3152  RTMP_STREAM_PUBLISH_ERROR_ALREADY_IN_USE = 12,
3153 };
3154 
3157 typedef struct RtcImage {
3161  const char* url;
3166  int x;
3171  int y;
3175  int width;
3179  int height;
3183  int zOrder;
3184 
3185  RtcImage() : url(NULL), x(0), y(0), width(0), height(0), zOrder(0) {}
3186 } RtcImage;
3187 
3191 enum CONNECTION_STATE_TYPE
3192 {
3196  CONNECTION_STATE_DISCONNECTED = 1,
3200  CONNECTION_STATE_CONNECTING = 2,
3205  CONNECTION_STATE_CONNECTED = 3,
3210  CONNECTION_STATE_RECONNECTING = 4,
3214  CONNECTION_STATE_FAILED = 5,
3215 };
3216 
3224  uid_t uid;
3228  int x;
3232  int y;
3236  int width;
3240  int height;
3246  int zOrder;
3250  double alpha;
3267  TranscodingUser()
3268  : uid(0),
3269  x(0),
3270  y(0),
3271  width(0),
3272  height(0),
3273  zOrder(0),
3274  alpha(1.0),
3275  audioChannel(0) {}
3276 };
3277 
3288  int width;
3295  int height;
3320  VIDEO_CODEC_PROFILE_TYPE videoCodecProfile;
3325  unsigned int backgroundColor;
3329  unsigned int userCount;
3342  const char* metadata;
3355  unsigned int watermarkCount;
3367  unsigned int backgroundImageCount;
3371  AUDIO_SAMPLE_RATE_TYPE audioSampleRate;
3390  AUDIO_CODEC_PROFILE_TYPE audioCodecProfile;
3391 
3392  LiveTranscoding()
3393  : width(360),
3394  height(640),
3395  videoBitrate(400),
3396  videoFramerate(15),
3397  lowLatency(false),
3398  videoGop(30),
3399  videoCodecProfile(VIDEO_CODEC_PROFILE_HIGH),
3400  backgroundColor(0x000000),
3401  userCount(0),
3402  transcodingUsers(NULL),
3403  transcodingExtraInfo(NULL),
3404  metadata(NULL),
3405  watermark(NULL),
3406  watermarkCount(0),
3407  backgroundImage(NULL),
3409  audioSampleRate(AUDIO_SAMPLE_RATE_48000),
3410  audioBitrate(48),
3411  audioChannels(1),
3412  audioCodecProfile(AUDIO_CODEC_PROFILE_LC_AAC) {}
3413 };
3414 
3422  agora::media::MEDIA_SOURCE_TYPE sourceType;
3430  const char* imageUrl;
3434  int x;
3438  int y;
3442  int width;
3446  int height;
3452  int zOrder;
3456  double alpha;
3460  bool mirror;
3461 
3463  : sourceType(agora::media::PRIMARY_CAMERA_SOURCE),
3464  remoteUserUid(0),
3465  imageUrl(NULL),
3466  x(0),
3467  y(0),
3468  width(0),
3469  height(0),
3470  zOrder(0),
3471  alpha(1.0),
3472  mirror(false) {}
3473 };
3474 
3475 
3483  unsigned int streamCount;
3492 
3494  : streamCount(0),
3495  VideoInputStreams(NULL),
3497 };
3498 
3527 };
3528 
3532 enum LASTMILE_PROBE_RESULT_STATE {
3536  LASTMILE_PROBE_RESULT_COMPLETE = 1,
3541  LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE = 2,
3546  LASTMILE_PROBE_RESULT_UNAVAILABLE = 3
3547 };
3548 
3557  unsigned int packetLossRate;
3561  unsigned int jitter;
3565  unsigned int availableBandwidth;
3566 
3568  jitter(0),
3569  availableBandwidth(0) {}
3570 };
3571 
3580  LASTMILE_PROBE_RESULT_STATE state;
3592  unsigned int rtt;
3593 
3594  LastmileProbeResult() : state(LASTMILE_PROBE_RESULT_UNAVAILABLE),
3595  rtt(0) {}
3596 };
3597 
3601 enum CONNECTION_CHANGED_REASON_TYPE
3602 {
3606  CONNECTION_CHANGED_CONNECTING = 0,
3610  CONNECTION_CHANGED_JOIN_SUCCESS = 1,
3614  CONNECTION_CHANGED_INTERRUPTED = 2,
3618  CONNECTION_CHANGED_BANNED_BY_SERVER = 3,
3622  CONNECTION_CHANGED_JOIN_FAILED = 4,
3626  CONNECTION_CHANGED_LEAVE_CHANNEL = 5,
3630  CONNECTION_CHANGED_INVALID_APP_ID = 6,
3634  CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7,
3638  CONNECTION_CHANGED_INVALID_TOKEN = 8,
3642  CONNECTION_CHANGED_TOKEN_EXPIRED = 9,
3646  CONNECTION_CHANGED_REJECTED_BY_SERVER = 10,
3650  CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11,
3654  CONNECTION_CHANGED_RENEW_TOKEN = 12,
3659  CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13,
3663  CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14,
3667  CONNECTION_CHANGED_REJOIN_SUCCESS = 15,
3671  CONNECTION_CHANGED_LOST = 16,
3675  CONNECTION_CHANGED_ECHO_TEST = 17,
3679  CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER = 18,
3680 };
3681 
3685 enum NETWORK_TYPE {
3689  NETWORK_TYPE_UNKNOWN = -1,
3693  NETWORK_TYPE_DISCONNECTED = 0,
3697  NETWORK_TYPE_LAN = 1,
3701  NETWORK_TYPE_WIFI = 2,
3705  NETWORK_TYPE_MOBILE_2G = 3,
3709  NETWORK_TYPE_MOBILE_3G = 4,
3713  NETWORK_TYPE_MOBILE_4G = 5,
3714 };
3715 
3719 struct VideoCanvas {
3723  view_t view;
3727  media::base::RENDER_MODE_TYPE renderMode;
3731  VIDEO_MIRROR_MODE_TYPE mirrorMode;
3735  uid_t uid;
3736  bool isScreenView;
3737 
3738  void* priv; // private data (underlying video engine denotes it)
3739 
3740  size_t priv_size;
3741 
3742  VIDEO_SOURCE_TYPE sourceType;
3743 
3744  VideoCanvas() : view(NULL), renderMode(media::base::RENDER_MODE_HIDDEN), mirrorMode(VIDEO_MIRROR_MODE_AUTO),
3745  uid(0), isScreenView(false), priv(NULL), priv_size(0), sourceType(VIDEO_SOURCE_CAMERA_PRIMARY) {}
3746  VideoCanvas(view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, uid_t u)
3747  : view(v), renderMode(m), mirrorMode(mt), uid(u), isScreenView(false), priv(NULL), priv_size(0),
3748  sourceType(VIDEO_SOURCE_CAMERA_PRIMARY) {}
3749  VideoCanvas(view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, user_id_t)
3750  : view(v), renderMode(m), mirrorMode(mt), uid(0), isScreenView(false), priv(NULL), priv_size(0),
3751  sourceType(VIDEO_SOURCE_CAMERA_PRIMARY) {}
3752 };
3753 
3754 
3767  };
3768 
3772 
3775 
3779 
3783 
3787 
3788  BeautyOptions(LIGHTENING_CONTRAST_LEVEL contrastLevel, float lightening, float smoothness, float redness, float sharpness) : lighteningContrastLevel(contrastLevel), lighteningLevel(lightening), smoothnessLevel(smoothness), rednessLevel(redness), sharpnessLevel(sharpness) {}
3789 
3791 };
3792 
3812 enum VOICE_BEAUTIFIER_PRESET {
3815  VOICE_BEAUTIFIER_OFF = 0x00000000,
3821  CHAT_BEAUTIFIER_MAGNETIC = 0x01010100,
3827  CHAT_BEAUTIFIER_FRESH = 0x01010200,
3833  CHAT_BEAUTIFIER_VITALITY = 0x01010300,
3847  SINGING_BEAUTIFIER = 0x01020100,
3850  TIMBRE_TRANSFORMATION_VIGOROUS = 0x01030100,
3853  TIMBRE_TRANSFORMATION_DEEP = 0x01030200,
3856  TIMBRE_TRANSFORMATION_MELLOW = 0x01030300,
3859  TIMBRE_TRANSFORMATION_FALSETTO = 0x01030400,
3862  TIMBRE_TRANSFORMATION_FULL = 0x01030500,
3865  TIMBRE_TRANSFORMATION_CLEAR = 0x01030600,
3868  TIMBRE_TRANSFORMATION_RESOUNDING = 0x01030700,
3871  TIMBRE_TRANSFORMATION_RINGING = 0x01030800
3872 };
3873 
3876 enum AUDIO_EFFECT_PRESET {
3879  AUDIO_EFFECT_OFF = 0x00000000,
3887  ROOM_ACOUSTICS_KTV = 0x02010100,
3895  ROOM_ACOUSTICS_VOCAL_CONCERT = 0x02010200,
3903  ROOM_ACOUSTICS_STUDIO = 0x02010300,
3911  ROOM_ACOUSTICS_PHONOGRAPH = 0x02010400,
3918  ROOM_ACOUSTICS_VIRTUAL_STEREO = 0x02010500,
3926  ROOM_ACOUSTICS_SPACIAL = 0x02010600,
3934  ROOM_ACOUSTICS_ETHEREAL = 0x02010700,
3946  ROOM_ACOUSTICS_3D_VOICE = 0x02010800,
3957  VOICE_CHANGER_EFFECT_UNCLE = 0x02020100,
3968  VOICE_CHANGER_EFFECT_OLDMAN = 0x02020200,
3979  VOICE_CHANGER_EFFECT_BOY = 0x02020300,
3990  VOICE_CHANGER_EFFECT_SISTER = 0x02020400,
4001  VOICE_CHANGER_EFFECT_GIRL = 0x02020500,
4010  VOICE_CHANGER_EFFECT_PIGKING = 0x02020600,
4018  VOICE_CHANGER_EFFECT_HULK = 0x02020700,
4026  STYLE_TRANSFORMATION_RNB = 0x02030100,
4034  STYLE_TRANSFORMATION_POPULAR = 0x02030200,
4044  PITCH_CORRECTION = 0x02040100
4045 
4049 };
4050 
4053 enum VOICE_CONVERSION_PRESET {
4056  VOICE_CONVERSION_OFF = 0x00000000,
4059  VOICE_CHANGER_NEUTRAL = 0x03010100,
4062  VOICE_CHANGER_SWEET = 0x03010200,
4065  VOICE_CHANGER_SOLID = 0x03010300,
4068  VOICE_CHANGER_BASS = 0x03010400
4069 };
4070 
4071 // TODO(ZYH), it will be deleted after the new interfaces have been implemented to replace it.
4072 enum AUDIO_REVERB_PRESET {
4076  AUDIO_REVERB_OFF = 0, // Turn off audio reverb
4080  AUDIO_REVERB_FX_KTV = 0x02010100,
4084  AUDIO_REVERB_FX_VOCAL_CONCERT = 0x02010200,
4088  AUDIO_REVERB_FX_UNCLE = 0x02020100,
4092  AUDIO_REVERB_FX_SISTER = 0x02020400,
4096  AUDIO_REVERB_FX_STUDIO = 0x02010300,
4100  AUDIO_REVERB_FX_POPULAR = 0x02030200,
4104  AUDIO_REVERB_FX_RNB = 0x02030100,
4108  AUDIO_REVERB_FX_PHONOGRAPH = 0x02010400
4109 };
4110 
4129  int bitrate;
4149 
4151  : dimensions(1920, 1080), frameRate(5), bitrate(STANDARD_BITRATE), captureMouseCursor(true), windowFocus(false), excludeWindowList(OPTIONAL_NULLPTR), excludeWindowCount(0) {}
4152  ScreenCaptureParameters(const VideoDimensions& d, int f, int b)
4153  : dimensions(d), frameRate(f), bitrate(b), captureMouseCursor(true), windowFocus(false), excludeWindowList(OPTIONAL_NULLPTR), excludeWindowCount(0) {}
4154  ScreenCaptureParameters(int width, int height, int f, int b)
4155  : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(true), windowFocus(false), excludeWindowList(OPTIONAL_NULLPTR), excludeWindowCount(0) {}
4156  ScreenCaptureParameters(int width, int height, int f, int b, bool cur, bool fcs)
4157  : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(cur), windowFocus(fcs), excludeWindowList(OPTIONAL_NULLPTR), excludeWindowCount(0) {}
4158  ScreenCaptureParameters(int width, int height, int f, int b, view_t *ex, int cnt)
4159  : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(true), windowFocus(false), excludeWindowList(ex), excludeWindowCount(cnt) {}
4160  ScreenCaptureParameters(int width, int height, int f, int b, bool cur, bool fcs, view_t *ex, int cnt)
4161  : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(cur), windowFocus(fcs), excludeWindowList(ex), excludeWindowCount(cnt) {}
4162 };
4163 
4167 enum AUDIO_RECORDING_QUALITY_TYPE {
4171  AUDIO_RECORDING_QUALITY_LOW = 0,
4175  AUDIO_RECORDING_QUALITY_MEDIUM = 1,
4179  AUDIO_RECORDING_QUALITY_HIGH = 2,
4180 };
4181 
4185 enum AUDIO_FILE_RECORDING_TYPE {
4189  AUDIO_FILE_RECORDING_MIC = 1,
4193  AUDIO_FILE_RECORDING_PLAYBACK = 2,
4197  AUDIO_FILE_RECORDING_MIXED = 3,
4198 };
4199 
4203 enum AUDIO_ENCODED_FRAME_OBSERVER_POSITION {
4207  AUDIO_ENCODED_FRAME_OBSERVER_POSITION_RECORD = 1,
4211  AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK = 2,
4215  AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED = 3,
4216 };
4217 
4226  const char* filePath;
4232  bool encode;
4241  AUDIO_FILE_RECORDING_TYPE fileRecordingType;
4245  AUDIO_RECORDING_QUALITY_TYPE quality;
4246 
4248  : filePath(NULL),
4249  encode(false),
4250  sampleRate(32000),
4251  fileRecordingType(AUDIO_FILE_RECORDING_MIXED),
4252  quality(AUDIO_RECORDING_QUALITY_LOW) {}
4253 
4254  AudioFileRecordingConfig(const char* file_path, int sample_rate, AUDIO_RECORDING_QUALITY_TYPE quality_type)
4255  : filePath(file_path),
4256  encode(false),
4257  sampleRate(sample_rate),
4258  fileRecordingType(AUDIO_FILE_RECORDING_MIXED),
4259  quality(quality_type) {}
4260 
4261  AudioFileRecordingConfig(const char* file_path, bool enc, int sample_rate, AUDIO_FILE_RECORDING_TYPE type, AUDIO_RECORDING_QUALITY_TYPE quality_type)
4262  : filePath(file_path),
4263  encode(enc),
4264  sampleRate(sample_rate),
4265  fileRecordingType(type),
4266  quality(quality_type) {}
4267 
4268  AudioFileRecordingConfig(const AudioFileRecordingConfig &rhs)
4269  : filePath(rhs.filePath),
4270  encode(rhs.encode),
4271  sampleRate(rhs.sampleRate),
4273  quality(rhs.quality) {}
4274 };
4275 
4284  AUDIO_ENCODED_FRAME_OBSERVER_POSITION postionType;
4288  AUDIO_ENCODING_TYPE encodingType;
4289 
4291  : postionType(AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK),
4292  encodingType(AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM){}
4293 
4294 };
4295 
4297 public:
4305 virtual void OnRecordAudioEncodedFrame(const uint8_t* frameBuffer, int length, const EncodedAudioFrameInfo& audioEncodedFrameInfo) = 0;
4306 
4314 virtual void OnPlaybackAudioEncodedFrame(const uint8_t* frameBuffer, int length, const EncodedAudioFrameInfo& audioEncodedFrameInfo) = 0;
4315 
4323 virtual void OnMixedAudioEncodedFrame(const uint8_t* frameBuffer, int length, const EncodedAudioFrameInfo& audioEncodedFrameInfo) = 0;
4324 
4325 virtual ~IAudioEncodedFrameObserver () {}
4326 };
4327 
4331 enum VOICE_CHANGER_PRESET {
4335  VOICE_CHANGER_OFF = 0, //Turn off the voice changer
4339  VOICE_CHANGER_OLDMAN = 0x02020200,
4343  VOICE_CHANGER_BABYBOY = 0x02020300,
4347  VOICE_CHANGER_BABYGIRL = 0x02020500,
4352  VOICE_CHANGER_ZHUBAJIE = 0x02020600,
4356  VOICE_CHANGER_ETHEREAL = 0x02010700,
4360  VOICE_CHANGER_HULK = 0x02020700,
4364  VOICE_BEAUTY_VIGOROUS = 0x01030100,
4368  VOICE_BEAUTY_DEEP = 0x01030200,
4372  VOICE_BEAUTY_MELLOW = 0x01030300,
4376  VOICE_BEAUTY_FALSETTO = 0x01030400,
4380  VOICE_BEAUTY_FULL = 0x01030500,
4384  VOICE_BEAUTY_CLEAR = 0x01030600,
4388  VOICE_BEAUTY_RESOUNDING = 0x01030700,
4392  VOICE_BEAUTY_RINGING = 0x01030800,
4396  VOICE_BEAUTY_SPACIAL = 0x02010600,
4401  GENERAL_BEAUTY_VOICE_MALE = 0x01010100,
4406  GENERAL_BEAUTY_VOICE_FEMALE_FRESH = 0x01010200,
4411  GENERAL_BEAUTY_VOICE_FEMALE_VITALITY = 0x01010300
4412 };
4415 enum AREA_CODE {
4419  AREA_CODE_CN = 0x00000001,
4423  AREA_CODE_NA = 0x00000002,
4427  AREA_CODE_EU = 0x00000004,
4431  AREA_CODE_AS = 0x00000008,
4435  AREA_CODE_JP = 0x00000010,
4439  AREA_CODE_IN = 0x00000020,
4443  AREA_CODE_GLOB = (0xFFFFFFFF)
4444 };
4445 
4446 enum AREA_CODE_EX {
4450  AREA_CODE_OC = 0x00000040,
4454  AREA_CODE_SA = 0x00000080,
4458  AREA_CODE_AF = 0x00000100,
4462  AREA_CODE_OVS = 0xFFFFFFFE
4463 };
4464 
4465 enum CHANNEL_MEDIA_RELAY_ERROR {
4468  RELAY_OK = 0,
4471  RELAY_ERROR_SERVER_ERROR_RESPONSE = 1,
4476  RELAY_ERROR_SERVER_NO_RESPONSE = 2,
4480  RELAY_ERROR_NO_RESOURCE_AVAILABLE = 3,
4483  RELAY_ERROR_FAILED_JOIN_SRC = 4,
4486  RELAY_ERROR_FAILED_JOIN_DEST = 5,
4489  RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC = 6,
4492  RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST = 7,
4497  RELAY_ERROR_SERVER_CONNECTION_LOST = 8,
4500  RELAY_ERROR_INTERNAL_ERROR = 9,
4503  RELAY_ERROR_SRC_TOKEN_EXPIRED = 10,
4506  RELAY_ERROR_DEST_TOKEN_EXPIRED = 11,
4507 };
4508 
4509 //callback event
4510 enum CHANNEL_MEDIA_RELAY_EVENT {
4514  RELAY_EVENT_NETWORK_DISCONNECTED = 0,
4517  RELAY_EVENT_NETWORK_CONNECTED = 1,
4520  RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL = 2,
4523  RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL = 3,
4526  RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL = 4,
4529  RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC = 5,
4532  RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC = 6,
4535  RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL = 7,
4538  RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED = 8,
4542  RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE = 9,
4545  RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL = 10,
4548  RELAY_EVENT_VIDEO_PROFILE_UPDATE = 11,
4549 };
4550 
4551 enum CHANNEL_MEDIA_RELAY_STATE {
4554  RELAY_STATE_IDLE = 0,
4557  RELAY_STATE_CONNECTING = 1,
4561  RELAY_STATE_RUNNING = 2,
4564  RELAY_STATE_FAILURE = 3,
4565 };
4566 
4573  const char* channelName;
4577  const char* token;
4580  uid_t uid;
4581 };
4582 
4611 
4613  : srcInfo(NULL)
4614  , destInfos(NULL)
4615  , destCount(0)
4616  {}
4617 };
4618 
4627 
4629 
4630  bool operator==(const UplinkNetworkInfo& rhs) const {
4632  }
4633 };
4634 
4643  const char* uid;
4647  VIDEO_STREAM_TYPE stream_type;
4651  REMOTE_VIDEO_DOWNSCALE_LEVEL current_downscale_level;
4656 
4658  : uid(OPTIONAL_NULLPTR),
4659  stream_type(VIDEO_STREAM_HIGH),
4660  current_downscale_level(REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE),
4661  expected_bitrate_bps(-1) {}
4662 
4663  PeerDownlinkInfo& operator=(const PeerDownlinkInfo& rhs) {
4664  if (this == &rhs) return *this;
4665  uid = OPTIONAL_NULLPTR;
4666  stream_type = rhs.stream_type;
4669  if (rhs.uid != OPTIONAL_NULLPTR) {
4670  char* temp = new char[strlen(rhs.uid) + 1];
4671  strcpy(temp, rhs.uid);
4672  uid = temp;
4673  }
4674  return *this;
4675  }
4676 
4677  ~PeerDownlinkInfo() {
4678  if (uid) delete [] uid;
4679  }
4680  };
4681 
4702 
4707  peer_downlink_info(OPTIONAL_NULLPTR),
4709 
4714  peer_downlink_info(OPTIONAL_NULLPTR),
4716  if (total_received_video_count <= 0) return;
4717  peer_downlink_info = new PeerDownlinkInfo[total_received_video_count];
4718  for (int i = 0; i < total_received_video_count; ++i)
4720  }
4721 
4722  DownlinkNetworkInfo& operator=(const DownlinkNetworkInfo& rhs) {
4723  if (this == &rhs) return *this;
4724  lastmile_buffer_delay_time_ms = rhs.lastmile_buffer_delay_time_ms;
4725  bandwidth_estimation_bps = rhs.bandwidth_estimation_bps;
4726  total_downscale_level_count = rhs.total_downscale_level_count;
4727  peer_downlink_info = OPTIONAL_NULLPTR;
4728  total_received_video_count = rhs.total_received_video_count;
4729  if (total_received_video_count > 0) {
4730  peer_downlink_info = new PeerDownlinkInfo[total_received_video_count];
4731  for (int i = 0; i < total_received_video_count; ++i)
4732  peer_downlink_info[i] = rhs.peer_downlink_info[i];
4733  }
4734  return *this;
4735  }
4736 
4737  ~DownlinkNetworkInfo() {
4738  if (peer_downlink_info) delete [] peer_downlink_info;
4739  }
4740 };
4741 
4744 enum ENCRYPTION_MODE {
4747  SM4_128_ECB = 4,
4750  AES_128_GCM2 = 7,
4753  AES_256_GCM2 = 8,
4756  MODE_END,
4757 };
4758 
4764  ENCRYPTION_MODE encryptionMode;
4770  const char* encryptionKey;
4771  uint8_t encryptionKdfSalt[32];
4772 
4774  : encryptionMode(AES_128_GCM2),
4775  encryptionKey(NULL)
4776  {
4777  memset(encryptionKdfSalt, 0, sizeof(encryptionKdfSalt));
4778  }
4779 
4781  const char* getEncryptionString() const {
4782  switch(encryptionMode) {
4783  case SM4_128_ECB:
4784  return "sm4-128-ecb";
4785  case AES_128_GCM2:
4786  return "aes-128-gcm";
4787  case AES_256_GCM2:
4788  return "aes-256-gcm";
4789  default:
4790  return "aes-128-gcm";
4791  }
4792  return "aes-128-gcm";
4793  }
4795 };
4796 
4799 enum ENCRYPTION_ERROR_TYPE {
4800  ENCRYPTION_ERROR_INTERNAL_FAILURE = 0,
4801  ENCRYPTION_ERROR_DECRYPTION_FAILURE = 1,
4802  ENCRYPTION_ERROR_ENCRYPTION_FAILURE = 2,
4803 };
4804 
4807 enum PERMISSION_TYPE {
4808  RECORD_AUDIO = 0,
4809  CAMERA = 1,
4810 };
4811 
4814 enum MAX_USER_ACCOUNT_LENGTH_TYPE
4815 {
4818  MAX_USER_ACCOUNT_LENGTH = 256
4819 };
4820 
4824 enum STREAM_SUBSCRIBE_STATE {
4825  SUB_STATE_IDLE = 0,
4826  SUB_STATE_NO_SUBSCRIBED = 1,
4827  SUB_STATE_SUBSCRIBING = 2,
4828  SUB_STATE_SUBSCRIBED = 3
4829 };
4830 
4834 enum STREAM_PUBLISH_STATE {
4835  PUB_STATE_IDLE = 0,
4836  PUB_STATE_NO_PUBLISHED = 1,
4837  PUB_STATE_PUBLISHING = 2,
4838  PUB_STATE_PUBLISHED = 3
4839 };
4840 
4844 struct UserInfo {
4848  uid_t uid;
4852  char userAccount[MAX_USER_ACCOUNT_LENGTH];
4853  UserInfo()
4854  : uid(0) {
4855  userAccount[0] = '\0';
4856  }
4857 };
4858 
4862 enum EAR_MONITORING_FILTER_TYPE {
4866  EAR_MONITORING_FILTER_NONE = (1<<0),
4870  EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS = (1<<1),
4874  EAR_MONITORING_FILTER_NOISE_SUPPRESSION = (1<<2)
4875 };
4876 
4877 } // namespace rtc
4878 
4879 namespace base {
4880 
4882  public:
4883  virtual int queryInterface(rtc::INTERFACE_ID_TYPE iid, void** inter) = 0;
4884  virtual ~IEngineBase() {}
4885 };
4886 
4887 class AParameter : public agora::util::AutoPtr<IAgoraParameter> {
4888  public:
4889  AParameter(IEngineBase& engine) { initialize(&engine); }
4890  AParameter(IEngineBase* engine) { initialize(engine); }
4892 
4893  private:
4894  bool initialize(IEngineBase* engine) {
4895  IAgoraParameter* p = NULL;
4896  if (engine && !engine->queryInterface(rtc::AGORA_IID_PARAMETER_ENGINE, (void**)&p)) reset(p);
4897  return p != NULL;
4898  }
4899 };
4900 
4902  public:
4903  virtual ~LicenseCallback() {}
4904  virtual void onCertificateRequired() = 0;
4905  virtual void onLicenseRequest() = 0;
4906  virtual void onLicenseValidated() = 0;
4907  virtual void onLicenseError(int result) = 0;
4908 };
4909 
4910 } // namespace base
4911 
4912 } // namespace agora
4913 
4919 AGORA_API const char* AGORA_CALL getAgoraSdkVersion(int* build);
4920 
4926 AGORA_API const char* AGORA_CALL getAgoraSdkErrorDescription(int err);
4927 
4928 AGORA_API int AGORA_CALL setAgoraSdkExternalSymbolLoader(void* (*func)(const char* symname));
4929 
4937 AGORA_API int AGORA_CALL createAgoraCredential(agora::util::AString &credential);
4938 
4952 AGORA_API int AGORA_CALL getAgoraCertificateVerifyResult(const char *credential_buf, int credential_len,
4953  const char *certificate_buf, int certificate_len);
4954 
4963 AGORA_API void setAgoraLicenseCallback(agora::base::LicenseCallback *callback);
4964 
4973 AGORA_API agora::base::LicenseCallback* getAgoraLicenseCallback();
agora::rtc::LiveTranscoding::transcodingUsers
TranscodingUser * transcodingUsers
Definition: AgoraBase.h:3333
agora::rtc::IPacketObserver::onReceiveVideoPacket
virtual bool onReceiveVideoPacket(Packet &packet)=0
agora::rtc::AudioFileRecordingConfig::quality
AUDIO_RECORDING_QUALITY_TYPE quality
Definition: AgoraBase.h:4245
agora::rtc::RtcImage::width
int width
Definition: AgoraBase.h:3175
agora::rtc::TranscodingVideoStream::zOrder
int zOrder
Definition: AgoraBase.h:3452
agora::rtc::RtcStats::firstAudioPacketDuration
int firstAudioPacketDuration
Definition: AgoraBase.h:2169
agora::rtc::UserInfo
Definition: AgoraBase.h:4844
agora::rtc::TranscodingVideoStream::alpha
double alpha
Definition: AgoraBase.h:3456
agora::rtc::VideoEncoderConfiguration::degradationPreference
DEGRADATION_PREFERENCE degradationPreference
Definition: AgoraBase.h:1907
agora::rtc::LastmileProbeResult
Definition: AgoraBase.h:3576
agora::rtc::AudioEncodedFrameObserverConfig
Definition: AgoraBase.h:4280
agora::rtc::ScreenCaptureParameters
Definition: AgoraBase.h:4114
agora::rtc::WatermarkRatio
Definition: AgoraBase.h:2024
agora::rtc::AudioVolumeInfo
Definition: AgoraBase.h:2883
agora::rtc::LastmileProbeResult::uplinkReport
LastmileProbeOneWayResult uplinkReport
Definition: AgoraBase.h:3584
agora::rtc::EncodedVideoFrameInfo::rotation
VIDEO_ORIENTATION rotation
Definition: AgoraBase.h:1769
agora::rtc::BeautyOptions
Definition: AgoraBase.h:3757
agora::rtc::ScreenCaptureParameters::bitrate
int bitrate
Definition: AgoraBase.h:4129
agora::rtc::BeautyOptions::lighteningLevel
float lighteningLevel
Definition: AgoraBase.h:3774
agora::rtc::RtcStats::txVideoBytes
unsigned int txVideoBytes
Definition: AgoraBase.h:2099
agora::rtc::LiveTranscoding::backgroundColor
unsigned int backgroundColor
Definition: AgoraBase.h:3325
agora::base::IAgoraParameter
Definition: IAgoraParameter.h:189
agora::rtc::LastmileProbeConfig
Definition: AgoraBase.h:3502
agora::rtc::TranscodingUser::y
int y
Definition: AgoraBase.h:3232
agora::rtc::RtcStats::rxKBitRate
unsigned short rxKBitRate
Definition: AgoraBase.h:2115
agora::rtc::RtcStats::memoryTotalUsageRatio
double memoryTotalUsageRatio
Definition: AgoraBase.h:2155
agora::rtc::VideoFormat::fps
int fps
Definition: AgoraBase.h:2511
agora::rtc::VideoEncoderConfiguration::minBitrate
int minBitrate
Definition: AgoraBase.h:1898
agora::rtc::TranscodingUser::audioChannel
int audioChannel
Definition: AgoraBase.h:3266
agora::rtc::RtcStats::firstAudioPacketDurationAfterUnmute
int firstAudioPacketDurationAfterUnmute
Definition: AgoraBase.h:2189
agora::rtc::VideoFormat::width
int width
Definition: AgoraBase.h:2503
agora::rtc::ScreenCaptureParameters::windowFocus
bool windowFocus
Definition: AgoraBase.h:4140
agora::rtc::AudioEncodedFrameObserverConfig::encodingType
AUDIO_ENCODING_TYPE encodingType
Definition: AgoraBase.h:4288
agora::rtc::EncodedAudioFrameInfo::codec
AUDIO_CODEC_TYPE codec
Definition: AgoraBase.h:1619
agora::rtc::AudioPcmDataInfo::sampleCount
size_t sampleCount
Definition: AgoraBase.h:1654
agora::rtc::LiveTranscoding::videoGop
int videoGop
Definition: AgoraBase.h:3316
agora::rtc::ChannelMediaRelayConfiguration::destCount
int destCount
Definition: AgoraBase.h:4610
agora::rtc::LastmileProbeOneWayResult::jitter
unsigned int jitter
Definition: AgoraBase.h:3561
agora::rtc::BeautyOptions::smoothnessLevel
float smoothnessLevel
Definition: AgoraBase.h:3778
agora::rtc::VideoCanvas::mirrorMode
VIDEO_MIRROR_MODE_TYPE mirrorMode
Definition: AgoraBase.h:3731
agora::rtc::RtcStats::duration
unsigned int duration
Definition: AgoraBase.h:2083
agora::rtc::SimulcastStreamConfig::framerate
int framerate
Definition: AgoraBase.h:1991
agora::rtc::VideoDimensions::height
int height
Definition: AgoraBase.h:1399
agora::rtc::LastmileProbeConfig::probeUplink
bool probeUplink
Definition: AgoraBase.h:3509
agora::rtc::LiveTranscoding
Definition: AgoraBase.h:3281
agora::rtc::RtcStats::txBytes
unsigned int txBytes
Definition: AgoraBase.h:2087
agora::rtc::VideoFormat::height
int height
Definition: AgoraBase.h:2507
agora::rtc::Rectangle
Definition: AgoraBase.h:2001
agora::rtc::TranscodingVideoStream::sourceType
agora::media::MEDIA_SOURCE_TYPE sourceType
Definition: AgoraBase.h:3422
agora::rtc::VideoCanvas::uid
uid_t uid
Definition: AgoraBase.h:3735
agora::rtc::RtcStats::firstVideoPacketDuration
int firstVideoPacketDuration
Definition: AgoraBase.h:2174
agora::rtc::EncodedVideoFrameInfo
Definition: AgoraBase.h:1701
agora::rtc::VideoTrackInfo::ownerUserId
user_id_t ownerUserId
Definition: AgoraBase.h:2825
agora::rtc::BeautyOptions::rednessLevel
float rednessLevel
Definition: AgoraBase.h:3782
agora::rtc::RtcStats::rxVideoBytes
unsigned int rxVideoBytes
Definition: AgoraBase.h:2107
agora::rtc::TranscodingVideoStream::remoteUserUid
uid_t remoteUserUid
Definition: AgoraBase.h:3426
agora::rtc::RemoteAudioStats::networkTransportDelay
int networkTransportDelay
Definition: AgoraBase.h:2348
agora::rtc::VideoEncoderConfiguration::dimensions
VideoDimensions dimensions
Definition: AgoraBase.h:1822
agora::rtc::EncodedVideoFrameInfo::uid
uid_t uid
Definition: AgoraBase.h:1786
agora::rtc::IAudioEncodedFrameObserver::OnPlaybackAudioEncodedFrame
virtual void OnPlaybackAudioEncodedFrame(const uint8_t *frameBuffer, int length, const EncodedAudioFrameInfo &audioEncodedFrameInfo)=0
agora::rtc::EncodedAudioFrameInfo
Definition: AgoraBase.h:1603
agora::util::AutoPtr
Definition: AgoraBase.h:99
agora::rtc::LastmileProbeOneWayResult::packetLossRate
unsigned int packetLossRate
Definition: AgoraBase.h:3557
agora::UserInfo::hasAudio
bool hasAudio
Definition: AgoraBase.h:1139
agora::rtc::ScreenCaptureParameters::excludeWindowCount
int excludeWindowCount
Definition: AgoraBase.h:4148
agora::rtc::IPacketObserver::Packet
Definition: AgoraBase.h:2906
agora::rtc::LiveTranscoding::audioCodecProfile
AUDIO_CODEC_PROFILE_TYPE audioCodecProfile
Definition: AgoraBase.h:3390
agora::rtc::RemoteAudioStats::receivedBitrate
int receivedBitrate
Definition: AgoraBase.h:2369
agora::rtc::VideoEncoderConfiguration
Definition: AgoraBase.h:1814
agora::rtc::IVideoEncodedImageReceiver::OnEncodedVideoImageReceived
virtual bool OnEncodedVideoImageReceived(const uint8_t *imageBuffer, size_t length, const EncodedVideoFrameInfo &videoEncodedFrameInfo)=0
agora::rtc::Rectangle::width
int width
Definition: AgoraBase.h:2013
agora::rtc::VideoEncoderConfiguration::bitrate
int bitrate
Definition: AgoraBase.h:1881
agora::util::AList
Definition: AgoraBase.h:232
agora::rtc::RtcStats::firstVideoKeyFrameDecodedDurationAfterUnmute
int firstVideoKeyFrameDecodedDurationAfterUnmute
Definition: AgoraBase.h:2204
agora::rtc::TranscodingUser
Definition: AgoraBase.h:3220
agora::rtc::AudioFileRecordingConfig::fileRecordingType
AUDIO_FILE_RECORDING_TYPE fileRecordingType
Definition: AgoraBase.h:4241
agora::rtc::RtcImage
Definition: AgoraBase.h:3157
agora::rtc::TranscodingUser::x
int x
Definition: AgoraBase.h:3228
agora::rtc::ChannelMediaInfo::token
const char * token
Definition: AgoraBase.h:4577
agora::rtc::BeautyOptions::lighteningContrastLevel
LIGHTENING_CONTRAST_LEVEL lighteningContrastLevel
Definition: AgoraBase.h:3771
agora::rtc::WatermarkRatio::yRatio
float yRatio
Definition: AgoraBase.h:2032
agora::rtc::SimulcastStreamConfig
Definition: AgoraBase.h:1979
agora::rtc::LiveTranscoding::audioBitrate
int audioBitrate
Definition: AgoraBase.h:3376
agora::rtc::IAudioEncodedFrameObserver::OnMixedAudioEncodedFrame
virtual void OnMixedAudioEncodedFrame(const uint8_t *frameBuffer, int length, const EncodedAudioFrameInfo &audioEncodedFrameInfo)=0
agora::rtc::ChannelMediaRelayConfiguration::destInfos
ChannelMediaInfo * destInfos
Definition: AgoraBase.h:4604
agora::rtc::RtcImage::x
int x
Definition: AgoraBase.h:3166
agora::rtc::RtcImage::zOrder
int zOrder
Definition: AgoraBase.h:3183
agora::rtc::ClientRoleOptions::audienceLatencyLevel
AUDIENCE_LATENCY_LEVEL_TYPE audienceLatencyLevel
Definition: AgoraBase.h:2326
agora::rtc::AudioVolumeInfo::volume
unsigned int volume
Definition: AgoraBase.h:2892
agora::rtc::TranscodingUser::uid
uid_t uid
Definition: AgoraBase.h:3224
agora::rtc::Rectangle::y
int y
Definition: AgoraBase.h:2009
agora::rtc::LocalAudioStats::sentBitrate
int sentBitrate
Definition: AgoraBase.h:3037
agora::rtc::RemoteAudioStats::totalFrozenTime
int totalFrozenTime
Definition: AgoraBase.h:2376
agora::rtc::RtcImage::url
const char * url
Definition: AgoraBase.h:3161
agora::rtc::IPacketObserver::Packet::buffer
const unsigned char * buffer
Definition: AgoraBase.h:2910
agora::rtc::RtcStats::firstVideoKeyFrameRenderedDurationAfterUnmute
int firstVideoKeyFrameRenderedDurationAfterUnmute
Definition: AgoraBase.h:2209
agora::UserInfo::userId
util::AString userId
Definition: AgoraBase.h:1133
agora::rtc::WatermarkOptions::positionInPortraitMode
Rectangle positionInPortraitMode
Definition: AgoraBase.h:2057
agora::rtc::LastmileProbeResult::downlinkReport
LastmileProbeOneWayResult downlinkReport
Definition: AgoraBase.h:3588
agora::rtc::LiveTranscoding::watermarkCount
unsigned int watermarkCount
Definition: AgoraBase.h:3355
agora::rtc::Rectangle::x
int x
Definition: AgoraBase.h:2005
agora::util::IString
Definition: AgoraBase.h:171
agora::rtc::EncodedAudioFrameInfo::advancedSettings
EncodedAudioFrameAdvancedSettings advancedSettings
Definition: AgoraBase.h:1637
agora::rtc::AudioFileRecordingConfig::sampleRate
int sampleRate
Definition: AgoraBase.h:4237
agora::rtc::LocalTranscoderConfiguration
Definition: AgoraBase.h:3479
agora::rtc::BeautyOptions::LIGHTENING_CONTRAST_LEVEL
LIGHTENING_CONTRAST_LEVEL
Definition: AgoraBase.h:3760
agora::rtc::WatermarkRatio::xRatio
float xRatio
Definition: AgoraBase.h:2028
agora::rtc::LocalAudioStats::sentSampleRate
int sentSampleRate
Definition: AgoraBase.h:3033
agora::rtc::LastmileProbeConfig::expectedDownlinkBitrate
unsigned int expectedDownlinkBitrate
Definition: AgoraBase.h:3526
agora::rtc::RtcStats::cpuTotalUsage
double cpuTotalUsage
Definition: AgoraBase.h:2147
agora::rtc::IPacketObserver::Packet::size
unsigned int size
Definition: AgoraBase.h:2914
agora::rtc::LiveTranscoding::backgroundImageCount
unsigned int backgroundImageCount
Definition: AgoraBase.h:3367
agora::rtc::IPacketObserver
Definition: AgoraBase.h:2900
agora::rtc::LiveTranscoding::backgroundImage
RtcImage * backgroundImage
Definition: AgoraBase.h:3360
agora::rtc::RtcStats::cpuAppUsage
double cpuAppUsage
Definition: AgoraBase.h:2143
agora::rtc::VideoFormat
Definition: AgoraBase.h:2490
agora::rtc::TranscodingUser::alpha
double alpha
Definition: AgoraBase.h:3250
agora::rtc::WatermarkOptions::watermarkRatio
WatermarkRatio watermarkRatio
Definition: AgoraBase.h:2062
agora::rtc::DataStreamConfig
Definition: AgoraBase.h:1967
agora::rtc::RtcStats::txAudioBytes
unsigned int txAudioBytes
Definition: AgoraBase.h:2095
agora::rtc::RtcStats::connectTimeMs
int connectTimeMs
Definition: AgoraBase.h:2164
agora::rtc::LastmileProbeResult::state
LASTMILE_PROBE_RESULT_STATE state
Definition: AgoraBase.h:3580
agora::rtc::ChannelMediaInfo::channelName
const char * channelName
Definition: AgoraBase.h:4573
agora::rtc::LiveTranscoding::height
int height
Definition: AgoraBase.h:3295
agora::rtc::EncodedAudioFrameAdvancedSettings::speech
bool speech
Definition: AgoraBase.h:1590
agora::rtc::EncodedVideoFrameInfo::codecType
VIDEO_CODEC_TYPE codecType
Definition: AgoraBase.h:1746
agora::rtc::RtcStats::txVideoKBitRate
unsigned short txVideoKBitRate
Definition: AgoraBase.h:2131
agora::rtc::RtcStats::rxAudioBytes
unsigned int rxAudioBytes
Definition: AgoraBase.h:2103
agora::rtc::EncodedAudioFrameAdvancedSettings::sendEvenIfEmpty
bool sendEvenIfEmpty
Definition: AgoraBase.h:1596
agora::rtc::RtcStats::txAudioKBitRate
unsigned short txAudioKBitRate
Definition: AgoraBase.h:2123
agora::rtc::AudioVolumeInfo::uid
uid_t uid
Definition: AgoraBase.h:2887
agora::rtc::BeautyOptions::LIGHTENING_CONTRAST_LOW
@ LIGHTENING_CONTRAST_LOW
Definition: AgoraBase.h:3762
agora::rtc::LiveTranscoding::videoBitrate
int videoBitrate
Definition: AgoraBase.h:3301
agora::rtc::VideoTrackInfo::trackId
track_id_t trackId
Definition: AgoraBase.h:2829
agora::rtc::VideoTrackInfo::encodedFrameOnly
bool encodedFrameOnly
Definition: AgoraBase.h:2847
agora::rtc::RemoteAudioStats::mosValue
int mosValue
Definition: AgoraBase.h:2398
agora::rtc::TranscodingUser::width
int width
Definition: AgoraBase.h:3236
agora::base::AParameter
Definition: AgoraBase.h:4887
agora::rtc::BeautyOptions::sharpnessLevel
float sharpnessLevel
Definition: AgoraBase.h:3786
agora::rtc::EncryptionConfig::encryptionMode
ENCRYPTION_MODE encryptionMode
Definition: AgoraBase.h:4764
agora::util::AOutputIterator
Definition: AgoraBase.h:201
agora::rtc::WatermarkOptions::positionInLandscapeMode
Rectangle positionInLandscapeMode
Definition: AgoraBase.h:2053
agora::rtc::IAudioEncodedFrameObserver
Definition: AgoraBase.h:4296
agora::rtc::EncodedVideoFrameInfo::width
int width
Definition: AgoraBase.h:1750
agora::rtc::LocalAudioStats::txPacketLossRate
int txPacketLossRate
Definition: AgoraBase.h:3045
agora::rtc::LastmileProbeOneWayResult::availableBandwidth
unsigned int availableBandwidth
Definition: AgoraBase.h:3565
agora::rtc::EncodedVideoFrameInfo::framesPerSecond
int framesPerSecond
Definition: AgoraBase.h:1761
agora::rtc::LiveTranscoding::transcodingExtraInfo
const char * transcodingExtraInfo
Definition: AgoraBase.h:3338
agora::rtc::VideoTrackInfo::codecType
VIDEO_CODEC_TYPE codecType
Definition: AgoraBase.h:2841
agora::rtc::LiveTranscoding::metadata
const char * metadata
Definition: AgoraBase.h:3342
agora::rtc::LiveTranscoding::audioSampleRate
AUDIO_SAMPLE_RATE_TYPE audioSampleRate
Definition: AgoraBase.h:3371
agora::rtc::ChannelMediaRelayConfiguration
Definition: AgoraBase.h:4585
agora::rtc::UserInfo::uid
uid_t uid
Definition: AgoraBase.h:4848
agora::rtc::DataStreamConfig::ordered
bool ordered
Definition: AgoraBase.h:1973
agora::rtc::LastmileProbeOneWayResult
Definition: AgoraBase.h:3553
agora::rtc::EncodedVideoFrameInfo::renderTimeMs
int64_t renderTimeMs
Definition: AgoraBase.h:1778
agora::rtc::WatermarkRatio::widthRatio
float widthRatio
Definition: AgoraBase.h:2036
agora::rtc::AudioPcmDataInfo::samplesOut
size_t samplesOut
Definition: AgoraBase.h:1660
agora::rtc::VideoEncoderConfiguration::frameRate
int frameRate
Definition: AgoraBase.h:1826
agora::rtc::Rectangle::height
int height
Definition: AgoraBase.h:2017
agora::rtc::AudioPcmDataInfo::elapsedTimeMs
int64_t elapsedTimeMs
Definition: AgoraBase.h:1664
agora::rtc::WatermarkOptions::mode
WATERMARK_FIT_MODE mode
Definition: AgoraBase.h:2066
agora::rtc::EncodedAudioFrameInfo::sampleRateHz
int sampleRateHz
Definition: AgoraBase.h:1623
agora::rtc::RemoteAudioStats::audioLossRate
int audioLossRate
Definition: AgoraBase.h:2356
agora::UserInfo
Definition: AgoraBase.h:1129
agora::rtc::RtcStats::txPacketLossRate
int txPacketLossRate
Definition: AgoraBase.h:2213
agora::rtc::VideoCanvas::view
view_t view
Definition: AgoraBase.h:3723
agora::rtc::TranscodingVideoStream::imageUrl
const char * imageUrl
Definition: AgoraBase.h:3430
agora::rtc::AudioEncodedFrameObserverConfig::postionType
AUDIO_ENCODED_FRAME_OBSERVER_POSITION postionType
Definition: AgoraBase.h:4284
agora::rtc::IPacketObserver::onSendAudioPacket
virtual bool onSendAudioPacket(Packet &packet)=0
agora::rtc::LiveTranscoding::watermark
RtcImage * watermark
Definition: AgoraBase.h:3348
agora::rtc::ChannelMediaInfo
Definition: AgoraBase.h:4569
agora::UserInfo::hasVideo
bool hasVideo
Definition: AgoraBase.h:1145
agora::rtc::VideoCanvas::renderMode
media::base::RENDER_MODE_TYPE renderMode
Definition: AgoraBase.h:3727
agora::rtc::VideoTrackInfo::sourceType
VIDEO_SOURCE_TYPE sourceType
Definition: AgoraBase.h:2851
agora::rtc::RtcStats::txKBitRate
unsigned short txKBitRate
Definition: AgoraBase.h:2111
agora::rtc::EncodedAudioFrameInfo::numberOfChannels
int numberOfChannels
Definition: AgoraBase.h:1633
agora::rtc::EncodedVideoFrameInfo::streamType
VIDEO_STREAM_TYPE streamType
Definition: AgoraBase.h:1790
agora::rtc::RemoteAudioStats::quality
int quality
Definition: AgoraBase.h:2344
agora::rtc::ScreenCaptureParameters::frameRate
int frameRate
Definition: AgoraBase.h:4124
agora::rtc::RtcStats::firstVideoKeyFramePacketDurationAfterUnmute
int firstVideoKeyFramePacketDurationAfterUnmute
Definition: AgoraBase.h:2199
agora::rtc::LiveTranscoding::audioChannels
int audioChannels
Definition: AgoraBase.h:3386
agora::rtc::RtcImage::height
int height
Definition: AgoraBase.h:3179
agora::rtc::SimulcastStreamConfig::dimensions
VideoDimensions dimensions
Definition: AgoraBase.h:1983
agora::rtc::EncodedVideoFrameInfo::frameType
VIDEO_FRAME_TYPE frameType
Definition: AgoraBase.h:1765
agora::rtc::LastmileProbeConfig::probeDownlink
bool probeDownlink
Definition: AgoraBase.h:3515
agora::rtc::RtcStats::userCount
unsigned int userCount
Definition: AgoraBase.h:2139
agora::rtc::LocalTranscoderConfiguration::streamCount
unsigned int streamCount
Definition: AgoraBase.h:3483
agora::rtc::BeautyOptions::LIGHTENING_CONTRAST_HIGH
@ LIGHTENING_CONTRAST_HIGH
Definition: AgoraBase.h:3766
agora::base::LicenseCallback
Definition: AgoraBase.h:4901
agora::rtc::EncryptionConfig
Definition: AgoraBase.h:4760
agora::rtc::LiveTranscoding::videoCodecProfile
VIDEO_CODEC_PROFILE_TYPE videoCodecProfile
Definition: AgoraBase.h:3320
agora::rtc::IVideoEncodedImageReceiver
Definition: AgoraBase.h:2954
agora::rtc::ScreenCaptureParameters::dimensions
VideoDimensions dimensions
Definition: AgoraBase.h:4119
agora::rtc::VideoDimensions::width
int width
Definition: AgoraBase.h:1395
agora::rtc::AudioFileRecordingConfig
Definition: AgoraBase.h:4221
agora::rtc::RemoteAudioStats
Definition: AgoraBase.h:2336
agora::rtc::TranscodingVideoStream::x
int x
Definition: AgoraBase.h:3434
agora::rtc::LiveTranscoding::lowLatency
bool lowLatency
Definition: AgoraBase.h:3312
agora::rtc::TranscodingVideoStream
Definition: AgoraBase.h:3418
agora::rtc::RtcStats
Definition: AgoraBase.h:2079
agora::base::IParameterEngine
Definition: AgoraBase.h:88
agora::rtc::WatermarkOptions::visibleInPreview
bool visibleInPreview
Definition: AgoraBase.h:2048
agora::rtc::TranscodingUser::zOrder
int zOrder
Definition: AgoraBase.h:3246
agora::rtc::LiveTranscoding::width
int width
Definition: AgoraBase.h:3288
agora::rtc::AudioPcmDataInfo
Definition: AgoraBase.h:1642
agora::rtc::RtcStats::rxBytes
unsigned int rxBytes
Definition: AgoraBase.h:2091
agora::rtc::RtcStats::rxVideoKBitRate
unsigned short rxVideoKBitRate
Definition: AgoraBase.h:2127
agora::rtc::RtcStats::rxAudioKBitRate
unsigned short rxAudioKBitRate
Definition: AgoraBase.h:2119
agora::rtc::LocalAudioStats::numChannels
int numChannels
Definition: AgoraBase.h:3029
agora::rtc::WatermarkOptions
Definition: AgoraBase.h:2043
agora::rtc::VideoEncoderConfiguration::mirrorMode
VIDEO_MIRROR_MODE_TYPE mirrorMode
Definition: AgoraBase.h:1912
agora::rtc::LocalAudioStats
Definition: AgoraBase.h:3025
agora::rtc::ScreenCaptureParameters::captureMouseCursor
bool captureMouseCursor
Definition: AgoraBase.h:4134
agora::rtc::LocalTranscoderConfiguration::VideoInputStreams
TranscodingVideoStream * VideoInputStreams
Definition: AgoraBase.h:3487
agora::rtc::RtcImage::y
int y
Definition: AgoraBase.h:3171
agora::rtc::EncodedAudioFrameAdvancedSettings
Definition: AgoraBase.h:1580
agora::rtc::RtcStats::memoryAppUsageRatio
double memoryAppUsageRatio
Definition: AgoraBase.h:2151
agora::rtc::LastmileProbeConfig::expectedUplinkBitrate
unsigned int expectedUplinkBitrate
Definition: AgoraBase.h:3521
agora::rtc::VideoTrackInfo::isLocal
bool isLocal
Definition: AgoraBase.h:2821
agora::rtc::VideoTrackInfo::channelId
const char * channelId
Definition: AgoraBase.h:2833
agora::rtc::RtcStats::firstVideoKeyFramePacketDuration
int firstVideoKeyFramePacketDuration
Definition: AgoraBase.h:2179
agora::rtc::VideoTrackInfo::streamType
VIDEO_STREAM_TYPE streamType
Definition: AgoraBase.h:2837
agora::rtc::AudioFileRecordingConfig::encode
bool encode
Definition: AgoraBase.h:4232
agora::util::IContainer
Definition: AgoraBase.h:192
agora::rtc::VideoDimensions
Definition: AgoraBase.h:1391
agora::rtc::TranscodingVideoStream::height
int height
Definition: AgoraBase.h:3446
agora::rtc::DataStreamConfig::syncWithAudio
bool syncWithAudio
Definition: AgoraBase.h:1970
agora::rtc::RemoteAudioStats::frozenRate
int frozenRate
Definition: AgoraBase.h:2381
agora::rtc::LiveTranscoding::userCount
unsigned int userCount
Definition: AgoraBase.h:3329
agora::util::CopyableAutoPtr
Definition: AgoraBase.h:155
agora::rtc::TranscodingVideoStream::width
int width
Definition: AgoraBase.h:3442
agora::rtc::TranscodingVideoStream::mirror
bool mirror
Definition: AgoraBase.h:3460
agora::rtc::AudioFileRecordingConfig::filePath
const char * filePath
Definition: AgoraBase.h:4226
agora::rtc::EncryptionConfig::encryptionKey
const char * encryptionKey
Definition: AgoraBase.h:4770
agora::rtc::EncodedVideoFrameInfo::trackId
int trackId
Definition: AgoraBase.h:1773
agora::rtc::ScreenCaptureParameters::excludeWindowList
view_t * excludeWindowList
Definition: AgoraBase.h:4144
agora::rtc::IPacketObserver::onSendVideoPacket
virtual bool onSendVideoPacket(Packet &packet)=0
agora::rtc::VideoTrackInfo
Definition: AgoraBase.h:2810
agora::rtc::LocalTranscoderConfiguration::videoOutputConfiguration
VideoEncoderConfiguration videoOutputConfiguration
Definition: AgoraBase.h:3491
agora::rtc::SimulcastStreamConfig::bitrate
int bitrate
Definition: AgoraBase.h:1987
agora::rtc::RemoteAudioStats::numChannels
int numChannels
Definition: AgoraBase.h:2360
agora::rtc::RemoteAudioStats::jitterBufferDelay
int jitterBufferDelay
Definition: AgoraBase.h:2352
agora::rtc::AudioPcmDataInfo::ntpTimeMs
int64_t ntpTimeMs
Definition: AgoraBase.h:1668
agora::rtc::RtcStats::firstVideoPacketDurationAfterUnmute
int firstVideoPacketDurationAfterUnmute
Definition: AgoraBase.h:2194
agora::rtc::IAudioEncodedFrameObserver::OnRecordAudioEncodedFrame
virtual void OnRecordAudioEncodedFrame(const uint8_t *frameBuffer, int length, const EncodedAudioFrameInfo &audioEncodedFrameInfo)=0
agora::rtc::LiveTranscoding::videoFramerate
int videoFramerate
Definition: AgoraBase.h:3306
agora::rtc::RemoteAudioStats::uid
uid_t uid
Definition: AgoraBase.h:2340
agora::rtc::RtcStats::rxPacketLossRate
int rxPacketLossRate
Definition: AgoraBase.h:2217
agora::rtc::RtcStats::lastmileDelay
unsigned short lastmileDelay
Definition: AgoraBase.h:2135
agora::rtc::VideoEncoderConfiguration::codecType
VIDEO_CODEC_TYPE codecType
Definition: AgoraBase.h:1818
agora::rtc::LastmileProbeResult::rtt
unsigned int rtt
Definition: AgoraBase.h:3592
agora::rtc::TranscodingVideoStream::y
int y
Definition: AgoraBase.h:3438
agora::rtc::RtcStats::packetsBeforeFirstKeyFramePacket
int packetsBeforeFirstKeyFramePacket
Definition: AgoraBase.h:2184
agora::rtc::BeautyOptions::LIGHTENING_CONTRAST_NORMAL
@ LIGHTENING_CONTRAST_NORMAL
Definition: AgoraBase.h:3764
agora::rtc::ChannelMediaRelayConfiguration::srcInfo
ChannelMediaInfo * srcInfo
Definition: AgoraBase.h:4597
agora::rtc::VideoEncoderConfiguration::orientationMode
ORIENTATION_MODE orientationMode
Definition: AgoraBase.h:1902
agora::base::IEngineBase
Definition: AgoraBase.h:4881
agora::util::IIterator
Definition: AgoraBase.h:183
agora::rtc::UserInfo::userAccount
char userAccount[MAX_USER_ACCOUNT_LENGTH]
Definition: AgoraBase.h:4852
agora::rtc::EncodedAudioFrameInfo::samplesPerChannel
int samplesPerChannel
Definition: AgoraBase.h:1629
agora::rtc::EncodedVideoFrameInfo::height
int height
Definition: AgoraBase.h:1754
agora::rtc::RtcStats::memoryAppUsageInKbytes
int memoryAppUsageInKbytes
Definition: AgoraBase.h:2159
agora::rtc::ClientRoleOptions
Definition: AgoraBase.h:2322
agora::rtc::TranscodingUser::height
int height
Definition: AgoraBase.h:3240
agora::rtc::RemoteAudioStats::receivedSampleRate
int receivedSampleRate
Definition: AgoraBase.h:2364
agora::rtc::IPacketObserver::onReceiveAudioPacket
virtual bool onReceiveAudioPacket(Packet &packet)=0
agora::rtc::VideoCanvas
Definition: AgoraBase.h:3719
agora::rtc::LocalAudioStats::internalCodec
int internalCodec
Definition: AgoraBase.h:3041
agora::rtc::ChannelMediaInfo::uid
uid_t uid
Definition: AgoraBase.h:4580
agora::rtc::EncodedVideoFrameInfo::internalSendTs
uint64_t internalSendTs
Definition: AgoraBase.h:1782