Commit cee4135a by Anand.suthar

Add agora framework & int's integration

parent 5ca567d5
......@@ -58,12 +58,12 @@
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "555413985.959007"
timestampString = "556268845.984683"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "109">
offsetFromSymbolStart = "104">
</Location>
<Location
shouldBeEnabled = "Yes"
......@@ -73,12 +73,12 @@
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "555413985.963246"
timestampString = "556268845.988762"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "112">
offsetFromSymbolStart = "120">
</Location>
<Location
shouldBeEnabled = "Yes"
......@@ -88,12 +88,12 @@
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "555413985.967458"
timestampString = "556268845.991715"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "607">
offsetFromSymbolStart = "424">
</Location>
<Location
shouldBeEnabled = "Yes"
......@@ -103,12 +103,12 @@
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "555413985.971509"
timestampString = "556268845.995146"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "470">
offsetFromSymbolStart = "380">
</Location>
</Locations>
</BreakpointContent>
......
......@@ -46,9 +46,9 @@
<key>NSMicrophoneUsageDescription</key>
<string>Fengushi would like to access your microphone to record audio</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Uses Photo</string>
<string>Fengushi would like to access your photos for sharing</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Uses Photo</string>
<string>Fengushi would like to access your photos for sharing</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
......
......@@ -7,16 +7,30 @@
//
import UIKit
import AgoraRtcEngineKit
class VideoCallingViewController: UIViewController {
@IBOutlet var imgMaleFeMale: UIImageView!
@IBOutlet var imgAvtar: UIImageView!
@IBOutlet var lblCustomerName: UILabel!
@IBOutlet weak var localVideo: UIView! // 3.
@IBOutlet weak var remoteVideo: UIView! // 5.
var agoraKit: AgoraRtcEngineKit!
override func viewDidLoad() {
super.viewDidLoad()
initializeAgoraEngine()
setupVideo()
setupLocalVideo()
joinChannel()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.view.sendSubview(toBack: remoteVideo)
}
}
......@@ -29,11 +43,110 @@ extension VideoCallingViewController {
}
@IBAction func switchCamera() {
agoraKit.switchCamera()
}
@IBAction func endCall() {
leaveChannel()
}
}
extension VideoCallingViewController {
func initializeAgoraEngine() {
agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: kAGORA_APP_ID, delegate: self)
}
func setupVideo() {
agoraKit.enableVideo() // Default mode is disableVideo
agoraKit.setVideoProfile(.landscape360P, swapWidthAndHeight: false) // Default video profile is 360P
}
func setupLocalVideo() {
let videoCanvas = AgoraRtcVideoCanvas()
videoCanvas.uid = 0
videoCanvas.view = localVideo
videoCanvas.renderMode = .fit
agoraKit.setupLocalVideo(videoCanvas)
}
func joinChannel() {
agoraKit.joinChannel(byToken: nil, channelId: "demoChannel1", info:nil, uid:0) {[weak self] (sid, uid, elapsed) -> Void in
// Join channel "demoChannel1"
if let weakSelf = self {
weakSelf.agoraKit.setEnableSpeakerphone(true)
UIApplication.shared.isIdleTimerDisabled = true
}
}
}
func leaveChannel() {
agoraKit.leaveChannel(nil)
remoteVideo.removeFromSuperview()
localVideo.removeFromSuperview()
}
}
extension VideoCallingViewController: AgoraRtcEngineDelegate {
// Tutorial Step 5
func rtcEngine(_ engine: AgoraRtcEngineKit, firstRemoteVideoDecodedOfUid uid:UInt, size:CGSize, elapsed:Int) {
if (remoteVideo.isHidden) {
remoteVideo.isHidden = false
}
let videoCanvas = AgoraRtcVideoCanvas()
videoCanvas.uid = uid
videoCanvas.view = remoteVideo
videoCanvas.renderMode = .fit
agoraKit.setupRemoteVideo(videoCanvas)
}
@IBAction func clock() {
// Tutorial Step 7
internal func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid:UInt, reason:AgoraUserOfflineReason) {
self.remoteVideo.isHidden = true
}
// Tutorial Step 10
func rtcEngine(_ engine: AgoraRtcEngineKit, didVideoMuted muted:Bool, byUid:UInt) {
// remoteVideo.isHidden = muted
// remoteVideoMutedIndicator.isHidden = !muted
}
}
......@@ -9,3 +9,4 @@
import Foundation
let kAPP_BLUE_COLOR = 0x066ba4 //Orange 0xf7b237
let kAGORA_APP_ID = "cb8a242be9344e3aba76c8de8707c10c"
......@@ -1078,6 +1078,11 @@
<constraint firstItem="81E-Ic-WDa" firstAttribute="leading" secondItem="PTJ-jA-KrH" secondAttribute="trailing" constant="20" id="q6D-Hk-efn"/>
<constraint firstItem="Ttf-fa-5zM" firstAttribute="leading" secondItem="81E-Ic-WDa" secondAttribute="trailing" constant="8" id="xH3-Fa-GI3"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="shadowOpacity">
<real key="value" value="0.10000000000000001"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="viewHeight" destination="bf7-u2-aKM" id="JbW-VA-Svr"/>
</connections>
......@@ -1101,15 +1106,25 @@
</constraints>
<state key="normal" image="close"/>
<connections>
<action selector="clock" destination="U6b-jI-xwG" eventType="touchUpInside" id="jpx-Hp-yRT"/>
<action selector="endCall" destination="U6b-jI-xwG" eventType="touchUpInside" id="I4F-vZ-aev"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RRd-Zr-GXG">
<rect key="frame" x="255" y="111" width="92" height="128"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="128" id="xVS-Rh-mix"/>
<constraint firstAttribute="width" constant="92" id="zz0-Ip-IHh"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Npn-MY-dwi" firstAttribute="leading" secondItem="Mfw-qU-Qgh" secondAttribute="leading" id="4RZ-Td-KMg"/>
<constraint firstItem="Mfw-qU-Qgh" firstAttribute="trailing" secondItem="k8L-FA-O78" secondAttribute="trailing" constant="102" id="4pS-t0-vnJ"/>
<constraint firstItem="RRd-Zr-GXG" firstAttribute="top" secondItem="k8L-FA-O78" secondAttribute="bottom" constant="27" id="Dd6-hB-cso"/>
<constraint firstItem="k8L-FA-O78" firstAttribute="leading" secondItem="Mfw-qU-Qgh" secondAttribute="leading" id="KNe-Ik-OYR"/>
<constraint firstItem="Mfw-qU-Qgh" firstAttribute="trailing" secondItem="RRd-Zr-GXG" secondAttribute="trailing" constant="28" id="Kgo-iG-wyv"/>
<constraint firstItem="lAl-ii-80X" firstAttribute="top" secondItem="Mfw-qU-Qgh" secondAttribute="top" constant="30" id="NaJ-sV-TTs"/>
<constraint firstItem="Npn-MY-dwi" firstAttribute="trailing" secondItem="Mfw-qU-Qgh" secondAttribute="trailing" id="Pnx-Fh-ZdF"/>
<constraint firstItem="lAl-ii-80X" firstAttribute="leading" secondItem="eci-ho-zOE" secondAttribute="trailing" constant="15" id="VWc-W0-Ubg"/>
......@@ -1126,11 +1141,13 @@
<outlet property="imgAvtar" destination="81E-Ic-WDa" id="0eO-Ww-60Q"/>
<outlet property="imgMaleFeMale" destination="UTP-dm-kjr" id="gmt-FP-zfz"/>
<outlet property="lblCustomerName" destination="Ttf-fa-5zM" id="Cvs-3n-pQs"/>
<outlet property="localVideo" destination="RRd-Zr-GXG" id="O23-iJ-lsC"/>
<outlet property="remoteVideo" destination="Npn-MY-dwi" id="kEI-sP-ZzP"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="nhp-dO-5PY" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="5161" y="116"/>
<point key="canvasLocation" x="5160.8000000000002" y="115.59220389805098"/>
</scene>
<!--Edit Result View Controller-->
<scene sceneID="fGT-Ih-kSu">
......
......@@ -22,5 +22,5 @@ target 'Bhagyashree' do
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'AgoraRtcEngine_iOS', '2.2.0'
end
PODS:
- AgoraRtcEngine_iOS (2.2.0)
- BufferSlider (0.1.6)
- Crashlytics (3.10.1):
- Fabric (~> 1.7.5)
......@@ -67,6 +68,7 @@ PODS:
- WMPageController (2.3.0)
DEPENDENCIES:
- AgoraRtcEngine_iOS (= 2.2.0)
- BufferSlider (= 0.1.6)
- Crashlytics
- EasyToast (= 2.0)
......@@ -89,6 +91,7 @@ DEPENDENCIES:
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- AgoraRtcEngine_iOS
- BufferSlider
- Crashlytics
- EasyToast
......@@ -117,6 +120,7 @@ SPEC REPOS:
- WMPageController
SPEC CHECKSUMS:
AgoraRtcEngine_iOS: 616331997992150073b68aa5737929fdee1491c8
BufferSlider: f95e72170e9ba51799c62090295ee50e193521ef
Crashlytics: aee1a064cbbf99b32efa3f056a5f458d846bc8ff
EasyToast: 243209f3536e47ae0d9e12fe5330367d6a0d7b82
......@@ -144,6 +148,6 @@ SPEC CHECKSUMS:
TimeAgoInWords: 633dbb30810de855333dedd1d5033d28b1ecfd6f
WMPageController: 9f219bb8912a1a1f51af11fde61e2682a7b7e7f2
PODFILE CHECKSUM: 612cf2d8c67fd5ad7333652e83c98b9778d9881e
PODFILE CHECKSUM: b376ed8a9c64f69a0b9ee9bf8ad4ed33a5b0118d
COCOAPODS: 1.5.3
//
// Agora Engine SDK
//
// Created by Sting Feng in 2017-11.
// Copyright (c) 2017 Agora.io. All rights reserved.
//
#ifndef AGORA_BASE_H
#define AGORA_BASE_H
#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define AGORA_CALL __cdecl
#if defined(AGORARTC_EXPORT)
#define AGORA_API extern "C" __declspec(dllexport)
#else
#define AGORA_API extern "C" __declspec(dllimport)
#endif
#elif defined(__APPLE__)
#define AGORA_API __attribute__((visibility("default"))) extern "C"
#define AGORA_CALL
#elif defined(__ANDROID__) || defined(__linux__)
#define AGORA_API extern "C" __attribute__((visibility("default")))
#define AGORA_CALL
#else
#define AGORA_API extern "C"
#define AGORA_CALL
#endif
namespace agora {
namespace util {
template<class T>
class AutoPtr {
typedef T value_type;
typedef T* pointer_type;
public:
AutoPtr(pointer_type p=0)
:ptr_(p)
{}
~AutoPtr() {
if (ptr_)
ptr_->release();
}
operator bool() const { return ptr_ != (pointer_type)0; }
value_type& operator*() const {
return *get();
}
pointer_type operator->() const {
return get();
}
pointer_type get() const {
return ptr_;
}
pointer_type release() {
pointer_type tmp = ptr_;
ptr_ = 0;
return tmp;
}
void reset(pointer_type ptr = 0) {
if (ptr != ptr_ && ptr_)
ptr_->release();
ptr_ = ptr;
}
template<class C1, class C2>
bool queryInterface(C1* c, C2 iid) {
pointer_type p = NULL;
if (c && !c->queryInterface(iid, (void**)&p))
{
reset(p);
}
return p != NULL;
}
private:
AutoPtr(const AutoPtr&);
AutoPtr& operator=(const AutoPtr&);
private:
pointer_type ptr_;
};
class IString {
public:
virtual bool empty() const = 0;
virtual const char* c_str() = 0;
virtual const char* data() = 0;
virtual size_t length() = 0;
virtual void release() = 0;
};
typedef AutoPtr<IString> AString;
}//namespace util
enum INTERFACE_ID_TYPE
{
AGORA_IID_AUDIO_DEVICE_MANAGER = 1,
AGORA_IID_VIDEO_DEVICE_MANAGER = 2,
AGORA_IID_RTC_ENGINE_PARAMETER = 3,
AGORA_IID_MEDIA_ENGINE = 4,
AGORA_IID_SIGNALING_ENGINE = 8,
};
enum WARN_CODE_TYPE
{
WARN_INVALID_VIEW = 8,
WARN_INIT_VIDEO = 16,
WARN_PENDING = 20,
WARN_NO_AVAILABLE_CHANNEL = 103,
WARN_LOOKUP_CHANNEL_TIMEOUT = 104,
WARN_LOOKUP_CHANNEL_REJECTED = 105,
WARN_OPEN_CHANNEL_TIMEOUT = 106,
WARN_OPEN_CHANNEL_REJECTED = 107,
// sdk: 100~1000
WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111,
WARN_SET_CLIENT_ROLE_TIMEOUT = 118,
WARN_OPEN_CHANNEL_INVALID_TICKET = 121,
WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122,
WARN_AUDIO_MIXING_OPEN_ERROR = 701,
WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014,
WARN_ADM_RUNTIME_RECORDING_WARNING = 1016,
WARN_ADM_RECORD_AUDIO_SILENCE = 1019,
WARN_ADM_PLAYOUT_MALFUNCTION = 1020,
WARN_ADM_RECORD_MALFUNCTION = 1021,
WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD = 1029,
WARN_ADM_IOS_SAMPLERATE_CHANGE = 1030,
WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031,
WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032,
WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040,
WARN_APM_HOWLING = 1051,
WARN_ADM_GLITCH_STATE = 1052,
WARN_ADM_IMPROPER_SETTINGS = 1053,
WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324,
};
enum ERROR_CODE_TYPE
{
ERR_OK = 0,
//1~1000
ERR_FAILED = 1,
ERR_INVALID_ARGUMENT = 2,
ERR_NOT_READY = 3,
ERR_NOT_SUPPORTED = 4,
ERR_REFUSED = 5,
ERR_BUFFER_TOO_SMALL = 6,
ERR_NOT_INITIALIZED = 7,
ERR_NO_PERMISSION = 9,
ERR_TIMEDOUT = 10,
ERR_CANCELED = 11,
ERR_TOO_OFTEN = 12,
ERR_BIND_SOCKET = 13,
ERR_NET_DOWN = 14,
ERR_NET_NOBUFS = 15,
ERR_JOIN_CHANNEL_REJECTED = 17,
ERR_LEAVE_CHANNEL_REJECTED = 18,
ERR_ALREADY_IN_USE = 19,
ERR_ABORTED = 20,
ERR_INIT_NET_ENGINE = 21,
ERR_RESOURCE_LIMITED = 22,
ERR_INVALID_APP_ID = 101,
ERR_INVALID_CHANNEL_NAME = 102,
ERR_TOKEN_EXPIRED = 109,
ERR_INVALID_TOKEN = 110,
ERR_CONNECTION_INTERRUPTED = 111, // only used in web sdk
ERR_CONNECTION_LOST = 112, // only used in web sdk
ERR_NOT_IN_CHANNEL = 113,
ERR_SIZE_TOO_LARGE = 114,
ERR_BITRATE_LIMIT = 115,
ERR_TOO_MANY_DATA_STREAMS = 116,
ERR_STREAM_MESSAGE_TIMEOUT = 117,
ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119,
ERR_DECRYPTION_FAILED = 120,
ERR_CLIENT_IS_BANNED_BY_SERVER = 123,
ERR_WATERMARK_PARAM = 124,
ERR_WATERMARK_PATH = 125,
ERR_WATERMARK_PNG = 126,
ERR_WATERMARKR_INFO = 127,
ERR_WATERMARK_ARGB = 128,
ERR_WATERMARK_READ = 129,
ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130,
//signaling: 400~600
ERR_LOGOUT_OTHER = 400, //
ERR_LOGOUT_USER = 401, // logout by user
ERR_LOGOUT_NET = 402, // network failure
ERR_LOGOUT_KICKED = 403, // login in other device
ERR_LOGOUT_PACKET = 404, //
ERR_LOGOUT_TOKEN_EXPIRED = 405, // token expired
ERR_LOGOUT_OLDVERSION = 406, //
ERR_LOGOUT_TOKEN_WRONG = 407,
ERR_LOGOUT_ALREADY_LOGOUT = 408,
ERR_LOGIN_OTHER = 420,
ERR_LOGIN_NET = 421,
ERR_LOGIN_FAILED = 422,
ERR_LOGIN_CANCELED = 423,
ERR_LOGIN_TOKEN_EXPIRED = 424,
ERR_LOGIN_OLD_VERSION = 425,
ERR_LOGIN_TOKEN_WRONG = 426,
ERR_LOGIN_TOKEN_KICKED = 427,
ERR_LOGIN_ALREADY_LOGIN = 428,
ERR_JOIN_CHANNEL_OTHER = 440,
ERR_SEND_MESSAGE_OTHER = 440,
ERR_SEND_MESSAGE_TIMEOUT = 441,
ERR_QUERY_USERNUM_OTHER = 450,
ERR_QUERY_USERNUM_TIMEOUT = 451,
ERR_QUERY_USERNUM_BYUSER = 452,
ERR_LEAVE_CHANNEL_OTHER = 460,
ERR_LEAVE_CHANNEL_KICKED = 461,
ERR_LEAVE_CHANNEL_BYUSER = 462,
ERR_LEAVE_CHANNEL_LOGOUT = 463,
ERR_LEAVE_CHANNEL_DISCONNECTED = 464,
ERR_INVITE_OTHER = 470,
ERR_INVITE_REINVITE = 471,
ERR_INVITE_NET = 472,
ERR_INVITE_PEER_OFFLINE = 473,
ERR_INVITE_TIMEOUT = 474,
ERR_INVITE_CANT_RECV = 475,
//1001~2000
ERR_LOAD_MEDIA_ENGINE = 1001,
ERR_START_CALL = 1002,
ERR_START_CAMERA = 1003,
ERR_START_VIDEO_RENDER = 1004,
ERR_ADM_GENERAL_ERROR = 1005,
ERR_ADM_JAVA_RESOURCE = 1006,
ERR_ADM_SAMPLE_RATE = 1007,
ERR_ADM_INIT_PLAYOUT = 1008,
ERR_ADM_START_PLAYOUT = 1009,
ERR_ADM_STOP_PLAYOUT = 1010,
ERR_ADM_INIT_RECORDING = 1011,
ERR_ADM_START_RECORDING = 1012,
ERR_ADM_STOP_RECORDING = 1013,
ERR_ADM_RUNTIME_PLAYOUT_ERROR = 1015,
ERR_ADM_RUNTIME_RECORDING_ERROR = 1017,
ERR_ADM_RECORD_AUDIO_FAILED = 1018,
ERR_ADM_INIT_LOOPBACK = 1022,
ERR_ADM_START_LOOPBACK = 1023,
ERR_ADM_NO_PERMISSION = 1027,
ERR_ADM_RECORD_AUDIO_IS_ACTIVE = 1033,
ERR_ADM_ANDROID_JNI_JAVA_RESOURCE = 1101,
ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY = 1108,
ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY = 1109,
ERR_ADM_ANDROID_JNI_JAVA_START_RECORD = 1111,
ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK = 1112,
ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR = 1115,
ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE = 1151,
ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER = 1153,
ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD = 1156,
ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER = 1157,
ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD = 1160,
ERR_ADM_IOS_INPUT_NOT_AVAILABLE = 1201,
ERR_ADM_IOS_ACTIVATE_SESSION_FAIL = 1206,
ERR_ADM_IOS_VPIO_INIT_FAIL = 1210,
ERR_ADM_IOS_VPIO_REINIT_FAIL = 1213,
ERR_ADM_IOS_VPIO_RESTART_FAIL = 1214,
ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL = 1219,
ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO = 1221,
ERR_ADM_WIN_CORE_INIT = 1301,
ERR_ADM_WIN_CORE_INIT_RECORDING = 1303,
ERR_ADM_WIN_CORE_INIT_PLAYOUT = 1306,
ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL = 1307,
ERR_ADM_WIN_CORE_START_RECORDING = 1309,
ERR_ADM_WIN_CORE_CREATE_REC_THREAD = 1311,
ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP = 1314,
ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD = 1319,
ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP = 1320,
ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
ERR_ADM_WIN_WAVE_INIT = 1351,
ERR_ADM_WIN_WAVE_INIT_RECORDING = 1353,
ERR_ADM_WIN_WAVE_INIT_MICROPHONE = 1354,
ERR_ADM_WIN_WAVE_INIT_PLAYOUT = 1355,
ERR_ADM_WIN_WAVE_INIT_SPEAKER = 1356,
ERR_ADM_WIN_WAVE_START_RECORDING = 1357,
ERR_ADM_WIN_WAVE_START_PLAYOUT = 1358,
ERR_ADM_NO_RECORDING_DEVICE = 1359,
ERR_ADM_NO_PLAYOUT_DEVICE = 1360,
// VDM error code starts from 1500
ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501,
// VCM error code starts from 1600
ERR_VCM_UNKNOWN_ERROR = 1600,
ERR_VCM_ENCODER_INIT_ERROR = 1601,
ERR_VCM_ENCODER_ENCODE_ERROR = 1602,
ERR_VCM_ENCODER_SET_ERROR = 1603,
};
enum LOG_FILTER_TYPE
{
LOG_FILTER_OFF = 0,
LOG_FILTER_DEBUG = 0x080f,
LOG_FILTER_INFO = 0x000f,
LOG_FILTER_WARN = 0x000e,
LOG_FILTER_ERROR = 0x000c,
LOG_FILTER_CRITICAL = 0x0008,
LOG_FILTER_MASK = 0x80f,
};
} // namespace agora
#endif
//
// AgoraEnumerates.h
// AgoraRtcEngineKit
//
// Created by Yuhua Gong
// Copyright (c) 2015 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
// channel
typedef NS_ENUM(NSInteger, AgoraWarningCode) {
AgoraWarningCodeInvalidView = 8,
AgoraWarningCodeInitVideo = 16,
AgoraWarningCodePending = 20,
AgoraWarningCodeNoAvailableChannel = 103,
AgoraWarningCodeLookupChannelTimeout = 104,
AgoraWarningCodeLookupChannelRejected = 105,
AgoraWarningCodeOpenChannelTimeout = 106,
AgoraWarningCodeOpenChannelRejected = 107,
AgoraWarningCodeSwitchLiveVideoTimeout = 111,
// sdk:vos, callmanager, peermanager: 100~1000
AgoraWarningCodeSetClientRoleTimeout = 118,
AgoraWarningCodeSetClientRoleNotAuthorized = 119,
AgoraWarningCodeOpenChannelInvalidTicket = 121,
AgoraWarningCodeOpenChannelTryNextVos = 122,
AgoraWarningCodeAudioMixingOpenError = 701,
AgoraWarningCodeAdmRuntimePlayoutWarning = 1014,
AgoraWarningCodeAdmRuntimeRecordingWarning = 1016,
AgoraWarningCodeAdmRecordAudioSilence = 1019,
AgoraWarningCodeAdmPlaybackMalfunction = 1020,
AgoraWarningCodeAdmRecordMalfunction = 1021,
AgoraWarningCodeAdmInterruption = 1025,
AgoraWarningCodeAdmRecordAudioLowlevel = 1031,
AgoraWarningCodeAdmPlayoutAudioLowlevel = 1032,
AgoraWarningCodeApmHowling = 1051,
AgoraWarningCodeAdmGlitchState = 1052,
AgoraWarningCodeAdmImproperSettings = 1053,
};
typedef NS_ENUM(NSInteger, AgoraErrorCode) {
AgoraErrorCodeNoError = 0,
AgoraErrorCodeFailed = 1,
AgoraErrorCodeInvalidArgument = 2,
AgoraErrorCodeNotReady = 3,
AgoraErrorCodeNotSupported = 4,
AgoraErrorCodeRefused = 5,
AgoraErrorCodeBufferTooSmall = 6,
AgoraErrorCodeNotInitialized = 7,
AgoraErrorCodeNoPermission = 9,
AgoraErrorCodeTimedOut = 10,
AgoraErrorCodeCanceled = 11,
AgoraErrorCodeTooOften = 12,
AgoraErrorCodeBindSocket = 13,
AgoraErrorCodeNetDown = 14,
AgoraErrorCodeNoBufs = 15,
AgoraErrorCodeJoinChannelRejected = 17,
AgoraErrorCodeLeaveChannelRejected = 18,
AgoraErrorCodeAlreadyInUse = 19,
AgoraErrorCodeAbort = 20,
AgoraErrorCodeInitNetEngine = 21,
AgoraErrorCodeResourceLimited = 22,
AgoraErrorCodeInvalidAppId = 101,
AgoraErrorCodeInvalidChannelId = 102,
AgoraErrorCodeTokenExpired = 109,
AgoraErrorCodeInvalidToken = 110,
AgoraErrorCodeConnectionInterrupted = 111, // only used in web sdk
AgoraErrorCodeConnectionLost = 112, // only used in web sdk
AgoraErrorCodeNotInChannel = 113,
AgoraErrorCodeSizeTooLarge = 114,
AgoraErrorCodeBitrateLimit = 115,
AgoraErrorCodeTooManyDataStreams = 116,
AgoraErrorCodeDecryptionFailed = 120,
AgoraErrorCodeWatermarkParam = 124,
AgoraErrorCodeWatermarkPath = 125,
AgoraErrorCodeWatermarkPng = 126,
AgoraErrorCodeWatermarkInfo = 127,
AgoraErrorCodeWatermarkAGRB = 128,
AgoraErrorCodeWatermarkRead = 129,
AgoraErrorCodeEncryptedStreamNotAllowedPublish = 130,
AgoraErrorCodePublishFailed = 150,
AgoraErrorCodeLoadMediaEngine = 1001,
AgoraErrorCodeStartCall = 1002,
AgoraErrorCodeStartCamera = 1003,
AgoraErrorCodeStartVideoRender = 1004,
AgoraErrorCodeAdmGeneralError = 1005,
AgoraErrorCodeAdmJavaResource = 1006,
AgoraErrorCodeAdmSampleRate = 1007,
AgoraErrorCodeAdmInitPlayout = 1008,
AgoraErrorCodeAdmStartPlayout = 1009,
AgoraErrorCodeAdmStopPlayout = 1010,
AgoraErrorCodeAdmInitRecording = 1011,
AgoraErrorCodeAdmStartRecording = 1012,
AgoraErrorCodeAdmStopRecording = 1013,
AgoraErrorCodeAdmRuntimePlayoutError = 1015,
AgoraErrorCodeAdmRuntimeRecordingError = 1017,
AgoraErrorCodeAdmRecordAudioFailed = 1018,
AgoraErrorCodeAdmPlayAbnormalFrequency = 1020,
AgoraErrorCodeAdmRecordAbnormalFrequency = 1021,
AgoraErrorCodeAdmInitLoopback = 1022,
AgoraErrorCodeAdmStartLoopback = 1023,
AgoraErrorCodeAdmNoRecordingDevice = 1359,
AgoraErrorCodeAdmNoPlayoutDevice = 1360,
// 1025, as warning for interruption of adm on ios
// 1026, as warning for route change of adm on ios
// VDM error code starts from 1500
AgoraErrorCodeVdmCameraNotAuthorized = 1501,
// VCM error code starts from 1600
AgoraErrorCodeVcmUnknownError = 1600,
AgoraErrorCodeVcmEncoderInitError = 1601,
AgoraErrorCodeVcmEncoderEncodeError = 1602,
AgoraErrorCodeVcmEncoderSetError = 1603,
};
typedef NS_ENUM(NSInteger, AgoraVideoProfile) {
// res fps
AgoraVideoProfileInvalid = -1,
AgoraVideoProfileLandscape120P = 0, // 160x120 15
#if TARGET_OS_IPHONE
AgoraVideoProfileLandscape120P_3 = 2, // 120x120 15
AgoraVideoProfileLandscape180P = 10, // 320x180 15
AgoraVideoProfileLandscape180P_3 = 12, // 180x180 15
AgoraVideoProfileLandscape180P_4 = 13, // 240x180 15
#endif
AgoraVideoProfileLandscape240P = 20, // 320x240 15
#if TARGET_OS_IPHONE
AgoraVideoProfileLandscape240P_3 = 22, // 240x240 15
AgoraVideoProfileLandscape240P_4 = 23, // 424x240 15
#endif
AgoraVideoProfileLandscape360P = 30, // 640x360 15
#if TARGET_OS_IPHONE
AgoraVideoProfileLandscape360P_3 = 32, // 360x360 15
#endif
AgoraVideoProfileLandscape360P_4 = 33, // 640x360 30
AgoraVideoProfileLandscape360P_6 = 35, // 360x360 30
AgoraVideoProfileLandscape360P_7 = 36, // 480x360 15
AgoraVideoProfileLandscape360P_8 = 37, // 480x360 30
AgoraVideoProfileLandscape360P_9 = 38, // 640x360 15
AgoraVideoProfileLandscape360P_10 = 39, // 640x360 24
AgoraVideoProfileLandscape360P_11 = 100, // 640x360 24
AgoraVideoProfileLandscape480P = 40, // 640x480 15
#if TARGET_OS_IPHONE
AgoraVideoProfileLandscape480P_3 = 42, // 480x480 15
#endif
AgoraVideoProfileLandscape480P_4 = 43, // 640x480 30
AgoraVideoProfileLandscape480P_6 = 45, // 480x480 30
AgoraVideoProfileLandscape480P_8 = 47, // 848x480 15
AgoraVideoProfileLandscape480P_9 = 48, // 848x480 30
AgoraVideoProfileLandscape480P_10 = 49, // 640x480 10
AgoraVideoProfileLandscape720P = 50, // 1280x720 15
AgoraVideoProfileLandscape720P_3 = 52, // 1280x720 30
AgoraVideoProfileLandscape720P_5 = 54, // 960x720 15
AgoraVideoProfileLandscape720P_6 = 55, // 960x720 30
#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
AgoraVideoProfileLandscape1080P = 60, // 1920x1080 15
AgoraVideoProfileLandscape1080P_3 = 62, // 1920x1080 30
AgoraVideoProfileLandscape1080P_5 = 64, // 1920x1080 60
AgoraVideoProfileLandscape1440P = 66, // 2560x1440 30
AgoraVideoProfileLandscape1440P_2 = 67, // 2560x1440 60
AgoraVideoProfileLandscape4K = 70, // 3840x2160 30
AgoraVideoProfileLandscape4K_3 = 72, // 3840x2160 60
#endif
AgoraVideoProfilePortrait120P = 1000, // 120x160 15
#if TARGET_OS_IPHONE
AgoraVideoProfilePortrait120P_3 = 1002, // 120x120 15
AgoraVideoProfilePortrait180P = 1010, // 180x320 15
AgoraVideoProfilePortrait180P_3 = 1012, // 180x180 15
AgoraVideoProfilePortrait180P_4 = 1013, // 180x240 15
#endif
AgoraVideoProfilePortrait240P = 1020, // 240x320 15
#if TARGET_OS_IPHONE
AgoraVideoProfilePortrait240P_3 = 1022, // 240x240 15
AgoraVideoProfilePortrait240P_4 = 1023, // 240x424 15
#endif
AgoraVideoProfilePortrait360P = 1030, // 360x640 15
#if TARGET_OS_IPHONE
AgoraVideoProfilePortrait360P_3 = 1032, // 360x360 15
#endif
AgoraVideoProfilePortrait360P_4 = 1033, // 360x640 30
AgoraVideoProfilePortrait360P_6 = 1035, // 360x360 30
AgoraVideoProfilePortrait360P_7 = 1036, // 360x480 15
AgoraVideoProfilePortrait360P_8 = 1037, // 360x480 30
AgoraVideoProfilePortrait360P_9 = 1038, // 360x640 15
AgoraVideoProfilePortrait360P_10 = 1039, // 360x640 24
AgoraVideoProfilePortrait360P_11 = 1100, // 360x640 24
AgoraVideoProfilePortrait480P = 1040, // 480x640 15
#if TARGET_OS_IPHONE
AgoraVideoProfilePortrait480P_3 = 1042, // 480x480 15
#endif
AgoraVideoProfilePortrait480P_4 = 1043, // 480x640 30
AgoraVideoProfilePortrait480P_6 = 1045, // 480x480 30
AgoraVideoProfilePortrait480P_8 = 1047, // 480x848 15
AgoraVideoProfilePortrait480P_9 = 1048, // 480x848 30
AgoraVideoProfilePortrait480P_10 = 1049, // 480x640 10
AgoraVideoProfilePortrait720P = 1050, // 720x1280 15
AgoraVideoProfilePortrait720P_3 = 1052, // 720x1280 30
AgoraVideoProfilePortrait720P_5 = 1054, // 720x960 15
AgoraVideoProfilePortrait720P_6 = 1055, // 720x960 30
#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
AgoraVideoProfilePortrait1080P = 1060, // 1080x1920 15
AgoraVideoProfilePortrait1080P_3 = 1062, // 1080x1920 30
AgoraVideoProfilePortrait1080P_5 = 1064, // 1080x1920 60
AgoraVideoProfilePortrait1440P = 1066, // 1440x2560 30
AgoraVideoProfilePortrait1440P_2 = 1067, // 1440x2560 60
AgoraVideoProfilePortrait4K = 1070, // 2160x3840 30
AgoraVideoProfilePortrait4K_3 = 1072, // 2160x3840 60
#endif
AgoraVideoProfileDEFAULT = AgoraVideoProfileLandscape360P,
};
typedef NS_ENUM(NSInteger, AgoraChannelProfile) {
AgoraChannelProfileCommunication = 0,
AgoraChannelProfileLiveBroadcasting = 1,
AgoraChannelProfileGame = 2,
};
typedef NS_ENUM(NSInteger, AgoraClientRole) {
AgoraClientRoleBroadcaster = 1,
AgoraClientRoleAudience = 2,
};
typedef NS_ENUM(NSInteger, AgoraMediaType) {
AgoraMediaTypeNone = 0,
AgoraMediaTypeAudioOnly = 1,
AgoraMediaTypeVideoOnly = 2,
AgoraMediaTypeAudioAndVideo = 3,
};
typedef NS_ENUM(NSInteger, AgoraEncryptionMode) {
AgoraEncryptionModeNone = 0,
AgoraEncryptionModeAES128XTS = 1,
AgoraEncryptionModeAES256XTS = 2,
AgoraEncryptionModeAES128ECB = 3,
};
typedef NS_ENUM(NSUInteger, AgoraUserOfflineReason) {
AgoraUserOfflineReasonQuit = 0,
AgoraUserOfflineReasonDropped = 1,
AgoraUserOfflineReasonBecomeAudience = 2,
};
typedef NS_ENUM(NSUInteger, AgoraInjectStreamStatus) {
AgoraInjectStreamStatusStartSuccess = 0,
AgoraInjectStreamStatusStartAlreadyExists = 1,
AgoraInjectStreamStatusStartUnauthorized = 2,
AgoraInjectStreamStatusStartTimedout = 3,
AgoraInjectStreamStatusStartFailed = 4,
AgoraInjectStreamStatusStopSuccess = 5,
AgoraInjectStreamStatusStopNotFound = 6,
AgoraInjectStreamStatusStopUnauthorized = 7,
AgoraInjectStreamStatusStopTimedout = 8,
AgoraInjectStreamStatusStopFailed = 9,
AgoraInjectStreamStatusBroken = 10,
};
typedef NS_ENUM(NSUInteger, AgoraLogFilter) {
AgoraLogFilterOff = 0,
AgoraLogFilterDebug = 0x080f,
AgoraLogFilterInfo = 0x000f,
AgoraLogFilterWarning = 0x000e,
AgoraLogFilterError = 0x000c,
AgoraLogFilterCritical = 0x0008,
};
typedef NS_ENUM(NSInteger, AgoraAudioRecordingQuality) {
AgoraAudioRecordingQualityLow = 0,
AgoraAudioRecordingQualityMedium = 1,
AgoraAudioRecordingQualityHigh = 2
};
typedef NS_ENUM(NSInteger, AgoraRtmpStreamLifeCycle) {
AgoraRtmpStreamLifeCycleBindToChannel = 1,
AgoraRtmpStreamLifeCycleBindToOwnner = 2,
};
// network
typedef NS_ENUM(NSUInteger, AgoraNetworkQuality) {
AgoraNetworkQualityUnknown = 0,
AgoraNetworkQualityExcellent = 1,
AgoraNetworkQualityGood = 2,
AgoraNetworkQualityPoor = 3,
AgoraNetworkQualityBad = 4,
AgoraNetworkQualityVBad = 5,
AgoraNetworkQualityDown = 6,
};
// video
typedef NS_ENUM(NSInteger, AgoraVideoStreamType) {
AgoraVideoStreamTypeHigh = 0,
AgoraVideoStreamTypeLow = 1,
};
typedef NS_ENUM(NSUInteger, AgoraVideoRenderMode) {
/**
Hidden(1)
The replaced content is sized to maintain its aspect ratio while filling the View's rectangular area.
If the content's aspect ratio does not match the aspect ratio of its View, then the content will be clipped to fit.
The content is then centered in the view.
*/
AgoraVideoRenderModeHidden = 1,
/**
Fit(2)
The replaced content is scaled to maintain its aspect ratio while fitting within View's rectangular area.
The entire content is made to fill the box, while preserving its aspect ratio, so the content will be "letterboxed"
if its aspect ratio does not match the aspect ratio of the View.
*/
AgoraVideoRenderModeFit = 2,
/**
Adaptive(3):If both callers use the same screen orientation, i.e., both use vertical screens or both use horizontal screens, the AgoraVideoRenderModeHidden mode applies; if they use different screen orientations, i.e., one vertical and one horizontal, the AgoraVideoRenderModeFit mode applies.
*/
AgoraVideoRenderModeAdaptive __deprecated_enum_msg("AgoraVideoRenderModeAdaptive is deprecated.") = 3,
};
typedef NS_ENUM(NSInteger, AgoraVideoCodecProfileType) {
AgoraVideoCodecProfileTypeBaseLine = 66,
AgoraVideoCodecProfileTypeMain = 77,
AgoraVideoCodecProfileTypeHigh = 100,
};
typedef NS_ENUM(NSUInteger, AgoraVideoMirrorMode) {
AgoraVideoMirrorModeAuto = 0,
AgoraVideoMirrorModeEnabled = 1,
AgoraVideoMirrorModeDisabled = 2,
};
typedef NS_ENUM(NSUInteger, AgoraVideoRemoteState) {
AgoraVideoRemoteStateStopped = 0,
AgoraVideoRemoteStateRunning = 1,
AgoraVideoRemoteStateFrozen = 2,
};
// Audio
typedef NS_ENUM(NSInteger, AgoraAudioSampleRateType) {
AgoraAudioSampleRateType32000 = 32000,
AgoraAudioSampleRateType44100 = 44100,
AgoraAudioSampleRateType48000 = 48000,
};
typedef NS_ENUM(NSInteger, AgoraAudioProfile) {
// sample rate, bit rate, mono/stereo, speech/music codec
AgoraAudioProfileDefault = 0, // use default settings
AgoraAudioProfileSpeechStandard = 1, // 32Khz, 18kbps, mono, speech
AgoraAudioProfileMusicStandard = 2, // 48Khz, 48kbps, mono, music
AgoraAudioProfileMusicStandardStereo = 3, // 48Khz, 56kbps, stereo, music
AgoraAudioProfileMusicHighQuality = 4, // 48Khz, 128kbps, mono, music
AgoraAudioProfileMusicHighQualityStereo = 5, // 48Khz, 192kbps, stereo, music
};
typedef NS_ENUM(NSInteger, AgoraAudioScenario) {
AgoraAudioScenarioDefault = 0,
AgoraAudioScenarioChatRoomEntertainment = 1,
AgoraAudioScenarioEducation = 2,
AgoraAudioScenarioGameStreaming = 3,
AgoraAudioScenarioShowRoom = 4,
AgoraAudioScenarioChatRoomGaming = 5
};
typedef NS_ENUM(NSInteger, AgoraAudioOutputRouting)
{
AgoraAudioOutputRoutingDefault = -1,
AgoraAudioOutputRoutingHeadset = 0,
AgoraAudioOutputRoutingEarpiece = 1,
AgoraAudioOutputRoutingHeadsetNoMic = 2,
AgoraAudioOutputRoutingSpeakerphone = 3,
AgoraAudioOutputRoutingLoudspeaker = 4,
AgoraAudioOutputRoutingHeadsetBluetooth = 5
};
typedef NS_ENUM(NSInteger, AgoraAudioRawFrameOperationMode) {
AgoraAudioRawFrameOperationModeReadOnly = 0,
AgoraAudioRawFrameOperationModeWriteOnly = 1,
AgoraAudioRawFrameOperationModeReadWrite = 2,
};
typedef NS_ENUM(NSInteger, AgoraAudioEqualizationBandFrequency) {
AgoraAudioEqualizationBand31 = 0,
AgoraAudioEqualizationBand62 = 1,
AgoraAudioEqualizationBand125 = 2,
AgoraAudioEqualizationBand250 = 3,
AgoraAudioEqualizationBand500 = 4,
AgoraAudioEqualizationBand1K = 5,
AgoraAudioEqualizationBand2K = 6,
AgoraAudioEqualizationBand4K = 7,
AgoraAudioEqualizationBand8K = 8,
AgoraAudioEqualizationBand16K = 9,
};
typedef NS_ENUM(NSInteger, AgoraAudioReverbType) {
AgoraAudioReverbDryLevel = 0, // (dB, [-20,10]), the level of the dry signal
AgoraAudioReverbWetLevel = 1, // (dB, [-20,10]), the level of the early reflection signal (wet signal)
AgoraAudioReverbRoomSize = 2, // ([0,100]), the room size of the reflection
AgoraAudioReverbWetDelay = 3, // (ms, [0, 200]), the length of the initial delay of the wet signal in ms
AgoraAudioReverbStrength = 4, // ([0,100]), the strength of the late reverberation
};
// device
typedef NS_ENUM(NSInteger, AgoraMediaDeviceType) {
AgoraMediaDeviceTypeAudioUnknown = -1,
AgoraMediaDeviceTypeAudioRecording = 0,
AgoraMediaDeviceTypeAudioPlayout = 1,
AgoraMediaDeviceTypeVideoRender = 2,
AgoraMediaDeviceTypeVideoCapture = 3,
};
//
// AgoraLiveKit.h
// AgoraLiveKit
//
// Created by Junhao Wang
// Copyright (c) 2017 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AgoraLivePublisher.h"
#import "AgoraLiveSubscriber.h"
#import "AgoraRtcEngineKit.h"
__attribute__((visibility("default"))) @interface AgoraLiveChannelConfig: NSObject
@property (assign, nonatomic) BOOL videoEnabled;
+(AgoraLiveChannelConfig *_Nonnull) defaultConfig;
@end
@class AgoraLiveKit;
@protocol AgoraLiveDelegate <NSObject>
@optional
/**
* The warning occurred in SDK. The APP could igonre the warning, and the SDK could try to resume automically.
*
* @param kit The live kit
* @param warningCode The warning code
*/
- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didOccurWarning:(AgoraWarningCode)warningCode;
/**
* The error occurred in SDK. The SDK couldn't resume to normal state, and the app need to handle it.
*
* @param kit The live kit
* @param errorCode The error code
*/
- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didOccurError:(AgoraErrorCode)errorCode;
/**
* Event of the user joined the channel.
*
* @param kit The live kit
* @param channel The channel name
* @param uid The local user id
* @param elapsed The elapsed time (ms) from session beginning
*/
- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didJoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
/**
* The statistics of the call when leave channel
*
* @param kit The live kit
*/
- (void)liveKitDidLeaveChannel:(AgoraLiveKit *_Nonnull)kit;
/**
* Event of the user rejoined the channel
*
* @param kit The live kit
* @param channel The channel name
* @param uid The user id
* @param elapsed The elapsed time (ms) from session beginning
*/
- (void)liveKit:(AgoraLiveKit *_Nonnull)kit didRejoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
/**
* when token is enabled, and specified token is invalid or expired, this function will be called.
* APP should generate a new token and call renewToken() to refresh the key.
* NOTE: to be compatible with previous version, ERR_TOKEN_EXPIRED and ERR_INVALID_TOKEN are also reported via onError() callback.
* You should move renew of token logic into this callback.
* @param kit The live kit
*/
- (void)liveKitRequestToken:(AgoraLiveKit *_Nonnull)kit;
// statistics
/**
* Statistics of rtc live kit status. Updated every two seconds.
*
* @param kit The live kit
* @param stats The statistics of rtc status, including duration, sent bytes and received bytes
*/
- (void)liveKit:(AgoraLiveKit *_Nonnull)kit reportLiveStats:(AgoraChannelStats *_Nonnull)stats;
// network
/**
* Event of disconnected with server. This event is reported at the moment SDK loses connection with server.
* In the mean time SDK automatically tries to reconnect with the server until APP calls leaveChannel.
*
* @param kit The live kit
*/
- (void)liveKitConnectionDidInterrupted:(AgoraLiveKit *_Nonnull)kit;
/**
* Event of loss connection with server. This event is reported after the connection is interrupted and exceed the retry period (10 seconds by default).
* In the mean time SDK automatically tries to reconnect with the server until APP calls leaveChannel.
*
* @param kit The live kit
*/
- (void)liveKitConnectionDidLost:(AgoraLiveKit *_Nonnull)kit;
/**
* The network quality of local user.
*
* @param kit The live kit
* @param uid The id of user
* @param txQuality The sending network quality
* @param rxQuality The receiving network quality
*/
- (void)liveKit:(AgoraLiveKit *_Nonnull)kit networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality;
@end
__attribute__((visibility("default"))) @interface AgoraLiveKit : NSObject
@property (weak, nonatomic) _Nullable id<AgoraLiveDelegate> delegate;
/**
* Get the version of Agora SDK.
*
* @return string, sdk version
*/
+ (NSString *_Nonnull)getSdkVersion;
/**
* Get the native handler of sdk Engine
*/
- (AgoraRtcEngineKit *_Nonnull)getRtcEngineKit;
/**
* Initializes the AgoraLiveKit object.
*
* @param appId The appId is issued to the application developers by Agora.
*
* @return an object of AgoraLiveKit class
*/
+ (instancetype _Nonnull)sharedLiveKitWithAppId:(NSString *_Nonnull)appId;
+ (void)destroy;
/** BEGIN OF COMMON METHODS */
/**
* Create an open UDP socket to the AgoraLiveKit cloud service to join a channel.
Users in the same channel can talk to each other with same vendor key.
Users using different vendor keys cannot call each other.
The method is asynchronous.
*
* @param channelId Joining in the same channel indicates those clients have entered in one room.
* @param token token generated by APP using sign certificate.
* @param channelConfig configration of channel
* @param uid Optional, this argument is the unique ID for each member in one channel.
If set to 0, the SDK automatically allocates an ID, and the id could be gotten in didJoinChannel delegate.
*
* @return 0 when executed successfully, and return negative value when failed.
*/
- (int)joinChannelByToken:(NSString *_Nullable)token
channelId:(NSString *_Nonnull)channelId
config:(AgoraLiveChannelConfig *_Nonnull)channelConfig
uid:(NSUInteger)uid;
/**
* lets the user leave a channel, i.e., hanging up or exiting a call.
After joining a channel, the user must call the leaveChannel method to end the call before joining another one.
It is synchronous, i.e., it only returns until the call ends and all resources are released.
*
* @return 0 if executed successfully, or return negative value if failed.
*/
- (int)leaveChannel;
/**
* Renew token, refresh the new key into agora engine. APP should call this API when SDK reports error ERR_TOKEN_EXPIRED.
*
* @param token new token
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)renewToken:(NSString*_Nonnull)token;
/**
* start local video preview, while not sending data to server
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)startPreview:(VIEW_CLASS *_Nonnull)view
renderMode:(AgoraVideoRenderMode)mode;
/**
* stop local video preview
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)stopPreview;
@end
//
// AgoraLivePublisher.h
// AgoraLiveKit
//
// Created by Sting Feng on 2015-8-11.
// Copyright (c) 2015 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AgoraObjects.h"
@class AgoraLiveKit;
@class AgoraLivePublisher;
@protocol AgoraLivePublisherDelegate <NSObject>
@optional
-(void)publisher:(AgoraLivePublisher *_Nonnull)publisher streamPublishedWithUrl:(NSString *_Nonnull)url error:(AgoraErrorCode)error;
-(void)publisher:(AgoraLivePublisher *_Nonnull)publisher streamUnpublishedWithUrl:(NSString *_Nonnull)url;
-(void)publisherTranscodingUpdated: (AgoraLivePublisher *_Nonnull)publisher;
-(void)publisher:(AgoraLivePublisher *_Nonnull)publisher streamInjectedStatusOfUrl:(NSString *_Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status;
@end
__attribute__((visibility("default"))) @interface AgoraLivePublisher: NSObject
-(void)setDelegate:(_Nullable id<AgoraLivePublisherDelegate>)delegate;
-(instancetype _Nonnull)initWithLiveKit:(AgoraLiveKit *_Nonnull)kit;
- (void)setVideoResolution:(CGSize)resolution andFrameRate:(NSInteger)frameRate bitrate:(NSInteger)bitrate;
-(void)setLiveTranscoding:(AgoraLiveTranscoding *_Nullable)transcoding;
-(int)addVideoWatermark:(AgoraImage * _Nonnull)watermark NS_SWIFT_NAME(addVideoWatermark(_:));
-(void)clearVideoWatermarks;
-(void)setMediaType:(AgoraMediaType)mediaType;
-(void)addStreamUrl:(NSString *_Nullable)url transcodingEnabled:(BOOL)transcodingEnabled;
-(void)removeStreamUrl:(NSString *_Nullable)url;
-(void)publish;
-(void)unpublish;
-(void)switchCamera;
- (void)addInjectStreamUrl:(NSString *_Nonnull)url config:(AgoraLiveInjectStreamConfig * _Nonnull)config;
- (void)removeInjectStreamUrl:(NSString *_Nonnull)url;
@end
//
// AgoraLiveSubscriber.h
// AgoraLiveKit
//
// Created by Sting Feng on 2015-8-11.
// Copyright (c) 2015 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AgoraObjects.h"
@class AgoraLiveKit;
@class AgoraLiveSubscriber;
@protocol AgoraLiveSubscriberDelegate <NSObject>
@optional
// subscriber 相关
- (void)subscriber: (AgoraLiveSubscriber *_Nonnull)subscriber publishedByHostUid:(NSUInteger)uid streamType:(AgoraMediaType) type;
- (void)subscriber: (AgoraLiveSubscriber *_Nonnull)subscriber streamTypeChangedTo:(AgoraMediaType) type byHostUid:(NSUInteger)uid;
// unmute, offline
- (void)subscriber: (AgoraLiveSubscriber *_Nonnull)subscriber unpublishedByHostUid:(NSUInteger)uid;
// video
/**
* Event of the first frame of remote user is rendering on the screen.
*
* @param subscriber The live subscriber
* @param uid The remote user id
* @param size The size of video stream
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)subscriber:(AgoraLiveSubscriber *_Nonnull)subscriber firstRemoteVideoDecodedOfHostUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed;
/**
* Event of video size changed for local or remote user
*
* @param subscriber The live subscriber
* @param uid The user id
* @param size The new size of video
* @param rotation The new rotate of video
*/
- (void)subscriber:(AgoraLiveSubscriber *_Nonnull)subscriber videoSizeChangedOfHostUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation;
@end
__attribute__((visibility("default"))) @interface AgoraLiveSubscriber: NSObject // AgoraLiveSubscriber
-(instancetype _Nonnull)initWithLiveKit:(AgoraLiveKit * _Nonnull)kit;
-(void)setDelegate:(_Nullable id<AgoraLiveSubscriberDelegate>)delegate;
- (void)subscribeToHostUid:(NSUInteger)uid
mediaType:(AgoraMediaType)mediaType
view:(VIEW_CLASS *_Nullable)view
renderMode:(AgoraVideoRenderMode)mode
videoType:(AgoraVideoStreamType)videoType;
-(void)unsubscribeToHostUid:(NSUInteger)uid;
@end
//
// AgoraMediaIO.h
// AgoraRtcEngineKit
//
// Created by Yuhua Gong
// Copyright (c) 2017 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "AgoraEnumerates.h"
#import "AgoraObjects.h"
typedef NS_ENUM(NSUInteger, AgoraVideoPixelFormat) {
AgoraVideoPixelFormatI420 = 1,
AgoraVideoPixelFormatBGRA = 2,
AgoraVideoPixelFormatNV12 = 8,
};
typedef NS_ENUM(NSInteger, AgoraVideoRotation) {
AgoraVideoRotationNone = 0,
AgoraVideoRotation90 = 1,
AgoraVideoRotation180 = 2,
AgoraVideoRotation270 = 3,
};
typedef NS_ENUM(NSInteger, AgoraVideoBufferType) {
AgoraVideoBufferTypePixelBuffer = 1,
AgoraVideoBufferTypeRawData = 2,
};
// Video Source consumer Delegate
@protocol AgoraVideoFrameConsumer <NSObject>
- (void)consumePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
withTimestamp:(CMTime)timestamp
rotation:(AgoraVideoRotation)rotation;
- (void)consumeRawData:(void * _Nonnull)rawData
withTimestamp:(CMTime)timestamp
format:(AgoraVideoPixelFormat)format
size:(CGSize)size
rotation:(AgoraVideoRotation)rotation;
@end
// Video Source Protocol
@protocol AgoraVideoSourceProtocol <NSObject>
@required
@property (strong) id<AgoraVideoFrameConsumer> _Nullable consumer;
- (BOOL)shouldInitialize;
- (void)shouldStart;
- (void)shouldStop;
- (void)shouldDispose;
- (AgoraVideoBufferType)bufferType;
@end
// Video Render Protocol
@protocol AgoraVideoSinkProtocol <NSObject>
@required
- (BOOL)shouldInitialize;
- (void)shouldStart;
- (void)shouldStop;
- (void)shouldDispose;
- (AgoraVideoBufferType)bufferType;
- (AgoraVideoPixelFormat)pixelFormat;
@optional
- (void)renderPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
rotation:(AgoraVideoRotation)rotation;
- (void)renderRawData:(void * _Nonnull)rawData
size:(CGSize)size
rotation:(AgoraVideoRotation)rotation;
@end
#pragma mark - Agora default media io
typedef NS_ENUM(NSInteger, AgoraRtcDefaultCameraPosition) {
AgoraRtcDefaultCameraPositionFront = 0,
AgoraRtcDefaultCameraPositionBack = 1
};
__attribute__((visibility("default"))) @interface AgoraRtcDefaultCamera: NSObject<AgoraVideoSourceProtocol>
#if TARGET_OS_IPHONE
@property (nonatomic, assign) AgoraRtcDefaultCameraPosition position;
- (instancetype _Nonnull)initWithPosition:(AgoraRtcDefaultCameraPosition)position;
#endif
@end
#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
__attribute__((visibility("default"))) @interface AgoraRtcScreenCapture: NSObject<AgoraVideoSourceProtocol>
@property (nonatomic, readonly) NSUInteger windowId;
+ (instancetype _Nonnull)fullScreenCaptureWithFrequency:(NSInteger)captureFrequency
bitRate:(NSInteger)bitRate;
+ (instancetype _Nonnull)windowCaptureWithId:(CGWindowID)windowId
captureFrequency:(NSInteger)captureFrequency
bitRate:(NSInteger)bitRate
rect:(CGRect)rect;
@end
#endif
__attribute__((visibility("default"))) @interface AgoraRtcDefaultRenderer: NSObject<AgoraVideoSinkProtocol>
@property (nonatomic, strong, readonly) VIEW_CLASS * _Nonnull view;
@property (nonatomic, assign) AgoraVideoRenderMode mode;
- (instancetype _Nonnull)initWithView:(VIEW_CLASS * _Nonnull)view
renderMode:(AgoraVideoRenderMode)mode;
@end
//
// AgoraObjects.h
// AgoraRtcEngineKit
//
// Created by Yuhua Gong
// Copyright (c) 2017 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreMedia/CoreMedia.h>
#import "AgoraEnumerates.h"
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
typedef UIView VIEW_CLASS;
typedef UIColor COLOR_CLASS;
#elif TARGET_OS_MAC
#import <AppKit/AppKit.h>
typedef NSView VIEW_CLASS;
typedef NSColor COLOR_CLASS;
#endif
__attribute__((visibility("default"))) @interface AgoraRtcVideoCanvas : NSObject
/**
* The video display view. The SDK does not maintain the lifecycle of the view.
The view can be safely released after calling leaveChannel with a returned value.
The SDK keeps a cache of the view value, so 'setupLocalVideo' to set the view value to nil could be able to clear cache before switching or releasing view.
*/
@property (strong, nonatomic) VIEW_CLASS* _Nullable view;
@property (assign, nonatomic) AgoraVideoRenderMode renderMode; // the render mode of view: hidden, fit and adaptive
@property (assign, nonatomic) NSUInteger uid; // the user id of view
@end
__attribute__((visibility("default"))) @interface AgoraRtcLocalVideoStats : NSObject
@property (assign, nonatomic) NSUInteger sentBitrate;
@property (assign, nonatomic) NSUInteger sentFrameRate;
@end
__attribute__((visibility("default"))) @interface AgoraRtcRemoteVideoStats : NSObject
@property (assign, nonatomic) NSUInteger uid;
@property (assign, nonatomic) NSUInteger delay __deprecated;
@property (assign, nonatomic) NSUInteger width;
@property (assign, nonatomic) NSUInteger height;
@property (assign, nonatomic) NSUInteger receivedBitrate;
@property (assign, nonatomic) NSUInteger receivedFrameRate;
@property (assign, nonatomic) AgoraVideoStreamType rxStreamType;
@end
__attribute__((visibility("default"))) @interface AgoraRtcAudioVolumeInfo : NSObject
@property (assign, nonatomic) NSUInteger uid;
@property (assign, nonatomic) NSUInteger volume;
@end
__attribute__((visibility("default"))) @interface AgoraChannelStats: NSObject
@property (assign, nonatomic) NSInteger duration;
@property (assign, nonatomic) NSInteger txBytes;
@property (assign, nonatomic) NSInteger rxBytes;
@property (assign, nonatomic) NSInteger txAudioKBitrate;
@property (assign, nonatomic) NSInteger rxAudioKBitrate;
@property (assign, nonatomic) NSInteger txVideoKBitrate;
@property (assign, nonatomic) NSInteger rxVideoKBitrate;
@property (assign, nonatomic) NSInteger userCount;
@property (assign, nonatomic) double cpuAppUsage;
@property (assign, nonatomic) double cpuTotalUsage;
@end
__attribute__((visibility("default"))) @interface AgoraLiveTranscodingUser: NSObject
@property (assign, nonatomic) NSUInteger uid;
@property (assign, nonatomic) CGRect rect;
@property (assign, nonatomic) NSInteger zOrder; //optional, [0, 100] //0 (default): bottom most, 100: top most
@property (assign, nonatomic) double alpha; //optional, [0, 1.0] where 0 denotes throughly transparent, 1.0 opaque
@property (assign, nonatomic) NSInteger audioChannel;
@end
__attribute__((visibility("default"))) @interface AgoraImage: NSObject
@property (strong, nonatomic) NSURL *_Nonnull url;
@property (assign, nonatomic) CGRect rect;
@end
__attribute__((visibility("default"))) @interface AgoraLiveTranscoding: NSObject
@property (assign, nonatomic) CGSize size;
@property (assign, nonatomic) NSInteger videoBitrate;
@property (assign, nonatomic) NSInteger videoFramerate;
@property (assign, nonatomic) BOOL lowLatency;
@property (assign, nonatomic) NSInteger videoGop;
@property (assign, nonatomic) AgoraVideoCodecProfileType videoCodecProfile;
@property (strong, nonatomic) COLOR_CLASS *_Nullable backgroundColor;
@property (copy, nonatomic) NSArray<AgoraLiveTranscodingUser *> *_Nullable transcodingUsers;
@property (copy, nonatomic) NSString *_Nullable transcodingExtraInfo;
@property (strong, nonatomic) AgoraImage *_Nullable watermark;
@property (assign, nonatomic) AgoraAudioSampleRateType audioSampleRate;
@property (assign, nonatomic) NSInteger audioBitrate; //kbps
@property (assign, nonatomic) NSInteger audioChannels;
+(AgoraLiveTranscoding *_Nonnull) defaultTranscoding;
@end
__attribute__((visibility("default"))) @interface AgoraLiveInjectStreamConfig: NSObject
@property (assign, nonatomic) CGSize size;
@property (assign, nonatomic) NSInteger videoGop;
@property (assign, nonatomic) NSInteger videoFramerate;
@property (assign, nonatomic) NSInteger videoBitrate;
@property (assign, nonatomic) AgoraAudioSampleRateType audioSampleRate;
@property (assign, nonatomic) NSInteger audioBitrate; //kbps
@property (assign, nonatomic) NSInteger audioChannels;
+(AgoraLiveInjectStreamConfig *_Nonnull) defaultConfig;
@end
__deprecated
__attribute__((visibility("default"))) @interface AgoraRtcVideoCompositingRegion : NSObject
@property (assign, nonatomic) NSUInteger uid;
@property (assign, nonatomic) CGFloat x;
@property (assign, nonatomic) CGFloat y;
@property (assign, nonatomic) CGFloat width;
@property (assign, nonatomic) CGFloat height;
@property (assign, nonatomic) NSInteger zOrder; //optional, [0, 100] //0 (default): bottom most, 100: top most
@property (assign, nonatomic) CGFloat alpha; //optional, [0, 1.0] where 0 denotes throughly transparent, 1.0 opaque
@property (assign, nonatomic) AgoraVideoRenderMode renderMode;
@end
__deprecated
__attribute__((visibility("default"))) @interface AgoraRtcVideoCompositingLayout : NSObject
@property (assign, nonatomic) NSInteger canvasWidth;
@property (assign, nonatomic) NSInteger canvasHeight;
@property (copy, nonatomic) NSString * _Nullable backgroundColor;//e.g. "#c0c0c0"
@property (copy, nonatomic) NSArray<AgoraRtcVideoCompositingRegion *> * _Nullable regions;
@property (copy, nonatomic) NSString * _Nullable appData;//app defined data
@end
__deprecated
__attribute__((visibility("default"))) @interface AgoraPublisherConfiguration : NSObject
@property (assign, nonatomic) BOOL owner;
@property (assign, nonatomic) NSInteger width;
@property (assign, nonatomic) NSInteger height;
@property (assign, nonatomic) NSInteger framerate;
@property (assign, nonatomic) NSInteger bitrate;
@property (assign, nonatomic) NSInteger defaultLayout;
@property (assign, nonatomic) AgoraRtmpStreamLifeCycle lifeCycle;
@property (assign, nonatomic) NSInteger injectStreamWidth;
@property (assign, nonatomic) NSInteger injectStreamHeight;
@property (copy, nonatomic) NSString * _Nullable injectStreamUrl;
@property (copy, nonatomic) NSString * _Nullable publishUrl;
@property (copy, nonatomic) NSString * _Nullable rawStreamUrl;
@property (copy, nonatomic) NSString * _Nullable extraInfo;
-(BOOL) validate;
@end
#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
__attribute__((visibility("default"))) @interface AgoraRtcDeviceInfo : NSObject
@property (assign, nonatomic) int index;
@property (assign, nonatomic) AgoraMediaDeviceType type;
@property (copy, nonatomic) NSString * _Nullable deviceId;
@property (copy, nonatomic) NSString * _Nullable deviceName;
@end
#endif
__attribute__((visibility("default"))) @interface AgoraVideoFrame : NSObject
@property (assign, nonatomic) NSInteger format; /* 12: ios texture (CVPixelBufferRef)
1: I420
2: BGRA
3: NV21
4: RGBA
5: IMC2
7: ARGB
8: NV12
*/
@property (assign, nonatomic) CMTime time; // time for this frame.
@property (assign, nonatomic) int stride DEPRECATED_MSG_ATTRIBUTE("use strideInPixels instead");
@property (assign, nonatomic) int strideInPixels; // how many pixels between 2 consecutive rows. Note: in pixel, not byte.
// in case of ios texture, it is not used
@property (assign, nonatomic) int height; // how many rows of pixels, in case of ios texture, it is not used
@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
@property (strong, nonatomic) NSData * _Nullable dataBuf; // raw data buffer. in case of ios texture, it is not used
@property (assign, nonatomic) int cropLeft; // how many pixels to crop on the left boundary
@property (assign, nonatomic) int cropTop; // how many pixels to crop on the top boundary
@property (assign, nonatomic) int cropRight; // how many pixels to crop on the right boundary
@property (assign, nonatomic) int cropBottom; // how many pixels to crop on the bottom boundary
@property (assign, nonatomic) int rotation; // 0, 90, 180, 270. See document for rotation calculation
/* Note
* 1. strideInPixels
* Stride is in unit of pixel, not byte
* 2. About frame width and height
* No field defined for width. However, it can be deduced by:
* croppedWidth = (strideInPixels - cropLeft - cropRight)
* And
* croppedHeight = (height - cropTop - cropBottom)
* 3. About crop
* _________________________________________________________________.....
* | ^ | ^
* | | | |
* | cropTop | |
* | | | |
* | v | |
* | ________________________________ | |
* | | | | |
* | | | | |
* |<-- cropLeft -->| valid region |<- cropRight ->|
* | | | | height
* | | | |
* | |_____________________________ | | |
* | ^ | |
* | | | |
* | cropBottom | |
* | | | |
* | v | v
* _________________________________________________________________......
* | |
* |<---------------- strideInPixels ----------------------------->|
*
* If your buffer contains garbage data, you can crop them. E.g. frame size is
* 360 x 640, often the buffer stride is 368, i.e. there extra 8 pixels on the
* right are for padding, and should be removed. In this case, you can set:
* strideInPixels = 368;
* height = 640;
* cropRight = 8;
* // cropLeft, cropTop, cropBottom are default to 0
*/
@end
//
// AgoraRtcEngineKit.h
// AgoraRtcEngineKit
//
// Created by Sting Feng on 2015-8-11.
// Copyright (c) 2015 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AgoraObjects.h"
#import "AgoraMediaIO.h"
@class AgoraRtcEngineKit;
@protocol AgoraRtcEngineDelegate <NSObject>
@optional
#pragma mark SDK common delegates
/**
* The warning occurred in SDK. The APP could igonre the warning, and the SDK could try to resume automically.
*
* @param engine The engine kit
* @param warningCode The warning code
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didOccurWarning:(AgoraWarningCode)warningCode;
/**
* The error occurred in SDK. The SDK couldn't resume to normal state, and the app need to handle it.
*
* @param engine The engine kit
* @param errorCode The error code
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didOccurError:(AgoraErrorCode)errorCode;
/**
* Event of load media engine success
*
* @param engine The engine kit
*/
- (void)rtcEngineMediaEngineDidLoaded:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Event of media engine start call success
*
* @param engine The engine kit
*/
- (void)rtcEngineMediaEngineDidStartCall:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* when token is enabled, and specified token is invalid or expired, this function will be called.
* APP should generate a new token and call renewToken() to refresh the token.
* NOTE: to be compatible with previous version, ERR_TOKEN_EXPIRED and ERR_INVALID_TOKEN are also reported via onError() callback.
* You should move renew of token logic into this callback.
* @param engine The engine kit
*/
- (void)rtcEngineRequestToken:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Event of disconnected with server. This event is reported at the moment SDK loses connection with server.
* In the mean time SDK automatically tries to reconnect with the server until APP calls leaveChannel.
*
* @param engine The engine kit
*/
- (void)rtcEngineConnectionDidInterrupted:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Event of loss connection with server. This event is reported after the connection is interrupted and exceed the retry period (10 seconds by default).
* In the mean time SDK automatically tries to reconnect with the server until APP calls leaveChannel.
*
* @param engine The engine kit
*/
- (void)rtcEngineConnectionDidLost:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Event of connection banned by server. This event is reported after the connection is banned by server.
* In the mean time SDK will not try to reconnect the server.
*/
- (void)rtcEngineConnectionDidBanned:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Statistics of rtc engine status. Updated every two seconds.
*
* @param engine The engine kit
* @param stats The statistics of rtc status, including duration, sent bytes and received bytes
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine reportRtcStats:(AgoraChannelStats * _Nonnull)stats;
/**
* The network quality of lastmile test.
*
* @param engine The engine kit
* @param quality The network quality
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine lastmileQuality:(AgoraNetworkQuality)quality;
/**
* Event of API call executed
*
* @param engine The engine kit
* @param api The API description
* @param error The error code
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didApiCallExecute:(NSInteger)error api:(NSString * _Nonnull)api result:(NSString * _Nonnull)result;
/**
* This callback returns the status code after executing the refreshRecordingServiceStatus method successfully.
*
* @param engine The engine kit
* @param status 0:Recording is stopped. 1:Recording is ongoing.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didRefreshRecordingServiceStatus:(NSInteger)status;
#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
/**
* the notificaitoin of device added removed
*
* @param engine The engine kit
* @param deviceId the identification of device
* @param deviceType type of device: -1: audio unknown; 0: audio recording ; 1: audio playout ; 2: render; 4: capture
* @param state state of device: 0: added; 1: removed
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine device:(NSString * _Nonnull) deviceId type:(AgoraMediaDeviceType) deviceType stateChanged:(NSInteger) state;
#endif
#pragma mark Local user common delegates
/**
* Event of the user joined the channel.
*
* @param engine The engine kit
* @param channel The channel name
* @param uid The remote user id
* @param elapsed The elapsed time (ms) from session beginning
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didJoinChannel:(NSString * _Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
/**
* Event of the user rejoined the channel
*
* @param engine The engine kit
* @param channel The channel name
* @param uid The user id
* @param elapsed The elapsed time (ms) from session beginning
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didRejoinChannel:(NSString * _Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
/**
* Event of cient role change. only take effect under broadcasting mode
*
* @param engine The engine kit
* @param oldRole the previous role
* @param newRole the new role
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didClientRoleChanged:(AgoraClientRole)oldRole newRole:(AgoraClientRole)newRole;
/**
* The statistics of the call when leave channel
*
* @param engine The engine kit
* @param stats The statistics of the call, including duration, sent bytes and received bytes
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didLeaveChannelWithStats:(AgoraChannelStats * _Nonnull)stats;
/**
* The network quality of local user.
*
* @param engine The engine kit
* @param uid The id of user
* @param txQuality The sending network quality
* @param rxQuality The receiving network quality
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality;
#pragma mark Local user audio delegates
/**
* Event of the first audio frame is sent.
*
* @param engine The engine kit
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine firstLocalAudioFrame:(NSInteger)elapsed;
/**
* Event of local audio route changed
*
* @param engine The engine kit
* @param routing the current audio output routing
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didAudioRouteChanged:(AgoraAudioOutputRouting)routing;
/**
* Event of finish audio mixing.
*
* @param engine The engine kit
*/
- (void)rtcEngineLocalAudioMixingDidFinish:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Event of finish audio effect.
*
* @param engine The engine kit
*/
- (void)rtcEngineDidAudioEffectFinish:(AgoraRtcEngineKit * _Nonnull)engine soundId:(NSInteger)soundId;
#pragma mark Local user video delegates
/**
* Event of camera opened
*
* @param engine The engine kit
*/
- (void)rtcEngineCameraDidReady:(AgoraRtcEngineKit * _Nonnull)engine;
#if TARGET_OS_IPHONE
/**
* Event of camera focus position changed
*
* @param engine The engine kit
* @param rect The focus rect in local preview
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine cameraFocusDidChangedToRect:(CGRect)rect;
#endif
/**
* Event of camera stopped
*
* @param engine The engine kit
*/
- (void)rtcEngineVideoDidStop:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Event of the first local frame starts rendering on the screen.
*
* @param engine The engine kit
* @param size The size of local video stream
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine firstLocalVideoFrameWithSize:(CGSize)size elapsed:(NSInteger)elapsed;
/**
* The statistics of local video stream. Update every two seconds.
*
* @param engine The engine kit
* @param stats The statistics of local video, including sent bitrate, sent framerate
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine localVideoStats:(AgoraRtcLocalVideoStats * _Nonnull)stats;
#pragma mark Remote user common delegates
/**
* Event of remote user joined
*
* @param engine The engine kit
* @param uid The remote user id
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed;
/**
* Event of remote user offlined
*
* @param engine The engine kit
* @param uid The remote user id
* @param reason Reason of user offline, quit, drop or became audience
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason;
/**
* receive custom data from remote user
*
* @param engine The engine kit
* @param uid The remote user id
* @param streamId The stream id
* @param data The user defined data
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData * _Nonnull)data;
/**
* the local user has not received the data stream from the other user within 5 seconds.
*
* @param engine The engine kit
* @param uid The remote user id
* @param streamId The stream id
* @param error The error code
* @param missed The number of lost messages
* @param cached The number of incoming cached messages when the data stream is interrupted
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached;
#pragma mark Remote user audio delegates
/**
* Event of the first audio frame from remote user is received.
*
* @param engine The engine kit
* @param uid The remote user id
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine firstRemoteAudioFrameOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed;
/**
* Event of remote user audio muted or unmuted
*
* @param engine The engine kit
* @param muted Muted or unmuted
* @param uid The remote user id
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didAudioMuted:(BOOL)muted byUid:(NSUInteger)uid;
/**
* The sdk reports the volume of a speaker. The interface is disable by default, and it could be enable by API "enableAudioVolumeIndication"
*
* @param engine The engine kit
* @param speakers AgoraRtcAudioVolumeInfo array
* @param totalVolume The total volume of speakers
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine reportAudioVolumeIndicationOfSpeakers:(NSArray<AgoraRtcAudioVolumeInfo *> * _Nonnull)speakers totalVolume:(NSInteger)totalVolume;
/**
* The sdk reports who is active speaker in the channel
*
* @param engine The engine kit
* @param speakerUid The speaker who is talking
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine activeSpeaker:(NSUInteger)speakerUid;
/**
* Event of remote start audio mixing.
*
* @param engine The engine kit
*/
- (void)rtcEngineRemoteAudioMixingDidStart:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* Event of remote finish audio mixing.
*
* @param engine The engine kit
*/
- (void)rtcEngineRemoteAudioMixingDidFinish:(AgoraRtcEngineKit * _Nonnull)engine;
/**
* The audio quality of the user. updated every two seconds.
*
* @param engine The engine kit
* @param uid The id of user
* @param quality The audio quality
* @param delay The delay from the remote user
* @param lost The percentage of lost packets
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine audioQualityOfUid:(NSUInteger)uid quality:(AgoraNetworkQuality)quality delay:(NSUInteger)delay lost:(NSUInteger)lost;
#pragma mark Remote user video delegates
/**
* Event of the first frame of remote user is decoded successfully.
*
* @param engine The engine kit
* @param uid The remote user id
* @param size The size of video stream
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine firstRemoteVideoDecodedOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed;
/**
* Event of the first frame of remote user is rendering on the screen.
*
* @param engine The engine kit
* @param uid The remote user id
* @param size The size of video stream
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine firstRemoteVideoFrameOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed;
/**
* Event of video size changed for local or remote user
*
* @param engine The engine kit
* @param uid The user id
* @param size The new size of video
* @param rotation The new rotate of video
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine videoSizeChangedOfUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation;
/**
* This callback indicates remote video stream state has changed.
*
* @param engine The engine kit
* @param uid The user id
* @param state Stopped // Default state, video is started or remote user disabled/muted video stream
Running // Running state, remote video can be displayed normally
Frozen // Remote video is frozen, probably due to network issue.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state;
/**
* Event of remote user video muted or unmuted
*
* @param engine The engine kit
* @param muted Muted or unmuted
* @param uid The remote user id
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didVideoMuted:(BOOL)muted byUid:(NSUInteger)uid;
/**
* Event of remote user video enabled or disabled
*
* @param engine The engine kit
* @param enabled Enabled or disabled
* @param uid The remote user id
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid;
/**
* Event of remote user local video enabled or disabled
*
* @param engine The engine kit
* @param enabled Enabled or disabled
* @param uid The remote user id
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didLocalVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid;
/**
* The statistics of remote video stream. Update every two seconds.
*
* @param engine The engine kit
* @param stats The statistics of remote video, including user id, delay, resolution, received bitrate, received framerate, video stream type
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine remoteVideoStats:(AgoraRtcRemoteVideoStats * _Nonnull)stats;
#pragma mark Stream publish delegates
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine streamPublishedWithUrl:(NSString * _Nonnull)url errorCode:(AgoraErrorCode)errorCode;
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine streamUnpublishedWithUrl:(NSString * _Nonnull)url;
- (void)rtcEngineTranscodingUpdated:(AgoraRtcEngineKit * _Nonnull)engine;
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine streamInjectedStatusOfUrl:(NSString * _Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status;
@end
#pragma mark - AgoraRtcEngineKit
__attribute__((visibility("default"))) @interface AgoraRtcEngineKit : NSObject
/**
* Set / Get the AgoraRtcEngineDelegate
*/
@property (nonatomic, weak) id<AgoraRtcEngineDelegate> _Nullable delegate;
/**
* Initializes the AgoraRtcEngineKit object.
*
* @param appId The appId is issued to the application developers by Agora.
* @param delegate The AgoraRtcEngineDelegate
*
* @return an object of AgoraRtcEngineKit class
*/
+ (instancetype _Nonnull)sharedEngineWithAppId:(NSString * _Nonnull)appId
delegate:(id<AgoraRtcEngineDelegate> _Nullable)delegate;
/**
* deprecated
*/
+ (instancetype _Nonnull)sharedEngineWithAppId:(NSString * _Nonnull)AppId error:(void(^ _Nullable)(AgoraErrorCode errorCode))errorBlock __deprecated;
+ (void)destroy;
/**
* Get the version of Agora SDK.
*
* @return string, sdk version
*/
+ (NSString * _Nonnull)getSdkVersion;
/**
* Get the version of Media Engine
*
* @return string, engine version
*/
+ (NSString * _Nonnull)getMediaEngineVersion;
/**
* Get the native handler of sdk Engine
*/
- (void * _Nullable)getNativeHandle;
#pragma mark Common methods
/**
* Create an open UDP socket to the AgoraRtcEngineKit cloud service to join a channel.
Users in the same channel can talk to each other with same appId.
Users using different appIds cannot call each other.
The method is asynchronous.
*
* @param token token generated by APP using sign certificate.
* @param channelId Joining in the same channel indicates those clients have entered in one room.
* @param info Optional, this argument can be whatever the programmer likes personally.
* @param uid Optional, this argument is the unique ID for each member in one channel.
If not specified, or set to 0, the SDK automatically allocates an ID, and the id could be gotten in onJoinChannelSuccess.
* @param joinSuccessBlock This callback indicates that the user has successfully joined the specified channel. Same as rtcEngine:didJoinChannel:withUid:elapsed:. If nil, the callback rtcEngine:didJoinChannel:withUid:elapsed: will works.
*
* @return 0 when executed successfully, and return negative value when failed.
*/
- (int)joinChannelByToken:(NSString * _Nullable)token
channelId:(NSString * _Nonnull)channelId
info:(NSString * _Nullable)info
uid:(NSUInteger)uid
joinSuccess:(void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))joinSuccessBlock;
/**
* lets the user leave a channel, i.e., hanging up or exiting a call.
After joining a channel, the user must call the leaveChannel method to end the call before joining another one.
It is synchronous, i.e., it only returns until the call ends and all resources are released.
* @param leaveChannelBlock indicate the statistics of this call, from joinChannel to leaveChannel, including duration, tx bytes and rx bytes in the call.
*
* @return 0 if executed successfully, or return negative value if failed.
*/
- (int)leaveChannel:(void(^ _Nullable)(AgoraChannelStats * _Nonnull stat))leaveChannelBlock;
/**
* Set the channel profile: such as communication, live broadcasting
*
* @param profile the channel profile
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setChannelProfile:(AgoraChannelProfile)profile;
/**
* Set the role of user: such as broadcaster, audience
*
* @param role the role of client
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setClientRole:(AgoraClientRole)role;
/**
* Renew token, refresh the new key into agora engine. APP should call this API when SDK reports error ERR_TOKEN_EXPIRED.
*
* @param token new token
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)renewToken:(NSString * _Nonnull)token;
- (int)enableWebSdkInteroperability:(BOOL)enabled;
/**
* Enables the network quality test. When enabled, the callback 'networkQualityBlock' notifies the application about the user's network connection quality.
Note: Once the network test is enabled, it uses the network bandwidth even when the application is not in a call.
Recommandation: When the application is foreground, enable the network connection test; and when the application is switched to background, disable network test in order to reduce network traffic.
By default, the network test is disabled
*
* @return 0 when executed successfully, and return negative value when failed.
*/
- (int)enableLastmileTest;
/**
* Disables the network quality test.
*
* @return 0 when executed successfully, and return negative value when failed.
*/
- (int)disableLastmileTest;
/**
* Specify sdk parameters
*
* @param options sdk options in json format.
*/
- (int)setParameters:(NSString * _Nonnull)options;
- (NSString * _Nullable)getParameter:(NSString * _Nonnull)parameter
args:(NSString * _Nullable)args;
/**
* Specifies the SDK output log file.
*
* @param filePath The full file path of the log file.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setLogFile:(NSString * _Nonnull)filePath;
/**
* Specifiy the log level of output
*
* @param filter The log level
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setLogFilter:(NSUInteger)filter;
/**
* The call id of current client. The call id could be used in 'rate' and 'complain' method.
*
* @return The current call id.
*/
- (NSString * _Nullable)getCallId;
/**
* Let user rate the call. Often called after the call ends.
*
* @param callId The call ID retrieved from the 'getCallId' method.
* @param rating The rating for the call between 1 (lowest score) to 10 (highest score).
* @param description Optional, decribed by user for the call with a length less than 800 bytes.
*
* @return 0 when executed successfully. return ERR_INVALID_ARGUMENT (-2):The passed argument is invalid, e.g., callId invalid. return ERR_NOT_READY (-3):The SDK status is incorrect, e.g., initialization failed.
*/
- (int)rate:(NSString * _Nonnull)callId
rating:(NSInteger)rating
description:(NSString * _Nullable)description;
/**
* Let user complain the quality of the call. Often called after the call ends.
*
* @param callId The call ID retrieved from the 'getCallId' method.
* @param description Optional, decribed by user for the call with a length less than 800 bytes.
*
* @return 0 when executed successfully. return ERR_INVALID_ARGUMENT (-2):The passed argument is invalid, e.g., callId invalid. return ERR_NOT_READY (-3):The SDK status is incorrect, e.g., initialization failed.
*/
- (int)complain:(NSString * _Nonnull)callId
description:(NSString * _Nullable)description;
/**
* Enable / Disable dispatching delegate to main queue. if disable, the app should dispatch UI operating to main queue by himself.
*
* @param enabled YES: dispatch delegate method to main queue. NO: not dispatch delegate methods to main queue
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)enableMainQueueDispatch:(BOOL)enabled;
#pragma mark Video common
/**
* Enables video mode. Switches from audio to video mode. It could be called during a call and before entering a channel.
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)enableVideo;
/**
* Disable video mode. Switch from video to audio mode. It could be called during a call and before entering a channel.
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)disableVideo;
/**
* Enables local video.
*
* @param enabled YES to enabled local video capture and render (by default), NO to disable using local camera device.
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)enableLocalVideo:(BOOL)enabled;
/**
* set video profile, including resolution, fps, kbps
*
* @param profile enumeration definition about the video resolution, fps and max kbps
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setVideoProfile:(AgoraVideoProfile)profile
swapWidthAndHeight:(BOOL)swapWidthAndHeight;
- (int)setVideoResolution: (CGSize)size andFrameRate: (NSInteger)frameRate bitrate: (NSInteger) bitrate;
- (int)enableLocalVideoCapture: (bool)enabled;
- (int)enableLocalVideoRender: (bool)enabled;
- (int)enableLocalVideoSend: (bool)enabled;
- (int)setVideoQualityParameters:(BOOL)preferFrameRateOverImageQuality;
/**
* Set up the local video view. The video canvus is initialized with video display setting. And it could be called before entering a channel.
*
* @param local the canvas is composed of view, renderMode and uid. How to initialize 'local'? please take a look at 'AgoraRtcVideoCanvas'
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setupLocalVideo:(AgoraRtcVideoCanvas * _Nullable)local;
/**
* Configure display setting of local view. And it could be called mutiple times during a call.
*
* @param mode There are Hidden(1), Fit(2) and Adaptive(3) mode. Please take a look at definition of enum AgoraVideoRenderMode
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setLocalRenderMode:(AgoraVideoRenderMode) mode;
/**
* Configure setting of local video mirror. And it should be set before open of preview.
* If the setting is after the open of preview, it needs reopen the preview to make the setting take effect.
* @param mode There are Default(0), Enabled(1) and Disabled(2) mode. Please take a look at definition of enum AgoraVideoMirrorMode
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setLocalVideoMirrorMode:(AgoraVideoMirrorMode) mode;
/**
* start local video preview, while not sending data to server
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)startPreview;
/**
* stop local video preview
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)stopPreview;
/**
* Switches between front and back cameras.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)switchCamera;
/**
* Set up the remote video view. The video canvus is initialized with video display setting. It could be called after receiving the remote video streams to configure the video settings.
*
* @param remote the canvas is composed of view, renderMode and uid. How to initialize 'remote'? please take a look at 'AgoraRtcVideoCanvas'
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setupRemoteVideo:(AgoraRtcVideoCanvas * _Nonnull)remote;
- (int)addVideoWatermark:(AgoraImage * _Nonnull)watermark NS_SWIFT_NAME(addVideoWatermark(_:));
- (void)clearVideoWatermarks;
/**
* Configure display setting of remote view. And it could be called mutiple times during a call.
*
* @param uid The user id of remote view.
* @param mode There are Hidden(1), Fit(2) and Adaptive(3) mode. Please take a look at definition of enum AgoraVideoRenderMode
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setRemoteRenderMode:(NSUInteger)uid
mode:(AgoraVideoRenderMode) mode;
/**
* Enable / disable sending local video streams to the network.
*
* @param mute YES: stop sending local video stream to the network, NO: start sending local video stream.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)muteLocalVideoStream:(BOOL)mute;
/**
* Enables / disables playing all remote callers’ video streams.
*
* @param mute YES: stop playing, NO: start playing.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)muteAllRemoteVideoStreams:(BOOL)mute;
/**
* Default enables / disables playing all remote callers’ video streams.
*
* @param mute YES: default not playing, NO: default playing.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setDefaultMuteAllRemoteVideoStreams:(BOOL)mute;
/**
* Enable / disable a remote user's video stream
*
* @param uid The remote user id
* @param mute YES: discard the video stream from remote user, NO: start receiving remote video stream.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)muteRemoteVideoStream:(NSUInteger)uid
mute:(BOOL)mute;
/**
* API deprecated. Please refer to open source https://github.com/AgoraLab/AgoraDemo, the function "onSwitchRemoteUsers" in demo agora-easycall-ios-oc
* Switches between video display views of two different users.
*
* @param uid1 The user ID of the user whose video is to be switched.
* @param uid2 The user ID of another user whose video is to be switched.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)switchView:(NSUInteger)uid1
andAnother:(NSUInteger)uid2 __deprecated;
#pragma mark Video dual stream
- (int)enableDualStreamMode:(BOOL)enabled;
- (int)setRemoteVideoStream:(NSUInteger)uid
type:(AgoraVideoStreamType)streamType;
- (int)setRemoteDefaultVideoStreamType:(AgoraVideoStreamType)streamType;
#if TARGET_OS_IPHONE
#pragma mark Video camera control
- (BOOL)isCameraZoomSupported;
- (CGFloat)setCameraZoomFactor:(CGFloat)zoomFactor;
- (BOOL)isCameraFocusPositionInPreviewSupported;
- (BOOL)setCameraFocusPositionInPreview:(CGPoint)position;
- (BOOL)isCameraTorchSupported;
- (BOOL)setCameraTorchOn:(BOOL)isOn;
- (BOOL)isCameraAutoFocusFaceModeSupported;
- (BOOL)setCameraAutoFocusFaceModeEnabled:(BOOL)enable;
#endif
#pragma mark Audio common
/**
* Enables audio function, which is enabled by default.
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)enableAudio;
/**
* Disable audio function.
*
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)disableAudio;
/**
* Pause audio function in channel.
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)pauseAudio;
/**
* Resume audio function in channel.
* @return 0 when this method is called successfully, or negative value when this method failed.
*/
- (int)resumeAudio;
/**
* Enable / Disable speaker of device
*
* @param enableSpeaker YES: Switches to speakerphone. NO: Switches to headset.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setEnableSpeakerphone:(BOOL)enableSpeaker;
/**
* test if the speakerphone is enabled or not.
*
* @return YES when speakerphone is enabled. NO when speakerphone is not enabled.
*/
- (BOOL)isSpeakerphoneEnabled;
/**
* Set default audio route to Speakerphone
*
* @param defaultToSpeaker YES: default to speakerphone. NO: default to earpiece for voice chat, speaker for video chat.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setDefaultAudioRouteToSpeakerphone:(BOOL)defaultToSpeaker;
/**
* set audio profile and scenario
* including sample rate, bit rate, mono/stereo, speech/music codec
*
* @param profile enumeration definition about the audio's samplerate, bitrate, mono/stereo, speech/music codec
* @param scenario enumeration definition about the audio scenario
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setAudioProfile:(AgoraAudioProfile)profile
scenario:(AgoraAudioScenario)scenario;
/**
* deprecated, use setAudioProfile:scenario: insted
*/
- (int)setHighQualityAudioParametersWithFullband:(BOOL)fullband
stereo:(BOOL)stereo
fullBitrate:(BOOL)fullBitrate __deprecated;
/**
* adjust recording signal volume
*
* @param [in] volume range from 0 to 400
*
* @return return 0 if success or an error code
*/
- (int)adjustRecordingSignalVolume:(NSInteger)volume;
/**
* adjust playback signal volume
*
* @param [in] volume range from 0 to 400
*
* @return return 0 if success or an error code
*/
- (int)adjustPlaybackSignalVolume:(NSInteger)volume;
/**
* Sets the speakerphone volume. The speaker volume could be adjust by MPMusicPlayerController and other iOS API easily.
*
* @param volume between 0 (lowest volume) to 255 (highest volume).
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setSpeakerphoneVolume:(NSUInteger)volume __deprecated;
/**
* Enables to report to the application about the volume of the speakers.
*
* @param interval Specifies the time interval between two consecutive volume indications.
<=0: Disables volume indication.
>0 : The volume indication interval in milliseconds. Recommandation: >=200ms.
* @param smooth The smoothing factor. Recommended: 3.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)enableAudioVolumeIndication:(NSInteger)interval
smooth:(NSInteger)smooth;
/**
* Mutes / Unmutes local audio.
*
* @param mute true: Mutes the local audio. false: Unmutes the local audio.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)muteLocalAudioStream:(BOOL)mute;
- (int)muteRemoteAudioStream:(NSUInteger)uid mute:(BOOL)mute;
/**
* Mutes / Unmutes all remote audio.
*
* @param mute true: Mutes all remote received audio. false: Unmutes all remote received audio.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)muteAllRemoteAudioStreams:(BOOL)mute;
/**
* Default Mutes / Unmutes all remote audio.
*
* @param mute true: default Mutes all remote received audio. false: default Unmutes all remote received audio.
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)setDefaultMuteAllRemoteAudioStreams:(BOOL)mute;
#if TARGET_OS_IPHONE
- (int)enableInEarMonitoring:(BOOL)enabled;
/**
* Set the audio ears back's volume and effect
* @param [in] volume
* set volume of audio ears back, in the range of [0..100], default value is 100
*
* @return return 0 if success or an error code
*/
- (int)setInEarMonitoringVolume:(NSInteger)volume;
#endif
/**
* Change the pitch of local speaker's voice
* @param [in] pitch
* frequency, in the range of [0.5..2.0], default value is 1.0
*
* @return return 0 if success or an error code
*/
- (int)setLocalVoicePitch:(double)pitch;
- (int)setLocalVoiceEqualizationOfBandFrequency:(AgoraAudioEqualizationBandFrequency)bandFrequency withGain:(NSInteger)gain;
- (int)setLocalVoiceReverbOfType:(AgoraAudioReverbType)reverbType withValue:(NSInteger)value;
#pragma mark Audio mixing
- (int)startAudioMixing:(NSString * _Nonnull)filePath
loopback:(BOOL)loopback
replace:(BOOL)replace
cycle:(NSInteger)cycle;
- (int)stopAudioMixing;
- (int)pauseAudioMixing;
- (int)resumeAudioMixing;
- (int)adjustAudioMixingVolume:(NSInteger)volume;
- (int)getAudioMixingDuration;
- (int)getAudioMixingCurrentPosition;
- (int)setAudioMixingPosition:(NSInteger)pos;
#pragma mark Audio effect
- (double)getEffectsVolume;
- (int)setEffectsVolume:(double)volume;
- (int)setVolumeOfEffect:(int)soundId
withVolume:(double)volume;
- (int)playEffect:(int)soundId
filePath:(NSString * _Nullable)filePath
loopCount:(int)loopCount
pitch:(double)pitch
pan:(double)pan
gain:(double)gain __deprecated;
- (int)playEffect:(int)soundId
filePath:(NSString * _Nullable)filePath
loopCount:(int)loopCount
pitch:(double)pitch
pan:(double)pan
gain:(double)gain
publish:(BOOL)publish;
- (int)stopEffect:(int)soundId;
- (int)stopAllEffects;
- (int)preloadEffect:(int)soundId
filePath:(NSString * _Nullable) filePath;
- (int)unloadEffect:(int)soundId;
- (int)pauseEffect:(int)soundId;
- (int)pauseAllEffects;
- (int)resumeEffect:(int)soundId;
- (int)resumeAllEffects;
#pragma mark Audio local recording
/**
* Start recording conversation to file specified by the file path.
*
* @param filePath file path to save recorded conversation.
* @param quality encode quality for the record file
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)startAudioRecording:(NSString * _Nonnull)filePath
quality:(AgoraAudioRecordingQuality)quality;
/**
* Stop conversation recording
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)stopAudioRecording;
#pragma mark Audio echo test
/**
* Launches an echo test to test if the audio devices (e.g., headset and speaker) and the network connection work properly. In the test, the user speaks first, and the recording will be played back in 10 seconds. If the user can hear what he said in 10 seconds, it indicates that the audio devices and network connection work properly.
Notes: Must call stopEchoTest to end the test, or won't start new test or join channel.
*
* @param successBlock The callback indicates that the user has successfully joined the specified channel.
*
* @return 0 when executed successfully. return negative value if failed. e.g. ERR_REFUSED (-5):Failed to launch the echo test, e.g., initialization failed.
*/
- (int)startEchoTest:(void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))successBlock;
/**
* Stop echo test.
*
* @return 0 when executed successfully. return negative value if failed. e.g. ERR_REFUSED(-5):Failed to stop the echo test. It could be that the echo test is not running.
*/
- (int)stopEchoTest;
#pragma mark Media Source
- (void)setVideoSource:(id<AgoraVideoSourceProtocol> _Nullable)videoSource;
- (id<AgoraVideoSourceProtocol> _Nullable)videoSource;
- (void)setLocalVideoRenderer:(id<AgoraVideoSinkProtocol> _Nullable)videoRenderer;
- (id<AgoraVideoSinkProtocol> _Nullable)localVideoRenderer;
- (void)setRemoteVideoRenderer:(id<AgoraVideoSinkProtocol> _Nullable)videoRenderer forUserId:(NSUInteger)userId;
- (id<AgoraVideoSinkProtocol> _Nullable)remoteVideoRendererOfUserId:(NSUInteger)userId;
#pragma mark External media source
// If external video source is to use, call this API before enableVideo/startPreview
- (void)setExternalVideoSource:(BOOL)enable useTexture:(BOOL)useTexture pushMode:(BOOL)pushMode;
// Push a video frame to SDK
- (BOOL)pushExternalVideoFrame:(AgoraVideoFrame * _Nonnull)frame;
- (void)enableExternalAudioSourceWithSampleRate:(NSUInteger)sampleRate
channelsPerFrame:(NSUInteger)channelsPerFrame;
- (void)disableExternalAudioSource;
- (BOOL)pushExternalAudioFrameRawData:(void * _Nonnull)data
samples:(NSUInteger)samples
timestamp:(NSTimeInterval)timestamp;
- (BOOL)pushExternalAudioFrameSampleBuffer:(CMSampleBufferRef _Nonnull)sampleBuffer;
- (int)setRecordingAudioFrameParametersWithSampleRate:(NSInteger)sampleRate
channel:(NSInteger)channel
mode:(AgoraAudioRawFrameOperationMode)mode
samplesPerCall:(NSInteger)samplesPerCall;
- (int)setPlaybackAudioFrameParametersWithSampleRate:(NSInteger)sampleRate
channel:(NSInteger)channel
mode:(AgoraAudioRawFrameOperationMode)mode
samplesPerCall:(NSInteger)samplesPerCall;
- (int)setMixedAudioFrameParametersWithSampleRate:(NSInteger)sampleRate
samplesPerCall:(NSInteger)samplesPerCall;
#pragma mark Encryption
/**
* Specify encryption mode of AES encryption algorithm.
* @param [in] encryptionMode
* encryption mode of AES algorithm, could be one of the following:
* "aes-128-xts", "aes-256-xts".
* The default value is "aes-128-xts". specify NULL value will use default encryption mode.
* @return return 0 if success or an error code
*/
- (int)setEncryptionMode:(NSString * _Nullable)encryptionMode;
/**
* Specifying encryption secret enables built-in AES-128 encryption. Leaving channel will clear the secret specified in last channel
* @param [in] secret
* secret to enable encryption
* @return return 0 if success or an error code
*/
- (int)setEncryptionSecret:(NSString * _Nullable)secret;
#pragma mark Data channel
- (int)createDataStream:(NSInteger * _Nonnull)streamId
reliable:(BOOL)reliable
ordered:(BOOL)ordered;
- (int)sendStreamMessage:(NSInteger)streamId
data:(NSData * _Nonnull)data;
#pragma mark Stream publish
- (int)addPublishStreamUrl:(NSString * _Nonnull)url transcodingEnabled:(BOOL) transcodingEnabled;
- (int)removePublishStreamUrl:(NSString * _Nonnull)url;
- (int)setLiveTranscoding:(AgoraLiveTranscoding *_Nullable) transcoding;
- (int)addInjectStreamUrl:(NSString * _Nonnull) url config:(AgoraLiveInjectStreamConfig * _Nonnull)config;
- (int)removeInjectStreamUrl:(NSString * _Nonnull) url;
- (int)configPublisher:(AgoraPublisherConfiguration * _Nonnull)config __deprecated;
- (int)setVideoCompositingLayout:(AgoraRtcVideoCompositingLayout * _Nonnull)layout __deprecated;
- (int)clearVideoCompositingLayout __deprecated;
#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
#pragma mark Screen capture
/**
* Start screen capture
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)startScreenCapture:(NSUInteger)windowId
withCaptureFreq:(NSInteger)captureFreq
bitRate:(NSInteger)bitRate
andRect:(CGRect)rect;
/**
* Stop screen capture
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)stopScreenCapture;
/**
* Update screen capture Region
*
* @return 0 when executed successfully. return negative value if failed.
*/
- (int)updateScreenCaptureRegion:(CGRect)rect;
#pragma mark Device test
- (void)monitorDeviceChange:(BOOL)enabled;
- (NSArray<AgoraRtcDeviceInfo *> * _Nullable)enumerateDevices:(AgoraMediaDeviceType)type;
- (NSString * _Nullable)getDeviceId:(AgoraMediaDeviceType)type;
- (int)setDevice:(AgoraMediaDeviceType)type deviceId:(NSString * _Nonnull)deviceId;
- (int)getDeviceVolume:(AgoraMediaDeviceType)type;
- (int)setDeviceVolume:(AgoraMediaDeviceType)type volume:(int)volume;
- (int)startRecordingDeviceTest:(int)indicationInterval;
- (int)stopRecordingDeviceTest;
- (int)startPlaybackDeviceTest:(NSString * _Nonnull)audioFileName;
- (int)stopPlaybackDeviceTest;
- (int)startCaptureDeviceTest:(NSView * _Nonnull)view;
- (int)stopCaptureDeviceTest;
#endif
#pragma mark Server recording
- (int)startRecordingService:(NSString * _Nonnull)recordingKey;
- (int)stopRecordingService:(NSString * _Nonnull)recordingKey;
- (int)refreshRecordingServiceStatus;
#pragma mark Deprecated blocks
- (void)audioVolumeIndicationBlock:(void(^ _Nullable)(NSArray * _Nonnull speakers, NSInteger totalVolume))audioVolumeIndicationBlock __deprecated;
- (void)firstLocalVideoFrameBlock:(void(^ _Nullable)(NSInteger width, NSInteger height, NSInteger elapsed))firstLocalVideoFrameBlock __deprecated;
- (void)firstRemoteVideoDecodedBlock:(void(^ _Nullable)(NSUInteger uid, NSInteger width, NSInteger height, NSInteger elapsed))firstRemoteVideoDecodedBlock __deprecated;
- (void)firstRemoteVideoFrameBlock:(void(^ _Nullable)(NSUInteger uid, NSInteger width, NSInteger height, NSInteger elapsed))firstRemoteVideoFrameBlock __deprecated;
- (void)userJoinedBlock:(void(^ _Nullable)(NSUInteger uid, NSInteger elapsed))userJoinedBlock __deprecated;
- (void)userOfflineBlock:(void(^ _Nullable)(NSUInteger uid))userOfflineBlock __deprecated;
- (void)userMuteAudioBlock:(void(^ _Nullable)(NSUInteger uid, BOOL muted))userMuteAudioBlock __deprecated;
- (void)userMuteVideoBlock:(void(^ _Nullable)(NSUInteger uid, BOOL muted))userMuteVideoBlock __deprecated;
- (void)localVideoStatBlock:(void(^ _Nullable)(NSInteger sentBitrate, NSInteger sentFrameRate))localVideoStatBlock __deprecated;
- (void)remoteVideoStatBlock:(void(^ _Nullable)(NSUInteger uid, NSInteger delay, NSInteger receivedBitrate, NSInteger receivedFrameRate))remoteVideoStatBlock __deprecated;
- (void)cameraReadyBlock:(void(^ _Nullable)(void))cameraReadyBlock __deprecated;
- (void)connectionLostBlock:(void(^ _Nullable)(void))connectionLostBlock __deprecated;
- (void)rejoinChannelSuccessBlock:(void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))rejoinChannelSuccessBlock __deprecated;
- (void)rtcStatsBlock:(void(^ _Nullable)(AgoraChannelStats * _Nonnull stat))rtcStatsBlock __deprecated;
- (void)leaveChannelBlock:(void(^ _Nullable)(AgoraChannelStats * _Nonnull stat))leaveChannelBlock __deprecated;
- (void)audioQualityBlock:(void(^ _Nullable)(NSUInteger uid, AgoraNetworkQuality quality, NSUInteger delay, NSUInteger lost))audioQualityBlock __deprecated;
- (void)networkQualityBlock:(void(^ _Nullable)(NSUInteger uid, AgoraNetworkQuality txQuality, AgoraNetworkQuality rxQuality))networkQualityBlock __deprecated;
- (void)lastmileQualityBlock:(void(^ _Nullable)(AgoraNetworkQuality quality))lastmileQualityBlock __deprecated;
- (void)mediaEngineEventBlock:(void(^ _Nullable)(NSInteger code))mediaEngineEventBlock __deprecated;
@end
#ifndef AGORA_MEDIA_ENGINE_H
#define AGORA_MEDIA_ENGINE_H
#if defined _WIN32 || defined __CYGWIN__
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
namespace agora
{
namespace media
{
enum MEDIA_SOURCE_TYPE {
AUDIO_PLAYOUT_SOURCE = 0,
AUDIO_RECORDING_SOURCE = 1,
};
class IAudioFrameObserver
{
public:
enum AUDIO_FRAME_TYPE {
FRAME_TYPE_PCM16 = 0, //PCM 16bit little endian
};
struct AudioFrame {
AUDIO_FRAME_TYPE type;
int samples; //number of samples in this frame
int bytesPerSample; //number of bytes per sample: 2 for PCM16
int channels; //number of channels (data are interleaved if stereo)
int samplesPerSec; //sampling rate
void* buffer; //data buffer
int64_t renderTimeMs;
};
public:
virtual bool onRecordAudioFrame(AudioFrame& audioFrame) = 0;
virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) = 0;
virtual bool onMixedAudioFrame(AudioFrame& audioFrame) = 0;
virtual bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, AudioFrame& audioFrame) = 0;
};
class IVideoFrameObserver
{
public:
enum VIDEO_FRAME_TYPE {
FRAME_TYPE_YUV420 = 0, //YUV 420 format
};
struct VideoFrame {
VIDEO_FRAME_TYPE type;
int width; //width of video frame
int height; //height of video frame
int yStride; //stride of Y data buffer
int uStride; //stride of U data buffer
int vStride; //stride of V data buffer
void* yBuffer; //Y data buffer
void* uBuffer; //U data buffer
void* vBuffer; //V data buffer
int rotation; // rotation of this frame (0, 90, 180, 270)
int64_t renderTimeMs;
};
public:
virtual bool onCaptureVideoFrame(VideoFrame& videoFrame) = 0;
virtual bool onRenderVideoFrame(unsigned int uid, VideoFrame& videoFrame) = 0;
};
class IVideoFrame
{
public:
enum PLANE_TYPE {
Y_PLANE = 0,
U_PLANE = 1,
V_PLANE = 2,
NUM_OF_PLANES = 3
};
enum VIDEO_TYPE {
VIDEO_TYPE_UNKNOWN = 0,
VIDEO_TYPE_I420 = 1,
VIDEO_TYPE_IYUV = 2,
VIDEO_TYPE_RGB24 = 3,
VIDEO_TYPE_ABGR = 4,
VIDEO_TYPE_ARGB = 5,
VIDEO_TYPE_ARGB4444 = 6,
VIDEO_TYPE_RGB565 = 7,
VIDEO_TYPE_ARGB1555 = 8,
VIDEO_TYPE_YUY2 = 9,
VIDEO_TYPE_YV12 = 10,
VIDEO_TYPE_UYVY = 11,
VIDEO_TYPE_MJPG = 12,
VIDEO_TYPE_NV21 = 13,
VIDEO_TYPE_NV12 = 14,
VIDEO_TYPE_BGRA = 15,
VIDEO_TYPE_RGBA = 16,
};
virtual void release() = 0;
virtual const unsigned char* buffer(PLANE_TYPE type) const = 0;
// Copy frame: If required size is bigger than allocated one, new buffers of
// adequate size will be allocated.
// Return value: 0 on success ,-1 on error.
virtual int copyFrame(IVideoFrame** dest_frame) const = 0;
// Convert frame
// Input:
// - src_frame : Reference to a source frame.
// - dst_video_type : Type of output video.
// - dst_sample_size : Required only for the parsing of MJPG.
// - dst_frame : Pointer to a destination frame.
// Return value: 0 if OK, < 0 otherwise.
// It is assumed that source and destination have equal height.
virtual int convertFrame(VIDEO_TYPE dst_video_type, int dst_sample_size, unsigned char* dst_frame) const = 0;
// Get allocated size per plane.
virtual int allocated_size(PLANE_TYPE type) const = 0;
// Get allocated stride per plane.
virtual int stride(PLANE_TYPE type) const = 0;
// Get frame width.
virtual int width() const = 0;
// Get frame height.
virtual int height() const = 0;
// Get frame timestamp (90kHz).
virtual unsigned int timestamp() const = 0;
// Get render time in milliseconds.
virtual int64_t render_time_ms() const = 0;
// Return true if underlying plane buffers are of zero size, false if not.
virtual bool IsZeroSize() const = 0;
};
class IExternalVideoRenderCallback
{
public:
virtual void onViewSizeChanged(int width, int height) = 0;
virtual void onViewDestroyed() = 0;
};
struct ExternalVideoRenerContext
{
IExternalVideoRenderCallback* renderCallback;
void* view;
int renderMode;
int zOrder;
float left;
float top;
float right;
float bottom;
};
class IExternalVideoRender
{
public:
virtual void release() = 0;
virtual int initialize() = 0;
virtual int deliverFrame(const IVideoFrame& videoFrame, int rotation, bool mirrored) = 0;
};
class IExternalVideoRenderFactory
{
public:
virtual IExternalVideoRender* createRenderInstance(const ExternalVideoRenerContext& context) = 0;
};
class IMediaEngine
{
public:
virtual void release() = 0;
virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0;
virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0;
virtual int registerVideoRenderFactory(IExternalVideoRenderFactory* factory) = 0;
virtual int pushAudioFrame(MEDIA_SOURCE_TYPE type, IAudioFrameObserver::AudioFrame *frame, bool wrap = false){ return -1; }
};
} //media
} //agora
#endif //AGORA_MEDIA_ENGINE_H
//
// Agora Rtc Engine SDK
//
// Created by Sting Feng in 2015-02.
// Copyright (c) 2015 Agora IO. All rights reserved.
//
#ifndef AGORA_RTC_ENGINE_H
#define AGORA_RTC_ENGINE_H
#include "AgoraBase.h"
#include "IAgoraService.h"
namespace agora {
namespace rtc {
typedef unsigned int uid_t;
typedef void* view_t;
enum MAX_DEVICE_ID_LENGTH_TYPE
{
MAX_DEVICE_ID_LENGTH = 512
};
enum QUALITY_REPORT_FORMAT_TYPE
{
QUALITY_REPORT_JSON = 0,
QUALITY_REPORT_HTML = 1,
};
enum MEDIA_ENGINE_EVENT_CODE_TYPE
{
MEDIA_ENGINE_RECORDING_ERROR = 0,
MEDIA_ENGINE_PLAYOUT_ERROR = 1,
MEDIA_ENGINE_RECORDING_WARNING = 2,
MEDIA_ENGINE_PLAYOUT_WARNING = 3,
MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH = 10,
MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS = 12,
MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS = 13,
// media engine role changed
MEDIA_ENGINE_ROLE_BROADCASTER_SOLO = 20,
MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE = 21,
MEDIA_ENGINE_ROLE_AUDIENCE = 22,
MEDIA_ENGINE_ROLE_COMM_PEER = 23,
MEDIA_ENGINE_ROLE_GAME_PEER = 24,
// iOS adm sample rate changed
MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART = 110,
MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART = 111,
};
enum MEDIA_DEVICE_STATE_TYPE
{
MEDIA_DEVICE_STATE_ACTIVE = 1,
MEDIA_DEVICE_STATE_DISABLED = 2,
MEDIA_DEVICE_STATE_NOT_PRESENT = 4,
MEDIA_DEVICE_STATE_UNPLUGGED = 8
};
enum MEDIA_DEVICE_TYPE
{
UNKNOWN_AUDIO_DEVICE = -1,
AUDIO_PLAYOUT_DEVICE = 0,
AUDIO_RECORDING_DEVICE = 1,
VIDEO_RENDER_DEVICE = 2,
VIDEO_CAPTURE_DEVICE = 3,
AUDIO_APPLICATION_PLAYOUT_DEVICE = 4,
};
enum AUDIO_RECORDING_QUALITY_TYPE
{
AUDIO_RECORDING_QUALITY_LOW = 0,
AUDIO_RECORDING_QUALITY_MEDIUM = 1,
AUDIO_RECORDING_QUALITY_HIGH = 2,
};
enum QUALITY_TYPE
{
QUALITY_UNKNOWN = 0,
QUALITY_EXCELLENT = 1,
QUALITY_GOOD = 2,
QUALITY_POOR = 3,
QUALITY_BAD = 4,
QUALITY_VBAD = 5,
QUALITY_DOWN = 6,
QUALITY_UNSUPPORTED = 7,
};
enum RENDER_MODE_TYPE
{
RENDER_MODE_HIDDEN = 1,
RENDER_MODE_FIT = 2,
RENDER_MODE_ADAPTIVE = 3,
};
enum VIDEO_MIRROR_MODE_TYPE
{
VIDEO_MIRROR_MODE_AUTO = 0,//determined by SDK
VIDEO_MIRROR_MODE_ENABLED = 1,//enabled mirror
VIDEO_MIRROR_MODE_DISABLED = 2,//disable mirror
};
enum VIDEO_PROFILE_TYPE
{ // res fps
VIDEO_PROFILE_LANDSCAPE_120P = 0, // 160x120 15
VIDEO_PROFILE_LANDSCAPE_120P_3 = 2, // 120x120 15
VIDEO_PROFILE_LANDSCAPE_180P = 10, // 320x180 15
VIDEO_PROFILE_LANDSCAPE_180P_3 = 12, // 180x180 15
VIDEO_PROFILE_LANDSCAPE_180P_4 = 13, // 240x180 15
VIDEO_PROFILE_LANDSCAPE_240P = 20, // 320x240 15
VIDEO_PROFILE_LANDSCAPE_240P_3 = 22, // 240x240 15
VIDEO_PROFILE_LANDSCAPE_240P_4 = 23, // 424x240 15
VIDEO_PROFILE_LANDSCAPE_360P = 30, // 640x360 15
VIDEO_PROFILE_LANDSCAPE_360P_3 = 32, // 360x360 15
VIDEO_PROFILE_LANDSCAPE_360P_4 = 33, // 640x360 30
VIDEO_PROFILE_LANDSCAPE_360P_6 = 35, // 360x360 30
VIDEO_PROFILE_LANDSCAPE_360P_7 = 36, // 480x360 15
VIDEO_PROFILE_LANDSCAPE_360P_8 = 37, // 480x360 30
VIDEO_PROFILE_LANDSCAPE_360P_9 = 38, // 640x360 15
VIDEO_PROFILE_LANDSCAPE_360P_10 = 39, // 640x360 24
VIDEO_PROFILE_LANDSCAPE_360P_11 = 100, // 640x360 24
VIDEO_PROFILE_LANDSCAPE_480P = 40, // 640x480 15
VIDEO_PROFILE_LANDSCAPE_480P_3 = 42, // 480x480 15
VIDEO_PROFILE_LANDSCAPE_480P_4 = 43, // 640x480 30
VIDEO_PROFILE_LANDSCAPE_480P_6 = 45, // 480x480 30
VIDEO_PROFILE_LANDSCAPE_480P_8 = 47, // 848x480 15
VIDEO_PROFILE_LANDSCAPE_480P_9 = 48, // 848x480 30
VIDEO_PROFILE_LANDSCAPE_480P_10 = 49, // 640x480 10
VIDEO_PROFILE_LANDSCAPE_720P = 50, // 1280x720 15
VIDEO_PROFILE_LANDSCAPE_720P_3 = 52, // 1280x720 30
VIDEO_PROFILE_LANDSCAPE_720P_5 = 54, // 960x720 15
VIDEO_PROFILE_LANDSCAPE_720P_6 = 55, // 960x720 30
VIDEO_PROFILE_LANDSCAPE_1080P = 60, // 1920x1080 15
VIDEO_PROFILE_LANDSCAPE_1080P_3 = 62, // 1920x1080 30
VIDEO_PROFILE_LANDSCAPE_1080P_5 = 64, // 1920x1080 60
VIDEO_PROFILE_LANDSCAPE_1440P = 66, // 2560x1440 30
VIDEO_PROFILE_LANDSCAPE_1440P_2 = 67, // 2560x1440 60
VIDEO_PROFILE_LANDSCAPE_4K = 70, // 3840x2160 30
VIDEO_PROFILE_LANDSCAPE_4K_3 = 72, // 3840x2160 60
VIDEO_PROFILE_PORTRAIT_120P = 1000, // 120x160 15
VIDEO_PROFILE_PORTRAIT_120P_3 = 1002, // 120x120 15
VIDEO_PROFILE_PORTRAIT_180P = 1010, // 180x320 15
VIDEO_PROFILE_PORTRAIT_180P_3 = 1012, // 180x180 15
VIDEO_PROFILE_PORTRAIT_180P_4 = 1013, // 180x240 15
VIDEO_PROFILE_PORTRAIT_240P = 1020, // 240x320 15
VIDEO_PROFILE_PORTRAIT_240P_3 = 1022, // 240x240 15
VIDEO_PROFILE_PORTRAIT_240P_4 = 1023, // 240x424 15
VIDEO_PROFILE_PORTRAIT_360P = 1030, // 360x640 15
VIDEO_PROFILE_PORTRAIT_360P_3 = 1032, // 360x360 15
VIDEO_PROFILE_PORTRAIT_360P_4 = 1033, // 360x640 30
VIDEO_PROFILE_PORTRAIT_360P_6 = 1035, // 360x360 30
VIDEO_PROFILE_PORTRAIT_360P_7 = 1036, // 360x480 15
VIDEO_PROFILE_PORTRAIT_360P_8 = 1037, // 360x480 30
VIDEO_PROFILE_PORTRAIT_360P_9 = 1038, // 360x640 15
VIDEO_PROFILE_PORTRAIT_360P_10 = 1039, // 360x640 24
VIDEO_PROFILE_PORTRAIT_360P_11 = 1100, // 360x640 24
VIDEO_PROFILE_PORTRAIT_480P = 1040, // 480x640 15
VIDEO_PROFILE_PORTRAIT_480P_3 = 1042, // 480x480 15
VIDEO_PROFILE_PORTRAIT_480P_4 = 1043, // 480x640 30
VIDEO_PROFILE_PORTRAIT_480P_6 = 1045, // 480x480 30
VIDEO_PROFILE_PORTRAIT_480P_8 = 1047, // 480x848 15
VIDEO_PROFILE_PORTRAIT_480P_9 = 1048, // 480x848 30
VIDEO_PROFILE_PORTRAIT_480P_10 = 1049, // 480x640 10
VIDEO_PROFILE_PORTRAIT_720P = 1050, // 720x1280 15
VIDEO_PROFILE_PORTRAIT_720P_3 = 1052, // 720x1280 30
VIDEO_PROFILE_PORTRAIT_720P_5 = 1054, // 720x960 15
VIDEO_PROFILE_PORTRAIT_720P_6 = 1055, // 720x960 30
VIDEO_PROFILE_PORTRAIT_1080P = 1060, // 1080x1920 15
VIDEO_PROFILE_PORTRAIT_1080P_3 = 1062, // 1080x1920 30
VIDEO_PROFILE_PORTRAIT_1080P_5 = 1064, // 1080x1920 60
VIDEO_PROFILE_PORTRAIT_1440P = 1066, // 1440x2560 30
VIDEO_PROFILE_PORTRAIT_1440P_2 = 1067, // 1440x2560 60
VIDEO_PROFILE_PORTRAIT_4K = 1070, // 2160x3840 30
VIDEO_PROFILE_PORTRAIT_4K_3 = 1072, // 2160x3840 60
VIDEO_PROFILE_DEFAULT = VIDEO_PROFILE_LANDSCAPE_360P,
};
enum AUDIO_PROFILE_TYPE // sample rate, bit rate, mono/stereo, speech/music codec
{
AUDIO_PROFILE_DEFAULT = 0, // use default settings
AUDIO_PROFILE_SPEECH_STANDARD = 1, // 32Khz, 18kbps, mono, speech
AUDIO_PROFILE_MUSIC_STANDARD = 2, // 48Khz, 48kbps, mono, music
AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3, // 48Khz, 56kbps, stereo, music
AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4, // 48Khz, 128kbps, mono, music
AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5, // 48Khz, 192kbps, stereo, music
AUDIO_PROFILE_NUM = 6,
};
enum AUDIO_SCENARIO_TYPE // set a suitable scenario for your app type
{
AUDIO_SCENARIO_DEFAULT = 0,
AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT = 1,
AUDIO_SCENARIO_EDUCATION = 2,
AUDIO_SCENARIO_GAME_STREAMING = 3,
AUDIO_SCENARIO_SHOWROOM = 4,
AUDIO_SCENARIO_CHATROOM_GAMING = 5,
AUDIO_SCENARIO_NUM = 6,
};
enum CHANNEL_PROFILE_TYPE
{
CHANNEL_PROFILE_COMMUNICATION = 0,
CHANNEL_PROFILE_LIVE_BROADCASTING = 1,
CHANNEL_PROFILE_GAME = 2,
};
enum CLIENT_ROLE_TYPE
{
CLIENT_ROLE_BROADCASTER = 1,
CLIENT_ROLE_AUDIENCE = 2,
};
enum USER_OFFLINE_REASON_TYPE
{
USER_OFFLINE_QUIT = 0,
USER_OFFLINE_DROPPED = 1,
USER_OFFLINE_BECOME_AUDIENCE = 2,
};
enum INJECT_STREAM_STATUS
{
INJECT_STREAM_STATUS_START_SUCCESS = 0,
INJECT_STREAM_STATUS_START_ALREADY_EXISTS = 1,
INJECT_STREAM_STATUS_START_UNAUTHORIZED = 2,
INJECT_STREAM_STATUS_START_TIMEDOUT = 3,
INJECT_STREAM_STATUS_START_FAILED = 4,
INJECT_STREAM_STATUS_STOP_SUCCESS = 5,
INJECT_STREAM_STATUS_STOP_NOT_FOUND = 6,
INJECT_STREAM_STATUS_STOP_UNAUTHORIZED = 7,
INJECT_STREAM_STATUS_STOP_TIMEDOUT = 8,
INJECT_STREAM_STATUS_STOP_FAILED = 9,
INJECT_STREAM_STATUS_BROKEN = 10,
};
enum REMOTE_VIDEO_STREAM_TYPE
{
REMOTE_VIDEO_STREAM_HIGH = 0,
REMOTE_VIDEO_STREAM_LOW = 1,
};
enum RAW_AUDIO_FRAME_OP_MODE_TYPE
{
RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0,
RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY = 1,
RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2,
};
enum AUDIO_SAMPLE_RATE_TYPE
{
AUDIO_SAMPLE_RATE_32000 = 32000,
AUDIO_SAMPLE_RATE_44100 = 44100,
AUDIO_SAMPLE_RATE_48000 = 48000,
};
enum VIDEO_CODEC_PROFILE_TYPE
{
VIDEO_CODEC_PROFILE_BASELINE = 66,
VIDEO_CODEC_PROFILE_MAIN = 77,
VIDEO_CODEC_PROFILE_HIGH = 100,
};
enum AUDIO_EQUALIZATION_BAND_FREQUENCY
{
AUDIO_EQUALIZATION_BAND_31 = 0,
AUDIO_EQUALIZATION_BAND_62 = 1,
AUDIO_EQUALIZATION_BAND_125 = 2,
AUDIO_EQUALIZATION_BAND_250 = 3,
AUDIO_EQUALIZATION_BAND_500 = 4,
AUDIO_EQUALIZATION_BAND_1K = 5,
AUDIO_EQUALIZATION_BAND_2K = 6,
AUDIO_EQUALIZATION_BAND_4K = 7,
AUDIO_EQUALIZATION_BAND_8K = 8,
AUDIO_EQUALIZATION_BAND_16K = 9,
};
enum AUDIO_REVERB_TYPE
{
AUDIO_REVERB_DRY_LEVEL = 0, // (dB, [-20,10]), the level of the dry signal
AUDIO_REVERB_WET_LEVEL = 1, // (dB, [-20,10]), the level of the early reflection signal (wet signal)
AUDIO_REVERB_ROOM_SIZE = 2, // ([0, 100]), the room size of the reflection
AUDIO_REVERB_WET_DELAY = 3, // (ms, [0, 200]), the length of the initial delay of the wet signal in ms
AUDIO_REVERB_STRENGTH = 4, // ([0, 100]), the strength of the late reverberation
};
enum REMOTE_VIDEO_STATE
{
// REMOTE_VIDEO_STATE_STOPPED is not used at this version. Ignore this value.
// REMOTE_VIDEO_STATE_STOPPED = 0, // Default state, video is started or remote user disabled/muted video stream
REMOTE_VIDEO_STATE_RUNNING = 1, // Running state, remote video can be displayed normally
REMOTE_VIDEO_STATE_FROZEN = 2, // Remote video is frozen, probably due to network issue.
};
struct AudioVolumeInfo
{
uid_t uid;
unsigned int volume; // [0,255]
};
struct RtcStats
{
unsigned int duration;
unsigned int txBytes;
unsigned int rxBytes;
unsigned short txKBitRate;
unsigned short rxKBitRate;
unsigned short rxAudioKBitRate;
unsigned short txAudioKBitRate;
unsigned short rxVideoKBitRate;
unsigned short txVideoKBitRate;
unsigned int userCount;
double cpuAppUsage;
double cpuTotalUsage;
};
struct LocalVideoStats
{
int sentBitrate;
int sentFrameRate;
};
struct RemoteVideoStats
{
uid_t uid;
int delay; // obsolete
int width;
int height;
int receivedBitrate;
int receivedFrameRate;
REMOTE_VIDEO_STREAM_TYPE rxStreamType;
};
struct VideoCompositingLayout
{
struct Region {
uid_t uid;
double x;//[0,1]
double y;//[0,1]
double width;//[0,1]
double height;//[0,1]
int zOrder; //optional, [0, 100] //0 (default): bottom most, 100: top most
// Optional
// [0, 1.0] where 0 denotes throughly transparent, 1.0 opaque
double alpha;
RENDER_MODE_TYPE renderMode;//RENDER_MODE_HIDDEN: Crop, RENDER_MODE_FIT: Zoom to fit
Region()
:uid(0)
, x(0)
, y(0)
, width(0)
, height(0)
, zOrder(0)
, alpha(1.0)
, renderMode(RENDER_MODE_HIDDEN)
{}
};
int canvasWidth;
int canvasHeight;
const char* backgroundColor;//e.g. "#C0C0C0" in RGB
const Region* regions;
int regionCount;
const char* appData;
int appDataLength;
VideoCompositingLayout()
:canvasWidth(0)
,canvasHeight(0)
,backgroundColor(NULL)
,regions(NULL)
, regionCount(0)
, appData(NULL)
, appDataLength(0)
{}
};
typedef struct Rect {
int top;
int left;
int bottom;
int right;
Rect(): top(0), left(0), bottom(0), right(0) {}
Rect(int t, int l, int b, int r): top(t), left(l), bottom(b), right(r) {}
} Rect;
typedef struct TranscodingUser {
uid_t uid;
int x;
int y;
int width;
int height;
int zOrder;
double alpha;
int audioChannel;
TranscodingUser()
: uid(0)
, x(0)
, y(0)
, width(0)
, height(0)
, zOrder(0)
, alpha(1.0)
, audioChannel(0)
{}
} TranscodingUser;
typedef struct RtcImage {
RtcImage() :
url(nullptr),
x(0),
y(0),
width(0),
height(0)
{}
const char* url;
int x;
int y;
int width;
int height;
} RtcImage;
typedef struct LiveTranscoding {
int width;
int height;
int videoBitrate;
int videoFramerate;
bool lowLatency;
int videoGop;
VIDEO_CODEC_PROFILE_TYPE videoCodecProfile;
unsigned int backgroundColor;
unsigned int userCount;
TranscodingUser *transcodingUsers;
const char *transcodingExtraInfo;
RtcImage* watermark;
AUDIO_SAMPLE_RATE_TYPE audioSampleRate;
int audioBitrate;
int audioChannels;
LiveTranscoding()
: width(360)
, height(640)
, videoBitrate(400)
, videoFramerate(15)
, lowLatency(false)
, backgroundColor(0x000000)
, videoGop(30)
, videoCodecProfile(VIDEO_CODEC_PROFILE_HIGH)
, userCount(0)
, transcodingUsers(nullptr)
, transcodingExtraInfo(nullptr)
, watermark(nullptr)
, audioSampleRate(AUDIO_SAMPLE_RATE_48000)
, audioBitrate(48)
, audioChannels(1)
{}
} LiveTranscoding;
struct InjectStreamConfig {
int width;
int height;
int videoGop;
int videoFramerate;
int videoBitrate;
AUDIO_SAMPLE_RATE_TYPE audioSampleRate;
int audioBitrate;
int audioChannels;
// width / height default set to 0 means pull the stream with its original resolution
InjectStreamConfig()
: width(0)
, height(0)
, videoGop(30)
, videoFramerate(15)
, videoBitrate(400)
, audioSampleRate(AUDIO_SAMPLE_RATE_48000)
, audioBitrate(48)
, audioChannels(1)
{}
};
enum RTMP_STREAM_LIFE_CYCLE_TYPE
{
RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL = 1,
RTMP_STREAM_LIFE_CYCLE_BIND2OWNER = 2,
};
struct PublisherConfiguration {
int width;
int height;
int framerate;
int bitrate;
int defaultLayout;
int lifecycle;
bool owner;
int injectStreamWidth;
int injectStreamHeight;
const char* injectStreamUrl;
const char* publishUrl;
const char* rawStreamUrl;
const char* extraInfo;
PublisherConfiguration()
: width(640)
, height(360)
, framerate(15)
, bitrate(500)
, defaultLayout(1)
, lifecycle(RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL)
, owner(true)
, injectStreamWidth(0)
, injectStreamHeight(0)
, injectStreamUrl(NULL)
, publishUrl(NULL)
, rawStreamUrl(NULL)
, extraInfo(NULL)
{}
};
#if !defined(__ANDROID__)
struct VideoCanvas
{
view_t view;
int renderMode;
uid_t uid;
void *priv; // private data (underlying video engine denotes it)
VideoCanvas()
: view(NULL)
, renderMode(RENDER_MODE_HIDDEN)
, uid(0)
, priv(NULL)
{}
VideoCanvas(view_t v, int m, uid_t u)
: view(v)
, renderMode(m)
, uid(u)
, priv(NULL)
{}
};
#else
struct VideoCanvas;
#endif
class IPacketObserver
{
public:
struct Packet
{
const unsigned char* buffer;
unsigned int size;
};
/**
* called by sdk before the audio packet is sent to other participants
* @param [in,out] packet
* buffer *buffer points the data to be sent
* size of buffer data to be sent
* @return returns true to send out the packet, returns false to discard the packet
*/
virtual bool onSendAudioPacket(Packet& packet) = 0;
/**
* called by sdk before the video packet is sent to other participants
* @param [in,out] packet
* buffer *buffer points the data to be sent
* size of buffer data to be sent
* @return returns true to send out the packet, returns false to discard the packet
*/
virtual bool onSendVideoPacket(Packet& packet) = 0;
/**
* called by sdk when the audio packet is received from other participants
* @param [in,out] packet
* buffer *buffer points the data to be sent
* size of buffer data to be sent
* @return returns true to process the packet, returns false to discard the packet
*/
virtual bool onReceiveAudioPacket(Packet& packet) = 0;
/**
* called by sdk when the video packet is received from other participants
* @param [in,out] packet
* buffer *buffer points the data to be sent
* size of buffer data to be sent
* @return returns true to process the packet, returns false to discard the packet
*/
virtual bool onReceiveVideoPacket(Packet& packet) = 0;
};
/**
* the event call back interface
*/
class IRtcEngineEventHandler
{
public:
virtual ~IRtcEngineEventHandler() {}
/**
* when join channel success, the function will be called
* @param [in] channel
* the channel name you have joined
* @param [in] uid
* the UID of you in this channel
* @param [in] elapsed
* the time elapsed in ms from the joinChannel been called to joining completed
*/
virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) {
(void)channel;
(void)uid;
(void)elapsed;
}
/**
* when join channel success, the function will be called
* @param [in] channel
* the channel name you have joined
* @param [in] uid
* the UID of you in this channel
* @param [in] elapsed
* the time elapsed in ms elapsed
*/
virtual void onRejoinChannelSuccess(const char* channel, uid_t uid, int elapsed) {
(void)channel;
(void)uid;
(void)elapsed;
}
/**
* when warning message coming, the function will be called
* @param [in] warn
* warning code
* @param [in] msg
* the warning message
*/
virtual void onWarning(int warn, const char* msg) {
(void)warn;
(void)msg;
}
/**
* when error message come, the function will be called
* @param [in] err
* error code
* @param [in] msg
* the error message
*/
virtual void onError(int err, const char* msg) {
(void)err;
(void)msg;
}
/**
* when audio quality message come, the function will be called
* @param [in] uid
* the uid of the peer
* @param [in] quality
* the quality of the user, see QUALITY_TYPE for value definition
* @param [in] delay
* the average time of the audio packages delayed
* @param [in] lost
* the rate of the audio packages lost
*/
virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost) {
(void)uid;
(void)quality;
(void)delay;
(void)lost;
}
/**
* when the audio volume information come, the function will be called
* @param [in] speakers
* the array of the speakers' audio volume information
* @param [in] speakerNumber
* the count of speakers in this array
* @param [in] totalVolume
* the total volume of all users
*/
virtual void onAudioVolumeIndication(const AudioVolumeInfo* speakers, unsigned int speakerNumber, int totalVolume) {
(void)speakers;
(void)speakerNumber;
(void)totalVolume;
}
/**
* when the audio volume information come, the function will be called
* @param [in] stats
* the statistics of the call
*/
virtual void onLeaveChannel(const RtcStats& stats) {
(void)stats;
}
/**
* when the information of the RTC engine stats come, the function will be called
* @param [in] stats
* the RTC engine stats
*/
virtual void onRtcStats(const RtcStats& stats) {
(void)stats;
}
/**
* when the audio device state changed(plugged or removed), the function will be called
* @param [in] deviceId
* the ID of the state changed audio device
* @param [in] deviceType
* the type of the audio device(playout device or record device)
* @param [in] deviceState
* the device is been removed or added
*/
virtual void onAudioDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) {
(void)deviceId;
(void)deviceType;
(void)deviceState;
}
/**
* When audio mixing file playback finished, this function will be called
*/
virtual void onAudioMixingFinished() {
}
/**
* When far-end rhythm begins/ends, these functions will be called
*/
virtual void onRemoteAudioMixingBegin() {
}
virtual void onRemoteAudioMixingEnd() {
}
/**
* When audio effect playback finished, this function will be called
*/
virtual void onAudioEffectFinished(int soundId) {
}
/**
* when the video device state changed(plugged or removed), the function will be called
* @param [in] deviceId
* the ID of the state changed video device
* @param [in] deviceType
* not used
* @param [in] deviceState
* the device is been removed or added
*/
virtual void onVideoDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) {
(void)deviceId;
(void)deviceType;
(void)deviceState;
}
/**
* report the network quality
* @param [in] uid
* the UID of the remote user
* @param [in] txQuality
* the score of the send network quality 0~5 the higher the better
* @param [in] rxQuality
* the score of the recv network quality 0~5 the higher the better
*/
virtual void onNetworkQuality(uid_t uid, int txQuality, int rxQuality) {
(void)uid;
(void)txQuality;
(void)rxQuality;
}
/**
* report the last-mile test network quality
* @param [in] quality
* the score of the network quality 0~5 the higher the better
*/
virtual void onLastmileQuality(int quality) {
(void)quality;
}
/**
* when the first local video frame displayed, the function will be called
* @param [in] width
* the width of the video frame
* @param [in] height
* the height of the video frame
* @param [in] elapsed
* the time elapsed from channel joined in ms
*/
virtual void onFirstLocalVideoFrame(int width, int height, int elapsed) {
(void)width;
(void)height;
(void)elapsed;
}
/**
* when the first remote video frame decoded, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] width
* the width of the video frame
* @param [in] height
* the height of the video frame
* @param [in] elapsed
* the time elapsed from channel joined in ms
*/
virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) {
(void)uid;
(void)width;
(void)height;
(void)elapsed;
}
/**
* when video size changed or rotation changed, the function will be called
* @param [in] uid
* the UID of the remote user or local user (0)
* @param [in] width
* the new width of the video
* @param [in] height
* the new height of the video
* @param [in] rotation
* the rotation of the video
*/
virtual void onVideoSizeChanged(uid_t uid, int width, int height, int rotation) {
(void)uid;
(void)width;
(void)height;
(void)rotation;
}
virtual void onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state) {
(void)uid;
(void)state;
}
/**
* when the first remote video frame displayed, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] width
* the width of the video frame
* @param [in] height
* the height of the video frame
* @param [in] elapsed
* the time elapsed from remote user called joinChannel in ms
*/
virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) {
(void)uid;
(void)width;
(void)height;
(void)elapsed;
}
/**
* when any other user joined in the same channel, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] elapsed
* the time elapsed from remote used called joinChannel to joining completed in ms
*/
virtual void onUserJoined(uid_t uid, int elapsed) {
(void)uid;
(void)elapsed;
}
/**
* when user offline(exit channel or offline by accident), the function will be called
* @param [in] uid
* the UID of the remote user
*/
virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) {
(void)uid;
(void)reason;
}
/**
* when remote user muted the audio stream, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] muted
* true: the remote user muted the audio stream, false: the remote user unmuted the audio stream
*/
virtual void onUserMuteAudio(uid_t uid, bool muted) {
(void)uid;
(void)muted;
}
/**
* when remote user muted the video stream, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] muted
* true: the remote user muted the video stream, false: the remote user unmuted the video stream
*/
virtual void onUserMuteVideo(uid_t uid, bool muted) {
(void)uid;
(void)muted;
}
/**
* when remote user enable video function, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] enabled
* true: the remote user has enabled video function, false: the remote user has disabled video function
*/
virtual void onUserEnableVideo(uid_t uid, bool enabled) {
(void)uid;
(void)enabled;
}
/**
* when remote user enable local video function, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] enabled
* true: the remote user has enabled local video function, false: the remote user has disabled local video function
*/
virtual void onUserEnableLocalVideo(uid_t uid, bool enabled) {
(void)uid;
(void)enabled;
}
/**
* when api call executed completely, the function will be called
* @param [in] api
* the api name
* @param [in] err
* error code while 0 means OK
*/
virtual void onApiCallExecuted(int err, const char* api, const char* result) {
(void)err;
(void)api;
(void)result;
}
/**
* reported local video stats
* @param [in] stats
* the latest local video stats
*/
virtual void onLocalVideoStats(const LocalVideoStats& stats) {
(void)stats;
}
/**
* reported remote video stats
* @param [in] stats
* the latest remote video stats
*/
virtual void onRemoteVideoStats(const RemoteVideoStats& stats) {
(void)stats;
}
/**
* when the camera is ready to work, the function will be called
*/
virtual void onCameraReady() {}
virtual void onCameraFocusAreaChanged(int x, int y, int width, int height) {
(void)x;
(void)y;
(void)width;
(void)height;
}
/**
* when all video stopped, the function will be called then you can repaint the video windows
*/
virtual void onVideoStopped() {}
/**
* when the network can not worked well, the function will be called
*/
virtual void onConnectionLost() {}
/**
* when local user disconnected by accident, the function will be called(then SDK will try to reconnect itself)
*/
virtual void onConnectionInterrupted() {}
/**
* when local user is banned by the server, the function will be called
*/
virtual void onConnectionBanned() {}
virtual void onRefreshRecordingServiceStatus(int status) {
(void)status;
}
// virtual void onStreamError(int streamId, int code, int parameter, const char* message, size_t length) {}
/**
* when stream message received, the function will be called
* @param [in] uid
* UID of the peer who sends the message
* @param [in] streamId
* APP can create multiple streams for sending messages of different purposes
* @param [in] data
* the message data
* @param [in] length
* the message length, in bytes
* frame rate
*/
virtual void onStreamMessage(uid_t uid, int streamId, const char* data, size_t length) {
(void)uid;
(void)streamId;
(void)data;
(void)length;
}
/**
*
*/
virtual void onStreamMessageError(uid_t uid, int streamId, int code, int missed, int cached) {
(void)uid;
(void)streamId;
(void)code;
(void)missed;
(void)cached;
}
virtual void onMediaEngineLoadSuccess() {
}
virtual void onMediaEngineStartCallSuccess() {
}
/**
* when token is enabled, and specified token is invalid or expired, this function will be called.
* APP should generate a new token and call renewToken() to refresh the token.
* NOTE: to be compatible with previous version, ERR_TOKEN_EXPIRED and ERR_INVALID_TOKEN are also reported via onError() callback.
* You should move renew of token logic into this callback.
*/
virtual void onRequestToken() {
}
/**
* when the first local audio frame generated, the function will be called
* @param [in] elapsed
* the time elapsed from remote user called joinChannel in ms
*/
virtual void onFirstLocalAudioFrame(int elapsed) {
(void)elapsed;
}
/**
* when the first remote audio frame arrived, the function will be called
* @param [in] uid
* the UID of the remote user
* @param [in] elapsed
* the time elapsed from remote user called joinChannel in ms
*/
virtual void onFirstRemoteAudioFrame(uid_t uid, int elapsed) {
(void)uid;
(void)elapsed;
}
/** @param [in] uid
* the speaker uid who is talking in the channel
*/
virtual void onActiveSpeaker(uid_t uid) {
(void)uid;
}
/**
* when client role is successfully changed, the function will be called
*/
virtual void onClientRoleChanged(CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) {
}
virtual void onAudioDeviceVolumeChanged(MEDIA_DEVICE_TYPE deviceType, int volume, bool muted) {
(void)deviceType;
(void)volume;
(void)muted;
}
virtual void onStreamPublished(const char *url, int error) {
(void)url;
(void)error;
}
virtual void onStreamUnpublished(const char *url) {
(void)url;
}
virtual void onTranscodingUpdated() {
}
virtual void onStreamInjectedStatus(const char* url, uid_t uid, int status) {
(void)url;
(void)uid;
(void)status;
}
};
/**
* the video device collection interface
*/
class IVideoDeviceCollection
{
public:
/**
* get the audio device count
* @return returns the audio device count
*/
virtual int getCount() = 0;
/**
* get audio device information
* @param [in] index
* the index of the device in the device list
* @param [in, out] deviceName
* the device name, UTF8 format
* @param [in, out] deviceId
* the device ID, UTF8 format
* @return return 0 if success or an error code
*/
virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* set current active audio device
* @param [in] deviceId
* the deviceId of the device you want to active currently
* @return return 0 if success or an error code
*/
virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* release the resource
*/
virtual void release() = 0;
};
class IVideoDeviceManager
{
public:
/**
* create the IVideoDeviceCollection interface pointer
* @return return the IVideoDeviceCollection interface or nullptr if failed
*/
virtual IVideoDeviceCollection* enumerateVideoDevices() = 0;
/**
* active the video device for current using
* @param [in] deviceId
* the deviceId of the device you want to active currently
* @return return 0 if success or the error code.
*/
virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* get the current active video device
* @param [in, out] deviceId
* the device id of the current active video device
* @return return 0 if success or an error code
*/
virtual int getDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* test the video capture device to know whether it can worked well
* @param [in] hwnd
* the HWND of the video-display window
* @return return 0 if success or an error code
*/
virtual int startDeviceTest(view_t hwnd) = 0;
/**
* stop the video device testing
* @return return 0 if success or an error code
*/
virtual int stopDeviceTest() = 0;
/**
* release the resource
*/
virtual void release() = 0;
};
class IAudioDeviceCollection
{
public:
/**
* get the available devices count
* @return return the device count
*/
virtual int getCount() = 0;
/**
* get video device information
* @param [in] index
* the index of the device in the device list
* @param [in, out] deviceName
* the device name, UTF8 format
* @param [in, out] deviceId
* the device ID, UTF8 format
* @return return 0 if success or an error code
*/
virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* active the device for current using
* @param [in] deviceId
* the deviceId of the device you want to active currently
* @return return 0 if success or the error code.
*/
virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
virtual int setApplicationVolume(int volume) = 0;
virtual int getApplicationVolume(int& volume) = 0;
virtual int setApplicationMute(bool mute) = 0;
virtual int isApplicationMute(bool& mute) = 0;
/**
* release the resource
*/
virtual void release() = 0;
};
class IAudioDeviceManager
{
public:
/**
* create the IAudioDeviceCollection interface pointer of the playback devices
* @return return the IVideoDeviceCollection interface or nullptr if failed
*/
virtual IAudioDeviceCollection* enumeratePlaybackDevices() = 0;
/**
* create the IAudioDeviceCollection interface pointer of the Recording devices
* @return return the IVideoDeviceCollection interface or nullptr if failed
*/
virtual IAudioDeviceCollection* enumerateRecordingDevices() = 0;
/**
* active the playback device for current using
* @param [in] deviceId
* the deviceId of the playback device you want to active currently
* @return return 0 if success or the error code.
*/
virtual int setPlaybackDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* get the current active playback device
* @param [in, out] deviceId
* the device id of the current active video device
* @return return 0 if success or an error code
*/
virtual int getPlaybackDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* set current playback device volume
* @param [in] volume
* the volume you want to set 0-255
* @return return 0 if success or an error code
*/
virtual int setPlaybackDeviceVolume(int volume) = 0;
/**
* get current playback device volume
* @param [in, out] volume
* the current playback device volume 0-255
* @return return 0 if success or an error code
*/
virtual int getPlaybackDeviceVolume(int *volume) = 0;
/**
* active the recording audio device for current using
* @param [in] deviceId
* the deviceId of the recording audio device you want to active currently
* @return return 0 if success or the error code.
*/
virtual int setRecordingDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* get the current active recording device
* @param [in, out] deviceId
* the device id of the current active recording audio device
* @return return 0 if success or an error code
*/
virtual int getRecordingDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
/**
* set current recording device volume
* @param [in] volume
* the volume you want to set 0-255
* @return return 0 if success or an error code
*/
virtual int setRecordingDeviceVolume(int volume) = 0;
/**
* get current recording device volume
* @param [in, out] volume
* the current recording device volume 0-255
* @return return 0 if success or an error code
*/
virtual int getRecordingDeviceVolume(int *volume) = 0;
virtual int setPlaybackDeviceMute(bool mute) = 0;
virtual int getPlaybackDeviceMute(bool *mute) = 0;
virtual int setRecordingDeviceMute(bool mute) = 0;
virtual int getRecordingDeviceMute(bool *mute) = 0;
/**
* test the playback audio device to know whether it can worked well
* @param [in] testAudioFilePath
* the path of the .wav file
* @return return 0 if success and you can hear the sound of the .wav file or an error code.
*/
virtual int startPlaybackDeviceTest(const char* testAudioFilePath) = 0;
/**
* stop the playback audio device testing
* @return return 0 if success or an error code
*/
virtual int stopPlaybackDeviceTest() = 0;
/**
* test the recording audio device to know whether it can worked well
* @param [in] indicationInterval
* the period in ms of the call back cycle
* @return return 0 if success or an error code
*/
virtual int startRecordingDeviceTest(int indicationInterval) = 0;
/**
* stop the recording audio device testing
* @return return 0 if success or an error code
*/
virtual int stopRecordingDeviceTest() = 0;
/**
* release the resource
*/
virtual void release() = 0;
};
struct RtcEngineContext
{
IRtcEngineEventHandler* eventHandler;
const char* appId;
RtcEngineContext()
:eventHandler(NULL)
,appId(NULL)
{}
};
class IRtcEngine
{
public:
/**
* release the engine resource
* @param [in] sync
* true: release the engine resources and return after all resources have been destroyed.
* APP should try not to call release(true) in the engine's callbacks, call it this way in a separate thread instead.
* false: notify engine to release its resources and returns without waiting for resources are really destroyed
*/
virtual void release(bool sync=false) = 0;
/**
* initialize the engine
* @param [in] context
* the RTC engine context
* @return return 0 if success or an error code
*/
virtual int initialize(const RtcEngineContext& context) = 0;
/**
* get the pointer of the device manager object.
* @param [in] iid
* the iid of the interface you want to get
* @param [in, out] inter
* the pointer of the pointer you want to point to DeviceManager object
* @return return 0 if success or an error code
*/
virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0;
/**
* get the version information of the SDK
* @param [in, out] build
* the build number
* @return return the version number string in char format
*/
virtual const char* getVersion(int* build) = 0;
/**
* get the version information of the SDK
* @param [in, out] code
* the build number
* @return return the version number string in char format
*/
virtual const char* getErrorDescription(int code) = 0;
/**
* join the channel, if the channel have not been created, it will been created automatically
* @param [in] token
* the token, if you have initialized the engine with an available APP ID, it can be null here. If you enable token on the dashboard, specify token here
* @param [in] channelId
* the channel id
* @param [in] info
* the additional information, it can be null here
* @param [in] uid
* the uid of you, if 0 the system will automatically allocate one for you
* @return return 0 if success or an error code
*/
virtual int joinChannel(const char* token, const char* channelId, const char* info, uid_t uid) = 0;
/**
* leave the current channel
* @return return 0 if success or an error code
*/
virtual int leaveChannel() = 0;
/**
* renew the token for the current channel
* @param [in] token the renewed token, if old token expired.
* @return return 0 if success or an error code
*/
virtual int renewToken(const char* token) = 0;
virtual int setChannelProfile(CHANNEL_PROFILE_TYPE profile) = 0;
virtual int setClientRole(CLIENT_ROLE_TYPE role) = 0;
/**
* start the echo testing, if every thing goes well you can hear your echo from the server
* @return return 0 if success or an error code
*/
virtual int startEchoTest() = 0;
/**
* stop the echo testing
* @return return 0 if success or an error code
*/
virtual int stopEchoTest() = 0;
/**
* start the network testing
* @return return 0 if success or an error code
*/
virtual int enableLastmileTest() = 0;
/**
* stop the network testing
* @return return 0 if success or an error code
*/
virtual int disableLastmileTest() = 0;
/**
* enable video function
* @return return 0 if success or an error code
*/
virtual int enableVideo() = 0;
/**
* disable video function
* @return return 0 if success or an error code
*/
virtual int disableVideo() = 0;
/**
* start the local video previewing
* @return return 0 if success or an error code
*/
virtual int startPreview() = 0;
/**
* stop the local video previewing
* @return return 0 if success or an error code
*/
virtual int stopPreview() = 0;
virtual int setVideoProfile(VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight) = 0;
/**
* set the remote video canvas
* @param [in] canvas
* the canvas information
* @return return 0 if success or an error code
*/
virtual int setupRemoteVideo(const VideoCanvas& canvas) = 0;
/**
* set the local video canvas
* @param [in] canvas
* the canvas information
* @return return 0 if success or an error code
*/
virtual int setupLocalVideo(const VideoCanvas& canvas) = 0;
/**
* enable audio function, which is enabled by deault.
* @return return 0 if success or an error code
*/
virtual int enableAudio() = 0;
/**
* disable audio function
* @return return 0 if success or an error code
*/
virtual int disableAudio() = 0;
virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) = 0;
#if defined(__APPLE__) || defined(_WIN32)
#if defined(__APPLE__)
typedef unsigned int WindowIDType;
#elif defined(_WIN32)
typedef HWND WindowIDType;
#endif
/**
* start screen/windows capture
*
* @param windowId screen capture, if windowId is 0; windows capture if windowsId isn't 0;
* @param rect valid when windowId is 0; whole screen if rect is NULL.
*
* @return return 0 if success or an error code
*/
virtual int startScreenCapture(WindowIDType windowId, int captureFreq, const Rect *rect, int bitrate) = 0;
/**
* stop screen capture
* @return return 0 if success or an error code
*/
virtual int stopScreenCapture() = 0;
/**
* update screen capture region
*
* @param rect valid when windowId is 0; whole screen if rect is NULL.
*
* @return return 0 if success or an error code
*/
virtual int updateScreenCaptureRegion(const Rect *rect) = 0;
#endif
/**
* get self call id in the current channel
* @param [in, out] callId
* the self call Id
* @return return 0 if success or an error code
*/
virtual int getCallId(agora::util::AString& callId) = 0;
virtual int rate(const char* callId, int rating, const char* description) = 0; // 0~10
virtual int complain(const char* callId, const char* description) = 0;
/**
* register a packet observer while the packet arrived or ready to be sent, the observer can touch the packet data
* @param [in] observer
* the pointer of the observer object
* @return return 0 if success or an error code
*/
virtual int registerPacketObserver(IPacketObserver* observer) = 0;
/**
* Specify encryption mode of AES encryption algorithm.
* @param [in] encryptionMode
* encryption mode of AES algorithm, could be one of the following:
* "aes-128-xts", "aes-256-xts".
* The default value is "aes-128-xts". specify NULL value will use default encryption mode.
* @return return 0 if success or an error code
*/
virtual int setEncryptionMode(const char* encryptionMode) = 0;
/**
* Specify encryption secret enables built-in encryption function. Leaving channel will clear the secret specified in last channel
* @param [in] secret
* secret to enable encryption
* @return return 0 if success or an error code
*/
virtual int setEncryptionSecret(const char* secret) = 0;
virtual int createDataStream(int* streamId, bool reliable, bool ordered) = 0;
virtual int sendStreamMessage(int streamId, const char* data, size_t length) = 0;
virtual int setVideoCompositingLayout(const VideoCompositingLayout& sei) = 0;
virtual int clearVideoCompositingLayout() = 0;
virtual int configPublisher(const PublisherConfiguration& config) = 0;
virtual int addPublishStreamUrl(const char *url, bool transcodingEnabled) = 0;
virtual int removePublishStreamUrl(const char *url) = 0;
virtual int setLiveTranscoding(const LiveTranscoding &transcoding) = 0;
virtual int addVideoWatermark(const RtcImage& watermark) = 0;
virtual int clearVideoWatermarks() = 0;
virtual int addInjectStreamUrl(const char* url, const InjectStreamConfig& config) = 0;
virtual int removeInjectStreamUrl(const char* url) = 0;
virtual bool registerEventHandler(IRtcEngineEventHandler *eventHandler) = 0;
virtual bool unregisterEventHandler(IRtcEngineEventHandler *eventHandler) = 0;
};
class IRtcEngineParameter
{
public:
/**
* release the resource
*/
virtual void release() = 0;
/**
* set bool value of the json
* @param [in] key
* the key name
* @param [in] value
* the value
* @return return 0 if success or an error code
*/
virtual int setBool(const char* key, bool value) = 0;
/**
* set int value of the json
* @param [in] key
* the key name
* @param [in] value
* the value
* @return return 0 if success or an error code
*/
virtual int setInt(const char* key, int value) = 0;
/**
* set unsigned int value of the json
* @param [in] key
* the key name
* @param [in] value
* the value
* @return return 0 if success or an error code
*/
virtual int setUInt(const char* key, unsigned int value) = 0;
/**
* set double value of the json
* @param [in] key
* the key name
* @param [in] value
* the value
* @return return 0 if success or an error code
*/
virtual int setNumber(const char* key, double value) = 0;
/**
* set string value of the json
* @param [in] key
* the key name
* @param [in] value
* the value
* @return return 0 if success or an error code
*/
virtual int setString(const char* key, const char* value) = 0;
/**
* set object value of the json
* @param [in] key
* the key name
* @param [in] value
* the value
* @return return 0 if success or an error code
*/
virtual int setObject(const char* key, const char* value) = 0;
/**
* get bool value of the json
* @param [in] key
* the key name
* @param [in, out] value
* the value
* @return return 0 if success or an error code
*/
virtual int getBool(const char* key, bool& value) = 0;
/**
* get int value of the json
* @param [in] key
* the key name
* @param [in, out] value
* the value
* @return return 0 if success or an error code
*/
virtual int getInt(const char* key, int& value) = 0;
/**
* get unsigned int value of the json
* @param [in] key
* the key name
* @param [in, out] value
* the value
* @return return 0 if success or an error code
*/
virtual int getUInt(const char* key, unsigned int& value) = 0;
/**
* get double value of the json
* @param [in] key
* the key name
* @param [in, out] value
* the value
* @return return 0 if success or an error code
*/
virtual int getNumber(const char* key, double& value) = 0;
/**
* get string value of the json
* @param [in] key
* the key name
* @param [in, out] value
* the value
* @return return 0 if success or an error code
*/
virtual int getString(const char* key, agora::util::AString& value) = 0;
/**
* get a child object value of the json
* @param [in] key
* the key name
* @param [in, out] value
* the value
* @return return 0 if success or an error code
*/
virtual int getObject(const char* key, agora::util::AString& value) = 0;
/**
* get array value of the json
* @param [in] key
* the key name
* @param [in, out] value
* the value
* @return return 0 if success or an error code
*/
virtual int getArray(const char* key, agora::util::AString& value) = 0;
/**
* set parameters of the sdk or engine
* @param [in] parameters
* the parameters
* @return return 0 if success or an error code
*/
virtual int setParameters(const char* parameters) = 0;
/**
* set profile to control the RTC engine
* @param [in] profile
* the profile
* @param [in] merge
* if merge with the original value
* @return return 0 if success or an error code
*/
virtual int setProfile(const char* profile, bool merge) = 0;
virtual int convertPath(const char* filePath, agora::util::AString& value) = 0;
};
class AAudioDeviceManager : public agora::util::AutoPtr<IAudioDeviceManager>
{
public:
AAudioDeviceManager(IRtcEngine* engine)
{
queryInterface(engine, AGORA_IID_AUDIO_DEVICE_MANAGER);
}
};
class AVideoDeviceManager : public agora::util::AutoPtr<IVideoDeviceManager>
{
public:
AVideoDeviceManager(IRtcEngine* engine)
{
queryInterface(engine, AGORA_IID_VIDEO_DEVICE_MANAGER);
}
};
class AParameter : public agora::util::AutoPtr<IRtcEngineParameter>
{
public:
AParameter(IRtcEngine& engine) { initialize(&engine); }
AParameter(IRtcEngine* engine) { initialize(engine); }
AParameter(IRtcEngineParameter* p) :agora::util::AutoPtr<IRtcEngineParameter>(p) {}
private:
bool initialize(IRtcEngine* engine)
{
IRtcEngineParameter* p = NULL;
if (engine && !engine->queryInterface(AGORA_IID_RTC_ENGINE_PARAMETER, (void**)&p))
reset(p);
return p != NULL;
}
};
class RtcEngineParameters
{
public:
RtcEngineParameters(IRtcEngine& engine)
:m_parameter(&engine){}
RtcEngineParameters(IRtcEngine* engine)
:m_parameter(engine){}
/**
* mute/unmute the local stream capturing
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int muteLocalAudioStream(bool mute) {
return setParameters("{\"rtc.audio.mute_me\":%s,\"che.audio.mute_me\":%s}", mute ? "true" : "false", mute ? "true" : "false");
}
// mute/unmute all peers. unmute will clear all muted peers specified mutePeer() interface
/**
* mute/unmute all the remote audio stream receiving
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int muteAllRemoteAudioStreams(bool mute) {
return m_parameter ? m_parameter->setBool("rtc.audio.mute_peers", mute) : -ERR_NOT_INITIALIZED;
}
/**
* set default mute/unmute all the remote audio stream receiving
* default value is false
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int setDefaultMuteAllRemoteAudioStreams(bool mute) {
return m_parameter ? m_parameter->setBool("rtc.audio.set_default_mute_peers", mute) : -ERR_NOT_INITIALIZED;
}
/**
* mute/unmute one remote audio stream receiving
* @param [in] uid
* the uid of the remote user you want to mute/unmute
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int muteRemoteAudioStream(uid_t uid, bool mute) {
return setObject("rtc.audio.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute?"true":"false");
}
/**
* mute/unmute local video stream sending
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int muteLocalVideoStream(bool mute) {
return setParameters("{\"rtc.video.mute_me\":%s,\"che.video.local.send\":%s}", mute ? "true" : "false", mute ? "false" : "true");
}
int enableLocalVideo(bool enabled) {
return setParameters("{\"rtc.video.capture\":%s,\"che.video.local.capture\":%s,\"che.video.local.render\":%s,\"che.video.local.send\":%s}", enabled ? "true" : "false", enabled ? "true" : "false", enabled ? "true" : "false", enabled ? "true" : "false");
}
/**
* mute/unmute all the remote video stream receiving
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int muteAllRemoteVideoStreams(bool mute) {
return m_parameter ? m_parameter->setBool("rtc.video.mute_peers", mute) : -ERR_NOT_INITIALIZED;
}
/**
* set default mute/unmute all the remote video stream receiving
* default value is false
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int setDefaultMuteAllRemoteVideoStreams(bool mute) {
return m_parameter ? m_parameter->setBool("rtc.video.set_default_mute_peers", mute) : -ERR_NOT_INITIALIZED;
}
/**
* mute/unmute one remote video stream receiving
* @param [in] uid
* the uid of the remote user you want to mute/unmute
* @param [in] mute
* true: mute
* false: unmute
* @return return 0 if success or an error code
*/
int muteRemoteVideoStream(uid_t uid, bool mute) {
return setObject("rtc.video.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute ? "true" : "false");
}
int setRemoteVideoStreamType(uid_t uid, REMOTE_VIDEO_STREAM_TYPE streamType) {
return setParameters("{\"rtc.video.set_remote_video_stream\":{\"uid\":%u,\"stream\":%d}, \"che.video.setstream\":{\"uid\":%u,\"stream\":%d}}", uid, streamType, uid, streamType);
// return setObject("rtc.video.set_remote_video_stream", "{\"uid\":%u,\"stream\":%d}", uid, streamType);
}
int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) {
return m_parameter ? m_parameter->setInt("rtc.video.set_remote_default_video_stream_type", streamType) : -ERR_NOT_INITIALIZED;
}
/**
* set play sound volume
* @param [in] volume
* the volume 0~255
* @return return 0 if success or an error code
*/
int setPlaybackDeviceVolume(int volume) {// [0,255]
return m_parameter ? m_parameter->setInt("che.audio.output.volume", volume) : -ERR_NOT_INITIALIZED;
}
/**
* enable or disable the audio volume indication
* @param [in] interval
* the period of the call back cycle, in ms
* interval <= 0: disable
* interval > 0: enable
* @param [in] smooth
* the smooth parameter
* @return return 0 if success or an error code
*/
int enableAudioVolumeIndication(int interval, int smooth) { // in ms: <= 0: disable, > 0: enable, interval in ms
if (interval < 0)
interval = 0;
return setObject("che.audio.volume_indication", "{\"interval\":%d,\"smooth\":%d}", interval, smooth);
}
/**
* start recording the audio stream
* @param [in] filePath
* the .wav file path you want to saved
* @return return 0 if success or an error code
*/
int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) {
if (!m_parameter) return -ERR_NOT_INITIALIZED;
#if defined(_WIN32)
util::AString path;
if (!m_parameter->convertPath(filePath, path))
filePath = path->c_str();
else
return -ERR_INVALID_ARGUMENT;
#endif
return setObject("che.audio.start_recording", "{\"filePath\":\"%s\",\"quality\":%d}", filePath, quality);
}
/**
* stop recording the audio stream
* @return return 0 if success or an error code
*/
int stopAudioRecording() {
return m_parameter ? m_parameter->setBool("che.audio.stop_recording", true) : -ERR_NOT_INITIALIZED;
}
/**
* mix microphone and local audio file into the audio stream
* @param [in] filePath
* specify the path and file name of the audio file to be played
* @param [in] loopback
* specify if local and remote participant can hear the audio file.
* false (default): both local and remote party can hear the the audio file
* true: only the local party can hear the audio file
* @param [in] replace
* false (default): mix the local microphone captured voice with the audio file
* true: replace the microphone captured voice with the audio file
* @param [in] cycle
* specify the number of cycles to play
* -1, infinite loop playback
* @return return 0 if success or an error code
*/
int startAudioMixing(const char* filePath, bool loopback, bool replace, int cycle) {
if (!m_parameter) return -ERR_NOT_INITIALIZED;
#if defined(_WIN32)
util::AString path;
if (!m_parameter->convertPath(filePath, path))
filePath = path->c_str();
else
return -ERR_INVALID_ARGUMENT;
#endif
return setObject("che.audio.start_file_as_playout", "{\"filePath\":\"%s\",\"loopback\":%s,\"replace\":%s,\"cycle\":%d}",
filePath,
loopback?"true":"false",
replace?"true":"false",
cycle);
}
/**
* stop mixing the local audio stream
* @return return 0 if success or an error code
*/
int stopAudioMixing() {
return m_parameter ? m_parameter->setBool("che.audio.stop_file_as_playout", true) : -ERR_NOT_INITIALIZED;
}
int pauseAudioMixing() {
return m_parameter ? m_parameter->setBool("che.audio.pause_file_as_playout", true) : -ERR_NOT_INITIALIZED;
}
int resumeAudioMixing() {
return m_parameter ? m_parameter->setBool("che.audio.pause_file_as_playout", false) : -ERR_NOT_INITIALIZED;
}
int adjustAudioMixingVolume(int volume) {
return m_parameter ? m_parameter->setInt("che.audio.set_file_as_playout_volume", volume) : -ERR_NOT_INITIALIZED;
}
int getAudioMixingDuration() {
int duration = 0;
int r = m_parameter ? m_parameter->getInt("che.audio.get_mixing_file_length_ms", duration) : -ERR_NOT_INITIALIZED;
if (r == 0)
r = duration;
return r;
}
int getAudioMixingCurrentPosition() {
if (!m_parameter) return -ERR_NOT_INITIALIZED;
int pos = 0;
int r = m_parameter->getInt("che.audio.get_mixing_file_played_ms", pos);
if (r == 0)
r = pos;
return r;
}
int setAudioMixingPosition(int pos /*in ms*/) {
return m_parameter ? m_parameter->setInt("che.audio.mixing.file.position", pos) : -ERR_NOT_INITIALIZED;
}
/**
* Get audio effect volume.
* @return return audio effect volume on success, or one value less than 0 otherwise.
*/
int getEffectsVolume() {
if (!m_parameter) return -ERR_NOT_INITIALIZED;
int volume = 0;
int r = m_parameter->getInt("che.audio.game_get_effects_volume", volume);
if (r == 0)
r = volume;
return r;
}
/**
* Set audio effect volume.
* param [in] volume
The volume to be set.
* @return return 0 on success or error number otherwise.
*/
int setEffectsVolume(int volume) {
return m_parameter ? m_parameter->setInt("che.audio.game_set_effects_volume", volume) : -ERR_NOT_INITIALIZED;
}
/**
* Set audio effect volume for effect with id : soundId
* @param [in] soundId
The soundId of the effect to be set.
* @param [in] volume
The volume value to be set
* @return return 0 on success, and error number otherwise.
*/
int setVolumeOfEffect(int soundId, int volume) {
return setObject(
"che.audio.game_adjust_effect_volume",
"{\"soundId\":%d,\"gain\":%d}",
soundId, volume);
}
/**
* To play effect
* @param [in] soundId
* effect id
* @param [in] filePath
* effect file path
* @param [in] loopCount
* if loopCount
* @param [in] sendToFar
* if send the effect to remote
* @param [in] pitch
* sound pitch
* @param [in] pan
* sound pan
* @param [in] gain
* sound gain
* @param [in] publish
* true indicates that when this sound effect is played locally,
* it is also published to Agora Could, so it can be heard by remote audience.
*
* false indicates that when any sound effect is only heard locally without published to Agora Cloud.
* @return return 0 on success, error code otherwise.
*
*/
int playEffect(int soundId, const char* filePath, int loopCount, double pitch, double pan, int gain, bool publish = false) {
#if defined(_WIN32)
util::AString path;
if (!m_parameter->convertPath(filePath, path))
filePath = path->c_str();
else if (!filePath)
filePath = "";
#endif
return setObject(
"che.audio.game_play_effect",
"{\"soundId\":%d,\"filePath\":\"%s\",\"loopCount\":%d, \"pitch\":%lf,\"pan\":%lf,\"gain\":%d, \"send2far\":%d}",
soundId, filePath, loopCount, pitch, pan, gain, publish);
}
/**
* To stop effect
* @param [in] soundId
* The effect's soundId
* @return return 0 on success, error code otherwise
*/
int stopEffect(int soundId) {
return m_parameter ? m_parameter->setInt(
"che.audio.game_stop_effect", soundId) : -ERR_NOT_INITIALIZED;
}
/**
* To stop all effects
* @return return 0 on success, error code otherwise
*/
int stopAllEffects() {
return m_parameter ? m_parameter->setBool(
"che.audio.game_stop_all_effects", true) : -ERR_NOT_INITIALIZED;
}
/**
* To preload effect
* @param [in] sound Id
* effect sound id
* @param [in] filepath
* effect file path
* @return return 0 on success or error code otherwise
*/
int preloadEffect(int soundId, char* filePath) {
return setObject(
"che.audio.game_preload_effect",
"{\"soundId\":%d,\"filePath\":\"%s\"}",
soundId, filePath);
}
/**
* To unload effect
* @param [in] soundId
* effect id
* @return return 0 on success, error code otherwise
*/
int unloadEffect(int soundId) {
return m_parameter ? m_parameter->setInt(
"che.audio.game_unload_effect", soundId) : -ERR_NOT_INITIALIZED;
}
/**
* To pause effect
* @param [in] soundId
* effect id
* @return return 0 on success, error code otherwise.
*/
int pauseEffect(int soundId) {
return m_parameter ? m_parameter->setInt(
"che.audio.game_pause_effect", soundId) : -ERR_NOT_INITIALIZED;
}
/**
* To pause all effects
* @return return 0 on success, error code otherwise.
*/
int pauseAllEffects() {
return m_parameter ? m_parameter->setBool(
"che.audio.game_pause_all_effects", true) : -ERR_NOT_INITIALIZED;
}
/**
* To resume effect
* @param [in] soundId
* effect id
* @return return 0 on success, error code otherwise
*/
int resumeEffect(int soundId) {
return m_parameter ? m_parameter->setInt(
"che.audio.game_resume_effect", soundId) : -ERR_NOT_INITIALIZED;
}
/**
* To resume all effects
* @return return 0 on success, error code otherwise.
*/
int resumeAllEffects() {
return m_parameter ? m_parameter->setBool(
"che.audio.game_resume_all_effects", true) : -ERR_NOT_INITIALIZED;
}
/**
* Change the pitch of local speaker's voice
* @param [in] pitch
* frequency, in the range of [0.5..2.0], default value is 1.0
*
* @return return 0 if success or an error code
*/
int setLocalVoicePitch(double pitch) {
return m_parameter ? m_parameter->setInt(
"che.audio.morph.pitch_shift",
static_cast<int>(pitch * 100)) : -ERR_NOT_INITIALIZED;
}
int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) {
return setObject(
"che.audio.morph.equalization",
"{\"index\":%d,\"gain\":%d}",
static_cast<int>(bandFrequency), bandGain);
}
int setLocalVoiceReverb(AUDIO_REVERB_TYPE reverbKey, int value) {
return setObject(
"che.audio.morph.reverb",
"{\"key\":%d,\"value\":%d}",
static_cast<int>(reverbKey), value);
}
/**
* Set the audio ears back's volume and effect
* @param [in] volume
* set volume of audio ears back, in the range of [0..100], default value is 100
*
* @return return 0 if success or an error code
*/
int setInEarMonitoringVolume(int volume) {
return m_parameter ? m_parameter->setInt("che.audio.headset.monitoring.parameter", volume) : -ERR_NOT_INITIALIZED;
}
/**
* set audio profile and scenario
* including sample rate, bit rate, mono/stereo, speech/music codec
*
* @param [in] profile
* enumeration definition about the audio's samplerate, bitrate, mono/stereo, speech/music codec
* @param [in] scenario
* enumeration definition about the audio scenario
*
* @return 0 when executed successfully. return negative value if failed.
*/
int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) {
return setObject(
"che.audio.profile",
"{\"config\":%d,\"scenario\":%d}",
static_cast<int>(profile), static_cast<int>(scenario));
}
/**
* disable audio function in channel, which will be recovered when leave channel.
* @return return 0 if success or an error code
*/
int pauseAudio() {
return m_parameter ? m_parameter->setBool("che.pause.audio", true) : -ERR_NOT_INITIALIZED;
}
/**
* resume audio function in channel.
* @return return 0 if success or an error code
*/
int resumeAudio() {
return m_parameter ? m_parameter->setBool("che.pause.audio", false) : -ERR_NOT_INITIALIZED;
}
int setExternalAudioSource(bool enabled, int sampleRate, int channels) {
if (enabled)
return setParameters("{\"che.audio.external_capture\":true,\"che.audio.external_capture.push\":true,\"che.audio.set_capture_raw_audio_format\":{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d}}", sampleRate, channels, RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_WRITE);
else
return setParameters("{\"che.audio.external_capture\":false,\"che.audio.external_capture.push\":false}");
}
/**
* set path to save the log file
* @param [in] filePath
* the .log file path you want to saved
* @return return 0 if success or an error code
*/
int setLogFile(const char* filePath) {
if (!m_parameter) return -ERR_NOT_INITIALIZED;
#if defined(_WIN32)
util::AString path;
if (!m_parameter->convertPath(filePath, path))
filePath = path->c_str();
else if (!filePath)
filePath = "";
#endif
return m_parameter->setString("rtc.log_file", filePath);
}
/**
* set the log information filter level
* @param [in] filter
* the filter level
* @return return 0 if success or an error code
*/
int setLogFilter(unsigned int filter) {
return m_parameter ? m_parameter->setUInt("rtc.log_filter", filter&LOG_FILTER_MASK) : -ERR_NOT_INITIALIZED;
}
/**
* set local video render mode
* @param [in] renderMode
* the render mode
* @return return 0 if success or an error code
*/
int setLocalRenderMode(RENDER_MODE_TYPE renderMode) {
return setRemoteRenderMode(0, renderMode);
}
/**
* set remote video render mode
* @param [in] renderMode
* the render mode
* @return return 0 if success or an error code
*/
int setRemoteRenderMode(uid_t uid, RENDER_MODE_TYPE renderMode) {
return setObject("che.video.render_mode", "{\"uid\":%u,\"mode\":%d}", uid, renderMode);
}
int setLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE mirrorMode) {
if (!m_parameter) return -ERR_NOT_INITIALIZED;
const char *value;
switch (mirrorMode) {
case VIDEO_MIRROR_MODE_AUTO:
value = "default";
break;
case VIDEO_MIRROR_MODE_ENABLED:
value = "forceMirror";
break;
case VIDEO_MIRROR_MODE_DISABLED:
value = "disableMirror";
break;
default:
return -ERR_INVALID_ARGUMENT;
}
return m_parameter->setString("che.video.localViewMirrorSetting", value);
}
int startRecordingService(const char* recordingKey) {
return m_parameter ? m_parameter->setString("rtc.api.start_recording_service", recordingKey) : -ERR_NOT_INITIALIZED;
}
int stopRecordingService(const char* recordingKey) {
return m_parameter ? m_parameter->setString("rtc.api.stop_recording_service", recordingKey) : -ERR_NOT_INITIALIZED;
}
int refreshRecordingServiceStatus() {
return m_parameter ? m_parameter->setBool("rtc.api.query_recording_service_status", true) : -ERR_NOT_INITIALIZED;
}
int enableDualStreamMode(bool enabled) {
return setParameters("{\"rtc.dual_stream_mode\":%s,\"che.video.enableLowBitRateStream\":%d}", enabled ? "true" : "false", enabled ? 1 : 0);
}
int setRecordingAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) {
return setObject("che.audio.set_capture_raw_audio_format", "{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d,\"samplesPerCall\":%d}", sampleRate, channel, mode, samplesPerCall);
}
int setPlaybackAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) {
return setObject("che.audio.set_render_raw_audio_format", "{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d,\"samplesPerCall\":%d}", sampleRate, channel, mode, samplesPerCall);
}
int setMixedAudioFrameParameters(int sampleRate, int samplesPerCall) {
return setObject("che.audio.set_mixed_raw_audio_format", "{\"sampleRate\":%d,\"samplesPerCall\":%d}", sampleRate, samplesPerCall);
}
int adjustRecordingSignalVolume(int volume) {//[0, 400]: e.g. 50~0.5x 100~1x 400~4x
if (volume < 0)
volume = 0;
else if (volume > 400)
volume = 400;
return m_parameter ? m_parameter->setInt("che.audio.record.signal.volume", volume) : -ERR_NOT_INITIALIZED;
}
int adjustPlaybackSignalVolume(int volume) {//[0, 400]
if (volume < 0)
volume = 0;
else if (volume > 400)
volume = 400;
return m_parameter ? m_parameter->setInt("che.audio.playout.signal.volume", volume) : -ERR_NOT_INITIALIZED;
}
/**
* @Deprecated. Agora does not recommend using this method.
* If you want to set the audio profile, see Set the Audio Profile (setAudioProfile).
*/
int setHighQualityAudioParameters(bool fullband, bool stereo, bool fullBitrate) {
return setObject("che.audio.codec.hq", "{\"fullband\":%s,\"stereo\":%s,\"fullBitrate\":%s}", fullband ? "true" : "false", stereo ? "true" : "false", fullBitrate ? "true" : "false");
}
int enableWebSdkInteroperability(bool enabled) {//enable interoperability with zero-plugin web sdk
return setParameters("{\"rtc.video.web_h264_interop_enable\":%s,\"che.video.web_h264_interop_enable\":%s}", enabled ? "true" : "false", enabled ? "true" : "false");
}
//only for live broadcasting
int setVideoQualityParameters(bool preferFrameRateOverImageQuality) {
return setParameters("{\"rtc.video.prefer_frame_rate\":%s,\"che.video.prefer_frame_rate\":%s}", preferFrameRateOverImageQuality ? "true" : "false", preferFrameRateOverImageQuality ? "true" : "false");
}
int enableLoopbackRecording(bool enabled) {
return setParameters("{\"che.audio.loopback.recording\":%s}", enabled ? "true" : "false");
}
protected:
AParameter& parameter() {
return m_parameter;
}
int setParameters(const char* format, ...) {
char buf[512];
va_list args;
va_start(args, format);
vsnprintf(buf, sizeof(buf)-1, format, args);
va_end(args);
return m_parameter ? m_parameter->setParameters(buf) : -ERR_NOT_INITIALIZED;
}
int setObject(const char* key, const char* format, ...) {
char buf[512];
va_list args;
va_start(args, format);
vsnprintf(buf, sizeof(buf)-1, format, args);
va_end(args);
return m_parameter ? m_parameter->setObject(key, buf) : -ERR_NOT_INITIALIZED;
}
int enableLocalVideoCapture(bool enabled) {
return m_parameter ? m_parameter->setBool("che.video.local.capture", enabled) : -ERR_NOT_INITIALIZED;
}
int enableLocalVideoRender(bool enabled) {
return m_parameter ? m_parameter->setBool("che.video.local.render", enabled) : -ERR_NOT_INITIALIZED;
}
int enableLocalVideoSend(bool enabled) {
return muteLocalVideoStream(!enabled);
}
int stopAllRemoteVideo() {
return m_parameter ? m_parameter->setBool("che.video.peer.stop_render", true) : -ERR_NOT_INITIALIZED;
}
private:
AParameter m_parameter;
};
} //namespace rtc
} // namespace agora
/**
* to get the version number of the SDK
* @param [in, out] build
* the build number of Agora SDK
* @return returns the string of the version of the SDK
*/
#define getAgoraRtcEngineVersion getAgoraSdkVersion
/**
* create the RTC engine object and return the pointer
* @return returns the pointer of the RTC engine object
*/
AGORA_API agora::rtc::IRtcEngine* AGORA_CALL createAgoraRtcEngine();
/**
* create the RTC engine object and return the pointer
* @param [in] err
* the error code
* @return returns the description of the error code
*/
#define getAgoraRtcEngineErrorDescription getAgoraSdkErrorDescription
#define setAgoraRtcEngineExternalSymbolLoader setAgoraSdkExternalSymbolLoader
#endif
//
// Agora SDK
//
// Created by Sting Feng in 2017-11.
// Copyright (c) 2017 Agora.io. All rights reserved.
//
#ifndef AGORA_SERVICE_H
#define AGORA_SERVICE_H
#include "AgoraBase.h"
namespace agora {
namespace rtc {
class IRtcEngine;
}
namespace signaling {
class ISignalingEngine;
}
namespace base {
struct AgoraServiceContext
{
};
class IAgoraService
{
public:
virtual void release() = 0;
/**
* initialize the engine
* @param [in] context
* the RTC engine context
* @return return 0 if success or an error code
*/
virtual int initialize(const AgoraServiceContext& context) = 0;
/**
* get the version information of the SDK
* @param [in, out] build
* the build number
* @return return the version number string in char format
*/
virtual const char* getVersion(int* build) = 0;
virtual rtc::IRtcEngine* createRtcEngine() = 0;
virtual signaling::ISignalingEngine* createSignalingEngine() = 0;
};
} //namespace base
} // namespace agora
/**
* to get the version number of the SDK
* @param [in, out] build
* the build number of Agora SDK
* @return returns the string of the version of the SDK
*/
AGORA_API const char* AGORA_CALL getAgoraSdkVersion(int* build);
/**
* create the RTC engine object and return the pointer
* @param [in] err
* the error code
* @return returns the description of the error code
*/
AGORA_API const char* AGORA_CALL getAgoraSdkErrorDescription(int err);
/**
* create the Agora Service object and return the pointer
* @return returns pointer of the Agora Service object
*/
AGORA_API agora::base::IAgoraService* AGORA_CALL createAgoraService();
AGORA_API int AGORA_CALL setAgoraSdkExternalSymbolLoader(void* (*func)(const char* symname));
#endif
framework module AgoraRtcEngineKit {
umbrella header "AgoraRtcEngineKit.h"
export *
module * { export * }
}
PODS:
- AgoraRtcEngine_iOS (2.2.0)
- BufferSlider (0.1.6)
- Crashlytics (3.10.1):
- Fabric (~> 1.7.5)
......@@ -67,6 +68,7 @@ PODS:
- WMPageController (2.3.0)
DEPENDENCIES:
- AgoraRtcEngine_iOS (= 2.2.0)
- BufferSlider (= 0.1.6)
- Crashlytics
- EasyToast (= 2.0)
......@@ -89,6 +91,7 @@ DEPENDENCIES:
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- AgoraRtcEngine_iOS
- BufferSlider
- Crashlytics
- EasyToast
......@@ -117,6 +120,7 @@ SPEC REPOS:
- WMPageController
SPEC CHECKSUMS:
AgoraRtcEngine_iOS: 616331997992150073b68aa5737929fdee1491c8
BufferSlider: f95e72170e9ba51799c62090295ee50e193521ef
Crashlytics: aee1a064cbbf99b32efa3f056a5f458d846bc8ff
EasyToast: 243209f3536e47ae0d9e12fe5330367d6a0d7b82
......@@ -144,6 +148,6 @@ SPEC CHECKSUMS:
TimeAgoInWords: 633dbb30810de855333dedd1d5033d28b1ecfd6f
WMPageController: 9f219bb8912a1a1f51af11fde61e2682a7b7e7f2
PODFILE CHECKSUM: 612cf2d8c67fd5ad7333652e83c98b9778d9881e
PODFILE CHECKSUM: b376ed8a9c64f69a0b9ee9bf8ad4ed33a5b0118d
COCOAPODS: 1.5.3
This source diff could not be displayed because it is too large. You can view the blob instead.
# Acknowledgements
This application makes use of the following third party libraries:
## AgoraRtcEngine_iOS
Copyright 2018 agora.io. All rights reserved.
## BufferSlider
Copyright (c) 2016 raxcat <raxcat@gmail.com>
......
......@@ -14,6 +14,17 @@
</dict>
<dict>
<key>FooterText</key>
<string>Copyright 2018 agora.io. All rights reserved.
</string>
<key>License</key>
<string>Copyright</string>
<key>Title</key>
<string>AgoraRtcEngine_iOS</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2016 raxcat &lt;raxcat@gmail.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy
......
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BufferSlider" "${PODS_CONFIGURATION_BUILD_DIR}/EasyToast" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseDatabase" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseStorage" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" "${PODS_CONFIGURATION_BUILD_DIR}/ImageSlideshow" "${PODS_CONFIGURATION_BUILD_DIR}/Kingfisher" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Pastel" "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftDate" "${PODS_CONFIGURATION_BUILD_DIR}/TimeAgoInWords" "${PODS_CONFIGURATION_BUILD_DIR}/WMPageController" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BufferSlider" "${PODS_CONFIGURATION_BUILD_DIR}/EasyToast" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseDatabase" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseStorage" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" "${PODS_CONFIGURATION_BUILD_DIR}/ImageSlideshow" "${PODS_CONFIGURATION_BUILD_DIR}/Kingfisher" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Pastel" "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftDate" "${PODS_CONFIGURATION_BUILD_DIR}/TimeAgoInWords" "${PODS_CONFIGURATION_BUILD_DIR}/WMPageController" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_ROOT}/AgoraRtcEngine_iOS" "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1
HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/BufferSlider/BufferSlider.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/EasyToast/EasyToast.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth/FirebaseAuth.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseDatabase/FirebaseDatabase.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseStorage/FirebaseStorage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/ImageSlideshow/ImageSlideshow.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Kingfisher/Kingfisher.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Pastel/Pastel.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD/SVProgressHUD.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftDate/SwiftDate.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TimeAgoInWords/TimeAgoInWords.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/WMPageController/WMPageController.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library/leveldb.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"icucore" -l"sqlite3" -l"z" -framework "BufferSlider" -framework "CFNetwork" -framework "Crashlytics" -framework "EasyToast" -framework "Fabric" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseDatabase" -framework "FirebaseInstanceID" -framework "FirebaseNanoPB" -framework "FirebaseStorage" -framework "Foundation" -framework "GTMSessionFetcher" -framework "GoogleToolboxForMac" -framework "IQKeyboardManagerSwift" -framework "ImageSlideshow" -framework "Kingfisher" -framework "MJRefresh" -framework "MobileCoreServices" -framework "Pastel" -framework "Realm" -framework "RealmSwift" -framework "SVProgressHUD" -framework "Security" -framework "StoreKit" -framework "SwiftDate" -framework "SystemConfiguration" -framework "TimeAgoInWords" -framework "UIKit" -framework "WMPageController" -framework "leveldb" -framework "nanopb"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"icucore" -l"resolv" -l"sqlite3" -l"z" -framework "AVFoundation" -framework "AgoraRtcEngineKit" -framework "AudioToolbox" -framework "BufferSlider" -framework "CFNetwork" -framework "CoreMedia" -framework "CoreTelephony" -framework "Crashlytics" -framework "EasyToast" -framework "Fabric" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseDatabase" -framework "FirebaseInstanceID" -framework "FirebaseNanoPB" -framework "FirebaseStorage" -framework "Foundation" -framework "GTMSessionFetcher" -framework "GoogleToolboxForMac" -framework "IQKeyboardManagerSwift" -framework "ImageSlideshow" -framework "Kingfisher" -framework "MJRefresh" -framework "MobileCoreServices" -framework "Pastel" -framework "Realm" -framework "RealmSwift" -framework "SVProgressHUD" -framework "Security" -framework "StoreKit" -framework "SwiftDate" -framework "SystemConfiguration" -framework "TimeAgoInWords" -framework "UIKit" -framework "VideoToolbox" -framework "WMPageController" -framework "leveldb" -framework "nanopb"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
......
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BufferSlider" "${PODS_CONFIGURATION_BUILD_DIR}/EasyToast" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseDatabase" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseStorage" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" "${PODS_CONFIGURATION_BUILD_DIR}/ImageSlideshow" "${PODS_CONFIGURATION_BUILD_DIR}/Kingfisher" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Pastel" "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftDate" "${PODS_CONFIGURATION_BUILD_DIR}/TimeAgoInWords" "${PODS_CONFIGURATION_BUILD_DIR}/WMPageController" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BufferSlider" "${PODS_CONFIGURATION_BUILD_DIR}/EasyToast" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseDatabase" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseStorage" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" "${PODS_CONFIGURATION_BUILD_DIR}/ImageSlideshow" "${PODS_CONFIGURATION_BUILD_DIR}/Kingfisher" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Pastel" "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftDate" "${PODS_CONFIGURATION_BUILD_DIR}/TimeAgoInWords" "${PODS_CONFIGURATION_BUILD_DIR}/WMPageController" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_ROOT}/AgoraRtcEngine_iOS" "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1
HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/BufferSlider/BufferSlider.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/EasyToast/EasyToast.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth/FirebaseAuth.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseDatabase/FirebaseDatabase.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseStorage/FirebaseStorage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/ImageSlideshow/ImageSlideshow.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Kingfisher/Kingfisher.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Pastel/Pastel.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD/SVProgressHUD.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftDate/SwiftDate.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TimeAgoInWords/TimeAgoInWords.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/WMPageController/WMPageController.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library/leveldb.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"icucore" -l"sqlite3" -l"z" -framework "BufferSlider" -framework "CFNetwork" -framework "Crashlytics" -framework "EasyToast" -framework "Fabric" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseDatabase" -framework "FirebaseInstanceID" -framework "FirebaseNanoPB" -framework "FirebaseStorage" -framework "Foundation" -framework "GTMSessionFetcher" -framework "GoogleToolboxForMac" -framework "IQKeyboardManagerSwift" -framework "ImageSlideshow" -framework "Kingfisher" -framework "MJRefresh" -framework "MobileCoreServices" -framework "Pastel" -framework "Realm" -framework "RealmSwift" -framework "SVProgressHUD" -framework "Security" -framework "StoreKit" -framework "SwiftDate" -framework "SystemConfiguration" -framework "TimeAgoInWords" -framework "UIKit" -framework "WMPageController" -framework "leveldb" -framework "nanopb"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"icucore" -l"resolv" -l"sqlite3" -l"z" -framework "AVFoundation" -framework "AgoraRtcEngineKit" -framework "AudioToolbox" -framework "BufferSlider" -framework "CFNetwork" -framework "CoreMedia" -framework "CoreTelephony" -framework "Crashlytics" -framework "EasyToast" -framework "Fabric" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseDatabase" -framework "FirebaseInstanceID" -framework "FirebaseNanoPB" -framework "FirebaseStorage" -framework "Foundation" -framework "GTMSessionFetcher" -framework "GoogleToolboxForMac" -framework "IQKeyboardManagerSwift" -framework "ImageSlideshow" -framework "Kingfisher" -framework "MJRefresh" -framework "MobileCoreServices" -framework "Pastel" -framework "Realm" -framework "RealmSwift" -framework "SVProgressHUD" -framework "Security" -framework "StoreKit" -framework "SwiftDate" -framework "SystemConfiguration" -framework "TimeAgoInWords" -framework "UIKit" -framework "VideoToolbox" -framework "WMPageController" -framework "leveldb" -framework "nanopb"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment