matrixbirds пре 5 година
родитељ
комит
c479cdb4d3
21 измењених фајлова са 12437 додато и 3418 уклоњено
  1. 1
    0
      .gitignore
  2. 70
    0
      ios/RCTAgora/AgoraConst.h
  3. 0
    2
      ios/RCTAgora/AgoraConst.m
  4. 2
    2
      ios/RCTAgora/RCTAgora.h
  5. 1901
    309
      ios/RCTAgora/RCTAgora.m
  6. 2
    2
      ios/RCTAgora/RCTAgoraVideoView.m
  7. BIN
      ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework/AgoraRtcCryptoLoader
  8. 1
    2
      ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework/Headers/AgoraRtcCryptoLoader.h
  9. 597
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraBase.h
  10. 91
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraConstants.h
  11. 833
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraEnumerates.h
  12. 243
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraLiveKit.h
  13. 181
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraLivePublisher.h
  14. 121
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraLiveSubscriber.h
  15. 281
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraMediaIO.h
  16. 765
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraObjects.h
  17. 3110
    1341
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraRtcEngineKit.h
  18. 36
    2
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraMediaEngine.h
  19. 4123
    1696
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraRtcEngine.h
  20. 79
    0
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraService.h
  21. 0
    62
      ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/ICodingModuleCallback.h

+ 1
- 0
.gitignore Прегледај датотеку

@@ -63,3 +63,4 @@ xcuserdata
63 63
 *.pbxproj
64 64
 lib
65 65
 *.xcworkspace
66
+*.zip

+ 70
- 0
ios/RCTAgora/AgoraConst.h Прегледај датотеку

@@ -8,6 +8,76 @@
8 8
 
9 9
 #import <AgoraRtcEngineKit/AgoraRtcEngineKit.h>
10 10
 
11
+static NSString *RCTAgoraErrorDomain = @"RCTAgoraErrorDomain";
12
+
13
+static NSString *DidOccurWarning = @"DidOccurWarning";
14
+static NSString *DidOccurError = @"DidOccurError";
15
+static NSString *DidApiCallExecute = @"DidApiCallExecute";
16
+static NSString *DidJoinChannel = @"DidJoinChannel";
17
+static NSString *DidRejoinChannel = @"DidRejoinChannel";
18
+static NSString *DidLeaveChannel = @"DidLeaveChannel";
19
+static NSString *DidClientRoleChanged = @"DidClientRoleChanged";
20
+static NSString *DidJoinedOfUid = @"DidJoinedOfUid";
21
+static NSString *DidOfflineOfUid = @"DidOfflineOfUid";
22
+static NSString *ConnectionChangedToState = @"ConnectionChangedToState";
23
+static NSString *ConnectionDidLost = @"ConnectionDidLost";
24
+static NSString *TokenPrivilegeWillExpire = @"T=okenPrivilegeWillExpire";
25
+static NSString *RequestToken = @"RequestToken";
26
+
27
+static NSString *DidMicrophoneEnabled = @"DidMicrophoneEnabled";
28
+static NSString *ReportAudioVolumeIndicationOfSpeakers = @"ReportAudioVolumeIndicationOfSpeakers";
29
+static NSString *ActiveSpeaker = @"ActiveSpeaker";
30
+static NSString *FirstLocalAudioFrame = @"FirstLocalAudioFrame";
31
+static NSString *FirstRemoteAudioFrameOfUid = @"FirstRemoteAudioFrameOfUid";
32
+static NSString *VideoDidStop = @"VideoDidStop";
33
+static NSString *FirstLocalVideoFrameWithSize = @"FirstLocalVideoFrameWithSize";
34
+static NSString *FirstRemoteVideoDecodedOfUid = @"FirstRemoteVideoDecodedOfUid";
35
+static NSString *FirstRemoteVideoFrameOfUid = @"FirstRemoteVideoFrameOfUid";
36
+static NSString *DidAudioMuted = @"DidAudioMuted";
37
+static NSString *DidVideoMuted = @"DidVideoMuted";
38
+static NSString *DidVideoEnabled = @"DidVideoEnabled";
39
+static NSString *DidLocalVideoEnabled = @"DidLocalVideoEnabled";
40
+static NSString *VideoSizeChangedOfUid = @"VideoSizeChangedOfUid";
41
+static NSString *RemoteVideoStateChangedOfUid = @"RemoteVideoStateChangedOfUid";
42
+static NSString *DidLocalPublishFallbackToAudioOnly = @"DidLocalPublishFallbackToAudioOnly";
43
+static NSString *DidRemoteSubscribeFallbackToAudioOnly = @"DidRemoteSubscribeFallbackToAudioOnly";
44
+
45
+static NSString *DeviceTypeStateChanged = @"DeviceTypeStateChanged";
46
+static NSString *DidAudioRouteChanged = @"DidAudioRouteChanged";
47
+static NSString *CameraDidReady = @"CameraDidReady";
48
+static NSString *CameraFocusDidChangedToRect = @"CameraFocusDidChangedToRect";
49
+static NSString *CameraExposureDidChangedToRect = @"CameraExposureDidChangedToRect";
50
+
51
+static NSString *ReportRtcStats = @"ReportRtcStats";
52
+static NSString *LastmileQuality = @"LastmileQuality";
53
+static NSString *NetworkQuality = @"NetworkQuality";
54
+static NSString *LocalVideoStats = @"LocalVideoStats";
55
+static NSString *RemoteVideoStats = @"RemoteVideoStats";
56
+static NSString *RemoteAudioStats = @"RemoteAudioStats";
57
+static NSString *AudioTransportStatsOfUid = @"AudioTransportStatsOfUid";
58
+static NSString *VideoTransportStatsOfUid = @"VideoTransportStatsOfUid";
59
+
60
+static NSString *LocalAudioMixingDidFinish = @"LocalAudioMixingDidFinish";
61
+static NSString *RemoteAudioMixingDidStart = @"RemoteAudioMixingDidStart";
62
+static NSString *RemoteAudioMixingDidFinish = @"RemoteAudioMixingDidFinish";
63
+static NSString *DidAudioEffectFinish = @"DidAudioEffectFinish";
64
+
65
+static NSString *StreamPublished = @"StreamPublished";
66
+static NSString *StreamUnpublish = @"StreamUnpublish";
67
+static NSString *TranscodingUpdated = @"TranscodingUpdated";
68
+
69
+static NSString *StreamInjectedStatus = @"StreamInjectedStatus";
70
+
71
+static NSString *ReceiveStreamMessage = @"ReceiveStreamMessage";
72
+static NSString *DidOccurStreamMessageError = @"DidOccurStreamMessageError";
73
+
74
+static NSString *MediaEngineDidLoaded = @"MediaEngineDidLoaded";
75
+static NSString *MediaEngineDidStartCall = @"MediaEngineDidStartCall";
76
+
77
+static NSString *ConnectionDidInterrupted = @"ConnectionDidInterrupted";
78
+static NSString *ConnectionDidBanned = @"ConnectionDidBanned";
79
+static NSString *AudioQualityOfUid = @"AudioQualityOfUid";
80
+
11 81
 @interface AgoraConst : NSObject
12 82
 
13 83
 @property (nonatomic, copy) NSString *appid;

+ 0
- 2
ios/RCTAgora/AgoraConst.m Прегледај датотеку

@@ -31,6 +31,4 @@ static AgoraConst *_person;
31 31
     return _person;
32 32
 }
33 33
 
34
-
35
-
36 34
 @end

+ 2
- 2
ios/RCTAgora/RCTAgora.h Прегледај датотеку

@@ -9,8 +9,8 @@
9 9
 #import <Foundation/Foundation.h>
10 10
 #import <UIKit/UIKit.h>
11 11
 #import <React/RCTBridgeModule.h>
12
-#import <AgoraRtcEngineKit/AgoraRtcEngineKit.h>
12
+#import <React/RCTEventEmitter.h>
13 13
 
14
-@interface RCTAgora : NSObject<RCTBridgeModule, AgoraRtcEngineDelegate>
14
+@interface RCTAgora : RCTEventEmitter<RCTBridgeModule>
15 15
 
16 16
 @end

+ 1901
- 309
ios/RCTAgora/RCTAgora.m
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 2
- 2
ios/RCTAgora/RCTAgoraVideoView.m Прегледај датотеку

@@ -24,7 +24,7 @@
24 24
         AgoraRtcVideoCanvas *canvas = [[AgoraRtcVideoCanvas alloc] init];
25 25
         canvas.uid = [AgoraConst share].localUid;
26 26
         canvas.view = self;
27
-        canvas.renderMode = AgoraRtc_Render_Hidden;
27
+        canvas.renderMode = AgoraVideoRenderModeHidden;
28 28
         [_rtcEngine setupLocalVideo:canvas];
29 29
     }
30 30
 }
@@ -34,7 +34,7 @@
34 34
         AgoraRtcVideoCanvas *canvas = [[AgoraRtcVideoCanvas alloc] init];
35 35
         canvas.uid = remoteUid;
36 36
         canvas.view = self;
37
-        canvas.renderMode = AgoraRtc_Render_Hidden;
37
+        canvas.renderMode = AgoraVideoRenderModeHidden;
38 38
         [_rtcEngine setupRemoteVideo:canvas];
39 39
     }
40 40
 }

BIN
ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework/AgoraRtcCryptoLoader Прегледај датотеку


+ 1
- 2
ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework/Headers/AgoraRtcCryptoLoader.h Прегледај датотеку

@@ -2,8 +2,7 @@
2 2
 //  AgoraRtcCryptoLoader.h
3 3
 //  AgoraRtcCryptoLoader
4 4
 //
5
-//  Created by junhao wang on 1/5/17.
6
-//  Copyright © 2017 Agora. All rights reserved.
5
+//  Copyright © 2018 Agora. All rights reserved.
7 6
 //
8 7
 
9 8
 #import <Foundation/Foundation.h>

+ 597
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraBase.h Прегледај датотеку

@@ -0,0 +1,597 @@
1
+//  Agora Engine SDK
2
+//
3
+//  Copyright (c) 2018 Agora.io. All rights reserved.
4
+//
5
+
6
+#ifndef AGORA_BASE_H
7
+#define AGORA_BASE_H
8
+
9
+#include <stddef.h>
10
+#include <stdio.h>
11
+#include <stdarg.h>
12
+
13
+#if defined(_WIN32)
14
+#define WIN32_LEAN_AND_MEAN
15
+#include <windows.h>
16
+#define AGORA_CALL __cdecl
17
+#if defined(AGORARTC_EXPORT)
18
+#define AGORA_API extern "C" __declspec(dllexport)
19
+#else
20
+#define AGORA_API extern "C" __declspec(dllimport)
21
+#endif
22
+#elif defined(__APPLE__)
23
+#define AGORA_API __attribute__((visibility("default"))) extern "C"
24
+#define AGORA_CALL
25
+#elif defined(__ANDROID__) || defined(__linux__)
26
+#define AGORA_API extern "C" __attribute__((visibility("default")))
27
+#define AGORA_CALL
28
+#else
29
+#define AGORA_API extern "C"
30
+#define AGORA_CALL
31
+#endif
32
+
33
+namespace agora {
34
+namespace util {
35
+
36
+template<class T>
37
+class AutoPtr {
38
+    typedef T value_type;
39
+    typedef T* pointer_type;
40
+public:
41
+    AutoPtr(pointer_type p=0)
42
+        :ptr_(p)
43
+    {}
44
+    ~AutoPtr() {
45
+        if (ptr_)
46
+            ptr_->release();
47
+    }
48
+    operator bool() const { return ptr_ != (pointer_type)0; }
49
+    value_type& operator*() const {
50
+        return *get();
51
+    }
52
+
53
+    pointer_type operator->() const {
54
+        return get();
55
+    }
56
+
57
+    pointer_type get() const {
58
+        return ptr_;
59
+    }
60
+
61
+    pointer_type release() {
62
+        pointer_type tmp = ptr_;
63
+        ptr_ = 0;
64
+        return tmp;
65
+    }
66
+
67
+    void reset(pointer_type ptr = 0) {
68
+        if (ptr != ptr_ && ptr_)
69
+            ptr_->release();
70
+        ptr_ = ptr;
71
+    }
72
+    template<class C1, class C2>
73
+    bool queryInterface(C1* c, C2 iid) {
74
+        pointer_type p = NULL;
75
+        if (c && !c->queryInterface(iid, (void**)&p))
76
+        {
77
+            reset(p);
78
+        }
79
+        return p != NULL;
80
+	}
81
+private:
82
+    AutoPtr(const AutoPtr&);
83
+    AutoPtr& operator=(const AutoPtr&);
84
+private:
85
+    pointer_type ptr_;
86
+};
87
+class IString {
88
+protected:
89
+    virtual ~IString(){}
90
+public:
91
+    virtual bool empty() const = 0;
92
+    virtual const char* c_str() = 0;
93
+    virtual const char* data() = 0;
94
+    virtual size_t length() = 0;
95
+    virtual void release() = 0;
96
+};
97
+typedef AutoPtr<IString> AString;
98
+
99
+}//namespace util
100
+
101
+enum INTERFACE_ID_TYPE
102
+{
103
+    AGORA_IID_AUDIO_DEVICE_MANAGER = 1,
104
+    AGORA_IID_VIDEO_DEVICE_MANAGER = 2,
105
+    AGORA_IID_RTC_ENGINE_PARAMETER = 3,
106
+    AGORA_IID_MEDIA_ENGINE = 4,
107
+    AGORA_IID_SIGNALING_ENGINE = 8,
108
+};
109
+
110
+    /** Warning code.
111
+     */
112
+enum WARN_CODE_TYPE
113
+{
114
+  /** 8: The specified view is invalid. Specify a view when using the video call function.
115
+  */
116
+    WARN_INVALID_VIEW = 8,
117
+    /** 16: Failed to initialize the video function, possibly caused by a lack of resources. The users cannot see the video while the voice communication is not affected.
118
+    */
119
+    WARN_INIT_VIDEO = 16,
120
+    /** 20: The request is pending, usually due to some module not being ready, and the SDK postponed processing the request.
121
+    */
122
+    WARN_PENDING = 20,
123
+    /** 103: No channel resources are available. Maybe because the server cannot allocate any channel resource.
124
+    */
125
+    WARN_NO_AVAILABLE_CHANNEL = 103,
126
+    /** 104: A timeout occurs when looking up the channel. When joining a channel, the SDK looks up the specified channel. This warning usually occurs when the network condition is too poor to connect to the server.
127
+    */
128
+    WARN_LOOKUP_CHANNEL_TIMEOUT = 104,
129
+    /** 105: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal.
130
+    */
131
+    WARN_LOOKUP_CHANNEL_REJECTED = 105,
132
+    /** 106: A timeout occurs when opening the channel. Once the specific channel is found, the SDK opens the channel. This warning usually occurs when the network condition is too poor to connect to the server.
133
+    */
134
+    WARN_OPEN_CHANNEL_TIMEOUT = 106,
135
+    /** 107: The server rejects the request to open the channel. The server cannot process this request or the request is illegal.
136
+    */
137
+    WARN_OPEN_CHANNEL_REJECTED = 107,
138
+
139
+    // sdk: 100~1000
140
+    /** 111: A timeout occurs when switching to the live video.
141
+    */
142
+    WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111,
143
+    /** 118: A timeout occurs when setting the client role in the live broadcast profile.
144
+    */
145
+    WARN_SET_CLIENT_ROLE_TIMEOUT = 118,
146
+    /** 121: The ticket to open the channel is invalid.
147
+    */
148
+    WARN_OPEN_CHANNEL_INVALID_TICKET = 121,
149
+    /** 122: Try connecting to another server.
150
+    */
151
+    WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122,
152
+    /** 701: An error occurs in opening the audio mixing file.
153
+    */
154
+    WARN_AUDIO_MIXING_OPEN_ERROR = 701,
155
+    /** 1014: Audio Device Module: A warning occurs in the playback device.
156
+    */
157
+    WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014,
158
+    /** 1016: Audio Device Module: A warning occurs in the recording device.
159
+    */
160
+    WARN_ADM_RUNTIME_RECORDING_WARNING = 1016,
161
+    /** 1019: Audio Device Module: No valid audio data is collected. This warning does not affect the ongoing call.
162
+    */
163
+    WARN_ADM_RECORD_AUDIO_SILENCE = 1019,
164
+    /** 1020: Audio Device Module: The playback device fails.
165
+    */
166
+    WARN_ADM_PLAYOUT_MALFUNCTION = 1020,
167
+    /** 1021: Audio Device Module: The recording device fails.
168
+    */
169
+    WARN_ADM_RECORD_MALFUNCTION = 1021,
170
+    /**
171
+    */
172
+    WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD = 1029,
173
+    /**
174
+    */
175
+    WARN_ADM_IOS_SAMPLERATE_CHANGE = 1030,
176
+    /** 1031: Audio Device Module: The recorded audio voice is too low.
177
+    */
178
+    WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031,
179
+    /** 1032: Audio Device Module: The playback audio voice is too low.
180
+    */
181
+    WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032,
182
+    /**
183
+    */
184
+    WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040,
185
+    /** 1051: Audio Device Module: Howling is detected.
186
+    */
187
+    WARN_APM_HOWLING = 1051,
188
+    /** 1052: Audio Device Module: The device is in the glitch state.
189
+    */
190
+    WARN_ADM_GLITCH_STATE = 1052,
191
+    /** 1053: Audio Device Module: The underlying audio settings changed.
192
+    */
193
+    WARN_ADM_IMPROPER_SETTINGS = 1053,
194
+    /**
195
+        */
196
+    WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
197
+    /**
198
+    */
199
+    WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
200
+    /**
201
+    */
202
+    WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324,
203
+};
204
+
205
+/** Error code.
206
+*/
207
+enum ERROR_CODE_TYPE
208
+{
209
+  /** 0: No error occurs.
210
+  */
211
+    ERR_OK = 0,
212
+    //1~1000
213
+    /** 1: A general error occurs (no specified reason).
214
+    */
215
+    ERR_FAILED = 1,
216
+    /** 2: An invalid parameter is used. For example, the specific channel name includes illegal characters.
217
+    */
218
+    ERR_INVALID_ARGUMENT = 2,
219
+    /** 3: The SDK module is not ready. Possible solutions:
220
+
221
+     - Check the audio device.
222
+     - Check the completeness of the application.
223
+     - Re-initialize the RTC engine.
224
+     */
225
+    ERR_NOT_READY = 3,
226
+    /** 4: The SDK does not support this function.
227
+     */
228
+    ERR_NOT_SUPPORTED = 4,
229
+    /** 5: The request is rejected. This is for internal SDK use only, and it does not return to the application through any method or callback.
230
+     */
231
+    ERR_REFUSED = 5,
232
+    /** 6: The buffer size is not big enough to store the returned data.
233
+     */
234
+    ERR_BUFFER_TOO_SMALL = 6,
235
+    /** 7: The SDK is not initialized before calling this method.
236
+     */
237
+    ERR_NOT_INITIALIZED = 7,
238
+    /** 9: No permission exists. This is for internal SDK use only, and it does not return to the application through any method or callback.
239
+     */
240
+    ERR_NO_PERMISSION = 9,
241
+    /** 10: An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (more than 10 seconds) for the SDK to process.
242
+     */
243
+    ERR_TIMEDOUT = 10,
244
+    /** 11: The request is canceled. This is for internal SDK use only, and it does not return to the application through any method or callback.
245
+     */
246
+    ERR_CANCELED = 11,
247
+    /** 12: The method is called too often. This is for internal SDK use only, and it does not return to the application through any method or callback.
248
+     */
249
+    ERR_TOO_OFTEN = 12,
250
+    /** 13: The SDK fails to bind to the network socket. This is for internal SDK use only, and it does not return to the application through any method or callback.
251
+     */
252
+    ERR_BIND_SOCKET = 13,
253
+    /** 14: The network is unavailable. This is for internal SDK use only, and it does not return to the application through any method or callback.
254
+     */
255
+    ERR_NET_DOWN = 14,
256
+    /** 15: No network buffers are available. This is for internal SDK internal use only, and it does not return to the application through any method or callback.
257
+     */
258
+    ERR_NET_NOBUFS = 15,
259
+    /** 17: The request to join the channel is rejected. This error usually occurs when the user is already in the channel, and still calls the method to join the channel, for example, \ref agora::rtc::IRtcEngine::joinChannel "joinChannel".
260
+     */
261
+    ERR_JOIN_CHANNEL_REJECTED = 17,
262
+    /** 18: The request to leave the channel is rejected.
263
+
264
+     This error usually occurs:
265
+
266
+     - When the user has left the channel and still calls \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, stop calling \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel".
267
+     - When the user has not joined the channel and still calls \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, no extra operation is needed.
268
+     */
269
+    ERR_LEAVE_CHANNEL_REJECTED = 18,
270
+    /** 19: Resources are occupied and cannot be reused.
271
+     */
272
+    ERR_ALREADY_IN_USE = 19,
273
+    /** 20: The SDK gives up the request due to too many requests.
274
+     */
275
+    ERR_ABORTED = 20,
276
+    /** 21: In Windows, specific firewall settings can cause the SDK to fail to initialize and crash.
277
+     */
278
+    ERR_INIT_NET_ENGINE = 21,
279
+    /** 22: The application uses too much of the system resources and the SDK fails to allocate the resources.
280
+     */
281
+    ERR_RESOURCE_LIMITED = 22,
282
+    /** 101: The specified App ID is invalid. Please try to rejoin the channel with a valid App ID.
283
+     */
284
+    ERR_INVALID_APP_ID = 101,
285
+    /** 102: The specified channel name is invalid. Please try to rejoin the channel with a valid channel name.
286
+     */
287
+    ERR_INVALID_CHANNEL_NAME = 102,
288
+    /** 109: The token expired due to one of the following reasons:
289
+
290
+     - Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the Token to access the Agora service within five minutes after the Token is generated. If the user does not access the Agora service after five minutes, this Token is no longer valid.
291
+     - Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel.
292
+     */
293
+    ERR_TOKEN_EXPIRED = 109,
294
+    /** 110: The token is invalid due to one of the following reasons:
295
+
296
+     - The App Certificate for the project is enabled in Dashboard, but the user is still using the App ID. Once the App Certificate is enabled, the user must use a token.
297
+     - The uid is mandatory, and users must set the same uid as the one set in the \ref agora::rtc::IRtcEngine::joinChannel "joinChannel" method.
298
+     */
299
+    ERR_INVALID_TOKEN = 110,
300
+    /** 111: The internet connection is interrupted. This applies to the Agora Web SDK only.
301
+     */
302
+    ERR_CONNECTION_INTERRUPTED = 111, // only used in web sdk
303
+    /** 112: The internet connection is lost. This applies to the Agora Web SDK only.
304
+     */
305
+    ERR_CONNECTION_LOST = 112, // only used in web sdk
306
+    /** 113: The user is not in the channel when calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method.
307
+     */
308
+    ERR_NOT_IN_CHANNEL = 113,
309
+    /** 114: The size of the sent data is over 1024 bytes when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method.
310
+     */
311
+    ERR_SIZE_TOO_LARGE = 114,
312
+    /** 115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method.
313
+     */
314
+    ERR_BITRATE_LIMIT = 115,
315
+    /** 116: Too many data streams (over 5 streams) are created when the user calls the \ref agora::rtc::IRtcEngine::createDataStream "createDataStream" method.
316
+     */
317
+    ERR_TOO_MANY_DATA_STREAMS = 116,
318
+    /** 117: The data stream transmission timed out.
319
+     */
320
+    ERR_STREAM_MESSAGE_TIMEOUT = 117,
321
+    /** 119: Switching roles fail. Please try to rejoin the channel.
322
+     */
323
+    ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119,
324
+    /** 120: Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel.
325
+     */
326
+    ERR_DECRYPTION_FAILED = 120,
327
+    /** 123: The client is banned by the server.
328
+     */
329
+    ERR_CLIENT_IS_BANNED_BY_SERVER = 123,
330
+    /** 124: An error occurs in the watermark file parameter.
331
+     */
332
+    ERR_WATERMARK_PARAM = 124,
333
+    /** 125: An error occurs in the watermark file path.
334
+     */
335
+    ERR_WATERMARK_PATH = 125,
336
+    /** 126: An error occurs in the watermark file format.
337
+     */
338
+    ERR_WATERMARK_PNG = 126,
339
+    /** 127: An error occurs in the watermark file information.
340
+     */
341
+    ERR_WATERMARKR_INFO = 127,
342
+    /** 128: An error occurs in the watermark file data format.
343
+     */
344
+    ERR_WATERMARK_ARGB = 128,
345
+    /** 129: An error occurs in reading the watermark file.
346
+     */
347
+    ERR_WATERMARK_READ = 129,
348
+    /** 130: Encryption is enabled when the user calls the \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method (CDN live streaming does not support encrypted streams).
349
+     */
350
+    ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130,
351
+
352
+    //signaling: 400~600
353
+    /**
354
+    */
355
+    ERR_LOGOUT_OTHER = 400,  //
356
+    /** 401: The user logged out.
357
+     */
358
+    ERR_LOGOUT_USER = 401,  // logout by user
359
+    /** 402: Network failure.
360
+     */
361
+    ERR_LOGOUT_NET = 402,  // network failure
362
+    /** 403: Logged in another device.
363
+     */
364
+    ERR_LOGOUT_KICKED = 403,  // login in other device
365
+    /**
366
+     */
367
+    ERR_LOGOUT_PACKET = 404,  //
368
+    /** 405: The token expired.
369
+     */
370
+    ERR_LOGOUT_TOKEN_EXPIRED = 405,  // token expired
371
+    /**
372
+     */
373
+    ERR_LOGOUT_OLDVERSION = 406,  //
374
+    /**
375
+     */
376
+    ERR_LOGOUT_TOKEN_WRONG = 407,
377
+    /**
378
+    */
379
+    ERR_LOGOUT_ALREADY_LOGOUT = 408,
380
+    /**
381
+     */
382
+    ERR_LOGIN_OTHER = 420,
383
+    /**
384
+    */
385
+    ERR_LOGIN_NET = 421,
386
+    /**
387
+     */
388
+    ERR_LOGIN_FAILED = 422,
389
+    /**
390
+     */
391
+    ERR_LOGIN_CANCELED = 423,
392
+    /**
393
+     */
394
+    ERR_LOGIN_TOKEN_EXPIRED = 424,
395
+    /**
396
+     */
397
+    ERR_LOGIN_OLD_VERSION = 425,
398
+    /**
399
+     */
400
+    ERR_LOGIN_TOKEN_WRONG = 426,
401
+    /**
402
+     */
403
+    ERR_LOGIN_TOKEN_KICKED = 427,
404
+    /**
405
+     */
406
+    ERR_LOGIN_ALREADY_LOGIN = 428,
407
+    /**
408
+    */
409
+    ERR_JOIN_CHANNEL_OTHER = 440,
410
+    /**
411
+     */
412
+    ERR_SEND_MESSAGE_OTHER = 440,
413
+    /**
414
+     */
415
+    ERR_SEND_MESSAGE_TIMEOUT = 441,
416
+    /**
417
+     */
418
+    ERR_QUERY_USERNUM_OTHER = 450,
419
+    /**
420
+     */
421
+    ERR_QUERY_USERNUM_TIMEOUT = 451,
422
+    /**
423
+     */
424
+    ERR_QUERY_USERNUM_BYUSER = 452,
425
+    /**
426
+     */
427
+    ERR_LEAVE_CHANNEL_OTHER = 460,
428
+    /**
429
+     */
430
+    ERR_LEAVE_CHANNEL_KICKED = 461,
431
+    /**
432
+     */
433
+    ERR_LEAVE_CHANNEL_BYUSER = 462,
434
+    /**
435
+     */
436
+    ERR_LEAVE_CHANNEL_LOGOUT = 463,
437
+    /**
438
+     */
439
+    ERR_LEAVE_CHANNEL_DISCONNECTED = 464,
440
+    /**
441
+     */
442
+    ERR_INVITE_OTHER = 470,
443
+    /**
444
+     */
445
+    ERR_INVITE_REINVITE = 471,
446
+    /**
447
+     */
448
+    ERR_INVITE_NET = 472,
449
+    /**
450
+     */
451
+    ERR_INVITE_PEER_OFFLINE = 473,
452
+    ERR_INVITE_TIMEOUT = 474,
453
+    ERR_INVITE_CANT_RECV = 475,
454
+
455
+
456
+    //1001~2000
457
+    /** 1001: Fails to load the media engine.
458
+     */
459
+    ERR_LOAD_MEDIA_ENGINE = 1001,
460
+    /** 1002: Fails to start the call after enabling the media engine.
461
+     */
462
+    ERR_START_CALL = 1002,
463
+    /** 1003: Fails to start the camera.
464
+     */
465
+    ERR_START_CAMERA = 1003,
466
+    /** 1004: Fails to start the video rendering module.
467
+     */
468
+    ERR_START_VIDEO_RENDER = 1004,
469
+    /** 1005: A general error occurs in the Audio Device Module (no specified reason). Check if the audio device is used by another application, or try rejoining the channel.
470
+     */
471
+    ERR_ADM_GENERAL_ERROR = 1005,
472
+    /** 1006: Audio Device Module: An error occurs in using the Java resources.
473
+     */
474
+    ERR_ADM_JAVA_RESOURCE = 1006,
475
+    /** 1007: Audio Device Module: An error occurs in setting the sampling frequency.
476
+     */
477
+    ERR_ADM_SAMPLE_RATE = 1007,
478
+    /** 1008: Audio Device Module: An error occurs in initializing the playback device.
479
+     */
480
+    ERR_ADM_INIT_PLAYOUT = 1008,
481
+    /** 1009: Audio Device Module: An error occurs in starting the playback device.
482
+     */
483
+    ERR_ADM_START_PLAYOUT = 1009,
484
+    /** 1010: Audio Device Module: An error occurs in stopping the playback device.
485
+     */
486
+    ERR_ADM_STOP_PLAYOUT = 1010,
487
+    /** 1011: Audio Device Module: An error occurs in initializing the recording device.
488
+     */
489
+    ERR_ADM_INIT_RECORDING = 1011,
490
+    /** 1012: Audio Device Module: An error occurs in starting the recording device.
491
+     */
492
+    ERR_ADM_START_RECORDING = 1012,
493
+    /** 1013: Audio Device Module: An error occurs in stopping the recording device.
494
+     */
495
+    ERR_ADM_STOP_RECORDING = 1013,
496
+    /** 1015: Audio Device Module: A playback error occurs. Check your playback device and try rejoining the channel.
497
+     */
498
+    ERR_ADM_RUNTIME_PLAYOUT_ERROR = 1015,
499
+    /** 1017: Audio Device Module: A recording error occurs.
500
+     */
501
+    ERR_ADM_RUNTIME_RECORDING_ERROR = 1017,
502
+    /** 1018: Audio Device Module: Fails to record.
503
+     */
504
+    ERR_ADM_RECORD_AUDIO_FAILED = 1018,
505
+    /** 1022: Audio Device Module: An error occurs in initializing the loopback device.
506
+     */
507
+    ERR_ADM_INIT_LOOPBACK = 1022,
508
+    /** 1023: Audio Device Module: An error occurs in starting the loopback device.
509
+     */
510
+    ERR_ADM_START_LOOPBACK = 1023,
511
+    /** 1027: Audio Device Module: No recording permission exists. Check if the recording permission is granted.
512
+     */
513
+    ERR_ADM_NO_PERMISSION = 1027,
514
+    ERR_ADM_RECORD_AUDIO_IS_ACTIVE = 1033,
515
+    ERR_ADM_ANDROID_JNI_JAVA_RESOURCE = 1101,
516
+    ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY = 1108,
517
+    ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY = 1109,
518
+    ERR_ADM_ANDROID_JNI_JAVA_START_RECORD = 1111,
519
+    ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK = 1112,
520
+    ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR = 1115,
521
+    ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE = 1151,
522
+    ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER = 1153,
523
+    ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD = 1156,
524
+    ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER = 1157,
525
+    ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD = 1160,
526
+    ERR_ADM_IOS_INPUT_NOT_AVAILABLE = 1201,
527
+    ERR_ADM_IOS_ACTIVATE_SESSION_FAIL = 1206,
528
+    ERR_ADM_IOS_VPIO_INIT_FAIL = 1210,
529
+    ERR_ADM_IOS_VPIO_REINIT_FAIL = 1213,
530
+    ERR_ADM_IOS_VPIO_RESTART_FAIL = 1214,
531
+    ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL = 1219,
532
+    ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO = 1221,
533
+    ERR_ADM_WIN_CORE_INIT = 1301,
534
+    ERR_ADM_WIN_CORE_INIT_RECORDING = 1303,
535
+    ERR_ADM_WIN_CORE_INIT_PLAYOUT = 1306,
536
+    ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL = 1307,
537
+    ERR_ADM_WIN_CORE_START_RECORDING = 1309,
538
+    ERR_ADM_WIN_CORE_CREATE_REC_THREAD = 1311,
539
+    ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP = 1314,
540
+    ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD = 1319,
541
+    ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP = 1320,
542
+    ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
543
+    ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
544
+    ERR_ADM_WIN_WAVE_INIT = 1351,
545
+    ERR_ADM_WIN_WAVE_INIT_RECORDING = 1353,
546
+    ERR_ADM_WIN_WAVE_INIT_MICROPHONE = 1354,
547
+    ERR_ADM_WIN_WAVE_INIT_PLAYOUT = 1355,
548
+    ERR_ADM_WIN_WAVE_INIT_SPEAKER = 1356,
549
+    ERR_ADM_WIN_WAVE_START_RECORDING = 1357,
550
+    ERR_ADM_WIN_WAVE_START_PLAYOUT = 1358,
551
+    /** 1359: Audio Device Module: No recording device exists.
552
+     */
553
+    ERR_ADM_NO_RECORDING_DEVICE = 1359,
554
+    /** 1360: Audio Device Module: No playback device exists.
555
+     */
556
+    ERR_ADM_NO_PLAYOUT_DEVICE = 1360,
557
+
558
+    // VDM error code starts from 1500
559
+    /** 1501: Video Device Module: The camera is unauthorized.
560
+     */
561
+    ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501,
562
+
563
+    // VCM error code starts from 1600
564
+    /** 1600: Video Device Module: An unknown error occurs.
565
+     */
566
+    ERR_VCM_UNKNOWN_ERROR = 1600,
567
+    /** 1601: Video Device Module: An error occurs in initializing the video encoder.
568
+    */
569
+    ERR_VCM_ENCODER_INIT_ERROR = 1601,
570
+    /** 1602: Video Device Module: An error occurs in encoding.
571
+     */
572
+    ERR_VCM_ENCODER_ENCODE_ERROR = 1602,
573
+    /** 1603: Video Device Module: An error occurs in setting the video encoder.
574
+     */
575
+    ERR_VCM_ENCODER_SET_ERROR = 1603,
576
+};
577
+
578
+    /** Output log filter level. */
579
+enum LOG_FILTER_TYPE
580
+{
581
+/** 0: Do not output any log information. */
582
+    LOG_FILTER_OFF = 0,
583
+     /** 0x080f: Output all log information. */
584
+    LOG_FILTER_DEBUG = 0x080f,
585
+     /** 0x000f: Output CRITICAL, ERROR, WARNING, and INFO level log information. */
586
+    LOG_FILTER_INFO = 0x000f,
587
+     /** 0x000e: Outputs CRITICAL, ERROR, and WARNING level log information. */
588
+    LOG_FILTER_WARN = 0x000e,
589
+     /** 0x000c: Outputs CRITICAL and ERROR level log information. */
590
+    LOG_FILTER_ERROR = 0x000c,
591
+     /** 0x0008: Outputs CRITICAL level log information. */
592
+    LOG_FILTER_CRITICAL = 0x0008,
593
+    LOG_FILTER_MASK = 0x80f,
594
+};
595
+} // namespace agora
596
+
597
+#endif

+ 91
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraConstants.h Прегледај датотеку

@@ -0,0 +1,91 @@
1
+//
2
+//  AgoraConstants.h
3
+//  AgoraRtcEngineKit
4
+//
5
+//  Copyright (c) 2018 Agora. All rights reserved.
6
+//
7
+#import <Foundation/Foundation.h>
8
+#if TARGET_OS_IPHONE
9
+#import <UIKit/UIKit.h>
10
+#elif TARGET_OS_MAC
11
+#import <AppKit/AppKit.h>
12
+#endif
13
+
14
+/** The standard bitrate set in [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]).
15
+
16
+(Recommended) The standard bitrate mode. In this mode, the bitrate under the live broadcast and communication profiles differs:
17
+
18
+    - Communication profile: The video bitrate is the same as the base bitrate.
19
+    - Live broadcast profile: The video bitrate is twice the base bitrate.
20
+ */
21
+extern NSInteger const AgoraVideoBitrateStandard;
22
+
23
+/** The compatible bitrate set in [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]).
24
+
25
+The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the channel profile. In a live broadcast channel, if you choose this mode, the video frame rate may be lower than the set value.
26
+ */
27
+extern NSInteger const AgoraVideoBitrateCompatible;
28
+
29
+/** Use default minimum bitrate.
30
+ */
31
+extern NSInteger const AgoraVideoBitrateDefaultMin;
32
+
33
+/** 120 &times; 120
34
+ */
35
+extern CGSize const AgoraVideoDimension120x120;
36
+/** 160 &times; 120
37
+ */
38
+extern CGSize const AgoraVideoDimension160x120;
39
+/** 180 &times; 180
40
+ */
41
+extern CGSize const AgoraVideoDimension180x180;
42
+/** 240 &times; 180
43
+ */
44
+extern CGSize const AgoraVideoDimension240x180;
45
+/** 320 &times; 180
46
+ */
47
+extern CGSize const AgoraVideoDimension320x180;
48
+/** 240 &times; 240
49
+ */
50
+extern CGSize const AgoraVideoDimension240x240;
51
+/** 320 &times; 240
52
+ */
53
+extern CGSize const AgoraVideoDimension320x240;
54
+/** 424 &times; 240
55
+ */
56
+extern CGSize const AgoraVideoDimension424x240;
57
+/** 360 &times; 360
58
+ */
59
+extern CGSize const AgoraVideoDimension360x360;
60
+/** 480 &times; 360
61
+ */
62
+extern CGSize const AgoraVideoDimension480x360;
63
+/** 640 &times; 360
64
+ */
65
+extern CGSize const AgoraVideoDimension640x360;
66
+/** 480 &times; 480
67
+ */
68
+extern CGSize const AgoraVideoDimension480x480;
69
+/** 640 &times; 480
70
+ */
71
+extern CGSize const AgoraVideoDimension640x480;
72
+/** 840 &times; 480
73
+ */
74
+extern CGSize const AgoraVideoDimension840x480;
75
+/** 960 &times; 720 (Depends on the hardware)
76
+ */
77
+extern CGSize const AgoraVideoDimension960x720;
78
+/** 1280 &times; 720 (Depends on the hardware)
79
+ */
80
+extern CGSize const AgoraVideoDimension1280x720;
81
+#if TARGET_OS_MAC
82
+/** 1920 &times; 1080 (Depends on the hardware, macOS only)
83
+ */
84
+extern CGSize const AgoraVideoDimension1920x1080;
85
+/** 25400 &times; 1440 (Depends on the hardware, macOS only)
86
+ */
87
+extern CGSize const AgoraVideoDimension2540x1440;
88
+/** 3840 &times; 2160 (Depends on the hardware, macOS only)
89
+ */
90
+extern CGSize const AgoraVideoDimension3840x2160;
91
+#endif

+ 833
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraEnumerates.h Прегледај датотеку

@@ -0,0 +1,833 @@
1
+//
2
+// AgoraEnumerates.h
3
+// AgoraRtcEngineKit
4
+//
5
+// Copyright (c) 2018 Agora. All rights reserved.
6
+//
7
+
8
+#import <Foundation/Foundation.h>
9
+
10
+/** Warning code.
11
+
12
+Warning codes occur when the SDK encounters an error that may be recovered automatically. These are only notifications, and can generally be ignored. For example, when the SDK loses connection to the server, the SDK reports the AgoraWarningCodeOpenChannelTimeout(106) code and tries to reconnect automatically.
13
+*/
14
+typedef NS_ENUM(NSInteger, AgoraWarningCode) {
15
+    /** 8: The specified view is invalid. Specify a view when using the video call function. */
16
+    AgoraWarningCodeInvalidView = 8,
17
+    /** 16: Failed to initialize the video function, possibly caused by a lack of resources. The users cannot see the video while the voice communication is not affected. */
18
+    AgoraWarningCodeInitVideo = 16,
19
+     /** 20: The request is pending, usually due to some module not being ready, and the SDK postpones processing the request. */
20
+    AgoraWarningCodePending = 20,
21
+    /** 103: No channel resources are available. Maybe because the server cannot allocate any channel resource. */
22
+    AgoraWarningCodeNoAvailableChannel = 103,
23
+    /** 104: A timeout occurs when looking up the channel. When joining a channel, the SDK looks up the specified channel. The warning usually occurs when the network condition is too poor to connect to the server. */
24
+    AgoraWarningCodeLookupChannelTimeout = 104,
25
+    /** 105: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. */
26
+    AgoraWarningCodeLookupChannelRejected = 105,
27
+    /** 106: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. */
28
+    AgoraWarningCodeOpenChannelTimeout = 106,
29
+    /** 107: The server rejects the request to open the channel. The server cannot process this request or the request is illegal. */
30
+    AgoraWarningCodeOpenChannelRejected = 107,
31
+    /** 111: A timeout occurs when switching to the live video. */
32
+    AgoraWarningCodeSwitchLiveVideoTimeout = 111,
33
+    /** 118: A timeout occurs when setting the client role in the live broadcast profile. */
34
+    AgoraWarningCodeSetClientRoleTimeout = 118,
35
+    /** 119: The client role is unauthorized. */
36
+    AgoraWarningCodeSetClientRoleNotAuthorized = 119,
37
+    /** 121: The ticket to open the channel is invalid. */
38
+    AgoraWarningCodeOpenChannelInvalidTicket = 121,
39
+    /** 122: Try connecting to another server. */
40
+    AgoraWarningCodeOpenChannelTryNextVos = 122,
41
+    /** 701: An error occurs in opening the audio mixing file. */
42
+    AgoraWarningCodeAudioMixingOpenError = 701,
43
+    /** 1014: Audio Device Module: A warning occurs in the playback device. */
44
+    AgoraWarningCodeAdmRuntimePlayoutWarning = 1014,
45
+    /** 1016: Audio Device Module: A warning occurs in the recording device. */
46
+    AgoraWarningCodeAdmRuntimeRecordingWarning = 1016,
47
+    /** 1019: Audio Device Module: No valid audio data is collected. */
48
+    AgoraWarningCodeAdmRecordAudioSilence = 1019,
49
+    /** 1020: Audio Device Module: A playback device fails. */
50
+    AgoraWarningCodeAdmPlaybackMalfunction = 1020,
51
+    /** 1021: Audio Device Module: A recording device fails. */
52
+    AgoraWarningCodeAdmRecordMalfunction = 1021,
53
+    /** 1025: The system interrupts the audio session, and the session is no longer active. */
54
+    AgoraWarningCodeAdmInterruption = 1025,
55
+    /** 1031: Audio Device Module: The recorded audio voice is too low. */
56
+    AgoraWarningCodeAdmRecordAudioLowlevel = 1031,
57
+    /** 1032: Audio Device Module: The playback audio voice is too low. */
58
+    AgoraWarningCodeAdmPlayoutAudioLowlevel = 1032,
59
+    /** 1051: Audio Device Module: Howling is detected. */
60
+    AgoraWarningCodeApmHowling = 1051,
61
+    /** 1052: Audio Device Module: The device is in the glitch state. */
62
+    AgoraWarningCodeAdmGlitchState = 1052,
63
+    /** 1053: Audio Device Module: The underlying audio settings have changed. */
64
+    AgoraWarningCodeAdmImproperSettings = 1053,
65
+};
66
+
67
+/** Error code.
68
+
69
+Error codes occur when the SDK encounters an error that cannot be recovered automatically without any app intervention. For example, the SDK reports the AgoraErrorCodeStartCall = 1002 error if it fails to start a call, and reminds the user to call the [leaveChannel]([AgoraRtcEngineKit leaveChannel:]) method.
70
+*/
71
+typedef NS_ENUM(NSInteger, AgoraErrorCode) {
72
+    /** 0: No error occurs. */
73
+    AgoraErrorCodeNoError = 0,
74
+    /** 1: A general error occurs (no specified reason). */
75
+    AgoraErrorCodeFailed = 1,
76
+    /** 2: An invalid parameter is used. For example, the specific channel name includes illegal characters. */
77
+    AgoraErrorCodeInvalidArgument = 2,
78
+    /** 3: The SDK module is not ready.
79
+     <p>Possible solutions:
80
+     <ul><li>Check the audio device.</li>
81
+     <li>Check the completeness of the app.</li>
82
+     <li>Re-initialize the SDK.</li></ul></p>
83
+    */
84
+    AgoraErrorCodeNotReady = 3,
85
+    /** 4: The current state of the SDK does not support this function. */
86
+    AgoraErrorCodeNotSupported = 4,
87
+    /** 5: The request is rejected. This is for internal SDK use only, and is not returned to the app through any method or callback. */
88
+    AgoraErrorCodeRefused = 5,
89
+    /** 6: The buffer size is not big enough to store the returned data. */
90
+    AgoraErrorCodeBufferTooSmall = 6,
91
+    /** 7: The SDK is not initialized before calling this method. */
92
+    AgoraErrorCodeNotInitialized = 7,
93
+    /** 9: No permission exists. This is for internal SDK use only, and is not returned to the app through any method or callback. */
94
+    AgoraErrorCodeNoPermission = 9,
95
+    /** 10: An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (over 10 seconds) for the SDK to process. */
96
+    AgoraErrorCodeTimedOut = 10,
97
+    /** 11: The request is canceled. This is for internal SDK use only, and is not returned to the app through any method or callback. */
98
+    AgoraErrorCodeCanceled = 11,
99
+    /** 12: The method is called too often. This is for internal SDK use only, and is not returned to the app through any method or callback. */
100
+    AgoraErrorCodeTooOften = 12,
101
+    /** 13: The SDK fails to bind to the network socket. This is for internal SDK use only, and is not returned to the app through any method or callback. */
102
+    AgoraErrorCodeBindSocket = 13,
103
+    /** 14: The network is unavailable. This is for internal SDK use only, and is not returned to the app through any method or callback. */
104
+    AgoraErrorCodeNetDown = 14,
105
+    /** 15: No network buffers are available. This is for internal SDK use only, and is not returned to the app through any method or callback. */
106
+    AgoraErrorCodeNoBufs = 15,
107
+    /** 17: The request to join the channel is rejected.
108
+     <p>The possible reasons are:
109
+     <ul><li>The user is already in the channel, and still calls the API method to join the channel, for example, [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]).</li>
110
+     <li>The user tries joining the channel during the echo test. Please join the channel after the echo test.</li></ul></p>
111
+    */
112
+    AgoraErrorCodeJoinChannelRejected = 17,
113
+    /** 18: The request to leave the channel is rejected.
114
+     <p>The possible reasons are:
115
+     <ul><li>The user left the channel and still calls the API method to leave the channel, for example, [leaveChannel]([AgoraRtcEngineKit leaveChannel:]).</li>
116
+     <li>The user has not joined the channel and calls the API method to leave the channel.</li></ul></p>
117
+    */
118
+    AgoraErrorCodeLeaveChannelRejected = 18,
119
+    /** 19: The resources are occupied and cannot be used. */
120
+    AgoraErrorCodeAlreadyInUse = 19,
121
+    /** 20: The SDK gave up the request due to too many requests.  */
122
+    AgoraErrorCodeAbort = 20,
123
+    /** 21: In Windows, specific firewall settings can cause the SDK to fail to initialize and crash. */
124
+    AgoraErrorCodeInitNetEngine = 21,
125
+    /** 22: The app uses too much of the system resources and the SDK fails to allocate the resources. */
126
+    AgoraErrorCodeResourceLimited = 22,
127
+    /** 101: The specified App ID is invalid. Please try to rejoin the channel with a valid App ID.*/
128
+    AgoraErrorCodeInvalidAppId = 101,
129
+    /** 102: The specified channel name is invalid. Please try to rejoin the channel with a valid channel name. */
130
+    AgoraErrorCodeInvalidChannelId = 102,
131
+    /** 109: The token expired.
132
+     <p>The possible reasons are:
133
+     <ul><li>Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the token to access the Agora service within five minutes after the token is generated. If the user does not access the Agora service after five minutes, this token is no longer valid.</li>
134
+     <li>Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel.</li></ul></p>
135
+     */
136
+    AgoraErrorCodeTokenExpired = 109,
137
+    /** 110: The token is invalid.
138
+     <p>The possible reasons are:
139
+     <ul><li>The App Certificate for the project is enabled in Dashboard, but the user is  using the App ID. Once the App Certificate is enabled, the user must use a token.</li>
140
+     <li>The uid is mandatory, and users must set the same uid as the one set in the [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) method.</li></ul></p>
141
+     */
142
+    AgoraErrorCodeInvalidToken = 110,
143
+    /** 111: The Internet connection is interrupted. This applies to the Agora Web SDK only. */
144
+    AgoraErrorCodeConnectionInterrupted = 111,
145
+    /** 112: The Internet connection is lost. This applies to the Agora Web SDK only. */
146
+    AgoraErrorCodeConnectionLost = 112,
147
+    /** 113: The user is not in the channel when calling the [sendStreamMessage]([AgoraRtcEngineKit sendStreamMessage:data:]) method. */
148
+    AgoraErrorCodeNotInChannel = 113,
149
+    /** 114: The size of the sent data is over 1024 bytes when the user calls the [sendStreamMessage]([AgoraRtcEngineKit sendStreamMessage:data:]) method. */
150
+    AgoraErrorCodeSizeTooLarge = 114,
151
+    /** 115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the [sendStreamMessage]([AgoraRtcEngineKit sendStreamMessage:data:]) method. */
152
+    AgoraErrorCodeBitrateLimit = 115,
153
+    /** 116: Too many data streams (over five streams) are created when the user calls the [createDataStream]([AgoraRtcEngineKit createDataStream:reliable:ordered:]) method. */
154
+    AgoraErrorCodeTooManyDataStreams = 116,
155
+    /** 120: Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel. */
156
+    AgoraErrorCodeDecryptionFailed = 120,
157
+    /** 124: An error occurs in the watermark file parameter. */
158
+    AgoraErrorCodeWatermarkParam = 124,
159
+    /** 125: An error occurs in the watermark file path. */
160
+    AgoraErrorCodeWatermarkPath = 125,
161
+    /** 126: An error occurs in the watermark file format. */
162
+    AgoraErrorCodeWatermarkPng = 126,
163
+    /** 127: An error occurs in the watermark file information. */
164
+    AgoraErrorCodeWatermarkInfo = 127,
165
+    /** 128: An error occurs in the watermark file data format. */
166
+    AgoraErrorCodeWatermarkAGRB = 128,
167
+    /** 129: An error occurs in reading the watermark file. */
168
+    AgoraErrorCodeWatermarkRead = 129,
169
+    /** 130: The encrypted stream is not allowed to publish. */
170
+    AgoraErrorCodeEncryptedStreamNotAllowedPublish = 130,
171
+    /** 150: Stream publishing fails. */
172
+    AgoraErrorCodePublishFailed = 150,
173
+    /** 1001: Fails to load the media engine. */
174
+    AgoraErrorCodeLoadMediaEngine = 1001,
175
+    /** 1002: Fails to start the call after enabling the media engine. */
176
+    AgoraErrorCodeStartCall = 1002,
177
+    /** 1003: Fails to start the camera. */
178
+    AgoraErrorCodeStartCamera = 1003,
179
+    /** 1004: Fails to start the video rendering module. */
180
+    AgoraErrorCodeStartVideoRender = 1004,
181
+    /** 1005: A general error occurs in the Audio Device Module (the reason is not classified specifically). Check if the audio device is used by another app, or try rejoining the channel. */
182
+    AgoraErrorCodeAdmGeneralError = 1005,
183
+    /** 1006: Audio Device Module: An error occurs in using the Java resources. */
184
+    AgoraErrorCodeAdmJavaResource = 1006,
185
+    /** 1007: Audio Device Module: An error occurs in setting the sampling frequency. */
186
+    AgoraErrorCodeAdmSampleRate = 1007,
187
+    /** 1008: Audio Device Module: An error occurs in initializing the playback device. */
188
+    AgoraErrorCodeAdmInitPlayout = 1008,
189
+    /** 1009: Audio Device Module: An error occurs in starting the playback device. */
190
+    AgoraErrorCodeAdmStartPlayout = 1009,
191
+    /** 1010: Audio Device Module: An error occurs in stopping the playback device. */
192
+    AgoraErrorCodeAdmStopPlayout = 1010,
193
+    /** 1011: Audio Device Module: An error occurs in initializing the recording device. */
194
+    AgoraErrorCodeAdmInitRecording = 1011,
195
+    /** 1012: Audio Device Module: An error occurs in starting the recording device. */
196
+    AgoraErrorCodeAdmStartRecording = 1012,
197
+    /** 1013: Audio Device Module: An error occurs in stopping the recording device. */
198
+    AgoraErrorCodeAdmStopRecording = 1013,
199
+    /** 1015: Audio Device Module: A playback error occurs. Check your playback device, or try rejoining the channel. */
200
+    AgoraErrorCodeAdmRuntimePlayoutError = 1015,
201
+    /** 1017: Audio Device Module: A recording error occurs. */
202
+    AgoraErrorCodeAdmRuntimeRecordingError = 1017,
203
+    /** 1018: Audio Device Module: Fails to record. */
204
+    AgoraErrorCodeAdmRecordAudioFailed = 1018,
205
+    /** 1020: Audio Device Module: Abnormal audio playback frequency. */
206
+    AgoraErrorCodeAdmPlayAbnormalFrequency = 1020,
207
+    /** 1021: Audio Device Module: Abnormal audio recording frequency. */
208
+    AgoraErrorCodeAdmRecordAbnormalFrequency = 1021,
209
+    /** 1022: Audio Device Module: An error occurs in initializing the loopback device. */
210
+    AgoraErrorCodeAdmInitLoopback  = 1022,
211
+    /** 1023: Audio Device Module: An error occurs in starting the loopback device. */
212
+    AgoraErrorCodeAdmStartLoopback = 1023,
213
+    /** 1359: No recording device exists. */
214
+    AgoraErrorCodeAdmNoRecordingDevice = 1359,
215
+    /** 1360: No playback device exists. */
216
+    AgoraErrorCodeAdmNoPlayoutDevice = 1360,
217
+    /** 1501: Video Device Module: The camera is unauthorized. */
218
+    AgoraErrorCodeVdmCameraNotAuthorized = 1501,
219
+    /** 1600: Video Device Module: An unknown error occurs. */
220
+    AgoraErrorCodeVcmUnknownError = 1600,
221
+    /** 1601: Video Device Module: An error occurs in initializing the video encoder. */
222
+    AgoraErrorCodeVcmEncoderInitError = 1601,
223
+    /** 1602: Video Device Module: An error occurs in video encoding. */
224
+    AgoraErrorCodeVcmEncoderEncodeError = 1602,
225
+    /** 1603: Video Device Module: An error occurs in setting the video encoder.
226
+    <p><b>DEPRECATED</b></p>
227
+    */
228
+    AgoraErrorCodeVcmEncoderSetError = 1603,
229
+};
230
+
231
+/** Video profile.
232
+
233
+**DEPRECATED**
234
+
235
+Please use AgoraVideoEncoderConfiguration.
236
+
237
+iPhone does not support resolutions above 720p.
238
+*/
239
+typedef NS_ENUM(NSInteger, AgoraVideoProfile) {
240
+    /** Invalid profile. */
241
+    AgoraVideoProfileInvalid = -1,
242
+    /** Resolution 160 &times; 120, frame rate 15 fps, bitrate 65 Kbps. */
243
+    AgoraVideoProfileLandscape120P = 0,
244
+    /** Resolution 120 &times; 120, frame rate 15 fps, bitrate 50 Kbps. */
245
+    AgoraVideoProfileLandscape120P_3 = 2, // iOS
246
+    /** Resolution 320 &times; 180, frame rate 15 fps, bitrate 140 Kbps. */
247
+    AgoraVideoProfileLandscape180P = 10, // iOS
248
+    /** Resolution 180 &times; 180, frame rate 15 fps, bitrate 100 Kbps. */
249
+    AgoraVideoProfileLandscape180P_3 = 12, // iOS
250
+    /** Resolution 240 &times; 180, frame rate 15 fps, bitrate 120 Kbps. */
251
+    AgoraVideoProfileLandscape180P_4 = 13, // iOS
252
+    /** Resolution 320 &times; 240, frame rate 15 fps, bitrate 200 Kbps. */
253
+    AgoraVideoProfileLandscape240P = 20,
254
+    /** Resolution 240 &times; 240, frame rate 15 fps, bitrate 140 Kbps. */
255
+    AgoraVideoProfileLandscape240P_3 = 22, //iOS
256
+    /** Resolution 424 &times; 240, frame rate 15 fps, bitrate 220 Kbps. */
257
+    AgoraVideoProfileLandscape240P_4 = 23, // iOS
258
+    /** Resolution 640 &times; 360, frame rate 15 fps, bitrate 400 Kbps. */
259
+    AgoraVideoProfileLandscape360P = 30,
260
+    /** Resolution 360 &times; 360, frame rate 15 fps, bitrate 260 Kbps. */
261
+    AgoraVideoProfileLandscape360P_3 = 32, // iOS
262
+    /** Resolution 640 &times; 360, frame rate 30 fps, bitrate 600 Kbps. */
263
+    AgoraVideoProfileLandscape360P_4 = 33,
264
+    /** Resolution 360 &times; 360, frame rate 30 fps, bitrate 400 Kbps. */
265
+    AgoraVideoProfileLandscape360P_6 = 35,
266
+    /** Resolution 480 &times; 360, frame rate 15 fps, bitrate 320 Kbps. */
267
+    AgoraVideoProfileLandscape360P_7 = 36,
268
+    /** Resolution 480 &times; 360, frame rate 30 fps, bitrate 490 Kbps. */
269
+    AgoraVideoProfileLandscape360P_8 = 37,
270
+    /** Resolution 640 &times; 360, frame rate 15 fps, bitrate 800 Kbps.
271
+
272
+     Note: This profile applies to the live broadcast channel profile only.
273
+     */
274
+    AgoraVideoProfileLandscape360P_9 = 38,
275
+    /** Resolution 640 &times; 360, frame rate 24 fps, bitrate 800 Kbps.
276
+
277
+     Note: This profile applies to the live broadcast channel profile only.
278
+     */
279
+    AgoraVideoProfileLandscape360P_10 = 39,
280
+    /** Resolution 640 &times; 360, frame rate 24 fps, bitrate 1000 Kbps.
281
+
282
+     Note: This profile applies to the live broadcast channel profile only.
283
+     */
284
+    AgoraVideoProfileLandscape360P_11 = 100,
285
+    /** Resolution 640 &times; 480, frame rate 15 fps, bitrate 500 Kbps. */
286
+    AgoraVideoProfileLandscape480P = 40,
287
+    /** Resolution 480 &times; 480, frame rate 15 fps, bitrate 400 Kbps. */
288
+    AgoraVideoProfileLandscape480P_3 = 42, // iOS
289
+    /** Resolution 640 &times; 480, frame rate 30 fps, bitrate 750 Kbps. */
290
+    AgoraVideoProfileLandscape480P_4 = 43,
291
+    /** Resolution 480 &times; 480, frame rate 30 fps, bitrate 600 Kbps. */
292
+    AgoraVideoProfileLandscape480P_6 = 45,
293
+    /** Resolution 848 &times; 480, frame rate 15 fps, bitrate 610 Kbps. */
294
+    AgoraVideoProfileLandscape480P_8 = 47,
295
+    /** Resolution 848 &times; 480, frame rate 30 fps, bitrate 930 Kbps. */
296
+    AgoraVideoProfileLandscape480P_9 = 48,
297
+    /** Resolution 640 &times; 480, frame rate 10 fps, bitrate 400 Kbps. */
298
+    AgoraVideoProfileLandscape480P_10 = 49,
299
+    /** Resolution 1280 &times; 720, frame rate 15 fps, bitrate 1130 Kbps. */
300
+    AgoraVideoProfileLandscape720P = 50,
301
+    /** Resolution 1280 &times; 720, frame rate 30 fps, bitrate 1710 Kbps. */
302
+    AgoraVideoProfileLandscape720P_3 = 52,
303
+    /** Resolution 960 &times; 720, frame rate 15 fps, bitrate 910 Kbps. */
304
+    AgoraVideoProfileLandscape720P_5 = 54,
305
+    /** Resolution 960 &times; 720, frame rate 30 fps, bitrate 1380 Kbps. */
306
+    AgoraVideoProfileLandscape720P_6 = 55,
307
+    /** Resolution 1920 &times; 1080, frame rate 15 fps, bitrate 2080 Kbps. */
308
+    AgoraVideoProfileLandscape1080P = 60,
309
+    /** Resolution 1920 &times; 1080, frame rate 30 fps, bitrate 3150 Kbps. */
310
+    AgoraVideoProfileLandscape1080P_3 = 62,
311
+    /** Resolution 1920 &times; 1080, frame rate 60 fps, bitrate 4780 Kbps. */
312
+    AgoraVideoProfileLandscape1080P_5 = 64,
313
+    /** Resolution 2560 &times; 1440, frame rate 30 fps, bitrate 4850 Kbps. */
314
+    AgoraVideoProfileLandscape1440P = 66,
315
+    /** Resolution 2560 &times; 1440, frame rate 60 fps, bitrate 6500 Kbps. */
316
+    AgoraVideoProfileLandscape1440P_2 = 67,
317
+    /** Resolution 3840 &times; 2160, frame rate 30 fps, bitrate 6500 Kbps. */
318
+    AgoraVideoProfileLandscape4K = 70,
319
+    /** Resolution 3840 &times; 2160, frame rate 60 fps, bitrate 6500 Kbps. */
320
+    AgoraVideoProfileLandscape4K_3 = 72,
321
+
322
+    /** Resolution 120 &times; 160, frame rate 15 fps, bitrate 65 Kbps. */
323
+    AgoraVideoProfilePortrait120P = 1000,
324
+    /** Resolution 120 &times; 120, frame rate 15 fps, bitrate 50 Kbps. */
325
+    AgoraVideoProfilePortrait120P_3 = 1002, //iOS
326
+    /** Resolution 180 &times; 320, frame rate 15 fps, bitrate 140 Kbps. */
327
+    AgoraVideoProfilePortrait180P = 1010, // iOS
328
+    /** Resolution 180 &times; 180, frame rate 15 fps, bitrate 100 Kbps. */
329
+    AgoraVideoProfilePortrait180P_3 = 1012, // iOS
330
+    /** Resolution 180 &times; 240, frame rate 15 fps, bitrate 120 Kbps. */
331
+    AgoraVideoProfilePortrait180P_4 = 1013, // iOS
332
+    /** Resolution 240 &times; 320, frame rate 15 fps, bitrate 200 Kbps. */
333
+    AgoraVideoProfilePortrait240P = 1020,
334
+    /** Resolution 240 &times; 240, frame rate 15 fps, bitrate 140 Kbps. */
335
+    AgoraVideoProfilePortrait240P_3 = 1022, // iOS
336
+    /** Resolution 240 &times; 424, frame rate 15 fps, bitrate 220 Kbps. */
337
+    AgoraVideoProfilePortrait240P_4 = 1023,
338
+    /** Resolution 360 &times; 640, frame rate 15 fps, bitrate 400 Kbps. */
339
+    AgoraVideoProfilePortrait360P = 1030, // iOS
340
+    /** Resolution 360 &times; 360, frame rate 15 fps, bitrate 260 Kbps. */
341
+    AgoraVideoProfilePortrait360P_3 = 1032, // iOS
342
+    /** Resolution 360 &times; 640, frame rate 30 fps, bitrate 600 Kbps. */
343
+    AgoraVideoProfilePortrait360P_4 = 1033,
344
+    /** Resolution 360 &times; 360, frame rate 30 fps, bitrate 400 Kbps. */
345
+    AgoraVideoProfilePortrait360P_6 = 1035,
346
+    /** Resolution 360 &times; 480, frame rate 15 fps, bitrate 320 Kbps. */
347
+    AgoraVideoProfilePortrait360P_7 = 1036,
348
+    /** Resolution 360 &times; 480, frame rate 30 fps, bitrate 490 Kbps. */
349
+    AgoraVideoProfilePortrait360P_8 = 1037,
350
+    /** Resolution 360 &times; 640, frame rate 15 fps, bitrate 600 Kbps. */
351
+    AgoraVideoProfilePortrait360P_9 = 1038,
352
+    /** Resolution 360 &times; 640, frame rate 24 fps, bitrate 800 Kbps. */
353
+    AgoraVideoProfilePortrait360P_10 = 1039,
354
+    /** Resolution 360 &times; 640, frame rate 24 fps, bitrate 800 Kbps. */
355
+    AgoraVideoProfilePortrait360P_11 = 1100,
356
+    /** Resolution 480 &times; 640, frame rate 15 fps, bitrate 500 Kbps. */
357
+    AgoraVideoProfilePortrait480P = 1040,
358
+    /** Resolution 480 &times; 480, frame rate 15 fps, bitrate 400 Kbps. */
359
+    AgoraVideoProfilePortrait480P_3 = 1042,    // iOS
360
+    /** Resolution 480 &times; 640, frame rate 30 fps, bitrate 750 Kbps. */
361
+    AgoraVideoProfilePortrait480P_4 = 1043,
362
+    /** Resolution 480 &times; 480, frame rate 30 fps, bitrate 600 Kbps. */
363
+    AgoraVideoProfilePortrait480P_6 = 1045,
364
+    /** Resolution 480 &times; 848, frame rate 15 fps, bitrate 610 Kbps. */
365
+    AgoraVideoProfilePortrait480P_8 = 1047,
366
+    /** Resolution 480 &times; 848, frame rate 30 fps, bitrate 930 Kbps. */
367
+    AgoraVideoProfilePortrait480P_9 = 1048,
368
+    /** Resolution 480 &times; 640, frame rate 10 fps, bitrate 400 Kbps. */
369
+    AgoraVideoProfilePortrait480P_10 = 1049,
370
+    /** Resolution 720 &times; 1280, frame rate 15 fps, bitrate 1130 Kbps. */
371
+    AgoraVideoProfilePortrait720P = 1050,
372
+    /** Resolution 720 &times; 1280, frame rate 30 fps, bitrate 1710 Kbps. */
373
+    AgoraVideoProfilePortrait720P_3 = 1052,
374
+    /** Resolution 720 &times; 960, frame rate 15 fps, bitrate 910 Kbps. */
375
+    AgoraVideoProfilePortrait720P_5 = 1054,
376
+    /** Resolution 720 &times; 960, frame rate 30 fps, bitrate 1380 Kbps. */
377
+    AgoraVideoProfilePortrait720P_6 = 1055,
378
+    /** Resolution 1080 &times; 1920, frame rate 15 fps, bitrate 2080 Kbps. */
379
+    AgoraVideoProfilePortrait1080P = 1060, // macOS
380
+    /** Resolution 1080 &times; 1920, frame rate 30 fps, bitrate 3150 Kbps. */
381
+    AgoraVideoProfilePortrait1080P_3 = 1062, // macOS
382
+    /** Resolution 1080 &times; 1920, frame rate 60 fps, bitrate 4780 Kbps. */
383
+    AgoraVideoProfilePortrait1080P_5 = 1064, // macOS
384
+    /** Resolution 1440 &times; 2560, frame rate 30 fps, bitrate 4850 Kbps. */
385
+    AgoraVideoProfilePortrait1440P = 1066, // macOS
386
+    /** Resolution 1440 &times; 2560, frame rate 60 fps, bitrate 6500 Kbps. */
387
+    AgoraVideoProfilePortrait1440P_2 = 1067, // macOS
388
+    /** Resolution 2160 &times; 3840, frame rate 30 fps, bitrate 6500 Kbps. */
389
+    AgoraVideoProfilePortrait4K = 1070, // macOS
390
+    /** Resolution 2160 &times; 3840, frame rate 60 fps, bitrate 6500 Kbps. */
391
+    AgoraVideoProfilePortrait4K_3 = 1072, // macOS
392
+    /** (Default) Resolution 640 &times; 360, frame rate 15 fps, bitrate 400 Kbps. */
393
+    AgoraVideoProfileDEFAULT = AgoraVideoProfileLandscape360P,
394
+};
395
+
396
+/** Frame rate of the video. */
397
+typedef NS_ENUM(NSInteger, AgoraVideoFrameRate) {
398
+    /** 1 fps. */
399
+    AgoraVideoFrameRateFps1 = 1,
400
+    /** 7 fps. */
401
+    AgoraVideoFrameRateFps7 = 7,
402
+    /** 10 fps. */
403
+    AgoraVideoFrameRateFps10 = 10,
404
+    /** 15 fps. */
405
+    AgoraVideoFrameRateFps15 = 15,
406
+    /** 24 fps. */
407
+    AgoraVideoFrameRateFps24 = 24,
408
+    /** 30 fps. */
409
+    AgoraVideoFrameRateFps30 = 30,
410
+    /** 60 fps. */
411
+    AgoraVideoFrameRateFps60 = 60,
412
+};
413
+
414
+/** Video output orientation mode.
415
+
416
+  **Note:** When a custom video source is used, if you set AgoraVideoOutputOrientationMode as AgoraVideoOutputOrientationModeFixedLandscape(1) or AgoraVideoOutputOrientationModeFixedPortrait(2), when the rotated video image has a different orientation than the specified output orientation, the video encoder first crops it and then encodes it.
417
+ */
418
+typedef NS_ENUM(NSInteger, AgoraVideoOutputOrientationMode) {
419
+    /** Adaptive mode (Default).
420
+     <p>The video encoder adapts to the orientation mode of the video input device. When you use a custom video source, the output video from the encoder inherits the orientation of the original video.
421
+     <ul><li>If the width of the captured video from the SDK is greater than the height, the encoder sends the video in landscape mode. The encoder also sends the rotational information of the video, and the receiver uses the rotational information to rotate the received video.</li>
422
+     <li>If the original video is in portrait mode, the output video from the encoder is also in portrait mode. The encoder also sends the rotational information of the video to the receiver.</li></ul></p>
423
+     */
424
+    AgoraVideoOutputOrientationModeAdaptative = 0,
425
+    /** Landscape mode.
426
+     <p>The video encoder always sends the video in landscape mode. The video encoder rotates the original video before sending it and the rotational information is 0. This mode applies to scenarios involving CDN live streaming.</p>
427
+     */
428
+    AgoraVideoOutputOrientationModeFixedLandscape = 1,
429
+     /** Portrait mode.
430
+      <p>The video encoder always sends the video in portrait mode. The video encoder rotates the original video before sending it and the rotational information is 0. This mode applies to scenarios involving CDN live streaming.</p>
431
+      */
432
+    AgoraVideoOutputOrientationModeFixedPortrait = 2,
433
+};
434
+
435
+/** Channel profile. */
436
+typedef NS_ENUM(NSInteger, AgoraChannelProfile) {
437
+    /** Communication (default).
438
+     <p>This is used in one-on-one or group calls, where all users in the channel can talk freely.</p>
439
+     */
440
+    AgoraChannelProfileCommunication = 0,
441
+    /** Live Broadcast.
442
+     <p>Host and audience roles that can be set by calling the [setClientRole]([AgoraRtcEngineKit setClientRole:]) method. The host sends and receives voice/video, while the audience can only receive voice/video.</p>
443
+     */
444
+    AgoraChannelProfileLiveBroadcasting = 1,
445
+    /** Gaming.
446
+     <p>This mode is for the Agora Gaming SDK only.</p>
447
+     <p>Any user in the channel can talk freely. This mode uses the codec with low-power consumption and low bitrate by default. </p>
448
+     */
449
+    AgoraChannelProfileGame = 2,
450
+};
451
+
452
+/** Client role in a live broadcast. */
453
+typedef NS_ENUM(NSInteger, AgoraClientRole) {
454
+    /** Host. */
455
+    AgoraClientRoleBroadcaster = 1,
456
+    /** Audience. */
457
+    AgoraClientRoleAudience = 2,
458
+};
459
+
460
+
461
+/** Media type. */
462
+typedef NS_ENUM(NSInteger, AgoraMediaType) {
463
+    /** No audio and video. */
464
+    AgoraMediaTypeNone = 0,
465
+    /** Audio only. */
466
+    AgoraMediaTypeAudioOnly = 1,
467
+    /** Video only. */
468
+    AgoraMediaTypeVideoOnly = 2,
469
+    /** Audio and video. */
470
+    AgoraMediaTypeAudioAndVideo = 3,
471
+};
472
+
473
+
474
+/** Encryption mode.
475
+
476
+When encryptionMode is set as NULL, the encryption mode is set to 128-bit AES encryption, XTS mode by default.
477
+*/
478
+typedef NS_ENUM(NSInteger, AgoraEncryptionMode) {
479
+    AgoraEncryptionModeNone = 0,
480
+    /** 128-bit AES encryption, XTS mode. */
481
+    AgoraEncryptionModeAES128XTS = 1,
482
+    /** 256-bit AES encryption, XTS mode. */
483
+    AgoraEncryptionModeAES256XTS = 2,
484
+    /** 128-bit AES encryption, ECB mode. */
485
+    AgoraEncryptionModeAES128ECB = 3,
486
+};
487
+
488
+/** Reason for the user being offline. */
489
+typedef NS_ENUM(NSUInteger, AgoraUserOfflineReason) {
490
+    /** The user left the current channel. */
491
+    AgoraUserOfflineReasonQuit = 0,
492
+    /** The SDK timed out and the user dropped offline because no data packet is received within a certain period of time. If a user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. */
493
+    AgoraUserOfflineReasonDropped = 1,
494
+    /** (Live broadcast only.) The client role switched from the host to the audience. */
495
+    AgoraUserOfflineReasonBecomeAudience = 2,
496
+};
497
+
498
+/** State of importing an external video stream in a live broadcast. */
499
+typedef NS_ENUM(NSUInteger, AgoraInjectStreamStatus) {
500
+    /** The external video stream imported successfully. */
501
+    AgoraInjectStreamStatusStartSuccess = 0,
502
+    /** The external video stream already exists. */
503
+    AgoraInjectStreamStatusStartAlreadyExists = 1,
504
+    /** The external video stream import is unauthorized. */
505
+    AgoraInjectStreamStatusStartUnauthorized = 2,
506
+    /** Import external video stream timeout. */
507
+    AgoraInjectStreamStatusStartTimedout = 3,
508
+    /** The external video stream failed to import. */
509
+    AgoraInjectStreamStatusStartFailed = 4,
510
+    /** The external video stream imports successfully. */
511
+    AgoraInjectStreamStatusStopSuccess = 5,
512
+    /** No external video stream is found. */
513
+    AgoraInjectStreamStatusStopNotFound = 6,
514
+    /** The external video stream is stopped from being unauthorized. */
515
+    AgoraInjectStreamStatusStopUnauthorized = 7,
516
+    /** Importing the external video stream timeout. */
517
+    AgoraInjectStreamStatusStopTimedout = 8,
518
+    /** Importing the external video stream failed. */
519
+    AgoraInjectStreamStatusStopFailed = 9,
520
+    /** The external video stream import is interrupted. */
521
+    AgoraInjectStreamStatusBroken = 10,
522
+};
523
+
524
+/** Output log filter level. */
525
+typedef NS_ENUM(NSUInteger, AgoraLogFilter) {
526
+    /** Do not output any log information. */
527
+    AgoraLogFilterOff = 0,
528
+    /** Output all log information. */
529
+    AgoraLogFilterDebug = 0x080f,
530
+    /** Output CRITICAL, ERROR, WARNING, and INFO level log information. */
531
+    AgoraLogFilterInfo = 0x000f,
532
+    /** Outputs CRITICAL, ERROR, and WARNING level log information. */
533
+    AgoraLogFilterWarning = 0x000e,
534
+    /** Outputs CRITICAL and ERROR level log information. */
535
+    AgoraLogFilterError = 0x000c,
536
+    /** Outputs CRITICAL level log information. */
537
+    AgoraLogFilterCritical = 0x0008,
538
+};
539
+
540
+/** Audio recording quality. */
541
+typedef NS_ENUM(NSInteger, AgoraAudioRecordingQuality) {
542
+   /** Low quality: The file size is around 1.2 MB after 10 minutes of recording. */
543
+    AgoraAudioRecordingQualityLow = 0,
544
+    /** Medium quality: The file size is around 2 MB after 10 minutes of recording. */
545
+    AgoraAudioRecordingQualityMedium = 1,
546
+    /** High quality: The file size is around 3.75 MB after 10 minutes of recording. */
547
+    AgoraAudioRecordingQualityHigh = 2
548
+};
549
+
550
+/** Lifecycle of the CDN live video stream.
551
+
552
+**DEPRECATED**
553
+*/
554
+typedef NS_ENUM(NSInteger, AgoraRtmpStreamLifeCycle) {
555
+    /** Bound to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds. */
556
+    AgoraRtmpStreamLifeCycleBindToChannel = 1,
557
+    /** Bound to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately. */
558
+    AgoraRtmpStreamLifeCycleBindToOwnner = 2,
559
+};
560
+
561
+/** Network quality. */
562
+typedef NS_ENUM(NSUInteger, AgoraNetworkQuality) {
563
+    /** The network quality is unknown. */
564
+    AgoraNetworkQualityUnknown = 0,
565
+    /**  The network quality is excellent. */
566
+    AgoraNetworkQualityExcellent = 1,
567
+    /** The network quality is quite good, but the bitrate may be slightly lower than excellent. */
568
+    AgoraNetworkQualityGood = 2,
569
+    /** Users can feel the communication slightly impaired. */
570
+    AgoraNetworkQualityPoor = 3,
571
+    /** Users can communicate only not very smoothly. */
572
+    AgoraNetworkQualityBad = 4,
573
+     /** The network quality is so bad that users can hardly communicate. */
574
+    AgoraNetworkQualityVBad = 5,
575
+     /** The network is disconnected and users cannot communicate at all. */
576
+    AgoraNetworkQualityDown = 6,
577
+};
578
+
579
+/** Video stream type. */
580
+typedef NS_ENUM(NSInteger, AgoraVideoStreamType) {
581
+    /** High-bitrate, high-resolution video stream. */
582
+    AgoraVideoStreamTypeHigh = 0,
583
+    /** Low-bitrate, low-resolution video stream. */
584
+    AgoraVideoStreamTypeLow = 1,
585
+};
586
+
587
+/** Video display mode. */
588
+typedef NS_ENUM(NSUInteger, AgoraVideoRenderMode) {
589
+    /** Hidden(1): Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. */
590
+    AgoraVideoRenderModeHidden = 1,
591
+
592
+    /** Fit(2): Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black. */
593
+    AgoraVideoRenderModeFit = 2,
594
+
595
+    /**
596
+     Adaptive(3):This mode is deprecated.
597
+     */
598
+    AgoraVideoRenderModeAdaptive __deprecated_enum_msg("AgoraVideoRenderModeAdaptive is deprecated.") = 3,
599
+};
600
+
601
+/** Self-defined video codec profile. */
602
+typedef NS_ENUM(NSInteger, AgoraVideoCodecProfileType) {
603
+    /** 66: Baseline video codec profile. Generally used in video calls on mobile phones. */
604
+    AgoraVideoCodecProfileTypeBaseLine = 66,
605
+    /** 77: Main video codec profile. Generally used in mainstream electronics, such as MP4 players, portable video players, PSP, and iPads. */
606
+    AgoraVideoCodecProfileTypeMain = 77,
607
+    /** 100: (Default) High video codec profile. Generally used in high-resolution broadcasts or television. */
608
+    AgoraVideoCodecProfileTypeHigh = 100
609
+};
610
+
611
+/** Video mirror mode. */
612
+typedef NS_ENUM(NSUInteger, AgoraVideoMirrorMode) {
613
+    /** The SDK determines the default mirror mode. */
614
+    AgoraVideoMirrorModeAuto = 0,
615
+    /** Enables mirror mode. */
616
+    AgoraVideoMirrorModeEnabled = 1,
617
+    /** Disables mirror mode. */
618
+    AgoraVideoMirrorModeDisabled = 2,
619
+};
620
+
621
+/** Remote video state. */
622
+typedef NS_ENUM(NSUInteger, AgoraVideoRemoteState) {
623
+    /** The remote video stopped playing. */
624
+    AgoraVideoRemoteStateStopped = 0,
625
+    /** The remote video is playing. */
626
+    AgoraVideoRemoteStateRunning = 1,
627
+    /** The remote video is frozen. */
628
+    AgoraVideoRemoteStateFrozen = 2,
629
+};
630
+
631
+/** Stream fallback option. */
632
+typedef NS_ENUM(NSInteger, AgoraStreamFallbackOptions) {
633
+    /** No fallback behavior for the local/remote stream when the uplink/downlink network condition is unreliable. The quality of the stream is not guaranteed. */
634
+    AgoraStreamFallbackOptionDisabled = 0,
635
+    /** Under unreliable downlink network conditions, the remote stream falls back to the low-video stream (low resolution and low bitrate). You can only set this option in [setRemoteSubscribeFallbackOption]([AgoraRtcEngineKit setRemoteSubscribeFallbackOption:]). Nothing happens when you set this in [setLocalPublishFallbackOption]([AgoraRtcEngineKit setLocalPublishFallbackOption:]). */
636
+    AgoraStreamFallbackOptionVideoStreamLow = 1,
637
+    /**
638
+     <li> Under unreliable uplink network conditions, the published stream falls back audio only.
639
+     <li>> Under unreliable downlink network conditions, the remote stream first falls back to the low-video stream (low resolution and low bitrate); and then to an audio-only stream if the network condition deteriorates. */
640
+    AgoraStreamFallbackOptionAudioOnly = 2,
641
+};
642
+
643
+/** Audio sampling rate. */
644
+typedef NS_ENUM(NSInteger, AgoraAudioSampleRateType) {
645
+    /** 32 kHz. */
646
+    AgoraAudioSampleRateType32000 = 32000,
647
+    /** 44.1 kHz. */
648
+    AgoraAudioSampleRateType44100 = 44100,
649
+    /** 48 kHz. */
650
+    AgoraAudioSampleRateType48000 = 48000,
651
+};
652
+
653
+/** Audio profile. */
654
+typedef NS_ENUM(NSInteger, AgoraAudioProfile) {
655
+    /** Default audio profile. In the communication profile, the default value is 1; in the live-broadcast profile, the default value is 2. */
656
+    AgoraAudioProfileDefault = 0,
657
+    /** Sampling rate of 32 kHz, audio encoding, mono, and a bitrate of up to 18 Kbps. */
658
+    AgoraAudioProfileSpeechStandard = 1,
659
+    /** Sampling rate of 48 kHz, music encoding, mono, and a bitrate of up to 48 Kbps. */
660
+    AgoraAudioProfileMusicStandard = 2,
661
+    /** Sampling rate of 48 kHz, music encoding, stereo, and a bitrate of up to 56 Kbps. */
662
+    AgoraAudioProfileMusicStandardStereo = 3,
663
+    /** Sampling rate of 48 kHz, music encoding, mono, and a bitrate of up to 128 Kbps. */
664
+    AgoraAudioProfileMusicHighQuality = 4,
665
+    /** Sampling rate of 48 kHz, music encoding, stereo, and a bitrate of up to 192 Kbps. */
666
+    AgoraAudioProfileMusicHighQualityStereo = 5,
667
+};
668
+
669
+/** Audio scenario. */
670
+typedef NS_ENUM(NSInteger, AgoraAudioScenario) {
671
+    /** Default. */
672
+    AgoraAudioScenarioDefault = 0,
673
+    /** Entertainment scenario, supporting voice during gameplay. */
674
+    AgoraAudioScenarioChatRoomEntertainment = 1,
675
+    /** Education scenario, prioritizing fluency and stability. */
676
+    AgoraAudioScenarioEducation = 2,
677
+    /** Live gaming scenario, enabling the gaming audio effects in the speaker mode in a live broadcast scenario. Choose this scenario for high-fidelity music playback.*/
678
+    AgoraAudioScenarioGameStreaming = 3,
679
+    /** Showroom scenario, optimizing the audio quality with external professional equipment. */
680
+    AgoraAudioScenarioShowRoom = 4,
681
+    /** Gaming scenario. */
682
+    AgoraAudioScenarioChatRoomGaming = 5
683
+};
684
+
685
+/** Audio output routing. */
686
+typedef NS_ENUM(NSInteger, AgoraAudioOutputRouting) {
687
+    /** Default. */
688
+    AgoraAudioOutputRoutingDefault = -1,
689
+    /** Headset.*/
690
+    AgoraAudioOutputRoutingHeadset = 0,
691
+    /** Earpiece. */
692
+    AgoraAudioOutputRoutingEarpiece = 1,
693
+    /** Headset with no microphone. */
694
+    AgoraAudioOutputRoutingHeadsetNoMic = 2,
695
+    /** Speakerphone. */
696
+    AgoraAudioOutputRoutingSpeakerphone = 3,
697
+    /** Loudspeaker. */
698
+    AgoraAudioOutputRoutingLoudspeaker = 4,
699
+    /** Bluetooth headset. */
700
+    AgoraAudioOutputRoutingHeadsetBluetooth = 5
701
+};
702
+
703
+/** Use mode of the onRecordAudioFrame callback. */
704
+typedef NS_ENUM(NSInteger, AgoraAudioRawFrameOperationMode) {
705
+    /** Read-only mode: Users only read the AudioFrame data without modifying anything. For example, when users acquire data with the Agora SDK then push the RTMP streams. */
706
+    AgoraAudioRawFrameOperationModeReadOnly = 0,
707
+    /** Write-only mode: Users replace the AudioFrame data with their own data and pass them to the SDK for encoding. For example, when users acquire data. */
708
+    AgoraAudioRawFrameOperationModeWriteOnly = 1,
709
+    /** Read and write mode: Users read the data from AudioFrame, modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing such as a voice change. */
710
+    AgoraAudioRawFrameOperationModeReadWrite = 2,
711
+};
712
+
713
+/** Audio equalization band frequency. */
714
+typedef NS_ENUM(NSInteger, AgoraAudioEqualizationBandFrequency) {
715
+    /** 31 Hz. */
716
+    AgoraAudioEqualizationBand31 = 0,
717
+    /** 62 Hz. */
718
+    AgoraAudioEqualizationBand62 = 1,
719
+    /** 125 Hz. */
720
+    AgoraAudioEqualizationBand125 = 2,
721
+    /** 250 Hz. */
722
+    AgoraAudioEqualizationBand250 = 3,
723
+    /** 500 Hz */
724
+    AgoraAudioEqualizationBand500 = 4,
725
+    /** 1 kHz. */
726
+    AgoraAudioEqualizationBand1K = 5,
727
+    /** 2 kHz. */
728
+    AgoraAudioEqualizationBand2K = 6,
729
+    /** 4 kHz. */
730
+    AgoraAudioEqualizationBand4K = 7,
731
+    /** 8 kHz. */
732
+    AgoraAudioEqualizationBand8K = 8,
733
+    /** 16 kHz. */
734
+    AgoraAudioEqualizationBand16K = 9,
735
+};
736
+
737
+/** Audio reverberation type. */
738
+typedef NS_ENUM(NSInteger, AgoraAudioReverbType) {
739
+    /** The level of the dry signal (dB). The value ranges between -20 and 10. */
740
+    AgoraAudioReverbDryLevel = 0,
741
+    /** The level of the early reflection signal (wet signal) in dB. The value ranges between -20 and 10. */
742
+    AgoraAudioReverbWetLevel = 1,
743
+    /** The room size of the reverberation. A larger room size means a stronger reverberation. The value ranges between 0 and 100. */
744
+    AgoraAudioReverbRoomSize = 2,
745
+    /** The length of the initial delay of the wet signal (ms). The value ranges between 0 and 200. */
746
+    AgoraAudioReverbWetDelay = 3,
747
+     /** The reverberation strength. The value ranges between 0 and 100. */
748
+    AgoraAudioReverbStrength = 4,
749
+};
750
+
751
+/** Audio session restriction. */
752
+typedef NS_OPTIONS(NSUInteger, AgoraAudioSessionOperationRestriction) {
753
+    /** No restriction, the SDK has full control of the audio session operations. */
754
+    AgoraAudioSessionOperationRestrictionNone              = 0,
755
+    /** The SDK does not change the audio session category. */
756
+    AgoraAudioSessionOperationRestrictionSetCategory       = 1,
757
+    /** The SDK does not change any setting of the audio session (category, mode, categoryOptions). */
758
+    AgoraAudioSessionOperationRestrictionConfigureSession  = 1 << 1,
759
+    /** The SDK keeps the audio session active when leaving a channel. */
760
+    AgoraAudioSessionOperationRestrictionDeactivateSession = 1 << 2,
761
+    /** The SDK does not configure the audio session anymore. */
762
+    AgoraAudioSessionOperationRestrictionAll               = 1 << 7
763
+};
764
+
765
+/** Media device type. */
766
+typedef NS_ENUM(NSInteger, AgoraMediaDeviceType) {
767
+    /** Unknown device. */
768
+    AgoraMediaDeviceTypeAudioUnknown = -1,
769
+    /** Audio recording device. */
770
+    AgoraMediaDeviceTypeAudioRecording = 0,
771
+    /** Audio playback device. */
772
+    AgoraMediaDeviceTypeAudioPlayout = 1,
773
+    /** Video render device. */
774
+    AgoraMediaDeviceTypeVideoRender = 2,
775
+    /** Video capture device. */
776
+    AgoraMediaDeviceTypeVideoCapture = 3,
777
+};
778
+
779
+/** Connection states. */
780
+typedef NS_ENUM(NSInteger, AgoraConnectionStateType) {
781
+    /** <p>1: The SDK is disconnected from Agora's edge server.</p>
782
+    <ul>
783
+        <li>This is the initial state before calling the [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) method.</li>
784
+        <li>The SDK also enters this state when the app calls the [leaveChannel]([AgoraRtcEngineKit leaveChannel:]) method.</li>
785
+    </ul>  
786
+    */
787
+    AgoraConnectionStateDisconnected = 1,
788
+    /** <p>2: The SDK is connecting to Agora's edge server.</p>
789
+    <ul>
790
+        <li>When the app calls the [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) method, the SDK starts to establish a connection to the specified channel, triggers the [connectionChangedToState]([AgoraRtcEngineDelegate rtcEngine:connectionChangedToState:reason:]) callback, and switches to the `AgoraConnectionStateConnecting` state.</li>
791
+        <li>When the SDK successfully joins the channel, the SDK triggers the [connectionChangedToState]([AgoraRtcEngineDelegate rtcEngine:connectionChangedToState:reason:]) callback and switches to the `AgoraConnectionStateConnected` state.</li>
792
+        <li>After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the [didJoinChannel]([AgoraRtcEngineDelegate rtcEngine:didJoinChannel:withUid:elapsed:]) callback.</li>
793
+    </ul>
794
+*/
795
+    AgoraConnectionStateConnecting = 2,
796
+    /** <p>3: The SDK is connected to Agora's edge server and joins a channel. You can now publish or subscribe to a media stream in the channel.</p>   
797
+    <p>If the connection to the channel is lost because, for example, the network is down or switched, the SDK automatically tries to reconnect and triggers:</p>
798
+    <ul>
799
+        <li>The [rtcEngineConnectionDidInterrupted]([AgoraRtcEngineDelegate rtcEngineConnectionDidInterrupted:])(deprecated) callback.</li>
800
+        <li>The [connectionChangedToState]([AgoraRtcEngineDelegate rtcEngine:connectionChangedToState:reason:]) callback, and switches to the `AgoraConnectionStateReconnecting` state.</li>
801
+    </ul>
802
+    */
803
+    AgoraConnectionStateConnected = 3,
804
+    /** <p>4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues.</p>
805
+    <ul>
806
+        <li>If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora's edge server, the SDK triggers the [rtcEngineConnectionDidLost]([AgoraRtcEngineDelegate rtcEngineConnectionDidLost:]) callback, stays in the `AgoraConnectionStateReconnecting` state, and keeps rejoining the channel.</li>
807
+        <li>If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK triggers the [connectionChangedToState]([AgoraRtcEngineDelegate rtcEngine:connectionChangedToState:reason:]) callback, switches to the `AgoraConnectionStateFailed` state, and stops rejoining the channel.</li>
808
+    </ul>
809
+
810
+    */
811
+    AgoraConnectionStateReconnecting = 4,
812
+    /** <p>5: The SDK fails to connect to Agora's edge server or join the channel.</p>
813
+    <p>You must call the [leaveChannel]([AgoraRtcEngineKit leaveChannel:])method to leave this state, and call the [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) method again to rejoin the channel.</p>
814
+    <p>If the SDK is banned from joining the channel by Agora's edge server (through the RESTful API), the SDK triggers the [rtcEngineConnectionDidBanned]([AgoraRtcEngineDelegate rtcEngineConnectionDidBanned:])(deprecated) and [connectionChangedToState]([AgoraRtcEngineDelegate rtcEngine:connectionChangedToState:reason:]) callbacks.</p>
815
+    */
816
+    AgoraConnectionStateFailed = 5,
817
+};
818
+
819
+/** Reason for the connection state change. */
820
+typedef NS_ENUM(NSUInteger, AgoraConnectionChangedReason) {
821
+    /** 0: The SDK is connecting to Agora's edge server. */
822
+    AgoraConnectionChangedConnecting = 0,
823
+    /** 1: The SDK has joined the channel successfully. */
824
+    AgoraConnectionChangedJoinSuccess = 1,
825
+    /** 2: The connection between the SDK and Agora's edge server is interrupted.  */
826
+    AgoraConnectionChangedInterrupted = 2,
827
+    /** 3: The connection between the SDK and Agora's edge server is banned by Agora's edge server. */
828
+    AgoraConnectionChangedBannedByServer = 3,
829
+    /** 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. */
830
+    AgoraConnectionChangedJoinFailed = 4,
831
+    /** 5: The SDK has left the channel. */
832
+    AgoraConnectionChangedLeaveChannel = 5,
833
+};

+ 243
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraLiveKit.h Прегледај датотеку

@@ -0,0 +1,243 @@
1
+//
2
+//  AgoraLiveKit.h
3
+//  AgoraLiveKit
4
+//
5
+//  Created by Junhao Wang
6
+//  Copyright (c) 2017 Agora. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+#import "AgoraLivePublisher.h"
12
+#import "AgoraLiveSubscriber.h"
13
+#import "AgoraRtcEngineKit.h"
14
+
15
+/** A class for enabling or disabling the video.
16
+ */
17
+__attribute__((visibility("default"))) @interface AgoraLiveChannelConfig: NSObject
18
+@property (assign, nonatomic) BOOL videoEnabled;
19
+
20
++(AgoraLiveChannelConfig *_Nonnull) defaultConfig;
21
+@end
22
+
23
+/** The base class for managing a live broadcast.
24
+
25
+ AgoraLiveKit manages the channel and all actions apart from publishing and subscribing.
26
+ */
27
+@class AgoraLiveKit;
28
+
29
+/** Protocol providing the AgoraLiveKit class with callbacks.
30
+ */
31
+@protocol AgoraLiveDelegate <NSObject>
32
+@optional
33
+
34
+
35
+/** A warning occurred during SDK runtime.
36
+
37
+ The application can ignore the warning, and the SDK tries to resume automatically.
38
+
39
+ @param kit         AgoraLiveKit
40
+ @param warningCode AgoraWarningCode
41
+ */
42
+- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didOccurWarning:(AgoraWarningCode)warningCode;
43
+
44
+/** An error occurred during SDK runtime.
45
+
46
+ The SDK cannot resume a normal state, and the application needs to handle it.
47
+
48
+ @param kit       AgoraLiveKit
49
+ @param errorCode AgoraErrorCode
50
+ */
51
+- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didOccurError:(AgoraErrorCode)errorCode;
52
+
53
+/** A user joined the channel.
54
+
55
+ @param kit     AgoraLiveKit
56
+ @param channel Channel name
57
+ @param uid     Local user ID
58
+ @param elapsed Time elapsed (ms) from calling [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) until this callback is triggered.
59
+  */
60
+- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didJoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
61
+
62
+/** The statistics of the call when leaving a channel
63
+
64
+ @param kit    AgoraLiveKit
65
+ */
66
+- (void)liveKitDidLeaveChannel:(AgoraLiveKit *_Nonnull)kit;
67
+
68
+/** A user rejoined the channel
69
+
70
+ @param kit     AgoraLiveKit
71
+ @param channel Channel name.
72
+ @param uid     User ID.
73
+ @param elapsed Time elapsed (ms) from calling [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) until this callback is triggered.
74
+ */
75
+- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didRejoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
76
+
77
+/** Generates a new Token.
78
+
79
+ When the Token is enabled, and the specified Token is invalid or has expired, this function will be called.
80
+ The app should generate a new Token and call renewToken to refresh the key.
81
+
82
+ Note: AgoraErrorCodeTokenExpired = -109 and AgoraErrorCodeInvalidToken = -110 are also reported through the [didOccurError](liveKit:didOccurError:) callback. Move the renew token logic into this callback.
83
+
84
+ @param kit AgoraLiveKit
85
+ */
86
+- (void)liveKitRequestToken:(AgoraLiveKit *_Nonnull)kit;
87
+
88
+/**
89
+ The Token will expire within 30 seconds.
90
+
91
+ If the Token you specified when calling [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) expires, you will become offline. This callback is triggered 30 seconds before the Token expires to remind the app to renew the Token.
92
+
93
+ Upon receiving this callback, the user needs to generate a new Token on your server and call renewToken to pass the new Token on to the SDK.
94
+
95
+
96
+ @param kit AgoraLiveKit
97
+ @param token The Token that will expire in 30 seconds.
98
+ */
99
+- (void)liveKit:(AgoraLiveKit * _Nonnull)kit tokenPrivilegeWillExpire:(NSString * _Nonnull)token;
100
+
101
+// statistics
102
+
103
+/** The statistics of the RTC AgoraLiveKit status every two seconds.
104
+
105
+ @param kit    AgoraLiveKit
106
+ @param stats  Statistics of the RTC status, including the duration, sent bytes, and received bytes
107
+ */
108
+- (void)liveKit:(AgoraLiveKit *_Nonnull)kit reportLiveStats:(AgoraChannelStats *_Nonnull)stats;
109
+// network
110
+
111
+/** The connection between the SDK and the server has been interrupted.
112
+
113
+This callback is triggered when the SDK losses connection with the server.
114
+
115
+Once the connection is lost, the SDK attempts to reconnect until the
116
+   application calls [leaveChannel]([AgoraLiveKit leaveChannel]).
117
+
118
+ @param kit    AgoraLiveKit
119
+ */
120
+- (void)liveKitConnectionDidInterrupted:(AgoraLiveKit *_Nonnull)kit;
121
+
122
+/** The connection to the server is lost.
123
+
124
+ This event is reported after the connection to the server is interrupted and the reconnection time has exceeded (10 seconds by default).
125
+ The SDK tries to automatically reconnect with the server until the app calls [leaveChannel]([AgoraLiveKit leaveChannel]).
126
+
127
+@param kit    AgoraLiveKit
128
+ */
129
+- (void)liveKitConnectionDidLost:(AgoraLiveKit *_Nonnull)kit;
130
+
131
+/** The network quality of the local user.
132
+
133
+ @param kit     AgoraLiveKit
134
+ @param uid     User ID
135
+ @param txQuality Network transmission quality: AgoraNetworkQuality
136
+ @param rxQuality Network receiving quality: AgoraNetworkQuality
137
+ */
138
+- (void)liveKit:(AgoraLiveKit *_Nonnull)kit networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality;
139
+@end
140
+
141
+/**
142
+ AgoraLiveKit is the base class for managing a live broadcast. AgoraLiveKit manages the channel and all actions apart from publishing and subscribing.
143
+ */
144
+__attribute__((visibility("default"))) @interface AgoraLiveKit : NSObject
145
+
146
+/**
147
+ Protocol providing the AgoraLiveKit class with callbacks.
148
+ */
149
+@property (weak, nonatomic) _Nullable id<AgoraLiveDelegate> delegate;
150
+
151
+/** Returns the version of the Agora SDK.
152
+
153
+@return string, SDK version
154
+*/
155
++ (NSString *_Nonnull)getSdkVersion;
156
+
157
+/** Returns the native handler of the SDK engine
158
+ */
159
+- (AgoraRtcEngineKit *_Nonnull)getRtcEngineKit;
160
+
161
+/** Initializes the AgoraLiveKit object.
162
+
163
+ @param appId The appId is issued to the application developers by Agora.
164
+
165
+ @return an object of AgoraLiveKit class
166
+ */
167
++ (instancetype _Nonnull)sharedLiveKitWithAppId:(NSString *_Nonnull)appId;
168
+
169
+
170
+/**
171
+ Destroys the engine instance.
172
+
173
+ This method releases all the resources used by the Agora SDK.  This is useful for applications occasionally making voice calls, to free up resources for other operations when not making calls.
174
+
175
+ Once the application has called destroy() to destroy the created RtcEngine instance,
176
+ no other methods in the SDK can be used and no callbacks occur.
177
+
178
+ To start communications again, initialize [sharedEngineWithappId](sharedEngineWithAppId:delegate:) to establish a new AgoraRtcEngineKit instance.
179
+
180
+ Note: This method is called synchronously. The result returns after the IRtcEngine
181
+ object resources are released. The app should not call this interface in the
182
+ callback generated by the SDK, otherwise the SDK must wait for the callback
183
+ to return before it can reclaim the related object resources, causing a deadlock.
184
+
185
+ */
186
++ (void)destroy;
187
+
188
+/** Core Methods */
189
+
190
+/**  Allows a user to join a channel.
191
+
192
+ This method creates an open UDP socket to the AgoraLiveKit cloud service to join a channel.
193
+ Users in the same channel can talk to each other using the same App ID. This method is asynchronous.
194
+
195
+
196
+ @param token A Token generated by the app through signature certification.
197
+ @param channelId Channel ID.  Joining a channel with the same channel ID means that users are joining the same room.
198
+ The channel ID supported scope: a-z, A-Z, 0-9, space, !#$%&()+-:;&le;.,>?@[]^_{|}~
199
+ @param channelConfig AgoraLiveChannelConfig
200
+ @param uid Optional: ID of each user in the channel that is unique. If it is set as 0, the SDK automatically assigns an ID, which can be found in the [didJoinChannel]([AgoraLiveDelegate liveKit:didJoinChannel:withUid:elapsed:]) delegate.
201
+
202
+ @return * 0: Success.
* <0: Failure.
203
+ */
204
+- (int)joinChannelByToken:(NSString *_Nullable)token
205
+               channelId:(NSString *_Nonnull)channelId
206
+            config:(AgoraLiveChannelConfig *_Nonnull)channelConfig
207
+               uid:(NSUInteger)uid;
208
+
209
+/**
210
+ Allows a user to leave a channel, such as hanging up or exiting a call.
211
+
212
+ @return * 0: Success.
* <0: Failure.
213
+ */
214
+- (int)leaveChannel;
215
+
216
+
217
+/** Updates the Token.
218
+
219
+ The key expires after a certain period of time once the Token scheme is enabled. When the [didOccurError]([AgoraLiveDelegate liveKit:didOccurError:]) callback reports the error ERR_TOKEN_EXPIRED(109), the application should retrieve a new key and then call this method to renew it. Failure to do so will result in the SDK disconnecting from the server.
220
+
221
+ @param token New Token.
222
+
223
+ @return * 0: Success.
* <0: Failure.
224
+ */
225
+- (int)renewToken:(NSString*_Nonnull)token;
226
+
227
+/** Starts the local video preview.
228
+
229
+ Before starting the preview, always call the setupLocalVideo:local: method to set up the preview window and configure its attributes and also call the enableVideo method to enable video. If before calling [joinChannelByToken](joinChannelByToken:channelId:info:uid:joinSuccess:) to join the channel, you have called startPreview to start the local video preview, then the local preview will be still in the started state after you called [leaveChannel]([AgoraLiveKit leaveChannel]) to exit the channel. You can call stopPreview to close the local preview.
230
+
231
+ @param mode Video display mode: AgoraVideoRenderMode
232
+ @return * 0: Success.
* <0: Failure.
233
+ */
234
+- (int)startPreview:(VIEW_CLASS *_Nonnull)view
235
+         renderMode:(AgoraVideoRenderMode)mode;
236
+
237
+/** Stops the local video preview.
238
+
239
+ @return * 0: Success.
* <0: Failure.
240
+ */
241
+- (int)stopPreview;
242
+
243
+@end

+ 181
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraLivePublisher.h Прегледај датотеку

@@ -0,0 +1,181 @@
1
+//
2
+//  AgoraLivePublisher.h
3
+//  AgoraLiveKit
4
+//
5
+//  Created by Sting Feng on 2015-8-11.
6
+//  Copyright (c) 2015 Agora. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "AgoraObjects.h"
11
+
12
+/** The base class for managing a live broadcast.  AgoraLiveKit manages the channel and all actions apart from publishing and subscribing.
13
+ */
14
+@class AgoraLiveKit;
15
+
16
+/** A class for managing the actions related to live publishing.
17
+ */
18
+@class AgoraLivePublisher;
19
+
20
+/** Protocol providing the AgoraLivePublisher class with callbacks.
21
+ */
22
+@protocol AgoraLivePublisherDelegate <NSObject>
23
+@optional
24
+
25
+/**
26
+ A stream was published.
27
+
28
+ @param publisher AgoraRtcEngineKit object.
29
+ @param url Address to which the publisher publishes the stream.
30
+ @param error AgoraErrorCode
31
+ */
32
+-(void)publisher:(AgoraLivePublisher *_Nonnull)publisher streamPublishedWithUrl:(NSString *_Nonnull)url error:(AgoraErrorCode)error;
33
+
34
+/**
35
+ A stream was unpublished.
36
+
37
+ @param publisher AgoraRtcEngineKit object.
38
+ @param url Address to which the publisher unpublishes the stream.
39
+ */
40
+-(void)publisher:(AgoraLivePublisher *_Nonnull)publisher streamUnpublishedWithUrl:(NSString *_Nonnull)url;
41
+
42
+/**
43
+ The publisher transcoding was updated.
44
+
45
+ @param publisher AgoraRtcEngineKit object
46
+ */
47
+-(void)publisherTranscodingUpdated: (AgoraLivePublisher *_Nonnull)publisher;
48
+
49
+/**
50
+ The state of the imported external video stream.
51
+
52
+ @param publisher AgoraRtcEngineKit object.
53
+ @param url URL address of the imported external video stream added to the live broadcast.
54
+ @param uid User ID.
55
+ @param status State of the externally injected video stream: AgoraInjectStreamStatus.
56
+ */
57
+-(void)publisher:(AgoraLivePublisher *_Nonnull)publisher streamInjectedStatusOfUrl:(NSString *_Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status;
58
+@end
59
+
60
+
61
+/**
62
+ The AgoraLivePublisher class manages all actions related to live broadcast publishing.
63
+
64
+ */
65
+__attribute__((visibility("default"))) @interface AgoraLivePublisher: NSObject
66
+
67
+/**
68
+ Sets the delegate.
69
+
70
+ @param delegate AgoraLivePublisherDelegate
71
+ */
72
+-(void)setDelegate:(_Nullable id<AgoraLivePublisherDelegate>)delegate;
73
+
74
+/**
75
+ Initializes the publisher.
76
+
77
+ @param kit AgoraLiveKit
78
+ @return AgoraLivePublisher object
79
+ */
80
+-(instancetype _Nonnull)initWithLiveKit:(AgoraLiveKit *_Nonnull)kit;
81
+
82
+/**  Sets the video encoding profile manually.
83
+
84
+ @param resolution Resolution of the video. The highest value is 1280 &times; 720.
85
+ @param frameRate Frame rate of the video. The highest value is 30. You can set it to 5, 10, 15, 24, 30, and so on.
86
+ @param bitrate Bitrate of the video. You need to manually work out the frame rate according to the width, height, and frame rate. With the same width and height, the bitrate varies with the change of the frame rate:
87
+
88
+* If the frame rate is 5 fps, divide the recommended bitrate by 2.
89
+* If the frame rate is 15 fps, use the recommended bitrate.
90
+* If the frame rate is 30 fps, multiply the recommended bitrate by 1.5.
91
+* Calculate your bitrate with the ratio if you choose other frame rates.
92
+
93
+ If the bitrate you set is beyond the proper range, the SDK will automatically adjust it to a value within the range.
94
+ */
95
+- (void)setVideoResolution:(CGSize)resolution andFrameRate:(NSInteger)frameRate bitrate:(NSInteger)bitrate;
96
+
97
+/**
98
+Sets live transcoding.
99
+
100
+ This method is used for CDN live. It sets the video layout and audio for CDN live.
101
+
102
+ @param transcoding AgoraLiveTranscoding object.
103
+ */
104
+-(void)setLiveTranscoding:(AgoraLiveTranscoding *_Nullable)transcoding;
105
+
106
+
107
+/**
108
+ Adds a watermark to the local video stream.
109
+
110
+ This method adds a watermark in the PNG file format onto the local video stream for the recording device and the audience in the channel and CDN live to see or capture it.
111
+ To add the PNG file onto a CDN live publishing stream only, see [setLiveTranscoding](setLiveTranscoding:).
112
+
113
+
114
+ @param watermark AgoraImage
115
+ @return Name of the watermark image.
116
+ */
117
+-(int)addVideoWatermark:(AgoraImage * _Nonnull)watermark  NS_SWIFT_NAME(addVideoWatermark(_:));
118
+
119
+/**
120
+Removes the watermark from the video stream.
121
+ */
122
+-(void)clearVideoWatermarks;
123
+
124
+/** Sets the media type.
125
+
126
+ @param mediaType AgoraMediaType
127
+ */
128
+-(void)setMediaType:(AgoraMediaType)mediaType;
129
+
130
+/** Adds a stream URL.
131
+
132
+ This method is used for CDN live. It adds the URL to which the host publishes the stream.
133
+ Note: This method only adds one URL each time it is called.
134
+
135
+ @param url URL to which the host publishes the stream.
136
+ @param transcodingEnabled * YES: Enable transcoding.
137
+ * NO: Disable transcoding.
138
+
139
+ */
140
+-(void)addStreamUrl:(NSString *_Nullable)url transcodingEnabled:(BOOL)transcodingEnabled;
141
+
142
+/** Removes a stream URL.
143
+
144
+ This method is used for CDN live. It removes the URL to which the host publishes the stream.
145
+ Note: This method only removes one URL each time it is called.
146
+
147
+ @param url URL to which the host publishes the stream.
148
+ */
149
+-(void)removeStreamUrl:(NSString *_Nullable)url;
150
+
151
+/** Publishes a stream.
152
+ */
153
+-(void)publish;
154
+
155
+/** Stops stream publishing.
156
+ */
157
+-(void)unpublish;
158
+
159
+#if TARGET_OS_IPHONE
160
+/**
161
+ Switches between front and rear cameras.
162
+ */
163
+-(void)switchCamera;
164
+#endif
165
+
166
+/**
167
+Adds a URL address of the added stream into the live broadcast channel.
168
+
169
+ @param url URL address to add to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV live streaming protocols and the MP3/MP4 streams.
170
+ @param config AgoraLiveInjectStreamConfig
171
+ */
172
+- (void)addInjectStreamUrl:(NSString *_Nonnull)url config:(AgoraLiveInjectStreamConfig * _Nonnull)config;
173
+
174
+/**
175
+ Removes the URL from the live broadcast.
176
+
177
+ @param url URL address of the added stream to remove.
178
+ */
179
+- (void)removeInjectStreamUrl:(NSString *_Nonnull)url;
180
+
181
+@end

+ 121
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraLiveSubscriber.h Прегледај датотеку

@@ -0,0 +1,121 @@
1
+//
2
+//  AgoraLiveSubscriber.h
3
+//  AgoraLiveKit
4
+//
5
+//  Created by Sting Feng on 2015-8-11.
6
+//  Copyright (c) 2015 Agora. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "AgoraObjects.h"
11
+
12
+/** The base class for managing a live broadcast.  AgoraLiveKit manages the channel and all actions apart from publishing and subscribing.
13
+ */
14
+@class AgoraLiveKit;
15
+
16
+/** A class for managing actions related to live subscribing.
17
+ */
18
+@class AgoraLiveSubscriber;
19
+
20
+/** Protocol providing the AgoraLiveSubscriber class with callbacks.
21
+ */
22
+@protocol AgoraLiveSubscriberDelegate <NSObject>
23
+@optional
24
+
25
+// Subscriber
26
+
27
+/**
28
+ A stream was published by a specified host.
29
+
30
+ @param subscriber AgoraLiveSubscriber
31
+ @param uid User ID of the host
32
+ @param type Stream type: AgoraMediaType
33
+ */
34
+- (void)subscriber: (AgoraLiveSubscriber *_Nonnull)subscriber publishedByHostUid:(NSUInteger)uid streamType:(AgoraMediaType) type;
35
+
36
+/**
37
+ The stream type was changed by a specified host.
38
+
39
+ @param subscriber AgoraLiveSubscriber
40
+ @param type AgoraMediaType
41
+ @param uid User ID of the host
42
+ */
43
+- (void)subscriber: (AgoraLiveSubscriber *_Nonnull)subscriber streamTypeChangedTo:(AgoraMediaType) type byHostUid:(NSUInteger)uid;
44
+
45
+// Unmute, offline
46
+
47
+/**
48
+ A stream was unpublished by a specified host.
49
+
50
+ @param subscriber AgoraLiveSubscriber
51
+ @param uid User ID of the host
52
+ */
53
+- (void)subscriber: (AgoraLiveSubscriber *_Nonnull)subscriber unpublishedByHostUid:(NSUInteger)uid;
54
+
55
+// Video
56
+/** The first frame of the specified remote user was displayed successfully.
57
+ *
58
+ *  @param subscriber     Live subscriber.
59
+ *  @param uid     Remote user id.
60
+ *  @param size    Size of video stream.
61
+ *  @param elapsed Time elapsed (ms) from the beginning of the session.
62
+ */
63
+- (void)subscriber:(AgoraLiveSubscriber *_Nonnull)subscriber firstRemoteVideoDecodedOfHostUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed;
64
+
65
+/**
66
+ *  The video size and rotational change of the specified user.
67
+ *
68
+ *  @param subscriber     Live subscriber
69
+ *  @param uid     User ID
70
+ *  @param size    New video size
71
+ *  @param rotation  New video rotation
72
+ */
73
+- (void)subscriber:(AgoraLiveSubscriber *_Nonnull)subscriber videoSizeChangedOfHostUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation;
74
+@end
75
+
76
+
77
+/**
78
+ The AgoraLiveSubscriber class manages all actions related to live broadcast subscribing.
79
+
80
+ */
81
+__attribute__((visibility("default"))) @interface AgoraLiveSubscriber: NSObject // AgoraLiveSubscriber
82
+
83
+/**
84
+ Initializes an AgoraLiveSubscriber object.
85
+
86
+ @param kit AgoraLiveKit
87
+ @return AgoraLiveSubscriber object.
88
+ */
89
+-(instancetype _Nonnull)initWithLiveKit:(AgoraLiveKit * _Nonnull)kit;
90
+
91
+
92
+/**
93
+ Sets the delegate.
94
+
95
+ @param delegate AgoraLiveSubscriberDelegate
96
+ */
97
+-(void)setDelegate:(_Nullable id<AgoraLiveSubscriberDelegate>)delegate;
98
+
99
+/**
100
+ Subscribes to a host.
101
+
102
+ @param uid User ID of the host
103
+ @param mediaType Media type: AgoraMediaType
104
+ @param view View to render
105
+ @param mode Video display mode: AgoraVideoRenderMode
106
+ @param videoType AgoraVideoStreamType
107
+ */
108
+- (void)subscribeToHostUid:(NSUInteger)uid
109
+             mediaType:(AgoraMediaType)mediaType
110
+                  view:(VIEW_CLASS *_Nullable)view
111
+            renderMode:(AgoraVideoRenderMode)mode
112
+             videoType:(AgoraVideoStreamType)videoType;
113
+
114
+/**
115
+ Unsubscribes from a host.
116
+
117
+ @param uid User ID of the host
118
+ */
119
+-(void)unsubscribeToHostUid:(NSUInteger)uid;
120
+
121
+@end

+ 281
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraMediaIO.h Прегледај датотеку

@@ -0,0 +1,281 @@
1
+//
2
+//  AgoraMediaIO.h
3
+//  AgoraRtcEngineKit
4
+//
5
+//  Copyright (c) 2018 Agora. All rights reserved.
6
+//
7
+
8
+#import <Foundation/Foundation.h>
9
+#import <AVFoundation/AVFoundation.h>
10
+#import "AgoraEnumerates.h"
11
+#import "AgoraObjects.h"
12
+
13
+
14
+/** Video pixel format.
15
+
16
+ This enumeration defines the pixel format of the video frame. Agora supports three pixel formats on iOS: I420, BGRA, and NV12. For information on the YVU format, see:
17
+
18
+   * [FourCC YUV Pixel Formats](http://www.fourcc.org/yuv.php)
19
+   * [Recommended 8-Bit YUV Formats for Video Rendering](https://docs.microsoft.com/zh-cn/windows/desktop/medfound/recommended-8-bit-yuv-formats-for-video-rendering)
20
+ */
21
+typedef NS_ENUM(NSUInteger, AgoraVideoPixelFormat) {
22
+    /** I420 */
23
+    AgoraVideoPixelFormatI420   = 1,
24
+    /** BGRA */
25
+    AgoraVideoPixelFormatBGRA   = 2,
26
+    /** NV12 */
27
+    AgoraVideoPixelFormatNV12   = 8,
28
+};
29
+
30
+/** Video rotation.
31
+
32
+ This enumeration defines the rotating angle of the video. Agora supports rotating clockwise by 0, 90, 180, and 270 degrees.
33
+ */
34
+typedef NS_ENUM(NSInteger, AgoraVideoRotation) {
35
+    /** No rotation */
36
+    AgoraVideoRotationNone      = 0,
37
+    /** 90 degrees */
38
+    AgoraVideoRotation90        = 1,
39
+    /** 180 degrees */
40
+    AgoraVideoRotation180       = 2,
41
+    /** 270 degrees */
42
+    AgoraVideoRotation270       = 3,
43
+};
44
+
45
+/** Video buffer type */
46
+typedef NS_ENUM(NSInteger, AgoraVideoBufferType) {
47
+   /** Use a pixel buffer to transmit the video data. */
48
+    AgoraVideoBufferTypePixelBuffer = 1,
49
+    /** Use raw data to transmit the video data. */
50
+    AgoraVideoBufferTypeRawData     = 2,
51
+};
52
+
53
+/** An object supporting video data in two formats; pixel buffer and raw data.
54
+
55
+ When the video source is initialized, the media engine passes this object to the developer and the developer needs to reserve it, and then pass the video frame to the media engine through this object once the video source is initialized.
56
+ Call [bufferType]([AgoraVideoSinkProtocol bufferType]) to specify a buffer type. The video data can only be transmitted in the corresponding type.
57
+ */
58
+@protocol AgoraVideoFrameConsumer <NSObject>
59
+
60
+/** Uses the video information in the pixel buffer.
61
+
62
+ @param pixelBuffer Buffer type
63
+ @param timestamp   Time stamp (ms) of the video frame. For each video frame, developers need to set a timestamp.
64
+ @param rotation    AgoraVideoRotation
65
+ */
66
+- (void)consumePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
67
+             withTimestamp:(CMTime)timestamp
68
+                  rotation:(AgoraVideoRotation)rotation;
69
+
70
+/** Uses the video information in the raw data.
71
+
72
+ @param rawData   Raw data of the video frame.
73
+ @param timestamp Time stamp (ms) of the video frame.
74
+ @param format    AgoraVideoPixelFormat
75
+ @param size      Size of the raw video data.
76
+ @param rotation  AgoraVideoRotation
77
+ */
78
+- (void)consumeRawData:(void * _Nonnull)rawData
79
+         withTimestamp:(CMTime)timestamp
80
+                format:(AgoraVideoPixelFormat)format
81
+                  size:(CGSize)size
82
+              rotation:(AgoraVideoRotation)rotation;
83
+@end
84
+
85
+/** Defines a set of protocols to implement the custom video source and pass it to the underlying media engine to replace the default video source.
86
+
87
+ AgoraVideoSourceProtocol allows you to take the ownership of the video source and manipulate it.
88
+ By default, when enabling real-time communications, the Agora SDK enables the default video input device (built-in camera) to start video streaming.
89
+ By calling [setVideoSource]([AgoraRtcEngineKit setVideoSource:]), you can change the default video input device, control it, and send the video source from the specified input device to the Agora Media Engine to handle the remaining video process; such as video filtering and publishing the video to the RTC connection.
90
+ Once you have implemented this interface, the Agora Media Engine automatically releases the ownership of the current video input device and passes the ownership to you, so that you can use the same video input device to capture the video stream.
91
+ AgoraVideoSourceProtocol consists of the following methods:
92
+
93
+ * Initializes the Video Source ([shouldInitialize](shouldInitialize))
94
+ * Enables the Video Source ([shouldStart](shouldStart))
95
+ * Disables the Video Source ([shouldStop](shouldStop))
96
+ * Releases the Video Source ([shouldDispose](shouldDispose))
97
+ * Retrieves the Buffer Type ([bufferType](bufferType))
98
+
99
+ Note:
100
+
101
+ * All methods in the [AgoraVideoSourceProtocol]([AgoraVideoSourceProtocol]) are callbacks. The media engine maintains a finite state machine and uses these functions at the right time. Do not use these functions directly in the app.
102
+ * These functions are synchronized.
103
+ * If the media engine restarts during the process, these functions can be repeated for a couple of times.
104
+ * These functions are not in the primary thread.
105
+
106
+ When using the AgoraVideoSourceProtocol, call AgoraVideoBufferType, AgoraVideoPixelFormat, and AgoraVideoRotation to set the buffer type, pixel format, and rotation angle of the transmitted video.
107
+ */
108
+@protocol AgoraVideoSourceProtocol <NSObject>
109
+@required
110
+/** See AgoraVideoFrameConsumer */
111
+@property (strong) id<AgoraVideoFrameConsumer> _Nullable consumer;
112
+/** Initializes the video source.
113
+
114
+ The media engine calls this method to initialize the video source. You can also initialize the video source before this method is called and return YES to the media engine in this method. You need to pass YES or NO in this method to tell the media engine if the video source is initialized.
115
+ When the video source is initialized, the media engine initializes the AgoraVideoFrameConsumer pointer in AgoraVideoSourceProtocol, then the video source sends the video frame to the media engine through the AgoraVideoFrameConsumer method.
116
+
117
+ @return * YES: If the external video source is initialized.
118
+ * NO: If the external video source is not ready or fails to initialize, the media engine stops and reports the error.
119
+ */
120
+- (BOOL)shouldInitialize;
121
+
122
+/** Enables the video source.
123
+
124
+ Call this method when the media engine is ready to start video streaming. You should start the video source to capture the video frame. Once the frame is ready, use the AgoraVideoFrameConsumer to consume the video frame.
125
+ Pass one of the following return values to the media engine:
126
+
127
+ * YES: If the external video source is enabled and AgoraVideoFrameConsumer is called to receive video frames.
128
+ * NO: If the external video source is not ready or fails to enable, the media engine stops and reports the error.
129
+
130
+ After YES is returned, video frames can be passed to the media engine through the preset AgoraVideoFrameConsumer interface method.
131
+ */
132
+- (void)shouldStart;
133
+
134
+/** Disables the video source.
135
+
136
+ Call this method when the media engine stops streaming. You should then stop capturing the video frame and consuming it. After this method is called, the video frames are discarded by the media engine.
137
+ */
138
+- (void)shouldStop;
139
+
140
+/** Releases the video source.
141
+
142
+Call this method when AgoraVideoFrameConsumer is released by the media engine. You can now release the video source as well as AgoraVideoFrameConsumer.
143
+ */
144
+- (void)shouldDispose;
145
+
146
+/** Retrieves the buffer type.
147
+
148
+ Passes the buffer type previously set in [AgoraVideoBufferType]([AgoraVideoBufferType]) to the media engine. This buffer type is used to set up the correct media engine environment.
149
+
150
+ @return return AgoraVideoBufferType
151
+ */
152
+- (AgoraVideoBufferType)bufferType;
153
+@end
154
+
155
+/** Defines a set of protocols to implement the custom video sink and pass it to the underlying media engine to replace the default video sink.
156
+
157
+ AgoraVideoSinkProtocol allows you to implement the custom video source.
158
+ By default, when you try to enable real-time communications, the Agora SDK enables the default video sink to start video rendering. By calling [setLocalVideoRenderer]([AgoraRtcEngineKit setLocalVideoRenderer:]) and [setRemoteVideoRenderer]([AgoraRtcEngineKit setRemoteVideoRenderer:forUserId:]), you can change the default video sink.
159
+ Once you have implemented this interface, you will receive callbacks from the media engine to indicate the state of the custom video sink, the underlying media engine, and enable their synchronization. Follow each callback to handle the resource allocation, and to release and receive the video frame from the media engine.
160
+ The AgoraVideoSinkProtocol defines a set of protocols to create a customized video sink. The AgoraVideoFrameConsumer interface passes the video frames to the media engine, which then passes them to the renderer.
161
+ After a customized video sink is created, the app passes it to the media engine, see [setLocalVideoRenderer]([AgoraRtcEngineKit setLocalVideoRenderer:]) and [setRemoteVideoRenderer]([AgoraRtcEngineKit setRemoteVideoRenderer:forUserId:]).
162
+ AgoraVideoSinkProtocol consists of the following callbacks:
163
+
164
+ * Initializes the Video Sink ([shouldInitialize](shouldInitialize))
165
+ * Enables the Video Sink ([shouldStart](shouldStart))
166
+ * Disables the Video Sink ([shouldStop](shouldStop))
167
+ * Releases the Video Sink ([shouldDispose](shouldDispose))
168
+ * Retrieves the Buffer Type ([bufferType](bufferType))
169
+ * Retrieves the Pixel Format ([pixelFormat](pixelFormat))
170
+ * (Optional) Outputs the Video in the Pixel Buffer ([renderPixelBuffer](renderPixelBuffer:rotation:))
171
+ * (Optional) Outputs the Video in the Raw Data ([renderRawData](renderRawData:size:rotation:))
172
+
173
+ Note: All methods defined in AgoraVideoSinkProtocol are callbacks. The media engine uses these functions to inform the customized renderer of its internal changes.
174
+ An example is shown in the following steps to customize the video sink:
175
+
176
+ 1. Call bufferType and AgoraVideoPixelFormat to set the buffer type and pixel format of the video frame.
177
+ 2. Implement [shouldInitialize](shouldInitialize), [shouldStart](shouldStart), [shouldStop](shouldStop), and [shouldDispose](shouldDispose) to manage the customized video sink.
178
+ 3. Implement the buffer type and pixel format as specified in AgoraVideoFrameConsumer.
179
+ 4. Create the customized video sink object.
180
+ 5. Call the [setLocalVideoRenderer]([AgoraRtcEngineKit setLocalVideoRenderer:]) and [setRemoteVideoRenderer]([AgoraRtcEngineKit setRemoteVideoRenderer:forUserId:]) methods to set the local and remote renderers.
181
+ 6. The media engine calls functions in AgoraVideoSinkProtocol according to its internal state.
182
+ */
183
+@protocol AgoraVideoSinkProtocol <NSObject>
184
+@required
185
+/** Initializes the video  sink.
186
+
187
+ You can also initialize the video sink before this method is called and return YES in this method.
188
+
189
+ @return * YES: If the video sink is initialized.
190
+ * NO: If the video sink is not ready or fails to initialize, the media engine stops and reports the error.
191
+ */
192
+- (BOOL)shouldInitialize;
193
+
194
+/** Enables the video sink.
195
+
196
+ Call this method when the media engine starts streaming.
197
+
198
+ * YES: If the video sink is ready. The media engine provides the video frame to the custom video sink by calling the AgoraVideoFrameConsumer interface.
199
+ * NO: If the video sink is not ready.
200
+ */
201
+- (void)shouldStart;
202
+
203
+/** Disables the video sink.
204
+
205
+ Call this method when the media engine stops video streaming. You should then stop the video sink.
206
+ */
207
+- (void)shouldStop;
208
+
209
+/** Releases the video sink.
210
+
211
+ Call this method when the media engine wants to release the video sink resources.
212
+ */
213
+- (void)shouldDispose;
214
+
215
+/** Retrieves the buffer type and passes the buffer type specified in [AgoraVideoBufferType]([AgoraVideoBufferType]) to the media engine.
216
+
217
+ @return bufferType AgoraVideoBufferType
218
+ */
219
+- (AgoraVideoBufferType)bufferType;
220
+
221
+/** Retrieves the pixel format and passes it to the media engine.
222
+
223
+ @return pixelFormat AgoraVideoPixelFormat
224
+ */
225
+- (AgoraVideoPixelFormat)pixelFormat;
226
+
227
+@optional
228
+/** (Optional) Outputs the video in the pixel buffer.
229
+
230
+ @param pixelBuffer Video in the pixel buffer.
231
+ @param rotation    Clockwise rotating angle of the video frame. See AgoraVideoRotation.
232
+ */
233
+- (void)renderPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
234
+                 rotation:(AgoraVideoRotation)rotation;
235
+
236
+/** (Optional) Outputs the video in the raw data.
237
+
238
+ @param rawData  Raw video data.
239
+ @param size     Size of the raw video.
240
+ @param rotation Clockwise rotating angle of the video frame. See AgoraVideoRotation.
241
+ */
242
+- (void)renderRawData:(void * _Nonnull)rawData
243
+                 size:(CGSize)size
244
+             rotation:(AgoraVideoRotation)rotation;
245
+@end
246
+
247
+
248
+#pragma mark - Agora Default Media IO
249
+/** Default camera position */
250
+typedef NS_ENUM(NSInteger, AgoraRtcDefaultCameraPosition) {
251
+    /** Front camera */
252
+    AgoraRtcDefaultCameraPositionFront = 0,
253
+    /** Rear camera */
254
+    AgoraRtcDefaultCameraPositionBack = 1,
255
+};
256
+
257
+__attribute__((visibility("default"))) @interface AgoraRtcDefaultCamera: NSObject<AgoraVideoSourceProtocol>
258
+#if TARGET_OS_IPHONE
259
+@property (nonatomic, assign) AgoraRtcDefaultCameraPosition position;
260
+- (instancetype _Nonnull)initWithPosition:(AgoraRtcDefaultCameraPosition)position;
261
+#endif
262
+@end
263
+
264
+#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
265
+__attribute__((visibility("default"))) @interface AgoraRtcScreenCapture: NSObject<AgoraVideoSourceProtocol>
266
+@property (nonatomic, readonly) NSUInteger windowId;
267
++ (instancetype _Nonnull)fullScreenCaptureWithFrequency:(NSInteger)captureFrequency
268
+                                                bitRate:(NSInteger)bitRate;
269
++ (instancetype _Nonnull)windowCaptureWithId:(CGWindowID)windowId
270
+                            captureFrequency:(NSInteger)captureFrequency
271
+                                     bitRate:(NSInteger)bitRate
272
+                                        rect:(CGRect)rect;
273
+@end
274
+#endif
275
+
276
+__attribute__((visibility("default"))) @interface AgoraRtcDefaultRenderer: NSObject<AgoraVideoSinkProtocol>
277
+@property (nonatomic, strong, readonly) VIEW_CLASS * _Nonnull view;
278
+@property (nonatomic, assign) AgoraVideoRenderMode mode;
279
+- (instancetype _Nonnull)initWithView:(VIEW_CLASS * _Nonnull)view
280
+                           renderMode:(AgoraVideoRenderMode)mode;
281
+@end

+ 765
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraObjects.h Прегледај датотеку

@@ -0,0 +1,765 @@
1
+//
2
+//  AgoraObjects.h
3
+//  AgoraRtcEngineKit
4
+//
5
+//  Copyright (c) 2018 Agora. All rights reserved.
6
+//
7
+
8
+#import <Foundation/Foundation.h>
9
+#import <CoreMedia/CoreMedia.h>
10
+#import "AgoraEnumerates.h"
11
+
12
+#if TARGET_OS_IPHONE
13
+#import <UIKit/UIKit.h>
14
+typedef UIView VIEW_CLASS;
15
+typedef UIColor COLOR_CLASS;
16
+#elif TARGET_OS_MAC
17
+#import <AppKit/AppKit.h>
18
+typedef NSView VIEW_CLASS;
19
+typedef NSColor COLOR_CLASS;
20
+#endif
21
+
22
+/** Properties of the video canvas object.
23
+ */
24
+__attribute__((visibility("default"))) @interface AgoraRtcVideoCanvas : NSObject
25
+/** The video display view.
26
+
27
+ VIEW_CLASS is a general name for this property. See the following definitions for iOS and macOS:
28
+
29
+ - iOS: UIView
30
+ - MacOS: NSView
31
+ */
32
+@property (strong, nonatomic) VIEW_CLASS* _Nullable view;
33
+/** Render mode of the view: AgoraVideoRenderMode
34
+ */
35
+@property (assign, nonatomic) AgoraVideoRenderMode renderMode;
36
+/** User ID of the view.
37
+ */
38
+@property (assign, nonatomic) NSUInteger uid;
39
+@end
40
+
41
+/** Statistics of the local video stream.
42
+ */
43
+__attribute__((visibility("default"))) @interface AgoraRtcLocalVideoStats : NSObject
44
+/** Data transmission bitrate (Kbps) since last count.
45
+ */
46
+@property (assign, nonatomic) NSUInteger sentBitrate;
47
+/** Data transmission frame rate (fps) since last count.
48
+ */
49
+@property (assign, nonatomic) NSUInteger sentFrameRate;
50
+@end
51
+
52
+/** Statistics of the remote video stream.
53
+ */
54
+__attribute__((visibility("default"))) @interface AgoraRtcRemoteVideoStats : NSObject
55
+/** User ID of the user sending the video streams.
56
+ */
57
+@property (assign, nonatomic) NSUInteger uid;
58
+/** Time delay (ms).
59
+ */
60
+@property (assign, nonatomic) NSUInteger __deprecated delay;
61
+/** Width (pixels) of the video stream.
62
+ */
63
+@property (assign, nonatomic) NSUInteger width;
64
+/** Height (pixels) of the video stream.
65
+ */
66
+@property (assign, nonatomic) NSUInteger height;
67
+/** Data receive bitrate (Kbps) since last count.
68
+ */
69
+@property (assign, nonatomic) NSUInteger receivedBitrate;
70
+/** Data receive frame rate (fps) since last count.
71
+ */
72
+@property (assign, nonatomic) NSUInteger receivedFrameRate;
73
+/** Video stream type (high-stream or low-stream).
74
+ */
75
+@property (assign, nonatomic) AgoraVideoStreamType rxStreamType;
76
+@end
77
+
78
+/** Statistics of the remote audio stream.
79
+ */
80
+__attribute__((visibility("default"))) @interface AgoraRtcRemoteAudioStats : NSObject
81
+/** User ID of the user sending the audio streams.
82
+ */
83
+@property (assign, nonatomic) NSUInteger uid;
84
+/** Audio quality received by the user.
85
+ */
86
+@property (assign, nonatomic) NSUInteger quality;
87
+/** Network delay from the sender to the receiver.
88
+ */
89
+@property (assign, nonatomic) NSUInteger networkTransportDelay;
90
+/** Jitter buffer delay at the receiver.
91
+ */
92
+@property (assign, nonatomic) NSUInteger jitterBufferDelay;
93
+/** Packet loss rate in the reported interval.
94
+ */
95
+@property (assign, nonatomic) NSUInteger audioLossRate;
96
+@end
97
+
98
+/** Properties of the audio volume information.
99
+
100
+An array containing the user ID and volume information for each speaker:
101
+
102
+- uid: User ID of the speaker. The uid of the local user is 0.
103
+- volume:Volume of the speaker. The value ranges between 0 (lowest volume) and 255 (highest volume).
104
+ */
105
+__attribute__((visibility("default"))) @interface AgoraRtcAudioVolumeInfo : NSObject
106
+/** User ID of the speaker.
107
+ */
108
+@property (assign, nonatomic) NSUInteger uid;
109
+/** The volume of the speaker. The value ranges between 0 (lowest volume) to 255 (highest volume).
110
+ */
111
+@property (assign, nonatomic) NSUInteger volume;
112
+@end
113
+
114
+/** Statistics of the channel
115
+ */
116
+__attribute__((visibility("default"))) @interface AgoraChannelStats: NSObject
117
+/** Call duration in seconds, represented by an aggregate value.
118
+ */
119
+@property (assign, nonatomic) NSInteger duration;
120
+/** Total number of bytes transmitted, represented by an aggregate value.
121
+ */
122
+@property (assign, nonatomic) NSInteger txBytes;
123
+/** Total number of bytes received, represented by an aggregate value.
124
+ */
125
+@property (assign, nonatomic) NSInteger rxBytes;
126
+/** Audio transmission bitrate (Kbps), represented by an instantaneous value.
127
+ */
128
+@property (assign, nonatomic) NSInteger txAudioKBitrate;
129
+/** Audio receive bitrate (Kbps), represented by an instantaneous value.
130
+ */
131
+@property (assign, nonatomic) NSInteger rxAudioKBitrate;
132
+/** Video transmission bitrate (Kbps), represented by an instantaneous value.
133
+ */
134
+@property (assign, nonatomic) NSInteger txVideoKBitrate;
135
+/** Video receive bitrate (Kbps), represented by an instantaneous value.
136
+ */
137
+@property (assign, nonatomic) NSInteger rxVideoKBitrate;
138
+/** Client-server latency (ms)
139
+ */
140
+@property (assign, nonatomic) NSInteger lastmileDelay;
141
+/** Number of users in the channel.
142
+
143
+- Communication profile: The number of users in the channel.
144
+- Live broadcast profile:
145
+
146
+  - If the local user is an audience: The number of hosts in the channel + 1.
147
+  - if the user is a host: The number of hosts in the channel.
148
+ */
149
+@property (assign, nonatomic) NSInteger userCount;
150
+/** Application CPU usage (%).
151
+ */
152
+@property (assign, nonatomic) double cpuAppUsage;
153
+/** System CPU usage (%).
154
+ */
155
+@property (assign, nonatomic) double cpuTotalUsage;
156
+@end
157
+
158
+/** Properties of the video encoder configuration.
159
+ */
160
+__attribute__((visibility("default"))) @interface AgoraVideoEncoderConfiguration: NSObject
161
+/** The video frame dimension used to specify the video quality in the total number of pixels along a frame's width and height.
162
+
163
+You can customize the dimension, or select from the following list:
164
+
165
+ - AgoraVideoDimension120x120
166
+ - AgoraVideoDimension160x120
167
+ - AgoraVideoDimension180x180
168
+ - AgoraVideoDimension240x180
169
+ - AgoraVideoDimension320x180
170
+ - AgoraVideoDimension240x240
171
+ - AgoraVideoDimension320x240
172
+ - AgoraVideoDimension424x240
173
+ - AgoraVideoDimension360x360
174
+ - AgoraVideoDimension480x360
175
+ - AgoraVideoDimension640x360
176
+ - AgoraVideoDimension480x480
177
+ - AgoraVideoDimension640x480
178
+ - AgoraVideoDimension840x480
179
+ - AgoraVideoDimension960x720
180
+ - AgoraVideoDimension1280x720
181
+
182
+ Note:
183
+
184
+ - The dimension does not specify the orientation mode of the output ratio. For how to set the video orientation, see [AgoraVideoOutputOrientationMode](AgoraVideoOutputOrientationMode).
185
+ - Whether 720p can be supported depends on the device. If the device cannot support 720p, the frame rate will be lower than the one listed in the table. Agora optimizes the video in lower-end devices.
186
+ - iPhone does not support video frame dimensions above 720p.
187
+ */
188
+@property (assign, nonatomic) CGSize dimensions;
189
+
190
+/** Frame rate of the video: AgoraVideoFrameRate
191
+
192
+  *  AgoraVideoFrameRateFps1(1): 1 fps
193
+  *  AgoraVideoFrameRateFps7(7): 7 fps
194
+  *  AgoraVideoFrameRateFps10(10): 10 fps
195
+  *  AgoraVideoFrameRateFps15(15): 15 fps
196
+  *  AgoraVideoFrameRateFps24(24): 24 fps
197
+  *  AgoraVideoFrameRateFps30(30): 30 fps
198
+  *  AgoraVideoFrameRateFps60(30): 60 fps (macOS only)
199
+ */
200
+@property (assign, nonatomic) AgoraVideoFrameRate frameRate;
201
+
202
+/** Bitrate of the video.
203
+
204
+ Sets the video bitrate (Kbps). Refer to the table below and set your bitrate. If the bitrate you set is beyond the proper range, the SDK automatically adjusts it to a value within the range. You can also choose from the following options:
205
+
206
+ - AgoraVideoBitrateStandard: (Recommended) The standard bitrate mode. In this mode, the bitrates differ between the live broadcast and communication profiles:
207
+
208
+     - Communication profile: The video bitrate is the same as the base bitrate.
209
+     - Live broadcast profile: The video bitrate is twice the base bitrate.
210
+
211
+ - AgoraVideoBitrateCompatible: The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. In a live broadcast profile, if you choose this mode, the video frame rate may be lower than the set value.
212
+
213
+Agora uses different video codecs for different profiles to optimize the user experience. For example, a communication profile prioritizes the smoothness while a live broadcast profile prioritizes the video quality (a higher bitrate). Therefore, Agora recommends setting this parameter as AgoraVideoBitrateStandard.
214
+
215
+**Video Bitrate Table**
216
+
217
+| Resolution        	| Frame Rate (fps) 	| Base Bitrate (Kbps, for Communication) 	| Live Bitrate (Kbps, for Live Broadcast) 	|
218
+|-------------------	|------------------	|----------------------------------------	|-----------------------------------------	|
219
+| 160 &times; 120   	| 15               	| 65                                     	| 130                                     	|
220
+| 120 &times; 120   	| 15               	| 50                                     	| 100                                     	|
221
+| 320 &times; 180   	| 15               	| 140                                    	| 280                                     	|
222
+| 180 &times; 180   	| 15               	| 100                                    	| 200                                     	|
223
+| 240 &times; 180   	| 15               	| 120                                    	| 240                                     	|
224
+| 320 &times; 240   	| 15               	| 200                                    	| 400                                     	|
225
+| 240 &times; 240   	| 15               	| 140                                    	| 280                                     	|
226
+| 424 &times; 240   	| 15               	| 220                                    	| 440                                     	|
227
+| 640 &times; 360   	| 15               	| 400                                    	| 800                                     	|
228
+| 360 &times; 360   	| 15               	| 260                                    	| 520                                     	|
229
+| 640 &times; 360   	| 30               	| 600                                    	| 1200                                    	|
230
+| 360 &times; 360   	| 30               	| 400                                    	| 800                                     	|
231
+| 480 &times; 360   	| 15               	| 320                                    	| 640                                     	|
232
+| 480 &times; 360   	| 30               	| 490                                    	| 980                                     	|
233
+| 640 &times; 480   	| 15               	| 500                                    	| 1000                                    	|
234
+| 480 &times; 480   	| 15               	| 400                                    	| 800                                     	|
235
+| 640 &times; 480   	| 30               	| 750                                    	| 1500                                    	|
236
+| 480 &times; 480   	| 30               	| 600                                    	| 1200                                    	|
237
+| 848 &times; 480   	| 15               	| 610                                    	| 1220                                    	|
238
+| 848 &times; 480   	| 30               	| 930                                    	| 1860                                    	|
239
+| 640 &times; 480   	| 10               	| 400                                    	| 800                                     	|
240
+| 1280 &times; 720  	| 15               	| 1130                                   	| 2260                                    	|
241
+| 1280 &times; 720  	| 30               	| 1710                                   	| 3420                                    	|
242
+| 960 &times; 720   	| 15               	| 910                                    	| 1820                                    	|
243
+| 960 &times; 720   	| 30               	| 1380                                   	| 2760                                    	|
244
+| 1920 &times; 1080 	| 15               	| 2080                                   	| 4160                                    	|
245
+| 1920 &times; 1080 	| 30               	| 3150                                   	| 6300                                    	|
246
+| 1920 &times; 1080 	| 60               	| 4780                                   	| 6500                                    	|
247
+| 2560 &times; 1440 	| 30               	| 4850                                   	| 6500                                    	|
248
+| 2560 &times; 1440 	| 60               	| 6500                                   	| 6500                                    	|
249
+| 3840 &times; 2160 	| 30               	| 6500                                   	| 6500                                    	|
250
+| 3840 &times; 2160 	| 60               	| 6500                                   	| 6500                                    	|
251
+
252
+
253
+**Note:**
254
+
255
+The base bitrate in this table applies to a communication profile. A live broadcast profile generally requires a higher bitrate for better video quality. Agora recommends setting the bitrate mode as AgoraVideoBitrateStandard. You can also set the bitrate as twice the base bitrate.
256
+
257
+
258
+*/
259
+@property (assign, nonatomic) NSInteger bitrate;
260
+
261
+/** The minimum encoding bitrate.
262
+
263
+Sets the minimum encoding bitrate, in Kbps.
264
+
265
+The Agora SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. Unless you have special requirements for image quality, Agora does not recommend changing this value.
266
+
267
+**Note:**
268
+
269
+This parameter applies only to the live broadcast profile.*/
270
+@property (assign, nonatomic) NSInteger minBitrate;
271
+
272
+/** Video orientation mode of the video: AgoraVideoOutputOrientationMode
273
+
274
+ * AgoraVideoOutputOrientationModeAdaptative(0): (Default) The output video always follows the orientation of the captured video, because the receiver takes the rotational information passed on from the video encoder.
275
+   - If the captured video is in landscape mode, the output video is in landscape mode.
276
+   - If the captured video is in portrait mode, the output video is in portrait mode.
277
+ * AgoraVideoOutputOrientationModeFixedLandscape(1): The output video is always in landscape mode. If the captured video is in portrait mode, the video encoder crops it to fit the output. This applies to situations where the receiver cannot process the rotational information. For example, CDN live streaming.
278
+ * AgoraVideoOutputOrientationModeFixedPortrait(2): The output video is always in portrait mode. If the captured video is in landscape mode, the video encoder crops it to fit the output. This applies to situations where the receiver cannot process the rotational information. For example, CDN live streaming.
279
+
280
+For scenarios with video rotation, Agora provides [Basic: Video Rotation Guide](https://docs.agora.io/en/2.3/product/Interactive%20Broadcast/Quickstart%20Guide/rotation_guide_ios) to guide users on how to set this parameter to get the video orientation that they want.
281
+
282
+ */
283
+@property (assign, nonatomic) AgoraVideoOutputOrientationMode orientationMode;
284
+
285
+/** Initializes and returns a newly allocated AgoraVideoEncoderConfiguration object with the specified video resolution.
286
+
287
+ @param size Video resolution.
288
+ @param frameRate Video frame rate.
289
+ @param bitrate Video bitrate.
290
+ @param orientationMode AgoraVideoOutputOrientationMode.
291
+ @return An initialized AgoraVideoEncoderConfiguration object.
292
+ */
293
+- (instancetype _Nonnull)initWithSize:(CGSize)size
294
+                            frameRate:(AgoraVideoFrameRate)frameRate
295
+                              bitrate:(NSInteger)bitrate
296
+                      orientationMode:(AgoraVideoOutputOrientationMode)orientationMode;
297
+
298
+/** Initializes and returns a newly allocated AgoraVideoEncoderConfiguration object with the specified video width and height.
299
+
300
+ @param width Width of the video.
301
+ @param height Height of the video.
302
+ @param frameRate Video frame rate.
303
+ @param bitrate Video bitrate.
304
+ @param orientationMode AgoraVideoOutputOrientationMode.
305
+ @return An initialized AgoraVideoEncoderConfiguration object.
306
+ */
307
+- (instancetype _Nonnull)initWithWidth:(NSInteger)width
308
+                                height:(NSInteger)height
309
+                             frameRate:(AgoraVideoFrameRate)frameRate
310
+                               bitrate:(NSInteger)bitrate
311
+                       orientationMode:(AgoraVideoOutputOrientationMode)orientationMode;
312
+@end
313
+
314
+/** A class for providing user-specific CDN live audio/video transcoding settings.
315
+ */
316
+__attribute__((visibility("default"))) @interface AgoraLiveTranscodingUser: NSObject
317
+/** User ID of the CDN live host.
318
+ */
319
+@property (assign, nonatomic) NSUInteger uid;
320
+/** Position and size of the video frame.
321
+ */
322
+@property (assign, nonatomic) CGRect rect;
323
+/**  Layer position of the video frame. The value ranges between 0 and 100.
324
+
325
+From v2.3.0, the Agora SDK supports setting zOrder as 0.
326
+
327
+    - 0: (Default) Lowest.
328
+    - 100: Highest.
329
+
330
+ Note: If the value is set to < 0 or > 100, the ERR_INVALID_ARGUMENT error occurs.
331
+ */
332
+@property (assign, nonatomic) NSInteger zOrder;
333
+/** Transparency of the video frame.
334
+
335
+ The value ranges between 0.0 and 1.0:
336
+
337
+ * 0.0: Completely transparent.
338
+ * 1.0: (Default) Opaque.
339
+ */
340
+@property (assign, nonatomic) double alpha;
341
+/** The audio channel of the sound.
342
+
343
+ The default value is 0:
344
+
345
+    - 0: (Default) Supports dual channels. Depends on the upstream of the broadcaster.
346
+    - 1: The audio stream of the broadcaster uses the FL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first.
347
+    - 2: The audio stream of the broadcaster uses the FC audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first.
348
+    - 3: The audio stream of the broadcaster uses the FR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first.
349
+    - 4: The audio stream of the broadcaster uses the BL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first.
350
+    - 5: The audio stream of the broadcaster uses the BR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first.
351
+
352
+Note: If your setting is not 0, you may need a specialized player.
353
+ */
354
+@property (assign, nonatomic) NSInteger audioChannel;
355
+@end
356
+
357
+/** Image properties.
358
+
359
+ A class for setting the properties of the watermark and background images in live broadcasting.
360
+ */
361
+__attribute__((visibility("default"))) @interface AgoraImage: NSObject
362
+/** HTTP/HTTPS address of the image on the broadcasting video.
363
+ */
364
+@property (strong, nonatomic) NSURL *_Nonnull url;
365
+/** Position and size of the image on the broadcasting video in CGRect.
366
+ */
367
+@property (assign, nonatomic) CGRect rect;
368
+@end
369
+
370
+/** A class for managing user-specific CDN live audio/video transcoding settings.
371
+ */
372
+__attribute__((visibility("default"))) @interface AgoraLiveTranscoding: NSObject
373
+/** Size of the video (width and height).
374
+ */
375
+@property (assign, nonatomic) CGSize size;
376
+/** Bitrate of the CDN live output video stream. The default value is 400 Kbps.
377
+ */
378
+@property (assign, nonatomic) NSInteger videoBitrate;
379
+/** Frame rate of the CDN live output video stream. The default value is 15 fps.
380
+ */
381
+@property (assign, nonatomic) NSInteger videoFramerate;
382
+/** Latency mode:
383
+
384
+ * YES: Low latency with unassured quality.
385
+ * NO:(Default)High latency with assured quality.
386
+ */
387
+@property (assign, nonatomic) BOOL lowLatency;
388
+/** Video GOP in frames. The default value is 30 fps. */
389
+@property (assign, nonatomic) NSInteger videoGop;
390
+/** Video codec profile type: AgoraVideoCodecProfileType.
391
+ */
392
+@property (assign, nonatomic) AgoraVideoCodecProfileType videoCodecProfile;
393
+
394
+/** An AgoraLiveTranscodingUser object managing the user layout configuration in the CDN live stream. Agora supports a maximum of 17 transcoding users in a CDN live stream channel. See AgoraLiveTranscodingUser for details.
395
+ */
396
+@property (copy, nonatomic) NSArray<AgoraLiveTranscodingUser *> *_Nullable transcodingUsers;
397
+/** Reserved property. Extra user-defined information to send SEI for the H.264/H.265 video stream to the CDN live client.
398
+ */
399
+@property (copy, nonatomic) NSString *_Nullable transcodingExtraInfo;
400
+/** The watermark image added to the CDN live publishing stream.
401
+
402
+The audience of the CDN live publishing stream can see the watermark. See AgoraImage for the definition of the watermark.
403
+ */
404
+@property (strong, nonatomic) AgoraImage *_Nullable watermark;
405
+/** The background image added to the CDN live publishing stream.
406
+
407
+The audience of the CDN live publishing stream can see the background image. See AgoraImage for the definition of the background image.
408
+ */
409
+@property (strong, nonatomic) AgoraImage *_Nullable backgroundImage;
410
+/** The background color in RGB hex value. Value only, do not include a #.
411
+
412
+COLOR_CLASS is a general name for the type:
413
+
414
+* iOS: UIColor
415
+* MacOS: NSColor
416
+ */
417
+@property (strong, nonatomic) COLOR_CLASS *_Nullable backgroundColor;
418
+
419
+/** Self-defined audio sampling rate: AgoraAudioSampleRateType.
420
+ */
421
+@property (assign, nonatomic) AgoraAudioSampleRateType audioSampleRate;
422
+/** Bitrate (Kbps) of the CDN live audio output stream. The default value is 48, and the highest value is 128.
423
+ */
424
+@property (assign, nonatomic) NSInteger audioBitrate;
425
+/** Agora’s self-defined audio channel type. Agora recommends choosing 1 or 2. Special players are required if you choose 3, 4 or 5:
426
+
427
+ * 1: (Default) Mono
428
+ * 2: Two-channel stereo
429
+ * 3: Three-channel stereo
430
+ * 4: Four-channel stereo
431
+ * 5: Five-channel stereo
432
+ */
433
+@property (assign, nonatomic) NSInteger audioChannels;
434
+
435
+/** Creates a default transcoding object.
436
+
437
+ @return Default AgoraLiveTranscoding object.
438
+ */
439
++(AgoraLiveTranscoding *_Nonnull) defaultTranscoding;
440
+
441
+-(int)addUser:(AgoraLiveTranscodingUser * _Nonnull)user;
442
+
443
+-(int)removeUser:(NSUInteger)uid;
444
+@end
445
+
446
+/** Configuration of the imported live broadcast voice or video stream.
447
+ */
448
+__attribute__((visibility("default"))) @interface AgoraLiveInjectStreamConfig: NSObject
449
+/** Size of the added stream to the broadcast.
450
+
451
+The default value is 0; same size as the original stream.
452
+ */
453
+@property (assign, nonatomic) CGSize size;
454
+/** Video GOP of the added stream to the broadcast.
455
+
456
+The default value is 30 fps.
457
+ */
458
+@property (assign, nonatomic) NSInteger videoGop;
459
+/** Video frame rate of the added stream to the broadcast.
460
+
461
+The default value is 15 fps.
462
+ */
463
+@property (assign, nonatomic) NSInteger videoFramerate;
464
+/** Video bitrate of the added stream to the broadcast.
465
+
466
+The default value is 400 Kbps.
467
+
468
+The setting of the video bitrate is closely linked to the resolution. If the video bitrate you set is beyond a reasonable range, the SDK will set it within a reasonable range instead.
469
+ */
470
+@property (assign, nonatomic) NSInteger videoBitrate;
471
+
472
+/** Audio sampling rate of the added stream to the broadcast.
473
+
474
+The default value is 48000. See AgoraAudioSampleRateType for details.
475
+
476
+**Note:**
477
+
478
+Agora recommends using the default value.
479
+ */
480
+@property (assign, nonatomic) AgoraAudioSampleRateType audioSampleRate;
481
+/** Audio bitrate of the added stream to the broadcast.
482
+
483
+The default value is 48 Kbps.
484
+
485
+**Note:**
486
+
487
+Agora recommends using the default value.
488
+ */
489
+@property (assign, nonatomic) NSInteger audioBitrate;
490
+/** Number of audio channels to add to the broadcast. The values are 1 and 2.
491
+
492
+The default value is 1.
493
+
494
+**Note:**
495
+
496
+Agora recommends using the default value.
497
+ */
498
+@property (assign, nonatomic) NSInteger audioChannels;
499
+
500
+/** Creates a default stream configuration object.
501
+
502
+ @return Default stream configuration object.
503
+ */
504
++(AgoraLiveInjectStreamConfig *_Nonnull) defaultConfig;
505
+@end
506
+
507
+__deprecated
508
+
509
+/** Defines the region to show the video on the screen for each host in the channel.
510
+
511
+**DEPRECATED**
512
+
513
+ */
514
+__attribute__((visibility("default"))) @interface AgoraRtcVideoCompositingRegion : NSObject
515
+/** ID of the user whose video is displayed on the screen. */
516
+@property (assign, nonatomic) NSUInteger uid;
517
+/** Horizontal position of the region on the screen. The value ranges between 0.0 and 1.0. */
518
+@property (assign, nonatomic) CGFloat x;
519
+/** Vertical position of the region on the screen. The value ranges between 0.0 and 1.0. */
520
+@property (assign, nonatomic) CGFloat y;
521
+/** Actual width of the region. The value ranges between 0.0 and 1.0. For example, if the width of the screen is 360, and the width of the region is 120, set the width value as 0.33. */
522
+@property (assign, nonatomic) CGFloat width;
523
+/** Actual height of the region. The value ranges between 0.0 and 1.0. For example, if the height of the screen is 240, and the height of the region is 120, set the height value as 0.5. */
524
+@property (assign, nonatomic) CGFloat height;
525
+/** Layer position of the region. The value ranges between 0 and 100:
526
+
527
+- 0: The region is at the bottom layer.
528
+- 100: The region is at the top layer.
529
+
530
+From v2.3.0, the Agora SDK supports setting zOrder as 0.
531
+ */
532
+@property (assign, nonatomic) NSInteger zOrder;
533
+/** The transparency of the region. The value ranges between 0.0 and 1.0:
534
+
535
+- 0: The region is transparent.
536
+- 1: (Default) The region is opaque.
537
+*/
538
+@property (assign, nonatomic) CGFloat alpha;
539
+/** Please ignore this property. Setting this property will not take effect. */
540
+@property (assign, nonatomic) AgoraVideoRenderMode renderMode;
541
+@end
542
+
543
+__deprecated
544
+/** Rtc video compositing layout.
545
+
546
+**DEPRECATED**
547
+ */
548
+__attribute__((visibility("default"))) @interface AgoraRtcVideoCompositingLayout : NSObject
549
+/** Please ignore this property.
550
+
551
+Width of the entire canvas (display window or screen).
552
+ */
553
+@property (assign, nonatomic) NSInteger canvasWidth;
554
+/** Please ignore this property.
555
+
556
+Height of the entire canvas (display window or screen).
557
+ */
558
+@property (assign, nonatomic) NSInteger canvasHeight;
559
+/** The background color in RGB hex value. Value only, do not include a #.
560
+ */
561
+@property (copy, nonatomic) NSString * _Nullable backgroundColor;
562
+/** Screen display region information.
563
+
564
+Sets the screen display region of a host or a delegated host in a CDN live stream. See AgoraRtcVideoCompositingRegion for details.
565
+ */
566
+@property (copy, nonatomic) NSArray<AgoraRtcVideoCompositingRegion *> * _Nullable regions;
567
+/** Application defined data. Maximum size of 2048 bytes. */
568
+@property (copy, nonatomic) NSString * _Nullable appData;
569
+@end
570
+
571
+/** CDN live stream settings.
572
+
573
+ **DEPRECATED**
574
+
575
+ Agora recommends using [setLiveTranscoding]([AgoraRtcEngineKit setLiveTranscoding:]) to set the CDN live stream settings.
576
+ */
577
+__deprecated
578
+__attribute__((visibility("default"))) @interface AgoraPublisherConfiguration : NSObject
579
+/** Sets whether or not the current host is the RTMP stream owner.
580
+
581
+ - YES: (Default) The current host is the RTMP stream owner and the push-stream configuration is enabled.
582
+ - NO: The current host is not the RTMP stream owner and the push-stream configuration is disabled.
583
+ */
584
+@property (assign, nonatomic) BOOL owner;
585
+
586
+/** Width of the CDN live output data stream. The default value is 360.
587
+ */
588
+@property (assign, nonatomic) NSInteger width;
589
+/** Height of the CDN live output data stream. The default value is 640.
590
+ */
591
+@property (assign, nonatomic) NSInteger height;
592
+/** Frame rate of the CDN live output data stream. The default value is 15 fps.
593
+ */
594
+@property (assign, nonatomic) NSInteger framerate;
595
+/** Bitrate of the CDN live output data stream. The default value is 500 Kbps.
596
+ */
597
+@property (assign, nonatomic) NSInteger bitrate;
598
+/** Audio sample rate of the CDN live output data stream. The default value is 48000.
599
+ */
600
+@property (assign, nonatomic) NSInteger audiosamplerate;
601
+/** Audio bitrate of the CDN live output data stream.  The default value is 48.
602
+ */
603
+@property (assign, nonatomic) NSInteger audiobitrate;
604
+/** Audio channels of the CDN live output data stream. The default value is 1.
605
+ */
606
+@property (assign, nonatomic) NSInteger audiochannels;
607
+/**
608
+
609
+* 0: Tile horizontally.
610
+* 1: Layered windows.
611
+* 2: Tile vertically.
612
+ */
613
+@property (assign, nonatomic) NSInteger defaultLayout;
614
+/** CDN live video stream lifecycle: AgoraRtmpStreamLifeCycle.
615
+ */
616
+@property (assign, nonatomic) AgoraRtmpStreamLifeCycle lifeCycle;
617
+
618
+/** Width of the injected stream. Set it as 0.
619
+ */
620
+@property (assign, nonatomic) NSInteger injectStreamWidth;
621
+
622
+/** Height of the injected stream. Set it as 0.
623
+ */
624
+@property (assign, nonatomic) NSInteger injectStreamHeight;
625
+
626
+/** Address of the injected stream into the channel.
627
+ */
628
+@property (copy, nonatomic) NSString * _Nullable injectStreamUrl;
629
+
630
+/** The push-stream address for the picture-in-picture layouts. The default value is nil.
631
+ */
632
+@property (copy, nonatomic) NSString * _Nullable publishUrl;
633
+
634
+/** The push-stream HTTP/HTTPS URL address of the original stream not requiring picture-blending. The default value is nil.
635
+ */
636
+@property (copy, nonatomic) NSString * _Nullable rawStreamUrl;
637
+
638
+/** Reserved field. The default value is nil.
639
+ */
640
+@property (copy, nonatomic) NSString * _Nullable extraInfo;
641
+
642
+/** Whether or not the configuration is validated.
643
+ */
644
+-(BOOL) validate;
645
+@end
646
+
647
+#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
648
+
649
+/** AgoraRtcDeviceInfo array.
650
+ */
651
+__attribute__((visibility("default"))) @interface AgoraRtcDeviceInfo : NSObject
652
+@property (assign, nonatomic) int __deprecated index;
653
+
654
+/** Device type: AgoraMediaDeviceType.
655
+ */
656
+@property (assign, nonatomic) AgoraMediaDeviceType type;
657
+
658
+/** Device ID.
659
+ */
660
+@property (copy, nonatomic) NSString * _Nullable deviceId;
661
+
662
+/** Device name.
663
+ */
664
+@property (copy, nonatomic) NSString * _Nullable deviceName;
665
+@end
666
+#endif
667
+
668
+/** Video frame containing the Agora SDK's encoded video data.
669
+ */
670
+__attribute__((visibility("default"))) @interface AgoraVideoFrame : NSObject
671
+/** Video format:
672
+
673
+ * 1: I420
674
+ * 2: BGRA
675
+ * 3: NV21
676
+ * 4: RGBA
677
+ * 5: IMC2
678
+ * 7: ARGB
679
+ * 8: NV12
680
+ * 12: iOS texture (CVPixelBufferRef)
681
+ */
682
+@property (assign, nonatomic) NSInteger format;
683
+
684
+/** Timestamp of the incoming video frame (ms).
685
+
686
+An incorrect timestamp results in frame loss or unsynchronized audio and video.
687
+
688
+ */
689
+@property (assign, nonatomic) CMTime time; // Time for this frame.
690
+
691
+@property (assign, nonatomic) int stride DEPRECATED_MSG_ATTRIBUTE("use strideInPixels instead");
692
+
693
+/** Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture.
694
+ */
695
+@property (assign, nonatomic) int strideInPixels; // Number of pixels between two consecutive rows. Note: in pixel, not byte. Not used for iOS textures.
696
+
697
+/** Height of the incoming video frame
698
+ */
699
+@property (assign, nonatomic) int height; // Number of rows of pixels. Not used for iOS textures.
700
+
701
+/** CVPixelBuffer
702
+ */
703
+@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
704
+
705
+/** Raw data buffer
706
+ */
707
+@property (strong, nonatomic) NSData * _Nullable dataBuf;  // Raw data buffer. Not used for iOS textures.
708
+
709
+/** (Optional) The number of pixels trimmed from the left. The default value is 0.
710
+ */
711
+@property (assign, nonatomic) int cropLeft;   // Number of pixels to crop on the left boundary.
712
+/** (Optional) The number of pixels trimmed from the top. The default value is 0.
713
+ */
714
+@property (assign, nonatomic) int cropTop;    // Number of pixels to crop on the top boundary.
715
+/** (Optional) The number of pixels trimmed from the right. The default value is 0.
716
+ */
717
+@property (assign, nonatomic) int cropRight;  // Number of pixels to crop on the right boundary.
718
+/** (Optional) The number of pixels trimmed from the bottom. The default value is 0.
719
+ */
720
+@property (assign, nonatomic) int cropBottom; // Number of pixels to crop on the bottom boundary.
721
+/** (Optional) The clockwise rotation of the incoming video frame.
722
+
723
+Optional values: 0, 90, 180, or 270. The default value is 0.
724
+ */
725
+@property (assign, nonatomic) int rotation;   // 0, 90, 180, 270. See document for rotation calculation.
726
+/* Note
727
+ * 1. strideInPixels
728
+ *    Stride is in pixels, not bytes.
729
+ * 2. About the frame width and height.
730
+ *    No field is defined for the width. However, it can be deduced by:
731
+ *       croppedWidth = (strideInPixels - cropLeft - cropRight)
732
+ *    And
733
+ *       croppedHeight = (height - cropTop - cropBottom)
734
+ * 3. About crop.
735
+ *    _________________________________________________________________.....
736
+ *    |                        ^                                      |  ^
737
+ *    |                        |                                      |  |
738
+ *    |                     cropTop                                   |  |
739
+ *    |                        |                                      |  |
740
+ *    |                        v                                      |  |
741
+ *    |                ________________________________               |  |
742
+ *    |                |                              |               |  |
743
+ *    |                |                              |               |  |
744
+ *    |<-- cropLeft -->|          valid region        |<- cropRight ->|
745
+ *    |                |                              |               | height
746
+ *    |                |                              |               |
747
+ *    |                |_____________________________ |               |  |
748
+ *    |                        ^                                      |  |
749
+ *    |                        |                                      |  |
750
+ *    |                     cropBottom                                |  |
751
+ *    |                        |                                      |  |
752
+ *    |                        v                                      |  v
753
+ *    _________________________________________________________________......
754
+ *    |                                                               |
755
+ *    |<---------------- strideInPixels ----------------------------->|
756
+ *
757
+ *    If your buffer contains garbage data, you can crop them. For example, the frame size is
758
+ *    360 &times; 640, often the buffer stride is 368, that is, the extra 8 pixels on the
759
+ *    right are for padding, and should be removed. In this case, you can set:
760
+ *    strideInPixels = 368;
761
+ *    height = 640;
762
+ *    cropRight = 8;
763
+ *    // cropLeft, cropTop, cropBottom are set to a default of 0
764
+ */
765
+@end

+ 3110
- 1341
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraRtcEngineKit.h
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 36
- 2
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraMediaEngine.h Прегледај датотеку

@@ -31,6 +31,7 @@ public:
31 31
     int samplesPerSec;  //sampling rate
32 32
     void* buffer;  //data buffer
33 33
     int64_t renderTimeMs;
34
+    int avsync_type;
34 35
   };
35 36
 public:
36 37
   virtual bool onRecordAudioFrame(AudioFrame& audioFrame) = 0;
@@ -57,6 +58,7 @@ public:
57 58
     void* vBuffer;  //V data buffer
58 59
     int rotation; // rotation of this frame (0, 90, 180, 270)
59 60
     int64_t renderTimeMs;
61
+    int avsync_type;
60 62
   };
61 63
 public:
62 64
   virtual bool onCaptureVideoFrame(VideoFrame& videoFrame) = 0;
@@ -164,14 +166,46 @@ public:
164 166
   virtual IExternalVideoRender* createRenderInstance(const ExternalVideoRenerContext& context) = 0;
165 167
 };
166 168
 
167
-class IMediaEngine
169
+struct ExternalVideoFrame
168 170
 {
171
+  enum VIDEO_BUFFER_TYPE
172
+  {
173
+    VIDEO_BUFFER_RAW_DATA = 1,
174
+  };
175
+
176
+  enum VIDEO_PIXEL_FORMAT
177
+  {
178
+    VIDEO_PIXEL_UNKNOWN = 0,
179
+    VIDEO_PIXEL_I420 = 1,
180
+    VIDEO_PIXEL_BGRA = 2,
181
+    VIDEO_PIXEL_NV12 = 8,
182
+  };
183
+
184
+  VIDEO_BUFFER_TYPE type;
185
+  VIDEO_PIXEL_FORMAT format;
186
+  void* buffer;
187
+  int stride;
188
+  int height;
189
+  int cropLeft;
190
+  int cropTop;
191
+  int cropRight;
192
+  int cropBottom;
193
+  int rotation;
194
+  long long timestamp;
195
+};
196
+
197
+class IMediaEngine {
169 198
 public:
170 199
   virtual void release() = 0;
171 200
   virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0;
172 201
   virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0;
173 202
   virtual int registerVideoRenderFactory(IExternalVideoRenderFactory* factory) = 0;
174
-  virtual int pushAudioFrame(MEDIA_SOURCE_TYPE type, IAudioFrameObserver::AudioFrame *frame, bool wrap = false){ return -1; }
203
+  virtual int pushAudioFrame(MEDIA_SOURCE_TYPE type, IAudioFrameObserver::AudioFrame *frame, bool wrap) = 0;
204
+  virtual int pushAudioFrame(IAudioFrameObserver::AudioFrame *frame) = 0;
205
+  virtual int pullAudioFrame(IAudioFrameObserver::AudioFrame *frame) = 0;
206
+
207
+  virtual int setExternalVideoSource(bool enable, bool useTexture) = 0;
208
+  virtual int pushVideoFrame(ExternalVideoFrame *frame) = 0;
175 209
 };
176 210
 
177 211
 } //media

+ 4123
- 1696
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraRtcEngine.h
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 79
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraService.h Прегледај датотеку

@@ -0,0 +1,79 @@
1
+//  Agora SDK
2
+//
3
+//  Copyright (c) 2018 Agora.io. All rights reserved.
4
+//
5
+
6
+#ifndef AGORA_SERVICE_H
7
+#define AGORA_SERVICE_H
8
+#include "AgoraBase.h"
9
+
10
+namespace agora {
11
+    namespace rtc {
12
+        class IRtcEngine;
13
+    }
14
+    namespace signaling {
15
+        class ISignalingEngine;
16
+    }
17
+namespace base {
18
+
19
+struct AgoraServiceContext
20
+{
21
+};
22
+
23
+
24
+class IAgoraService
25
+{
26
+protected:
27
+    virtual ~IAgoraService(){}
28
+public:
29
+    virtual void release() = 0;
30
+
31
+	/**
32
+    * Initializes the engine.
33
+    * @param context RtcEngine context.
34
+    @return
35
+
36
+     - 0: Success.
37
+     - < 0: Failure.
38
+    */
39
+    virtual int initialize(const AgoraServiceContext& context) = 0;
40
+
41
+    /** Retrieves the SDK version number.
42
+    * @param build Build number.
43
+    * @return The current SDK version in the string format. For example, 2.3.0
44
+    */
45
+    virtual const char* getVersion(int* build) = 0;
46
+
47
+    virtual rtc::IRtcEngine* createRtcEngine() = 0;
48
+    virtual signaling::ISignalingEngine* createSignalingEngine() = 0;
49
+};
50
+
51
+} //namespace base
52
+} // namespace agora
53
+
54
+/**
55
+* Gets the SDK version number.
56
+* @param build Build number of the Agora SDK.
57
+ @return
58
+
59
+ - 0: Success.
60
+ - < 0: Failure.
61
+*/
62
+AGORA_API const char* AGORA_CALL getAgoraSdkVersion(int* build);
63
+
64
+/**
65
+* Creates the RtcEngine object and returns the pointer.
66
+* @param err Error code
67
+* @return returns Description of the error code
68
+*/
69
+AGORA_API const char* AGORA_CALL getAgoraSdkErrorDescription(int err);
70
+
71
+/**
72
+* Creates the Agora Service object and returns the pointer.
73
+* @return returns Pointer of the Agora Service object
74
+*/
75
+AGORA_API agora::base::IAgoraService* AGORA_CALL createAgoraService();
76
+
77
+AGORA_API int AGORA_CALL setAgoraSdkExternalSymbolLoader(void* (*func)(const char* symname));
78
+
79
+#endif

+ 0
- 62
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/ICodingModuleCallback.h Прегледај датотеку

@@ -1,62 +0,0 @@
1
-
2
-#ifndef _I_CODING_MODULE_CALLBACK_H_
3
-#define _I_CODING_MODULE_CALLBACK_H_
4
-
5
-#ifdef AGORAVOICE_EXPORT
6
-#define AGORAVOICE_DLLEXPORT HELPER_DLL_EXPORT
7
-#elif AGORAVOICE_DLL
8
-#define AGORAVOICE_DLLIMPORT HELPER_DLL_IMPORT
9
-#else
10
-#define AGORAVOICE_DLLEXPORT
11
-#endif
12
-
13
-namespace AgoraRTC {
14
-
15
-  struct VFrameInfo {
16
-    int frame_type; //2: Key frame, 0: P Frame, 1: B Frame
17
-    unsigned int frame_num;
18
-    unsigned int width;
19
-    unsigned int height;
20
-    bool sps_pps_handle;
21
-  };
22
-
23
-  // Callback class used for recording/playback video file
24
-  class VCMVideoFileCallback {
25
-  public:
26
-    virtual int onDecodeVideo(unsigned int video_ts, unsigned char payload_type, unsigned char* buffer, unsigned int length, VFrameInfo info) = 0;
27
-    virtual int onEncodeVideo(unsigned int video_ts, unsigned char payload_type, unsigned char* buffer, unsigned int length, VFrameInfo info) = 0;
28
-
29
-    virtual int onDecodeVideoSEI(const char* info, int len) = 0;
30
-    //virtual int onEncodeVideoSEI(char** info, int *len) = 0;
31
-  };
32
-
33
-  // Callback class used for recording/playback audio file
34
-  class ACMAudioFileCallback {
35
-  public:
36
-    virtual int onDecodeAudio(unsigned int audio_ts, unsigned char payload_type, unsigned int channels, unsigned char* buffer, unsigned int length) = 0;
37
-    virtual int onEncodeAudio(unsigned int audio_ts, unsigned char payload_type, unsigned int channels, unsigned char* buffer, unsigned int length) = 0;
38
-  };
39
-
40
-  class ICMFile : public VCMVideoFileCallback,
41
-                  public ACMAudioFileCallback {
42
-  public:
43
-    virtual int startAudioRecord() = 0;
44
-    virtual int startVideoRecord() = 0;
45
-    virtual int stopAudioRecord() = 0;
46
-    virtual int stopVideoRecord() = 0;
47
-    virtual int setVideoRotation(int rotation) = 0;
48
-  };
49
-
50
-  class ICMFileObserver {
51
-  public:
52
-    virtual ICMFile* GetICMFileObject(unsigned int uid) = 0;
53
-    virtual int InsertRawAudioPacket(unsigned int uid, const unsigned char*  payloadData, unsigned short payloadSize,
54
-      int payload_type, unsigned int timeStamp, unsigned short seqNumber) = 0;
55
-  };
56
-
57
-}
58
-
59
-AGORAVOICE_DLLEXPORT int RegisterICMFileObserver(AgoraRTC::ICMFileObserver* observer);
60
-AGORAVOICE_DLLEXPORT int Set264SPSPPS(char* spspps, int len);
61
-
62
-#endif