From 24f17cb2b4db33b79bbd69b5342cf7dc7c2cdd35 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 03 Aug 2021 14:39:32 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_app
---
components/uni-popup/message.js | 22
components/uni-popup-message/uni-popup-message.vue | 116
pages/home/home.vue | 7
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArBase.h | 826 ++
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArMediaBase.h | 400 +
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/AREnumerates.h | 1817 +++++
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Info.plist | 0
nativePlugins/AR-RtcModule/package.json | 81
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArRtcEngine.h | 8998 +++++++++++++++++++++++++
static/BG.png | 0
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcKit.h | 29
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArService.h | 76
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannelDelegate.h | 216
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeResources | 147
static/logo.png | 0
pages.json | 36
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Modules/module.modulemap | 6
components/uni-popup-dialog/uni-popup-dialog.vue | 243
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARObjects.h | 1095 +++
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements | 0
components/uni-popup/uni-popup.vue | 297
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeDirectory | 0
components/uni-popup/share.js | 16
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeSignature | 0
static/vi_in.png | 0
nativePlugins/AR-RtcModule/android/rtc-release.aar | 0
static/vi_on.png | 0
nativePlugins/AR-RtcModule/android/arsdk-release.aar | 0
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaIO.h | 224
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/ARtcKit | 0
static/camera.png | 0
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/_CodeSignature/CodeResources | 101
pages/securityStaff/information.vue | 4
static/au_in.png | 0
js_sdk/wa-permission/permission.js | 272
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/Info.plist | 0
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineKit.h | 2143 ++++++
components/uni-transition/uni-transition.vue | 279
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaPlayer.h | 378 +
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/ArRtcUniPlugin | 0
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements-1 | 0
static/au_on.png | 0
static/over.png | 0
components/uni-popup/popup.js | 25
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaPlayerKit.h | 413 +
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Info.plist | 0
nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/ARtcKit | 0
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannel.h | 256
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARStreamingKit.h | 64
manifest.json | 21
static/phone.png | 0
pages/videoCall/videoCall.vue | 781 ++
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineDelegate.h | 915 ++
nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaEngine.h | 770 ++
54 files changed, 21,060 insertions(+), 14 deletions(-)
diff --git a/components/uni-popup-dialog/uni-popup-dialog.vue b/components/uni-popup-dialog/uni-popup-dialog.vue
new file mode 100644
index 0000000..c91123c
--- /dev/null
+++ b/components/uni-popup-dialog/uni-popup-dialog.vue
@@ -0,0 +1,243 @@
+<template>
+ <view class="uni-popup-dialog">
+ <view class="uni-dialog-title">
+ <text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{title}}</text>
+ </view>
+ <view class="uni-dialog-content">
+ <text class="uni-dialog-content-text" v-if="mode === 'base'">{{content}}</text>
+ <input v-else class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholder" :focus="focus" >
+ </view>
+ <view class="uni-dialog-button-group">
+ <view class="uni-dialog-button" @click="close">
+ <text class="uni-dialog-button-text">取消</text>
+ </view>
+ <view class="uni-dialog-button uni-border-left" @click="onOk">
+ <text class="uni-dialog-button-text uni-button-color">确定</text>
+ </view>
+ </view>
+
+ </view>
+</template>
+
+<script>
+ /**
+ * PopUp 弹出层-对话框样式
+ * @description 弹出层-对话框样式
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=329
+ * @property {String} value input 模式下的默认值
+ * @property {String} placeholder input 模式下输入提示
+ * @property {String} type = [success|warning|info|error] 主题样式
+ * @value success 成功
+ * @value warning 提示
+ * @value info 消息
+ * @value error 错误
+ * @property {String} mode = [base|input] 模式、
+ * @value base 基础对话框
+ * @value input 可输入对话框
+ * @property {String} content 对话框内容
+ * @property {Boolean} beforeClose 是否拦截取消事件
+ * @event {Function} confirm 点击确认按钮触发
+ * @event {Function} close 点击取消按钮触发
+ */
+
+ export default {
+ name: "uniPopupDialog",
+ props: {
+ value: {
+ type: [String, Number],
+ default: ''
+ },
+ placeholder: {
+ type: [String, Number],
+ default: '请输入内容'
+ },
+ /**
+ * 对话框主题 success/warning/info/error 默认 success
+ */
+ type: {
+ type: String,
+ default: 'error'
+ },
+ /**
+ * 对话框模式 base/input
+ */
+ mode: {
+ type: String,
+ default: 'base'
+ },
+ /**
+ * 对话框标题
+ */
+ title: {
+ type: String,
+ default: '提示'
+ },
+ /**
+ * 对话框内容
+ */
+ content: {
+ type: String,
+ default: ''
+ },
+ /**
+ * 拦截取消事件 ,如果拦截取消事件,必须监听close事件,执行 done()
+ */
+ beforeClose: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ dialogType: 'error',
+ focus: false,
+ val: ""
+ }
+ },
+ inject: ['popup'],
+ watch: {
+ type(val) {
+ this.dialogType = val
+ },
+ mode(val) {
+ if (val === 'input') {
+ this.dialogType = 'info'
+ }
+ },
+ value(val) {
+ this.val = val
+ }
+ },
+ created() {
+ // 对话框遮罩不可点击
+ this.popup.mkclick = false
+ if (this.mode === 'input') {
+ this.dialogType = 'info'
+ this.val = this.value
+ } else {
+ this.dialogType = this.type
+ }
+ },
+ mounted() {
+ this.focus = true
+ },
+ methods: {
+ /**
+ * 点击确认按钮
+ */
+ onOk() {
+ this.$emit('confirm', () => {
+ this.popup.close()
+ if (this.mode === 'input') this.val = this.value
+ }, this.mode === 'input' ? this.val : '')
+ },
+ /**
+ * 点击取消按钮
+ */
+ close() {
+ if (this.beforeClose) {
+ this.$emit('close', () => {
+ this.popup.close()
+ })
+ return
+ }
+ this.popup.close()
+ }
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ .uni-popup-dialog {
+ width: 300px;
+ border-radius: 15px;
+ background-color: #fff;
+ }
+
+ .uni-dialog-title {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ justify-content: center;
+ padding-top: 15px;
+ padding-bottom: 5px;
+ }
+
+ .uni-dialog-title-text {
+ font-size: 16px;
+ font-weight: 500;
+ }
+
+ .uni-dialog-content {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ padding: 5px 15px 15px 15px;
+ }
+
+ .uni-dialog-content-text {
+ font-size: 14px;
+ color: #6e6e6e;
+ }
+
+ .uni-dialog-button-group {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ border-top-color: #f5f5f5;
+ border-top-style: solid;
+ border-top-width: 1px;
+ }
+
+ .uni-dialog-button {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+
+ flex: 1;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ height: 45px;
+ }
+
+ .uni-border-left {
+ border-left-color: #f0f0f0;
+ border-left-style: solid;
+ border-left-width: 1px;
+ }
+
+ .uni-dialog-button-text {
+ font-size: 14px;
+ }
+
+ .uni-button-color {
+ color: $uni-color-primary;
+ }
+
+ .uni-dialog-input {
+ flex: 1;
+ font-size: 14px;
+ }
+
+ .uni-popup__success {
+ color: $uni-color-success;
+ }
+
+ .uni-popup__warn {
+ color: $uni-color-warning;
+ }
+
+ .uni-popup__error {
+ color: $uni-color-error;
+ }
+
+ .uni-popup__info {
+ color: #909399;
+ }
+</style>
diff --git a/components/uni-popup-message/uni-popup-message.vue b/components/uni-popup-message/uni-popup-message.vue
new file mode 100644
index 0000000..a32bd00
--- /dev/null
+++ b/components/uni-popup-message/uni-popup-message.vue
@@ -0,0 +1,116 @@
+<template>
+ <view class="uni-popup-message" :class="'uni-popup__'+[type]">
+ <text class="uni-popup-message-text" :class="'uni-popup__'+[type]+'-text'">{{message}}</text>
+ </view>
+</template>
+
+<script>
+
+ /**
+ * PopUp 弹出层-消息提示
+ * @description 弹出层-消息提示
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=329
+ * @property {String} type = [success|warning|info|error] 主题样式
+ * @value success 成功
+ * @value warning 提示
+ * @value info 消息
+ * @value error 错误
+ * @property {String} message 消息提示文字
+ * @property {String} duration 显示时间,设置为 0 则不会自动关闭
+ */
+
+ export default {
+ name: 'UniPopupMessage',
+ props: {
+ /**
+ * 主题 success/warning/info/error 默认 success
+ */
+ type: {
+ type: String,
+ default: 'success'
+ },
+ /**
+ * 消息文字
+ */
+ message: {
+ type: String,
+ default: ''
+ },
+ /**
+ * 显示时间,设置为 0 则不会自动关闭
+ */
+ duration: {
+ type: Number,
+ default: 3000
+ }
+ },
+ inject: ['popup'],
+ data() {
+ return {}
+ },
+ created() {
+ this.popup.childrenMsg = this
+ },
+ methods: {
+ open() {
+ if (this.duration === 0) return
+ clearTimeout(this.popuptimer)
+ this.popuptimer = setTimeout(() => {
+ this.popup.close()
+ }, this.duration)
+ },
+ close() {
+ clearTimeout(this.popuptimer)
+ }
+ }
+ }
+</script>
+<style lang="scss" scoped>
+ .uni-popup-message {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ background-color: #e1f3d8;
+ padding: 10px 15px;
+ border-color: #eee;
+ border-style: solid;
+ border-width: 1px;
+ }
+ .uni-popup-message-text {
+ font-size: 14px;
+ padding: 0;
+ }
+
+ .uni-popup__success {
+ background-color: #e1f3d8;
+ }
+
+ .uni-popup__success-text {
+ color: #67C23A;
+ }
+
+ .uni-popup__warn {
+ background-color: #faecd8;
+ }
+
+ .uni-popup__warn-text {
+ color: #E6A23C;
+ }
+
+ .uni-popup__error {
+ background-color: #fde2e2;
+ }
+
+ .uni-popup__error-text {
+ color: #F56C6C;
+ }
+
+ .uni-popup__info {
+ background-color: #F2F6FC;
+ }
+
+ .uni-popup__info-text {
+ color: #909399;
+ }
+</style>
diff --git a/components/uni-popup/message.js b/components/uni-popup/message.js
new file mode 100644
index 0000000..0ff9a02
--- /dev/null
+++ b/components/uni-popup/message.js
@@ -0,0 +1,22 @@
+export default {
+ created() {
+ if (this.type === 'message') {
+ // 不显示遮罩
+ this.maskShow = false
+ // 获取子组件对象
+ this.childrenMsg = null
+ }
+ },
+ methods: {
+ customOpen() {
+ if (this.childrenMsg) {
+ this.childrenMsg.open()
+ }
+ },
+ customClose() {
+ if (this.childrenMsg) {
+ this.childrenMsg.close()
+ }
+ }
+ }
+}
diff --git a/components/uni-popup/popup.js b/components/uni-popup/popup.js
new file mode 100644
index 0000000..14d4b77
--- /dev/null
+++ b/components/uni-popup/popup.js
@@ -0,0 +1,25 @@
+import message from './message.js';
+// 定义 type 类型:弹出类型:top/bottom/center
+const config = {
+ // 顶部弹出
+ top:'top',
+ // 底部弹出
+ bottom:'bottom',
+ // 居中弹出
+ center:'center',
+ // 消息提示
+ message:'top',
+ // 对话框
+ dialog:'center',
+ // 分享
+ share:'bottom',
+}
+
+export default {
+ data(){
+ return {
+ config:config
+ }
+ },
+ mixins: [message]
+}
diff --git a/components/uni-popup/share.js b/components/uni-popup/share.js
new file mode 100644
index 0000000..462bb83
--- /dev/null
+++ b/components/uni-popup/share.js
@@ -0,0 +1,16 @@
+export default {
+ created() {
+ if (this.type === 'share') {
+ // 关闭点击
+ this.mkclick = false
+ }
+ },
+ methods: {
+ customOpen() {
+ console.log('share 打开了');
+ },
+ customClose() {
+ console.log('share 关闭了');
+ }
+ }
+}
diff --git a/components/uni-popup/uni-popup.vue b/components/uni-popup/uni-popup.vue
new file mode 100644
index 0000000..ae40d03
--- /dev/null
+++ b/components/uni-popup/uni-popup.vue
@@ -0,0 +1,297 @@
+<template>
+ <view v-if="showPopup" class="uni-popup" :class="[popupstyle]" @touchmove.stop.prevent="clear">
+ <uni-transition v-if="maskShow" class="uni-mask--hook" :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans"
+ @click="onTap" />
+ <uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
+ <view class="uni-popup__wrapper-box" @click.stop="clear">
+ <slot />
+ </view>
+ </uni-transition>
+ </view>
+</template>
+
+<script>
+ import uniTransition from '../uni-transition/uni-transition.vue'
+ import popup from './popup.js'
+ /**
+ * PopUp 弹出层
+ * @description 弹出层组件,为了解决遮罩弹层的问题
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=329
+ * @property {String} type = [top|center|bottom] 弹出方式
+ * @value top 顶部弹出
+ * @value center 中间弹出
+ * @value bottom 底部弹出
+ * @value message 消息提示
+ * @value dialog 对话框
+ * @value share 底部分享示例
+ * @property {Boolean} animation = [ture|false] 是否开启动画
+ * @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
+ * @event {Function} change 打开关闭弹窗触发,e={show: false}
+ */
+
+ export default {
+ name: 'UniPopup',
+ components: {
+ uniTransition
+ },
+ props: {
+ // 开启动画
+ animation: {
+ type: Boolean,
+ default: true
+ },
+ // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
+ // message: 消息提示 ; dialog : 对话框
+ type: {
+ type: String,
+ default: 'center'
+ },
+ // maskClick
+ maskClick: {
+ type: Boolean,
+ default: true
+ }
+ },
+ provide() {
+ return {
+ popup: this
+ }
+ },
+ mixins: [popup],
+ watch: {
+ /**
+ * 监听type类型
+ */
+ type: {
+ handler: function(newVal) {
+ this[this.config[newVal]]()
+ },
+ immediate: true
+ },
+ /**
+ * 监听遮罩是否可点击
+ * @param {Object} val
+ */
+ maskClick: {
+ handler: function(val) {
+ this.mkclick = val
+ },
+ immediate: true
+ }
+ },
+ data() {
+ return {
+ duration: 300,
+ ani: [],
+ showPopup: false,
+ showTrans: false,
+ maskClass: {
+ 'position': 'fixed',
+ 'bottom': 0,
+ 'top': 0,
+ 'left': 0,
+ 'right': 0,
+ 'backgroundColor': 'rgba(0, 0, 0, 0.4)'
+ },
+ transClass: {
+ 'position': 'fixed',
+ 'left': 0,
+ 'right': 0,
+ },
+ maskShow: true,
+ mkclick: true,
+ popupstyle: 'top'
+ }
+ },
+ created() {
+ this.mkclick = this.maskClick
+ if (this.animation) {
+ this.duration = 300
+ } else {
+ this.duration = 0
+ }
+ },
+ methods: {
+ clear(e) {
+ // TODO nvue 取消冒泡
+ e.stopPropagation()
+ },
+ open() {
+ this.showPopup = true
+ this.$nextTick(() => {
+ new Promise(resolve => {
+ clearTimeout(this.timer)
+ this.timer = setTimeout(() => {
+ this.showTrans = true
+ // fixed by mehaotian 兼容 app 端
+ this.$nextTick(() => {
+ resolve();
+ })
+ }, 50);
+ }).then(res => {
+ // 自定义打开事件
+ clearTimeout(this.msgtimer)
+ this.msgtimer = setTimeout(() => {
+ this.customOpen && this.customOpen()
+ }, 100)
+ this.$emit('change', {
+ show: true,
+ type: this.type
+ })
+ })
+ })
+ },
+ close(type) {
+ this.showTrans = false
+ this.$nextTick(() => {
+ this.$emit('change', {
+ show: false,
+ type: this.type
+ })
+ clearTimeout(this.timer)
+ // 自定义关闭事件
+ this.customOpen && this.customClose()
+ this.timer = setTimeout(() => {
+ this.showPopup = false
+ }, 300)
+ })
+ },
+ onTap() {
+ if (!this.mkclick) return
+ this.close()
+ },
+ /**
+ * 顶部弹出样式处理
+ */
+ top() {
+ this.popupstyle = 'top'
+ this.ani = ['slide-top']
+ this.transClass = {
+ 'position': 'fixed',
+ 'left': 0,
+ 'right': 0,
+ }
+ },
+ /**
+ * 底部弹出样式处理
+ */
+ bottom() {
+ this.popupstyle = 'bottom'
+ this.ani = ['slide-bottom']
+ this.transClass = {
+ 'position': 'fixed',
+ 'left': 0,
+ 'right': 0,
+ 'bottom': 0
+ }
+ },
+ /**
+ * 中间弹出样式处理
+ */
+ center() {
+ this.popupstyle = 'center'
+ this.ani = ['zoom-out', 'fade']
+ this.transClass = {
+ 'position': 'fixed',
+ /* #ifndef APP-NVUE */
+ 'display': 'flex',
+ 'flexDirection': 'column',
+ /* #endif */
+ 'bottom': 0,
+ 'left': 0,
+ 'right': 0,
+ 'top': 0,
+ 'justifyContent': 'center',
+ 'alignItems': 'center'
+ }
+ }
+ }
+ }
+</script>
+<style lang="scss" scoped>
+ .uni-popup {
+ position: fixed;
+ /* #ifndef APP-NVUE */
+ z-index: 99;
+ /* #endif */
+ }
+
+ .uni-popup__mask {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: $uni-bg-color-mask;
+ opacity: 0;
+ }
+
+ .mask-ani {
+ transition-property: opacity;
+ transition-duration: 0.2s;
+ }
+
+ .uni-top-mask {
+ opacity: 1;
+ }
+
+ .uni-bottom-mask {
+ opacity: 1;
+ }
+
+ .uni-center-mask {
+ opacity: 1;
+ }
+
+ .uni-popup__wrapper {
+ /* #ifndef APP-NVUE */
+ display: block;
+ /* #endif */
+ position: absolute;
+ }
+
+ .top {
+ /* #ifdef H5 */
+ top: var(--window-top);
+ /* #endif */
+ /* #ifndef H5 */
+ top: 0;
+ /* #endif */
+ }
+
+ .bottom {
+ bottom: 0;
+ }
+
+ .uni-popup__wrapper-box {
+ /* #ifndef APP-NVUE */
+ display: block;
+ /* #endif */
+ position: relative;
+ /* iphonex 等安全区设置,底部安全区适配 */
+ /* #ifndef APP-NVUE */
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+ /* #endif */
+ }
+
+ .content-ani {
+ // transition: transform 0.3s;
+ transition-property: transform, opacity;
+ transition-duration: 0.2s;
+ }
+
+
+ .uni-top-content {
+ transform: translateY(0);
+ }
+
+ .uni-bottom-content {
+ transform: translateY(0);
+ }
+
+ .uni-center-content {
+ transform: scale(1);
+ opacity: 1;
+ }
+</style>
diff --git a/components/uni-transition/uni-transition.vue b/components/uni-transition/uni-transition.vue
new file mode 100644
index 0000000..908a939
--- /dev/null
+++ b/components/uni-transition/uni-transition.vue
@@ -0,0 +1,279 @@
+<template>
+ <view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject"
+ @click="change">
+ <slot></slot>
+ </view>
+</template>
+
+<script>
+ // #ifdef APP-NVUE
+ const animation = uni.requireNativePlugin('animation');
+ // #endif
+ /**
+ * Transition 过渡动画
+ * @description 简单过渡动画组件
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=985
+ * @property {Boolean} show = [false|true] 控制组件显示或隐藏
+ * @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
+ * @value fade 渐隐渐出过渡
+ * @value slide-top 由上至下过渡
+ * @value slide-right 由右至左过渡
+ * @value slide-bottom 由下至上过渡
+ * @value slide-left 由左至右过渡
+ * @value zoom-in 由小到大过渡
+ * @value zoom-out 由大到小过渡
+ * @property {Number} duration 过渡动画持续时间
+ * @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
+ */
+ export default {
+ name: 'uniTransition',
+ props: {
+ show: {
+ type: Boolean,
+ default: false
+ },
+ modeClass: {
+ type: Array,
+ default () {
+ return []
+ }
+ },
+ duration: {
+ type: Number,
+ default: 300
+ },
+ styles: {
+ type: Object,
+ default () {
+ return {}
+ }
+ }
+ },
+ data() {
+ return {
+ isShow: false,
+ transform: '',
+ ani: { in: '',
+ active: ''
+ }
+ };
+ },
+ watch: {
+ show: {
+ handler(newVal) {
+ if (newVal) {
+ this.open()
+ } else {
+ this.close()
+ }
+ },
+ immediate: true
+ }
+ },
+ computed: {
+ stylesObject() {
+ let styles = {
+ ...this.styles,
+ 'transition-duration': this.duration / 1000 + 's'
+ }
+ let transfrom = ''
+ for (let i in styles) {
+ let line = this.toLine(i)
+ transfrom += line + ':' + styles[i] + ';'
+ }
+ return transfrom
+ }
+ },
+ created() {
+ // this.timer = null
+ // this.nextTick = (time = 50) => new Promise(resolve => {
+ // clearTimeout(this.timer)
+ // this.timer = setTimeout(resolve, time)
+ // return this.timer
+ // });
+ },
+ methods: {
+ change() {
+ this.$emit('click', {
+ detail: this.isShow
+ })
+ },
+ open() {
+ clearTimeout(this.timer)
+ this.isShow = true
+ this.transform = ''
+ this.ani.in = ''
+ for (let i in this.getTranfrom(false)) {
+ if (i === 'opacity') {
+ this.ani.in = 'fade-in'
+ } else {
+ this.transform += `${this.getTranfrom(false)[i]} `
+ }
+ }
+ this.$nextTick(() => {
+ setTimeout(() => {
+ this._animation(true)
+ }, 50)
+ })
+
+ },
+ close(type) {
+ clearTimeout(this.timer)
+ this._animation(false)
+ },
+ _animation(type) {
+ let styles = this.getTranfrom(type)
+ // #ifdef APP-NVUE
+ if(!this.$refs['ani']) return
+ animation.transition(this.$refs['ani'].ref, {
+ styles,
+ duration: this.duration, //ms
+ timingFunction: 'ease',
+ needLayout: false,
+ delay: 0 //ms
+ }, () => {
+ if (!type) {
+ this.isShow = false
+ }
+ this.$emit('change', {
+ detail: this.isShow
+ })
+ })
+ // #endif
+ // #ifndef APP-NVUE
+ this.transform = ''
+ for (let i in styles) {
+ if (i === 'opacity') {
+ this.ani.in = `fade-${type?'out':'in'}`
+ } else {
+ this.transform += `${styles[i]} `
+ }
+ }
+ this.timer = setTimeout(() => {
+ if (!type) {
+ this.isShow = false
+ }
+ this.$emit('change', {
+ detail: this.isShow
+ })
+
+ }, this.duration)
+ // #endif
+
+ },
+ getTranfrom(type) {
+ let styles = {
+ transform: ''
+ }
+ this.modeClass.forEach((mode) => {
+ switch (mode) {
+ case 'fade':
+ styles.opacity = type ? 1 : 0
+ break;
+ case 'slide-top':
+ styles.transform += `translateY(${type?'0':'-100%'}) `
+ break;
+ case 'slide-right':
+ styles.transform += `translateX(${type?'0':'100%'}) `
+ break;
+ case 'slide-bottom':
+ styles.transform += `translateY(${type?'0':'100%'}) `
+ break;
+ case 'slide-left':
+ styles.transform += `translateX(${type?'0':'-100%'}) `
+ break;
+ case 'zoom-in':
+ styles.transform += `scale(${type?1:0.8}) `
+ break;
+ case 'zoom-out':
+ styles.transform += `scale(${type?1:1.2}) `
+ break;
+ }
+ })
+ return styles
+ },
+ _modeClassArr(type) {
+ let mode = this.modeClass
+ if (typeof(mode) !== "string") {
+ let modestr = ''
+ mode.forEach((item) => {
+ modestr += (item + '-' + type + ',')
+ })
+ return modestr.substr(0, modestr.length - 1)
+ } else {
+ return mode + '-' + type
+ }
+ },
+ // getEl(el) {
+ // console.log(el || el.ref || null);
+ // return el || el.ref || null
+ // },
+ toLine(name) {
+ return name.replace(/([A-Z])/g, "-$1").toLowerCase();
+ }
+ }
+ }
+</script>
+
+<style>
+ .uni-transition {
+ transition-timing-function: ease;
+ transition-duration: 0.3s;
+ transition-property: transform, opacity;
+ }
+
+ .fade-in {
+ opacity: 0;
+ }
+
+ .fade-active {
+ opacity: 1;
+ }
+
+ .slide-top-in {
+ /* transition-property: transform, opacity; */
+ transform: translateY(-100%);
+ }
+
+ .slide-top-active {
+ transform: translateY(0);
+ /* opacity: 1; */
+ }
+
+ .slide-right-in {
+ transform: translateX(100%);
+ }
+
+ .slide-right-active {
+ transform: translateX(0);
+ }
+
+ .slide-bottom-in {
+ transform: translateY(100%);
+ }
+
+ .slide-bottom-active {
+ transform: translateY(0);
+ }
+
+ .slide-left-in {
+ transform: translateX(-100%);
+ }
+
+ .slide-left-active {
+ transform: translateX(0);
+ opacity: 1;
+ }
+
+ .zoom-in-in {
+ transform: scale(0.8);
+ }
+
+ .zoom-out-active {
+ transform: scale(1);
+ }
+
+ .zoom-out-in {
+ transform: scale(1.2);
+ }
+</style>
diff --git a/js_sdk/wa-permission/permission.js b/js_sdk/wa-permission/permission.js
new file mode 100644
index 0000000..9981504
--- /dev/null
+++ b/js_sdk/wa-permission/permission.js
@@ -0,0 +1,272 @@
+/**
+ * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
+ */
+
+var isIos
+// #ifdef APP-PLUS
+isIos = (plus.os.name == "iOS")
+// #endif
+
+// 判断推送权限是否开启
+function judgeIosPermissionPush() {
+ var result = false;
+ var UIApplication = plus.ios.import("UIApplication");
+ var app = UIApplication.sharedApplication();
+ var enabledTypes = 0;
+ if (app.currentUserNotificationSettings) {
+ var settings = app.currentUserNotificationSettings();
+ enabledTypes = settings.plusGetAttribute("types");
+ console.log("enabledTypes1:" + enabledTypes);
+ if (enabledTypes == 0) {
+ console.log("推送权限没有开启");
+ } else {
+ result = true;
+ console.log("已经开启推送功能!")
+ }
+ plus.ios.deleteObject(settings);
+ } else {
+ enabledTypes = app.enabledRemoteNotificationTypes();
+ if (enabledTypes == 0) {
+ console.log("推送权限没有开启!");
+ } else {
+ result = true;
+ console.log("已经开启推送功能!")
+ }
+ console.log("enabledTypes2:" + enabledTypes);
+ }
+ plus.ios.deleteObject(app);
+ plus.ios.deleteObject(UIApplication);
+ return result;
+}
+
+// 判断定位权限是否开启
+function judgeIosPermissionLocation() {
+ var result = false;
+ var cllocationManger = plus.ios.import("CLLocationManager");
+ var status = cllocationManger.authorizationStatus();
+ result = (status != 2)
+ console.log("定位权限开启:" + result);
+ // 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
+ /* var enable = cllocationManger.locationServicesEnabled();
+ var status = cllocationManger.authorizationStatus();
+ console.log("enable:" + enable);
+ console.log("status:" + status);
+ if (enable && status != 2) {
+ result = true;
+ console.log("手机定位服务已开启且已授予定位权限");
+ } else {
+ console.log("手机系统的定位没有打开或未给予定位权限");
+ } */
+ plus.ios.deleteObject(cllocationManger);
+ return result;
+}
+
+// 判断麦克风权限是否开启
+function judgeIosPermissionRecord() {
+ var result = false;
+ var avaudiosession = plus.ios.import("AVAudioSession");
+ var avaudio = avaudiosession.sharedInstance();
+ var permissionStatus = avaudio.recordPermission();
+ console.log("permissionStatus:" + permissionStatus);
+ if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
+ console.log("麦克风权限没有开启");
+ } else {
+ result = true;
+ console.log("麦克风权限已经开启");
+ }
+ plus.ios.deleteObject(avaudiosession);
+ return result;
+}
+
+// 判断相机权限是否开启
+function judgeIosPermissionCamera() {
+ var result = false;
+ var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
+ var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
+ console.log("authStatus:" + authStatus);
+ if (authStatus == 3) {
+ result = true;
+ console.log("相机权限已经开启");
+ } else {
+ console.log("相机权限没有开启");
+ }
+ plus.ios.deleteObject(AVCaptureDevice);
+ return result;
+}
+
+// 判断相册权限是否开启
+function judgeIosPermissionPhotoLibrary() {
+ var result = false;
+ var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
+ var authStatus = PHPhotoLibrary.authorizationStatus();
+ console.log("authStatus:" + authStatus);
+ if (authStatus == 3) {
+ result = true;
+ console.log("相册权限已经开启");
+ } else {
+ console.log("相册权限没有开启");
+ }
+ plus.ios.deleteObject(PHPhotoLibrary);
+ return result;
+}
+
+// 判断通讯录权限是否开启
+function judgeIosPermissionContact() {
+ var result = false;
+ var CNContactStore = plus.ios.import("CNContactStore");
+ var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
+ if (cnAuthStatus == 3) {
+ result = true;
+ console.log("通讯录权限已经开启");
+ } else {
+ console.log("通讯录权限没有开启");
+ }
+ plus.ios.deleteObject(CNContactStore);
+ return result;
+}
+
+// 判断日历权限是否开启
+function judgeIosPermissionCalendar() {
+ var result = false;
+ var EKEventStore = plus.ios.import("EKEventStore");
+ var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
+ if (ekAuthStatus == 3) {
+ result = true;
+ console.log("日历权限已经开启");
+ } else {
+ console.log("日历权限没有开启");
+ }
+ plus.ios.deleteObject(EKEventStore);
+ return result;
+}
+
+// 判断备忘录权限是否开启
+function judgeIosPermissionMemo() {
+ var result = false;
+ var EKEventStore = plus.ios.import("EKEventStore");
+ var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
+ if (ekAuthStatus == 3) {
+ result = true;
+ console.log("备忘录权限已经开启");
+ } else {
+ console.log("备忘录权限没有开启");
+ }
+ plus.ios.deleteObject(EKEventStore);
+ return result;
+}
+
+// Android权限查询
+function requestAndroidPermission(permissionID) {
+ return new Promise((resolve, reject) => {
+ plus.android.requestPermissions(
+ [permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
+ function(resultObj) {
+ var result = 0;
+ for (var i = 0; i < resultObj.granted.length; i++) {
+ var grantedPermission = resultObj.granted[i];
+ console.log('已获取的权限:' + grantedPermission);
+ result = 1
+ }
+ for (var i = 0; i < resultObj.deniedPresent.length; i++) {
+ var deniedPresentPermission = resultObj.deniedPresent[i];
+ console.log('拒绝本次申请的权限:' + deniedPresentPermission);
+ result = 0
+ }
+ for (var i = 0; i < resultObj.deniedAlways.length; i++) {
+ var deniedAlwaysPermission = resultObj.deniedAlways[i];
+ console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
+ result = -1
+ }
+ resolve(result);
+ // 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
+ // if (result != 1) {
+ // gotoAppPermissionSetting()
+ // }
+ },
+ function(error) {
+ console.log('申请权限错误:' + error.code + " = " + error.message);
+ resolve({
+ code: error.code,
+ message: error.message
+ });
+ }
+ );
+ });
+}
+
+// 使用一个方法,根据参数判断权限
+function judgeIosPermission(permissionID) {
+ if (permissionID == "location") {
+ return judgeIosPermissionLocation()
+ } else if (permissionID == "camera") {
+ return judgeIosPermissionCamera()
+ } else if (permissionID == "photoLibrary") {
+ return judgeIosPermissionPhotoLibrary()
+ } else if (permissionID == "record") {
+ return judgeIosPermissionRecord()
+ } else if (permissionID == "push") {
+ return judgeIosPermissionPush()
+ } else if (permissionID == "contact") {
+ return judgeIosPermissionContact()
+ } else if (permissionID == "calendar") {
+ return judgeIosPermissionCalendar()
+ } else if (permissionID == "memo") {
+ return judgeIosPermissionMemo()
+ }
+ return false;
+}
+
+// 跳转到**应用**的权限页面
+function gotoAppPermissionSetting() {
+ if (isIos) {
+ var UIApplication = plus.ios.import("UIApplication");
+ var application2 = UIApplication.sharedApplication();
+ var NSURL2 = plus.ios.import("NSURL");
+ // var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
+ var setting2 = NSURL2.URLWithString("app-settings:");
+ application2.openURL(setting2);
+
+ plus.ios.deleteObject(setting2);
+ plus.ios.deleteObject(NSURL2);
+ plus.ios.deleteObject(application2);
+ } else {
+ // console.log(plus.device.vendor);
+ var Intent = plus.android.importClass("android.content.Intent");
+ var Settings = plus.android.importClass("android.provider.Settings");
+ var Uri = plus.android.importClass("android.net.Uri");
+ var mainActivity = plus.android.runtimeMainActivity();
+ var intent = new Intent();
+ intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+ var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
+ intent.setData(uri);
+ mainActivity.startActivity(intent);
+ }
+}
+
+// 检查系统的设备服务是否开启
+// var checkSystemEnableLocation = async function () {
+function checkSystemEnableLocation() {
+ if (isIos) {
+ var result = false;
+ var cllocationManger = plus.ios.import("CLLocationManager");
+ var result = cllocationManger.locationServicesEnabled();
+ console.log("系统定位开启:" + result);
+ plus.ios.deleteObject(cllocationManger);
+ return result;
+ } else {
+ var context = plus.android.importClass("android.content.Context");
+ var locationManager = plus.android.importClass("android.location.LocationManager");
+ var main = plus.android.runtimeMainActivity();
+ var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
+ var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
+ console.log("系统定位开启:" + result);
+ return result
+ }
+}
+
+module.exports = {
+ judgeIosPermission: judgeIosPermission,
+ requestAndroidPermission: requestAndroidPermission,
+ checkSystemEnableLocation: checkSystemEnableLocation,
+ gotoAppPermissionSetting: gotoAppPermissionSetting
+}
diff --git a/manifest.json b/manifest.json
index 9a35469..7e751a5 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,6 +1,6 @@
{
"name" : "智慧保安",
- "appid" : "__UNI__0F00D11",
+ "appid" : "__UNI__6B9ED90",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@@ -49,7 +49,8 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
- ]
+ ],
+ "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
/* ios打包配置 */
"ios" : {},
@@ -89,6 +90,22 @@
}
}
}
+ },
+ "nativePlugins" : {
+ "AR-RtcModule" : {
+ "__plugin_info__" : {
+ "name" : "AR-RtcModule",
+ "description" : "anyRTC音视频插件提供音视频功能,支持Android、iOS。",
+ "platforms" : "Android,iOS",
+ "url" : "",
+ "android_package_name" : "",
+ "ios_bundle_id" : "",
+ "isCloud" : false,
+ "bought" : -1,
+ "pid" : "",
+ "parameters" : {}
+ }
+ }
}
},
/* 快应用特有相关 */
diff --git a/nativePlugins/AR-RtcModule/android/arsdk-release.aar b/nativePlugins/AR-RtcModule/android/arsdk-release.aar
new file mode 100644
index 0000000..27ade2f
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/android/arsdk-release.aar
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/android/rtc-release.aar b/nativePlugins/AR-RtcModule/android/rtc-release.aar
new file mode 100644
index 0000000..9266a84
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/android/rtc-release.aar
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/ARtcKit b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/ARtcKit
new file mode 100644
index 0000000..b7e2a07
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/ARtcKit
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/AREnumerates.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/AREnumerates.h
new file mode 100644
index 0000000..756f9bc
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/AREnumerates.h
@@ -0,0 +1,1817 @@
+//
+// AREnumerates.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/3/20.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#ifndef AREnumerates_h
+#define AREnumerates_h
+
+/** Warning code.
+
+警告代码表示 SDK 运行时出现了(网络或媒体相关的)警告。通常情况下,SDK 上报的警告信息 App 可以忽略,SDK 会自动恢复。比如和服务器失去连接时,SDK 可能会上报 ARWarningCodeOpenChannelTimeout(106) 警告,同时自动尝试重连。
+*/
+typedef NS_ENUM(NSInteger, ARWarningCode) {
+ /**
+ 8: 指定的 view 无效,使用视频功能时需要指定 view,如果 view 尚未指定,则返回该警告。
+ */
+ ARWarningCodeInvalidView = 8,
+ /**
+ 16: 初始化视频功能失败。有可能是因视频资源被占用导致的。用户无法看到视频画面,但不影响语音通信。
+ */
+ ARWarningCodeInitVideo = 16,
+ /**
+ 20: 请求处于待定状态。一般是由于某个模块还没准备好,请求被延迟处理。
+ */
+ ARWarningCodePending = 20,
+ /**
+ 103: 没有可用的频道资源。可能是因为服务端没法分配频道资源。
+ */
+ ARWarningCodeNoAvailableChannel = 103,
+ /**
+ 104: 查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器。
+ */
+ ARWarningCodeLookupChannelTimeout = 104,
+ /**
+ 105: 查找频道请求被服务器拒绝。服务器可能没有办法处理这个请求或请求是非法的。
+ */
+ ARWarningCodeLookupChannelRejected = 105,
+ /**
+ 106: 打开频道超时。查找到指定频道后,SDK 接着打开该频道,超时一般是因为网络太差,连接不到服务器。
+ */
+ ARWarningCodeOpenChannelTimeout = 106,
+ /**
+ 107: 打开频道请求被服务器拒绝。服务器可能没有办法处理该请求或该请求是非法的。
+ */
+ ARWarningCodeOpenChannelRejected = 107,
+ /**
+ 111: 切换直播视频超时。
+ */
+ ARWarningCodeSwitchLiveVideoTimeout = 111,
+ /**
+ 118: 直播场景下设置用户角色超时。
+ */
+ ARWarningCodeSetClientRoleTimeout = 118,
+ /**
+ 119: 直播场景下用户角色未授权。
+ */
+ ARWarningCodeSetClientRoleNotAuthorized = 119,
+ /**
+ 121: TICKET 非法,打开频道失败。
+ */
+ ARWarningCodeOpenChannelInvalidTicket = 121,
+ /**
+ 122: 尝试打开另一个服务器。
+ */
+ ARWarningCodeOpenChannelTryNextVos = 122,
+ /**
+ 701: 打开伴奏出错。
+ */
+ ARWarningCodeAudioMixingOpenError = 701,
+ /**
+ 1014: 音频设备模块:运行时播放设备出现警告。
+ */
+ ARWarningCodeAdmRuntimePlayoutWarning = 1014,
+ /**
+ 1016: 音频设备模块:运行时录音设备出现警告。
+ */
+ ARWarningCodeAdmRuntimeRecordingWarning = 1016,
+ /**
+ 1019: 音频设备模块:没有采集到有效的声音数据。该警告不影响正常通话。
+ */
+ ARWarningCodeAdmRecordAudioSilence = 1019,
+ /**
+ 1020: 音频设备模块:播放设备故障。
+ */
+ ARWarningCodeAdmPlaybackMalfunction = 1020,
+ /**
+ 1021: 音频设备模块:录音设备故障。
+ */
+ ARWarningCodeAdmRecordMalfunction = 1021,
+ /**
+ 1025: 通话或直播被系统声音打断,比如电话、闹钟等。
+ */
+ ARWarningCodeAdmInterruption = 1025,
+ /**
+ 1031: 音频设备模块:录到的声音太低。
+ */
+ ARWarningCodeAdmRecordAudioLowlevel = 1031,
+ /**
+ 1032: 音频设备模块:播放的声音太低。
+ */
+ ARWarningCodeAdmPlayoutAudioLowlevel = 1032,
+ /**
+ 1051: 音频设备模块:录音声音监测到啸叫。
+ */
+ ARWarningCodeApmHowling = 1051,
+ /**
+ 1052: 音频设备模块:音频播放会卡顿。
+ */
+ ARWarningCodeAdmGlitchState = 1052,
+ /**
+ 1053: 音频设备模块:音频底层设置被修改。
+ */
+ ARWarningCodeAdmImproperSettings = 1053,
+};
+
+/** 错误代码
+
+错误代码表示 SDK 运行时出现了(网络或媒体相关的)错误。通常情况下,SDK 上报的错误意味着 SDK 无法自动恢复,需要 App 干预或提示用户。 比如启动通话失败时,SDK 会上报 ARErrorCodeStartCall = 1002 错误。App可以提示用户启动通话失败,并调用 leaveChannel 退出频道。
+*/
+typedef NS_ENUM(NSInteger, ARErrorCode) {
+ /**
+ 0: 没有错误。
+ */
+ ARErrorCodeNoError = 0,
+ /**
+ 1: 一般性的错误(没有明确归类的错误原因)。
+ */
+ ARErrorCodeFailed = 1,
+ /**
+ 2: API 调用了无效的参数。例如指定的频道名含有非法字符。
+ */
+ ARErrorCodeInvalidArgument = 2,
+ /**
+ 3: SDK 未准备好。
+ 处理方法:
+ * 检查音频设备状态
+ * 检查程序集完整性
+ * 尝试重新初始化 SDK
+ */
+ ARErrorCodeNotReady = 3,
+ /**
+ 4: SDK 当前状态不支持此操作,因此不能进行此操作。
+ */
+ ARErrorCodeNotSupported = 4,
+ /**
+ 5: 调用被拒绝。仅供 SDK 内部使用,不通过 API 或者回调事件返回给 App。
+ */
+ ARErrorCodeRefused = 5,
+ /**
+ 6: 传入的缓冲区大小不足以存放返回的数据。
+ */
+ ARErrorCodeBufferTooSmall = 6,
+ /**
+ 7: SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 ARtcEngineKit 对象并完成初始化。
+ */
+ ARErrorCodeNotInitialized = 7,
+ /**
+ 9: 没有操作权限,请检查用户是否授予 app 音视频设备使用权限。
+ */
+ ARErrorCodeNoPermission = 9,
+ /**
+ 10: API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误。
+ */
+ ARErrorCodeTimedOut = 10,
+ /**
+ 11: 请求被取消。仅供 SDK 内部使用,不通过 API 或者回调事件返回给 App。
+ */
+ ARErrorCodeCanceled = 11,
+ /**
+ 12: 调用频率太高。仅供 SDK 内部使用,不通过 API 或者回调事件返回给 App。
+ */
+ ARErrorCodeTooOften = 12,
+ /**
+ 13: SDK 内部绑定到网络 Socket 失败。仅供 SDK 内部使用,不通过 API 或者回调事件返回给 App。
+ */
+ ARErrorCodeBindSocket = 13,
+ /**
+ 14: 网络不可用。仅供 SDK 内部使用,不通过 API 或者回调事件返回给 App。
+ */
+ ARErrorCodeNetDown = 14,
+ /**
+ 15: 没有网络缓冲区可用。仅供 SDK 内部使用,不通过 API 或者回调事件返回给 App。
+ */
+ ARErrorCodeNoBufs = 15,
+ /**
+ 17: 加入频道被拒绝。
+ 一般有以下原因:
+ * 用户已进入频道,再次调用加入频道的 API,例如 joinChannelByToken,会返回此错误。停止调用该 API 即可。
+ * 用户在做 Echo 测试时尝试加入频道。等待 Echo test 结束后再加入频道即可。
+ */
+ ARErrorCodeJoinChannelRejected = 17,
+ /**
+ 18: 离开频道失败。
+ 一般有以下原因:
+ * 用户已离开频道,再次调用退出频道的 API,例如 leaveChannel,会返回此错误。停止调用该 API 即可。
+ * 用户尚未加入频道,就调用退出频道的 API。这种情况下无需额外操作。
+ */
+ ARErrorCodeLeaveChannelRejected = 18,
+ /**
+ 19: 资源已被占用,不能重复使用。
+ */
+ ARErrorCodeAlreadyInUse = 19,
+ /**
+ 20: SDK 放弃请求,可能由于请求次数太多。
+ */
+ ARErrorCodeAbort = 20,
+ /**
+ 21: Windows 下特定的防火墙设置导致 SDK 初始化失败然后崩溃。
+ */
+ ARErrorCodeInitNetEngine = 21,
+ /**
+ 22: 当用户 App 占用资源过多,或系统资源耗尽时,SDK 分配资源失败会返回该错误。
+ */
+ ARErrorCodeResourceLimited = 22,
+ /**
+ 101: 不是有效的 App ID。请更换有效的 App ID 重新加入频道。
+ */
+ ARErrorCodeInvalidAppId = 101,
+ /**
+ 102: 不是有效的频道名。请更换有效的频道名重新加入频道。
+ */
+ ARErrorCodeInvalidChannelId = 102,
+ /**
+ 109: 当前使用的 Token 过期,不再有效。
+ connectionChangedToState 回调中 reason 参数的 ARConnectionChangedTokenExpired(9)。
+ 一般有以下原因:
+ * Token 授权时间戳无效:Token 授权时间戳为 Token 生成时的时间戳,自 1970 年 1 月 1 日开始到当前时间的描述。授权该 Token 在生成后的 24 小时内可以访问 anyRTC 服务。如果 24 小时内没有访问,则该 Token 无法再使用。需要重新在服务端申请生成 Token。
+ * Token 服务到期时间戳已过期:用户设置的服务到期时间戳小于当前时间戳,无法继续使用 anyRTC 服务(比如正在进行的通话会被强制终止);设置服务到期时间并不意味着 Token 失效,而仅仅用于限制用户使用当前服务的时间。需要重新在服务端申请生成 Token。
+ */
+ ARErrorCodeTokenExpired = 109,
+ /**
+ 110: 生成的 Token 无效。
+ connectionChangedToState 回调中 reason 参数的 ARConnectionChangedInvalidToken(8)。
+ 一般有以下原因:
+ * 用户在控制台上启用了 App Certificate,但仍旧在代码里仅使用了 App ID。当启用了 App Certificate,必须使用 Token。
+ * 字段 uid 为生成 Token 的必须字段,用户在调用 joinChannelByToken 加入频道时必须设置相同的 uid。
+ */
+ ARErrorCodeInvalidToken = 110,
+ /**
+ 111: 网络连接中断。仅适用于 anyRTC Web SDK。
+ */
+ ARErrorCodeConnectionInterrupted = 111,
+ /**
+ 112: 网络连接丢失。仅适用于 anyRTC Web SDK。
+ */
+ ARErrorCodeConnectionLost = 112,
+ /**
+ 113: 在调用 sendStreamMessage 时,如果用户不在频道内,会发生该错误。
+ */
+ ARErrorCodeNotInChannel = 113,
+ /**
+ 114: 在调用 sendStreamMessage 时,当发送的数据长度大于 1024 个字节时,会发生该错误。
+ */
+ ARErrorCodeSizeTooLarge = 114,
+ /**
+ 115: 在调用 sendStreamMessage 时,当发送的数据码率超过限制时 (6 Kbps),会发生该错误。
+ */
+ ARErrorCodeBitrateLimit = 115,
+ /**
+ 116: 在调用 createDataStream 时,如果创建的数据通道过多(超过 5 个通道),会发生该错误。
+ */
+ ARErrorCodeTooManyDataStreams = 116,
+ /**
+ 120: 解密失败,可能是用户加入频道用了不同的密码。请检查加入频道时的设置,或尝试重新加入频道。
+ */
+ ARErrorCodeDecryptionFailed = 120,
+ /**
+ 124: 水印文件参数错误。
+ */
+ ARErrorCodeWatermarkParam = 124,
+ /**
+ 125: 水印文件路径错误。
+ */
+ ARErrorCodeWatermarkPath = 125,
+ /**
+ 126: 水印文件格式错误。
+ */
+ ARErrorCodeWatermarkPng = 126,
+ /**
+ 127: 水印文件信息错误。
+ */
+ ARErrorCodeWatermarkInfo = 127,
+ /**
+ 128: 水印文件数据格式错误。
+ */
+ ARErrorCodeWatermarkAGRB = 128,
+ /**
+ 129: 水印文件读取错误。
+ */
+ ARErrorCodeWatermarkRead = 129,
+ /**
+ 130: 推流已加密不能推流。
+ */
+ ARErrorCodeEncryptedStreamNotAllowedPublish = 130,
+ /**
+ 134: 无效的 User Account。
+ */
+ ARErrorCodeInvalidUserAccount = 134,
+ /**
+ 151: CDN 相关错误。请调用 removePublishStreamUrl 方法删除原来的推流地址,然后调用 addPublishStreamUrl 方法重新推流到新地址。
+ */
+ ARErrorCodePublishStreamCDNError = 151,
+ /**
+ 152: 单个主播的推流地址数目达到上限 10。请删掉一些不用的推流地址再增加推流地址。
+ */
+ ARErrorCodePublishStreamNumReachLimit = 152,
+ /**
+ 153: 操作不属于主播自己的流,例如更新其他主播的流参数、停止其他主播的流。请检查 App 逻辑。
+ */
+ ARErrorCodePublishStreamNotAuthorized = 153,
+ /**
+ 154: 推流服务器出现错误。请调用 addPublishStreamUrl 重新推流。
+ */
+ ARErrorCodePublishStreamInternalServerError = 154,
+ /**
+ 155: 服务器未找到这个流。
+ */
+ ARErrorCodePublishStreamNotFound = 155,
+ /**
+ 156: 推流地址格式有错误。请检查推流地址格式是否正确。
+ */
+ ARErrorCodePublishStreamFormatNotSuppported = 156,
+ /**
+ 1001: 加载媒体引擎失败。
+ */
+ ARErrorCodeLoadMediaEngine = 1001,
+ /**
+ 1002: 启动媒体引擎开始通话失败。请尝试重新进入频道。
+ */
+ ARErrorCodeStartCall = 1002,
+ /**
+ 1003: 启动摄像头失败,请检查摄像头是否被其他应用占用,或者尝试重新进入频道。
+ */
+ ARErrorCodeStartCamera = 1003,
+ /**
+ 1004: 启动视频渲染模块失败。
+ */
+ ARErrorCodeStartVideoRender = 1004,
+ /**
+ 1005: 音频设备模块:音频设备出现错误(未明确指明为何种错误)。请检查音频设备是否被其它应用占用,或者尝试重新进入频道。
+ */
+ ARErrorCodeAdmGeneralError = 1005,
+ /**
+ 1006: 音频设备模块:使用 java 资源出现错误。
+ */
+ ARErrorCodeAdmJavaResource = 1006,
+ /**
+ 1007: 音频设备模块:设置的采样频率出现错误。
+ */
+ ARErrorCodeAdmSampleRate = 1007,
+ /**
+ 1008: 音频设备模块:初始化播放设备出现错误。请检查播放设备是否被其他应用占用,或者尝试重新进入频道。
+ */
+ ARErrorCodeAdmInitPlayout = 1008,
+ /**
+ 1009: 音频设备模块:启动播放设备出现错误。请检查播放设备是否正常,或者尝试重新进入频道。
+ */
+ ARErrorCodeAdmStartPlayout = 1009,
+ /**
+ 1010: 音频设备模块:停止播放设备出现错误。
+ */
+ ARErrorCodeAdmStopPlayout = 1010,
+ /**
+ 1011: 音频设备模块:初始化录音设备时出现错误。请检查录音设备是否正常,或者尝试重新进入频道。
+ */
+ ARErrorCodeAdmInitRecording = 1011,
+ /**
+ 1012: 音频设备模块:启动录音设备出现错误。请检查录音设备是否正常,或者尝试重新进入频道。
+ */
+ ARErrorCodeAdmStartRecording = 1012,
+ /**
+ 1013: 音频设备模块:停止录音设备出现错误。
+ */
+ ARErrorCodeAdmStopRecording = 1013,
+ /**
+ 1015: 音频设备模块:运行时播放出现错误。请检查播放设备是否正常,或者尝试重新进入频道。
+ */
+ ARErrorCodeAdmRuntimePlayoutError = 1015,
+ /**
+ 1017: 音频设备模块:运行时录音错误。请检查录音设备是否正常,或者尝试重新进入频道。
+ */
+ ARErrorCodeAdmRuntimeRecordingError = 1017,
+ /**
+ 1018: 音频设备模块:录音失败。
+ */
+ ARErrorCodeAdmRecordAudioFailed = 1018,
+ /**
+ 1020: 音频设备模块:回放频率异常。
+ */
+ ARErrorCodeAdmPlayAbnormalFrequency = 1020,
+ /**
+ 1021: 音频设备模块:录制频率异常。
+ */
+ ARErrorCodeAdmRecordAbnormalFrequency = 1021,
+ /**
+ 1022: 音频设备模块:初始化 Loopback 设备错误。
+ */
+ ARErrorCodeAdmInitLoopback = 1022,
+ /**
+ 1023: 音频设备模块:启动 Loopback 设备错误。
+ */
+ ARErrorCodeAdmStartLoopback = 1023,
+ /**
+ 1027: 音频设备模块: 在没有录音权限时发生错误。
+ */
+ ARErrorCodeAdmNoPermission = 1027,
+ /**
+ 1359: 音频设备模块:无录制设备。请检查是否有可用的录放音设备或者录放音设备是否已经被其他应用占用。
+ */
+ ARErrorCodeAdmNoRecordingDevice = 1359,
+ /**
+ 1360: 音频设备模块:无播放设备。
+ */
+ ARErrorCodeAdmNoPlayoutDevice = 1360,
+ /**
+ 1501: 视频设备模块:没有摄像头使用权限。请检查是否已经打开摄像头权限。
+ */
+ ARErrorCodeVdmCameraNotAuthorized = 1501,
+ /**
+ 1600: 视频设备模块:未知错误。
+ */
+ ARErrorCodeVcmUnknownError = 1600,
+ /**
+ 1601: 视频设备模块:视频编码器初始化错误。该错误为严重错误,请尝试重新加入频道。
+ */
+ ARErrorCodeVcmEncoderInitError = 1601,
+ /**
+ 1602: 视频设备模块:视频编码器错误。该错误为严重错误,请尝试重新加入频道。
+ */
+ ARErrorCodeVcmEncoderEncodeError = 1602
+};
+
+/** 混音音乐文件状态 */
+typedef NS_ENUM(NSInteger, ARAudioMixingStateCode){
+ /**
+ 710: 视频设备模块:未知错误。
+ */
+ ARAudioMixingStatePlaying = 710,
+ /**
+ 711: 音乐文件暂停播放
+ */
+ ARAudioMixingStatePaused = 711,
+ /**
+ 713:音乐文件停止播放
+ */
+ ARAudioMixingStateStopped = 713,
+ /**
+ 714:音乐文件播放出错
+ */
+ ARAudioMixingStateFailed = 714,
+};
+
+/** 混音音乐文件错误码 */
+typedef NS_ENUM(NSInteger, ARAudioMixingErrorCode){
+ /**
+ 701: 音乐文件打开出错
+ */
+ ARAudioMixingErrorCanNotOpen = 701,
+ /**
+ 702: 音乐文件打开太频繁
+ */
+ ARAudioMixingErrorTooFrequentCall = 702,
+ /**
+ 703: 音乐文件打开中断
+ */
+ ARAudioMixingErrorInterruptedEOF = 703,
+ /**
+ 0: 音乐文件状态正常
+ */
+ ARAudioMixingErrorOK = 0,
+};
+
+/** 频道使用场景 */
+typedef NS_ENUM(NSUInteger, ARChannelProfile ) {
+ /**
+ 0: 通信场景
+ */
+ ARChannelProfileCommunication = 0,
+ /**
+ 1: 直播场景
+ */
+ ARChannelProfileLiveBroadcasting = 1,
+ /**
+ 2: 游戏语音场景
+ */
+ ARChannelProfileGame = 2
+};
+
+/** 视频显示模式 */
+typedef NS_ENUM(NSUInteger, ARVideoRenderMode ) {
+ /**
+ 1:优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗。
+ */
+ ARVideoRenderModeHidden = 1,
+ /**
+ 2:优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。
+ */
+ ARVideoRenderModeFit = 2,
+ /**
+ 4:视频尺寸进行缩放和拉伸以充满显示视窗。
+ */
+ ARVideoRenderModeFill = 4
+};
+
+/** 视频镜像模式 */
+typedef NS_ENUM(NSUInteger, ARVideoMirrorMode ) {
+ /**
+ 0: (Default) 由 SDK 决定镜像模式
+ */
+ ARVideoMirrorModeAuto = 0,
+ /**
+ 1: 启用镜像模式
+ */
+ ARVideoMirrorModeEnabled = 1,
+ /**
+ 2: 关闭镜像模式
+ */
+ ARVideoMirrorModeDisabled = 2
+
+};
+
+/** 直播场景里的用户角色 */
+typedef NS_ENUM(NSInteger, ARClientRole) {
+ /**
+ 1:主播
+ */
+ ARClientRoleBroadcaster = 1,
+ /**
+ 2:观众(默认)
+ */
+ ARClientRoleAudience = 2,
+};
+
+/** 用户离线原因 */
+typedef NS_ENUM(NSUInteger, ARUserOfflineReason) {
+ /**
+ 0:用户主动离开
+ */
+ ARUserOfflineReasonQuit = 0,
+ /**
+ 1:因过长时间收不到对方数据包,超时掉线。注意:由于 SDK 使用的是不可靠通道,也有可能对方主动离开本方没收到对方离开消息而误判为超时掉线
+ */
+ ARUserOfflineReasonDropped = 1,
+ /**
+ 2:用户身份从主播切换为观众时触发
+ */
+ ARUserOfflineReasonBecomeAudience = 2,
+};
+
+/** 网络状态 */
+typedef NS_ENUM(NSInteger, ARNetworkType) {
+ /**
+ -1:网络连接类型未知
+ */
+ ARNetworkTypeUnknown = 0,
+ /**
+ 1:网络类型为 LAN
+ */
+ ARNetworkTypeLAN = 1,
+ /**
+ 2:网络类型为 Wi-Fi(包含热点)
+ */
+ ARNetworkTypeWIFI = 2,
+ /**
+ 3:网络类型为 2G 移动网络
+ */
+ ARNetworkTypeMobile2G = 3,
+ /**
+ 4:网络类型为 3G 移动网络
+ */
+ ARNetworkTypeMobile3G = 4,
+ /**
+ 5:网络类型为 4G 移动网络
+ */
+ ARNetworkTypeMobile4G = 5
+};
+
+/** 网络连接状态类型 */
+typedef NS_ENUM(NSInteger, ARConnectionStateType) {
+ /**
+ 1:网络连接断开
+ */
+ ARConnectionStateDisconnected = 1,
+ /**
+ 2:建立网络连接中
+ */
+ ARConnectionStateConnecting = 2,
+ /**
+ 3:网络已连接
+ */
+ ARConnectionStateConnected = 3,
+ /**
+ 4:重新建立网络连接中
+ */
+ ARConnectionStateReconnecting = 4,
+ /**
+ 5:网络连接失败
+ */
+ ARConnectionStateFailed = 5
+};
+
+/** 音频属性 */
+typedef NS_ENUM(NSInteger, ARAudioProfile) {
+ /**
+ 0:默认设置,通信场景下,默认ARAudioProfileSpeechStandard。直播场景下,默认ARAudioProfileMusicStandard
+ */
+ ARAudioProfileDefault = 0,
+ /**
+ 1:指定 32 KHz采样率,语音编码,单声道,编码码率最大值为 18 Kbps
+ */
+ ARAudioProfileSpeechStandard = 1,
+ /**
+ 2:指定 48 KHz采样率,音乐编码,单声道,编码码率最大值为 48 Kbps。
+ */
+ ARAudioProfileMusicStandard = 2,
+ /**
+ 3:指定 48 KHz采样率,音乐编码,双声道,编码码率最大值为 56 Kbps
+ */
+ ARAudioProfileMusicStandardStereo = 3,
+ /**
+ 4:指定 48 KHz 采样率,音乐编码,单声道,编码码率最大值为 128 Kbps
+ */
+ ARAudioProfileMusicHighQuality = 4,
+ /**
+ 5:指定 48 KHz采样率,音乐编码,双声道,编码码率最大值为 192 Kbps
+ */
+ ARAudioProfileMusicHighQualityStereo = 5
+};
+
+/** 设置音频应用场景 */
+typedef NS_ENUM(NSInteger, ARAudioScenario) {
+ /**
+ 0: 默认的音频应用场景。 */
+ ARAudioScenarioDefault = 0,
+ /**
+ 1: 娱乐应用,需要频繁上下麦的场景
+ */
+ ARAudioScenarioChatRoomEntertainment = 1,
+ /**
+ 2: 教育场景,适用于需要高流畅度和稳定性的场景。
+ */
+ ARAudioScenarioEducation = 2,
+ /**
+ 3: 高音质语聊房场景,适用于音乐为主的场景。
+ */
+ ARAudioScenarioGameStreaming = 3,
+ /**
+ 4: 秀场场景,适用于需要高音质的单主播场景。
+ */
+ ARAudioScenarioShowRoom = 4,
+ /**
+ 5: 游戏开黑场景,适用于只有人声的场景。
+ */
+ ARAudioScenarioChatRoomGaming = 5
+};
+
+/** 远端视频流状态 */
+typedef NS_ENUM(NSUInteger, ARVideoRemoteState) {
+ /**
+ 0: 远端视频默认初始状态。在 ARVideoRemoteStateReasonLocalMuted(3)、ARVideoRemoteStateReasonRemoteMuted(5) 或 ARVideoRemoteStateReasonRemoteMuted(7) 的情况下,会报告该状态。
+ */
+ ARVideoRemoteStateStopped = 0,
+ /**
+ 1: 本地用户已接收远端视频首包。
+ */
+ ARVideoRemoteStateStarting = 1,
+ /**
+ 2: 远端视频流正在解码,正常播放。在 ARVideoRemoteStateReasonNetworkRecovery(2)、ARVideoRemoteStateReasonNetworkRecovery(4)、ARVideoRemoteStateReasonRemoteUnmuted(6) 或 ARVideoRemoteStateReasonAudioFallbackRecovery(9) 的情况下,会报告该状态。
+ */
+ ARVideoRemoteStateDecoding = 2,
+ /**
+ 3: 远端视频流卡顿。在 ARVideoRemoteStateReasonNetworkCongestion(1) 或 ARVideoRemoteStateReasonAudioFallback(8) 的情况下,会报告该状态。
+ */
+ ARVideoRemoteStateFrozen = 3,
+ /**
+ 4: 远端视频流播放失败。在 ARVideoRemoteStateReasonInternal(0) 的情况下,会报告该状态。
+ */
+ ARVideoRemoteStateFailed = 4,
+};
+
+/** 远端视频流状态改变的具体原因 */
+typedef NS_ENUM(NSUInteger, ARVideoRemoteStateReason ) {
+ /**
+ 0: 内部原因。
+ */
+ ARVideoRemoteStateReasonInternal = 0,
+ /**
+ 1: 网络阻塞。
+ */
+ ARVideoRemoteStateReasonNetworkCongestion = 1,
+ /**
+ 2: 网络恢复正常。
+ */
+ ARVideoRemoteStateReasonNetworkRecovery = 2,
+ /**
+ 3: 本地用户停止接收远端视频流或本地用户禁用视频模块。
+ */
+ ARVideoRemoteStateReasonLocalMuted = 3,
+ /**
+ 4: 本地用户恢复接收远端视频流或本地用户启动视频模块。
+ */
+ ARVideoRemoteStateReasonLocalUnmuted = 4,
+ /**
+ 5: 远端用户停止发送视频流或远端用户禁用视频模块。
+ */
+ ARVideoRemoteStateReasonRemoteMuted = 5,
+ /**
+ 6: 远端用户恢复发送视频流或远端用户启用视频模块。
+ */
+ ARVideoRemoteStateReasonRemoteUnmuted = 6,
+ /**
+ 7: 远端用户离开频道。
+ */
+ ARVideoRemoteStateReasonRemoteOffline = 7,
+ /**
+ 8: 远端视频流已回退为音频流。
+ */
+ ARVideoRemoteStateReasonAudioFallback = 8,
+ /**
+ 9: 回退的远端音频流恢复为视频流。
+ */
+ ARVideoRemoteStateReasonAudioFallbackRecovery = 9
+};
+
+/** 选择高码率高分辨率视频或低码率低分辨率视频 */
+typedef NS_ENUM(NSInteger, ARVideoStreamType ) {
+ /**
+ 0:高码率、高分辨率视频
+ */
+ ARVideoStreamTypeHigh = 0,
+ /**
+ 1:低码率、低分辨率视频
+ */
+ ARVideoStreamTypeLow = 1,
+};
+
+/** 视频输出方向模式 */
+typedef NS_ENUM(NSInteger, ARVideoOutputOrientationMode ) {
+ /**
+ 0:自适应布局(默认)
+ 该模式下SDK输出的视频方向与采集到的视频方向一致。接收端会根据收到的视频旋转信息对视频进行旋转。该模式适用于接收端可以调整视频方向的场景:
+ * 如果采集的视频是横屏模式,则输出的视频也是横屏模式。
+ * 如果采集的视频是竖屏模式,则输出的视频也是竖屏模式。
+ */
+ ARVideoOutputOrientationModeAdaptative = 0,
+ /**
+ 1:横屏布局
+ 该模式下SDK固定输出人像(横屏)模式的视频。如果采集到的视频是竖屏模式,则视频编码器会对其进行裁剪。该模式适用于当接收端无法调整视频方向时,如使用旁路推流场景下。
+ */
+ ARVideoOutputOrientationModeFixedLandscape = 1,
+ /**
+ 2:竖屏布局
+ 该模式下SDK固定输出人像(竖屏)模式的视频。如果采集到的视频是横屏模式,则视频编码器会对其进行裁剪。该模式适用于当接收端无法调整视频方向时,如使用旁路推流场景下。
+ */
+ ARVideoOutputOrientationModeFixedPortrait = 2,
+};
+
+/** 带宽受限时的视频编码降级偏好 */
+typedef NS_ENUM(NSInteger, ARDegradationPreference) {
+ /**
+ 0:(默认)降低编码帧率以保证视频质量。
+ */
+ ARDegradationMaintainQuality = 0,
+ /**
+ 1:降低视频质量以保证编码帧率。
+ */
+ ARDegradationMaintainFramerate = 1,
+ /**
+ 2:(预留参数,暂不支持)在编码帧率和视频质量之间保持平衡。
+ */
+ ARDegradationBalanced = 2,
+};
+
+/** 视频帧率 */
+typedef NS_ENUM(NSInteger, ARVideoFrameRate) {
+ /**
+ 1 fps.
+ */
+ ARVideoFrameRateFps1 = 1,
+ /**
+ 7 fps.
+ */
+ ARVideoFrameRateFps7 = 7,
+ /**
+ 10 fps.
+ */
+ ARVideoFrameRateFps10 = 10,
+ /**
+ 15 fps.
+ */
+ ARVideoFrameRateFps15 = 15,
+ /**
+ 24 fps.
+ */
+ ARVideoFrameRateFps24 = 24,
+ /**
+ 30 fps.
+ */
+ ARVideoFrameRateFps30 = 30,
+ /**
+ 60 fps (仅支持 macOS).
+ */
+ ARVideoFrameRateFps60 = 60,
+};
+
+/** 本地音频状态 */
+typedef NS_ENUM(NSUInteger, ARAudioLocalState) {
+ /**
+ 0: 本地音频默认初始状态。
+ */
+ ARAudioLocalStateStopped = 0,
+ /**
+ 1: 本地音频录制设备启动成功。
+ */
+ ARAudioLocalStateRecording = 1,
+ /**
+ 2: 本地音频首帧编码成功。
+ */
+ ARAudioLocalStateEncoding = 2,
+ /**
+ 3: 本地音频启动失败。
+ */
+ ARAudioLocalStateFailed = 3,
+};
+
+/** 本地音频出错原因 */
+typedef NS_ENUM(NSUInteger, ARAudioLocalError) {
+ /**
+ 0: 本地音频状态正常。
+ */
+ ARAudioLocalErrorOk = 0,
+ /**
+ 1: 本地音频出错原因不明确。
+ */
+ ARAudioLocalErrorFailure = 1,
+ /**
+ 2: 没有权限启动本地音频录制设备。
+ */
+ ARAudioLocalErrorDeviceNoPermission = 2,
+ /**
+ 3: 本地音频录制设备已经在使用中。
+ */
+ ARAudioLocalErrorDeviceBusy = 3,
+ /**
+ 4: 本地音频录制失败,建议你检查录制设备是否正常工作。
+ */
+ ARAudioLocalErrorRecordFailure = 4,
+ /**
+ 5: 本地音频编码失败。
+ */
+ ARAudioLocalErrorEncodeFailure = 5,
+};
+
+/** 远端音频状态 */
+typedef NS_ENUM(NSUInteger, ARAudioRemoteState) {
+ /**
+ 0: 远端音频流默认初始状态。在 ARAudioRemoteReasonLocalMuted(3)、ARAudioRemoteReasonRemoteMuted(5) 或 ARAudioRemoteReasonRemoteOffline(7) 的情况下,会报告该状态。
+ */
+ ARAudioRemoteStateStopped = 0,
+ /**
+ 1: 本地用户已接收远端音频首包。
+ */
+ ARAudioRemoteStateStarting = 1,
+ /**
+ 2: 远端音频流正在解码,正常播放。在 ARAudioRemoteReasonNetworkRecovery(2)、ARAudioRemoteReasonLocalUnmuted(4) 或 ARAudioRemoteReasonRemoteUnmuted(6) 的情况下,会报告该状态。
+ */
+ ARAudioRemoteStateDecoding = 2,
+ /**
+ 3: 远端音频流卡顿。在 ARAudioRemoteReasonNetworkCongestion(1) 的情况下,会报告该状态。
+ */
+ ARAudioRemoteStateFrozen = 3,
+ /**
+ 4: 远端音频流播放失败。在 ARAudioRemoteReasonInternal(0) 的情况下,会报告该状态。
+ */
+ ARAudioRemoteStateFailed = 4,
+};
+
+/** 远端音频流状态改变的具体原因 */
+typedef NS_ENUM(NSUInteger, ARAudioRemoteStateReason) {
+ /**
+ 0: 内部原因。
+ */
+ ARAudioRemoteReasonInternal = 0,
+ /**
+ 1: 网络阻塞。
+ */
+ ARAudioRemoteReasonNetworkCongestion = 1,
+ /**
+ 2: 网络恢复正常。
+ */
+ ARAudioRemoteReasonNetworkRecovery = 2,
+ /**
+ 3: 本地用户停止接收远端音频流或本地用户禁用音频模块。
+ */
+ ARAudioRemoteReasonLocalMuted = 3,
+ /**
+ 4: 本地用户恢复接收远端音频流或本地用户启用音频模块。
+ */
+ ARAudioRemoteReasonLocalUnmuted = 4,
+ /**
+ 5: 远端用户停止发送音频流或远端用户禁用音频模块。
+ */
+ ARAudioRemoteReasonRemoteMuted = 5,
+ /**
+ 6: 远端用户恢复发送音频流或远端用户启用音频模块。
+ */
+ ARAudioRemoteReasonRemoteUnmuted = 6,
+ /**
+ 7: 远端用户离开频道。
+ */
+ ARAudioRemoteReasonRemoteOffline = 7,
+};
+
+/** 本地视频状态 */
+typedef NS_ENUM(NSInteger, ARLocalVideoStreamState) {
+ /**
+ 0: 本地视频默认初始状态。
+ */
+ ARLocalVideoStreamStateStopped = 0,
+ /**
+ 1: 本地视频采集设备启动成功。
+ */
+ ARLocalVideoStreamStateCapturing = 1,
+ /**
+ 2: 本地视频首帧编码成功。
+ */
+ ARLocalVideoStreamStateEncoding = 2,
+ /**
+ 3: 本地视频启动失败。
+ */
+ ARLocalVideoStreamStateFailed = 3,
+};
+
+/** 本地视频出错原因 */
+typedef NS_ENUM(NSInteger, ARLocalVideoStreamError) {
+ /**
+ 0: 本地视频状态正常。
+ */
+ ARLocalVideoStreamErrorOK = 0,
+ /**
+ 1: 出错原因不明确。
+ */
+ ARLocalVideoStreamErrorFailure = 1,
+ /**
+ 2: 没有权限启动本地视频采集设备。
+ */
+ ARLocalVideoStreamErrorDeviceNoPermission = 2,
+ /**
+ 3: 本地视频采集设备正在使用中。
+ */
+ ARLocalVideoStreamErrorDeviceBusy = 3,
+ /**
+ 4: 本地视频采集失败,建议检查采集设备是否正常工作。
+ */
+ ARLocalVideoStreamErrorCaptureFailure = 4,
+ /**
+ 5: 本地视频编码失败。
+ */
+ ARLocalVideoStreamErrorEncodeFailure = 5,
+ /**
+ 6: (仅适用于 iOS)应用处于后台
+
+ @since v4.2.0
+ */
+ ARLocalVideoStreamErrorCaptureInBackGround = 6,
+ /**
+ 7: (仅支持 iOS) 应用窗口处于侧拉、分屏、画中画模式。
+
+ @since v4.2.0
+ */
+ ARLocalVideoStreamErrorCaptureMultipleForegroundApps = 7,
+ /**
+ 11:(仅支持 macOS)调用 startScreenCaptureByWindowId 方法共享窗口时, 共享窗口处于最小化的状态。
+
+ @since v4.2.0
+ */
+ ARLocalVideoStreamErrorScreenCaptureWindowMinimized = 11,
+ /**
+ 12:(仅支持 macOS)该错误码表示通过窗口 ID 共享的窗口已关闭,或通过窗口 ID 共享的全屏窗口已退出全屏。退出全屏模式后,远端用户将无法看到共享的窗口。为避免远端用户看到黑屏,Agora 建议你立即结束本次共享。
+
+ @since v4.2.0
+ */
+ ARLocalVideoStreamErrorScreenCaptureWindowClosed = 12
+};
+
+/** 摄像头采集偏好 */
+typedef NS_ENUM(NSInteger, ARCameraCaptureOutputPreference) {
+ /**
+ 0:(默认)自动调整采集参数。SDK 根据实际的采集设备性能及网络情况,选择合适的摄像头输出参数,在设备性能及视频预览质量之间,维持平衡。
+ */
+ ARCameraCaptureOutputPreferenceAuto = 0,
+ /**
+ 1:优先保证设备性能。SDK 根据用户在 setVideoEncoderConfiguration 中设置编码器的分辨率和帧率,选择最接近的摄像头输出参数,从而保证设备性能。在这种情况下,预览质量接近于编码器的输出质量*/
+ ARCameraCaptureOutputPreferencePerformance = 1,
+ /**
+ 2:优先保证视频预览质量。SDK 选择较高的摄像头输出参数,从而提高预览视频的质量。在这种情况下,会消耗更多的 CPU 及内存做视频前处理。
+ */
+ ARCameraCaptureOutputPreferencePreview = 2,
+ /**
+ 3:仅供内部使用
+ */
+ ARCameraCaptureOutputPreferenceUnkown = 3
+};
+
+#if TARGET_OS_IOS
+/** 摄像头方向 */
+typedef NS_ENUM(NSInteger, ARCameraDirection) {
+ /**
+ 0:使用后置摄像头
+ */
+ ARCameraDirectionRear = 0,
+ /**
+ 1:使用前置摄像头
+ */
+ ARCameraDirectionFront = 1,
+};
+#endif
+
+/** 语音路由 */
+typedef NS_ENUM(NSInteger, ARAudioOutputRouting) {
+ /**
+ -1:使用默认的语音路由
+ */
+ ARAudioOutputRoutingDefault = -1,
+ /**
+ 0:使用耳机为语音路由
+ */
+ ARAudioOutputRoutingHeadset = 0,
+ /**
+ 1:使用听筒为语音路由
+ */
+ ARAudioOutputRoutingEarpiece = 1,
+ /**
+ 2:使用不带麦的耳机为语音路由
+ */
+ ARAudioOutputRoutingHeadsetNoMic = 2,
+ /**
+ 3:使用手机的扬声器为语音路由
+ */
+ ARAudioOutputRoutingSpeakerphone = 3,
+ /**
+ 4:使用外接的扬声器为语音路由
+ */
+ ARAudioOutputRoutingLoudspeaker = 4,
+ /**
+ 5:使用蓝牙耳机为语音路由
+ */
+ ARAudioOutputRoutingHeadsetBluetooth = 5
+};
+
+/** 引起网络连接状态发生改变的原因 */
+typedef NS_ENUM(NSUInteger, ARConnectionChangedReason) {
+ /**
+ 0: 建立网络连接中。
+ */
+ ARConnectionChangedConnecting = 0,
+ /**
+ 1: 成功加入频道。
+ */
+ ARConnectionChangedJoinSuccess = 1,
+ /**
+ 2: 网络连接中断。
+ */
+ ARConnectionChangedInterrupted = 2,
+ /**
+ 3: 网络连接被服务器禁止。
+ */
+ ARConnectionChangedBannedByServer = 3,
+ /**
+ 4: 加入频道失败。SDK 在尝试加入频道 20 分钟后还是没能加入频道,会返回该状态,并停止尝试重连。
+ */
+ ARConnectionChangedJoinFailed = 4,
+ /**
+ 5: 离开频道。
+ */
+ ARConnectionChangedLeaveChannel = 5,
+ /**
+ 6: 不是有效的 APP ID。请更换有效的 APP ID 重新加入频道。
+ */
+ ARConnectionChangedInvalidAppId = 6,
+ /**
+ 7: 不是有效的频道名。请更换有效的频道名重新加入频道。
+ */
+ ARConnectionChangedInvalidChannelName = 7,
+ /**
+ 8: 生成的 Token 无效。一般有以下原因:
+ * 在控制台上启用了 App Certificate,但加入频道未使用 Token。当启用了 App Certificate,必须使用 Token。
+ * 在调用 joinChannelByToken 加入频道时指定的 uid 与生成 Token 时传入的 uid 不一致。
+ */
+ ARConnectionChangedInvalidToken = 8,
+ /**
+ 9: 当前使用的 Token 过期,不再有效,需要重新在你的服务端申请生成 Token。
+ */
+ ARConnectionChangedTokenExpired = 9,
+ /**
+ 10: 此用户被服务器禁止。
+ */
+ ARConnectionChangedRejectedByServer = 10,
+ /**
+ 11: 由于设置了代理服务器,SDK 尝试重连。
+ */
+ ARConnectionChangedSettingProxyServer = 11,
+ /**
+ 12: 更新 Token 引起网络连接状态改变。
+ */
+ ARConnectionChangedRenewToken = 12,
+ /**
+ 13: 客户端 IP 地址变更,可能是由于网络类型,或网络运营商的 IP 或端口发生改变引起。
+ */
+ ARConnectionChangedClientIpAddressChanged = 13,
+ /**
+ 14: SDK 和服务器连接保活超时,进入自动重连状态 ARConnectionStateReconnecting(4).
+ */
+ ARConnectionChangedKeepAliveTimeout = 14,
+};
+
+/** 日志过滤分级 */
+typedef NS_ENUM(NSUInteger, ARLogFilter) {
+ /**
+ 不输出日志信息
+ */
+ ARLogFilterOff = 0,
+ /**
+ 输出所有 API 日志信息。如果你想获取最完整的日志,可以将日志级别设为该等级。
+ */
+ ARLogFilterDebug = 0x080f,
+ /**
+ 输出 CRITICAL、ERROR、WARNING 和 INFO 级别的日志信息。我们推荐你将日志级别设为该等级。
+ */
+ ARLogFilterInfo = 0x000f,
+ /**
+ 输出 CRITICAL、ERROR 和 WARNING 级别的日志信息
+ */
+ ARLogFilterWarning = 0x000e,
+ /**
+ 输出 CRITICAL 和 ERROR 级别的日志信息
+ */
+ ARLogFilterError = 0x000c,
+ /**
+ 输出 CRITICAL 级别的日志信息
+ */
+ ARLogFilterCritical = 0x0008,
+};
+
+/** 远端用户的需求优先级。如果将某个用户的优先级设为高,那么发给这个用户的音视频流的优先级就会高于其他用户。 */
+typedef NS_ENUM(NSInteger, ARUserPriority ) {
+ /**
+ 50:用户需求优先级为高
+ */
+ ARUserPriorityHigh = 50,
+ /**
+ 100:(默认)用户需求优先级为正常
+ */
+ ARUserPriorityNormal = 100,
+};
+
+/** 音视频流回退处理选项 */
+typedef NS_ENUM(NSInteger, ARStreamFallbackOptions ) {
+ /**
+ 0:上行/下行网络较弱时,不对音视频流作回退处理,但不能保证音视频流的质量。
+ */
+ ARStreamFallbackOptionDisabled = 0,
+ /**
+ 1:在下行网络条件较差的情况下,SDK 将接收视频小流(低分辨率、低码率视频流)。此选项仅适用于 setRemoteSubscribeFallbackOption。
+ */
+ ARStreamFallbackOptionVideoStreamLow = 1,
+ /**
+ 2:上行网络较弱时,只发布音频流;下行网络较弱时,先尝试只接收视频小流(低分辨率、低码率视频流),如果网络环境无法显示视频,则再回退到只接收音频流。
+ */
+ ARStreamFallbackOptionAudioOnly = 2,
+};
+
+/** 视频的编码类型 */
+typedef NS_ENUM(NSInteger, ARVideoCodecType) {
+ /**
+ 1: VP8.
+ */
+ ARVideoCodecTypeVP8 = 1,
+ /**
+ 2: (默认值)H.264。
+ */
+ ARVideoCodecTypeH264 = 2,
+ /**
+ 3: EVP
+ */
+ ARVideoCodecTypeEVP = 3,
+ /**
+ 4: E264
+ */
+ ARVideoCodecTypeE264 = 4,
+};
+
+/** 自上次统计后本地视频质量的自适应情况(基于目标帧率和目标码率) */
+typedef NS_ENUM(NSInteger, ARVideoQualityAdaptIndication) {
+ /**
+ 0:本地视频质量不变
+ */
+ ARVideoQualityAdaptNone = 0,
+ /**
+ 1:因网络带宽增加,本地视频质量改善
+ */
+ ARVideoQualityAdaptUpBandwidth = 1,
+ /**
+ 2:因网络带宽减少,本地视频质量变差
+ */
+ ARVideoQualityAdaptDownBandwidth = 2,
+};
+
+/** 网络质量 */
+typedef NS_ENUM(NSUInteger, ARNetworkQuality) {
+ /**
+ 0:网络质量未知
+ */
+ ARNetworkQualityUnknown = 0,
+ /**
+ 1:网络质量极好
+ */
+ ARNetworkQualityExcellent = 1,
+ /**
+ 2:用户主观感觉和 excellent 差不多,但码率可能略低于 excellent
+ */
+ ARNetworkQualityGood = 2,
+ /**
+ 3:用户主观感受有瑕疵但不影响沟通
+ */
+ ARNetworkQualityPoor = 3,
+ /**
+ 4:勉强能沟通但不顺畅
+ */
+ ARNetworkQualityBad = 4,
+ /**
+ 5:网络质量非常差,基本不能沟通
+ */
+ ARNetworkQualityVBad = 5,
+ /**
+ 6:网络连接已断开,完全无法沟通
+ */
+ ARNetworkQualityDown = 6,
+ /**
+ 7:网络质量探测功能不可使用 (目前没有使用)
+ */
+ ARNetworkQualityUnsupported = 7,
+ /**
+ 8:网络质量探测中
+ */
+ ARNetworkQualityDetecting = 8,
+};
+
+/** 视频buffer */
+typedef NS_ENUM(NSInteger, ARVideoBufferType ) {
+ /**
+ 1:pixelbuffer
+ */
+ ARVideoBufferTypePixelBuffer = 1,
+ /**
+ 2:rawdata
+ */
+ ARVideoBufferTypeRawData = 2,
+};
+
+/** 音频采集类型 */
+typedef NS_ENUM(NSInteger, ARAudioType) {
+ /**
+ 1:音频由App产生
+ */
+ ARAudioTypeApp = 1,
+ /**
+ 2:音频由麦克风产生
+ */
+ ARAudioTypeMic = 2,
+};
+
+/** 录音音质 */
+typedef NS_ENUM(NSInteger, ARAudioRecordingQuality) {
+ /**
+ 低音质。采样率为 32 KHz,录制 10 分钟的文件大小为 1.2 M 左右
+ */
+ ARAudioRecordingQualityLow = 0,
+ /**
+ 中音质。采样率为 32 KHz,录制 10 分钟的文件大小为 2 M 左右
+ */
+ ARAudioRecordingQualityMedium = 1,
+ /**
+ 高音质。采样率为 32 KHz,录制 10 分钟的文件大小为 3.75 M 左右
+ */
+ ARAudioRecordingQualityHigh = 2
+};
+
+/** 音频的采样率 */
+typedef NS_ENUM(NSInteger, ARAudioSampleRateType) {
+ /** 32 kHz. */
+ ARAudioSampleRateType32000 = 32000,
+ /** 44.1 kHz. */
+ ARAudioSampleRateType44100 = 44100,
+ /** 48 kHz. */
+ ARAudioSampleRateType48000 = 48000,
+};
+
+/** 导入的外部视频源状态 */
+typedef NS_ENUM(NSUInteger, ARInjectStreamStatus) {
+ /** 外部视频流导入成功 */
+ ARInjectStreamStatusStartSuccess = 0,
+ /** 外部视频流已存在 */
+ ARInjectStreamStatusStartAlreadyExists = 1,
+ /** 外部视频流导入未经授权 */
+ ARInjectStreamStatusStartUnauthorized = 2,
+ /** 导入外部视频流超时 */
+ ARInjectStreamStatusStartTimedout = 3,
+ /** 外部视频流导入失败*/
+ ARInjectStreamStatusStartFailed = 4,
+ /** 外部视频流停止导入成功 */
+ ARInjectStreamStatusStopSuccess = 5,
+ /** 未找到要停止导入的外部视频流 */
+ ARInjectStreamStatusStopNotFound = 6,
+ /** 要停止导入的外部视频流未经授权*/
+ ARInjectStreamStatusStopUnauthorized = 7,
+ /** 停止导入外部视频流超时 */
+ ARInjectStreamStatusStopTimedout = 8,
+ /** 停止导入外部视频流失败 */
+ ARInjectStreamStatusStopFailed = 9,
+ /** 导入的外部视频流被中断*/
+ ARInjectStreamStatusBroken = 10,
+};
+
+/** 跨频道媒体流转发状态码
+ */
+typedef NS_ENUM(NSInteger, ARChannelMediaRelayState) {
+ /** 0: SDK 正在初始化。
+ */
+ ARChannelMediaRelayStateIdle = 0,
+ /** 1: SDK 尝试跨频道。
+ */
+ ARChannelMediaRelayStateConnecting = 1,
+ /** 2: 源频道主播成功加入目标频道。
+ */
+ ARChannelMediaRelayStateRunning = 2,
+ /** 3: 发生异常,详见 error 中提示的错误信息。
+ */
+ ARChannelMediaRelayStateFailure = 3,
+};
+
+/** 跨频道媒体流转发事件码
+ */
+typedef NS_ENUM(NSInteger, ARChannelMediaRelayEvent) {
+ /** 0: 网络中断导致用户与服务器连接断开。
+ */
+ ARChannelMediaRelayEventDisconnect = 0,
+ /** 1: 用户与服务器建立连接。
+ */
+ ARChannelMediaRelayEventConnected = 1,
+ /** 2: 用户已加入源频道。
+ */
+ ARChannelMediaRelayEventJoinedSourceChannel = 2,
+ /** 3: 用户已加入目标频道。
+ */
+ ARChannelMediaRelayEventJoinedDestinationChannel = 3,
+ /** 4: SDK 开始向目标频道发送数据包。
+ */
+ ARChannelMediaRelayEventSentToDestinationChannel = 4,
+ /** 5: 服务器收到了目标频道发送的视频流。
+ */
+ ARChannelMediaRelayEventReceivedVideoPacketFromSource = 5,
+ /** 6: 服务器收到了目标频道发送的音频流。
+ */
+ ARChannelMediaRelayEventReceivedAudioPacketFromSource = 6,
+ /** 7: 目标频道已更新。
+ */
+ ARChannelMediaRelayEventUpdateDestinationChannel = 7,
+ /** 8: 内部原因导致目标频道更新失败。
+ */
+ ARChannelMediaRelayEventUpdateDestinationChannelRefused = 8,
+ /** 9: 目标频道未发生改变,即目标频道更新失败。
+ */
+ ARChannelMediaRelayEventUpdateDestinationChannelNotChange = 9,
+ /** 10: 目标频道名为 NULL。
+ */
+ ARChannelMediaRelayEventUpdateDestinationChannelIsNil = 10,
+ /** 11: 视频属性已发送至服务器。
+ */
+ ARChannelMediaRelayEventVideoProfileUpdate = 11,
+};
+
+/** 跨频道媒体流转发出错的错误码
+ */
+typedef NS_ENUM(NSInteger, ARChannelMediaRelayError) {
+ /** 0: 一切正常。
+ */
+ ARChannelMediaRelayErrorNone = 0,
+ /** 1: 服务器回应出错。
+ */
+ ARChannelMediaRelayErrorServerErrorResponse = 1,
+ /** 2: 服务器无回应。你可以调用 leaveChannel 方法离开频道。
+ */
+ ARChannelMediaRelayErrorServerNoResponse = 2,
+ /** 3: SDK 无法获取服务,可能是因为服务器资源有限导致。
+ */
+ ARChannelMediaRelayErrorNoResourceAvailable = 3,
+ /** 4: 发起跨频道转发媒体流请求失败。
+ */
+ ARChannelMediaRelayErrorFailedJoinSourceChannel = 4,
+ /** 5: 接受跨频道转发媒体流请求失败。
+ */
+ ARChannelMediaRelayErrorFailedJoinDestinationChannel = 5,
+ /** 6: 服务器接收跨频道转发媒体流失败。
+ */
+ ARChannelMediaRelayErrorFailedPacketReceivedFromSource = 6,
+ /** 7: 服务器发送跨频道转发媒体流失败。
+ */
+ ARChannelMediaRelayErrorFailedPacketSentToDestination = 7,
+ /** 8: SDK 因网络质量不佳与服务器断开。你可以调用 leaveChannel 方法离开当前频道。
+ */
+ ARChannelMediaRelayErrorServerConnectionLost = 8,
+ /** 9: 服务器内部出错。
+ */
+ ARChannelMediaRelayErrorInternalError = 9,
+ /** 10: 源频道的 Token 已过期。
+ */
+ ARChannelMediaRelayErrorSourceTokenExpired = 10,
+ /** 11: 目标频道的 Token 已过期。
+ */
+ ARChannelMediaRelayErrorDestinationTokenExpired = 11,
+};
+
+/** 发布状态 */
+typedef NS_ENUM(NSUInteger, ARStreamPublishState) {
+ /** 0: 加入频道后的初始发布状态。
+ */
+ ARStreamPublishIdle = 0,
+ /** 1: 发布失败。可能是因为:
+ - 本地用户调用 muteLocalAudioStream(YES) 或 muteLocalVideoStream(YES) 停止发送本地媒体流。
+ - 本地用户调用 disableAudio 或 disableVideo 关闭本地音频或视频模块。
+ - 本地用户调用 enableLocalAudio(NO) 或 enableLocalVideo(NO) 关闭本地音频或视频采集。
+ - 本地用户角色为观众。
+ */
+ ARStreamPublishNoPublished = 1,
+ /** 2: 正在发布。
+ */
+ ARStreamPublishPublishing = 2,
+ /** 3: 发布成功。
+ */
+ ARStreamPublishPublished = 3,
+};
+
+/** 订阅状态。 */
+typedef NS_ENUM(NSUInteger, ARStreamSubscribeState) {
+ /** 0: 加入频道后的初始订阅状态。
+ */
+ ARStreamSubscribeIdle = 0,
+ /** 1: 订阅失败。可能是因为:
+
+ - 远端用户:
+ - 调用 muteLocalAudioStream(YES) 或 muteLocalVideoStream(YES) 停止发送本地媒体流。
+ - 调用 disableAudio 或 disableVideo 关闭本地音频或视频模块。
+ - 调用 enableLocalAudio(NO) 或 enableLocalVideo(NO) 关闭本地音频或视频采集。
+ - 用户角色为观众。
+ - 本地用户调用以下方法停止接收远端媒体流:
+ - 调用 muteRemoteAudioStream(YES)、muteAllRemoteAudioStreams(YES) 或 setDefaultMuteAllRemoteAudioStreams(YES) 停止接收远端音频流。
+ - 调用 muteRemoteVideoStream(YES)、muteAllRemoteVideoStreams(YES) 或 setDefaultMuteAllRemoteVideoStreams(YES) 停止接收远端视频流。
+ */
+ ARStreamSubscribeNoSubscribed = 1,
+ /** 2: 正在订阅。
+ */
+ ARStreamSubscribeSubscribing = 2,
+ /** 3: 收到了远端流,订阅成功。
+ */
+ ARStreamSubscribeSubscribed = 3,
+};
+
+/** 用于旁路直播的输出视频的编解码规格 */
+typedef NS_ENUM(NSInteger, ARVideoCodecProfileType) {
+ /** 66:Baseline 级别的视频编码规格,一般用于低阶或需要额外容错的应用,比如视频通话、手机视频等。 */
+ ARVideoCodecProfileTypeBaseLine = 66,
+ /** 77:Main 级别的视频编码规格,一般用于主流消费类电子产品,如 mp4、便携的视频播放器、PSP 和 iPad 等。 */
+ ARVideoCodecProfileTypeMain = 77,
+ /** 100:(默认)High 级别的视频编码规格,一般用于广播及视频碟片存储,高清电视。 */
+ ARVideoCodecProfileTypeHigh = 100
+};
+
+/** 音频编码规格 */
+typedef NS_ENUM(NSInteger, ARAudioCodecProfileType) {
+ /** 0: (默认) LC-AAC 规格,表示基本音频编码规格。 */
+ ARAudioCodecProfileLCAAC = 0,
+ /** 1: HE-AAC 规格,表示高效音频编码规格。 */
+ ARAudioCodecProfileHEAAC = 1
+};
+
+/** 推流错误信息 */
+typedef NS_ENUM(NSUInteger, ARtmpStreamingErrorCode) {
+ /** 推流成功 */
+ ARtmpStreamingErrorCodeOK = 0,
+ /** 参数无效。请检查输入参数是否正确。例如如果你在调用 addPublishStreamUrl 前没有调用 setLiveTranscoding 设置转码参数,SDK 会返回该错误。 */
+ ARtmpStreamingErrorCodeInvalidParameters = 1,
+ /** 推流已加密,不能推流。*/
+ ARtmpStreamingErrorCodeEncryptedStreamNotAllowed = 2,
+ /** 推流超时未成功。可调用 addPublishStreamUrl 重新推流。 */
+ ARtmpStreamingErrorCodeConnectionTimeout = 3,
+ /** 推流服务器出现错误。请调用 addPublishStreamUrl 重新推流。 */
+ ARtmpStreamingErrorCodeInternalServerError = 4,
+ /** RTMP 服务器出现错误。 */
+ ARtmpStreamingErrorCodeRtmpServerError = 5,
+ /** 推流请求过于频繁。*/
+ ARtmpStreamingErrorCodeTooOften = 6,
+ /** 单个主播的推流地址数目达到上线 10。请删掉一些不用的推流地址再增加推流地址。*/
+ ARtmpStreamingErrorCodeReachLimit = 7,
+ /** 主播操作不属于自己的流。例如更新其他主播的流参数、停止其他主播的流。请检查 App 逻辑。*/
+ ARtmpStreamingErrorCodeNotAuthorized = 8,
+ /** 服务器未找到这个流。 */
+ ARtmpStreamingErrorCodeStreamNotFound = 9,
+ /** 推流地址格式有错误。请检查推流地址格式是否正确。*/
+ ARtmpStreamingErrorCodeFormatNotSupported = 10,
+};
+
+/** RTMP 推流时发生的事件。*/
+typedef NS_ENUM(NSUInteger, ARtmpStreamingEvent) {
+ /** RTMP 推流时,添加背景图或水印出错。*/
+ ARtmpStreamingEventFailedLoadImage = 1,
+};
+
+/** 推流状态 */
+typedef NS_ENUM(NSUInteger, ARtmpStreamingState) {
+ /** 推流未开始或已结束。成功调用 removePublishStreamUrl 方法删除推流地址后,也会返回该状态。*/
+ ARtmpStreamingStateIdle = 0,
+ /** 正在连接推流服务器和 RTMP 服务器。调用 addPublishStreamUrl 方法后,会返回该状态。 */
+ ARtmpStreamingStateConnecting = 1,
+ /** 推流正在进行。成功推流后,会返回该状态*/
+ ARtmpStreamingStateRunning = 2,
+ /** 正在恢复推流。当 CDN 出现异常,或推流短暂中断时,SDK 会自动尝试恢复推流,并返回该状态。
+
+ - 如成功恢复推流,则进入状态 ARtmpStreamingStateRunning(2)。
+ 如服务器出错或 60 秒内未成功恢复,则进入状态 ARtmpStreamingStateFailure(4)。如果觉得 60 秒太长,也可以主动调用 removePublishStreamUrl 和 addPublishStreamUrl 方法尝试重连。
+ */
+ ARtmpStreamingStateRecovering = 3,
+ /** 推流失败。失败后,你可以通过返回的错误码排查错误原因,也可以再次调用 addPublishStreamUrl 重新尝试推流。 */
+ ARtmpStreamingStateFailure = 4,
+};
+
+/** Last mile 质量探测结果的状态 */
+typedef NS_ENUM(NSUInteger, ARLastmileProbeResultState) {
+ /** 1: 表示本次 last mile 质量探测的结果是完整的 */
+ ARLastmileProbeResultComplete = 1,
+ /** 2: 表示本次 last mile 质量探测未进行带宽预测,因此结果不完整。一个可能的原因是测试资源暂时受限。*/
+ ARLastmileProbeResultIncompleteNoBwe = 2,
+ /** 3: 未进行 last mile 质量探测。一个可能的原因是网络连接中断。 */
+ ARLastmileProbeResultUnavailable = 3,
+};
+
+/** 屏幕共享的内容类型 */
+typedef NS_ENUM(NSUInteger, ARVideoContentHint) {
+ /** 0:(默认)无指定的内容类型 */
+ ARVideoContentHintNone = 0,
+ /** 1: 内容类型为动画。当共享的内容是视频、电影或视频游戏时,推荐选择该内容类型。 */
+ ARVideoContentHintMotion = 1,
+ /** 2: 内容类型为细节。当共享的内容是图片或文字时,推荐选择该内容类型。 */
+ ARVideoContentHintDetails = 2,
+};
+
+/** 媒体设备类型. */
+typedef NS_ENUM(NSInteger, ARMediaDeviceType) {
+ /** 未知设备 */
+ ARMediaDeviceTypeAudioUnknown = -1,
+ /** 音频播放设备 */
+ ARMediaDeviceTypeAudioPlayout = 0,
+ /** 音频采集设备 */
+ ARMediaDeviceTypeAudioRecording = 1,
+ /** 视频渲染设备 */
+ ARMediaDeviceTypeVideoRender = 2,
+ /** 视频采集设备 */
+ ARMediaDeviceTypeVideoCapture = 3,
+};
+
+/**
+推流模式。
+ */
+typedef NS_ENUM(NSInteger, ARStreamPushMode) {
+ /**
+ 0: 音频
+ */
+ ARStreamPushModeAudMix = 0,
+ /**
+ 1: 视频。
+ */
+ ARStreamPushModeVidMix = 1
+};
+
+/**
+推流状态。
+ */
+typedef NS_ENUM(NSInteger, ARStreamPushState) {
+ /**
+ 0: 连建立网络连接中
+ */
+ ARStreamPushStateConnecting = 0,
+ /**
+ 1: 连接失败
+ */
+ ARStreamPushStateLostConnection = 1,
+ /**
+ 1: 重连中。
+ */
+ ARStreamPushStateReConnecting = 2,
+ /**
+ 1: 连接失败。
+ */
+ ARStreamPushStateFailed = 3
+};
+
+/**
+推流原因。
+ */
+typedef NS_ENUM(NSInteger, ARStreamPushReason) {
+ /**
+ 0: 推流正常
+ */
+ ARStreamPushReasonOK = 0,
+ /**
+ 1: 网络原因。
+ */
+ ARStreamPushReasonNetwork = 1,
+ /**
+ 2: 推流超时
+ */
+ ARStreamPushReasonTimeout = 2,
+ /**
+ 3: 推流身份
+ */
+ ARStreamPushReasonAuth = 3
+};
+
+/**
+用于直播推流的输出视频的编码规格
+ */
+typedef NS_ENUM(NSInteger, ARStreamVideoCodeProfileType) {
+ /**
+ 66: Baseline 级别的视频编码规格,一般用于低阶或需要额外容错的应用,比如视频通话、手机视频等。
+ */
+ ARStreamVideoCodeProfileTypeBaseline = 66,
+ /**
+ 77: Main 级别的视频编码规格,一般用于主流消费类电子产品,如 mp4、便携的视频播放器、PSP 和 iPad 等
+ */
+ ARStreamVideoCodeProfileTypeMain = 77,
+ /**
+ 100(默认): High 级别的视频编码规格,一般用于广播及视频碟片存储,高清电视。
+ */
+ ARStreamVideoCodeProfileTypehigh = 100
+};
+
+/**
+音频的采样率
+ */
+typedef NS_ENUM(NSInteger, ARStreamAudioSampleRateType) {
+ /**
+ 32 kHz
+ */
+ ARStreamAudioSampleRateType32000 = 32000,
+ /**
+ 44.1 kHz
+ */
+ ARStreamAudioSampleRateType44100 = 44100,
+ /**
+ 48 kHz
+ */
+ ARStreamAudioSampleRateType48000 = 48000
+};
+
+/**
+音频编码规格
+ */
+typedef NS_ENUM(NSInteger, ARStreamAudioCodecProfileType) {
+ /**
+ 0:LC-AAC 规格,表示基本音频编码规格。
+ */
+ ARStreamAudioCodecProfileLCAAC = 0,
+ /**
+ 1:HE-AAC 规格,表示高效音频编码规格。
+ */
+ ARStreamAudioCodecProfileHEAAC = 1
+};
+
+/** 加密模式 */
+typedef NS_ENUM(NSInteger, AREncryptionMode) {
+ /* OpenSSL Encryption Mode Start */
+ /** 1: (默认)128 位 AES 加密,XTS 模式。 */
+ AREncryptionModeAES128XTS = 1,
+ /** 2: 128 位 AES 加密,ECB 模式。 */
+ AREncryptionModeAES128ECB = 2,
+ /** 3: 256 位 AES 加密,XTS 模式。 */
+ AREncryptionModeAES256XTS = 3,
+ /* OpenSSL Encryption Mode End */
+
+ /** 4: 128 位 SM4 加密,ECB 模式。*/
+ AREncryptionModeSM4128ECB = 4,
+ /** 枚举值边界 */
+ AREncryptionModeEnd,
+};
+
+/** 语音音效均衡波段的中心频率 */
+typedef NS_ENUM(NSInteger, ARAudioEqualizationBandFrequency) {
+ /** 31 Hz. */
+ ARAudioEqualizationBand31 = 0,
+ /** 62 Hz. */
+ ARAudioEqualizationBand62 = 1,
+ /** 125 Hz. */
+ ARAudioEqualizationBand125 = 2,
+ /** 250 Hz. */
+ ARAudioEqualizationBand250 = 3,
+ /** 500 Hz */
+ ARAudioEqualizationBand500 = 4,
+ /** 1 kHz. */
+ ARAudioEqualizationBand1K = 5,
+ /** 2 kHz. */
+ ARAudioEqualizationBand2K = 6,
+ /** 4 kHz. */
+ ARAudioEqualizationBand4K = 7,
+ /** 8 kHz. */
+ ARAudioEqualizationBand8K = 8,
+ /** 16 kHz. */
+ ARAudioEqualizationBand16K = 9,
+};
+
+/** 音频混响类型 */
+typedef NS_ENUM(NSInteger, ARAudioReverbType) {
+ /** 原始音频强度,即所谓的 dry signal,取值范围 [-20,10],单位为 dB */
+ ARAudioReverbDryLevel = 0,
+ /** 早期反射信号强度,即所谓的 wet signal,取值范围 [-20,10],单位为 dB */
+ ARAudioReverbWetLevel = 1,
+ /** 所需混响效果的房间尺寸,一般房间越大,混响越强,取值范围 [0,100] */
+ ARAudioReverbRoomSize = 2,
+ /** wet signal 的初始延迟长度,取值范围 [0,200],单位为 ms*/
+ ARAudioReverbWetDelay = 3,
+ /** 混响持续的强度,取值范围 [0,100] */
+ ARAudioReverbStrength = 4,
+};
+
+/** 本地语音变声、美音或语聊美声效果选项 */
+typedef NS_ENUM(NSInteger, ARAudioVoiceChanger) {
+ /** 原声,即关闭本地语音的变声、美音或语聊美声效果。*/
+ ARAudioVoiceChangerOff = 0x00000000,
+ /** 变声:老年男性 */
+ ARAudioVoiceChangerOldMan = 0x00000001,
+ /** 变声:小男孩 */
+ ARAudioVoiceChangerBabyBoy = 0x00000002,
+ /** 变声:小女孩 */
+ ARAudioVoiceChangerBabyGirl = 0x00000003,
+ /** 变声:猪八戒 */
+ ARAudioVoiceChangerZhuBaJie = 0x00000004,
+ /** 变声:空灵 */
+ ARAudioVoiceChangerEthereal = 0x00000005,
+ /** 变声:绿巨人 */
+ ARAudioVoiceChangerHulk = 0x00000006,
+ /** 美音:浑厚 */
+ ARAudioVoiceBeautyVigorous = 0x00100001,
+ /** 美音:低沉 */
+ ARAudioVoiceBeautyDeep = 0x00100002,
+ /** 美音:圆润 */
+ ARAudioVoiceBeautyMellow = 0x00100003,
+ /** 美音:假音 */
+ ARAudioVoiceBeautyFalsetto = 0x00100004,
+ /** 美音:饱满 */
+ ARAudioVoiceBeautyFull = 0x00100005,
+ /** 美音:清澈 */
+ ARAudioVoiceBeautyClear = 0x00100006,
+ /** 美音:高亢 */
+ ARAudioVoiceBeautyResounding = 0x00100007,
+ /** 美音:嘹亮 */
+ ARAudioVoiceBeautyRinging = 0x00100008,
+ /** 美音:空旷 */
+ ARAudioVoiceBeautySpacial = 0x00100009,
+ /** 语聊美声:磁性(男)。此枚举为男声定制化效果,不适用于女声。若女声使用此音效设置,则音频可能会产生失真。 */
+ ARAudioGeneralBeautyVoiceMaleMagnetic = 0x00200001,
+ /** 语聊美声:清新(女)。此枚举为女声定制化效果,不适用于男声。若男声使用此音效设置,则音频可能会产生失真。*/
+ ARAudioGeneralBeautyVoiceFemaleFresh = 0x00200002,
+ /** 语聊美声:活力(女)。此枚举为女声定制化效果,不适用于男声。若男声使用此音效设置,则音频可能会产生失真。 */
+ ARAudioGeneralBeautyVoiceFemaleVitality = 0x00200003,
+};
+
+/** 本地语音混响选项 */
+typedef NS_ENUM(NSInteger, ARAudioReverbPreset) {
+ /** 原声,即关闭本地语音混响。*/
+ ARAudioReverbPresetOff = 0x00000000,
+ /** KTV(增强版) */
+ ARAudioReverbPresetFxKTV = 0x00100001,
+ /** 演唱会(增强版)*/
+ ARAudioReverbPresetFxVocalConcert = 0x00100002,
+ /** 大叔 */
+ ARAudioReverbPresetFxUncle = 0x00100003,
+ /** 小姐姐 */
+ ARAudioReverbPresetFxSister = 0x00100004,
+ /** 录音棚(增强版) */
+ ARAudioReverbPresetFxStudio = 0x00100005,
+ /** 流行(增强版) */
+ ARAudioReverbPresetFxPopular = 0x00100006,
+ /** R&B(增强版) */
+ ARAudioReverbPresetFxRNB = 0x00100007,
+ /** 留声机 */
+ ARAudioReverbPresetFxPhonograph = 0x00100008,
+ /** 流行 */
+ ARAudioReverbPresetPopular = 0x00000001,
+ /** R&B */
+ ARAudioReverbPresetRnB = 0x00000002,
+ /** 摇滚 */
+ ARAudioReverbPresetRock = 0x00000003,
+ /** 嘻哈 */
+ ARAudioReverbPresetHipHop = 0x00000004,
+ /** 演唱会 */
+ ARAudioReverbPresetVocalConcert = 0x00000005,
+ /** KTV */
+ ARAudioReverbPresetKTV = 0x00000006,
+ /** 录音棚 */
+ ARAudioReverbPresetStudio = 0x00000007,
+ /** 虚拟立体声。虚拟立体声是指将单声道的音轨渲染出立体声的效果,使频道内所有用户听到有空间感的声音效果。为达到更好的虚拟立体声效果,AR 推荐在调用该方法前将 setAudioProfile 的 profile 参数设置为 ARAudioProfileMusicHighQualityStereo(5)。*/
+ ARAudioReverbPresetVirtualStereo = 0x00200001
+};
+
+#endif /* AREnumerates_h */
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaIO.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaIO.h
new file mode 100644
index 0000000..32dadce
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaIO.h
@@ -0,0 +1,224 @@
+//
+// ARMediaIO.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/6/15.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <AVFoundation/AVFoundation.h>
+#import "AREnumerates.h"
+
+/** 视频像素格式
+
+ 关于 YVU 图像格式的描述,请参考:
+ FourCC YUV 格式说明
+ Recommended 8-Bit YUV Formats for Video Rendering
+ */
+typedef NS_ENUM(NSUInteger, ARVideoPixelFormat) {
+ /** I420 */
+ ARVideoPixelFormatI420 = 1,
+ /** BGRA */
+ ARVideoPixelFormatBGRA = 2,
+ /** NV12 */
+ ARVideoPixelFormatNV12 = 8,
+};
+
+/** 视频的顺时针旋转角度
+
+如果设置为其他数字,系统会自动忽略
+ */
+typedef NS_ENUM(NSInteger, ARVideoRotation) {
+ /** 顺时针旋转 0 度 */
+ ARVideoRotationNone = 0,
+ /** 顺时针旋转 90 度*/
+ ARVideoRotation90 = 1,
+ /** 顺时针旋转 180 度 */
+ ARVideoRotation180 = 2,
+ /** 顺时针旋转 270 度 */
+ ARVideoRotation270 = 3,
+};
+
+/**
+ ARVideoFrameConsumer 支持接收两种 Buffer 类型的视频帧数据:PixelBuffer 和裸数据。 自定义视频源时,开发者需要通过 bufferType 来指定一种 Buffer 类型,并在自定义视频源中只使用与其对应的方法来传递视频帧数据。
+*/
+@protocol ARVideoFrameConsumer <NSObject>
+
+/** PixelBuffer 类型
+
+ @param pixelBuffer PixelBuffer 类型的视频 Buffer
+ @param timestamp 传入的视频帧的时间戳,开发者必须为每一个视频帧设置一个时间戳。
+ @param rotation 视频的顺时针旋转角度, 详见 ARVideoRotation
+ */
+- (void)consumePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
+ withTimestamp:(CMTime)timestamp
+ rotation:(ARVideoRotation)rotation;
+
+/** RawData 类型
+
+ @param rawData RawData 类型的视频 Buffer
+ @param timestamp 传入的视频帧的时间戳,以毫秒为单位。
+ @param format ARVideoPixelFormat
+ @param size 视频裸数据的尺寸
+ @param rotation 视频的顺时针旋转角度, 详见 ARVideoRotation
+ */
+- (void)consumeRawData:(void * _Nonnull)rawData
+ withTimestamp:(CMTime)timestamp
+ format:(ARVideoPixelFormat)format
+ size:(CGSize)size
+ rotation:(ARVideoRotation)rotation;
+
+
+@end
+
+
+/** ARVideoSourceProtocol 协议
+
+ ARVideoSourceProtocol 定义了一套协议,开发者通过实现该接口,来创建自定义的视频源,并设置给 sdk 底层的 Media Engine
+
+ 实时通讯过程中,SDK 通常会启动默认的视频输入设备,即内置的摄像头,进行视频推流。 使用 ARVideoSourceProtocol 接口可以自定义视频源。通过调用 设置视频源 setVideoSource 接口,可以改变并控制默认的视频输入设备,再将自定义的视频源发送给 Media Engine,让 Media Engine 进行其它视频处理,如过滤视频、将视频发布到 RTC 链接等。
+
+ */
+@protocol ARVideoSourceProtocol <NSObject>
+@required
+/** ARVideoFrameConsumer 协议,详见 ARVideoFrameConsumer */
+@property (strong) id<ARVideoFrameConsumer> _Nullable consumer;
+/** 初始化视频源
+
+ Media Engine 在初始化视频源的时候会回调此方法。开发者可以在这个方法中做一些准备工作,例如打开 Camera,或者初始化视频源,并通过返回值告诉 Media Engine,自定义的视频源是否已经准备好。
+
+**Note**
+
+ 初始化视频源过程中,开发者需要在 bufferType 中指定一种 Buffer 类型,并在自定义视频源中只使用与其对应的方法来传递视频帧数据。
+
+ 在初始化视频源过程中,Media Engine 会传递给开发者的一个 ARVideoFrameConsumer 对象。开发者需要保存该对象,并在视频源启动后,通过这个对象把视频帧输入给 Media Engine。
+
+ 开发者需要手动输入 YES 或 NO,以告诉 Media Engine 自定义视频源是否已准备好。
+
+ @return 初始化状态:
+ * YES: 自定义的视频源已经完成了初始化工作
+ * NO: 自定义的视频源设备没准备好或者初始化失败,Media Engine 会停下来并上报错误
+ */
+- (BOOL)shouldInitialize;
+
+/** 启动视频源
+
+ Media Engine 在启动视频源时会回调这个方法。开发者可以在该方法中启动视频帧捕捉。开发者需要通过返回值告诉告知 Media Engine 自定义的视频源是否开启成功。
+
+ 开发者需要手动输入 YES 或 NO,以告诉 Media Engine 自定义视频源是否开启:
+
+ * YES:自定义的视频源已成功开启,接下来会打开 ARVideoFrameConsumer 的开关,接收开发者传输的视频帧
+ * NO:自定义的视频源设备启动失败,Media Engine 会停下来并上报错误
+ */
+- (void)shouldStart;
+
+/** 停止视频源
+
+ Media Engine 在停止视频源的时候会回调这个方法。开发者可以在这个方法中停止视频的采集。Media Engine 通过这个回调通知开发者,ARVideoFrameConsumer 的帧输入开关即将关闭,之后输入的视频帧都会被丢弃。
+ */
+- (void)shouldStop;
+
+/** 释放视频源
+
+Media Engine 通知开发者视频源即将失效,开发者可以在这个方法中关闭视频源设备。引擎会销毁 ARVideoFrameConsumer 对象,开发者需要确保在此回调之后不再使用它。
+ */
+- (void)shouldDispose;
+
+/** 获取 Buffer 类型
+
+ Media Engine 在初始化的时候,会调用这个方法来查询该视频源所使用的 Buffer 类型。开发者必须指定且只能指定一种 Buffer 类型并通过返回值告诉 Media Engine
+
+ @return ARVideoBufferType
+ */
+- (ARVideoBufferType)bufferType;
+
+@end
+
+/** ARVideoSinkProtocol 协议
+
+ ARVideoSinkProtocol 定义了一套协议,开发者通过实现该接口,来创建自定义的视频渲染器,并设置给底层的 Media Engine。
+
+ 实时通讯过程中,SDK 通常会启动默认的视频渲染器进行视频渲染。 ARVideoSinkProtocol 可以自定义视频渲染器,再通过调用 设置本地视频渲染器 setLocalVideoRenderer 和 设置远端视频渲染器 setRemoteVideoRenderer 接口,改变并控制默认的视频渲染器。
+
+ ARVideoSinkProtocol 由以下方法组成:
+
+ - 初始化渲染器(shouldInitialize)
+ - 启动渲染器 (shouldStart)
+ - 停止渲染器 (shouldStop)
+ - 释放渲染器 (shouldDispose)
+ - 获取 Buffer 类型 (AgoraVideoBufferType)
+ - 获取像素格式 (AgoraVideoPixelFormat)
+ - (可选) 输出视频像素 Buffer (renderPixelBuffer)
+ - (可选) 输出视频裸数据 (renderRawData)
+ Note: ARVideoSinkProtocol 接口中定义的所有方法都是回调方法,Media Engine 内部维护着状态机,并使用这些方法将自定义视频源及渲染器的状态传给 Media Engine。因此请避免直接在 App 中直接调用这些接口。 下面这个例子给出了自定义 video sink 的步骤:
+
+ - 调用 bufferType 和 AgoraVideoPixelFormat 方法设置视频帧的 Buffer 类型和像素格式。
+ - 实现 shouldInitialize、shouldStart、shouldStop 和 shouldDispose 管理自定义的 Video Sink。
+ - 根据 ARVideoFrameConsumer 实现 buffer 类型和像素格式。
+ - 创建 ARVideoFrameConsumer 自定义的 Video Sink 对象。
+ - 调用 setLocalVideoRenderer 和 setRemoteVideoRenderer 方法设置本地和远端视频渲染器。
+ - Media Engine 会根据内部状态调用 ARVideoSinkProtocol 接口中的方法。
+ */
+@protocol ARVideoSinkProtocol <NSObject>
+@required
+/** 初始化渲染器
+
+ Media Engine 初始化渲染器的时候调用这个方法。开发者可以在这个方法中做渲染器的初始化工作。如果是耗时操作,也可以提前初始化好,然后在这个方法中通过返回值告知 Media Engine 自定义渲染器已初始化好。 该方法需要开发者手动输入 YES 或 NO,告知 Media Engine 自定义渲染器的状态。
+
+ @return - YES: Media Engine 会认为自定义的渲染器已经初始化好
+ - NO: Media Engine 会认为自定义的渲染器初始化失败,不继续往下运行
+ */
+- (BOOL)shouldInitialize;
+
+/** 启动渲染器
+
+ Media Engine 在开启渲染功能的时候会回调这个方法。开发者可以在这个方法中启动渲染器。 该方法需要开发者手动输入 YES 或 NO,Media Engine 会根据输入值做对应的动作:
+
+ - YES: Media Engine 继续进行渲染
+ - NO:Media Engine 认为出错而停止渲染器的功能
+ */
+- (void)shouldStart;
+
+/** 停止渲染器
+
+ Media Engine 在停止渲染功能的时候会回调这个方法。开发者可以在这个方法中停止渲染。
+ */
+- (void)shouldStop;
+
+/** 释放渲染器
+
+ Media Engine 通知开发者渲染器即将被废弃。在 shouldDispose 返回之后,开发者就可以释放掉资源了。
+ */
+- (void)shouldDispose;
+
+/** 获取 Buffer 类型
+
+ 用于在自定义渲染器的时候,需要指定 Buffer 类型,通过返回值告知引擎。Media Engine 会调用这个方法并检查返回值类型。
+
+ @return Buffer 类型
+ */
+- (ARVideoBufferType)bufferType;
+
+/** 获取像素格式
+
+ @return 用于自定义渲染器的时候,还需要指定视频数据的像素格式。
+ */
+- (ARVideoPixelFormat)pixelFormat;
+
+@optional
+/** (可选)输出视频的 PixelBuffer
+
+ @param pixelBuffer 视频的 PixelBuffer
+ @param rotation 视频像素的顺时针旋转角度, ARVideoRotation
+ */
+- (void)renderPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer rotation:(ARVideoRotation)rotation;
+
+/** 输出视频裸数据
+
+ @param rawData RawData 格式的视频
+ @param size 视频的尺寸
+ @param rotation 视频的顺时针旋转角度, ARVideoRotation
+ */
+- (void)renderRawData:(void * _Nonnull)rawData size:(CGSize)size rotation:(ARVideoRotation)rotation;
+@end
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaPlayerKit.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaPlayerKit.h
new file mode 100644
index 0000000..89bb23d
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARMediaPlayerKit.h
@@ -0,0 +1,413 @@
+//
+// ARMediaPlayerKit.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/11/2.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#import <AudioToolbox/AudioToolbox.h>
+#import <Foundation/Foundation.h>
+#import <VideoToolbox/VideoToolbox.h>
+#if TARGET_OS_IPHONE
+#import <UIKit/UIKit.h>
+typedef UIView View;
+#elif TARGET_OS_MAC
+#import <AppKit/AppKit.h>
+typedef NSView View;
+#endif
+NS_ASSUME_NONNULL_BEGIN
+
+// external key
+/**
+ * set analyze duration for real time stream
+ * @example "setPlayerOption(kMediaPlayerRealTimeStreamAnalyzeDuration,1000000)"
+ */
+#define kMediaPlayerRealTimeStreamAnalyzeDuration @"analyzeduration"
+
+/**
+ * 设置播放器禁用播放音频
+ * @example "setPlayerOption(kMediaPlayerDisableAudio,0)"
+ */
+#define kMediaPlayerDisableAudio @"audio_disable"
+
+/**
+ * 设置播放器禁用播放视频
+ * @example "setPlayerOption(kMediaPlayerDisableVideo,0)"
+ */
+#define kMediaPlayerDisableVideo @"video_disable"
+
+
+typedef NS_ENUM(NSInteger, ARMediaPlayerSpeed) {
+ /** origin playback speed
+ */
+ ARMediaPlayerSpeedDefault = 100,
+ /** playback speed slow down to 0.75
+ */
+ ARMediaPlayerSpeed75Percent = 75,
+ /** playback speed slow down to 0.5
+ */
+ ARMediaPlayerSpeed50Percent = 50,
+ /** playback speed speed up to 1.25
+ */
+ ARMediaPlayerSpeed125Percent = 125,
+ /** playback speed speed up to 1.5
+ */
+ ARMediaPlayerSpeed150Percent = 150,
+ /** playback speed speed up to 2.0
+ */
+ ARMediaPlayerSpeed200Percent = 200,
+
+};
+/** ARMediaPlayerState,播放器的状态 */
+typedef NS_ENUM(NSInteger, ARMediaPlayerState) {
+ /** 0: 默认状态 */
+ ARMediaPlayerStateIdle = 0,
+ /** 1: 正在打开媒体文件 */
+ ARMediaPlayerStateOpening = 1,
+ /** 2: 成功打开媒体文件 */
+ ARMediaPlayerStateOpenCompleted = 2,
+ /** 3: 正在播放 */
+ ARMediaPlayerStatePlaying = 3,
+ /** 4: 暂停播放 */
+ ARMediaPlayerStatePaused = 4,
+ /** 5: 播放完毕 */
+ ARMediaPlayerStatePlayBackCompleted = 5,
+ /** 6: 停止播放 */
+ ARMediaPlayerStateStopped = 6,
+ /** 100: 播放失败 */
+ ARMediaPlayerStateFailed = 100,
+};
+/** ARMediaPlayerError,播放器的错误码 */
+typedef NS_ENUM(NSInteger, ARMediaPlayerError) {
+ /** 0: 没有错误 */
+ ARMediaPlayerErrorNone = 0,
+ /** -1: 不正确的参数 */
+ ARMediaPlayerErrorInvalidArguments = -1,
+ /** -2: 内部错误 */
+ ARMediaPlayerErrorInternal = -2,
+ /** -3: 没有 resource */
+ ARMediaPlayerErrorNoSource = -3,
+ /** -4: 无效的 resource */
+ ARMediaPlayerErrorInvalidMediaSource = -4,
+ /** -5: 未知的媒体流类型 */
+ ARMediaPlayerErrorUnknowStreamType = -5,
+ /** -6: 对象没有初始化 */
+ ARMediaPlayerErrorObjNotInitialized = -6,
+ /** -7: 解码器不支持该 codec */
+ ARMediaPlayerErrorCodecNotSupported = -7,
+ /** -8: 无效的 renderer */
+ ARMediaPlayerErrorVideoRenderFailed = -8,
+ /** -9: 播放器内部状态错误 */
+ ARMediaPlayerErrorInvalidState = -9,
+ /** -10: 未找到该 URL */
+ ARMediaPlayerErrorUrlNotFound = -10,
+ /** -11: 播放器与服务器的连接无效 */
+ ARMediaPlayerErrorInvalidConnectState = -11,
+ /** -12: 播放缓冲区数据不足 */
+ ARMediaPlayerErrorSrcBufferUnderflow = -12,
+};
+/** ARMediaPlayerEvent,播放器的事件
+ */
+typedef NS_ENUM(NSInteger, ARMediaPlayerEvent) {
+ /** 0: 开始定位 */
+ ARMediaPlayerEventSeekBegin = 0,
+ /** 1: 完成定位 */
+ ARMediaPlayerEventSeekComplete = 1,
+ /** 2: 定位出错 */
+ ARMediaPlayerEventSeekError = 2,
+};
+
+/**
+ * ARMediaPlayerMetaDataType, 媒体附属信息数据类型
+ */
+typedef NS_ENUM(NSUInteger, ARMediaPlayerMetaDataType) {
+ /** 0: 未知类型 */
+ ARMediaPlayerMetaDataTypeUnknown = 0,
+ /** 1: SEI(补充增强信息)类型 */
+ ARMediaPlayerMetaDataTypeSEI = 1,
+};
+
+/** ARMediaPixelFormat, reporting the pixel format of the video stream. */
+typedef NS_ENUM(NSInteger, ARMediaPixelFormat) {
+ /** `0`: The format is known.
+ */
+ ARMediaPixelFormatUnknown = 0,
+ /** `1`: The format is I420.
+ */
+ ARMediaPixelFormatI420 = 1,
+ /** `2`: The format is BGRA.
+ */
+ ARMediaPixelFormatBGRA = 2,
+ /** `3`: The format is Planar YUV422.
+ */
+ ARMediaPixelFormatI422 = 3,
+ /** `8`: The format is NV12.
+ */
+ ARMediaPixelFormatNV12 = 8,
+};
+/** ARMediaStreamType,媒体流的类型 */
+typedef NS_ENUM(NSInteger, ARMediaStreamType) {
+ /** 0: 未知类型 */
+ ARMediaStreamTypeUnknow = 0,
+ /** 1: 视频流 */
+ ARMediaStreamTypeVideo = 1,
+ /** 2: 音频流 */
+ ARMediaStreamTypeAudio = 2,
+ /** 3: 字幕流 */
+ ARMediaStreamTypeSubtitle = 3,
+};
+/** ARMediaPlayerRenderMode, 播放器视图的渲染模式 */
+typedef NS_ENUM(NSUInteger, ARMediaPlayerRenderMode) {
+ /** 1: 视频尺寸等比缩放,优先保证视窗被填满,因视频尺寸与显示视窗尺寸不一致而多出的视频将被截掉。
+ */
+ ARMediaPlayerRenderModeHidden = 1,
+
+ /** 2: 视频尺寸等比缩放,优先保证视频内容全部显示,因视频尺寸与显示视窗尺寸不一致造成的视窗未被填满的区域填充黑色。
+ */
+ ARMediaPlayerRenderModeFit = 2,
+};
+@class ARMediaPlayer;
+
+@class ARMediaStreamInfo;
+
+/** MediaPlayer 会通过代理方法 ARMediaPlayerDelegate 向 App 上报一些运行时的事件。 */
+@protocol ARMediaPlayerDelegate <NSObject>
+
+@optional
+
+/** 报告播放器状态改变
+
+ 当播放器状态改变时,SDK 会触发该回调,向你报告新的播放状态。
+
+ @param playerKit ARMediaPlayer
+
+ @param state 新的播放状态,详见 ARMediaPlayerState
+
+ @param error 播放器错误码,详见 ARMediaPlayerError
+ */
+- (void)rtcMediaPlayer:(ARMediaPlayer *_Nonnull)playerKit
+ didChangedToState:(ARMediaPlayerState)state
+ error:(ARMediaPlayerError)error;
+
+/** 报告当前播放进度
+
+ 播放媒体文件时,SDK 每隔 1 秒会自动触发该回调,向你报告当前播放进度。
+
+ @param playerKit ARMediaPlayer
+
+ @param position 当前播放进度 (秒)
+ */
+- (void)rtcMediaPlayer:(ARMediaPlayer *_Nonnull)playerKit
+ didChangedToPosition:(NSInteger)position;
+
+/** 报告定位播放的结果
+
+ @param playerKit ARMediaPlayer
+
+ @param event 定位播放的结果,详见 ARMediaPlayerEvent
+ */
+- (void)rtcMediaPlayer:(ARMediaPlayer *_Nonnull)playerKit
+ didOccurEvent:(ARMediaPlayerEvent)event;
+
+/** 报告已获取媒体附属信息
+
+ 当获取到媒体附属信息时,SDK 会触发该回调,向你报告媒体附属信息的数据类型和具体数据。
+
+ @param playerKit ARMediaPlayer
+
+ @param type 媒体附属信息数据类型,详见 ARMediaPlayerMetaDataType
+
+ @param data 具体数据,用户自定义格式数据
+
+ @param length 数据长度(字节)
+ */
+- (void)rtcMediaPlayer:(ARMediaPlayer *_Nonnull)playerKit
+ metaDataType:(ARMediaPlayerMetaDataType) type
+ didReceiveData:(NSString *)data
+ length:(NSInteger)length;
+/** 已获取视频帧回调
+
+ 每次接收到一帧视频帧时,都会触发该回调,报告视频帧信息。
+
+ @param playerKit ARMediaPlayer
+
+ @param pixelBuffer 视频帧信息
+ */
+- (void)rtcMediaPlayer:(ARMediaPlayer *_Nonnull)playerKit
+ didReceiveVideoFrame:(CVPixelBufferRef)pixelBuffer;
+/** 已获取音频帧回调
+
+ 每次接收到一帧音频帧时,都会触发该回调,报告音频帧信息。
+
+ @param playerKit ARMediaPlayer
+
+ @param audioFrame 音频帧信息
+ */
+- (void)rtcMediaPlayer:(ARMediaPlayer *_Nonnull)playerKit
+ didReceiveAudioFrame:(CMSampleBufferRef)audioFrame;
+
+@end
+
+/** ARMediaStreamInfo 类,包含媒体流的所有信息
+ */
+__attribute__((visibility("default"))) @interface ARMediaStreamInfo : NSObject
+/** 此条媒体流的索引值 */
+@property(nonatomic, assign) NSInteger streamIndex;
+/** 此条媒体流的类型,详见 ARMediaStreamType */
+@property(nonatomic, assign) ARMediaStreamType streamType;
+/** 此条媒体流的编码规格 */
+@property(nonatomic, copy) NSString *_Nonnull codecName;
+/** 此条媒体流的语言 */
+@property(nonatomic, copy) NSString *_Nullable language;
+/** 如果此条媒体流是视频流,获取它的视频帧率 (fps) */
+@property(nonatomic, assign) NSInteger videoFrameRate;
+/** 如果此条媒体流是视频流,获取它的视频码率 (bps) */
+@property(nonatomic, assign) NSInteger videoBitRate;
+/** 如果此条媒体流是视频流,获取它的视频宽度 (pixel) */
+@property(nonatomic, assign) NSInteger videoWidth;
+/** 如果此条媒体流是视频流,获取它的视频高度 (pixel) */
+@property(nonatomic, assign) NSInteger videoHeight;
+/** 如果此条媒体流是音频流,获取它的音频采样率 (Hz) */
+@property(nonatomic, assign) NSInteger audioSampleRate;
+/** 如果此条媒体流是音频流,获取它的声道数 */
+@property(nonatomic, assign) NSInteger audioChannels;
+/** 此条媒体流的时长 (秒) */
+@property(nonatomic, assign) NSInteger duration;
+/** 如果此条媒体流是视频流,获取它的旋转角度 */
+@property(nonatomic, assign) NSInteger rotation;
+
+@end
+
+/** 媒体播放器组件 */
+__attribute__((visibility("default"))) @interface ARMediaPlayer : NSObject
+/** 是否静音:
+
+* YES: 静音
+* NO: 不静音
+*/
+@property(nonatomic, assign) BOOL mute;
+/** 本地播放音量。取值范围 0 到 100。 0 为无声,100 为媒体资源的原始音量。 */
+@property(nonatomic, assign) NSInteger volume;
+/** 播放状态,详见 ARMediaPlayerState*/
+@property(nonatomic, readonly) ARMediaPlayerState state;
+@property(nonatomic, weak) id<ARMediaPlayerDelegate> _Nullable delegate;
+/** 初始化一个 ARMediaPlayer 实例
+
+ @param delegate ARMediaPlayerDelegate
+
+ @return 一个 ARMediaPlayer 实例
+ */
+- (instancetype)initWithDelegate:(id<ARMediaPlayerDelegate>)delegate;
+
+/** 设置播放器的渲染视图
+
+ @param view 视频渲染视图
+ */
+- (void)setView:(View *_Nullable)view;
+
+/** 设置播放器视图的渲染模式
+
+ @param mode 播放器视图的渲染模式,详见 ARMediaPlayerRenderMode
+ */
+- (void)setRenderMode:(ARMediaPlayerRenderMode)mode;
+
+/** 打开媒体文件
+
+ @param url 设置媒体文件的路径,本地路径或网络路径
+
+ @param startPos 设置起始播放位置 (s),默认值为 0
+ */
+- (void)open:(NSString *)url startPos:(NSInteger)startPos;
+
+/** 播放媒体文件
+
+ 打开 (open) 媒体文件或暂停 (pause 播放媒体文件后,你可以调用该方法播放媒体文件。
+ */
+- (void)play;
+
+/** 暂停播放
+
+ 如果你想恢复播放,请调用 play() 方法。
+ */
+- (void)pause;
+
+/** 停止播放
+ */
+- (void)stop;
+
+/** 从指定的位置播放媒体文件
+
+ 成功调用该方法后,将收到didOccurEvent回调。
+ @param position 指定的位置 (s)
+ */
+- (void)seekToPosition:(NSInteger)position;
+
+/** 设置是否静音
+ @param isMute 静音选项:
+
+ * YES: 静音
+ * NO: (默认)不静音
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)mute:(bool)isMute;
+
+/** 获取当前的静音状态
+ @return 方法调用成功,返回:
+ - YES: 静音
+ - NO: (默认)不静音
+ * 方法调用失败,返回 NO
+ */
+- (bool)getMute;
+
+/** 调节本地播放音量
+ @param volume 本地播放音量,取值范围从 0 到 100: - 0: 无声 - 100: (默认)媒体文件的原始播放音量
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)adjustVolume:(int)volume;
+
+/** 获取当前播放进度
+ @return < 0: 方法调用失败,详见 ARMediaPlayerError
+ * 其它:播放进度 (s)
+ */
+- (NSInteger)getPosition;
+
+/** 获取媒体文件总时长
+ @return < 0: 方法调用失败,详见 ARMediaPlayerError
+ * 其它:媒体文件总时长 (s)
+ */
+- (NSInteger)getDuration;
+
+/** 获取播放器当前状态
+
+ @return 方法调用成功,返回播放器当前状态 详见 ARMediaPlayerState
+ * 方法调用失败,返回 nil
+ */
+- (ARMediaPlayerState)getPlayerState;
+
+/** 获取该媒体文件中媒体流的数量
+
+ @return < 0: 方法调用失败,详见 ARMediaPlayerError
+ * 其它:该媒体文件中媒体流的数量
+ */
+- (NSInteger)getStreamCount;
+
+/** 通过此条媒体流的索引值获取媒体流信息
+
+ @param index 媒体流索引值
+
+ @return 方法调用成功,返回媒体流信息,详见 ARMediaStreamInfo
+ * 方法调用失败,返回 nil
+ */
+- (ARMediaStreamInfo *_Nullable)getStreamByIndex:(int)index;
+
+/** 销毁 ARMediaPlayerKit 实例
+
+ 调用该方法后,你将无法再使用 Player 提供的其他 API。如果你需要重新使用 Player, 你需要调用 initWithDelegate 方法,重新创建一个 ARMediaPlayerKit 实例。
+ */
+- (void)destroy;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARObjects.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARObjects.h
new file mode 100644
index 0000000..fce516a
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARObjects.h
@@ -0,0 +1,1095 @@
+//
+// ARObjects.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/3/20.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <CoreMedia/CoreMedia.h>
+#import "AREnumerates.h"
+
+#if TARGET_OS_IPHONE
+#import <UIKit/UIKit.h>
+typedef UIView VIEW_CLASS;
+typedef UIColor COLOR_CLASS;
+typedef CGSize SIZE_CLASS;
+typedef CGPoint POINT_CLASS;
+#elif TARGET_OS_MAC
+#import <AppKit/AppKit.h>
+typedef NSView VIEW_CLASS;
+typedef NSColor COLOR_CLASS;
+typedef NSSize SIZE_CLASS;
+typedef NSPoint POINT_CLASS;
+#endif
+
+/** 视频画布对象的属性
+*/
+__attribute__((visibility("default"))) @interface ARtcVideoCanvas : NSObject
+
+/**
+ 视频显示视窗
+
+ VIEW_CLASS 为统称,具体为:
+ - iOS: UIView
+ - MacOS: NSView
+ */
+@property (strong, nonatomic) VIEW_CLASS* _Nullable view;
+/** 视频显示模式*/
+@property (assign, nonatomic) ARVideoRenderMode renderMode;
+
+/**
+ * 频道id
+ * 0 ~ 9
+ * a ~ z A ~Z
+ * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ",".
+
+** Note **
+ * 该参数默认值为空字符 ""。如果用户是通过 ARtcEngineKit 类的 joinChannelByToken 方法加入频道的,则将参数设为默认值,表示该用户在频道内的渲染视图。
+ * 如果用户是通过 ARtcChannel 类的 joinChannelByToken 方法加入频道的,则将该参数设为该 ARtcChannel 类对应的 channelId,表示该用户在该 channelId 对应频道内的渲染视图。
+*/
+@property (copy, nonatomic) NSString * _Nullable channelId;
+/** 用户id */
+@property (copy, nonatomic) NSString * _Nonnull uid;
+/** 视图镜像模式,详见 ARVideoMirrorMode
+
+ **Note**:
+
+ * 本地视图镜像模式:如果你使用前置摄像头,默认启动本地视图镜像模式;如果你使用后置摄像头,默认关闭本地视图镜像模式。
+ * 远端用户视图镜像模式:默认关闭远端用户的镜像模式。
+ */
+@property (assign, nonatomic) ARVideoMirrorMode mirrorMode;
+
+@end
+
+
+/** 通话相关的统计信息
+*/
+__attribute__((visibility("default"))) @interface ARChannelStats : NSObject
+
+/** 通话时长,单位为秒,累计值
+ */
+@property (assign, nonatomic) NSInteger duration;
+/** 音视频总发送字节数 (bytes),累计值
+ */
+@property (assign, nonatomic) NSInteger txBytes;
+/** 音视频总接收字节数 (bytes),累计值
+ */
+@property (assign, nonatomic) NSInteger rxBytes;
+/** 音频发送字节数(bytes),累计值
+ */
+@property (assign, nonatomic) NSInteger txAudioBytes;
+/** 视频发送字节数(bytes),累计值
+ */
+@property (assign, nonatomic) NSInteger txVideoBytes;
+/** 音频接收字节数(bytes),累计值
+ */
+@property (assign, nonatomic) NSInteger rxAudioBytes;
+/** 视频接收字节数(bytes),累计值
+ */
+@property (assign, nonatomic) NSInteger rxVideoBytes;
+/** 音视频总发送码率(Kbps),瞬时值
+ */
+@property (assign, nonatomic) NSInteger txKBitrate;
+/** 音视频总接收码率(Kbps),瞬时值
+ */
+@property (assign, nonatomic) NSInteger rxKBitrate;
+/** 音频发送码率 (Kbps),瞬时值
+ */
+@property (assign, nonatomic) NSInteger txAudioKBitrate;
+/** 音频接收码率 (Kbps),瞬时值
+ */
+@property (assign, nonatomic) NSInteger rxAudioKBitrate;
+/** 视频发送码率 (Kbps),瞬时值
+ */
+@property (assign, nonatomic) NSInteger txVideoKBitrate;
+/** 视频接收码率 (Kbps),瞬时值
+ */
+@property (assign, nonatomic) NSInteger rxVideoKBitrate;
+/** Last mile 的延迟(ms)
+ */
+@property (assign, nonatomic) NSInteger lastmileDelay;
+/** 使用抗丢包技术前,本地客户端到边缘服务器的丢包率,单位为 %
+ */
+@property (assign, nonatomic) NSInteger txPacketLossRate;
+/** 使用抗丢包技术前,边缘服务器到本地客户端的丢包率,单位为 %
+ */
+@property (assign, nonatomic) NSInteger rxPacketLossRate;
+/** 当前频道内的用户人数
+
+ * 通信场景下,当前频道内的用户人数。
+ * 直播场景下,如果本地用户为观众,为频道内的主播人数 + 1;如果本地用户为主播,为频道内的主播人数。
+ */
+@property (assign, nonatomic) NSInteger userCount;
+/** 当前 App 的 CPU 使用率 (%)
+ */
+@property (assign, nonatomic) double cpuAppUsage;
+/** 当前系统的 CPU 使用率 (%)
+ */
+@property (assign, nonatomic) double cpuTotalUsage;
+/** 客户端到本地路由器的往返时延 (ms)
+ */
+@property (assign, nonatomic) NSInteger gatewayRtt;
+/** 当前 App 的内存占比 (%)
+
+**Note**
+
+该值仅作参考。受系统限制可能无法获取。
+ */
+@property (assign, nonatomic) double memoryAppUsageRatio;
+/** 当前系统的内存占比 (%)
+
+**Note**
+
+ 该值仅作参考。受系统限制可能无法获取。
+ */
+@property (assign, nonatomic) double memoryTotalUsageRatio;
+/** 当前 App 的内存大小 (KB)
+
+**Note**
+
+ 该值仅作参考。受系统限制可能无法获取。
+ */
+@property (assign, nonatomic) NSInteger memoryAppUsageInKbytes;
+
+@end
+
+/** 视频编码器配置的属性 */
+__attribute__((visibility("default"))) @interface ARVideoEncoderConfiguration : NSObject
+
+/** 视频编码的分辨率 (px),用于衡量编码质量,以长x宽表示,默认值为 640 x 480。
+
+ 用户可以自行设置分辨率,也可以在如下列表中直接选择想要的分辨率:
+
+ - ARVideoDimension120x120
+ - ARVideoDimension160x120
+ - ARVideoDimension180x180
+ - ARVideoDimension240x180
+ - ARVideoDimension320x180
+ - ARVideoDimension240x240
+ - ARVideoDimension320x240
+ - ARVideoDimension424x240
+ - ARVideoDimension360x360
+ - ARVideoDimension480x360
+ - ARVideoDimension640x360
+ - ARVideoDimension480x480
+ - ARVideoDimension640x480
+ - ARVideoDimension840x480
+ - ARVideoDimension960x720
+ - ARVideoDimension1280x720
+ - ARVideoDimension1920x1080 (macOS only)
+ - ARVideoDimension2540x1440 (macOS only)
+ - ARVideoDimension3840x2160 (macOS only)
+
+**Note**
+
+ * 该值不代表最终视频输出的方向。请查阅 ARVideoOutputOrientationMode 了解设置视频方向
+ * 视频能否达到 720P 的分辨率取决于设备的性能,在性能配备较低的设备上有可能无法实现。如果采用 720P 分辨率而设备性能跟不上,则有可能出现帧率过低的情况。
+ * iPhone 不支持 720P 以上的分辨率。
+ */
+
+@property (assign, nonatomic) CGSize dimensions;
+
+/** 视频编码的帧率(fps)
+
+用户可以自行设置帧率,也可以在如下列表中直接选择想要的帧率。默认值为 15 帧。建议不要超过 30 帧。
+
+ * ARVideoFrameRateFps1(1): 1 fps
+ * ARVideoFrameRateFps7(7): 7 fps
+ * ARVideoFrameRateFps10(10): 10 fps
+ * ARVideoFrameRateFps15(15): 15 fps
+ * ARVideoFrameRateFps24(24): 24 fps
+ * ARVideoFrameRateFps30(30): 30 fps
+ * ARVideoFrameRateFps60(30): 60 fps (macOS only)
+*/
+@property (assign, nonatomic) NSInteger frameRate;
+
+/** 最低视频编码帧率(fps)
+
+单位为 fps,默认值为 -1,表示使用系统默认的最低编码帧率。关于该参数的适用场景及注意事项,请参考 设置视频属性(iOS) 或 设置视频属性(macOS)。
+*/
+@property (assign, nonatomic) NSInteger minFrameRate;
+
+/** 视频编码的码率
+
+ 该参数设置视频编码码率,单位为 Kbps。你可以根据场景需要,参考下表,手动设置你想要的码率。若设置的视频码率超出合理范围,SDK 会自动按照合理区间处理码率。你也可以直接选择如下任意一种模式进行设置:
+
+ ARVideoBitrateStandard: (推荐)标准码率模式。该模式下,视频在通信和直播场景下的码率有所不同:通信场景下,码率与基准码率一致;直播场景下,码率对照基准码率翻倍。
+ ARVideoBitrateCompatible: 适配码率模式。该模式下,视频在通信和直播场景下的码率均与基准码率一致。直播下如果选择该场景,视频帧率可能会低于设置的值。
+ 在通信和直播场景下采用不同的编码方式,以提升不同场景下的用户体验。通信场景保证流畅,而直播场景则更注重画面质量,因此直播场景对码率的需求大于通信场景。所以推荐将该参数设置为 ARVideoBitrateStandard。
+
+**视频码率参考表**
+
+| Resolution | Frame Rate (fps) | Base Bitrate (Kbps, for Communication) | Live Bitrate (Kbps, for Live Broadcast) |
+|------------------- |------------------ |---------------------------------------- |----------------------------------------- |
+| 160 × 120 | 15 | 65 | 130 |
+| 120 × 120 | 15 | 50 | 100 |
+| 320 × 180 | 15 | 140 | 280 |
+| 180 × 180 | 15 | 100 | 200 |
+| 240 × 180 | 15 | 120 | 240 |
+| 320 × 240 | 15 | 200 | 400 |
+| 240 × 240 | 15 | 140 | 280 |
+| 424 × 240 | 15 | 220 | 440 |
+| 640 × 360 | 15 | 400 | 800 |
+| 360 × 360 | 15 | 260 | 520 |
+| 640 × 360 | 30 | 600 | 1200 |
+| 360 × 360 | 30 | 400 | 800 |
+| 480 × 360 | 15 | 320 | 640 |
+| 480 × 360 | 30 | 490 | 980 |
+| 640 × 480 | 15 | 500 | 1000 |
+| 480 × 480 | 15 | 400 | 800 |
+| 640 × 480 | 30 | 750 | 1500 |
+| 480 × 480 | 30 | 600 | 1200 |
+| 848 × 480 | 15 | 610 | 1220 |
+| 848 × 480 | 30 | 930 | 1860 |
+| 640 × 480 | 10 | 400 | 800 |
+| 1280 × 720 | 15 | 1130 | 2260 |
+| 1280 × 720 | 30 | 1710 | 3420 |
+| 960 × 720 | 15 | 910 | 1820 |
+| 960 × 720 | 30 | 1380 | 2760 |
+| 1920 × 1080 | 15 | 2080 | 4160 |
+| 1920 × 1080 | 30 | 3150 | 6300 |
+| 1920 × 1080 | 60 | 4780 | 6500 |
+| 2560 × 1440 | 30 | 4850 | 6500 |
+| 2560 × 1440 | 60 | 6500 | 6500 |
+| 3840 × 2160 | 30 | 6500 | 6500 |
+| 3840 × 2160 | 60 | 6500 | 6500 |
+
+
+**Note**
+
+该表中的基准码率适用于通信场景。直播场景下通常需要较大码率来提升视频质量。推荐通过设置 ARVideoBitrateStandard 模式来实现。你也可以直接将码率值设为基准码率值 x 2。
+*/
+@property (assign, nonatomic) NSInteger bitrate;
+
+/** 最低编码码率
+
+该参数设置最低编码码率,单位为 Kbps。
+
+SDK会根据网络状况自动调整视频编码码率。将参数设为高于默认值可强制视频编码器输出高质量图片,但在网络状况不佳的情况下可能导致网络丢包并影响视频播放的流畅度造成卡顿。因此如非对画质有特殊需求,建议不要修改该参数的值。
+
+**Note**
+
+该参数仅适用于直播场景。
+ */
+@property (assign, nonatomic) NSInteger minBitrate;
+
+/** 视频编码的方向模式
+
+ * ARVideoOutputOrientationModeAdaptative(0): (默认)该模式下 SDK 输出的视频方向与采集到的视频方向一致。接收端会根据收到的视频旋转信息对视频进行旋转。该模式适用于接收端可以调整视频方向的场景:
+ - 如果采集的视频是横屏模式,则输出的视频也是横屏模式。
+ - 如果采集的视频是竖屏模式,则输出的视频也是竖屏模式。
+ * ARVideoOutputOrientationModeFixedLandscape(1): 该模式下 SDK 固定输出风景(横屏)模式的视频。如果采集到的视频是竖屏模式,则视频编码器会对其进行裁剪。该模式适用于当接收端无法调整视频方向时,如使用旁路推流场景下。
+ * ARVideoOutputOrientationModeFixedPortrait(2): 该模式下 SDK 固定输出人像(竖屏)模式的视频,如果采集到的视频是横屏模式,则视频编码器会对其进行裁剪。该模式适用于当接收端无法调整视频方向时,如使用旁路推流场景下。
+ */
+@property (assign, nonatomic) ARVideoOutputOrientationMode orientationMode;
+
+/** 带宽受限时的视频编码降级偏好
+
+ARDegradationPreference,有如下选项:
+
+ * ARDegradationMaintainQuality(0):(默认)降低编码帧率以保证视频质量
+ * ARDegradationMaintainFramerate(1):降低视频质量以保证编码帧率
+ * ARDegradationMaintainFramerate(2):(预留参数,暂不支持)在编码帧率和视频质量之间保持平衡。
+*/
+@property (assign, nonatomic) ARDegradationPreference degradationPreference;
+
+/** 设置本地发送视频的镜像模式
+
+ * 只影响远端用户看到的视频画面。详见 ARVideoMirrorMode
+ * 默认关闭镜像模式
+ */
+@property (assign, nonatomic) ARVideoMirrorMode mirrorMode;
+
+/** 指定视频分辨率并初始化一个 ARVideoEncoderConfiguration 对象
+
+ @param size 视频分辨率
+ @param frameRate 视频帧率,详见 ARVideoFrameRate
+ @param bitrate 视频码率
+ @param orientationMode 视频方向,详见 ARVideoOutputOrientationMode
+ @return 初始化的 ARVideoEncoderConfiguration 对象
+ */
+- (instancetype _Nonnull)initWithSize:(CGSize)size
+ frameRate:(ARVideoFrameRate)frameRate
+ bitrate:(NSInteger)bitrate
+ orientationMode:(ARVideoOutputOrientationMode)orientationMode;
+
+/** 指定视频宽和高并初始化一个 ARVideoEncoderConfiguration 对象
+
+ @param width 视频宽度
+ @param height 视频高度
+ @param frameRate 视频帧率,详见 ARVideoFrameRate
+ @param bitrate 视频码率
+ @param orientationMode 视频方向,详见 ARVideoOutputOrientationMode
+ @return 初始化的 ARVideoEncoderConfiguration 对象
+ */
+- (instancetype _Nonnull)initWithWidth:(NSInteger)width
+ height:(NSInteger)height
+ frameRate:(ARVideoFrameRate)frameRate
+ bitrate:(NSInteger)bitrate
+ orientationMode:(ARVideoOutputOrientationMode)orientationMode;
+
+@end
+
+/** 音量信息的属性 */
+__attribute__((visibility("default"))) @interface ARtcAudioVolumeInfo : NSObject
+
+/** 说话者的用户 ID。 */
+@property (copy, nonatomic) NSString * _Nonnull uid;
+/** 说话者各自混音后的音量,取值范围为 [0,255] */
+@property (assign, nonatomic) NSUInteger volume;
+/** 本地用户的人声状态。
+
+ * 0: 本地用户不在说话。
+ * 1: 本地用户在说话。
+
+**Note**
+
+ * vad 无法报告远端用户的人声状态。对于远端用户,vad 的值始终为 0。
+ * 若需使用此参数,请在 enableAudioVolumeIndication 方法中设置 report_vad 为 YES。
+ */
+@property (assign, nonatomic) NSUInteger vad;
+/** 频道 ID,表明当前说话者在哪个频道。*/
+@property (copy, nonatomic) NSString * _Nonnull channelId;
+@end
+
+/** 摄像头采集偏好设置 */
+__attribute__((visibility("default"))) @interface ARCameraCapturerConfiguration : NSObject
+
+/** 摄像头采集偏好,详见 ARCameraCaptureOutputPreference
+ */
+@property (assign, nonatomic) ARCameraCaptureOutputPreference preference;
+#if TARGET_OS_IOS
+/** 摄像头方向,详见 ARCameraDirection:
+
+ * ARCameraDirectionRear: 使用后置摄像头
+ * ARCameraDirectionFront: 使用前置摄像头
+ */
+@property (assign, nonatomic) ARCameraDirection cameraDirection;
+#endif
+
+@end
+
+/** 远端音频统计信息
+ */
+__attribute__((visibility("default"))) @interface ARtcRemoteAudioStats : NSObject
+/** 用户 ID,指定是哪个用户/主播的音频流
+ */
+@property (copy, nonatomic) NSString * _Nonnull uid;
+/** 远端用户发送的音频流质量:
+ 0:质量未知
+ 1:质量极好
+ 2:用户主观感觉和极好差不多 ,但码率可能略低于极好
+ 3:用户主观感受有瑕疵,但不影响沟通
+ 4:勉强能沟通但不顺畅
+ 5:网络质量非常差,基本不能沟通
+ 6:网络连接已断开,完全无法沟通
+ 7:网络质量探测功能不可使用 (目前没有使用)
+ 8:网络质量探测中
+ */
+@property (assign, nonatomic) ARNetworkQuality quality;
+/** 音频发送端到接收端的网络延迟(毫秒)
+ */
+@property (assign, nonatomic) NSUInteger networkTransportDelay;
+/** 接收端到网络抖动缓冲的网络延迟(毫秒)
+ */
+@property (assign, nonatomic) NSUInteger jitterBufferDelay;
+/** 统计周期内的远端音频流的丢帧率(%)
+ */
+@property (assign, nonatomic) NSUInteger audioLossRate;
+/** 声道数
+ */
+@property (assign, nonatomic) NSUInteger numChannels;
+/** 统计周期内接收到的远端音频采样率(Hz)
+ */
+@property (assign, nonatomic) NSUInteger receivedSampleRate;
+/** 接收流在统计周期内的平均码率(Kbps)
+ */
+@property (assign, nonatomic) NSUInteger receivedBitrate;
+/** 远端用户在加入频道后发生音频卡顿的累计时长(ms)
+ */
+@property (assign, nonatomic) NSUInteger totalFrozenTime;
+/** 远端用户在加入频道后发生音频卡顿的累计时长占音频总有效时长的百分比(%)。音频有效时长是指远端用户加入频道后音频未被停止发送或禁用的时长。
+ */
+@property (assign, nonatomic) NSUInteger frozenRate;
+@end
+
+/** 本地视频统计回调
+ */
+__attribute__((visibility("default"))) @interface ARtcLocalVideoStats : NSObject
+/** 实际发送码率 (Kbps) : 不包含丢包后重传视频等的发送码率 */
+@property (assign, nonatomic) NSUInteger sentBitrate;
+/** 实际发送帧率 (fps) : 不包含丢包后重传视频等的发送帧率 */
+@property (assign, nonatomic) NSUInteger sentFrameRate;
+/** 本地视频编码器的输出帧率,单位为 fps */
+@property (assign, nonatomic) NSUInteger encoderOutputFrameRate;
+/** 本地视频渲染器的输出帧率,单位为 fps */
+@property (assign, nonatomic) NSUInteger rendererOutputFrameRate;
+/** 当前编码器的目标编码码率,单位为 Kbps,该码率为 SDK 根据当前网络状况预估的一个值。*/
+@property (assign, nonatomic) NSUInteger sentTargetBitrate;
+/** 当前编码器的目标编码帧率,单位为 fps */
+@property (assign, nonatomic) NSUInteger sentTargetFrameRate;
+/** 统计周期内本地视频质量(基于目标帧率和目标码率)的自适应情况,详见 ARVideoQualityAdaptIndication。 */
+@property (assign, nonatomic) ARVideoQualityAdaptIndication qualityAdaptIndication;
+/** 视频编码码率(Kbps)。
+ */
+@property (assign, nonatomic) NSUInteger encodedBitrate;
+/** 视频编码宽度(px)。
+ */
+@property (assign, nonatomic) NSUInteger encodedFrameWidth;
+/** 视频编码高度(px)。
+ */
+@property (assign, nonatomic) NSUInteger encodedFrameHeight;
+/** 视频发送的帧数,累计值。
+ */
+@property (assign, nonatomic) NSUInteger encodedFrameCount;
+/** 视频的编码类型:
+
+ * ARVideoCodecTypeVP8 = 1: VP8。
+ * ARVideoCodecTypeH264 = 2: (默认值)H.264。
+ */
+@property (assign, nonatomic) ARVideoCodecType codecType;
+
+/** 弱网对抗前本端到边缘服务器的视频丢包率 (%)。
+ */
+@property (assign, nonatomic) NSInteger txPacketLossRate;
+
+/** 本地视频采集帧率 (fps)。
+ */
+@property (assign, nonatomic) NSInteger captureFrameRate;
+
+@end
+
+/** 本地音频统计信息
+ */
+__attribute__((visibility("default"))) @interface ARtcLocalAudioStats : NSObject
+/** 声道数。
+ */
+@property (assign, nonatomic) NSUInteger numChannels;
+/** 发送的采样率,单位为 Hz。
+ */
+@property (assign, nonatomic) NSUInteger sentSampleRate;
+/** 发送码率的平均值,单位为 Kbps。
+ */
+@property (assign, nonatomic) NSUInteger sentBitrate;
+/** 弱网对抗前本端到边缘服务器的音频丢包率 (%)。
+ */
+@property (assign, nonatomic) NSUInteger txPacketLossRate;
+@end
+
+/** 远端视频统计回调。
+ */
+__attribute__((visibility("default"))) @interface ARtcRemoteVideoStats : NSObject
+/** 用户 ID,指定远程视频来自哪个用户
+ */
+@property (copy, nonatomic) NSString * _Nonnull uid;
+/** 延时(毫秒),已废弃(Deprecated)
+*/
+@property (assign, nonatomic) NSUInteger delay;
+/** 视频流宽(像素)
+ */
+@property (assign, nonatomic) NSUInteger width;
+/** 视频流高(像素)
+ */
+@property (assign, nonatomic) NSUInteger height;
+/** 接收流的平均码率(Kbps)
+ */
+@property (assign, nonatomic) NSUInteger receivedBitrate;
+/** 远端视频解码器的输出帧率,单位为 fps
+ */
+@property (assign, nonatomic) NSUInteger decoderOutputFrameRate;
+/** 远端视频渲染器的输出帧率,单位为 fps
+ */
+@property (assign, nonatomic) NSUInteger rendererOutputFrameRate;
+/** 远端视频在使用抗丢包技术之后的丢包率(%)。
+ */
+@property (assign, nonatomic) NSUInteger packetLossRate;
+/** 视频流类型,大流或小流: ARVideoStreamType
+ */
+@property (assign, nonatomic) ARVideoStreamType rxStreamType;
+/** 远端用户在加入频道后发生视频卡顿的累计时长(ms)。通话过程中,视频帧率设置不低于 5 fps 时,连续渲染的两帧视频之间间隔超过 500 ms,则计为一次视频卡顿。
+ */
+@property (assign, nonatomic) NSUInteger totalFrozenTime;
+/** 远端用户在加入频道后发生视频卡顿的累计时长占视频总有效时长的百分比(%)。视频有效时长是指远端用户加入频道后视频未被停止发送或禁用的时长。
+ */
+@property (assign, nonatomic) NSUInteger frozenRate;
+@end
+
+/** 用于封装视频帧数据传递给 SDK 的类
+ */
+__attribute__((visibility("default"))) @interface ARVideoFrame : NSObject
+/** 传入的视频帧的格式
+必须指定为下面的某一个值:
+ * 1: I420
+ * 2: BGRA
+ * 3: NV21
+ * 4: RGBA
+ * 5: IMC2
+ * 7: ARGB
+ * 8: NV12
+ * 12: iOS texture (CVPixelBufferRef)
+ * 13: H264 extra data(sps,pps data)
+ * 14: H264 nomal data
+ * 15: H264 key frame data
+ */
+@property (assign, nonatomic) NSInteger format;
+
+/** 传入的视频帧的时间戳 (ms).
+
+以毫秒为单位。不正确的时间戳会导致丢帧或者音视频不同步。
+
+ */
+@property (assign, nonatomic) CMTime time; // Time for this frame.
+
+/** 传入视频帧的行间距。单位为像素而不是字节。如果视频帧格式设为 12,则不使用该字段。
+ */
+@property (assign, nonatomic) int strideInPixels;
+
+/** 传入视频帧的高度。单位为像素而不是字节。如果视频帧格式设为 12,则不使用该字段。
+ */
+@property (assign, nonatomic) int height;
+
+/** iOS 纹理的 Buffer
+ */
+@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
+
+/** 裸数据格式的 Buffer。如果视频帧格式设为 12,则不使用该字段。
+ */
+@property (strong, nonatomic) NSData * _Nullable dataBuf;
+
+/** 视频左边裁减掉的像素数量,默认为 0
+ */
+@property (assign, nonatomic) int cropLeft;
+/** 视频顶部裁减掉的像素数量,默认为 0
+ */
+@property (assign, nonatomic) int cropTop;
+/** 视频右边裁减掉的像素数量,默认为 0
+ */
+@property (assign, nonatomic) int cropRight;
+/** 视频底部裁减掉的像素数量,默认为 0
+ */
+@property (assign, nonatomic) int cropBottom;
+/** 是否对传入的视频做顺时针旋转操作
+
+可选值为 0,90,180,270。默认为 0。
+ */
+@property (assign, nonatomic) int rotation;
+
+/** 视频缓冲区的长度
+ */
+@property (assign, nonatomic) int length;
+/* Note
+ * 1. strideInPixels
+ * Stride is in pixels, not bytes.
+ * 2. About the frame width and height.
+ * No field is defined for the 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. For example, if the frame size is
+ * 360 × 640, often the buffer stride is 368, that is, the 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 set to a default of 0
+ */
+@end
+
+/** 检测到的人脸信息
+ */
+__attribute__((visibility("default"))) @interface ARFacePositionInfo : NSObject
+
+/** 人脸在画面中的 x 坐标 (px)。以摄像头采集画面的左上角为原点,x 坐标为人脸左上角相对于原点的横向位移。
+ */
+@property (assign, nonatomic) NSInteger x;
+
+/** 人脸在画面中的 y 坐标 (px)。以摄像头采集画面的左上角为原点,y 坐标为人脸左上角相对原点的纵向位移。
+ */
+@property (assign, nonatomic) NSInteger y;
+
+/** 人脸在画面中的宽度 (px)。
+ */
+@property (assign, nonatomic) NSInteger width;
+
+/** 人脸在画面中的高度 (px)。
+ */
+@property (assign, nonatomic) NSInteger height;
+
+/** 人脸距设备屏幕的距离 (cm)。
+ */
+@property (assign, nonatomic) NSInteger distance;
+
+@end
+
+/** 频道媒体设置选项
+ */
+__attribute__((visibility("default"))) @interface ARtcChannelMediaOptions : NSObject
+/** 设置加入频道时是否自动订阅音频流:
+
+ - YES: (默认)订阅
+ - NO: 不订阅
+
+ 该成员功能与 muteAllRemoteAudioStreams 相同。加入频道后,你可以通过 muteAllRemoteAudioStreams 方法重新设置是否订阅频道内的远端音频流。
+ */
+@property (nonatomic, assign) BOOL autoSubscribeAudio;
+
+/** 设置加入频道是是否自动订阅视频流:
+
+ - YES: (默认)订阅
+ - NO: 不订阅
+
+ 该成员功能与 muteAllRemoteVideoStreams 相同。加入频道后,你可以通过 muteAllRemoteVideoStreams 方法重新设置是否订阅频道内的远端视频流。
+ */
+@property (nonatomic, assign) BOOL autoSubscribeVideo;
+@end
+
+/** 实况直播注入流配置
+ */
+__attribute__((visibility("default"))) @interface ARLiveInjectStreamConfig: NSObject
+/** 添加进入直播的外部视频源尺寸。
+
+默认值为 0,即保留视频导入前的尺寸
+ */
+@property (assign, nonatomic) CGSize size;
+/** 添加进入直播的外部视频源的 GOP。
+
+默认值为 30 帧
+ */
+@property (assign, nonatomic) NSInteger videoGop;
+/** 添加进入直播的外部视频源的帧率。
+
+默认值为 15 fps
+ */
+@property (assign, nonatomic) NSInteger videoFramerate;
+/** 添加进入直播的外部视频源的码率
+
+默认值为 400 Kbps
+
+视频码率的设置与分辨率相关。如果设置的视频码率超出合理范围,SDK 会按照合理区间自动设置码率。
+ */
+@property (assign, nonatomic) NSInteger videoBitrate;
+
+/** 添加进入直播的外部音频采样率
+
+默认值为 48000。详见 ARAudioSampleRateType。
+
+**Note:**
+
+建议目前采用默认值,不要自行设置。
+ */
+@property (assign, nonatomic) ARAudioSampleRateType audioSampleRate;
+/** 添加进入直播的外部音频码率
+
+默认值为 48 kbps。
+
+**Note:**
+
+建议目前采用默认值,不要自行设置。
+ */
+@property (assign, nonatomic) NSInteger audioBitrate;
+/** 添加进入直播的外部音频频道数
+
+取值范围 [1,2],默认值为 1。
+
+**Note:**
+
+建议目前采用默认值,不要自行设置。
+ */
+@property (assign, nonatomic) NSInteger audioChannels;
+
+/** 创建默认实况直播注入流配置
+
+ @return 默认配置
+ */
++(ARLiveInjectStreamConfig *_Nonnull) defaultConfig;
+@end
+
+/** 目标频道信息
+ */
+__attribute__((visibility("default"))) @interface ARChannelMediaRelayInfo: NSObject
+/** 能加入频道的 Token。
+ */
+@property (copy, nonatomic) NSString * _Nullable token;
+/** 频道名。
+ */
+@property (copy, nonatomic) NSString * _Nullable channelName;
+/** 用户 ID。
+ */
+@property (copy, nonatomic) NSString * _Nonnull uid;
+/** 初始化 ARChannelMediaRelayInfo 类
+
+ @param token 能加入频道的 Token。
+ */
+- (instancetype _Nonnull)initWithToken:(NSString *_Nullable)token;
+@end
+
+/** 跨频道媒体流转发参数配置类
+
+ */
+__attribute__((visibility("default"))) @interface ARChannelMediaRelayConfiguration: NSObject
+/** 目标频道信息 ARChannelMediaRelayInfo ,包含如下成员:
+
+ - `channelName`: 目标频道的频道名。
+ - `uid`: 标识转发流到目标频道的主播 ID。取值范围为 0 到(232-1),请确保与目标频道中的所有 UID 不同。默认值为 0,表示 SDK 随机分配一个 UID。
+ - `token`: 能加入目标频道的 token。由你在 destinationInfos 中设置的 channelName 和 uid 生成。
+
+ - 如未启用 App Certificate,可直接将该参数设为默认值 nil,表示 SDK 填充 App ID。
+ - 如已启用 App Certificate,则务必填入使用 channelName 和 uid 生成的 token。
+ */
+@property (strong, nonatomic, readonly) NSDictionary<NSString *, ARChannelMediaRelayInfo *> *_Nullable destinationInfos;
+/** 源频道信息 ARChannelMediaRelayInfo ,包含如下成员:
+
+ - `channelName`: 源频道名。默认值为 nil,表示 SDK 填充当前的频道名。
+ - `uid`: 标识源频道中想要转发流的主播 ID。默认值为 0,表示 SDK 随机分配一个 uid。请确保设为 0。
+ - `token`: 能加入源频道的 token。由你在 sourceInfo 中设置的 channelName 和 uid 生成。
+
+ - 如未启用 App Certificate,可直接将该参数设为默认值 nil,表示 SDK 填充 App ID。
+ - 如已启用 App Certificate,则务必填入使用 channelName 和 uid 生成的 token,且其中的 uid 必须为 0。
+ */
+@property (strong, nonatomic) ARChannelMediaRelayInfo *_Nonnull sourceInfo;
+/** 设置目标频道信息。
+
+ @param destinationInfo 目标频道信息 ARChannelMediaRelayInfo ,包含如下成员:
+
+ - `channelName`: 目标频道的频道名。
+ - `uid`:标识转发流到目标频道的主播 ID。取值范围为 0 到(232-1),请确保与目标频道中的所有 UID 不同。默认值为 0,表示 SDK 随机分配一个 UID。
+ - `token`: 能加入目标频道的 token。由你在 destinationInfo 中设置的 channelName 和 uid 生成。
+
+ - 如未启用 App Certificate,可直接将该参数设为默认值 nil,表示 SDK 填充 App ID。
+ - 如已启用 App Certificate,则务必填入使用 channelName 和 uid 生成的 token。
+
+ @param channelName 目标频道名,该参数必填,且需与该方法 destinationInfo 参数中的 channelName 一致。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (BOOL)setDestinationInfo:(ARChannelMediaRelayInfo *_Nonnull)destinationInfo forChannelName:(NSString *_Nonnull)channelName;
+/** 删除目标频道。
+
+ @param channelName 想要删除的目标频道名。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (BOOL)removeDestinationInfoForChannelName:(NSString *_Nonnull)channelName;
+@end
+
+/** 提供旁路推流时特定用户音频/视频转码设置的类
+ */
+__attribute__((visibility("default"))) @interface ARLiveTranscodingUser: NSObject
+/** 旁路推流的用户 ID
+ */
+@property (copy, nonatomic) NSString *_Nonnull uid;
+/** 直播视频上用户视频在布局中相对左上角的位置和大小信息
+ */
+@property (assign, nonatomic) CGRect rect;
+/** 直播视频上用户视频帧的图层编号
+
+ 整数,取值范围为 0 到 100:
+
+ - 最小值为 0(默认值),表示该区域图像位于最下层
+ - 最大值为 100,表示该区域图像位于最上层
+
+ Note: 如果取值小于 0 或大于 100,会返回错误 ARErrorCodeInvalidArgument。
+ */
+@property (assign, nonatomic) NSInteger zOrder;
+/** 直播视频上用户视频的透明度。取值范围为 [0.0,1.0]。
+
+ * 0.0: 表示该区域图像完全透明
+ * 1.0: 表示该区域图像完全不透明。默认值为 1.0.
+ */
+@property (assign, nonatomic) double alpha;
+/** 直播音频所在声道
+
+ 取值范围为 [0,5],默认值为 0 :
+
+ - 0:(推荐) 默认混音设置,最多支持双声道,与主播端上行音频相关
+ - 1: 对应主播的音频,推流中位于 FL 声道。如果主播端上行音频是多声道,会先把多声道混音成单声道。
+ - 2: 对应主播的音频,推流中位于 FC 声道。如果主播端上行音频是多声道,会先把多声道混音成单声道。
+ - 3: 对应主播的音频,推流中位于 FR 声道。如果主播端上行音频是多声道,会先把多声道混音成单声道。
+ - 4: 对应主播的音频,推流中位于 BL 声道。如果主播端上行音频是多声道,会先把多声道混音成单声道。
+ - 5: 对应主播的音频,推流中位于 BR 声道。如果主播端上行音频是多声道,会先把多声道混音成单声道。
+Note: 选项不为 0 时,需要特殊的播放器支持。
+ */
+@property (assign, nonatomic) NSInteger audioChannel;
+@end
+
+/** 图像属性
+
+ 用于设置直播视频的水印和背景图片的属性
+ */
+__attribute__((visibility("default"))) @interface ARImage: NSObject
+/** 直播视频上图片的 HTTP/HTTPS 地址,字符长度不得超过 1024 字节。
+ */
+@property (strong, nonatomic) NSURL *_Nonnull url;
+/** 图片在视频帧上的位置和大小,类型为 CGRect
+ */
+@property (assign, nonatomic) CGRect rect;
+@end
+
+/** 管理旁路推流转码的类
+ */
+__attribute__((visibility("default"))) @interface ARLiveTranscoding: NSObject
+/** 推流视频的总尺寸(宽和高),单位为像素。
+
+- 如果推视频流,宽和高的值均不得低于 64,否则 SDK 会调整为 64。
+- 如果推音频流,请将宽和高都设为 0。
+ */
+@property (assign, nonatomic) CGSize size;
+/** 用于旁路直播的输出视频的码率。单位为 Kbps。400 Kbps 为默认值。
+
+用于旁路直播的输出视频的码率。单位为 Kbps。400 Kbps 为默认值。
+
+你可以根据 Video Profile 参考表中的码率值进行设置;如果设置的码率超出合理范围,服务器会在合理区间内自动调整码率值。
+ */
+@property (assign, nonatomic) NSInteger videoBitrate;
+/** 用于旁路直播的输出视频的帧率。取值范围是 (0,30],单位为 fps。
+
+@note 15 fps 为默认值。服务器会将高于 30 fps 的帧率设置改为 30 fps。
+ */
+@property (assign, nonatomic) NSInteger videoFramerate;
+
+/** 用于旁路直播的输出视频的 GOP。单位为帧。默认值为 30 帧。*/
+@property (assign, nonatomic) NSInteger videoGop;
+/** 用于旁路直播的输出视频的编码规格。
+
+ 可以设置为 66、77 或 100,详见 ARVideoCodecProfileType。
+
+ 如果设置其它值,服务器会统一设为默认值 100。
+ */
+@property (assign, nonatomic) ARVideoCodecProfileType videoCodecProfile;
+
+/** 用于管理参与旁路直播的视频转码合图的用户。最多支持 17 人同时参与转码合图,详见 ARLiveTranscodingUser
+ */
+@property (copy, nonatomic) NSArray<ARLiveTranscodingUser *> *_Nullable transcodingUsers;
+
+/** 预留参数:用户自定义的发送到旁路推流客户端的信息,用于填充 H264/H265 视频中 SEI 帧内容。长度限制:4096 字节。关于 SEI 的详细信息,详见SEI 帧相关问题。
+ */
+@property (copy, nonatomic) NSString *_Nullable transcodingExtraInfo;
+/** 用于旁路直播的输出视频上的水印图片
+
+ 仅支持 PNG 格式的图片。添加后所有旁路直播的观众都可以看到水印。水印图片的定义详见 ARImage
+ */
+@property (strong, nonatomic) ARImage *_Nullable watermark;
+/** 用于旁路直播的输出视频上的背景图片
+
+添加后所有旁路直播的观众都可以看到背景图片。背景图片的定义详见 ARImage
+ */
+@property (strong, nonatomic) ARImage *_Nullable backgroundImage;
+/** 用于旁路直播的输出视频的背景色
+
+ 格式为 RGB 定义下的十六进制整数,不要带 # 号,如 0xFFB6C1 表示浅粉色。默认 0x000000,黑色。
+
+ COLOR_CLASS 为类型统称,具体为:
+
+* iOS: UIColor
+* macOS: NSColor
+ */
+@property (strong, nonatomic) COLOR_CLASS *_Nullable backgroundColor;
+
+/** 用于旁路直播的输出音频的采样率,详见 ARAudioSampleRateType
+ */
+@property (assign, nonatomic) ARAudioSampleRateType audioSampleRate;
+/** 用于旁路直播的输出音频的码率。单位为 Kbps,默认值为 48,最大值为 128
+ */
+@property (assign, nonatomic) NSInteger audioBitrate;
+/** 用于旁路直播的输出音频的声道数,默认值为 1。
+
+ 取值范围为 [1,5] 中的整型,建议取 1 或 2。3、4、5需要特殊播放器支持:
+
+ * 1: 单声道
+ * 2: 双声道
+ * 3: 三声道
+ * 4: 四声道
+ * 5: 五声道
+ */
+@property (assign, nonatomic) NSInteger audioChannels;
+/**
+ 用于旁路直播输出音频的编码规格,默认值为 ARAudioCodecProfileLCAAC(0)。详见 ARAudioCodecProfileType。
+ */
+@property (assign, nonatomic) ARAudioCodecProfileType audioCodecProfile;
+
+/** 应用默认的转码设置
+
+ @return 应用默认设置的 ARLiveTranscoding 对象
+ */
++(ARLiveTranscoding *_Nonnull) defaultTranscoding;
+
+/** 添加一个用户到已有的用户中。
+
+ @param user 参数合图的用户,定义详见 ARLiveTranscodingUser 。
+
+ @return 0: 方法调用成功,< 0: 方法调用失败。
+ */
+-(int)addUser:(ARLiveTranscodingUser * _Nonnull)user;
+
+/** 删除转码合图用户
+
+ @param uid 待删除的用户 ID
+
+ @return 0: 方法调用成功,< 0: 方法调用失败。
+ */
+-(int)removeUser:(NSString *_Nonnull)uid;
+
+@end
+
+/** Last mile 网络探测配置 */
+__attribute__((visibility("default"))) @interface ARLastmileProbeConfig : NSObject
+/** 是否探测上行网络带宽。有些用户不需要进行网络探测,如直播频道中的普通观众。
+
+- NO:不探测
+- YES:探测
+*/
+@property (assign, nonatomic) BOOL probeUplink;
+/** 是否探测下行网络带宽
+
+- NO:不探测
+- YES:探测
+*/
+@property (assign, nonatomic) BOOL probeDownlink;
+/** 用户期望的最高发送码率
+
+ 单位为 bps,范围为 [100000,5000000]。anyRTC 推荐参考 setVideoEncoderConfiguration 中的码率值设置该参数的值。 */
+@property (assign, nonatomic) NSUInteger expectedUplinkBitrate;
+/** 用户期望的最高接收码率
+
+ 单位为 bps,范围为 [100000,5000000]。
+*/
+@property (assign, nonatomic) NSUInteger expectedDownlinkBitrate;
+@end
+
+/** 单向网络质量探测结果 */
+__attribute__((visibility("default"))) @interface ARLastmileProbeOneWayResult : NSObject
+/** 网络丢包率,范围 [0,100]。 */
+@property (assign, nonatomic) NSUInteger packetLossRate;
+/** 网络抖动,单位为毫秒。*/
+@property (assign, nonatomic) NSUInteger jitter;
+/** 可用网络带宽预估,单位为 Kbps。*/
+@property (assign, nonatomic) NSUInteger availableBandwidth;
+@end
+
+/** 上下行 last mile 质量探测结果 */
+__attribute__((visibility("default"))) @interface ARLastmileProbeResult : NSObject
+/* Last mile 质量探测结果的状态
+*/
+@property (assign, nonatomic) ARLastmileProbeResultState state;
+/** 往返时延,单位为毫秒 */
+@property (assign, nonatomic) NSUInteger rtt;
+/** 上行网络质量报告
+
+ 包含丢包率、网络抖动和可用带宽预估,详见 ARLastmileProbeOneWayResult。
+*/
+@property (strong, nonatomic) ARLastmileProbeOneWayResult *_Nonnull uplinkReport;
+/** 下行网络质量报告
+
+ 包含丢包率、网络抖动和可用带宽预估,详见 ARLastmileProbeOneWayResult。
+*/
+@property (strong, nonatomic) ARLastmileProbeOneWayResult *_Nonnull downlinkReport;
+@end
+
+/** 设置屏幕共享编码配置的类
+ */
+__attribute__((visibility("default"))) @interface ARScreenCaptureParameters: NSObject
+/** 屏幕共享视频发送的最大像素值
+
+ 默认值为 1920 * 1080,即 2073600 像素。该像素值为计费标准。
+
+ 当共享的屏幕分辨率宽高比与该值设置不一致时,SDK 按如下策略进行编码。假设 dimensions 为 1920 * 1080:
+
+ - 如果屏幕分辨率小于 dimensions,如 1000 * 1000,SDK 直接按 1000 * 1000 进行编码。
+ - 如果屏幕分辨率大于 dimensions,如 2000 * 1500,SDK 按屏幕分辨率的宽高比,即 4:3,取 dimensions 以内的最大分辨率进行编码,即 1440 * 1080。
+ 无论实际编码分辨率如何,均按 dimensions 设置的值计费。
+ */
+@property (assign, nonatomic) CGSize dimensions;
+
+/** 共享视频的帧率,单位为 fps;默认值为 5,建议不要超过 15。
+ */
+@property (assign, nonatomic) NSInteger frameRate;
+
+/** 共享视频的码率,单位为 Kbps;默认值为 0,表示由 SDK 根据当前共享的分辨率计算出一个合理的值。
+ */
+@property (assign, nonatomic) NSInteger bitrate;
+
+/** 是否采集鼠标用于屏幕共享
+
+- YES:(默认)采集鼠标
+- NO:不采集鼠标
+ */
+@property (assign, nonatomic) BOOL captureMouseCursor;
+
+/** 调用 startScreenCaptureByWindowId 方法共享窗口时,是否将该窗口前置。
+
+ - YES:前置窗口。
+ - NO: (默认)不前置窗口。
+ */
+@property (assign, nonatomic) BOOL windowFocus;
+
+/** 待屏蔽窗口的 ID 列表。
+
+ 调用 startScreenCaptureByDisplayId 开启主屏幕共享 (即屏幕 ID 为 0)时,你可以通过该参数屏蔽指定的窗口。开启主屏幕共享后,你可以在调用 updateScreenCaptureParameters 更新屏幕共享的配置参数时,通过该参数动态屏蔽指定的窗口。
+ */
+@property (copy, nonatomic) NSArray * _Nullable excludeWindowList;
+
+@end
+
+#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
+
+/** 提供设备信息的类
+ */
+__attribute__((visibility("default"))) @interface ARtcDeviceInfo : NSObject
+
+/** 设备类型,详见 ARMediaDeviceType
+ */
+@property (assign, nonatomic) ARMediaDeviceType type;
+
+/** 设备 ID
+ */
+@property (copy, nonatomic) NSString * _Nullable deviceId;
+
+/** 设备名称
+ */
+@property (copy, nonatomic) NSString * _Nullable deviceName;
+
+@end
+
+#endif
+
+/** 配置内置加密模式和密钥
+ */
+__attribute__((visibility("default"))) @interface AREncryptionConfig: NSObject
+
+ /** 内置加密模式,默认为 AREncryptionModeAES128XTS 加密模式。详见 AREncryptionMode 。
+ */
+ @property (assign, nonatomic) AREncryptionMode encryptionMode;
+
+ /** 内置加密密钥,字符串类型。
+
+ **Note**
+
+ 如果未指定该参数或将该参数设置为空,则无法启用内置加密,且 SDK 会返回错误码 -2 (ARErrorCodeInvalidArgument)。
+ */
+ @property (copy, nonatomic) NSString * _Nullable encryptionKey;
+ @end
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARStreamingKit.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARStreamingKit.h
new file mode 100644
index 0000000..88d2185
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARStreamingKit.h
@@ -0,0 +1,64 @@
+//
+// ARStreamingKit.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/12/24.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "ARtcEngineKit.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ARStreamingKit : NSObject
+
+/**
+设置RtcEngine对象。
+
+@param rtcKit 一个 ARtcEngineKit 实例对象。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setRtcEngine:(ARtcEngineKit *)rtcKit;
+
+/**
+开始推Rtmp的流
+
+@param url rtmp流地址
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)pushStream:(NSString *_Nonnull)url;
+
+/**
+停止推Rtmp的流
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)unPushStream;
+
+/**
+设置推流模式。
+
+@param mode 推流模式,详见ARStreamPushMode。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setMode:(ARStreamPushMode)mode;
+
+/**
+设置合流参数
+
+@param transcoding 合流参数,详见ARLiveTranscoding。
+*/
+- (int)setLiveTranscoding:(ARLiveTranscoding *_Nonnull)transcoding;
+
+/**
+ 销毁 ARStreamingKit 实例
+*/
+- (void)destroy;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannel.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannel.h
new file mode 100644
index 0000000..bfaa97d
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannel.h
@@ -0,0 +1,256 @@
+//
+// ARtcChannel.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/3/24.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "ARtcEngineKit.h"
+#import "ARObjects.h"
+#import "ARtcChannelDelegate.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ARtcEngineKit()
+
+/** 实例化ARtcChannel对象
+
+@param channelId 当前 ARtcChannel 对象的频道 ID
+*/
+- (ARtcChannel * _Nullable)createRtcChannel:(NSString * _Nonnull)channelId;
+
+@end
+
+@interface ARtcChannel : NSObject
+
+/** 销毁 ARtcChannel 对象
+
+@return channelId 当前 ARtcChannel 对象的频道 ID
+*/
+- (int)destroy;
+
+/** 设置 ARtcChannel 对象的 Delegate
+
+@param channelDelegate ARtcChannelDelegate
+*/
+- (void)setRtcChannelDelegate:(id<ARtcChannelDelegate> _Nullable)channelDelegate;
+
+/** 获取当前 ARtcChannel 对象的频道 ID
+
+@return channelId 当前 ARtcChannel 对象的频道 ID
+*/
+- (NSString * _Nullable)getChannelId;
+
+/** 通过用户 ID 加入频道
+
+@param token 动态密钥
+@param uid 用户 ID
+@param options 频道媒体设置选项 ARtcChannelMediaOptions
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)joinChannelByToken:(NSString * _Nullable)token
+ uid:(NSString * _Nullable)uid
+ options:(ARtcChannelMediaOptions * _Nonnull)options;
+
+/** 离开频道
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)leaveChannel;
+
+/** 将本地音视频流发布到本频道
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)publish;
+
+/** 停止将本地音视频流发布到本频道
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)unpublish;
+
+/** 设置用户角色
+
+该方法仅适用于直播场景。
+
+在加入频道前,用户需要通过本方法设置观众(默认)或主播角色。在直播场景中,只有角色为主播时可调用 publish 方法。
+
+如果你在加入频道后调用该方法切换用户角色,调用成功后会触发以下回调:
+
+- 本地:didClientRoleChanged 回调。
+- 远端:didJoinedOfUid 或 didOfflineOfUid 回调。
+
+@param role 直播场景里的用户角色
+
+- ARClientRoleBroadcaster(1): 直播频道中的主播,可以发布和接收音视频流。
+- ARClientRoleAudience(2): (默认)直播频道中的观众,只可以接收音视频流。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setClientRole:(ARClientRole)role;
+
+/** 更新 Token
+
+该方法用于更新 Token。如果启用了 Token 机制,过一段时间后使用的 Token 会失效。当以下任意一种情况发生时:
+
+- SDK 触发 tokenPrivilegeWillExpire 回调。
+- connectionChangedToState 回调 reason 参数报告 ARConnectionChangedTokenExpired(9)。
+
+App 应重新获取 Token,然后调用该 API 更新 Token,否则 SDK 无法和服务器建立连接。
+
+**Note**
+
+推荐使用 rtcChannelRequestToken 回调报告 ARErrorCodeTokenExpired(-109),而不是 didOccurError 回调.
+
+@param token The new token.
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)renewToken:(NSString *_Nonnull)token;
+
+/** 更新远端视图显示模式
+
+初始化远端用户视图后,你可以调用该方法更新远端用户视图在本地显示时的渲染和镜像模式。该方法只影响本地用户看到的视频画面。
+
+**Note**
+
+ * 请在调用 setupRemoteVideo 方法初始化远端视图后,调用该方法。
+ * 你可以在通话中多次调用该方法,多次更新远端用户视图的显示模式。
+
+@param uid 用户 ID
+@param renderMode 远端用户视图的渲染模式,详见 ARVideoRenderMode ;
+@param mirrorMode 远端用户视图的镜像模式,详见 ARVideoMirrorMode 。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setRemoteRenderMode:(NSString *_Nonnull)uid renderMode:(ARVideoRenderMode)renderMode mirrorMode:(ARVideoMirrorMode)mirrorMode;
+
+/** 设置是否默认接收音频流
+
+该方法在加入频道前后都可调用。如果在加入频道后调用 setDefaultMuteAllRemoteAudioStreams (YES),会接收不到设置后加入频道的用户的音频流。
+
+**Note**
+
+ 停止接收音频流后,如果想要恢复接收,请调用 muteRemoteAudioStream (NO),并指定你想要接收的远端用户 uid;如果想恢复接收多个用户的音频流,则需要多次调用 muteRemoteAudioStream。setDefaultMuteAllRemoteAudioStreams (NO) 只能恢复接收后面加入频道的用户的音频流。
+
+ @param mute 设置是否默认接收音频流:
+
+ * YES: 默认停止接收所有远端音频流
+ * NO: 默认继续接收所有远端音频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setDefaultMuteAllRemoteAudioStreams:(BOOL)mute;
+
+/** 设置是否默认接收视频流
+ 该方法在加入频道前后都可调用。如果在加入频道后调用setDefaultMuteAllRemoteVideoStreams(YES),会接收不到设置后加入频道的用户的视频流。
+
+ **Note**
+
+ 停止接收视频流后,如果想要恢复接收,请调用 muteRemoteVideoStream (NO),并指定你想要接收的远端用户 uid;如果想恢复接收多个用户的视频流,则需要多次调用 muteRemoteVideoStream。setDefaultMuteAllRemoteVideoStreams (NO) 只能恢复接收后面加入频道的用户的视频流。
+
+ @param mute 是否默认接收视频流
+
+ * YES: 不接收
+ * NO: 接收
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setDefaultMuteAllRemoteVideoStreams:(BOOL)mute;
+
+/** 停止/恢复接收指定用户的音频流
+
+**Note**
+
+ 如果之前有调用过 muteAllRemoteAudioStreams(YES) 对所有远端音频进行静音,在调用本 API 之前请确保你已调用 muteAllRemoteAudioStreams(NO)。 muteAllRemoteAudioStreams 是全局控制,muteRemoteAudioStream 是精细控制。
+
+ @param uid 指定用户的用户 ID
+ @param mute 停止/恢复接收指定用户的音频流:
+
+ * YES: 停止接收指定音频流
+ * NO: 继续接收指定音频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteRemoteAudioStream:(NSString *_Nonnull)uid mute:(BOOL)mute;
+
+/** 调节本地播放的指定远端用户音量
+
+加入频道后,你可以多次调用该方法调节不同远端用户在本地播放的音量,或对某个远端用户在本地播放的音量调节多次。
+
+**Note**
+
+- 该方法要在加入频道后调用。
+- 该方法调节的是本地播放的指定远端用户混音后的音量。
+- 该方法每次只能调整一位远端用户在本地播放的音量。若需调整多位远端用户在本地播放的音量,则需多次调用该方法。
+
+@param uid 远端用户 ID,需和远端用户加入频道时用的 uid 一致。
+@param volume 播放音量,取值范围为 [0,100]。
+
+- 0: 静音
+- 100: 原始音量
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)adjustUserPlaybackSignalVolume:(NSString *_Nonnull)uid volume:(int)volume;
+
+/** 停止/恢复接收所有远端音频流
+
+@param mute YES: 停止接收所有远端音频流;NO: 继续接收所有远端音频流(默认)。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)muteAllRemoteAudioStreams:(BOOL)mute;
+
+/** 停止/恢复接收指定视频流
+
+**Note**
+
+ 如果之前有调用过 muteAllRemoteVideoStreams(YES) 暂停接收所有远端视频,在调用本 API 之前请确保你已调用 muteAllRemoteVideoStreams(NO)。 muteAllRemoteVideoStreams 是全局控制,muteRemoteVideoStream 是精细控制。
+
+ @param uid 远端用户ID
+ @param mute 停止/恢复接收指定视频流:
+ * YES: 停止接收指定用户的视频流
+ * NO: 允许接收指定用户的视频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteRemoteVideoStream:(NSString *_Nonnull)uid mute:(BOOL)mute;
+
+/** 停止/恢复接收所有视频流
+
+ @param mute 禁止/允许接收所有人的视频流
+
+ * YES: 停止接收所有视频流
+ * NO: 允许接收所有视频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteAllRemoteVideoStreams:(BOOL)mute;
+
+/** 设置订阅的视频流类型
+
+ 如果发送端选择发送视频双流(大流或小流),接收端可以选择接收大流还是小流。其中大流可以理解为高分辨率高码率的视频流,小流则是低分辨率低码率的视频流。该方法可以根据视频窗口的大小动态调整对应视频流的大小,以节约带宽和计算资源。
+
+@param uid 用户 ID
+@param streamType 设置视频流大小,详见ARVideoStreamType
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setRemoteVideoStream:(NSString *_Nonnull)uid type:(ARVideoStreamType)streamType;
+
+/** 设置默认订阅的视频流类型
+
+ @param streamType 设置默认接收的视频流类型,详见 ARVideoStreamType 。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setRemoteDefaultVideoStreamType:(ARVideoStreamType)streamType;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannelDelegate.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannelDelegate.h
new file mode 100644
index 0000000..1a887f2
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcChannelDelegate.h
@@ -0,0 +1,216 @@
+//
+// ARtcChannelDelegate.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/3/24.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#ifndef ARtcChannelDelegate_h
+#define ARtcChannelDelegate_h
+
+@protocol ARtcChannelDelegate <NSObject>
+
+@optional
+
+/** 发生警告回调
+
+@param rtcChannel ARtcChannel 类。
+@param warningCode ARWarningCode
+*/
+- (void)rtcChannel:(ARtcChannel *_Nonnull)rtcChannel didOccurWarning:(ARWarningCode)warningCode;
+
+/** 发生错误回调
+
+@param rtcChannel ARtcChannel 类。
+@param errorCode ARErrorCode
+*/
+- (void)rtcChannel:(ARtcChannel *_Nonnull)rtcChannel didOccurError:(ARErrorCode)errorCode;
+
+/** 加入频道回调
+
+@param rtcChannel ARtcChannel 类。
+@param uid 用户ID
+@param elapsed 从调用joinChannelByToken开始到发生此事件过去的时间(ms)。
+*/
+- (void)rtcChannelDidJoinChannel:(ARtcChannel *_Nonnull)rtcChannel withUid:(NSString *_Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 重新加入频道回调
+
+@param rtcChannel ARtcChannel 类。
+@param uid 用户ID
+@param elapsed 从开始重连到重连成功的时间(ms)。
+*/
+- (void)rtcChannelDidRejoinChannel:(ARtcChannel *_Nonnull)rtcChannel withUid:(NSString *_Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 已离开频道回调
+
+当用户调用 leaveChannel 离开频道后,SDK 会触发该回调。在该回调方法中,App 可以得到此次通话的总通话时长、SDK 收发数据的流量等信息。
+
+@param rtcChannel ARtcChannel 类。
+@param stats 通话相关的统计信息:ARChannelStats
+*/
+- (void)rtcChannelDidLeaveChannel:(ARtcChannel *_Nonnull)rtcChannel withStats:(ARChannelStats *_Nonnull)stats;
+
+/** 用户角色已切换回调
+
+直播场景下,当本地用户在加入频道后调用 setClientRole 切换角色时会触发此回调,即主播切换为观众时,或观众切换为主播时。
+
+@param rtcChannel ARtcChannel 类。
+@param oldRole 切换前的角色
+@param newRole 切换后的角色
+*/
+- (void)rtcChannel:(ARtcChannel *_Nonnull)rtcChannel didClientRoleChanged:(ARClientRole)oldRole newRole:(ARClientRole)newRole;
+
+/** 远端用户/主播加入回调
+
+@param rtcChannel ARtcChannel 类。
+@param uid 新加入频道的远端用户/主播 ID。如果 joinChannelByToken 中指定了 uid,则此处返回该 ID;否则使用ar云平台服务器自动分配的 ID。
+@param elapsed 从本地用户加入频道 joinChannelByToken开始到发生此事件过去的时间(ms)。
+*/
+- (void)rtcChannel:(ARtcChannel *_Nonnull)rtcChannel didJoinedOfUid:(NSString *_Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 远端用户(通信场景)/主播(直播场景)离开当前频道回调
+
+@param rtcChannel ARtcChannel 类。
+@param uid 离线的用户 ID。
+@param reason 离线原因,详见 ARUserOfflineReason。
+*/
+- (void)rtcChannel:(ARtcChannel *_Nonnull)rtcChannel didOfflineOfUid:(NSString *_Nonnull)uid reason:(ARUserOfflineReason)reason;
+
+/** 网络连接状态已改变回调
+
+该回调在网络连接状态发生改变的时候触发,并告知用户当前的网络连接状态,和引起网络状态改变的原因。
+
+@param rtcChannel ARtcChannel 类。
+@param state 当前的网络连接状态,详见 ARConnectionStateType。
+@param reason 引起网络连接状态发生改变的原因,详见 ARConnectionChangedReason。
+*/
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel connectionChangedToState:(ARConnectionStateType)state reason:(ARConnectionChangedReason)reason;
+
+/** 网络连接中断,且 SDK 无法在 10 秒内连接服务器回调
+
+SDK 在调用 joinChannelByToken 后无论是否加入成功,只要 10 秒和服务器无法连接就会触发该回调。
+
+如果 SDK 在断开连接后,20 分钟内还是没能重新加入频道,SDK 会停止尝试重连。
+
+@param rtcChannel ARtcChannel 类。
+ */
+- (void)rtcChannelDidLost:(ARtcChannel * _Nonnull)rtcChannel;
+
+/** Token 服务即将过期回调
+
+ 在调用 joinChannelByToken 时如果指定了 Token,由于 Token 具有一定的时效,在通话过程中如果 Token 即将失效,SDK 会提前 30 秒触发该回调,提醒应用程序更新 Token。 当收到该回调时,用户需要重新在服务端生成新的 Token,然后调用 renewToken 将新生成的 Token 传给 SDK。
+
+ @param rtcChannel ARtcChannel 类。
+ @param token 即将服务失效的 Token
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel tokenPrivilegeWillExpire:(NSString *_Nonnull)token;
+
+/** Token 过期回调
+
+在调用 joinChannelByToken 时如果指定了 Token,由于 Token 具有一定的时效,在通话过程中 SDK 可能由于网络原因和服务器失去连接,重连时可能需要新的 Token。 该回调通知 App 需要生成新的 Token,并需调用 renewToken 为 SDK 指定新的 Token。
+
+@param rtcChannel ARtcChannel 类。
+*/
+- (void)rtcChannelRequestToken:(ARtcChannel *_Nonnull)rtcChannel;
+
+/** 监测到活跃用户的回调
+
+该回调获取当前时间段内累积音量最大者。如果用户开启了 enableAudioVolumeIndication 功能,则当音量检测模块监测到频道内有新的活跃用户说话时,会通过本回调返回该用户的 uid。
+
+**Note**
+- 你需要开启 enableAudioVolumeIndication 方法才能收到该回调
+- uid 返回的是当前时间段内声音最大的用户 uid,而不是瞬时声音最大的用户 uid。
+
+ @param rtcChannel ARtcChannel 类。
+ @param speakerUid 当前时间段声音最大的用户的 uid。
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel activeSpeaker:(NSString * _Nonnull)speakerUid;
+
+/** 本地或远端视频大小和旋转信息发生改变回调
+
+ @param rtcChannel ARtcChannel 类。
+ @param uid 图像尺寸和旋转信息发生变化的用户的用户 ID
+ @param size 新的视频尺寸
+ @param rotation 旋转信息 (0 到 360)
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel videoSizeChangedOfUid:(NSString *_Nonnull)uid size:(CGSize)size rotation:(NSInteger)rotation;
+
+/** 远端视频状态发生改变回调
+
+@param rtcChannel ARtcChannel 类。
+@param uid 发生视频状态改变的远端用户 ID。
+@param state 远端视频流状态。详见 ARVideoRemoteState。
+@param reason 远端视频流状态改变的具体原因。详见 ARVideoRemoteStateReason。
+@param elapsed 从本地用户调用 joinChannelByToken 方法到发生本事件经历的时间,单位为 ms。
+*/
+- (void)rtcChannel:(ARtcChannel *_Nonnull)rtcChannel remoteVideoStateChangedOfUid:(NSString *_Nonnull)uid state:(ARVideoRemoteState)state reason:(ARVideoRemoteStateReason)reason elapsed:(NSInteger)elapsed;
+
+/** 远端音频流状态发生改变回调。
+
+ 远端用户/主播音频状态发生改变时,SDK 会触发该回调向本地用户报告当前的远端音频流状态。
+
+ @param rtcChannel ARtcChannel 类。
+ @param uid 发生音频状态改变的远端用户 ID。
+ @param state 远端音频流状态。详见 ARAudioRemoteState。
+ @param reason 远端音频流状态改变的具体原因。详见 ARAudioRemoteStateReason。
+ @param elapsed 从本地用户调用 joinChannelByToken 方法到发生本事件经历的时间,单位为 ms。
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel remoteAudioStateChangedOfUid:(NSString *_Nonnull)uid state:(ARAudioRemoteState)state reason:(ARAudioRemoteStateReason)reason elapsed:(NSInteger)elapsed;
+
+/** 当前通话统计回调。 该回调在通话或直播中每两秒触发一次。
+
+ @param rtcChannel ARtcChannel 类。
+ @param stats 通话相关的数据统计信息,详见 ARChannelStats
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel reportRtcStats:(ARChannelStats * _Nonnull)stats;
+
+/** 通话中每个用户的网络上下行 last mile 质量报告回调
+
+ 该回调描述每个用户在通话中的 last mile 网络状态,其中 last mile 是指设备到 ar云平台 边缘服务器的网络状态。
+
+ 该回调每 2 秒触发一次。如果远端有多个用户,该回调每 2 秒会被触发多次。
+
+ @param rtcChannel ARtcChannel 类。
+ @param uid 用户 ID。表示该回调报告的是持有该 ID 的用户的网络质量。
+ @param txQuality
+
+ 该用户的上行网络质量。基于上行视频的发送码率、上行丢包率、平均往返时延和网络抖动计算。该值代表当前的上行网络质量,帮助判断是否可以支持当前设置的视频编码属性。
+
+ 假设上行码率是 500 Kbps,那么支持 480 x 480 的分辨率、30 fps 的帧率没有问题,但是支持 1280 x 720 的分辨率就会有困难。详见 ARNetworkQuality。
+
+ @param rxQuality 该用户的下行网络质量。基于下行网络的丢包率、平均往返延时和网络抖动计算。详见 ARNetworkQuality。
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel networkQuality:(NSString * _Nonnull)uid txQuality:(ARNetworkQuality)txQuality rxQuality:(ARNetworkQuality)rxQuality;
+
+/** 通话中远端视频流的统计信息回调
+
+ 该回调描述远端用户在通话中端到端的视频流统计信息,针对每个远端用户/主播每 2 秒触发一次。
+
+ 如果远端同时存在多个用户/主播,该回调每 2 秒会被触发多次。
+
+ @param rtcChannel ARtcChannel 类。
+ @param stats 远端视频统计数据,详见 ARtcRemoteVideoStats
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel remoteVideoStats:(ARtcRemoteVideoStats * _Nonnull)stats;
+
+/** 通话中远端音频流的统计信息回调,用于取代 audioQualityOfUid
+
+ 该回调描述远端用户在通话中端到端的音频流统计信息,针对每个远端用户/主播每 2 秒触发一次。
+
+ 如果远端同时存在多个用户/主播,该回调每 2 秒会被触发多次。
+
+ 和 audioTransportStatsOfUid 回调相比,该回调更贴近用户的主观感受。
+
+ 比如,当网络发生丢包时,因 FEC(Forward Error Correction,向前纠错码)或重传恢复,最终的音频丢帧率不高,则可以认为整个质量较好。
+
+ @param rtcChannel ARtcChannel 类。
+ @param stats 远端音频统计数据,详细定义见 ARtcRemoteAudioStats。
+ */
+- (void)rtcChannel:(ARtcChannel * _Nonnull)rtcChannel remoteAudioStats:(ARtcRemoteAudioStats * _Nonnull)stats;
+
+@end
+
+
+#endif /* ARtcChannelDelegate_h */
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineDelegate.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineDelegate.h
new file mode 100644
index 0000000..5aef1d6
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineDelegate.h
@@ -0,0 +1,915 @@
+//
+// ARtcEngineDelegate.h
+// ARtcKit
+//
+// Created by 余生丶 on 2020/3/18.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#ifndef ARtcEngineDelegate_h
+#define ARtcEngineDelegate_h
+#import "AREnumerates.h"
+#import "ARObjects.h"
+
+@class ARtcEngineKit;
+
+@protocol ARtcEngineDelegate <NSObject>
+
+@optional
+
+//MARK: - 核心事件回调
+/**-----------------------------------------------------------------------------
+* @name 核心事件回调
+* -----------------------------------------------------------------------------
+*/
+
+/** 发生警告回调
+
+@param engine ARtcEngineKit对象
+@param warningCode 警告码,详见 ARWarningCode
+*/
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didOccurWarning:(ARWarningCode)warningCode;
+
+/** 发生错误回调
+
+@param engine ARtcEngineKit对象
+@param errorCode 错误码,详见 ARErrorCode
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didOccurError:(ARErrorCode)errorCode;
+
+/** 加入频道回调
+
+@param engine ARtcEngineKit对象
+@param channel 频道名称
+@param uid 用户ID
+@param elapsed 从调用joinChannelByToken开始到发生此事件过去的时间(ms)。
+*/
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didJoinChannel:(NSString * _Nonnull)channel withUid:(NSString * _Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 重新加入频道回调
+
+有时候由于网络原因,客户端可能会和服务器失去连接,SDK 会进行自动重连,自动重连成功后触发此回调方法。
+
+@param engine ARtcEngineKit对象
+@param channel 频道名称
+@param uid 用户ID
+@param elapsed 从开始重连到重连成功的时间(ms)。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didRejoinChannel:(NSString *_Nonnull)channel withUid:(NSString * _Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 已离开频道回调
+
+ 当用户调用 leaveChannel 离开频道后,SDK 会触发该回调。在该回调方法中,App 可以得到此次通话的总通话时长、SDK 收发数据的流量等信息。
+
+ @param engine ARtcEngineKit对象
+ @param stats 通话相关的统计信息,详见 ARChannelStats
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didLeaveChannelWithStats:(ARChannelStats * _Nonnull)stats;
+
+/** 用户角色已切换回调
+
+直播场景下,当本地用户在加入频道后调用 setClientRole 切换角色时会触发此回调,即主播切换为观众时,或观众切换为主播时。
+
+@param engine ARtcEngineKit对象
+@param oldRole 切换前的角色
+@param newRole 切换后的角色
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didClientRoleChanged:(ARClientRole)oldRole newRole:(ARClientRole)newRole;
+
+/** 远端用户/主播加入回调
+
+@param engine ARtcEngineKit对象
+@param uid 新加入频道的远端用户/主播 ID。如果 joinChannelByToken 中指定了 uid,则此处返回该 ID;否则使用ar云平台服务器自动分配的 ID。
+@param elapsed 从本地用户加入频道 joinChannelByToken开始到发生此事件过去的时间(ms)。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didJoinedOfUid:(NSString *_Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 远端用户(通信场景)/主播(直播场景)离开当前频道回调
+
+@param engine ARtcEngineKit对象
+@param uid 离线的用户 ID。
+@param reason 离线原因,详见 ARUserOfflineReason。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didOfflineOfUid:(NSString *_Nonnull)uid reason:(ARUserOfflineReason)reason;
+
+/** 网络连接状态已改变回调
+
+该回调在网络连接状态发生改变的时候触发,并告知用户当前的网络连接状态,和引起网络状态改变的原因。
+
+@param engine ARtcEngineKit对象
+@param state 当前的网络连接状态,详见 ARConnectionStateType。
+@param reason 引起网络连接状态发生改变的原因,详见 ARConnectionChangedReason。
+*/
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine connectionChangedToState:(ARConnectionStateType)state reason:(ARConnectionChangedReason)reason;
+
+/** 本地网络类型发生改变回调
+
+@param engine ARtcEngineKit对象
+@param type 网络连接类型,详见 ARNetworkType。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine networkTypeChangedToType:(ARNetworkType)type;
+
+/** 网络连接中断,且 SDK 无法在 10 秒内连接服务器回调
+
+@param engine ARtcEngineKit对象
+*/
+- (void)rtcEngineConnectionDidLost:(ARtcEngineKit *_Nonnull)engine;
+
+/** Token 服务即将过期回调
+
+ 在调用 joinChannelByToken 时如果指定了 Token,由于 Token 具有一定的时效,在通话过程中如果 Token 即将失效,SDK 会提前 30 秒触发该回调,提醒应用程序更新 Token。 当收到该回调时,用户需要重新在服务端生成新的 Token,然后调用 renewToken 将新生成的 Token 传给 SDK。
+
+ @param engine ARtcEngineKit 对象
+ @param token 即将服务失效的 Token
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine tokenPrivilegeWillExpire:(NSString *_Nonnull)token;
+
+/** Token 过期回调
+
+ 在调用 joinChannelByToken 时如果指定了 Token,由于 Token 具有一定的时效,在通话过程中 SDK 可能由于网络原因和服务器失去连接,重连时可能需要新的 Token。 该回调通知 App 需要生成新的 Token,并需调用 renewToken 为 SDK 指定新的 Token。
+
+ @param engine ARtcEngineKit 对象
+ */
+- (void)rtcEngineRequestToken:(ARtcEngineKit * _Nonnull)engine;
+
+
+//MARK: - 媒体事件回调
+/**-----------------------------------------------------------------------------
+* @name 媒体事件回调
+* -----------------------------------------------------------------------------
+*/
+
+/** 提示频道内谁正在说话、说话者音量及本地用户是否在说话的回调
+
+ 与 audioVolumeIndicationBlock 相同。
+
+ 该回调报告频道内瞬时音量最高的几个用户(最多三个用户)的用户 ID、他们的音量及本地用户是否在说话。
+
+ 该回调默认禁用。可以通过 enableAudioVolumeIndication 方法开启;开启后,无论频道内是否有人说话,SDK 都会按 enableAudioVolumeIndication 方法中设置的时间间隔触发 reportAudioVolumeIndicationOfSpeakers 回调。每次触发,用户会收到两个独立的 reportAudioVolumeIndicationOfSpeakers 回调,其中一个包含本地用户的音量信息,另一个包含远端所有用户的音量信息,详见下方参数描述。
+
+**Note:**
+
+ - 若需使用该回调 speakers 数组中的 vad 参数(即本地人声检测功能),请在 enableAudioVolumeIndication 方法中设置 report_vad 为 YES 。
+ - 如果有用户将自己静音(调用了 muteLocalAudioStream ),会对该回调的行为产生影响。
+ - 本地用户静音后 SDK 即不再报告本地用户的音量提示回调。
+ - 远端说话者静音后 20 秒,远端的音量提示回调中将不再包含该用户;如果远端所有用户都将自己静音,20 秒后 SDK 不再报告远端用户的音量提示回调。
+
+ @param engine ARtcEngineKit 对象
+ @param speakers ARtcAudioVolumeInfo 数组。
+
+ - 在本地用户的回调中,此数组中包含以下成员:
+ - `uid` = 0,
+ - volume 等于 totalVolume,返回本地用户混音后的音量;
+ - vad,返回本地用户人声状态。
+
+ - 在远端用户的回调中,此数组中包含以下成员:
+ - uid 为每位说话者各自的用户 ID;
+ - volume 为说话者各自混音后的音量;
+ - vad = 0,对远端用户无效。 如果报告的 speakers 数组为空,则表示此时远端没有人说话。
+
+ @param totalVolume (混音后的)总音量,取值范围为 [0,255]。
+
+ - 在本地用户的回调中,totalVolume 为本地用户混音后的音量。
+ - 在远端用户的回调中,totalVolume 为所有说话者混音后的总音量。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine reportAudioVolumeIndicationOfSpeakers:(NSArray<ARtcAudioVolumeInfo *> * _Nonnull)speakers totalVolume:(NSInteger)totalVolume;
+
+/** 监测到活跃用户的回调
+
+该回调获取当前时间段内累积音量最大者。如果用户开启了 enableAudioVolumeIndication 功能,则当音量检测模块监测到频道内有新的活跃用户说话时,会通过本回调返回该用户的 uid。
+
+**Note**
+- 你需要开启 enableAudioVolumeIndication 方法才能收到该回调
+- uid 返回的是当前时间段内声音最大的用户 uid,而不是瞬时声音最大的用户 uid。
+
+ @param engine ARtcEngineKit 对象
+ @param speakerUid 当前时间段声音最大的用户的 uid。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine activeSpeaker:(NSString * _Nonnull)speakerUid;
+
+/** 已发送本地音频首帧的回调
+
+ @param engine ARtcEngineKit 对象
+ @param elapsed 从本地用户调用joinChannelByToken开始到发生此事件过去的时间(ms)。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine firstLocalAudioFrame:(NSInteger)elapsed;
+
+ /** 已显示本地视频首帧的回调
+
+ 第一帧本地视频显示时,触发此回调。
+
+ @param engine ARtcEngineKit 对象
+ @param size 本地渲染的视频尺寸(宽度和高度)
+ @param elapsed 从本地用户调用joinChannelByToken到发生此事件过去的时间(ms)。 如果在joinChannelByToken前调用了startPreview,是从startPreview到发生此事件过去的时间。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine firstLocalVideoFrameWithSize:(CGSize)size elapsed:(NSInteger)elapsed;
+
+/** 远端音频流状态发生改变回调。
+
+ 远端用户/主播音频状态发生改变时,SDK 会触发该回调向本地用户报告当前的远端音频流状态。
+
+ @param engine ARtcEngineKit 对象
+ @param uid 发生音频状态改变的远端用户 ID。
+ @param state 远端音频流状态。详见 ARAudioRemoteState。
+ @param reason 远端音频流状态改变的具体原因。详见 ARAudioRemoteStateReason。
+ @param elapsed 从本地用户调用 joinChannelByToken 方法到发生本事件经历的时间,单位为 ms。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine remoteAudioStateChangedOfUid:(NSString *_Nonnull)uid state:(ARAudioRemoteState)state reason:(ARAudioRemoteStateReason)reason elapsed:(NSInteger)elapsed;
+
+/** 本地音频状态发生改变回调。
+
+ 本地音频的状态发生改变时(包括本地麦克风录制状态和音频编码状态),SDK会触发该回调报告当前的本地音频状态。在本地音频出现故障时,该回调可以帮助你了解当前音频的状态以及出现故障的原因,方便你排查问题。
+
+ **Note:**
+
+ 当状态为 ARAudioLocalStateFailed(3) 时,你可以在 error 参数中查看返回的错误信息。
+
+ @param engine ARtcEngineKit 对象
+ @param state 当前的本地音频状态。详见 ARAudioLocalState。
+ @param error 本地音频出错原因。详见 ARAudioLocalError。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine localAudioStateChange:(ARAudioLocalState)state error:(ARAudioLocalError)error;
+
+/** 已显示远端视频首帧回调
+
+@param engine ARtcEngineKit 对象
+@param uid 远端用户 ID
+@param size 视频尺寸(宽和高)
+@param elapsed 从本地用户调用joinChannelByToken到发生此事件过去的时间(ms)。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine firstRemoteVideoFrameOfUid:(NSString *_Nonnull)uid size:(CGSize)size elapsed:(NSInteger)elapsed;
+
+/** 音频发布状态改变回调
+
+ 本地音频的发布状态发生改变时,SDK会触发该回调报告当前的本地音频发布状态。
+
+ @param engine ARtcEngineKit 对象
+ @param channel 频道名
+ @param oldState 之前的发布状态,详见 ARStreamPublishState 。
+ @param newState 当前的发布状态,详见 ARStreamPublishState 。
+ @param elapseSinceLastState 两次状态变化时间间隔(毫秒)。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didAudioPublishStateChange:(NSString *_Nonnull)channel oldState:(ARStreamPublishState)oldState newState:(ARStreamPublishState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState;
+
+/** 视频发布状态改变回调
+
+ 本地视频的发布状态发生改变时,SDK会触发该回调报告当前的本地视频发布状态。
+
+ @param engine ARtcEngineKit 对象
+ @param channel 频道名
+ @param oldState 之前的发布状态,详见 ARStreamPublishState 。
+ @param newState 当前的发布状态,详见 ARStreamPublishState 。
+ @param elapseSinceLastState 两次状态变化时间间隔(毫秒)。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didVideoPublishStateChange:(NSString *_Nonnull)channel oldState:(ARStreamPublishState)oldState newState:(ARStreamPublishState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState;
+
+/** 音频订阅状态发生改变回调
+
+ 本地订阅远程音频的状态发生改变时,SDK会触发该回调报告当前订阅远程音频的状态。
+
+ @param engine ARtcEngineKit 对象
+ @param channel 频道名
+ @param uid 远端用户的 ID
+ @param oldState 之前的订阅状态,详见 ARStreamSubscribeState 。
+ @param newState 当前的订阅状态,详见 ARStreamSubscribeState 。
+ @param elapseSinceLastState 两次状态变化时间间隔(毫秒)。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didAudioSubscribeStateChange:(NSString *_Nonnull)channel withUid:(NSString * _Nonnull)uid oldState:(ARStreamSubscribeState)oldState newState:(ARStreamSubscribeState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState;
+
+/** 视频订阅状态发生改变回调
+
+ 本地订阅远程视频的状态发生改变时,SDK会触发该回调报告当前订阅远程视频的状态。
+
+ @param engine ARtcEngineKit 对象
+ @param channel 频道名
+ @param uid 远端用户的 ID
+ @param oldState 之前的订阅状态,详见 ARStreamSubscribeState 。
+ @param newState 当前的订阅状态,详见 ARStreamSubscribeState 。
+ @param elapseSinceLastState 两次状态变化时间间隔(毫秒)。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didVideoSubscribeStateChange:(NSString *_Nonnull)channel withUid:(NSString * _Nonnull)uid oldState:(ARStreamSubscribeState)oldState newState:(ARStreamSubscribeState)newState elapseSinceLastState:(NSInteger)elapseSinceLastState;
+
+/** 本地或远端视频大小和旋转信息发生改变回调
+
+ @param engine ARtcEngineKit 对象
+ @param uid 图像尺寸和旋转信息发生变化的用户的用户 ID
+ @param size 新的视频尺寸
+ @param rotation 旋转信息 (0 到 360)
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine videoSizeChangedOfUid:(NSString *_Nonnull)uid size:(CGSize)size rotation:(NSInteger)rotation;
+
+/** 远端视频状态发生改变回调
+
+@param engine ARtcEngineKit 对象。
+@param uid 发生视频状态改变的远端用户 ID。
+@param state 远端视频流状态。详见 ARVideoRemoteState。
+@param reason 远端视频流状态改变的具体原因。详见 ARVideoRemoteStateReason。
+@param elapsed 从本地用户调用 joinChannelByToken 方法到发生本事件经历的时间,单位为 ms。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine remoteVideoStateChangedOfUid:(NSString *_Nonnull)uid state:(ARVideoRemoteState)state reason:(ARVideoRemoteStateReason)reason elapsed:(NSInteger)elapsed;
+
+/** 本地视频状态发生改变回调
+
+本地视频的状态发生改变时,SDK 会触发该回调返回当前的本地视频状态。
+
+在本地视频出现故障时,你可以通过该回调了解当前视频的状态以及出现故障的原因,方便排查问题。
+
+ @param engine ARtcEngineKit 对象。
+ @param state 本地视频状态,详见 ARLocalVideoStreamState。当本地视频状态为 ARLocalVideoStreamStateFailed(3) 时,你可以在 error 参数中查看返回的错误原因。
+ @param error 本地视频出错原因,详见 ARLocalVideoStreamError。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine localVideoStateChange:(ARLocalVideoStreamState)state error:(ARLocalVideoStreamError)error;
+
+//MARK: - 统计数据事件回调
+/**-----------------------------------------------------------------------------
+* @name 统计数据事件回调
+* -----------------------------------------------------------------------------
+*/
+
+/** 通话中远端音频流的统计信息回调,用于取代 audioQualityOfUid
+
+ 该回调描述远端用户在通话中端到端的音频流统计信息,针对每个远端用户/主播每 2 秒触发一次。
+
+ 如果远端同时存在多个用户/主播,该回调每 2 秒会被触发多次。
+
+ 和 audioTransportStatsOfUid 回调相比,该回调更贴近用户的主观感受。
+
+ 比如,当网络发生丢包时,因 FEC(Forward Error Correction,向前纠错码)或重传恢复,最终的音频丢帧率不高,则可以认为整个质量较好。
+
+ @param engine ARtcEngineKit 对象。
+ @param stats 远端音频统计数据,详细定义见 ARtcRemoteAudioStats。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine remoteAudioStats:(ARtcRemoteAudioStats * _Nonnull)stats;
+
+
+/** 当前通话统计回调。 该回调在通话或直播中每两秒触发一次。
+
+ @param engine ARtcEngineKit 对象。
+ @param stats 通话相关的数据统计信息,详见 ARChannelStats
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine reportRtcStats:(ARChannelStats * _Nonnull)stats;
+
+/** 通话前网络上下行 last mile 质量报告回调
+
+ 该回调描述本地用户在加入频道前的 last mile 网络探测的结果,其中 last mile 是指设备到 边缘服务器的网络状态。
+
+ 在调用 enableLastmileTest 之后,该回调每 2 秒触发一次。
+
+ @param engine ARtcEngineKit 对象。
+ @param quality 网络上下行质量,基于上下行网络的丢包率和抖动计算,探测结果主要反映上行网络的状态。详见 ARNetworkQuality。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine lastmileQuality:(ARNetworkQuality)quality;
+
+/** 通话中每个用户的网络上下行 last mile 质量报告回调
+
+ 该回调描述每个用户在通话中的 last mile 网络状态,其中 last mile 是指设备到 ar云平台 边缘服务器的网络状态。
+
+ 该回调每 2 秒触发一次。如果远端有多个用户,该回调每 2 秒会被触发多次。
+
+ @param engine ARtcEngineKit 对象
+ @param uid 用户 ID。表示该回调报告的是持有该 ID 的用户的网络质量。
+ @param txQuality
+
+ 该用户的上行网络质量。基于上行视频的发送码率、上行丢包率、平均往返时延和网络抖动计算。该值代表当前的上行网络质量,帮助判断是否可以支持当前设置的视频编码属性。
+
+ 假设上行码率是 500 Kbps,那么支持 480 x 480 的分辨率、30 fps 的帧率没有问题,但是支持 1280 x 720 的分辨率就会有困难。详见 ARNetworkQuality。
+
+ @param rxQuality 该用户的下行网络质量。基于下行网络的丢包率、平均往返延时和网络抖动计算。详见 ARNetworkQuality。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine networkQuality:(NSString * _Nonnull)uid txQuality:(ARNetworkQuality)txQuality rxQuality:(ARNetworkQuality)rxQuality;
+
+/** 通话前网络质量探测报告回调
+
+ 通话前网络上下行 last mile 质量探测报告回调。在调用 startLastmileProbeTest 之后,SDK 会在约 30 秒内返回该回调。
+
+ @param engine ARtcEngineKit 对象
+ @param result 上下行 last mile 质量探测结果,详见 ARLastmileProbeResult。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine lastmileProbeTestResult:(ARLastmileProbeResult * _Nonnull)result;
+
+/** 本地视频流统计信息回调
+
+ @param engine ARtcEngineKit 对象。
+ @param stats 报告更新本地视频统计信息,该回调方法每两秒触发一次。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine localVideoStats:(ARtcLocalVideoStats * _Nonnull)stats;
+
+/** 通话中本地音频流的统计信息回调。
+
+ 该回调描述本地设备发送音频流的统计信息。SDK 每 2 秒触发该回调一次。
+
+ @param engine ARtcEngineKit 对象。
+ @param stats 本地音频统计数据。详见 ARtcLocalAudioStats。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine localAudioStats:(ARtcLocalAudioStats * _Nonnull)stats;
+
+/** 通话中远端视频流的统计信息回调
+
+ 该回调描述远端用户在通话中端到端的视频流统计信息,针对每个远端用户/主播每 2 秒触发一次。
+
+ 如果远端同时存在多个用户/主播,该回调每 2 秒会被触发多次。
+
+
+ @param engine ARtcEngineKit 对象。
+ @param stats 远端视频统计数据,详见 ARtcRemoteVideoStats
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine remoteVideoStats:(ARtcRemoteVideoStats * _Nonnull)stats;
+
+//MARK: - 音频播放事件回调
+/**-----------------------------------------------------------------------------
+* @name 音频播放事件回调
+* -----------------------------------------------------------------------------
+*/
+
+/** 本地音乐文件播放已结束回调
+
+本地用户调用 startAudioMixing 播放音乐文件音乐结束后,会触发该回调。如果调用 startAudioMixing 失败,会在 didOccurWarning 回调里,返回警告代码 ARWarningCodeAudioMixingOpenError。
+
+@param engine ARtcEngineKit 对象。
+*/
+- (void)rtcEngineLocalAudioMixingDidFinish:(ARtcEngineKit *_Nonnull)engine;
+
+/** 本地音效文件播放已结束回调
+
+ 当调用 playEffect 播放音效结束后,会触发该回调。
+
+ @param engine ARtcEngineKit 对象。
+ @param soundId 自行设定的音效 ID,需保证唯一性。
+ */
+- (void)rtcEngineDidAudioEffectFinish:(ARtcEngineKit * _Nonnull)engine soundId:(NSInteger)soundId;
+
+//MARK: - CDN 旁路推流事件回调
+
+/**-----------------------------------------------------------------------------
+ * @name CDN 旁路推流事件回调
+ * -----------------------------------------------------------------------------
+ */
+
+/** RTMP 推流状态发生改变回调
+
+ 该回调返回本地用户调用 addPublishStreamUrl 或 removePublishStreamUrl 方法的结果。
+
+ RTMP 推流状态发生改变时,SDK 会触发该回调,并在回调中明确状态发生改变的 URL 地址及当前推流状态。
+
+ 该回调方便推流用户了解当前的推流状态;推流出错时,你可以通过返回的错误码了解出错的原因,方便排查问题。
+
+@param engine ARtcEngineKit 对象。
+@param url 推流状态发生改变的 URL 地址。
+@param state 当前的推流状态,详见 ARtmpStreamingState。当推流状态为 ARtmpStreamingStateFailure(4) 时,你可以在 errorCode 参数中查看返回的错误信息。
+@param errorCode 具体的推流错误信息,详见 ARtmpStreamingErrorCode。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine rtmpStreamingChangedToState:(NSString * _Nonnull)url state:(ARtmpStreamingState)state errorCode:(ARtmpStreamingErrorCode)errorCode;
+
+/** RTMP 推流事件回调。
+
+ @param engine ARtcEngineKit 对象。
+ @param url RTMP 推流 URL。
+ @param eventCode RTMP 推流事件码。详见 ARtmpStreamingEvent 。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine rtmpStreamingEventWithUrl:(NSString * _Nonnull)url eventCode:(ARtmpStreamingEvent)eventCode;
+
+/** 开启旁路推流的结果回调
+
+ 返回 addPublishStreamUrl 方法的调用结果。如果调用不成功,你可以在 errorCode 参数中查看详细的错误信息。
+
+ @param engine ARtcEngineKit 对象
+ @param url 主播推流地址或输入的外部音视频流地址
+ @param errorCode 常见的错误码如下,详情见 ARErrorCode
+
+ - ARErrorCodeNoError(0):推流成功
+ - ARErrorCodeFailed(1):推流失败
+ - ARErrorCodeInvalidArgument(2):参数错误,如果你在调用 addPublishStreamUrl 前没有调用 setLiveTranscoding 配置 ARLiveTranscoding ,会导致此错误。
+ - ARErrorCodeTimedOut(10):推流超时未成功
+ - ARErrorCodeAlreadyInUse(19):推流地址已经在推流
+ - ARErrorCodeAbort(20): SDK 与推流服务器断开连接,推流中断
+ - ARErrorCodeResourceLimited(22):后台没有足够资源推流
+ - ARErrorCodeEncryptedStreamNotAllowedPublish(130):推流已加密不能推流
+ - ARErrorCodePublishStreamCDNError(151):CDN 相关错误。请调用 removePublishStreamUrl 方法删除原来的推流地址,然后调用 addPublishStreamUrl 方法重新推流到新地址。
+ - ARErrorCodePublishStreamNumReachLimit(152):单个主播的推流地址数目达到上限 10。请删掉一些不用的推流地址再增加推流地址。
+ - ARErrorCodePublishStreamNotAuthorized(153):操作不属于主播自己的流,例如更新其他主播的流参数、停止其他主播的流。请检查 App 逻辑。
+ - ARErrorCodePublishStreamInternalServerError(154):推流服务器出现错误。请调用 addPublishStreamUrl 重新推流。
+ - ARErrorCodePublishStreamFormatNotSuppported(156):推流地址格式有错误。请检查推流地址格式是否正确。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine streamPublishedWithUrl:(NSString * _Nonnull)url errorCode:(ARErrorCode)errorCode;
+
+/** 停止旁路推流的结果回调
+
+ 返回 removePublishStreamUrl 方法的调用结果。
+
+ @param engine ARtcEngineKit object.
+ @param url 主播停止推流的 RTMP 地址
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine streamUnpublishedWithUrl:(NSString * _Nonnull)url;
+
+/** 旁路推流设置被更新回调
+
+ setLiveTranscoding 方法中的直播参数 LiveTranscoding rtcEngineTranscodingUpdated 回调会被触发并向主播报告更新信息。
+
+ **Note:**
+
+ 首次调用 setLiveTranscoding 方法设置转码参数 LiveTranscoding 时,不会触发此回调。
+
+ @param engine ARtcEngineKit 对象。
+ */
+- (void)rtcEngineTranscodingUpdated:(ARtcEngineKit * _Nonnull)engine;
+
+//MARK: - 直播输入在线媒体流事件回调
+/**-----------------------------------------------------------------------------
+* @name 直播输入在线媒体流事件回调
+* -----------------------------------------------------------------------------
+*/
+
+/** 输入外部视频流状态回调
+
+ @param engine ARtcEngineKit 对象
+ @param url 输入进直播的外部视频源 URL 地址
+ @param uid 用户 ID
+ @param status 详见ARInjectStreamStatus
+ */
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine streamInjectedStatusOfUrl:(NSString *_Nonnull)url uid:(NSString * _Nonnull)uid status:(ARInjectStreamStatus)status;
+
+//MARK: - 数据流事件回调
+
+/**-----------------------------------------------------------------------------
+ * @name 数据流事件回调
+ * -----------------------------------------------------------------------------
+ */
+
+/** 接收到对方数据流消息的回调
+
+ 该回调表示本地用户收到了远端用户调用 sendStreamMessage 方法发送的流消息。
+
+ @param engine ARtcEngineKit 对象
+ @param uid 用户ID
+ @param streamId 数据流 ID
+ @param data 接收到的数据
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine receiveStreamMessageFromUid:(NSString * _Nonnull)uid streamId:(NSInteger)streamId data:(NSData * _Nonnull)data;
+
+/** 接收对方数据流消息错误的回调
+
+ 该回调表示本地用户未收到远端用户调用 sendStreamMessage 方法发送的流消息。
+
+ @param engine ARtcEngineKit 对象
+ @param uid 用户 ID
+ @param streamId 数据流 ID
+ @param error 错误代码: ARErrorCode
+ @param missed 丢失的消息数量
+ @param cached 数据流中断时,后面缓存的消息数量
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didOccurStreamMessageErrorFromUid:(NSString * _Nonnull)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached;
+
+//MARK: - Miscellaneous Delegate Methods
+
+//MARK: - 音视频流回退事件回调
+/**-----------------------------------------------------------------------------
+ * @name 本地发布流已回退为音频流
+ * -----------------------------------------------------------------------------
+ */
+
+ /** 远端订阅流已回退为音频流
+
+ 如果你调用了 setRemoteSubscribeFallbackOption, 接口并将回退选项设置为 ARStreamFallbackOptionAudioOnly,当下行网络环境不理想、仅接收远端音频流时,或当下行网络改善、恢复订阅音视频流时,会触发该回调。
+
+ **Note:**
+
+ 远端订阅流因弱网环境不能同时满足音视频而回退为小流时,你可以使用 remoteVideoStats 方法来监控远端视频大小流的切换。
+
+ @param engine ARtcEngineKit 对象。
+ @param isFallbackOrRecover 回退为音频流或恢复为音视频流:
+
+ * YES: 由于网络环境不理想,远端订阅流已回退为音频流
+ * NO: 由于网络环境改善,订阅的音频流已恢复为音视频流
+ @param uid 远端用户ID
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didRemoteSubscribeFallbackToAudioOnly:(BOOL)isFallbackOrRecover byUid:(NSString *_Nonnull)uid;
+
+//MARK: - 媒体设备事件回调
+/**-----------------------------------------------------------------------------
+* @name 媒体设备事件回调
+* -----------------------------------------------------------------------------
+*/
+
+#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
+
+/** 设备状态改变回调 (仅支持 macOS)
+
+ @param engine ARtcEngineKit 对象
+ @param deviceId 设备ID
+ @param deviceType 设备类型,详见 ARMediaDeviceType
+ @param state 设备的状态:
+ - 0: 已添加。
+ - 1: 删除。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine device:(NSString * _Nonnull)deviceId type:(ARMediaDeviceType)deviceType stateChanged:(NSInteger) state;
+
+#endif
+
+/** 语音路由已发生变化回调
+
+当语音路由发生变化时,SDK 会触发此回调。
+
+ @param engine ARtcEngineKit 对象
+ @param routing 设置语音路由,详见 ARAudioOutputRouting
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didAudioRouteChanged:(ARAudioOutputRouting)routing;
+
+#if defined (TARGET_OS_IPHONE) && TARGET_OS_IPHONE
+
+/** 报告本地人脸检测结果。
+
+ 调用 enableFaceDetection(YES) 开启本地人脸检测后,你可以通过该回调实时获取以下人脸检测的信息:
+
+ - 摄像头采集的画面大小
+ - 人脸在画面中的位置
+ - 人脸距设备屏幕的距离,该值由 SDK 通过摄像头采集的画面大小和人脸在画面中的位置拟合计算得出。
+
+**Note**
+
+ - 当检测到摄像头前没有人脸时,该回调触发频率会降低,以节省设备耗能。
+ - 当人脸距离设备屏幕过近时,SDK 不会触发该回调。
+
+ @param engine ARtcEngineKit 对象。
+ @param width 摄像头采集画面的宽度 (px)。
+ @param height 摄像头采集画面的高度 (px)。
+ @param faces 检测到的人脸信息,详见 ARFacePositionInfo 。
+
+ 检测到几张人脸,就会报告几个 ARFacePositionInfo 数组。数组长度可以为 0,表示没有检测到摄像头前出现人脸。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine facePositionDidChangeWidth:(int)width previewHeight:(int)height faces:(NSArray<ARFacePositionInfo *> *_Nullable)faces;
+
+#endif
+
+//MARK: - 跨频道媒体流转发回调
+
+/**-----------------------------------------------------------------------------
+* @name 跨频道媒体流转发回调
+* -----------------------------------------------------------------------------
+*/
+/** 跨频道媒体流转发状态发生改变回调。
+
+ 当跨频道媒体流转发状态发生改变时,SDK 会触发该回调,并报告当前的转发状态以及相关的错误信息。
+
+ @param engine ARtcEngineKit 对象
+ @param state 跨频道媒体流转发状态 ARChannelMediaRelayState。
+ @param error 跨频道媒体流转发出错的错误码 ARChannelMediaRelayError。
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine channelMediaRelayStateDidChange:(ARChannelMediaRelayState)state error:(ARChannelMediaRelayError)error;
+
+/** 跨频道媒体流转发事件回调。
+
+ @param engine ARtcEngineKit 对象
+ @param event 跨频道媒体流转发事件码
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didReceiveChannelMediaRelayEvent:(ARChannelMediaRelayEvent)event;
+
+//MARK: - 其它回调方法(不推荐使用)
+/**-----------------------------------------------------------------------------
+* @name 其它回调方法
+* -----------------------------------------------------------------------------
+*/
+/** 已完成远端视频首帧解码回调
+
+**Note**
+
+收到该回调,可调用setupRemoteVideo方法显示远端视图。推荐使用 remoteVideoStateChangedOfUid 回调的 ARVideoRemoteStateStarting(1) 和 ARVideoRemoteStateDecoding(2)。
+
+@param engine ARtcEngineKit 对象
+@param uid 远端用户 ID
+@param size 视频流尺寸(宽度和高度)
+@param elapsed 从本地用户调用 joinChannelByToken到发生此事件过去的时间(ms)。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine firstRemoteVideoDecodedOfUid:(NSString *_Nonnull)uid size:(CGSize)size elapsed:(NSInteger)elapsed;
+
+/** 已接收远端音频首帧的回调
+
+**Note**
+
+推荐使用 remoteAudioStateChangedOfUid 回调。
+
+@param engine ARtcEngineKit 对象
+@param uid 远端用户 ID
+@param elapsed 从本地用户调用joinChannelByToken到发生此事件的时间(ms)。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine firstRemoteAudioFrameOfUid:(NSString *_Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 已解码远端音频首帧的回调
+
+**Note**
+
+推荐使用 remoteAudioStateChangedOfUid 回调。SDK 完成远端音频首帧解码,并发送给音频模块用以播放时,会触发此回调。有两种情况:
+
+ * 远端用户首次上线后发送音频
+ * 远端用户音频离线再上线发送音频。音频离线指本地在 15 秒内没有收到音频包,可能有如下原因:
+ * 远端用户离开频道
+ * 远端用户掉线
+ * 远端用户停止发送音频流(调用了 muteLocalAudioStream)
+ * 远端用户关闭音频(调用了 disableAudio)
+
+@param engine ARtcEngineKit 对象
+@param uid 远端用户 ID
+@param elapsed 从本地用户调用 joinChannelByToken 直至该回调触发的延迟,单位为毫秒。
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine firstRemoteAudioFrameDecodedOfUid:(NSString *_Nonnull)uid elapsed:(NSInteger)elapsed;
+
+/** 远端用户暂停/重新发送视频回调(由muteLocalVideoStream触发 )
+
+**Note**
+
+ 推荐使用 remoteVideoStateChangedOfUid 回调的:
+
+ * ARVideoRemoteStateStopped(0) and ARVideoRemoteStateReasonRemoteMuted(5).
+ * ARVideoRemoteStateDecoding(2) 和 ARVideoRemoteStateReasonRemoteUnmuted(6)。
+
+ 当频道内的用户或主播数超过 20 人,该回调会失效。
+
+ @param engine ARtcEngineKit 对象
+ @param muted 暂停或恢复发送视频流:
+
+ * Yes: 该用户已暂停发送其视频流
+ * No: 该用户已恢复发送其视频流
+
+ @param uid 远端用户 UID
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine didVideoMuted:(BOOL)muted byUid:(NSString *_Nonnull)uid;
+
+/** 远端用户音频静音回调
+
+ 该回调是由远端用户调用 muteLocalAudioStream 方法关闭或开启音频发送触发的。当频道内的用户或主播人数超过 20 时,该回调不生效。
+
+**Note**
+
+推荐使用 remoteAudioStateChangedOfUid 回调:
+ * ARAudioRemoteReasonRemoteMuted(5)
+ * ARAudioRemoteReasonRemoteUnmuted(6)
+
+@param engine ARtcEngineKit 对象
+@param muted YES: 静音 NO:取消静音
+@param uid 远端用户 ID
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didAudioMuted:(BOOL)muted byUid:(NSString *_Nonnull)uid;
+
+/** 其他用户启用/关闭视频回调(enableVideo 或 disableVideo触发)
+
+**Note**
+
+推荐使用 remoteVideoStateChangedOfUid 回调的:
+
+ * ARVideoRemoteStateStopped(0) 和 ARVideoRemoteStateReasonRemoteMuted(5)。
+ * ARVideoRemoteStateDecoding(2) 和 ARVideoRemoteStateReasonRemoteUnmuted(6)。
+
+提示有其他用户启用/关闭了视频功能。关闭视频功能是指该用户只能进行语音直播,不能显示、发送自己的视频,也不能接收、显示别人的视频。
+该回调是由远端用户调用 enableVideo 或 disableVideo 方法开启或关闭视频模块触发的。
+
+@param engine ARtcEngineKit 对象
+@param enabled 是否启用了视频功能:
+ * YES: 该用户已启用了视频功能。启用后,该用户可以进行视频通话或直播。
+ * NO: 该用户已关闭了视频功能。关闭后,该用户只能进行语音通话或直播,不能显示、发送自己的视频,也不能接收、显示别人的视频。
+@param uid 远端用户 ID
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didVideoEnabled:(BOOL)enabled byUid:(NSString *_Nonnull)uid;
+
+/** 其他用户启用/关闭本地视频回调(enableLocalVideo触发)
+
+**Note**
+
+推荐使用 remoteVideoStateChangedOfUid 回调的:
+
+ * ARVideoRemoteStateStopped(0) 和 ARVideoRemoteStateReasonRemoteMuted(5)。
+ * ARVideoRemoteStateDecoding(2) 和 ARVideoRemoteStateReasonRemoteUnmuted(6)。
+
+@param engine ARtcEngineKit 对象
+@param enabled 是否启用了视频功能
+ * YES: 该用户已启用本地视频功能。启用后,其他用户可以接收到该用户的视频流。
+ * NO: 该用户已关闭视频功能。关闭后,该用户仍然可以接收其他用户的视频流,但其他用户接收不到该用户的视频流。
+@param uid 远端用户 ID
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didLocalVideoEnabled:(BOOL)enabled byUid:(NSString *_Nonnull)uid;
+
+/** 麦克风状态已改变回调
+
+ 该回调是由本地用户调用 enableLocalAudio 方法开启或关闭本地音频采集触发的。
+
+**Note**
+
+推荐使用 localAudioStateChange 回调的: ARAudioLocalStateStopped(0) 或 ARAudioLocalStateRecording(1)。
+
+@param engine ARtcEngineKit 对象
+@param enabled YES: 麦克风已启用 NO: 麦克风已禁用
+*/
+- (void)rtcEngine:(ARtcEngineKit *_Nonnull)engine didMicrophoneEnabled:(BOOL)enabled;
+
+/** 网络连接中断回调
+
+ SDK 在和服务器建立连接后,失去了网络连接超过 4 秒,会触发该回调。在触发事件后,SDK 会主动重连服务器,所以该事件可以用于 UI 提示。
+
+ 与 rtcEngineConnectionDidLost 回调的区别是:
+
+ rtcEngineConnectionDidInterrupted 回调一定是发生在加入频道成功后,且 SDK 刚失去和服务器连接超过 4 秒时触发。
+ rtcEngineConnectionDidLost 回调是无论之前加入频道是否连接成功,只要 10 秒内和服务器无法建立连接都会触发。
+ 如果 SDK 在断开连接后,20 分钟内还是没能重新加入频道,SDK 会停止尝试重连。
+
+**Note**
+
+推荐使用connectionChangedToState回调。
+
+@param engine ARtcEngineKit 对象
+*/
+- (void)rtcEngineConnectionDidInterrupted:(ARtcEngineKit *_Nonnull)engine;
+
+/** 连接已被禁止回调
+
+ 当你被服务端禁掉连接的权限时,会触发该回调。
+
+**Note**
+
+推荐使用connectionChangedToState回调。
+
+@param engine ARtcEngineKit 对象
+*/
+- (void)rtcEngineConnectionDidBanned:(ARtcEngineKit *_Nonnull)engine;
+
+/** 通话中远端音频流传输的统计信息回调
+
+ 该回调描述远端用户通话中端到端的网络统计信息,通过音频包计算,用客观的数据,如丢包、网络延迟等,展示当前网络状态。
+
+ 通话中,当用户收到远端用户/主播发送的音频数据包后,会每 2 秒触发一次该回调。
+
+ 和 remoteAudioStats 回调相比,该回调以数据展示当前网络状态,因此更客观。
+
+**Note**
+
+ 推荐使用remoteAudioStats回调。
+
+ @param engine ARtcEngineKit 对象
+ @param uid 用户 ID,指定是哪个用户/主播的音频包
+ @param delay 音频包从发送端到接收端的延时(毫秒)
+ @param lost 音频包从发送端到接收端的丢包率(%)
+ @param rxKBitRate 远端音频包的接收码率(Kbps)
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine audioTransportStatsOfUid:(NSString *_Nonnull)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate;
+
+/** 通话中远端视频流传输的统计信息回调
+
+ 该回调描述远端用户通话中端到端的网络统计信息,通过视频包计算,用客观的数据,如丢包、网络延迟等,展示当前网络状态。
+
+ 通话中,当用户收到远端用户/主播发送的视频数据包后,会每 2 秒触发一次该回调。
+
+ 和 remoteVideoStats 回调相比,该回调以数据展示当前网络状态,因此更客观。
+
+**Note**
+
+ 推荐使用remoteVideoStats回调。
+
+ @param engine ARtcEngineKit 对象
+ @param uid 用户 ID,指定是哪个用户/主播的视频包
+ @param delay 视频包从发送端到接收端的延时(毫秒)
+ @param lost 视频包从发送端到接收端 800 ms 内的丢包率(%)
+ @param rxKBitRate 远端视频包的接收码率(Kbps)
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine videoTransportStatsOfUid:(NSString *_Nonnull)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate;
+
+/** 远端音频质量回调
+
+ 该回调描述远端用户在通话中的音频质量,针对每个远端用户/主播每 2 秒触发一次。如果远端同时存在多个用户/主播,该回调每 2 秒会被触发多次。
+
+**Note**
+
+ 推荐使用remoteVideoStats回调。
+
+ @param engine ARtcEngineKit 对象
+ @param uid 用户 ID,指定是谁发的音频流。
+ @param quality 语音质量,详见 ARNetworkQuality
+ @param delay 音频包从发送端到接收端的延迟(毫秒)。包括声音采样前处理、网络传输、网络抖动缓冲引起的延迟。
+ @param lost 音频包从发送端到接收端的丢包率(%)
+ */
+- (void)rtcEngine:(ARtcEngineKit * _Nonnull)engine audioQualityOfUid:(NSString *_Nonnull)uid quality:(ARNetworkQuality)quality delay:(NSUInteger)delay lost:(NSUInteger)lost;
+
+/** 摄像头就绪回调
+
+ 提示已成功打开摄像头,可以开始捕获视频。
+
+**Note**
+
+ 推荐使用localVideoStateChange回调 state 参数中的 ARLocalVideoStreamStateCapturing(1)。
+
+ @param engine ARtcEngineKit 对象
+ */
+- (void)rtcEngineCameraDidReady:(ARtcEngineKit * _Nonnull)engine;
+
+/** 视频功能停止回调
+
+ 提示视频功能已停止。 App 如需在停止视频后对 view 做其他处理(比如显示其他画面),可以在这个回调中进行。
+
+**Note**
+
+ 推荐使用localVideoStateChange回调 state 参数中的 ARLocalVideoStreamStateCapturing(0)。
+
+ @param engine ARtcEngineKit 对象
+ */
+- (void)rtcEngineVideoDidStop:(ARtcEngineKit * _Nonnull)engine;
+
+@end
+
+
+#endif /* ARtcEngineDelegate_h */
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineKit.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineKit.h
new file mode 100644
index 0000000..5f01d78
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcEngineKit.h
@@ -0,0 +1,2143 @@
+//
+// ARtcEngineKit.h
+// ARtcKit
+//
+// Created by zjq on 2020/3/18.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "ARtcEngineDelegate.h"
+#import "ARObjects.h"
+#import "ARMediaIO.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class ARtcEngineKit;
+@class ARtcChannel;
+
+__attribute__((visibility("default"))) @interface ARtcEngineKit : NSObject
+
+//MARK: - 核心方法
+
+/**-----------------------------------------------------------------------------
+* @name 核心方法
+* -----------------------------------------------------------------------------
+*/
+
+/** 实例化ARtcEngineKit对象
+
+该方法初始化一个 ARtcEngineKit 单例。使用 ARtcEngineKit,必须先调用该接口进行初始化。
+
+**Note**
+
+请确保在调用其他 API 前先调用该方法创建并初始化 ARtcEngineKit。 一个 ARtcEngineKit 实例对象只能使用一个 App ID。如需更换 App ID,必须先调用 destroy 销毁当前实例,再调用本方法重新创建实例。
+
+@param appId ar云平台 为 App 开发者签发的 App ID。每个项目都应该有一个独一无二的 App ID。如果你的开发包里没有 App ID,请从ar云平台官网申请一个新的 App ID。在你调用 joinChannelByToken加入ar云平台的全球网络实现一对一或一对多直播通信时需要:
+
+ * 用 App ID 标示你的项目和所属组织
+ * 用一个独一无二的频道名称
+@param delegate ARtcEngineDelegate.
+
+@return 一个 ARtcEngineKit 实例对象
+*/
++ (instancetype _Nonnull)sharedEngineWithAppId:(NSString *_Nonnull)appId delegate:(id<ARtcEngineDelegate> _Nullable)delegate;
+
+/** 销毁 RtcEngine 实例
+
+ 该方法用于释放SDK 使用的所有对象资源。帮助偶尔使用音视频通话的 App 在无需通话时释放资源。一旦 App 调用了 destroy 接口销毁创建的 ARtcEngineKit 实例,将无法调用 SDK 内的任何方法也不再会有任何回调产生。如需重启通话,请调用初始化方法 sharedEngineWithAppId创建一个新的 ARtcEngineKit 实例。
+
+**Note**
+
+ * 该方法需要在子线程中操作
+ * 该方法为同步调用。 App 不得在 SDK 生成的回调中调用该方法,不然 SDK 只能等候该回调返回才能重新获取相应的对象资源造成死锁。
+ */
++ (void)destroy;
+
+/** 设置频道使用场景
+
+ * 为保证实时音视频质量,我们建议相同频道内的用户使用同一种频道场景。
+ * 该方法必须在加入频道前调用,进入频道后无法再设置频道场景。
+
+@param profile 频道使用场景,详见ARChannelProfile。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setChannelProfile:(ARChannelProfile)profile;
+
+/** 设置用户角色
+
+在加入频道前,用户需要通过本方法设置观众(默认)或主播角色。在加入频道后,用户可以通过本方法切换用户角色。
+
+如果你在加入频道后调用该方法切换用户角色,调用成功后,本地会触发 didClientRoleChanged 回调;远端会触发 didJoinedOfUid 或 didOfflineOfUid(ARUserOfflineReasonBecomeAudience) 回调。
+
+**Note**
+
+该方法仅适用于直播场景。
+
+@param role 直播场景里的用户角色,详见ARClientRole:
+
+ * ARClientRoleBroadcaster = 1; 主播
+ * ARClientRoleAudience = 2; 观众(默认)
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setClientRole:(ARClientRole)role;
+
+/** 加入频道
+
+该方法让用户加入通话频道,在同一个频道内的用户可以互相通话,多个用户加入同一个频道,可以群聊。 使用不同 App ID 的 App 是不能互通的。如果已在通话中,用户必须调用 leaveChannel 退出当前通话,才能进入下一个频道。SDK 在通话中使用 iOS 系统的 AVAudioSession 共享对象进行录音和播放, App 对该对象的操作可能会影响 SDK 的音频相关功能。
+
+调用该 API 后会触发 joinSuccessBlock 或 didJoinChannel 回调。block 比 delegate 优先级高,如果两种回调都实现了,只有 block 会触发。
+
+我们建议你将 joinSuccessBlock 设置为 nil,使用 delegate 回调。
+
+加入频道后,本地会触发 didJoinChannel 回调;通信场景下的用户和直播场景下的主播加入频道后,远端会触发 didJoinedOfUid 回调。
+
+在网络状况不理想的情况下,客户端可能会与 ar云平台 的服务器失去连接;SDK 会自动尝试重连,重连成功后,本地会触发 didRejoinChannel 回调。
+
+**Note**
+
+ * 频道内每个用户的 UID 必须是唯一的。如果将 UID 设为 nil,系统将自动分配一个 UID。如果想要从不同的设备同时接入同一个频道,请确保每个设备上使用的 UID 是不同的。
+ * 在加入频道时,SDK 调用 setCategory(AVAudioSessionCategoryPlayAndRecord) 将 AVAudioSession 设置到 PlayAndRecord 模式, App 不应将其设置到其他模式。设置该模式时,正在播放的声音会被打断(比如正在播放的响铃声)。
+
+ @param token 动态密钥
+
+ * 安全要求不高: 将值设为 nil
+ * 安全要求高: 将值设置为 Token。如果你已经启用了 App Certificate,请务必使用 Token。
+ * 请务必确保用于生成 Token 的 App ID 和 sharedEngineWithappId 方法初始化引擎时用的是同一个 App ID。
+
+ @param channelId 标识通话频道的字符串,长度在 64 字节以内的字符串。
+ 以下为支持的字符集范围(共 89 个字符):
+
+ * 26 个小写英文字母 a-z
+ * 26 个大写英文字母 A-Z
+ * 10 个数字 0-9
+ * 空格
+ * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
+
+@param uid 用户 ID,建议设置长度1~48,确保uid符合规则,并保证唯一性。如果不填或设置为nil,SDK 会自动分配一个,并在 joinSuccessBlock 回调方法中返回,App 层必须记住该返回值并维护,SDK 不对该返回值进行维护。
+
+ * 26 个小写英文字母 a-z
+ * 26 个大写英文字母 A-Z
+ * 10 个数字 0-9
+@param joinSuccessBlock 成功加入频道回调。joinSuccessBlock 优先级高于 didJoinChannel,2 个同时存在时,didJoinChannel 会被忽略。 需要有 didJoinChannel 回调时,请将 joinSuccessBlock 设置为 nil 。
+
+@return 0方法调用成功,<0方法调用失败
+
+ * ARErrorCodeInvalidArgument(-2)
+ * ARErrorCodeNotReady(-3)
+ * ARErrorCodeRefused(-5)
+*/
+- (int)joinChannelByToken:(NSString * _Nullable)token
+ channelId:(NSString * _Nonnull)channelId
+ uid:(NSString * _Nullable)uid
+ joinSuccess:(void(^ _Nullable)(NSString * _Nonnull channel, NSString * _Nonnull uid, NSInteger elapsed))joinSuccessBlock;
+
+/** 快速切换直播频道。
+
+ 当直播频道中的观众想从一个频道切换到另一个频道时,可以调用该方法,实现快速切换。
+
+ 成功调用该方切换频道后,本地会先收到离开原频道的回调 didLeaveChannelWithStats,再收到成功加入新频道的回调 didJoinChannel。
+
+**Note**
+
+ 该方法仅适用直播频道中的观众用户。
+
+ @param token 动态密钥
+
+ * 安全要求不高: 将值设为 nil
+ * 安全要求高: 将值设置为 Token。如果你已经启用了 App Certificate,请务必使用 Token。
+ * 请务必确保用于生成 Token 的 App ID 和 sharedEngineWithappId 方法初始化引擎时用的是同一个 App ID。
+
+ @param channelId 标识通话频道的字符串,长度在 64 字节以内的字符串。
+ 以下为支持的字符集范围(共 89 个字符):
+
+ * 26 个小写英文字母 a-z
+ * 26 个大写英文字母 A-Z
+ * 10 个数字 0-9
+ * 空格
+ * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
+ @param joinSuccessBlock 成功加入频道回调。joinSuccessBlock 优先级高于 didJoinChannel,2 个同时存在时,didJoinChannel 会被忽略。 需要有 didJoinChannel 回调时,请将 joinSuccessBlock 设置为 nil 。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)switchChannelByToken:(NSString * _Nullable)token
+ channelId:(NSString * _Nonnull)channelId
+ joinSuccess:(void(^ _Nullable)(NSString * _Nonnull channel, NSString *_Nonnull uid, NSInteger elapsed))joinSuccessBlock;
+
+/** 离开频道
+
+离开频道,即挂断或退出通话。
+
+当调用 joinChannelByToken 方法后,必须调用 leaveChannel 结束通话,否则无法开始下一次通话。 不管当前是否在通话中,都可以调用本方法,没有副作用。该方法会把会话相关的所有资源释放掉。该方法是异步操作,调用返回时并没有真正退出频道。
+
+ * 成功调用该方法离开频道后,本地会触发 didLeaveChannelWithStats 回调;
+ * 通信场景下的用户和直播场景下的主播离开频道后,远端会触发 didOfflineOfUid(ARUserOfflineReasonBecomeAudience) 回调。
+
+**Note**
+
+- 如果你调用了本方法后立即调用 destroy 方法,SDK 将无法触发 didLeaveChannelWithStats 回调。
+- 如果你在旁路推流时调用本方法, SDK 将自动调用 removePublishStreamUrl 方法。
+- 在调用本方法时,iOS 默认情况下 SDK 会停用 audio session,可能会对其他应用程序造成影响。如果想改变这种默认行为,可以通过setAudioSessionOperationRestriction 方法设置 ARAudioSessionOperationRestrictionDeactivateSession,这样在 leaveChannel 时,SDK 不会停用 audio session。
+
+ @param leaveChannelBlock 成功离开频道的回调,提供通话相关的统计信息,详见 ARChannelStats
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)leaveChannel:(void (^ _Nullable) (ARChannelStats *_Nonnull stat))leaveChannelBlock;
+
+/** 更新 Token
+
+该方法用于更新 Token。如果启用了 Token 机制,过一段时间后使用的 Token 会失效。当以下任意一种情况发生时:
+
+ * tokenPrivilegeWillExpire 回调。
+ * connectionChangedToState 回调的 reason 参数报告 ARConnectionChangedTokenExpired(9)。
+
+**Note**
+
+ App 应重新获取 Token,然后调用该 API 更新 Token,否则 SDK 无法和服务器建立连接。
+
+ @param token 新的 Token
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)renewToken:(NSString * _Nonnull)token;
+
+/** 获取当前网络连接状态
+
+@return 当前的网络连接状态,详见 ARConnectionStateType。
+*/
+- (ARConnectionStateType)getConnectionState;
+
+/** 开始跨频道媒体流转发。该方法可用于实现跨频道连麦等场景。
+
+ 成功调用该方法后,SDK 会触发 channelMediaRelayStateDidChange 和 didReceiveChannelMediaRelayEvent 回调,并在回调中报告当前的跨频道媒体流转发状态和事件。
+
+ 如果 channelMediaRelayStateDidChange 回调报告 ARChannelMediaRelayStateRunning(2) 和 ARChannelMediaRelayStateIdle(0),且 didReceiveChannelMediaRelayEvent 回调报告 ARChannelMediaRelayEventSentToDestinationChannel(4),则表示 SDK 开始在源频道和目标频道之间转发媒体流。
+ 如果 channelMediaRelayStateDidChange 回调报告 ARChannelMediaRelayStateFailure(3),则表示跨频道媒体流转发出现异常。
+
+**Note**
+
+ - 请在成功加入频道后调用该方法。
+ - 该方法仅对直播场景下的主播有效。
+ - 成功调用该方法后,若你想再次调用该方法,必须先调用 stopChannelMediaRelay 方法退出当前的转发状态。
+ - 跨频道媒体流转发功能需要提交工单联系技术支持开通。
+
+ @param config 跨频道媒体流转发参数配置: ARChannelMediaRelayConfiguration 类。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)startChannelMediaRelay:(ARChannelMediaRelayConfiguration * _Nonnull)config;
+
+/** 更新媒体流转发的频道。成功开始跨频道转发媒体流后,如果你希望将流转发到多个目标频道,或退出当前的转发频道,可以调用该方法。
+
+ 成功调用该方法后,SDK 会触发 didReceiveChannelMediaRelayEvent 回调,并在回调中报告状态码 ARChannelMediaRelayEventUpdateDestinationChannel(7)。
+
+ **Note**
+
+ - 请在 startChannelMediaRelay 方法后调用该方法,更新媒体流转发的频道。
+ - 跨频道媒体流转发最多支持 4 个目标频道。如果直播间里已经有 4 个频道了,你可以在调用该方法之前,调用 ARChannelMediaRelayConfiguration 中的 removeDestinationInfoForChannelName 方法移除不需要的频道。
+
+ @param config 跨频道媒体流转发参数配置: ARChannelMediaRelayConfiguration 类。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)updateChannelMediaRelay:(ARChannelMediaRelayConfiguration * _Nonnull)config;
+
+/** 停止跨频道媒体流转发。一旦停止,主播会退出所有目标频道。
+
+ 成功调用该方法后,SDK 会触发 channelMediaRelayStateDidChange 回调。如果报告 ARChannelMediaRelayStateIdle(0) 和 ARChannelMediaRelayErrorNone(0),则表示已停止转发媒体流。
+
+ Note: 如果该方法调用不成功,SDK 会触发 channelMediaRelayStateDidChange 回调,并报告状态码 ARChannelMediaRelayErrorServerNoResponse(2) 或 ARChannelMediaRelayEventUpdateDestinationChannelRefused(8)。你可以调用 leaveChannel 方法离开频道,跨频道媒体流转发会自动停止。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopChannelMediaRelay;
+
+//MARK: - 音频核心方法
+
+/**-----------------------------------------------------------------------------
+* @name 音频核心方法
+* -----------------------------------------------------------------------------
+*/
+
+/** 启用音频模块
+
+ 本方法可以启用音频模块,默认开启状态。
+
+**Note**
+
+ * 该方法设置的是内部引擎为开启状态,在频道内和频道外均可调用,且在 leaveChannel 后仍然有效。
+ * 该方法重置整个引擎,响应速度较慢,因此 ar云平台 建议使用如下方法来控制音频模块:
+
+ * enableLocalAudio:是否启动麦克风采集并创建本地音频流
+ * muteLocalAudioStream:是否发布本地音频流
+ * muteRemoteAudioStream:是否接收并播放远端音频流
+ * muteAllRemoteAudioStreams:是否接收并播放所有远端音频流
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableAudio;
+
+/** 关闭音频模块
+
+ **Note**
+
+ * 该方法设置的是内部引擎为禁用状态,在频道内和频道外均可调用,且在 leaveChannel 后仍然有效。
+ * 该方法重置整个引擎,响应速度较慢,因此建议使用如下方法来控制音频模块:
+
+ - enableLocalAudio:是否启动麦克风采集并创建本地音频流
+ - muteLocalAudioStream:是否发布本地音频流
+ - muteRemoteAudioStream:是否接收并播放远端音频流
+ - muteAllRemoteAudioStreams:是否接收并播放所有远端音频流
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)disableAudio;
+
+/** 设置音频编码配置
+
+**Note**
+
+ * 该方法需要在 joinChannelByToken 之前设置好,joinChannelByToken 之后设置不生效。
+ * 通信场景下,该方法设置 profile 生效,设置 scenario 不生效。
+ * 通信和直播场景下,音质(码率)会有网络自适应的调整,通过该方法设置的是一个最高码率。
+ * 在有高音质需求的场景(例如音乐教学场景)中,建议将 profile 设置为 ARAudioProfileMusicHighQuality(4),scenario 设置为 ARAudioScenarioGameStreaming(3)
+
+ @param profile 音频属性,详见ARAudioProfile
+ @param scenario 设置音频应用场景,详细定义见 ARAudioScenario。不同的音频场景下,设备的系统音量是不同的。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setAudioProfile:(ARAudioProfile)profile scenario:(ARAudioScenario)scenario;
+
+/** 调节录音音量
+
+ @param volume 录音音量可在 0~400 范围内进行调节:
+
+ * 0: 静音
+ * 100: 原始音量
+ * 400: 最大可为原始音量的 4 倍(自带溢出保护)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)adjustRecordingSignalVolume:(NSInteger)volume;
+
+/** 调节本地播放的所有远端用户音量
+
+**Note**
+
+- 该方法调节的是本地播放的所有远端用户混音后的音量。
+- 静音本地音频需同时调用 adjustPlaybackSignalVolume 和 adjustAudioMixingPlayoutVolume 方法,并将 volume 参数设置为 0。
+
+@param volume 播放音量,取值范围为 [0,400]。
+
+* 0: 静音
+* 100: 原始音量
+* 400: 最大可为原始音量的 4 倍(自带溢出保护)
+
+@return 0方法调用成功,<0方法调用失败
+*/
+
+- (int)adjustPlaybackSignalVolume:(NSInteger)volume;
+
+/** 启用说话者音量提示
+
+@param interval 指定音量提示的时间间隔
+
+ * <= 0: 禁用音量提示功能
+ * > 0: 提示间隔,单位为毫秒。建议设置到大于 200 毫秒。最小不得少于 10 毫秒。启用该方法后,无论频道内是否有人说话,都会在 reportAudioVolumeIndicationOfSpeakers回调中按设置的时间间隔返回音量提示
+
+@param smooth 指定音量提示的灵敏度。取值范围为 [0,10],建议值为 3,数字越大,波动越灵敏;数字越小,波动越平滑。
+@param report_vad 本地人声检测功能
+
+ * YES:开启本地人声检测功能。开启后, reportAudioVolumeIndicationOfSpeakers 回调的 vad 参数会报告是否在本地检测到人声。
+ * NO:(默认)关闭本地人声检测功能。除引擎自动进行本地人声检测的场景外, reportAudioVolumeIndicationOfSpeakers 回调的 vad 参数不会报告是否在本地检测到人声。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)enableAudioVolumeIndication:(NSInteger)interval smooth:(NSInteger)smooth report_vad:(BOOL)report_vad;
+
+/** 开关本地音频采集
+
+当用户加入频道时,它的语音功能默认是开启的。该方法可以关闭或重新开启本地语音功能,即停止或重新开启本地音频采集。
+
+该方法不影响接收或播放远端音频流,enableLocalAudio(NO) 适用于只听不发的用户场景。
+
+语音功能关闭或重新开启后,会收到回调 didMicrophoneEnabled。
+
+**Note**
+
+ 该方法与 muteLocalAudioStream 的区别在于:
+
+ * enableLocalAudio:开启或关闭本地语音采集及处理。使用 enableLocalAudio 关闭或开启本地采集后,本地听远端播放会有短暂中断。
+ * muteLocalAudioStream:停止或继续发送本地音频流。
+
+ @param enabled 开关本地音频采集
+
+ * YES: 重新开启本地语音功能,即开启本地语音采集(默认)
+ * NO: 关闭本地语音功能,即停止本地语音采集或处理
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableLocalAudio:(BOOL)enabled;
+
+/** 开关本地音频发送
+
+ 该方法用于允许/禁止往网络发送本地音频流。成功调用该方法后,远端会触发 remoteAudioStateChangedOfUid 回调。
+
+**Note**
+
+ * 该方法不影响录音状态,并没有禁用麦克风。
+ * 如果你在该方法后调用 setChannelProfile 方法,SDK 会根据你设置的频道场景以及用户角色,重新设置是否停止发送本地音频。因此我们建议在 setChannelProfile 后调用该方法。
+
+ @param mute 是否发送本地音频流
+
+ * YES: 停止发送本地音频流
+ * NO: (默认)继续发送本地音频流
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteLocalAudioStream:(BOOL)mute;
+
+/** 停止/恢复接收指定用户的音频流
+
+**Note**
+
+ 如果之前有调用过 muteAllRemoteAudioStreams(YES) 对所有远端音频进行静音,在调用本 API 之前请确保你已调用 muteAllRemoteAudioStreams(NO)。 muteAllRemoteAudioStreams 是全局控制,muteRemoteAudioStream 是精细控制。
+
+ @param uid 指定用户的用户 ID
+ @param mute 停止/恢复接收指定用户的音频流:
+
+ * YES: 停止接收指定音频流
+ * NO: 继续接收指定音频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteRemoteAudioStream:(NSString *_Nonnull)uid mute:(BOOL)mute;
+
+/** 停止/恢复接收所有远端音频流
+
+@param mute YES: 停止接收所有远端音频流;NO: 继续接收所有远端音频流(默认)。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)muteAllRemoteAudioStreams:(BOOL)mute;
+
+/** 设置是否默认接收音频流
+
+该方法在加入频道前后都可调用。如果在加入频道后调用 setDefaultMuteAllRemoteAudioStreams (YES),会接收不到设置后加入频道的用户的音频流。
+
+**Note**
+
+ 停止接收音频流后,如果想要恢复接收,请调用 muteRemoteAudioStream (NO),并指定你想要接收的远端用户 uid;如果想恢复接收多个用户的音频流,则需要多次调用 muteRemoteAudioStream。setDefaultMuteAllRemoteAudioStreams (NO) 只能恢复接收后面加入频道的用户的音频流。
+
+ @param mute 设置是否默认接收音频流:
+
+ * YES: 默认停止接收所有远端音频流
+ * NO: 默认继续接收所有远端音频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setDefaultMuteAllRemoteAudioStreams:(BOOL)mute;
+
+/** 调节本地播放的指定远端用户音量
+
+加入频道后,你可以多次调用该方法调节不同远端用户在本地播放的音量,或对某个远端用户在本地播放的音量调节多次。
+
+**Note**
+
+- 该方法要在加入频道后调用。
+- 该方法调节的是本地播放的指定远端用户混音后的音量。
+- 该方法每次只能调整一位远端用户在本地播放的音量。若需调整多位远端用户在本地播放的音量,则需多次调用该方法。
+
+@param uid 远端用户 ID,需和远端用户加入频道时用的 uid 一致。
+@param volume 播放音量,取值范围为 [0,100]。
+
+- 0: 静音
+- 100: 原始音量
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)adjustUserPlaybackSignalVolume:(NSString *_Nonnull)uid volume:(int)volume;
+
+//MARK: - 视频核心方法
+
+/**-----------------------------------------------------------------------------
+* @name 视频核心方法
+* -----------------------------------------------------------------------------
+*/
+
+/** 启用视频模块
+
+该方法用于打开视频模式。可以在加入频道前或者通话中调用,在加入频道前调用,则自动开启视频模式,在通话中调用则由音频模式切换为视频模式。调用 disableVideo 方法可关闭视频模式。
+
+成功调用该方法后,远端会触发 didVideoEnabled(YES) 和 remoteVideoStateChangedOfUid 回调。
+
+**Note**
+
+ * 该方法设置的是内部引擎为启用状态,在 leaveChannel 后仍然有效。
+ * 该方法重置整个引擎,响应速度较慢,因此建议使用如下方法来控制视频模块:
+ - enableLocalVideo:是否启动摄像头采集并创建本地视频流
+ - muteLocalVideoStream:是否发布本地视频流
+ - muteRemoteVideoStream:是否接收并播放远端视频流
+ - muteAllRemoteVideoStreams:是否接收并播放所有远端视频流
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableVideo;
+
+/**
+
+该方法用于关闭视频。可以在加入频道前或者通话中调用,在加入频道前调用,则自动开启纯音频模式,在通话中调用则由视频模式切换为纯音频模式。调用 enableVideo 方法可开启视频模式。成功调用该方法后,远端会触发 didVideoEnabled(NO) 回调。
+
+- 该方法设置的是内部引擎为启用状态,在 leaveChannel 后仍然有效。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+/** 关闭视频模块
+
+该方法用于关闭视频。可以在加入频道前或者通话中调用,在加入频道前调用,则自动开启纯音频模式,在通话中调用则由视频模式切换为纯音频模式。调用 enableVideo 方法可开启视频模式。
+
+成功调用该方法后,远端会触发remoteVideoStateChangedOfUid回调。
+
+**Note**
+
+ * 该方法设置的是内部引擎为启用状态,在 leaveChannel 后仍然有效。
+ * 该方法重置整个引擎,响应速度较慢,因此建议使用如下方法来控制视频模块:
+ - enableLocalVideo:是否启动摄像头采集并创建本地视频流
+ - muteLocalVideoStream:是否发布本地视频流
+ - muteRemoteVideoStream:是否接收并播放远端视频流
+ - muteAllRemoteVideoStreams:是否接收并播放所有远端视频流
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)disableVideo;
+
+/** 设置视频编码配置
+
+该方法设置视频编码配置。每个配置对应一套视频参数,如分辨率、帧率、码率、视频方向等。 所有设置的参数均为理想情况下的最大值。当视频引擎因网络环境等原因无法达到设置的分辨率、帧率或码率的最大值时,会取最接近最大值的那个值。
+
+如果加入频道后不需要重新设置视频编码配置,建议在 enableVideo 之前调用该方法,可以加快首帧出图时间。
+
+@param config 视频编码器配置的属性
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setVideoEncoderConfiguration:(ARVideoEncoderConfiguration *_Nonnull)config;
+
+/** 初始化本地视图
+
+ 该方法初始化本地视图并设置本地用户视频显示信息,只影响本地用户看到的视频画面,不影响本地发布视频。调用该方法绑定本地视频流的显示视窗(view),并设置本地用户视图的渲染模式和镜像模式。在 App 开发中,通常在初始化后调用该方法进行本地视频设置,然后再加入频道。退出频道后,绑定仍然有效,如果需要解除绑定,可以指定空 (nil) view 调用本方法。
+
+**Note**
+
+ * 该方法在加入频道前后都能调用。
+ * 如果你希望在通话中更新本地用户视图的渲染或镜像模式,请使用 setLocalRenderMode 方法。
+
+ @param local 通过 ARtcVideoCanvas 设置本地视频显示属性。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setupLocalVideo:(ARtcVideoCanvas *_Nullable)local;
+
+/** 初始化远端用户视图
+
+该方法绑定远端用户和显示视图,并设置远端用户视图在本地显示时的渲染模式和镜像模式,只影响本地用户看到的视频画面。调用该接口时需要指定远端用户的 uid,一般可以在进频道前提前设置好。
+
+如果 App 不能事先知道对方的 uid,可以在 APP 收到 didJoinedOfUid 事件时设置。如果启用了视频录制功能,视频录制服务会做为一个哑客户端加入频道,因此其他客户端也会收到它的 didJoinedOfUid 事件,App 不应给它绑定视图(因为它不会发送视频流),如果 App 不能识别哑客户端,可以在 firstRemoteVideoDecodedOfUid 事件时再绑定视图。解除某个用户的绑定视图可以把 view 设置为空。退出频道后,SDK 会把远端用户的绑定关系清除掉。
+
+**Note**
+
+如果你希望在通话中更新远端用户视图的渲染或镜像模式,请使用 setRemoteRenderMode 方法。
+
+- 该参数默认值为空字符 ""。如果用户是通过 ARtcEngineKit 类的 joinChannelByToken 方法加入频道的,则将参数设为默认值,表示该用户在频道内的渲染视图。
+- 如果用户是通过 ARtcChannel 类的 joinChannelByToken 方法加入频道的,则将该参数设为该 ARtcChannel 类对应的 channelId,表示该用户在该 channelId 对应频道内的渲染视图。
+
+ @param remote 通过 ARtcVideoCanvas 设置远端视频显示属性:
+
+ * view 视频显示视窗
+ * renderMode: 视频显示模式:
+ - ARVideoRenderModeHidden (1):优先保证视窗被填满。因视频尺寸与显示视窗尺寸不一致而多出的视频将被截掉。
+ - ARVideoRenderModeFit (2):优先保证视频内容全部显示。因视频尺寸与显示视窗尺寸不一致造成的视窗未被填满的区域填充黑色。
+ * uid: 用户 ID,指定要显示视窗的远端用户。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setupRemoteVideo:(ARtcVideoCanvas *_Nonnull)remote;
+
+/** 更新本地视图显示模式
+
+初始化本地用户视图后,你可以调用该方法更新本地用户视图的渲染和镜像模式。该方法只影响本地用户看到的视频画面,不影响本地发布视频。
+
+**Note**
+ * 如果你使用前置摄像头,默认启动本地用户视图镜像模式;如果你使用后置摄像头,默认关闭本地视图镜像模式。
+ * 请在调用 setupLocalVideo 方法初始化本地视图后,调用该方法。
+ * 你可以在通话中多次调用该方法,多次更新本地用户视图的显示模式。
+
+@param renderMode 本地视图的渲染模式,详见 ARVideoRenderMode;
+@param mirrorMode 本地视图的镜像模式,详见 ARVideoMirrorMode。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setLocalRenderMode:(ARVideoRenderMode)renderMode mirrorMode:(ARVideoMirrorMode)mirrorMode;
+
+/** 更新远端视图显示模式
+
+初始化远端用户视图后,你可以调用该方法更新远端用户视图在本地显示时的渲染和镜像模式。该方法只影响本地用户看到的视频画面。
+
+**Note**
+
+ * 请在调用 setupRemoteVideo 方法初始化远端视图后,调用该方法。
+ * 你可以在通话中多次调用该方法,多次更新远端用户视图的显示模式。
+
+@param uid 用户 ID
+@param renderMode 远端用户视图的渲染模式,详见 ARVideoRenderMode ;
+@param mirrorMode 远端用户视图的镜像模式,详见 ARVideoMirrorMode,SDK 默认关闭远端用户视图的镜像模式 。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setRemoteRenderMode:(NSString *_Nonnull)uid renderMode:(ARVideoRenderMode)renderMode mirrorMode:(ARVideoMirrorMode)mirrorMode;
+
+/** 开启视频预览
+
+该方法用于在进入频道前启动本地视频预览。本地预览默认开启镜像功能。
+
+调用该 API 前,请调用:
+
+ * 调用 setupLocalVideo 设置预览窗口及属性
+ * 调用 enableVideo 开启视频功能
+
+**Note**
+
+启用了本地视频预览后,如果调用 leaveChannel退出频道,本地预览依然处于启动状态,如需要关闭本地预览,需要调用 stopPreview 。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)startPreview;
+
+/** 停止本地视频预览
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)stopPreview;
+
+/** 开关本地视频采集
+
+ 该方法禁用或重新启用本地视频采集,不影响接收远端视频。
+
+ 调用 enableVideo 后,本地视频即默认开启。你可以调用 enableLocalVideo(NO) 关闭本地视频采集。关闭后如果想要重新开启,则可调用 enableLocalVideo(YES)。
+
+ 成功禁用或启用本地视频采集后,远端会触发 didLocalVideoEnabled 回调。
+
+**Note**
+
+ 该方法设置的是内部引擎为启用/禁用状态,在 leaveChannel 后仍然有效。
+
+ @param enabled 是否启用本地视频:
+
+ * YES: 开启本地视频采集和渲染(默认)
+ * NO: 关闭使用本地摄像头设备。关闭后远端用户会接收不到本地用户的视频流;但本地用户依然可以接收远端用户的视频流。设置为 NO 时,该方法不需要本地有摄像头。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableLocalVideo:(BOOL)enabled;
+
+/** 开关本地视频发送
+
+成功调用该方法后,远端会触发 didVideoMuted 回调。你也可以使用 remoteVideoStateChangedOfUid 回调的:
+ ARVideoRemoteStateStopped(0) 和 ARVideoRemoteStateReasonRemoteMuted(5)。
+ ARVideoRemoteStateDecoding(2) 和 ARVideoRemoteStateReasonRemoteUnmuted(6)。
+
+**Note**
+
+ * 相比于调用 enableLocalVideo 控制本地视频流发送,调用该方法响应速度更快。
+ * 该方法不影响视频采集状态,因为没有禁用摄像头。
+ * 该方法在加入频道前后都能调用。如果你在该方法后调用 setChannelProfile 方法,SDK 会根据你设置的频道场景以及用户角色,重新设置是否取消发布本地视频。因此我们建议在 setChannelProfile 后调用该方法。
+
+ @param mute 是否发送本地视频流
+
+ * YES: 不发送本地视频流
+ * NO: 发送本地视频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteLocalVideoStream:(BOOL)mute;
+
+/** 停止/恢复接收所有视频流
+
+ @param mute 禁止/允许接收所有人的视频流
+
+ * YES: 停止接收所有视频流
+ * NO: 允许接收所有视频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteAllRemoteVideoStreams:(BOOL)mute;
+
+/** 停止/恢复接收指定视频流
+
+**Note**
+
+ 如果之前有调用过 muteAllRemoteVideoStreams(YES) 暂停接收所有远端视频,在调用本 API 之前请确保你已调用 muteAllRemoteVideoStreams(NO)。 muteAllRemoteVideoStreams 是全局控制,muteRemoteVideoStream 是精细控制。
+
+ @param uid 远端用户ID
+ @param mute 停止/恢复接收指定视频流:
+ * YES: 停止接收指定用户的视频流
+ * NO: 允许接收指定用户的视频流(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)muteRemoteVideoStream:(NSString *_Nonnull)uid mute:(BOOL)mute;
+
+/** 设置是否默认接收视频流
+ 该方法在加入频道前后都可调用。如果在加入频道后调用setDefaultMuteAllRemoteVideoStreams(YES),会接收不到设置后加入频道的用户的视频流。
+
+ **Note**
+
+ 停止接收视频流后,如果想要恢复接收,请调用 muteRemoteVideoStream (NO),并指定你想要接收的远端用户 uid;如果想恢复接收多个用户的视频流,则需要多次调用 muteRemoteVideoStream。setDefaultMuteAllRemoteVideoStreams (NO) 只能恢复接收后面加入频道的用户的视频流。
+
+ @param mute 是否默认接收视频流
+
+ * YES: 不接收
+ * NO: 接收
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setDefaultMuteAllRemoteVideoStreams:(BOOL)mute;
+
+//MARK: - 视频前处理及后处理
+
+//MARK: - 音频播放路由
+
+/**-----------------------------------------------------------------------------
+* @name 音频播放路由
+* -----------------------------------------------------------------------------
+*/
+
+#if TARGET_OS_IPHONE
+/** 设置默认的语音路由
+
+该方法设置接收到的语音从听筒或扬声器出声。如果用户不调用本方法,语音默认从听筒出声。
+
+**Note**
+
+ * 该方法仅使用于通信场景。
+ * 该方法只在纯音频模式下工作,在有视频的模式下不工作。
+
+ 各频道场景下默认的语音路由:
+
+ * 通信:听筒。
+ * 直播:扬声器。
+
+ @param defaultToSpeaker 默认的语音路由:
+
+ * YES: 默认从外放(扬声器)出声。如果设备连接了耳机或蓝牙,则无法切换到外放。
+ * NO: (默认)默认从听筒出声。如果设备连接了耳机,则语音路由走耳机。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setDefaultAudioRouteToSpeakerphone:(BOOL)defaultToSpeaker;
+
+/** 启用/关闭扬声器播放
+
+该方法设置是否将语音路由到扬声器(外放)。调用该方法后,SDK 将返回 didAudioRouteChanged 回调提示状态已更改。
+
+**Note**
+
+ * 请确保在调用此方法前已调用过 joinChannelByToken 方法。
+ * SDK 会调用 setCategory(AVAudioSessionCategoryPlayAndRecord) 并配置耳麦或者外放,所以调用该方法后所有声音的路由都会按照该方法设置。
+
+ @param enableSpeaker 启用/关闭扬声器播放:
+
+ * YES: 切换到外放。如果设备连接了耳机或蓝牙,则无法切换到外放。
+ * NO: 切换到听筒。如果设备连接了耳机,则语音路由走耳机。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setEnableSpeakerphone:(BOOL)enableSpeaker;
+
+/** 查询扬声器启用状态
+
+ @return 扬声器状态:
+ * YES: 扬声器已开启,语音会输出到扬声器
+ * NO: 扬声器未开启,语音会输出到非扬声器(听筒、耳机等)
+ */
+- (BOOL)isSpeakerphoneEnabled;
+#endif
+
+#if TARGET_OS_IPHONE
+//MARK: - 耳返设置
+/**-----------------------------------------------------------------------------
+* @name 耳返设置
+* -----------------------------------------------------------------------------
+*/
+
+/** 开启耳返功能
+
+**Note**
+
+ 用户必须使用有线耳机才能听到耳返效果
+
+ @param enabled 开启或关闭耳返功能:
+ * YES: 开启耳返功能
+ * NO: 关闭耳返功能(默认)
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableInEarMonitoring:(BOOL)enabled;
+
+/** 设置耳返音量
+
+ @param volume 设置耳返音量,取值范围在 [0,100]。默认值为 100
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setInEarMonitoringVolume:(NSInteger)volume;
+#endif
+
+//MARK: - 语音音效设置
+
+/**-----------------------------------------------------------------------------
+ * @name 美声与音效
+ * -----------------------------------------------------------------------------
+ */
+
+/** 设置本地语音音调
+
+ 该方法改变本地说话人声音的音调。该方法在加入频道前后都能调用。
+
+ @param pitch 语音频率。可以在 [0.5,2.0] 范围内设置。取值越小,则音调越低。默认值为 1.0,表示不需要修改音调。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setLocalVoicePitch:(double)pitch;
+
+/** 设置本地语音音效均衡
+
+ @param bandFrequency 频谱子带索引,取值范围是 [0,9],分别代表 10 个 频带,对应的中心频率是 [31,62,125,250,500,1k,2k,4k,8k,16k] Hz,详见 ARAudioEqualizationBandFrequency 。
+ @param gain 每个 band 的增益,单位是 dB,每一个值的范围是 [-15,15],默认值为 0。
+
+ @return 0方法调用成功,<0方法调用失败
+*/
+-(int)setLocalVoiceEqualizationOfBandFrequency:(ARAudioEqualizationBandFrequency)bandFrequency withGain:(NSInteger)gain;
+
+/** 设置本地音效混响
+
+ 提供一个使用更为简便的接口 setLocalVoiceReverbPreset,通过一系列内置参数的调整,直接实现流行、R&B、摇滚、嘻哈等预置的混响效果。
+
+ 该方法在加入频道前后都能调用。
+
+ @param reverbType 混响音效类型,详见 ARAudioReverbType
+ @param value 设置混响音效的效果数值,各混响音效对应的取值范围请参考 ARAudioReverbType
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setLocalVoiceReverbOfType:(ARAudioReverbType)reverbType withValue:(NSInteger)value;
+
+/** 设置本地语音混响(含虚拟立体声效果)。
+
+**Note:**
+
+ 当使用以 ARAudioReverbPresetFx 为前缀的枚举值时,请确保在调用该方法前将 setAudioProfile 的 profile 参数设置为 ARAudioProfileMusicHighQuality(4) 或 ARAudioProfileMusicHighQualityStereo(5),否则该方法设置无效。
+ 当使用 ARAudioReverbPresetVirtualStereo 时,AR 推荐在调用该方法前将 setAudioProfile 的 profile 参数设置为 ARAudioProfileMusicHighQualityStereo(5)。
+ 该方法对人声的处理效果最佳,AR 不推荐调用该方法处理含人声和音乐的音频数据。
+ 该方法不能与 setLocalVoiceChanger 方法一同使用,否则先调的方法会不生效。更多注意事项,详见《变声与混响》。
+
+ @param reverbPreset 本地语音混响选项,默认值为 ARAudioReverbPresetOff,即原声。详见 ARAudioReverbPreset。
+
+ @return 0: 方法调用成功。< 0: 方法调用失败。请检查输入的枚举值是否正确。
+ */
+- (int)setLocalVoiceReverbPreset:(ARAudioReverbPreset)reverbPreset;
+
+//MARK: - 音乐文件播放及混音设置
+/**-----------------------------------------------------------------------------
+* @name 音乐文件播放及混音设置
+* -----------------------------------------------------------------------------
+*/
+
+/** 开始播放音乐文件
+
+ 指定本地或在线音频文件来和麦克风采集的音频流进行混音或替换。替换是指用指定的音频文件替换麦克风采集到的音频流。该方法可以选择是否让对方听到本地播放的音频,并指定循环播放的次数。
+
+ 成功调用该方法后,本地会触发 localAudioMixingStateDidChanged(ARAudioMixingStatePlaying) 回调。播放结束后,会收到 localAudioMixingStateDidChanged(ARAudioMixingStateStopped) 回调。
+
+**Note**
+
+ * 使用本方法前请确保你的 iOS 设备版本不低于 9.0。
+ * 请在频道内调用该方法,如果在频道外调用该方法可能会出现问题。
+ * 如果播放的是在线音乐文件,请确保重复调用该 API 的间隔超过 100 ms,否则 SDK 会返回 AudioFileOpenTooFrequent(702)警告码,表示音乐文件打开过于频繁。
+ * 如果本地音乐文件不存在、文件格式不支持、无法访问在线音乐文件 URL 都会返回警告码 ARWarningCodeAudioMixingOpenError = 701。
+
+ @param filePath 指定需要混音的音频文件名和文件路径名,例如: /var/mobile/Containers/Data/audio.mp4。建议填写文件后缀名。若无法确定文件后缀名,可不填。支持以下音频格式: mp3,aac,m4a,3gp,wav
+ @param loopback 设置哪些用户可以听到音频混合:
+ * YES: 只有本地可以听到混音或替换后的音频流
+ * NO: 本地和对方都可以听到混音或替换后的音频流
+ @param replace 设置混音麦克风内容:
+ * YES: 只推送设置的本地音频文件或者线上音频文件,不传输麦克风收录的音频。
+ * NO: 音频文件内容将会和麦克风采集的音频流进行混音
+ @param cycle 指定音频文件循环播放的次数:
+
+ * 正整数: 循环的次数
+ * -1:无限循环
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)startAudioMixing:(NSString * _Nonnull)filePath
+ loopback:(BOOL)loopback
+ replace:(BOOL)replace
+ cycle:(NSInteger)cycle;
+
+/** 停止播放音乐文件
+
+ 请在频道内调用该方法。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopAudioMixing;
+
+/** 暂停播放音乐文件
+
+ 请在频道内调用该方法。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)pauseAudioMixing;
+
+/** 恢复播放音乐文件
+
+ 请在频道内调用该方法。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)resumeAudioMixing;
+
+/** 调节音乐文件的播放音量
+
+**Note**
+
+ 该方法调节混音的音乐文件在本地和远端播放的音量大小。请在频道内调用该方法。
+
+ @param volume 音乐文件播放音量范围为 0~100。默认 100 为原始文件音量
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)adjustAudioMixingVolume:(NSInteger)volume;
+
+/** 调节音乐文件在本地播放的音量
+
+**Note**
+
+该方法调节混音的音乐文件在本地播放的音量大小。请在频道内调用该方法。
+
+@param volume 音乐文件播放音量范围为 0~100。默认 100 为原始文件音量
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)adjustAudioMixingPlayoutVolume:(NSInteger)volume;
+
+/** 调节音乐文件在远端播放的音量
+
+音乐文件播放音量范围为 0~100。默认 100 为原始文件音量
+
+@param volume 该方法调节混音的音乐文件在远端播放的音量大小。请在频道内调用该方法。
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)adjustAudioMixingPublishVolume:(NSInteger)volume;
+
+/** 获取音乐文件的本地播放音量
+
+该方法获取混音的音乐文件本地播放音量,方便排查音量相关问题。
+
+ @return 方法调用成功则返回音量值,范围为 [0,100]。<0:方法调用失败
+*/
+- (int)getAudioMixingPlayoutVolume;
+
+/** 获取音乐文件的远端播放音量
+
+该方法获取混音的音乐文件远端播放音量,方便排查音量相关问题。
+
+ @return 方法调用成功则返回音量值,范围为 [0,100]。<0:方法调用失败
+*/
+- (int)getAudioMixingPublishVolume;
+
+//MARK: - 音效文件播放管理
+
+/**-----------------------------------------------------------------------------
+* @name 音效文件播放管理
+* -----------------------------------------------------------------------------
+*/
+
+/** 获取音效文件播放音量
+
+@return 方法调用成功返回音效的音量值,范围为 [0.0,100.0],< 0: 方法调用失败
+ */
+- (double)getEffectsVolume;
+
+/** 设置音效文件播放音量
+
+ @param volume 取值范围为 [0.0,100.0]。 100.0 为默认值
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setEffectsVolume:(double)volume;
+
+/** 实时调整音效文件播放音量
+
+ @param soundId 自行设定的音效 ID,需保证唯一性。
+ @param volume 取值范围为 [0.0,100.0]。100.0 为默认值
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setVolumeOfEffect:(int)soundId
+ withVolume:(double)volume;
+
+/** 播放指定音效文件
+
+该方法可以播放指定的本地或在线音效文件来给应用增加音效,比如游戏中特定操作的音效。
+
+你可以在该方法中设置音效文件的播放次数、音调、音效的空间位置和增益,以及远端用户是否能听到该音效。你可以多次调用该方法,通过传入不同的音效文件的 soundID 和 filePath,同时播放多个音效文件,实现音效叠加。为获得最佳用户体验,我们建议同时播放的音效文件不要超过 3 个。
+
+调用该方法播放音效结束后,会触发 rtcEngineDidAudioEffectFinish 回调。
+
+**Note**
+
+ macOS 上不支持同时播放多个在线音效文件。
+
+ @param soundId 自行设定的音效 ID,需保证唯一性。 如果你已通过 preloadEffect 将音效加载至内存,确保这里设置的 soundId 与 preloadEffect 设置的 soundId 相同。
+ @param filePath 指定音效文件的绝对路径或 URL 地址(包含文件后缀名),例如:/var/mobile/Containers/Data/audio.mp4。支持以下音频格式: mp3、mp4、aac、m4a、3gp、wav。
+ @param loopCount 设置音效文件循环播放的次数:
+
+ * 0: 播放音效文件一次
+ * 1: 循环播放音效文件两次
+ * -1: 无限循环播放音效文件,直至调用 stopEffect 或 stopAllEffects 后停止
+
+ @param pitch 设置音效的音调 取值范围为 [0.5,2]。默认值为 1.0,表示不需要修改音调。取值越小,则音调越低
+ @param pan 设置音效的空间位置。取值范围为 [-1.0,1.0]:
+
+ * 0.0: 音效出现在正前方
+ * 1.0: 音效出现在右边
+ * -1.0: 音效出现在左边
+
+ @param gain 设置音效的音量。取值范围为 [0.0,100.0]。默认值为 100.0。取值越小,则音效的音量越低。
+ @param publish 设置是否将音效传到远端
+
+ * YES: 音效文件在本地播放的同时,会发布到 ar云平台 云上,因此远端用户也能听到该音效
+ * NO: 音效文件不会发布到ar云平台云上,因此只能在本地听到该音效
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)playEffect:(int)soundId
+ filePath:(NSString * _Nullable)filePath
+ loopCount:(int)loopCount
+ pitch:(double)pitch
+ pan:(double)pan
+ gain:(double)gain
+ publish:(BOOL)publish;
+
+/** 停止播放指定音效文件
+
+ @param soundId 自行设定的音效 ID,需保证唯一性。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopEffect:(int)soundId;
+
+/** 停止播放所有音效文件
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopAllEffects;
+
+/** 将指定音效文件预加载至内存
+
+ 为保证通信畅通,请注意控制预加载音效文件的大小,并在 joinChannelByToken 前就使用该方法完成音效预加载。
+
+ 音效文件支持以下音频格式: mp3,aac,m4a,3gp,wav
+
+**Note**
+
+ 该方法不支持在线音效文件。
+
+ @param soundId 自行设定的音效 ID,需保证唯一性。
+ @param filePath 音效文件的绝对路径
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)preloadEffect:(int)soundId
+ filePath:(NSString * _Nullable)filePath;
+
+/** 从内存释放某个预加载的音效文件
+
+ @param soundId 自行设定的音效 ID,需保证唯一性。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)unloadEffect:(int)soundId;
+
+/** 暂停音效文件播放
+
+ @param soundId 自行设定的音效 ID,需保证唯一性。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)pauseEffect:(int)soundId;
+
+/** 暂停所有音效文件播放
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)pauseAllEffects;
+
+/** 恢复播放指定音效文件
+
+ @param soundId 自行设定的音效 ID,需保证唯一性。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)resumeEffect:(int)soundId;
+
+/** 恢复播放所有音效文件
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)resumeAllEffects;
+
+//MARK: - 音频录制
+
+/**-----------------------------------------------------------------------------
+ * @name 音频录制
+ * -----------------------------------------------------------------------------
+ */
+
+/** 开始客户端录音
+
+SDK 支持通话过程中在客户端进行录音。调用该方法后,你可以录制频道内所有用户的音频,并得到一个包含所有用户声音的录音文件。录音文件格式可以为:
+
+ - .wav: 文件大,音质保真度较高。
+ - .aac: 文件小,音质保真度较低。
+
+**Note**
+
+ - 请确保你在该方法中指定的路径存在并且可写。
+ - 该接口需在 joinChannelByToken 之后调用。如果调用 leaveChannel 时还在录音,录音会自动停止。
+ - 为保证录音效果,当 sampleRate 设为 44100 Hz 或 48000 Hz 时,建议将 quality 设为 ARAudioRecordingQualityMedium 或 ARAudioRecordingQualityHigh 。
+
+ @param filePath 录音文件在本地保存的绝对路径,由用户自行指定,需精确到文件名及格式,例如:/var/mobile/Containers/Data/audio.aac。
+ @param sampleRate 录音采样率(Hz),可以设为以下值:
+
+ - 16000
+ - (Default) 32000
+ - 44100
+ - 48000
+
+ @param quality 录音音质。详见 ARAudioRecordingQuality 。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)startAudioRecording:(NSString * _Nonnull)filePath
+ sampleRate:(NSInteger)sampleRate
+ quality:(ARAudioRecordingQuality)quality;
+
+/** 停止客户端录音
+
+**Note:**
+
+ 该接口需要在 leaveChannel 之前调用,不然会在调用 leaveChannel 时自动停止。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopAudioRecording;
+
+//MARK: - 开启声卡采集
+
+//MARK: - 音频其他方法
+
+//MARK: - 网络相关测试
+
+/**-----------------------------------------------------------------------------
+ * @name 网络相关测试
+ * -----------------------------------------------------------------------------
+ */
+
+/** 开始语音通话回路测试
+
+ 该方法启动语音通话测试,目的是测试系统的音频设备(耳麦、扬声器等)和网络连接是否正常。在测试过程中,用户先说一段话,声音会在设置的时间间隔后回放出来。如果用户能正常听到自己刚才说的话,就表示系统音频设备和网络连接都是正常的。
+
+**Note:**
+
+- 请在加入频道前调用该方法。
+
+- 调用该方法后必须调用 stopEchoTest 以结束测试,否则不能进行下一次回声测试,也无法加入频道。
+
+- 直播场景下,该方法仅能由用户角色为主播的用户调用。
+
+@param interval 返回语音通话回路测试结果的时间间隔,取值范围为 [2,10],单位为秒,默认值为 10 秒。
+@param successBlock 成功开始语音通话测试回调。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)startEchoTestWithInterval:(NSInteger)interval successBlock:(void(^ _Nullable)(NSString * _Nonnull channel, NSString * _Nonnull uid, NSInteger elapsed))successBlock;
+
+/** 停止语音通话回路测试
+
+ @return 0方法调用成功,<0方法调用失败,如 ERR_REFUSED (-5):不能停止测试,可能语音通话测试没有成功启动。
+ */
+- (int)stopEchoTest;
+
+/** 启动网络测试
+
+ 该方法启用网络连接质量测试,用于检测用户网络接入质量。默认该功能为关闭状态。
+
+ 该方法主要用于以下场景:
+
+ - 用户加入频道前,可以调用该方法判断和预测目前的上行网络质量是否足够好。
+ - 直播场景下,当用户角色想由观众切换为主播时,可以调用该方法判断和预测目前的上行网络质量是否足够好。
+ 启用该方法会消耗一定的网络流量,影响通话质量,因此我们建议不要和 startLastmileProbeTest 同时使用。
+
+ 在收到 lastmileQuality 回调后须调用 disableLastmileTest 停止测试,再加入频道或切换用户角色。
+
+**Note:**
+
+ - 调用该方法后,在收到 lastmileQuality 回调之前请不要调用其他方法,否则可能会由于 API 操作过于频繁导致此回调无法执行。
+ - 直播场景下,主播在加入频道后请勿调用该方法。
+ - 加入频道前调用该方法检测网络质量后,SDK 会占用一路视频的带宽,码率与 setVideoEncoderConfiguration 中设置的码率相同。加入频道后,无论是否调用了 disableLastmileTest,SDK 均会自动停止带宽占用。
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableLastmileTest;
+
+/** 关闭网络测试
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)disableLastmileTest;
+
+/** 开始通话前网络质量探测
+
+
+ 开始通话前网络质量探测,向用户反馈上下行网络的带宽、丢包、网络抖动和往返时延数据。
+
+ 启用该方法后,SDK 会依次返回如下 2 个回调:
+
+ lastmileQuality,视网络情况约 2 秒内返回。该回调通过打分反馈上下行网络质量,更贴近用户的主观感受。
+ lastmileProbeResult,视网络情况约 30 秒内返回。该回调通过具体数据反馈上下行网络质量,更加客观。
+ 该方法主要用于以下两种场景:
+
+ - 用户加入频道前,可以调用该方法判断和预测目前的上行网络质量是否足够好。
+ - 直播场景下,当用户角色想由观众切换为主播时,可以调用该方法判断和预测目前的上行网络质量是否足够好。
+
+**Note:**
+
+ - 该方法会消耗一定的网络流量,影响通话质量,因此我们建议不要和 enableLastmileTest 同时使用。
+ - 调用该方法后,在收到 lastmileQuality 和 lastmileProbeResult 回调之前请不要调用其他方法,否则可能会由于 API 操作过于频繁导致此方法无法执行。
+ - 直播场景下,如果本地用户为主播,请勿在加入频道后调用该方法。
+
+@param config Last mile 网络探测配置,详见 ARLastmileProbeConfig
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)startLastmileProbeTest:(ARLastmileProbeConfig *_Nullable)config;
+
+/** 停止通话前网络质量探测
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)stopLastmileProbeTest;
+
+//MARK: - 自定义视频模块
+
+/**-----------------------------------------------------------------------------
+ * @name 自定义视频模块
+ * -----------------------------------------------------------------------------
+*/
+
+/** 设置自定义视频源
+
+该方法设置视频源。实时通讯过程中,ar云平台 SDK 通常会启动默认的视频输入设备,即内置的摄像头,进行视频推流。当需要自定义视频设备时,App 可以先通过 ARVideoSourceProtocol 自定义视频源,然后调用该方法将自定义的视频源加入到 SDK 中。
+
+ @param videoSource 自定义的视频源,详见 ARVideoSourceProtocol
+ */
+- (void)setVideoSource:(id<ARVideoSourceProtocol> _Nullable)videoSource;
+
+/** 本地自定义视频渲染器
+
+ 该方法设置本地视频渲染器。实时通讯过程中, SDK 通常会启动默认的视频渲染器进行视频渲染。当需要自定义视频渲染设备时,App 可以先通过 ARVideoSinkProtocol 自定义渲染器,然后调用该方法将视频渲染器加入到 SDK 中。
+
+ 该方法在加入频道前后都能调用。
+
+ @param videoRenderer 自定义的视频渲染器,详见 ARVideoSinkProtocol
+ */
+- (void)setLocalVideoRenderer:(id<ARVideoSinkProtocol> _Nullable)videoRenderer;
+
+/** 远端自定义视频渲染器
+
+ 实时音视频互动过程中,SDK 通常会启动默认的视频渲染器进行视频渲染。当需要自定义视频渲染设备时,App 可以先通过 ARVideoSinkProtocol 自定义渲染器,然后调用该方法将视频渲染器加入到 SDK 中。
+
+ 该方法在加入频道前后都能调用。如果在加入频道前调用,需要自行维护远端用户的 uid。
+
+ @param videoRenderer 自定义的视频渲染器,详见 ARVideoSinkProtocol
+ @param uid 远端用户的 uid
+ */
+- (void)setRemoteVideoRenderer:(id<ARVideoSinkProtocol> _Nullable)videoRenderer forUserId:(NSString * _Nonnull)uid;
+
+/** 获取当前视频源
+
+ @return 当前视频源,详见ARVideoSourceProtocol.
+ */
+- (id<ARVideoSourceProtocol> _Nullable)videoSource;
+
+/** 获取本地视频渲染器
+
+ @return 本地视频渲染器。 详见ARVideoSinkProtocol.
+ */
+- (id<ARVideoSinkProtocol> _Nullable)localVideoRenderer;
+
+/** 获取远端视频渲染器
+
+ @param uid 远端用户的 uid
+ @return 远端视频渲染器。 详见 ARVideoSinkProtocol.
+ */
+- (id<ARVideoSinkProtocol> _Nullable)remoteVideoRendererOfUserId:(NSString * _Nonnull)uid;
+
+//MARK: - 音频自渲染
+
+//MARK: - 音频自采集 (仅适用于 push 模式)
+
+/**-----------------------------------------------------------------------------
+ * @name 音频自采集 (仅适用于 push 模式)
+ * -----------------------------------------------------------------------------
+ */
+
+/** 开启外部音频采集
+
+ 该方法必须在加入频道前调用
+
+ @param sampleRate 外部音频源的采样率 (Hz),可设置为 8000,16000,32000,44100 或 48000
+ @param channelsPerFrame 外部音频源的通道数,可设置为 1 或 2:
+ * 1: 单声道
+ * 2: 双声道
+
+**Note:**
+该方法必须在 joinChannelByToken 和 startPreview 前调用
+ */
+- (void)enableExternalAudioSourceWithSampleRate:(NSUInteger)sampleRate channelsPerFrame:(NSUInteger)channelsPerFrame;
+
+/** 关闭外部音频采集
+*/
+- (void)disableExternalAudioSource;
+
+/** 推送外部音频帧
+
+ @param data 外部音频数据
+ @param samples 音频帧的样本数量
+ @param timestamp 外部音频帧的时间戳。该参数为必填。你可以使用该时间戳还原音频帧顺序;在有视频的场景中(包含使用外部视频源的场景),该参数可以帮助实现音视频同步。
+ @return YES方法调用成功,NO方法调用失败
+ */
+- (BOOL)pushExternalAudioFrameRawData:(void *_Nonnull)data samples:(NSUInteger)samples timestamp:(NSTimeInterval)timestamp;
+
+/** 推送外部 CMSampleBuffer 音频帧
+
+ @param sampleBuffer 采样缓冲区
+ @return YES方法调用成功,NO方法调用失败
+ */
+- (BOOL)pushExternalAudioFrameSampleBuffer:(CMSampleBufferRef _Nonnull)sampleBuffer type:(ARAudioType)type;
+
+//MARK: - 视频自采集 (仅适用于 push 模式)
+
+/**-----------------------------------------------------------------------------
+ * @name 视频自采集 (仅适用于 push 模式)
+ * -----------------------------------------------------------------------------
+ */
+
+/** 配置外部视频源
+
+ 如果使用了外部视频源,请在调用 enableVideo 或 startPreview 之前调用此 API。
+
+ @param enable 是否使用外部视频源:
+
+ * YES: 使用外部视频源
+ * NO: 不使用外部视频源(默认)
+
+ @param useTexture 是否使用 Texture 作为输入:
+
+ * YES: 使用 Texture 作为输入
+ * NO: 不使用 Texture 作为输入
+
+ @param pushMode 是否外部视频源需要调用 pushExternalVideoFrame 将视频帧主动推送给 ar云平台SDK:
+
+ * YES: 使用推送 (push) 模式
+ * NO: 使用拉 (pull) 模式(暂不支持)
+
+ **Note:**
+ 该方法需要在加入频道前调用。
+ */
+- (void)setExternalVideoSource:(BOOL)enable useTexture:(BOOL)useTexture pushMode:(BOOL)pushMode;
+
+/** 推送外部视频帧
+
+该方法主动将视频帧数据用 ARVideoFrame 类封装后传递给 SDK。请确保在你调用本方法前已调用 setExternalVideoSource,并将参数 pushMode 设为 YES,不然调用本方法后会一直报错。
+
+ @param frame 该视频帧包含待 ar云平台SDK 编码的视频数据,详见 ARVideoFrame
+ @return YES: 该帧推送成功 NO: 该帧推送不成功
+ */
+- (BOOL)pushExternalVideoFrame:(ARVideoFrame * _Nonnull)frame;
+
+//MARK: - 原始音频数据处理
+
+//MARK: - 直播视频水印
+
+//MARK: - 直播音视频流回退
+/**-----------------------------------------------------------------------------
+ * @name 直播音视频流回退
+ * -----------------------------------------------------------------------------
+ */
+
+/** 设置弱网条件下订阅的音视频流回退选项
+
+ 网络不理想的环境下,订阅音视频的质量都会下降。使用该接口开启订阅音视频流的回退选项后,SDK 会在下行弱网且音视频质量严重受影响时,将视频流切换为小流,或关断视频流,从而保证或提高通信质量。同时 SDK 会持续监控网络质量,并在网络质量改善时恢复音视频流。当远端订阅流回退为音频流时,或由音频流恢复为音视频流时,SDK 会触发远端订阅流已回退为音频流回调。
+
+ @param option 订阅音视频流的回退选项,默认为弱网时回退到视频小流,详见 ARStreamFallbackOptions
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setRemoteSubscribeFallbackOption:(ARStreamFallbackOptions)option;
+
+//MARK: - 视频双流模式
+/**-----------------------------------------------------------------------------
+* @name 视频双流模式
+* -----------------------------------------------------------------------------
+*/
+
+/** 开关视频双流模式
+
+@param enabled YES双流模式,NO单流模式,默认单流模式
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)enableDualStreamMode:(BOOL)enabled;
+
+/** 设置订阅的视频流类型
+
+ 如果发送端选择发送视频双流(大流或小流),接收端可以选择接收大流还是小流。其中大流可以理解为高分辨率高码率的视频流,小流则是低分辨率低码率的视频流。该方法可以根据视频窗口的大小动态调整对应视频流的大小,以节约带宽和计算资源。
+
+@param uid 用户 ID
+@param streamType 设置视频流大小,详见ARVideoStreamType
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setRemoteVideoStream:(NSString *_Nonnull)uid type:(ARVideoStreamType)streamType;
+
+/** 设置默认订阅的视频流类型
+
+ @param streamType 设置默认接收的视频流类型,详见 ARVideoStreamType 。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setRemoteDefaultVideoStreamType:(ARVideoStreamType)streamType;
+
+//MARK: - 加密
+
+/**-----------------------------------------------------------------------------
+ * @name 加密
+ * -----------------------------------------------------------------------------
+ */
+
+/** Enables/Disables the built-in encryption.
+
+ 在安全要求较高的场景下,建议你在加入频道前,调用 enableEncryption 方法开启内置加密。
+
+ 同一频道内所有用户必须使用相同的加密模式和密钥。一旦所有用户都离开频道,该频道的加密密钥会自动清除。
+
+ **Note**
+
+ - 如果开启了内置加密,则不能使用 RTMP/RTMPS 推流功能。
+ - anyRTC 支持 4 种加密模式。除 SM4_128_ECB 模式外,其他加密模式都需要在集成 iOS SDK 时,额外添加加密库文件。详见《媒体流加密》。
+
+ @param enabled 是否开启内置加密:
+ - YES: 开启
+ - NO: 关闭
+
+ @param config 配置内置加密模式和密钥。详见 AREncryptionConfig 。
+
+ @return 0方法调用成功,<0方法调用失败
+
+ -2 (ARErrorCodeInvalidArgument): 调用了无效的参数。需重新指定参数。
+ -7 (ARErrorCodeNotInitialized): SDK 尚未初始化。需在调用 API 之前已创建 ARRtcEngineKit 对象并完成初始化。
+ -4 (ARErrorCodeNotSupported): 设置的加密模式不正确或加载外部加密库失败。需检查枚举值是否正确或重新加载外部加密库。
+ */
+- (int)enableEncryption:(bool)enabled encryptionConfig:(AREncryptionConfig *)config;
+
+//MARK: - 直播输入在线媒体流
+
+/**-----------------------------------------------------------------------------
+ * @name 直播输入在线媒体流
+ * -----------------------------------------------------------------------------
+ */
+
+/** 输入在线媒体流 URL
+
+ 该方法通过在服务端拉取视频流并发送到频道中,将正在播放的视频输入到正在进行的直播中。可主要应用于赛事直播、多人看视频互动等直播场景。
+
+ 调用该方法后,SDK 会在本地触发 streamInjectedStatusOfUrl 回调,报告输入在线媒体流的状态。
+
+ 成功输入媒体流后,该音视频流会出现在频道中,频道内所有用户都会收到 didJoinedOfUid 回调,其中 uid 为 "share666"。
+
+**Note:**
+
+ - 频道内同一时间只允许输入一个在线媒体流。
+ - 请确保已开通旁路推流的功能,详见前提条件。
+ @param url 添加到直播中的视频流 URL 地址, 支持 RTMP, HLS, HTTP-FLV 协议传输。
+
+ - 支持的音频编码格式:AAC。
+ - 支持的视频编码格式:H264 (AVC)。
+ @param config 输入的视频流设置,详见 ARLiveInjectStreamConfig 。
+
+@return 0方法调用成功,<0方法调用失败
+
+ - ARErrorCodeInvalidArgument(-2):输入的 URL 为空。请重新调用该方法,并确认输入的媒体流的 URL 是有效的。
+ - ARErrorCodeNotInitialized(-7):引擎没有初始化。请确认调用该方法前已创建 RtcEngine 对象并完成初始化。
+ - ARErrorCodeNotSupported(-4):频道非直播场景。请调用 setChannelProfile 并将频道设置为直播场景再调用该方法。
+ - ARErrorCodeNotReady(-3):用户没有加入频道。
+*/
+- (int)addInjectStreamUrl:(NSString * _Nonnull)url config:(ARLiveInjectStreamConfig * _Nonnull)config;
+
+/** 删除输入的在线媒体流
+
+ 成功删除后会触发 didOfflineOfUid 回调,UID 为 "share666"。
+
+ @param url 已输入、待删除的在线媒体流 URL 地址
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)removeInjectStreamUrl:(NSString * _Nonnull)url;
+
+//MARK: - CDN 旁路推流
+/**-----------------------------------------------------------------------------
+ * @name CDN 旁路推流
+ * -----------------------------------------------------------------------------
+ */
+
+/** 增加旁路推流地址
+
+ 该方法用于添加旁路推流地址,调用该方法后,SDK 会在本地触发 rtmpStreamingChangedToState 回调,报告增加旁路推流地址的状态。
+
+ **Note:**
+
+ - 该方法仅适用于直播场景。
+ - 请确保在成功加入频道后再调用该接口。
+ - 请确保已开通旁路推流的功能
+ - 该方法每次只能增加一路旁路推流地址。若需推送多路流,则需多次调用该方法
+
+ @param url CDN 推流地址,格式为 RTMP。该字符串长度不能超过 1024 字节。URL 不支持中文等特殊字符。
+ @param transcodingEnabled 是否转码:
+
+ - YES: 转码(转码是指在旁路推流时对音视频流做一些转码处理后再推送到其他 RTMP 服务器,常见的适用场景是对多主播进行混流、合图)。如果设为 YES,需先调用 setLiveTranscoding 方法。
+ - NO: 不转码。
+
+ @return 0方法调用成功,<0方法调用失败
+
+ - ARErrorCodeInvalidArgument(-2):参数无效,一般是 URL 为空或是长度为 0 的的字符串
+ - ARErrorCodeNotInitialized(-7):推流时未初始化引擎
+ */
+- (int)addPublishStreamUrl:(NSString * _Nonnull)url transcodingEnabled:(BOOL)transcodingEnabled;
+
+/** 删除旁路推流地址
+
+ 该方法用于删除旁路推流过程中已经设置的 RTMP 推流地址。调用该方法后,SDK 会在本地触发 rtmpStreamingChangedToState 回调,报告删除旁路推流地址的状态。
+
+**Note:**
+
+ * 该方法仅适用于直播场景。
+ * 该方法每次只能删除一路旁路推流地址。若需删除多路流,则需多次调用该方法。
+ * URL 不支持中文等特殊字符。
+
+ @param url 待删除的推流地址,格式为 RTMP。该字符串长度不能超过 1024 字节
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)removePublishStreamUrl:(NSString * _Nonnull)url;
+
+/** 设置直播转码
+
+ 该方法用于旁路推流的视图布局及音频设置等。调用该方法更新转码设置后本地会触发 rtcEngineTranscodingUpdated 回调。
+
+ **Note**
+
+ - 该方法仅适用于直播场景。
+ - 请确保已开通 CDN 旁路推流的功能
+ - 首次调用该方法更新转码设置时,不会触发 rtcEngineTranscodingUpdated 回调。
+
+
+ @param transcoding 一个 ARLiveTranscoding 的对象,详细设置见 ARLiveTranscoding 。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setLiveTranscoding:(ARLiveTranscoding *_Nullable)transcoding;
+
+//MARK: - 数据流
+
+/**-----------------------------------------------------------------------------
+ * @name 数据流
+ * -----------------------------------------------------------------------------
+ */
+
+/** 创建数据流
+
+ 该方法用于创建数据流。ARtcEngineKit 生命周期内,每个用户最多只能创建 5 个数据流。频道内数据通道最多允许数据延迟 5 秒,若超过 5 秒接收方尚未收到数据流,则数据通道会向 App 报错。 目前Native SDK 支持 99% 可靠和 100% 有序的数据传输。
+
+**Note:**
+
+ 请将 reliable 和 ordered 同时设置为 YES 或 NO,暂不支持交叉设置。
+
+ @param streamId 数据流 ID
+ @param reliable 设置是否保证接收方在5秒内接收到发送方的数据流:
+
+ - YES: 接收方 5 秒内会收到发送方所发送的数据,否则会收到 didOccurStreamMessageError 回调获得相应报错信息。
+ - NO: 接收方不保证收到,就算数据丢失也不会报错。
+
+ @param ordered 设置接收方是否收到发送顺序中的数据流:
+
+ - YES: 接收方 5 秒内会按照发送方发送的顺序收到数据包。
+ - NO: 接收方不保证按照发送方发送的顺序收到数据包
+
+ @return 0方法调用成功,<0方法调用失败
+*/
+- (int)createDataStream:(NSInteger * _Nonnull)streamId reliable:(BOOL)reliable ordered:(BOOL)ordered;
+
+/** 发送数据流
+
+ 该方法发送数据流消息到频道内所有用户。SDK 对该方法的实现进行了如下限制:频道内每秒最多能发送 30 个包,且每个包最大为 1 KB。 每个客户端每秒最多能发送 6 KB 数据。频道内每人最多能同时有 5 个数据通道。
+
+ 成功调用该方法后,远端会触发 receiveStreamMessageFromUid 回调,远端用户可以在该回调中获取接收到的流消息;若调用失败,远端会触发 didOccurStreamMessageErrorFromUid 回调。
+
+ **Note:**
+
+ - 该方法仅适用于通信场景以及直播场景下的主播用户,如果直播场景下的观众调用此方法可能会造成观众变主播。
+ - 请确保在调用该方法前,已调用 createDataStream 创建了数据通道。
+
+ @param streamId 数据流 ID,createDataStream 的返回值。
+ @param data 需要发送的消息
+
+ @return 0方法调用成功,<0方法调用失败
+*/
+- (int)sendStreamMessage:(NSInteger)streamId data:(NSData * _Nonnull)data;
+
+//MARK: - 其他视频控制
+/**-----------------------------------------------------------------------------
+* @name 其他视频控制
+* -----------------------------------------------------------------------------
+*/
+
+/** 设置摄像头采集偏好
+
+一般的视频通话或直播中,默认由 SDK 自动控制摄像头的输出参数。在如下特殊场景中,默认的参数通常无法满足需求,或可能引起设备性能问题,我们推荐调用该方法设置摄像头的采集偏好:
+
+* 使用原始音视频数据自采集接口时,如果 SDK 输出的分辨率和帧率高于 setVideoEncoderConfiguration 中指定的参数,在后续处理视频帧的时候,比如美颜功能时,会需要更高的 CPU 及内存,容易导致性能问题。在这种情况下,我们推荐将摄像头采集偏好设置为 ARCameraCaptureOutputPreferencePerformance(1),避免性能问题。
+* 如果没有本地预览功能或者对预览质量没有要求,我们推荐将采集偏好设置为 ARCameraCaptureOutputPreferencePerformance(1),以优化 CPU 和内存的资源分配。
+* 如果用户希望本地预览视频比实际编码发送的视频清晰,可以将采集偏好设置为 ARCameraCaptureOutputPreferencePreview(2)。
+
+**Note**
+
+请在启动摄像头之前调用该方法,如 joinChannelByToken,enableVideo 或者 enableLocalVideo 之前。
+
+@param configuration 摄像头采集偏好,详见 ARCameraCapturerConfiguration
+
+@return 0方法调用成功,<0方法调用失败
+ */
+- (int)setCameraCapturerConfiguration:(ARCameraCapturerConfiguration * _Nullable)configuration;
+
+/** 开启/关闭本地人脸检测
+
+ 开启本地人脸检测后,SDK 会触发 facePositionDidChangeWidth 回调向你报告人脸检测的信息::
+
+ - 摄像头采集的画面大小
+ - 人脸在画面中的位置
+ - 人脸距设备屏幕的距离
+
+ @param enable 是否开启人脸检测:
+
+ - YES: 开启人脸检测
+ - NO: (默认)关闭人脸检测
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableFaceDetection:(BOOL)enable;
+
+#if TARGET_OS_IPHONE
+
+//MARK: - 摄像头控制
+/**-----------------------------------------------------------------------------
+* @name 摄像头控制
+* -----------------------------------------------------------------------------
+*/
+
+/** 切换前置/后置摄像头
+
+**Note**
+
+本方法仅适用于 iOS 平台,不适用于 macOS。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)switchCamera;
+
+/** 检测设备是否支持摄像头缩放功能
+
+@return YES: 设备支持摄像头缩放功能; NO: 设备不支持摄像头缩放功能。
+*/
+- (BOOL)isCameraZoomSupported;
+
+/** 检测设备是否支持闪光灯常开
+
+**Note**
+
+ * 本方法仅适用于 iOS 平台,不适用于 macOS。
+ * 一般情况下,App 默认开启前置摄像头,因此如果你的前置摄像头不支持闪光灯常开,直接使用该方法会返回 NO。如果需要检查后置摄像头是否支持闪光灯常开,需要先使用 switchCamera 切换摄像头,再使用该方法。
+
+@return YES: 设备支持闪光灯常开; NO:设备不支持闪光灯常开。
+*/
+- (BOOL)isCameraTorchSupported;
+
+/** 检测设备是否支持手动对焦功能
+
+**Note**
+
+本方法仅适用于 iOS 平台,不适用于 macOS。
+
+@return YES: 设备支持手动对焦功能;NO: 设备不支持手动对焦功能。
+*/
+- (BOOL)isCameraFocusPositionInPreviewSupported;
+
+/** 检测设备是否支持手动曝光功能
+
+**Note**
+
+本方法仅适用于 iOS 平台,不适用于 macOS。
+
+@return YES: 设备支持手动曝光功能;NO: 设备不支持手动曝光功能。
+*/
+- (BOOL)isCameraExposurePositionSupported;
+
+/** 检测设备是否支持人脸对焦功能
+
+**Note**
+
+本方法仅适用于 iOS 平台,不适用于 macOS。
+
+@return YES: 设备支持人脸对焦功能;NO: 设备不支持人脸对焦功能。
+*/
+- (BOOL)isCameraAutoFocusFaceModeSupported;
+
+/** 设置摄像头缩放比例
+
+**Note**
+
+本方法仅适用于 iOS 平台,不适用于 macOS。
+
+@param zoomFactor 摄像头缩放比例,有效范围是 1.0 到设备支持的最大缩放比例。
+
+@return 设置成功返回设置的 factor 值,设置失败返回 < 0
+*/
+- (CGFloat)setCameraZoomFactor:(CGFloat)zoomFactor;
+
+/** 设置手动对焦位置,并触发对焦
+
+**Note**
+
+本方法仅适用于 iOS 平台,不适用于 macOS。成功调用该方法后,本地会触发 cameraFocusDidChangedToRect 回调。
+
+@param position 触摸点相对于视图的坐标
+
+@return YES方法调用成功,NO方法调用失败
+*/
+- (BOOL)setCameraFocusPositionInPreview:(CGPoint)position;
+
+/** 设置摄像头曝光位置
+
+**Note**
+
+本方法仅适用于 iOS 平台,不适用于 macOS。成功调用该方法后,本地会触发 cameraExposureDidChangedToRect 回调。
+
+@param positionInView 触摸点相对于视图的横坐标和纵坐标
+
+@return YES方法调用成功,NO方法调用失败
+*/
+- (BOOL)setCameraExposurePosition:(CGPoint)positionInView;
+
+/** 设置是否打开闪光灯
+
+@param isOn YES打开,NO关闭
+
+@return YES方法调用成功,NO方法调用失败
+*/
+- (BOOL)setCameraTorchOn:(BOOL)isOn;
+
+/** 设置是否开启人脸对焦功能
+
+@param enable YES开启,NO关闭,默认关闭
+
+@return YES方法调用成功,NO方法调用失败
+*/
+- (BOOL)setCameraAutoFocusFaceModeEnabled:(BOOL)enable;
+
+#endif
+
+#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
+//MARK: - 屏幕共享
+
+/**-----------------------------------------------------------------------------
+ * @name 屏幕共享
+ * -----------------------------------------------------------------------------
+ */
+
+/** 通过屏幕 ID 共享屏幕(仅支持 macOS )
+
+共享一个屏幕或该屏幕的部分区域。你需要在该方法中指定想要共享的屏幕 ID。
+
+**Note**: 该方法需要在加入频道后调用。
+
+@param displayId 待共享的屏幕 ID。通过该参数指定你要共享的那个屏幕。
+@param rectangle (可选)待共享区域相对于整个屏幕的位置。如不填,则表示共享整个屏幕。由如下参数组成:
+
+- x:左上角的横向偏移
+- y:左上角的纵向偏移
+- width:待共享区域的宽
+- height:待共享区域的高
+
+ 如果设置的共享区域超出了屏幕的边界,则只共享屏幕内的内容;如果宽或高设为 0,则共享整个屏幕。
+@param captureParams 屏幕共享的编码参数配置。默认的分辨率为 1920 x 1080,即 2073600 像素。该像素值为计费标准。 详见 ARScreenCaptureParameters 中的说明。
+
+@return 0方法调用成功,<0方法调用失败
+ */
+- (int)startScreenCaptureByDisplayId:(NSUInteger)displayId
+ rectangle:(CGRect)rectangle
+ parameters:(ARScreenCaptureParameters * _Nonnull)captureParams;
+
+/** 通过窗口 ID 共享窗口(仅支持 macOS )
+
+共享一个窗口或该窗口的部分区域。你需要在该方法中指定想要共享的窗口 ID。
+
+**Note**: 该方法需要在加入频道后调用。
+
+@param windowId 待共享的窗口 ID。通过该参数指定你要共享的那个窗口
+@param rectangle (可选)待共享区域相对于整个窗口的位置。如不填,则表示共享整个窗口。由如下参数组成:
+
+ - x:左上角的横向偏移
+ - y:左上角的纵向偏移
+ - width:待共享区域的宽
+ - height:待共享区域的高
+
+ 如果设置的共享区域超出了窗口的边界,则只共享窗口内的内容;如果宽或高设为 0,则共享整个窗口。
+@param captureParams 屏幕共享的编码参数配置。默认的分辨率为 1920 x 1080,即 2073600 像素。该像素值为计费标准。 详见 ARScreenCaptureParameters 中的说明。
+
+@return 0方法调用成功,<0方法调用失败
+ */
+- (int)startScreenCaptureByWindowId:(NSUInteger)windowId
+ rectangle:(CGRect)rectangle
+ parameters:(ARScreenCaptureParameters * _Nonnull)captureParams;
+
+/** 更新屏幕共享的参数配置(仅支持 macOS )
+
+@param captureParams 屏幕共享的编码参数配置。默认的分辨率为 1920 x 1080,即 2073600 像素。该像素值为计费标准。
+
+@return 0方法调用成功,<0方法调用失败
+ */
+- (int)updateScreenCaptureParameters:(ARScreenCaptureParameters * _Nonnull)captureParams;
+
+/** 更新屏幕共享区域 (仅支持 macOS )
+
+ @param rect 待共享区域相对于整个屏幕或窗口的位置。如不填,则表示共享整个屏幕或窗口。由如下参数组成:
+
+ - x:左上角的横向偏移
+ - y:左上角的纵向偏移
+ - width:待共享区域的宽
+ - height:待共享区域的高
+
+ 如果设置的共享区域超出了屏幕或窗口的边界,则只共享屏幕或窗口内的内容;如果宽或高设为 0,则共享整个屏幕或窗口。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)updateScreenCaptureRegion:(CGRect)rect;
+
+/** 停止屏幕共享(仅支持 macOS )
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopScreenCapture;
+
+#endif
+
+#if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
+//MARK: - 音视频设备管理 (macOS)
+
+/**-----------------------------------------------------------------------------
+ * @name 音视频设备管理 (仅支持 macOS)
+ * -----------------------------------------------------------------------------
+ */
+
+/** 监控设备改变 (仅支持 macOS)
+
+ 该方法用来启动设备插拔检测,这里设备指的是音视频外接设备,比如外接摄像头等。开启后,会触发设备状态改变回调。
+
+ @param enabled - YES: 开启监控
+ - NO: 关闭监控
+ */
+- (void)monitorDeviceChange:(BOOL)enabled;
+
+/** 获取系统中所有的音视频设备 (仅支持 macOS)
+
+**Note:**
+
+ 不要在主线程调用该方法。
+
+ 该方法返回一个 NSArray 对象,包含系统中所有的音视频设备。应用程序可以通过 ARtcDeviceInfo array 对象枚举设备。
+
+ @param type 要枚举的设备类型,详见 ARMediaDeviceType
+ @return 调用成功时,返回 ARtcDeviceInfo NSArray 对象,包含所有的音视频设备。
+ */
+- (NSArray<ARtcDeviceInfo *> * _Nullable)enumerateDevices:(ARMediaDeviceType)type;
+
+/** 指定设备 (仅支持 macOS)
+
+ @param type 设备的类型,包括音、视频采集或播放设备,详见 ARMediaDeviceType
+ @param deviceId 设备的 Device ID,可通过 enumerateDevices获取。插拔设备不会影响 deviceId 。
+ @return 0方法调用成功,<0方法调用失败
+ */
+
+- (int)setDevice:(ARMediaDeviceType)type deviceId:(NSString * _Nonnull)deviceId;
+
+/** 获取设备音量 (仅支持 macOS)
+
+ @param type 设备的类型,包括音、视频采集或播放设备,详见 ARMediaDeviceType
+ @return 该方法获取当前设备的音量。
+ */
+- (int)getDeviceVolume:(ARMediaDeviceType)type;
+
+/** 设置设备音量 (仅支持 macOS)
+
+ @param type 设备的类型,包括音、视频采集或播放设备,详见 ARMediaDeviceType
+ @param volume 设置的音量(0 ~ 100)
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setDeviceVolume:(ARMediaDeviceType)type volume:(int)volume;
+
+/** 启动音频采集设备测试 (仅支持 macOS)
+
+ 该方法测试音频采集设备是否能正常工作。
+
+ 调用该方法后,SDK 会按设置的时间间隔触发 reportAudioVolumeIndicationOfSpeakers 回调,报告 uid = "0"及采集设备的音量信息。
+
+ @param indicationInterval SDK 返回 reportAudioVolumeIndicationOfSpeakers 回调的时间间隔,单位为毫秒。建议设置到大于 200 毫秒。 不得少于 10 毫秒,否则会收不到 reportAudioVolumeIndicationOfSpeakers 回调。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)startRecordingDeviceTest:(int)indicationInterval;
+
+/** 停止麦克风测试 (仅支持 macOS)
+
+ 该方法停止麦克风测试。调用 startRecordingDeviceTest 后,必须调用该方法停止测试。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopRecordingDeviceTest;
+
+ /** 启动音频播放设备测试 (仅支持 macOS)
+
+ 该方法测试音频播放设备是否能正常工作。启动测试后,SDK 播放指定的音频文件,测试者如果能听到声音,说明播放设备能正常工作。
+
+ 调用该方法后,SDK 会每隔 100 ms 触发一次 reportAudioVolumeIndicationOfSpeakers 回调,报告 uid = "1" 及播放设备的音量信息。
+
+**Note:** 该方法需要在加入频道前调用。
+
+ @param audioFileName 指定音频文件的绝对路径,路径字符串使用UTF-8编码格式:
+ - 支持的文件格式: wav,mp3,m4a,aac
+ - 支持的文件采样率: 8000,16000,32000,44100,48000
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)startPlaybackDeviceTest:(NSString * _Nonnull)audioFileName;
+
+/** 停止播放设备测试 (仅支持 macOS)
+
+ 该方法停止播放设备测试。调用 startPlaybackDeviceTest 后,必须调用该方法停止测试。
+
+**Note:** 该方法需要在加入频道前调用。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopPlaybackDeviceTest;
+
+/** 启动视频采集设备测试 (仅支持 macOS)
+
+ 用于测试当前视频采集设备是否工作正常,使用前需保证已调用过 enableVideo ,且传入参数的 view 窗口有效。
+
+**Note:** 该方法需要在加入频道前调用。
+
+ @param view 输入参数,用于显示图像的窗口
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)startCaptureDeviceTest:(NSView * _Nonnull)view;
+
+/** 停止视频采集设备测试 (仅支持 macOS)
+
+ 停止视频采集设备测试,如果之前调用了 startCaptureDeviceTest,必须通过该方法停止测试。
+
+**Note:** 该方法需要在加入频道前调用。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)stopCaptureDeviceTest;
+
+/** 开始音频设备回路测试 (仅支持 macOS)
+
+ 该方法测试音频采集和播放设备是否能正常工作。一旦测试开始,音频采集设备会采集本地音频,然后使用音频播放设备播放出来。SDK 会按设置的时间间隔触发 两个 reportAudioVolumeIndicationOfSpeakers 回调,分别报告音频采集设备(uid = 0)和音频播放设备(uid = 1)的音量信息。
+
+**Note:**
+
+ - 该方法仅在本地进行音频设备测试,不涉及网络连接。
+ - 该方法需要在加入频道前调用。
+
+@param indicationInterval SDK 返回 reportAudioVolumeIndicationOfSpeakers 回调的时间间隔,单位为毫秒。建议设置为大于 200 毫秒。 不得少于 10 毫秒,否则会收不到 reportAudioVolumeIndicationOfSpeakers 回调。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+-(int)startAudioDeviceLoopbackTest:(int)indicationInterval;
+
+/** 停止音频设备回路测试 (仅支持 macOS)
+
+ 在调用 startAudioDeviceLoopbackTest 后,必须调用该方法停止音频设备回路测试。
+
+**Note:** 该方法需要在加入频道前调用。
+
+@return 0方法调用成功,<0方法调用失败
+*/
+-(int)stopAudioDeviceLoopbackTest;
+
+#endif
+
+//MARK: - 媒体附属信息
+
+//MARK: - 其它方法
+/**-----------------------------------------------------------------------------
+* @name 其它方法
+* -----------------------------------------------------------------------------
+*/
+
+/** 获取通话 ID
+
+ 客户端在每次 joinChannelByToken 后会生成一个对应的 CallId,标识该客户端的此次通话。有些方法如 rate,complain需要在通话结束后调用,向 SDK 提交反馈,这些方法必须指定 CallId 参数。使用这些反馈方法,需要在通话过程中调用 getCallId 方法获取 CallId,在通话结束后在反馈方法中作为参数传入。
+
+ @return 当前通话 ID
+ */
+- (NSString * _Nullable)getCallId;
+
+/** 分发/不分发回调至主队列
+
+ 如果不分发回调方法到主队列, App 应将 UI 操作分发到主队列。
+
+ @param enabled 设置是否将委托方法分发到主队列:
+
+ * YES: 分发回调方法到主队列
+ * NO: 不分发回调方法到主队列
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)enableMainQueueDispatch:(BOOL)enabled;
+
+/** 查询 SDK 版本号
+
+ @return 当前的 SDK 版本号,格式为字符串,如 4.0.0
+ */
++ (NSString * _Nonnull)getSdkVersion;
+
+/** 获取警告或错误描述。
+
+ @param code didOccurWarning 或 didOccurError 提供的警告码或错误码。
+
+ @return 警告或错误描述
+ */
++ (NSString * _Nullable)getErrorDescription:(NSInteger)code;
+
+/** 设置日志文件路径
+
+设置 SDK 的输出 log 文件。SDK 运行时产生的所有 log 将写入该文件。 App 必须保证指定的目录存在而且可写。
+
+**Note**
+
+ - 日志文件的默认地址如下:
+ - iOS: `App Sandbox/Library/caches/ar_sdk.log`
+ - macOS
+ - 开启沙盒: `App Sandbox/Library/Logs/ar_sdk.log`, 例如 `/Users/<username>/Library/Containers/<App Bundle Identifier>/Data/Library/Logs/ar_sdk.log`.
+ - 关闭沙盒: `~/Library/Logs/ar_sdk.log`.
+ - 如需调用本方法,请在调用 sharedEngineWithAppId 方法初始化 ARtcEngineKit 对象后立即调用,否则可能造成输出日志不完整。
+
+ @param filePath 日志文件的完整路径。该日志文件为 UTF-8 编码。
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setLogFile:(NSString * _Nonnull)filePath;
+
+/** 设置日志文件大小
+
+设置 SDK 输出的日志文件大小,单位为 KB。
+
+SDK 设有 2 个日志文件,每个文件大小为 512 KB。如果你将 fileSizeInKByte 设置为 1024 KB, SDK 会最多输出 2 MB 的日志文件。如果日志文件大小超出设置值,新的日志会覆盖之前的日志。
+
+ @param fileSizeInKBytes 指定 SDK 输出日志文件的内存大小,单位为 KB。
+
+ @return 0方法调用成功,<0方法调用失败,有可能是因为传入的参数无效
+ */
+- (int)setLogFileSize:(NSUInteger)fileSizeInKBytes;
+
+/** 设置日志输出等级
+
+@param filter 日志输出等级
+
+@return 0方法调用成功,<0方法调用失败
+*/
+- (int)setLogFilter:(ARLogFilter)filter;
+
+/** 获取 Native SDK Engine 句柄
+
+该方法获取 native SDK engine 的 C++ handle,用于包括注册音视频帧观测器在内的特殊场景。
+*/
+- (void *_Nullable)getNativeHandle;
+
+/** 设置/获取 ARtcEngineDelegate
+
+ ar云平台 Native SDK 通过指定的 delegate 通知 App 引擎运行时的事件。Delegate 中定义的所有方法都是可选实现的。
+ */
+@property (nonatomic, weak) id<ARtcEngineDelegate> _Nullable delegate;
+
+//MARK: - 定制方法
+/**-----------------------------------------------------------------------------
+* @name 定制方法
+* -----------------------------------------------------------------------------
+*/
+
+/** 通过 JSON 配置 SDK 提供技术预览或特别定制功能
+
+**Note**
+
+ JSON 选项默认不公开。
+
+ @param options JSON 格式的 SDK 选项
+
+ @return 0方法调用成功,<0方法调用失败
+ */
+- (int)setParameters:(NSString * _Nonnull)options;
+
+/** 获取 ar云平台 SDK 可供自定义的参数
+
+**Note**
+
+ 该方法未公开,请联系ar云平台支持 hi@dync.cc 获取详情。
+
+ @param parameter 定制参数
+ @param args 参数
+
+ @return json字符串
+ */
+- (NSString * _Nullable)getParameter:(NSString * _Nonnull)parameter args:(NSString * _Nullable)args;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcKit.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcKit.h
new file mode 100644
index 0000000..055c437
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ARtcKit.h
@@ -0,0 +1,29 @@
+//
+// ARtcKit.h
+// ARtcKit
+//
+// Created by zjq on 2020/3/18.
+// Copyright © 2020 zjq. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+//! Project version number for ARtcKit.
+FOUNDATION_EXPORT double ARtcKitVersionNumber;
+
+//! Project version string for ARtcKit.
+FOUNDATION_EXPORT const unsigned char ARtcKitVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import <ARtcKit/PublicHeader.h>
+
+#import <ARtcKit/ARObjects.h>
+#import <ARtcKit/ARtcEngineDelegate.h>
+#import <ARtcKit/AREnumerates.h>
+#import <ARtcKit/ARtcEngineKit.h>
+#import <ARtcKit/ARtcChannel.h>
+#import <ARtcKit/ARtcChannelDelegate.h>
+#import <ARtcKit/ARMediaPlayerKit.h>
+#import <ARtcKit/ARStreamingKit.h>
+
+
+
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArBase.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArBase.h
new file mode 100644
index 0000000..2c70c27
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArBase.h
@@ -0,0 +1,826 @@
+// AR Engine SDK
+//
+// Copyright (c) 2019 AR.io. All rights reserved.
+//
+
+#ifndef __AR_BASE_H__
+#define __AR_BASE_H__
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined(_WIN32)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#define AR_CALL __cdecl
+#if defined(ARRTC_EXPORT)
+#define AR_API extern "C" __declspec(dllexport)
+#else
+#define AR_API extern "C" __declspec(dllimport)
+#endif
+#elif defined(__APPLE__)
+#include <TargetConditionals.h>
+#define AR_API __attribute__((visibility("default"))) extern "C"
+#define AR_CALL
+#elif defined(__ANDROID__) || defined(__linux__)
+#define AR_API extern "C" __attribute__((visibility("default")))
+#define AR_CALL
+#else
+#define AR_API extern "C"
+#define AR_CPP_API
+#define AR_CALL
+#endif
+
+namespace ar {
+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 {
+protected:
+ virtual ~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
+{
+ AR_IID_AUDIO_DEVICE_MANAGER = 1,
+ AR_IID_VIDEO_DEVICE_MANAGER = 2,
+ AR_IID_RTC_ENGINE_PARAMETER = 3,
+ AR_IID_MEDIA_ENGINE = 4,
+ AR_IID_SIGNALING_ENGINE = 8,
+};
+
+ /** Warning code.
+ */
+enum WARN_CODE_TYPE
+{
+ /** 8: The specified view is invalid. Specify a view when using the video call function.
+ */
+ WARN_INVALID_VIEW = 8,
+ /** 16: Failed to initialize the video function, possibly caused by a lack of resources. The users cannot see the video while the voice communication is not affected.
+ */
+ WARN_INIT_VIDEO = 16,
+ /** 20: The request is pending, usually due to some module not being ready, and the SDK postponed processing the request.
+ */
+ WARN_PENDING = 20,
+ /** 103: No channel resources are available. Maybe because the server cannot allocate any channel resource.
+ */
+ WARN_NO_AVAILABLE_CHANNEL = 103,
+ /** 104: A timeout occurs when looking up the channel. When joining a channel, the SDK looks up the specified channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server.
+ */
+ WARN_LOOKUP_CHANNEL_TIMEOUT = 104,
+ /** **DEPRECATED** 105: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal.
+
+ Deprecated as of v2.4.1. Use CONNECTION_CHANGED_REJECTED_BY_SERVER(10) in the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead.
+ */
+ WARN_LOOKUP_CHANNEL_REJECTED = 105,
+ /** 106: A timeout occurs when opening the channel. Once the specific channel is found, the SDK opens the channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server.
+ */
+ WARN_OPEN_CHANNEL_TIMEOUT = 106,
+ /** 107: The server rejects the request to open the channel. The server cannot process this request or the request is illegal.
+ */
+ WARN_OPEN_CHANNEL_REJECTED = 107,
+
+ // sdk: 100~1000
+ /** 111: A timeout occurs when switching to the live video.
+ */
+ WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111,
+ /** 118: A timeout occurs when setting the client role in the live interactive streaming profile.
+ */
+ WARN_SET_CLIENT_ROLE_TIMEOUT = 118,
+ /** 121: The ticket to open the channel is invalid.
+ */
+ WARN_OPEN_CHANNEL_INVALID_TICKET = 121,
+ /** 122: Try connecting to another server.
+ */
+ WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122,
+ /** 131: The channel connection cannot be recovered.
+ */
+ WARN_CHANNEL_CONNECTION_UNRECOVERABLE = 131,
+ /** 132: The IP address has changed.
+ */
+ WARN_CHANNEL_CONNECTION_IP_CHANGED = 132,
+ /** 133: The port has changed.
+ */
+ WARN_CHANNEL_CONNECTION_PORT_CHANGED = 133,
+ /** 134: The socket error occurs, try to rejoin channel.
+ */
+ WARN_CHANNEL_SOCKET_ERROR = 134,
+ /** 701: An error occurs in opening the audio mixing file.
+ */
+ WARN_AUDIO_MIXING_OPEN_ERROR = 701,
+ /** 1014: Audio Device Module: A warning occurs in the playback device.
+ */
+ WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014,
+ /** 1016: Audio Device Module: a warning occurs in the recording device.
+ */
+ WARN_ADM_RUNTIME_RECORDING_WARNING = 1016,
+ /** 1019: Audio Device Module: no valid audio data is recorded.
+ */
+ WARN_ADM_RECORD_AUDIO_SILENCE = 1019,
+ /** 1020: Audio device module: The audio playback frequency is abnormal, which may cause audio freezes. This abnormality is caused by high CPU usage. AR recommends stopping other apps.
+ */
+ WARN_ADM_PLAYOUT_MALFUNCTION = 1020,
+ /** 1021: Audio device module: the audio recording frequency is abnormal, which may cause audio freezes. This abnormality is caused by high CPU usage. AR recommends stopping other apps.
+ */
+ WARN_ADM_RECORD_MALFUNCTION = 1021,
+ /** 1025: The audio playback or recording is interrupted by system events (such as a phone call).
+ */
+ WARN_ADM_CALL_INTERRUPTION = 1025,
+ /** 1029: During a call, the audio session category should be set to
+ * AVAudioSessionCategoryPlayAndRecord, and RtcEngine monitors this value.
+ * If the audio session category is set to other values, this warning code
+ * is triggered and RtcEngine will forcefully set it back to
+ * AVAudioSessionCategoryPlayAndRecord.
+ */
+ WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD = 1029,
+ /** 1031: Audio Device Module: The recorded audio voice is too low.
+ */
+ WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031,
+ /** 1032: Audio Device Module: the playback audio voice is too low.
+ */
+ WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032,
+ /** 1033: Audio device module: The audio recording device is occupied.
+ */
+ WARN_ADM_RECORD_AUDIO_IS_ACTIVE = 1033,
+ /** 1040: Audio device module: An exception occurs with the audio drive.
+ * Solutions:
+ * - Disable or re-enable the audio device.
+ * - Re-enable your device.
+ * - Update the sound card drive.
+ */
+ WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040,
+ /** 1042: Audio device module: The audio recording device is different from the audio playback device,
+ * which may cause echoes problem. AR recommends using the same audio device to record and playback
+ * audio.
+ */
+ WARN_ADM_INCONSISTENT_AUDIO_DEVICE = 1042,
+ /** 1051: (Communication profile only) Audio processing module: A howling sound is detected when recording the audio data.
+ */
+ WARN_APM_HOWLING = 1051,
+ /** 1052: Audio Device Module: The device is in the glitch state.
+ */
+ WARN_ADM_GLITCH_STATE = 1052,
+ /** 1053: Audio Processing Module: A residual echo is detected, which may be caused by the belated scheduling of system threads or the signal overflow.
+ */
+ WARN_APM_RESIDUAL_ECHO = 1053,
+ /// @cond
+ WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
+ /// @endcond
+ /** 1323: Audio device module: No available playback device.
+ * Solution: Plug in the audio device.
+ */
+ WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
+ /** Audio device module: The capture device is released improperly.
+ * Solutions:
+ * - Disable or re-enable the audio device.
+ * - Re-enable your device.
+ * - Update the sound card drive.
+ */
+ WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324,
+ /** 1610: The origin resolution of the remote video is beyond the range where the super-resolution algorithm can be applied.
+ */
+ WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION = 1610,
+ /** 1611: Another user is already using the super-resolution algorithm.
+ */
+ WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION = 1611,
+ /** 1612: The device does not support the super-resolution algorithm.
+ */
+ WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED = 1612,
+ /// @cond
+ WARN_RTM_LOGIN_TIMEOUT = 2005,
+ WARN_RTM_KEEP_ALIVE_TIMEOUT = 2009
+ /// @endcond
+};
+
+/** Error code.
+*/
+enum ERROR_CODE_TYPE
+{
+ /** 0: No error occurs.
+ */
+ ERR_OK = 0,
+ //1~1000
+ /** 1: A general error occurs (no specified reason).
+ */
+ ERR_FAILED = 1,
+ /** 2: An invalid parameter is used. For example, the specific channel name includes illegal characters.
+ */
+ ERR_INVALID_ARGUMENT = 2,
+ /** 3: The SDK module is not ready. Possible solutions:
+
+ - Check the audio device.
+ - Check the completeness of the application.
+ - Re-initialize the RTC engine.
+ */
+ ERR_NOT_READY = 3,
+ /** 4: The SDK does not support this function.
+ */
+ ERR_NOT_SUPPORTED = 4,
+ /** 5: The request is rejected.
+ */
+ ERR_REFUSED = 5,
+ /** 6: The buffer size is not big enough to store the returned data.
+ */
+ ERR_BUFFER_TOO_SMALL = 6,
+ /** 7: The SDK is not initialized before calling this method.
+ */
+ ERR_NOT_INITIALIZED = 7,
+ /** 9: No permission exists. Check if the user has granted access to the audio or video device.
+ */
+ ERR_NO_PERMISSION = 9,
+ /** 10: An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (more than 10 seconds) for the SDK to process.
+ */
+ ERR_TIMEDOUT = 10,
+ /** 11: The request is canceled. This is for internal SDK use only, and it does not return to the application through any method or callback.
+ */
+ ERR_CANCELED = 11,
+ /** 12: The method is called too often. This is for internal SDK use only, and it does not return to the application through any method or callback.
+ */
+ ERR_TOO_OFTEN = 12,
+ /** 13: The SDK fails to bind to the network socket. This is for internal SDK use only, and it does not return to the application through any method or callback.
+ */
+ ERR_BIND_SOCKET = 13,
+ /** 14: The network is unavailable. This is for internal SDK use only, and it does not return to the application through any method or callback.
+ */
+ ERR_NET_DOWN = 14,
+ /** 15: No network buffers are available. This is for internal SDK internal use only, and it does not return to the application through any method or callback.
+ */
+ ERR_NET_NOBUFS = 15,
+ /** 17: The request to join the channel is rejected.
+ *
+ * - This error usually occurs when the user is already in the channel, and still calls the method to join the channel, for example, \ref ar::rtc::IRtcEngine::joinChannel "joinChannel".
+ * - This error usually occurs when the user tries to join a channel during a call test (\ref ar::rtc::IRtcEngine::startEchoTest "startEchoTest"). Once you call \ref ar::rtc::IRtcEngine::startEchoTest "startEchoTest", you need to call \ref ar::rtc::IRtcEngine::stopEchoTest "stopEchoTest" before joining a channel.
+ */
+ ERR_JOIN_CHANNEL_REJECTED = 17,
+ /** 18: The request to leave the channel is rejected.
+
+ This error usually occurs:
+
+ - When the user has left the channel and still calls \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, stop calling \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel".
+ - When the user has not joined the channel and still calls \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" to leave the channel. In this case, no extra operation is needed.
+ */
+ ERR_LEAVE_CHANNEL_REJECTED = 18,
+ /** 19: Resources are occupied and cannot be reused.
+ */
+ ERR_ALREADY_IN_USE = 19,
+ /** 20: The SDK gives up the request due to too many requests.
+ */
+ ERR_ABORTED = 20,
+ /** 21: In Windows, specific firewall settings can cause the SDK to fail to initialize and crash.
+ */
+ ERR_INIT_NET_ENGINE = 21,
+ /** 22: The application uses too much of the system resources and the SDK fails to allocate the resources.
+ */
+ ERR_RESOURCE_LIMITED = 22,
+ /** 101: The specified App ID is invalid. Please try to rejoin the channel with a valid App ID.
+ */
+ ERR_INVALID_APP_ID = 101,
+ /** 102: The specified channel name is invalid. Please try to rejoin the channel with a valid channel name.
+ */
+ ERR_INVALID_CHANNEL_NAME = 102,
+ /** 103: Fails to get server resources in the specified region. Please try to specify another region when calling \ref ar::rtc::IRtcEngine::initialize "initialize".
+ */
+ ERR_NO_SERVER_RESOURCES = 103,
+ /** **DEPRECATED** 109: Deprecated as of v2.4.1. Use CONNECTION_CHANGED_TOKEN_EXPIRED(9) in the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead.
+
+ The token expired due to one of the following reasons:
+
+ - Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the Token to access the AR service within five minutes after the Token is generated. If the user does not access the AR service after five minutes, this Token is no longer valid.
+ - Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the AR service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel.
+ */
+ ERR_TOKEN_EXPIRED = 109,
+ /** **DEPRECATED** 110: Deprecated as of v2.4.1. Use CONNECTION_CHANGED_INVALID_TOKEN(8) in the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead.
+
+ The token is invalid due to one of the following reasons:
+
+ - The App Certificate for the project is enabled in Console, but the user is still using the App ID. Once the App Certificate is enabled, the user must use a token.
+ - The uid is mandatory, and users must set the same uid as the one set in the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method.
+ */
+ ERR_INVALID_TOKEN = 110,
+ /** 111: The internet connection is interrupted. This applies to the AR Web SDK only.
+ */
+ ERR_CONNECTION_INTERRUPTED = 111, // only used in web sdk
+ /** 112: The internet connection is lost. This applies to the AR Web SDK only.
+ */
+ ERR_CONNECTION_LOST = 112, // only used in web sdk
+ /** 113: The user is not in the channel when calling the \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" or \ref ar::rtc::IRtcEngine::getUserInfoByUserAccount "getUserInfoByUserAccount" method.
+ */
+ ERR_NOT_IN_CHANNEL = 113,
+ /** 114: The size of the sent data is over 1024 bytes when the user calls the \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method.
+ */
+ ERR_SIZE_TOO_LARGE = 114,
+ /** 115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method.
+ */
+ ERR_BITRATE_LIMIT = 115,
+ /** 116: Too many data streams (over 5 streams) are created when the user calls the \ref ar::rtc::IRtcEngine::createDataStream "createDataStream" method.
+ */
+ ERR_TOO_MANY_DATA_STREAMS = 116,
+ /** 117: The data stream transmission timed out.
+ */
+ ERR_STREAM_MESSAGE_TIMEOUT = 117,
+ /** 119: Switching roles fail. Please try to rejoin the channel.
+ */
+ ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119,
+ /** 120: Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel.
+ */
+ ERR_DECRYPTION_FAILED = 120,
+ /** 123: The client is banned by the server.
+ */
+ ERR_CLIENT_IS_BANNED_BY_SERVER = 123,
+ /** 124: Incorrect watermark file parameter.
+ */
+ ERR_WATERMARK_PARAM = 124,
+ /** 125: Incorrect watermark file path.
+ */
+ ERR_WATERMARK_PATH = 125,
+ /** 126: Incorrect watermark file format.
+ */
+ ERR_WATERMARK_PNG = 126,
+ /** 127: Incorrect watermark file information.
+ */
+ ERR_WATERMARKR_INFO = 127,
+ /** 128: Incorrect watermark file data format.
+ */
+ ERR_WATERMARK_ARGB = 128,
+ /** 129: An error occurs in reading the watermark file.
+ */
+ ERR_WATERMARK_READ = 129,
+ /** 130: Encryption is enabled when the user calls the \ref ar::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method (CDN live streaming does not support encrypted streams).
+ */
+ ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130,
+ /** 134: The user account is invalid. */
+ ERR_INVALID_USER_ACCOUNT = 134,
+
+ /** 151: CDN related errors. Remove the original URL address and add a new one by calling the \ref ar::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref ar::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods.
+ */
+ ERR_PUBLISH_STREAM_CDN_ERROR = 151,
+ /** 152: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones.
+ */
+ ERR_PUBLISH_STREAM_NUM_REACH_LIMIT = 152,
+ /** 153: The host manipulates other hosts' URLs. Check your app logic.
+ */
+ ERR_PUBLISH_STREAM_NOT_AUTHORIZED = 153,
+ /** 154: An error occurs in AR's streaming server. Call the addPublishStreamUrl method to publish the streaming again.
+ */
+ ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR = 154,
+ /** 155: The server fails to find the stream.
+ */
+ ERR_PUBLISH_STREAM_NOT_FOUND = 155,
+ /** 156: The format of the RTMP stream URL is not supported. Check whether the URL format is correct.
+ */
+ ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED = 156,
+
+ //signaling: 400~600
+ /**
+ */
+ ERR_LOGOUT_OTHER = 400, //
+ /** 401: The user logged out.
+ */
+ ERR_LOGOUT_USER = 401, // logout by user
+ /** 402: Network failure.
+ */
+ ERR_LOGOUT_NET = 402, // network failure
+ /** 403: Logged in another device.
+ */
+ ERR_LOGOUT_KICKED = 403, // login in other device
+ /**
+ */
+ ERR_LOGOUT_PACKET = 404, //
+ /** 405: The token expired.
+ */
+ 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
+ /** 1001: Fails to load the media engine.
+ */
+ ERR_LOAD_MEDIA_ENGINE = 1001,
+ /** 1002: Fails to start the call after enabling the media engine.
+ */
+ ERR_START_CALL = 1002,
+ /** **DEPRECATED** 1003: Fails to start the camera.
+
+ Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE(4) in the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead.
+ */
+ ERR_START_CAMERA = 1003,
+ /** 1004: Fails to start the video rendering module.
+ */
+ ERR_START_VIDEO_RENDER = 1004,
+ /** 1005: A general error occurs in the Audio Device Module (no specified reason). Check if the audio device is used by another application, or try rejoining the channel.
+ */
+ ERR_ADM_GENERAL_ERROR = 1005,
+ /** 1006: Audio Device Module: An error occurs in using the Java resources.
+ */
+ ERR_ADM_JAVA_RESOURCE = 1006,
+ /** 1007: Audio Device Module: An error occurs in setting the sampling frequency.
+ */
+ ERR_ADM_SAMPLE_RATE = 1007,
+ /** 1008: Audio Device Module: An error occurs in initializing the playback device.
+ */
+ ERR_ADM_INIT_PLAYOUT = 1008,
+ /** 1009: Audio Device Module: An error occurs in starting the playback device.
+ */
+ ERR_ADM_START_PLAYOUT = 1009,
+ /** 1010: Audio Device Module: An error occurs in stopping the playback device.
+ */
+ ERR_ADM_STOP_PLAYOUT = 1010,
+ /** 1011: Audio Device Module: An error occurs in initializing the recording device.
+ */
+ ERR_ADM_INIT_RECORDING = 1011,
+ /** 1012: Audio Device Module: An error occurs in starting the recording device.
+ */
+ ERR_ADM_START_RECORDING = 1012,
+ /** 1013: Audio Device Module: An error occurs in stopping the recording device.
+ */
+ ERR_ADM_STOP_RECORDING = 1013,
+ /** 1015: Audio Device Module: A playback error occurs. Check your playback device and try rejoining the channel.
+ */
+ ERR_ADM_RUNTIME_PLAYOUT_ERROR = 1015,
+ /** 1017: Audio Device Module: A recording error occurs.
+ */
+ ERR_ADM_RUNTIME_RECORDING_ERROR = 1017,
+ /** 1018: Audio Device Module: Fails to record.
+ */
+ ERR_ADM_RECORD_AUDIO_FAILED = 1018,
+ /** 1022: Audio Device Module: An error occurs in initializing the
+ * loopback device.
+ */
+ ERR_ADM_INIT_LOOPBACK = 1022,
+ /** 1023: Audio Device Module: An error occurs in starting the loopback
+ * device.
+ */
+ ERR_ADM_START_LOOPBACK = 1023,
+ /** 1027: Audio Device Module: No recording permission exists. Check if the
+ * recording permission is granted.
+ */
+ ERR_ADM_NO_PERMISSION = 1027,
+ /** 1033: Audio device module: The device is occupied.
+ */
+ ERR_ADM_RECORD_AUDIO_IS_ACTIVE = 1033,
+ /** 1101: Audio device module: A fatal exception occurs.
+ */
+ ERR_ADM_ANDROID_JNI_JAVA_RESOURCE = 1101,
+ /** 1108: Audio device module: The recording frequency is lower than 50.
+ * 0 indicates that the recording is not yet started. We recommend
+ * checking your recording permission.
+ */
+ ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY = 1108,
+ /** 1109: The playback frequency is lower than 50. 0 indicates that the
+ * playback is not yet started. We recommend checking if you have created
+ * too many AudioTrack instances.
+ */
+ ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY = 1109,
+ /** 1111: Audio device module: AudioRecord fails to start up. A ROM system
+ * error occurs. We recommend the following options to debug:
+ * - Restart your App.
+ * - Restart your cellphone.
+ * - Check your recording permission.
+ */
+ ERR_ADM_ANDROID_JNI_JAVA_START_RECORD = 1111,
+ /** 1112: Audio device module: AudioTrack fails to start up. A ROM system
+ * error occurs. We recommend the following options to debug:
+ * - Restart your App.
+ * - Restart your cellphone.
+ * - Check your playback permission.
+ */
+ ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK = 1112,
+ /** 1115: Audio device module: AudioRecord returns error. The SDK will
+ * automatically restart AudioRecord. */
+ ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR = 1115,
+ /** **DEPRECATED** */
+ ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE = 1151,
+ /** **DEPRECATED** */
+ ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER = 1153,
+ /** **DEPRECATED** */
+ ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD = 1156,
+ /** **DEPRECATED** */
+ ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER = 1157,
+ /** **DEPRECATED** */
+ ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD = 1160,
+ /** 1201: Audio device module: The current device does not support audio
+ * input, possibly because you have mistakenly configured the audio session
+ * category, or because some other app is occupying the input device. We
+ * recommend terminating all background apps and re-joining the channel. */
+ ERR_ADM_IOS_INPUT_NOT_AVAILABLE = 1201,
+ /** 1206: Audio device module: Cannot activate the Audio Session.*/
+ ERR_ADM_IOS_ACTIVATE_SESSION_FAIL = 1206,
+ /** 1210: Audio device module: Fails to initialize the audio device,
+ * normally because the audio device parameters are wrongly set.*/
+ ERR_ADM_IOS_VPIO_INIT_FAIL = 1210,
+ /** 1213: Audio device module: Fails to re-initialize the audio device,
+ * normally because the audio device parameters are wrongly set.*/
+ ERR_ADM_IOS_VPIO_REINIT_FAIL = 1213,
+ /** 1214: Fails to re-start up the Audio Unit, possibly because the audio
+ * session category is not compatible with the settings of the Audio Unit.
+ */
+ ERR_ADM_IOS_VPIO_RESTART_FAIL = 1214,
+ ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL = 1219,
+ /** **DEPRECATED** */
+ ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO = 1221,
+ /** 1301: Audio device module: An audio driver abnomality or a
+ * compatibility issue occurs. Solutions: Disable and restart the audio
+ * device, or reboot the system.*/
+ ERR_ADM_WIN_CORE_INIT = 1301,
+ /** 1303: Audio device module: A recording driver abnomality or a
+ * compatibility issue occurs. Solutions: Disable and restart the audio
+ * device, or reboot the system. */
+ ERR_ADM_WIN_CORE_INIT_RECORDING = 1303,
+ /** 1306: Audio device module: A playout driver abnomality or a
+ * compatibility issue occurs. Solutions: Disable and restart the audio
+ * device, or reboot the system. */
+ ERR_ADM_WIN_CORE_INIT_PLAYOUT = 1306,
+ /** 1307: Audio device module: No audio device is available. Solutions:
+ * Plug in a proper audio device. */
+ ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL = 1307,
+ /** 1309: Audio device module: An audio driver abnomality or a
+ * compatibility issue occurs. Solutions: Disable and restart the audio
+ * device, or reboot the system. */
+ ERR_ADM_WIN_CORE_START_RECORDING = 1309,
+ /** 1311: Audio device module: Insufficient system memory or poor device
+ * performance. Solutions: Reboot the system or replace the device.
+ */
+ ERR_ADM_WIN_CORE_CREATE_REC_THREAD = 1311,
+ /** 1314: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver.*/
+ ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP = 1314,
+ /** 1319: Audio device module: Insufficient system memory or poor device
+ * performance. Solutions: Reboot the system or replace the device. */
+ ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD = 1319,
+ /** 1320: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Replace the device. */
+ ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP = 1320,
+ /** 1322: Audio device module: No audio sampling device is available.
+ * Solutions: Plug in a proper recording device. */
+ ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
+ /** 1323: Audio device module: No audio playout device is available.
+ * Solutions: Plug in a proper playback device.*/
+ ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323,
+ /** 1351: Audio device module: An audio driver abnormality or a
+ * compatibility issue occurs. Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver. */
+ ERR_ADM_WIN_WAVE_INIT = 1351,
+ /** 1353: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver. */
+ ERR_ADM_WIN_WAVE_INIT_RECORDING = 1353,
+ /** 1354: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver. */
+ ERR_ADM_WIN_WAVE_INIT_MICROPHONE = 1354,
+ /** 1355: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver. */
+ ERR_ADM_WIN_WAVE_INIT_PLAYOUT = 1355,
+ /** 1356: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver. */
+ ERR_ADM_WIN_WAVE_INIT_SPEAKER = 1356,
+ /** 1357: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver. */
+ ERR_ADM_WIN_WAVE_START_RECORDING = 1357,
+ /** 1358: Audio device module: An audio driver abnormality occurs.
+ * Solutions:
+ * - Disable and then re-enable the audio device.
+ * - Reboot the system.
+ * - Upgrade your audio card driver.*/
+ ERR_ADM_WIN_WAVE_START_PLAYOUT = 1358,
+ /** 1359: Audio Device Module: No recording device exists.
+ */
+ ERR_ADM_NO_RECORDING_DEVICE = 1359,
+ /** 1360: Audio Device Module: No playback device exists.
+ */
+ ERR_ADM_NO_PLAYOUT_DEVICE = 1360,
+
+ // VDM error code starts from 1500
+ /** 1501: Video Device Module: The camera is unauthorized.
+ */
+ ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501,
+
+ // VDM error code starts from 1500
+ /** **DEPRECATED** 1502: Video Device Module: The camera in use.
+
+ Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY(3) in the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback instead.
+ */
+ ERR_VDM_WIN_DEVICE_IN_USE = 1502,
+
+ // VCM error code starts from 1600
+ /** 1600: Video Device Module: An unknown error occurs.
+ */
+ ERR_VCM_UNKNOWN_ERROR = 1600,
+ /** 1601: Video Device Module: An error occurs in initializing the video encoder.
+ */
+ ERR_VCM_ENCODER_INIT_ERROR = 1601,
+ /** 1602: Video Device Module: An error occurs in encoding.
+ */
+ ERR_VCM_ENCODER_ENCODE_ERROR = 1602,
+ /** 1603: Video Device Module: An error occurs in setting the video encoder.
+ */
+ ERR_VCM_ENCODER_SET_ERROR = 1603,
+};
+
+ /** Output log filter level. */
+enum LOG_FILTER_TYPE
+{
+/** 0: Do not output any log information. */
+ LOG_FILTER_OFF = 0,
+ /** 0x080f: Output all log information.
+ Set your log filter as debug if you want to get the most complete log file. */
+ LOG_FILTER_DEBUG = 0x080f,
+ /** 0x000f: Output CRITICAL, ERROR, WARNING, and INFO level log information.
+ We recommend setting your log filter as this level.
+ */
+ LOG_FILTER_INFO = 0x000f,
+ /** 0x000e: Outputs CRITICAL, ERROR, and WARNING level log information.
+ */
+ LOG_FILTER_WARN = 0x000e,
+ /** 0x000c: Outputs CRITICAL and ERROR level log information. */
+ LOG_FILTER_ERROR = 0x000c,
+ /** 0x0008: Outputs CRITICAL level log information. */
+ LOG_FILTER_CRITICAL = 0x0008,
+ LOG_FILTER_MASK = 0x80f,
+};
+/** The output log level of the SDK.
+ *
+ * @since v3.3.0
+ */
+enum class LOG_LEVEL {
+ /** 0: Do not output any log. */
+ LOG_LEVEL_NONE = 0x0000,
+ /** 0x0001: (Default) Output logs of the FATAL, ERROR, WARN and INFO level. We recommend setting your log filter as this level.
+ */
+ LOG_LEVEL_INFO = 0x0001,
+ /** 0x0002: Output logs of the FATAL, ERROR and WARN level.
+ */
+ LOG_LEVEL_WARN = 0x0002,
+ /** 0x0004: Output logs of the FATAL and ERROR level. */
+ LOG_LEVEL_ERROR = 0x0004,
+ /** 0x0008: Output logs of the FATAL level. */
+ LOG_LEVEL_FATAL = 0x0008,
+};
+} // namespace ar
+
+#endif
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArMediaBase.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArMediaBase.h
new file mode 100644
index 0000000..1dd51d7
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/ArMediaBase.h
@@ -0,0 +1,400 @@
+//
+// anyrtc Engine SDK
+//
+// Created by Sting Feng in 2017-11.
+// Copyright (c) 2017 anyrtc.io. All rights reserved.
+
+#ifndef __AR_MEDIA_BASE_H__ // NOLINT(build/header_guard)
+#define __AR_MEDIA_BASE_H__
+
+#include <stdint.h>
+#include <stddef.h>
+
+namespace ar {
+namespace media {
+namespace base {
+
+typedef void* view_t;
+
+typedef const char* user_id_t;
+
+
+/** The video pixel format.
+ */
+enum VIDEO_PIXEL_FORMAT {
+ /** 0: The video pixel format is unknown.
+ */
+ VIDEO_PIXEL_UNKNOWN = 0,
+ /** 1: The video pixel format is I420.
+ */
+ VIDEO_PIXEL_I420 = 1,
+ /** 2: The video pixel format is BGRA.
+ */
+ VIDEO_PIXEL_BGRA = 2,
+ /** 3: Planar YUV 4:2:2 format.
+ */
+ VIDEO_PIXEL_I422 = 3,
+ /** 2: The video pixel format is RGBA.
+ */
+ VIDEO_PIXEL_RGBA = 4,
+ /** 8: The video pixel format is NV12.
+ */
+ VIDEO_PIXEL_NV12 = 8,
+};
+
+/**
+ * The video display mode.
+ */
+enum RENDER_MODE_TYPE {
+ /**
+ * 1: Uniformly scale the video until it fills the visible boundaries
+ * (cropped). One dimension of the video may have clipped contents.
+ */
+ RENDER_MODE_HIDDEN = 1,
+ /**
+ * 2: Uniformly scale the video until one of its dimension fits the boundary
+ * (zoomed to fit). Areas that are not filled due to the disparity in the
+ * aspect ratio will be filled with black.
+ */
+ RENDER_MODE_FIT = 2,
+ /**
+ * @deprecated
+ * 3: This mode is deprecated.
+ */
+ RENDER_MODE_ADAPTIVE = 3,
+};
+
+/** Definition of VideoFrame.
+
+The video data format is in YUV420. The buffer provides a pointer to a pointer. However, the
+interface cannot modify the pointer of the buffer, but can only modify the content of the buffer.
+
+*/
+struct VideoFrame {
+ VIDEO_PIXEL_FORMAT type;
+ /** Video pixel width.
+ */
+ int width; // width of video frame
+ /** Video pixel height.
+ */
+ int height; // height of video frame
+ /** Line span of Y buffer in YUV data.
+ */
+ int yStride; // stride of Y data buffer
+ /** Line span of U buffer in YUV data.
+ */
+ int uStride; // stride of U data buffer
+ /** Line span of V buffer in YUV data.
+ */
+ int vStride; // stride of V data buffer
+ /** Pointer to the Y buffer pointer in the YUV data.
+ */
+ uint8_t* yBuffer; // Y data buffer
+ /** Pointer to the U buffer pointer in the YUV data.
+ */
+ uint8_t* uBuffer; // U data buffer
+ /** Pointer to the V buffer pointer in the YUV data
+ */
+ uint8_t* vBuffer; // V data buffer
+ /** Set the rotation of this frame before rendering the video, and it supports 0, 90, 180, 270
+ * degrees clockwise.
+ */
+ int rotation; // rotation of this frame (0, 90, 180, 270)
+ /** Timestamp to render the video stream. It instructs the users to use this timestamp to
+ synchronize the video stream render while rendering the video streams.
+
+ Note: This timestamp is for rendering the video stream, not for capturing the video stream.
+ */
+ int64_t renderTimeMs;
+ int avsync_type;
+};
+
+/**
+ * The struct of AudioPcmFrame.
+ */
+struct AudioPcmFrame {
+ /**
+ * The buffer size of the PCM audio frame.
+ */
+ enum : size_t {
+ // Stereo, 32 kHz, 60 ms (2 * 32 * 60)
+ kMaxDataSizeSamples = 3840,
+ kMaxDataSizeBytes = kMaxDataSizeSamples * sizeof(int16_t),
+ };
+
+ AudioPcmFrame() {}
+
+ uint32_t capture_timestamp = 0;
+ size_t samples_per_channel_ = 0;
+ int sample_rate_hz_ = 0;
+ size_t num_channels_ = 0;
+ size_t bytes_per_sample = 0;
+ int16_t data_[kMaxDataSizeSamples] = {0};
+
+ AudioPcmFrame(const AudioPcmFrame& frame) = delete;
+ void operator=(const AudioPcmFrame& frame) = delete;
+};
+
+class IVideoFrameObserver {
+ public:
+ virtual void onFrame(const VideoFrame* frame) = 0;
+ virtual ~IVideoFrameObserver() {}
+};
+
+class IAudioFrameObserver {
+ public:
+ virtual void onFrame(const AudioPcmFrame* frame) = 0;
+ virtual ~IAudioFrameObserver() {}
+};
+
+} // namespace base
+} // namespace media
+} // namespace ar
+
+namespace ar {
+namespace media {
+
+/**
+ * @brief Player state
+ *
+ */
+enum MEDIA_PLAYER_STATE {
+ /** Default state
+ */
+ PLAYER_STATE_IDLE = 0,
+ /** Opening media file
+ */
+ PLAYER_STATE_OPENING = 1,
+ /** Media file opened successfully
+ *
+ */
+ PLAYER_STATE_OPEN_COMPLETED = 2,
+ /** Player playing
+ */
+ PLAYER_STATE_PLAYING = 3,
+ /** Player paused
+ */
+ PLAYER_STATE_PAUSED = 4,
+ /** Player playback complete
+ */
+ PLAYER_STATE_PLAYBACK_COMPLETED = 5,
+ /** Player stopped
+ */
+ PLAYER_STATE_STOPPED = 6,
+ /** Player failed
+ */
+ PLAYER_STATE_FAILED = 100,
+};
+
+/**
+ * @brief Player error code
+ *
+ */
+enum MEDIA_PLAYER_ERROR {
+ /** No error
+ */
+ PLAYER_ERROR_NONE = 0,
+ /** The parameter is incorrect
+ */
+ PLAYER_ERROR_INVALID_ARGUMENTS = -1,
+ /** Internel error
+ */
+ PLAYER_ERROR_INTERNAL = -2,
+ /** No resource error
+ */
+ PLAYER_ERROR_NO_RESOURCE = -3,
+ /** Media source is invalid
+ */
+ PLAYER_ERROR_INVALID_MEDIA_SOURCE = -4,
+ /** Unknown stream type
+ */
+ PLAYER_ERROR_UNKNOWN_STREAM_TYPE = -5,
+ /** Object is not initialized
+ */
+ PLAYER_ERROR_OBJ_NOT_INITIALIZED = -6,
+ /** Decoder codec not supported
+ */
+ PLAYER_ERROR_CODEC_NOT_SUPPORTED = -7,
+ /** Video renderer is invalid
+ */
+ PLAYER_ERROR_VIDEO_RENDER_FAILED = -8,
+ /** Internal state error
+ */
+ PLAYER_ERROR_INVALID_STATE = -9,
+ /** Url not found
+ */
+ PLAYER_ERROR_URL_NOT_FOUND = -10,
+ /** Invalid connection state
+ */
+ PLAYER_ERROR_INVALID_CONNECTION_STATE = -11,
+ /** Insufficient buffer data
+ */
+ PLAY_ERROR_SRC_BUFFER_UNDERFLOW = -12,
+};
+
+/**
+ * @brief Media stream type
+ *
+ */
+enum MEDIA_STREAM_TYPE {
+ /** Unknown stream type
+ */
+ STREAM_TYPE_UNKNOWN = 0,
+ /** Video stream
+ */
+ STREAM_TYPE_VIDEO = 1,
+ /** Audio stream
+ */
+ STREAM_TYPE_AUDIO = 2,
+ /** Subtitle stream
+ */
+ STREAM_TYPE_SUBTITLE = 3,
+};
+
+/**
+ * @brief Playback speed type
+ *
+ */
+enum MEDIA_PLAYER_PLAY_SPEED {
+ /** origin playback speed
+ */
+ ORIGIN_PLAYBACK_SPEED = 100,
+ /** playback speed slow down to 0.75
+ */
+ PLAYBACK_SPEED_75_PERCENT = 75,
+ /** playback speed slow down to 0.5
+ */
+ PLAYBACK_SPEED_50_PERCENT = 50,
+ /** playback speed speed up to 1.25
+ */
+ PLAYBACK_SPEED_125_PERCENT = 125,
+ /** playback speed speed up to 1.5
+ */
+ PLAYBACK_SPEED_150_PERCENT = 150,
+ /** playback speed speed up to 2.0
+ */
+ PLAYBACK_SPEED_200_PERCENT = 200,
+};
+
+/**
+ * @brief Player event
+ *
+ */
+enum MEDIA_PLAYER_EVENT {
+ /** seek complete
+ */
+ PLAYER_EVENT_SEEK_BEGIN = 0,
+ /** seek complete
+ */
+ PLAYER_EVENT_SEEK_COMPLETE = 1,
+ /** seek failed
+ */
+ PLAYER_EVENT_SEEK_ERROR = 2,
+ /** player video published
+ */
+ PLAYER_EVENT_VIDEO_PUBLISHED = 3,
+ /** player audio published
+ */
+ PLAYER_EVENT_AUDIO_PUBLISHED = 4,
+ /** player audio track changed
+ */
+ PLAYER_EVENT_AUDIO_TRACK_CHANGED = 5,
+};
+
+/**
+ * @brief Media stream object
+ *
+ */
+static const uint8_t kMaxCodecNameLength = 50;
+struct MediaStreamInfo { /* the index of the stream in the media file */
+ int streamIndex;
+
+ /* stream type */
+ MEDIA_STREAM_TYPE streamType;
+
+ /* stream encoding name */
+ char codecName[kMaxCodecNameLength];
+
+ /* streaming language */
+ char language[kMaxCodecNameLength];
+
+ /* If it is a video stream, video frames rate */
+ int videoFrameRate;
+
+ /* If it is a video stream, video bit rate */
+ int videoBitRate;
+
+ /* If it is a video stream, video width */
+ int videoWidth;
+
+ /* If it is a video stream, video height */
+ int videoHeight;
+
+ /* If it is a video stream, video rotation */
+ int videoRotation;
+
+ /* If it is an audio stream, audio bit rate */
+ int audioSampleRate;
+
+ /* If it is an audio stream, the number of audio channels */
+ int audioChannels;
+
+ /* stream duration in second */
+ int64_t duration;};
+
+/**
+ * @brief Player Metadata type
+ *
+ */
+enum MEDIA_PLAYER_METADATA_TYPE {
+ /** data type unknown
+ */
+ PLAYER_METADATA_TYPE_UNKNOWN = 0,
+ /** sei data
+ */
+ PLAYER_METADATA_TYPE_SEI = 1,
+};
+
+} // namespace media
+
+namespace rtc {
+/**
+ * The audio route.
+ */
+enum AudioRoute
+{
+ /**
+ * -1: The default audio route.
+ */
+ ROUTE_DEFAULT = -1,
+ /**
+ * The headset.
+ */
+ ROUTE_HEADSET,
+ /**
+ * The earpiece.
+ */
+ ROUTE_EARPIECE,
+ /**
+ * The headset with no microphone.
+ */
+ ROUTE_HEADSETNOMIC,
+ /**
+ * The speakerphone.
+ */
+ ROUTE_SPEAKERPHONE,
+ /**
+ * The loudspeaker.
+ */
+ ROUTE_LOUDSPEAKER,
+ /**
+ * The Bluetooth headset.
+ */
+ ROUTE_HEADSETBLUETOOTH
+};
+} // namespace rtc
+
+
+} // namespace ar
+
+#endif // __AR_MEDIA_BASE_H__
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaEngine.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaEngine.h
new file mode 100644
index 0000000..4ee79a5
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaEngine.h
@@ -0,0 +1,770 @@
+#ifndef __I_AR_MEDIA_ENGINE_H__
+#define __I_AR_MEDIA_ENGINE_H__
+#include <stdint.h>
+
+#define AM ar::media
+
+namespace ar {
+namespace media {
+/** **DEPRECATED** Type of audio device.
+ */
+enum MEDIA_SOURCE_TYPE {
+ /** Audio playback device.
+ */
+ AUDIO_PLAYOUT_SOURCE = 0,
+ /** Microphone.
+ */
+ AUDIO_RECORDING_SOURCE = 1,
+};
+
+/**
+ * The IAudioFrameObserver class.
+ */
+class IAudioFrameObserver {
+ public:
+ /** The frame type. */
+ enum AUDIO_FRAME_TYPE {
+ /** 0: PCM16. */
+ FRAME_TYPE_PCM16 = 0, // PCM 16bit little endian
+ };
+ /** Definition of AudioFrame */
+ struct AudioFrame {
+ /** The type of the audio frame. See #AUDIO_FRAME_TYPE
+ */
+ AUDIO_FRAME_TYPE type;
+ /** The number of samples per channel in the audio frame.
+ */
+ int samples; //number of samples for each channel in this frame
+ /**The number of bytes per audio sample, which is usually 16-bit (2-byte).
+ */
+ int bytesPerSample; //number of bytes per sample: 2 for PCM16
+ /** The number of audio channels.
+ - 1: Mono
+ - 2: Stereo (the data is interleaved)
+ */
+ int channels; //number of channels (data are interleaved if stereo)
+ /** The sample rate.
+ */
+ int samplesPerSec; //sampling rate
+ /** The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved.
+ The size of the data buffer is as follows: `buffer` = `samples` × `channels` × `bytesPerSample`.
+ */
+ void* buffer; //data buffer
+ /** The timestamp (ms) of the external audio frame. You can use this parameter for the following purposes:
+ - Restore the order of the captured audio frame.
+ - Synchronize audio and video frames in video-related scenarios, including where external video sources are used.
+ */
+ int64_t renderTimeMs;
+ /** Reserved parameter.
+ */
+ int avsync_type;
+ };
+
+ public:
+ /** Retrieves the recorded audio frame.
+
+ The SDK triggers this callback once every 10 ms.
+
+ @param audioFrame Pointer to AudioFrame.
+ @return
+ - true: Valid buffer in AudioFrame, and the recorded audio frame is sent out.
+ - false: Invalid buffer in AudioFrame, and the recorded audio frame is discarded.
+ */
+ virtual bool onRecordAudioFrame(AudioFrame& audioFrame) = 0;
+ /** Retrieves the audio playback frame every 10 ms for getting the audio.
+
+ @param audioFrame Pointer to AudioFrame.
+ @return
+ - true: Valid buffer in AudioFrame, and the audio playback frame is sent out.
+ - false: Invalid buffer in AudioFrame, and the audio playback frame is discarded.
+ */
+ virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) = 0;
+ /** Retrieves the mixed recorded and playback audio frame.
+
+
+ @note This callback only returns the single-channel data.
+
+ @param audioFrame Pointer to AudioFrame.
+ @return
+ - true: Valid buffer in AudioFrame and the mixed recorded and playback audio frame is sent out.
+ - false: Invalid buffer in AudioFrame and the mixed recorded and playback audio frame is discarded.
+ */
+ virtual bool onMixedAudioFrame(AudioFrame& audioFrame) = 0;
+ /** Retrieves the audio frame of a specified user before mixing.
+
+ The SDK triggers this callback if isMultipleChannelFrameWanted returns false.
+
+ @param uid The user ID
+ @param audioFrame Pointer to AudioFrame.
+ @return
+ - true: Valid buffer in AudioFrame, and the mixed recorded and playback audio frame is sent out.
+ - false: Invalid buffer in AudioFrame, and the mixed recorded and playback audio frame is discarded.
+ */
+ virtual bool onPlaybackAudioFrameBeforeMixing(const char* uid,
+ AudioFrame& audioFrame) = 0;
+ /** Determines whether to receive audio data from multiple channels.
+
+ @since v3.0.1
+
+ After you register the audio frame observer, the SDK triggers this callback every time it captures an audio frame.
+
+ In the multi-channel scenario, if you want to get audio data from multiple channels,
+ set the return value of this callback as true. After that, the SDK triggers the
+ \ref IAudioFrameObserver::onPlaybackAudioFrameBeforeMixingEx "onPlaybackAudioFrameBeforeMixingEx" callback to send you the before-mixing
+ audio data from various channels. You can also get the channel ID of each audio frame.
+
+ @note
+ - Once you set the return value of this callback as true, the SDK triggers
+ only the \ref IAudioFrameObserver::onPlaybackAudioFrameBeforeMixingEx "onPlaybackAudioFrameBeforeMixingEx" callback
+ to send the before-mixing audio frame. \ref IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing "onPlaybackAudioFrameBeforeMixing" is not triggered.
+ In the multi-channel scenario, AR recommends setting the return value as true.
+ - If you set the return value of this callback as false, the SDK triggers only the `onPlaybackAudioFrameBeforeMixing` callback to send the audio data.
+ @return
+ - `true`: Receive audio data from multiple channels.
+ - `false`: Do not receive audio data from multiple channels.
+ */
+ virtual bool isMultipleChannelFrameWanted() { return false; }
+
+ /** Gets the before-mixing playback audio frame from multiple channels.
+
+ After you successfully register the audio frame observer, if you set the return
+ value of \ref IAudioFrameObserver::isMultipleChannelFrameWanted "isMultipleChannelFrameWanted" as true, the SDK triggers this callback each
+ time it receives a before-mixing audio frame from any of the channel.
+
+ @param channelId The channel ID of this audio frame.
+ @param uid The ID of the user sending this audio frame.
+ @param audioFrame The pointer to AudioFrame.
+ @return
+ - `true`: The data in AudioFrame is valid, and send this audio frame.
+ - `false`: The data in AudioFrame in invalid, and do not send this audio frame.
+ */
+ virtual bool onPlaybackAudioFrameBeforeMixingEx(const char *channelId,
+ const char* uid, AudioFrame& audioFrame) { return true; }
+
+};
+
+/**
+ * The IVideoFrameObserver class.
+ */
+class IVideoFrameObserver {
+ public:
+ /** The video frame type. */
+ enum VIDEO_FRAME_TYPE {
+ /**
+ * 0: YUV420
+ */
+ FRAME_TYPE_YUV420 = 0, // YUV 420 format
+ /**
+ * 1: YUV422
+ */
+ FRAME_TYPE_YUV422 = 1, // YUV 422 format
+ /**
+ * 2: RGBA
+ */
+ FRAME_TYPE_RGBA = 2, // RGBA format
+ };
+ /**
+ * The frame position of the video observer.
+ */
+ enum VIDEO_OBSERVER_POSITION {
+ /**
+ * 1: The post-capturer position, which corresponds to the video data in the onCaptureVideoFrame callback.
+ */
+ POSITION_POST_CAPTURER = 1 << 0,
+ /**
+ * 2: The pre-renderer position, which corresponds to the video data in the onRenderVideoFrame callback.
+ */
+ POSITION_PRE_RENDERER = 1 << 1,
+ /**
+ * 4: The pre-encoder position, which corresponds to the video data in the onPreEncodeVideoFrame callback.
+ */
+ POSITION_PRE_ENCODER = 1 << 2,
+ };
+ /** Video frame information. The video data format is YUV420. The buffer provides a pointer to a pointer. The interface cannot modify the pointer of the buffer, but can modify the content of the buffer only.
+ */
+ struct VideoFrame {
+ VIDEO_FRAME_TYPE type;
+ /** Video pixel width.
+ */
+ int width; //width of video frame
+ /** Video pixel height.
+ */
+ int height; //height of video frame
+ /** Line span of the Y buffer within the YUV data.
+ */
+ int yStride; //stride of Y data buffer
+ /** Line span of the U buffer within the YUV data.
+ */
+ int uStride; //stride of U data buffer
+ /** Line span of the V buffer within the YUV data.
+ */
+ int vStride; //stride of V data buffer
+ /** Pointer to the Y buffer pointer within the YUV data.
+ */
+ void* yBuffer; //Y data buffer
+ /** Pointer to the U buffer pointer within the YUV data.
+ */
+ void* uBuffer; //U data buffer
+ /** Pointer to the V buffer pointer within the YUV data.
+ */
+ void* vBuffer; //V data buffer
+ /** Set the rotation of this frame before rendering the video. Supports 0, 90, 180, 270 degrees clockwise.
+ */
+ int rotation; // rotation of this frame (0, 90, 180, 270)
+ /** The timestamp of the external audio frame. It is mandatory. You can use this parameter for the following purposes:
+ - Restore the order of the captured audio frame.
+ - Synchronize audio and video frames in video-related scenarios, including scenarios where external video sources are used.
+ @note This timestamp is for rendering the video stream, and not for capturing the video stream.
+ */
+ int64_t renderTimeMs;
+ int avsync_type;
+ };
+
+ public:
+ /** Occurs each time the SDK receives a video frame captured by the local camera.
+ *
+ * After you successfully register the video frame observer, the SDK triggers this callback each time a video frame is received. In this callback,
+ * you can get the video data captured by the local camera. You can then pre-process the data according to your scenarios.
+ *
+ * After pre-processing, you can send the processed video data back to the SDK by setting the `videoFrame` parameter in this callback.
+ *
+ * @note
+ * This callback does not support sending processed RGBA video data back to the SDK.
+ *
+ * @param videoFrame Pointer to VideoFrame.
+ * @return Whether or not to ignore the current video frame if the pre-processing fails:
+ * - true: Do not ignore.
+ * - false: Ignore the current video frame, and do not send it back to the SDK.
+ */
+ virtual bool onCaptureVideoFrame(VideoFrame& videoFrame) = 0;
+ /** Occurs each time the SDK receives a video frame before encoding.
+ *
+ * After you successfully register the video frame observer, the SDK triggers this callback each time when it receives a video frame. In this callback, you can get the video data before encoding. You can then process the data according to your particular scenarios.
+ *
+ * After processing, you can send the processed video data back to the SDK by setting the `VideoFrame` parameter in this callback.
+ *
+ * @note
+ * - The video data that this callback gets has been pre-processed, with its content cropped, rotated, and the image enhanced.
+ * - This callback does not support sending processed RGBA video data back to the SDK.
+ *
+ * @param videoFrame A pointer to VideoFrame
+ * @return Whether to ignore the current video frame if the processing fails:
+ * - true: Do not ignore the current video frame.
+ * - false: Ignore the current video frame, and do not send it back to the SDK.
+ */
+ virtual bool onPreEncodeVideoFrame(VideoFrame& videoFrame) { return true; }
+ /** Occurs each time the SDK receives a video encoded data after encoding.
+ *
+ * After you successfully register the video frame observer, the SDK triggers this callback each time when it receives a video frame. In this callback, you can get the video enccoded data after encoding. You can then process the data according to your particular scenarios.
+ */
+ virtual bool onEncodeVideoData(bool keyFrame, const char*vidData, int vidLen) { return true; }
+ /** Occurs each time the SDK receives a video frame sent by the remote user.
+ *
+ * After you successfully register the video frame observer, the SDK triggers this callback each time a video frame is received. In this callback,
+ * you can get the video data sent by the remote user. You can then post-process the data according to your scenarios.
+ *
+ * After post-processing, you can send the processed data back to the SDK by setting the `videoFrame` parameter in this callback.
+ *
+ * @note
+ * This callback does not support sending processed RGBA video data back to the SDK.
+ *
+ * @param uid ID of the remote user who sends the current video frame.
+ * @param videoFrame Pointer to VideoFrame.
+ * @return Whether or not to ignore the current video frame if the post-processing fails:
+ * - true: Do not ignore.
+ * - false: Ignore the current video frame, and do not send it back to the SDK.
+ */
+ virtual bool onRenderVideoFrame(const char* uid, VideoFrame& videoFrame) = 0;
+ /** Occurs each time the SDK receives a video frame and prompts you to set the video format.
+ *
+ * YUV420 is the default video format. If you want to receive other video formats, register this callback in the IVideoFrameObserver class.
+ *
+ * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame.
+ * You need to set your preferred video data in the return value of this callback.
+ *
+ * @return Sets the video format: #VIDEO_FRAME_TYPE
+ * - #FRAME_TYPE_YUV420 (0): (Default) YUV420.
+ * - #FRAME_TYPE_RGBA (2): RGBA
+ */
+ virtual VIDEO_FRAME_TYPE getVideoFormatPreference() { return FRAME_TYPE_YUV420; }
+ /** Occurs each time the SDK receives a video frame and prompts you whether or not to rotate the captured video according to the rotation member in the VideoFrame class.
+ *
+ * The SDK does not rotate the captured video by default. If you want to rotate the captured video according to the rotation member in the VideoFrame class, register this callback in the IVideoFrameObserver class.
+ *
+ * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. You need to set whether or not to rotate the video frame in the return value of this callback.
+ *
+ * @note
+ * This callback applies to RGBA video data only.
+ *
+ * @return Sets whether or not to rotate the captured video:
+ * - true: Rotate.
+ * - false: (Default) Do not rotate.
+ */
+ virtual bool getRotationApplied() { return false; }
+ /** Occurs each time the SDK receives a video frame and prompts you whether or not to mirror the captured video.
+ *
+ * The SDK does not mirror the captured video by default. Register this callback in the IVideoFrameObserver class if you want to mirror the captured video.
+ *
+ * After you successfully register the video frame observer, the SDK triggers this callback each time a video frame is received.
+ * You need to set whether or not to mirror the captured video in the return value of this callback.
+ *
+ * @note
+ * This callback applies to RGBA video data only.
+ *
+ * @return Sets whether or not to mirror the captured video:
+ * - true: Mirror.
+ * - false: (Default) Do not mirror.
+ */
+ virtual bool getMirrorApplied() { return false; }
+ /** @since v3.0.0
+
+ Sets whether to output the acquired video frame smoothly.
+
+ If you want the video frames acquired from \ref IVideoFrameObserver::onRenderVideoFrame "onRenderVideoFrame" to be more evenly spaced, you can register the `getSmoothRenderingEnabled` callback in the `IVideoFrameObserver` class and set its return value as `true`.
+
+ @note
+ - Register this callback before joining a channel.
+ - This callback applies to scenarios where the acquired video frame is self-rendered after being processed, not to scenarios where the video frame is sent back to the SDK after being processed.
+
+ @return Set whether or not to smooth the video frames:
+ - true: Smooth the video frame.
+ - false: (Default) Do not smooth.
+ */
+ virtual bool getSmoothRenderingEnabled(){ return false; }
+ /**
+ * Sets the frame position for the video observer.
+ * @since v3.0.1
+ *
+ * After you successfully register the video observer, the SDK triggers this callback each time it receives a video frame. You can determine which position to observe by setting the return value.
+ * The SDK provides 3 positions for observer. Each position corresponds to a callback function:
+ * - `POSITION_POST_CAPTURER(1 << 0)`: The position after capturing the video data, which corresponds to the \ref onCaptureVideoFrame "onCaptureVideoFrame" callback.
+ * - `POSITION_PRE_RENDERER(1 << 1)`: The position before receiving the remote video data, which corresponds to the \ref onRenderVideoFrame "onRenderVideoFrame" callback.
+ * - `POSITION_PRE_ENCODER(1 << 2)`: The position before encoding the video data, which corresponds to the \ref onPreEncodeVideoFrame "onPreEncodeVideoFrame" callback.
+ *
+ * @note
+ * - Use '|' (the OR operator) to observe multiple frame positions.
+ * - This callback observes `POSITION_POST_CAPTURER(1 << 0)` and `POSITION_PRE_RENDERER(1 << 1)` by default.
+ * - To conserve the system consumption, you can reduce the number of frame positions that you want to observe.
+ *
+ * @return A bit mask that controls the frame position of the video observer: #VIDEO_OBSERVER_POSITION.
+ *
+ */
+ virtual uint32_t getObservedFramePosition() { return static_cast<uint32_t>(POSITION_POST_CAPTURER | POSITION_PRE_RENDERER); }
+
+ /** Determines whether to receive video data from multiple channels.
+
+ After you register the video frame observer, the SDK triggers this callback
+ every time it captures a video frame.
+
+ In the multi-channel scenario, if you want to get video data from multiple channels,
+ set the return value of this callback as true. After that, the SDK triggers the
+ onRenderVideoFrameEx callback to send you
+ the video data from various channels. You can also get the channel ID of each video frame.
+
+ @note
+ - Once you set the return value of this callback as true, the SDK triggers only the `onRenderVideoFrameEx` callback to
+ send the video frame. onRenderVideoFrame will not be triggered. In the multi-channel scenario, AR recommends setting the return value as true.
+ - If you set the return value of this callback as false, the SDK triggers only the `onRenderVideoFrame` callback to send the video data.
+ @return
+ - `true`: Receive video data from multiple channels.
+ - `false`: Do not receive video data from multiple channels.
+ */
+ virtual bool isMultipleChannelFrameWanted() { return false; }
+
+ /** Gets the video frame from multiple channels.
+
+ After you successfully register the video frame observer, if you set the return value of
+ isMultipleChannelFrameWanted as true, the SDK triggers this callback each time it receives a video frame
+ from any of the channel.
+
+ You can process the video data retrieved from this callback according to your scenario, and send the
+ processed data back to the SDK using the `videoFrame` parameter in this callback.
+
+ @note This callback does not support sending RGBA video data back to the SDK.
+
+ @param channelId The channel ID of this video frame.
+ @param uid The ID of the user sending this video frame.
+ @param videoFrame The pointer to VideoFrame.
+ @return Whether to send this video frame to the SDK if post-processing fails:
+ - `true`: Send this video frame.
+ - `false`: Do not send this video frame.
+ */
+ virtual bool onRenderVideoFrameEx(const char *channelId, const char* uid, VideoFrame& videoFrame) { return true; }
+};
+
+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,
+ VIDEO_TYPE_I422 = 17,
+ };
+ virtual void release() = 0;
+ virtual const unsigned char* buffer(PLANE_TYPE type) const = 0;
+
+ /** Copies the frame.
+
+ If the required size is larger than the allocated size, new buffers of the adequate size will be allocated.
+
+ @param dest_frame Address of the returned destination frame. See IVideoFrame.
+ @return
+ - 0: Success.
+ - -1: Failure.
+ */
+ virtual int copyFrame(IVideoFrame** dest_frame) const = 0;
+ /** Converts the frame.
+
+ @note The source and destination frames have equal heights.
+
+ @param dst_video_type Type of the output video.
+ @param dst_sample_size Required only for the parsing of M-JPEG.
+ @param dst_frame Pointer to a destination frame. See IVideoFrame.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int convertFrame(VIDEO_TYPE dst_video_type, int dst_sample_size,
+ unsigned char* dst_frame) const = 0;
+ /** Retrieves the specified component in the YUV space.
+
+ @param type Component type: #PLANE_TYPE
+ */
+ virtual int allocated_size(PLANE_TYPE type) const = 0;
+ /** Retrieves the stride of the specified component in the YUV space.
+
+ @param type Component type: #PLANE_TYPE
+ */
+ virtual int stride(PLANE_TYPE type) const = 0;
+ /** Retrieves the width of the frame.
+ */
+ virtual int width() const = 0;
+ /** Retrieves the height of the frame.
+ */
+ virtual int height() const = 0;
+ /** Retrieves the timestamp (90 ms) of the frame.
+ */
+ virtual unsigned int timestamp() const = 0;
+ /** Retrieves the render time (ms).
+ */
+ virtual int64_t render_time_ms() const = 0;
+ /** Checks if a plane is of zero size.
+
+ @return
+ - true: The plane is of zero size.
+ - false: The plane is not of zero size.
+ */
+ virtual bool IsZeroSize() const = 0;
+
+ virtual VIDEO_TYPE GetVideoType() const = 0;
+};
+/** **DEPRECATED** */
+class IExternalVideoRenderCallback {
+ public:
+ /** Occurs when the video view size has changed.
+ */
+ virtual void onViewSizeChanged(int width, int height) = 0;
+ /** Occurs when the video view is destroyed.
+ */
+ virtual void onViewDestroyed() = 0;
+};
+/** **DEPRECATED** */
+struct ExternalVideoRenerContext {
+ IExternalVideoRenderCallback* renderCallback;
+ /** Video display window.
+ */
+ void* view;
+ /** Video display mode: \ref ar::rtc::RENDER_MODE_TYPE "RENDER_MODE_TYPE" */
+ int renderMode;
+ /** The image layer location.
+
+ - 0: (Default) The image is at the bottom of the stack
+ - 100: The image is at the top of the stack.
+
+ @note If the value is set to below 0 or above 100, the #ERR_INVALID_ARGUMENT error occurs.
+ */
+ int zOrder;
+ /** Video layout distance from the left.
+ */
+ float left;
+ /** Video layout distance from the top.
+ */
+ float top;
+ /** Video layout distance from the right.
+ */
+ float right;
+ /** Video layout distance from the bottom.
+ */
+ 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;
+};
+
+/** The external video frame.
+ */
+struct ExternalVideoFrame
+{
+ /** The video buffer type.
+ */
+ enum VIDEO_BUFFER_TYPE
+ {
+ /** 1: The video buffer in the format of raw data.
+ */
+ VIDEO_BUFFER_RAW_DATA = 1,
+ /** 10: The video buffer in the format of h264 extra data.
+ */
+ VIDEO_BUFFER_H264_EXTRA_DATA = 10,
+ /** 11: The video buffer in the format of h264 data.
+ */
+ VIDEO_BUFFER_H264_DATA = 11,
+
+ };
+
+ /** The video pixel format.
+ */
+ enum VIDEO_PIXEL_FORMAT
+ {
+ /** 0: The video pixel format is unknown.
+ */
+ VIDEO_PIXEL_UNKNOWN = 0,
+ /** 1: The video pixel format is I420.
+ */
+ VIDEO_PIXEL_I420 = 1,
+ /** 2: The video pixel format is BGRA.
+ */
+ VIDEO_PIXEL_BGRA = 2,
+ /** 3: The video pixel format is NV21.
+ */
+ VIDEO_PIXEL_NV21 = 3,
+ /** 4: The video pixel format is RGBA.
+ */
+ VIDEO_PIXEL_RGBA = 4,
+ /** 5: The video pixel format is IMC2.
+ */
+ VIDEO_PIXEL_IMC2 = 5,
+ /** 7: The video pixel format is ARGB.
+ */
+ VIDEO_PIXEL_ARGB = 7,
+ /** 8: The video pixel format is NV12.
+ */
+ VIDEO_PIXEL_NV12 = 8,
+ /** 16: The video pixel format is I422.
+ */
+ VIDEO_PIXEL_I422 = 16,
+ /** 32: The video is key frame.
+ */
+ VIDEO_KEY_FRAME = 32,
+ /** 64: The video is normal frame.
+ */
+ VIDEO_NOR_FRAME = 64,
+ };
+
+ /** The buffer type. See #VIDEO_BUFFER_TYPE
+ */
+ VIDEO_BUFFER_TYPE type;
+ /** The pixel format. See #VIDEO_PIXEL_FORMAT
+ */
+ VIDEO_PIXEL_FORMAT format;
+ /** The video buffer.
+ */
+ void* buffer;
+ /** The length of video buffer.
+ */
+ int length;
+ /** Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture.
+ */
+ int stride;
+ /** Width of the incoming video frame.
+ */
+ int width;
+ /** Height of the incoming video frame.
+ */
+ int height;
+ /** [Raw data related parameter] The number of pixels trimmed from the left. The default value is 0.
+ */
+ int cropLeft;
+ /** [Raw data related parameter] The number of pixels trimmed from the top. The default value is 0.
+ */
+ int cropTop;
+ /** [Raw data related parameter] The number of pixels trimmed from the right. The default value is 0.
+ */
+ int cropRight;
+ /** [Raw data related parameter] The number of pixels trimmed from the bottom. The default value is 0.
+ */
+ int cropBottom;
+ /** [Raw data related parameter] The clockwise rotation of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0.
+ */
+ int rotation;
+ /** Timestamp of the incoming video frame (ms). An incorrect timestamp results in frame loss or unsynchronized audio and video.
+ */
+ long long timestamp;
+
+ ExternalVideoFrame()
+ :cropLeft(0)
+ ,cropTop(0)
+ ,cropRight(0)
+ ,cropBottom(0)
+ ,rotation(0)
+ {}
+};
+
+class IMediaEngine {
+ public:
+ virtual void release() = 0;
+ /** Registers an audio frame observer object.
+
+ This method is used to register an audio frame observer object (register a callback). This method is required to register callbacks when the engine is required to provide an \ref IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" or \ref IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback.
+
+ @param observer Audio frame observer object instance. If NULL is passed in, the registration is canceled.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0;
+ /** Registers a video frame observer object.
+
+ You need to implement the IVideoFrameObserver class in this method, and register callbacks according to your scenarios.
+
+ After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received.
+
+ @note When handling the video data returned in the callbacks, pay attention to the changes in the `width` and `height` parameters,
+ which may be adapted under the following circumstances:
+ - When the network condition deteriorates, the video resolution decreases incrementally.
+ - If the user adjusts the video profile, the resolution of the video returned in the callbacks also changes.
+ @param observer Video frame observer object instance. If NULL is passed in, the registration is canceled.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0;
+ /** **DEPRECATED** */
+ virtual int registerVideoRenderFactory(IExternalVideoRenderFactory* factory) = 0;
+ /** **DEPRECATED** Use \ref ar::media::IMediaEngine::pushAudioFrame(IAudioFrameObserver::AudioFrame* frame) "pushAudioFrame(IAudioFrameObserver::AudioFrame* frame)" instead.
+
+ Pushes the external audio frame.
+
+ @param type Type of audio capture device: #MEDIA_SOURCE_TYPE.
+ @param frame Audio frame pointer: \ref IAudioFrameObserver::AudioFrame "AudioFrame".
+ @param wrap Whether to use the placeholder. We recommend setting the default value.
+ - true: Use.
+ - false: (Default) Not use.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int pushAudioFrame(MEDIA_SOURCE_TYPE type,
+ IAudioFrameObserver::AudioFrame* frame,
+ bool wrap) = 0;
+ /** Pushes the external audio frame.
+
+ @param frame Pointer to the audio frame: \ref IAudioFrameObserver::AudioFrame "AudioFrame".
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int pushAudioFrame(IAudioFrameObserver::AudioFrame* frame) = 0;
+ /** Pulls the remote audio data.
+ *
+ * Before calling this method, call the
+ * \ref ar::rtc::IRtcEngine::setExternalAudioSink
+ * "setExternalAudioSink(enabled: true)" method to enable and set the
+ * external audio sink.
+ *
+ * After a successful method call, the app pulls the decoded and mixed
+ * audio data for playback.
+ *
+ * @note
+ * - Once you call the \ref ar::media::IMediaEngine::pullAudioFrame
+ * "pullAudioFrame" method successfully, the app will not retrieve any audio
+ * data from the
+ * \ref ar::media::IAudioFrameObserver::onPlaybackAudioFrame
+ * "onPlaybackAudioFrame" callback.
+ * - The difference between the
+ * \ref ar::media::IAudioFrameObserver::onPlaybackAudioFrame
+ * "onPlaybackAudioFrame" callback and the
+ * \ref ar::media::IMediaEngine::pullAudioFrame "pullAudioFrame" method is as
+ * follows:
+ * - `onPlaybackAudioFrame`: The SDK sends the audio data to the app once
+ * every 10 ms. Any delay in processing the audio frames may result in audio
+ * jitter.
+ * - `pullAudioFrame`: The app pulls the remote audio data. After setting the
+ * audio data parameters, the SDK adjusts the frame buffer and avoids
+ * problems caused by jitter in the external audio playback.
+ *
+ * @param frame Pointers to the audio frame.
+ * See: \ref IAudioFrameObserver::AudioFrame "AudioFrame".
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int pullAudioFrame(IAudioFrameObserver::AudioFrame* frame) = 0;
+ /** Configures the external video source.
+
+ @param enable Sets whether to use the external video source:
+ - true: Use the external video source.
+ - false: (Default) Do not use the external video source.
+
+ @param useTexture Sets whether to use texture as an input:
+ - true: Use texture as an input.
+ - false: (Default) Do not use texture as an input.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setExternalVideoSource(bool enable, bool useTexture) = 0;
+ /** Pushes the video frame using the \ref ExternalVideoFrame "ExternalVideoFrame" and passes the video frame to the AR SDK.
+
+ @param frame Video frame to be pushed. See \ref ExternalVideoFrame "ExternalVideoFrame".
+
+ @note In the `COMMUNICATION` profile, this method does not support video frames in the Texture format.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int pushVideoFrame(ExternalVideoFrame *frame) = 0;
+
+ virtual void SetHeadset(bool bHead) = 0;
+};
+
+} // namespace media
+
+} // namespace ar
+
+#endif // AR_MEDIA_ENGINE_H
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaPlayer.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaPlayer.h
new file mode 100644
index 0000000..afc93f7
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArMediaPlayer.h
@@ -0,0 +1,378 @@
+//
+// anyrtc Rtc Engine SDK
+//
+// Copyright (c) 2019 anyrtc.io. All rights reserved.
+//
+
+#ifndef __I_AR_MEDIA_PLAYER_H__
+#define __I_AR_MEDIA_PLAYER_H__
+
+#include "ArMediaBase.h"
+
+#ifndef AR
+#define AR ar::rtc
+#endif
+
+// external key
+/**
+ * set analyze duration for real time stream
+ * @example "setPlayerOption(KEY_PLAYER_REAL_TIME_STREAM_ANALYZE_DURATION,1000000)"
+ */
+#define KEY_PLAYER_REAL_TIME_STREAM_ANALYZE_DURATION "analyzeduration"
+
+/**
+ * set the player disable to play audio
+ * @example "setPlayerOption(KEY_PLAYER_DISABLE_AUDIO,0)"
+ */
+#define KEY_PLAYER_DISABLE_AUDIO "audio_disable"
+
+/**
+ * set the player disable to play video
+ * @example "setPlayerOption(KEY_PLAYER_DISABLE_VIDEO,0)"
+ */
+#define KEY_PLAYER_DISABLE_VIDEO "video_disable"
+
+namespace ar {
+namespace rtc {
+
+/** Definition of MediaPlayerContext.
+ */
+struct MediaPlayerContext {
+ /** User Context, i.e., activity context in Android.
+ */
+ void* context;
+
+ MediaPlayerContext()
+ : context(nullptr) {}
+};
+
+class IMediaPlayerObserver;
+
+/**
+ * @brief Player interface
+ *
+ */
+class IMediaPlayer {
+ public:
+
+ virtual int initialize(const MediaPlayerContext& context) = 0;
+
+ /**
+ * @brief Open media file
+ *
+ * @param src Media path, local path or network path
+ * @param startPos Set the starting position for playback, in seconds
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int open(const char* src, int64_t startPos) = 0;
+
+ /**
+ * @brief Play
+ *
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int play() = 0;
+
+ /**
+ * @brief pause
+ *
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int pause() = 0;
+
+ /**
+ * @brief stop
+ *
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int stop() = 0;
+
+ /**
+ * @brief Play to a specified position
+ *
+ * @param pos The position to play, in seconds
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int seek(int64_t pos) = 0;
+
+ /**
+ * @brief Turn mute on or off
+ *
+ * @param mute Whether to mute on
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int mute(bool mute) = 0;
+
+ /**
+ * @brief Get mute state
+ *
+ * @param[out] mute Whether is mute on
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int getMute(bool& mute) = 0;
+
+ /**
+ * @brief Adjust playback volume
+ *
+ * @param volume The volume value to be adjusted
+ * The volume can be adjusted from 0 to 400:
+ * 0: mute;
+ * 100: original volume;
+ * 400: Up to 4 times the original volume (with built-in overflow protection).
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int adjustPlayoutVolume(int volume) = 0;
+
+ /**
+ * @brief Get the current playback volume
+ *
+ * @param[out] volume
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int getPlayoutVolume(int& volume) = 0;
+
+ /**
+ * @brief Get the current playback progress
+ *
+ * @param[out] pos Progress in seconds
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int getPlayPosition(int64_t& pos) = 0;
+
+ /**
+ * @brief Get the current playback progress
+ *
+ * @param[out] pos Progress in millisecond
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int getPlayPositionInMillisecond(int64_t& positionInMs) = 0;
+
+ /**
+ * @brief Get media duration
+ *
+ * @param[out] duration Duration in seconds
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int getDuration(int64_t& duration) = 0;
+
+ /**
+ * @brief Get player state
+ *
+ * @return PLAYER_STATE
+ */
+ virtual ar::media::MEDIA_PLAYER_STATE getState() = 0;
+
+ /**
+ * @brief Get the streams info count in the media
+ *
+ * @param[out] count
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int getStreamCount(int& count) = 0;
+
+ /**
+ * @brief Get the streams info by index
+ *
+ * @param[in] index, index
+ * @param[out] info, stream info for return
+ */
+ virtual int getStreamInfo(int index, ar::media::MediaStreamInfo* info) = 0;
+
+ /**
+ * @brief Set video rendering view
+ *
+ * @param view view object, windows platform is HWND
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int setView(ar::media::base::view_t view) = 0;
+
+ /**
+ * @brief Set video display mode
+ *
+ * @param renderMode Video display mode
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int setRenderMode(ar::media::base::RENDER_MODE_TYPE renderMode) = 0;
+
+ /**
+ * @brief Register the player observer
+ *
+ * @param observer observer object
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int registerPlayerObserver(IMediaPlayerObserver* observer) = 0;
+
+ /**
+ * @brief Unregister the player observer
+ *
+ * @param observer observer object
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int unregisterPlayerObserver(IMediaPlayerObserver* observer) = 0;
+
+ /**
+ * @brief Register the player video observer
+ *
+ * @param observer observer object
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int registerVideoFrameObserver(ar::media::base::IVideoFrameObserver* observer) = 0;
+
+ /**
+ * @brief UnRegister the player video observer
+ *
+ * @param observer observer object
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int unregisterVideoFrameObserver(ar::media::base::IVideoFrameObserver* observer) = 0;
+
+ /**
+ * @brief register the player audio observer
+ *
+ * @param observer observer object
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int registerAudioFrameObserver(ar::media::base::IAudioFrameObserver* observer) = 0;
+
+ /**
+ * @brief Unregister the player audio observer
+ *
+ * @param observer observer object
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int unregisterAudioFrameObserver(ar::media::base::IAudioFrameObserver* observer) = 0;
+
+ /**
+ * @brief change log file position
+ *
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int setLogFile(const char* filePath) = 0;
+
+ /**
+ * Sets the output log level of the SDK.
+ *
+ * You can use one or a combination of the filters. The log level follows the
+ * sequence of `OFF`, `CRITICAL`, `ERROR`, `WARNING`, `INFO`, and `DEBUG`. Choose a level
+ * and you will see logs preceding that level. For example, if you set the log level to
+ * `WARNING`, you see the logs within levels `CRITICAL`, `ERROR`, and `WARNING`.
+ *
+ * @param filter Sets the log filter level:
+ * - LOG_FILTER_DEBUG (0x80f): Output all API logs. Set your log filter as DEBUG
+ * if you want to get the most complete log file.
+ * - LOG_FILTER_INFO (0x0f): Output logs of the CRITICAL, ERROR, WARNING, and INFO
+ * level. We recommend setting your log filter as this level.
+ * - LOG_FILTER_WARNING (0x0e): Output logs of the CRITICAL, ERROR, and WARNING level.
+ * - LOG_FILTER_ERROR (0x0c): Output logs of the CRITICAL and ERROR level.
+ * - LOG_FILTER_CRITICAL (0x08): Output logs of the CRITICAL level.
+ * - LOG_FILTER_OFF (0): Do not output any log.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int setLogFilter(unsigned int filter) = 0;
+
+ /**
+ * @brief modify player option before play,
+ * @param [in] key
+ * the option key name
+ * @param [in] value
+ * the option value
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int setPlayerOption(const char *key ,int value) = 0;
+
+ /**
+ * @brief change playback speed
+ *
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int changePlaybackSpeed(const ar::media::MEDIA_PLAYER_PLAY_SPEED speed) = 0;
+
+ /**
+ * @brief change audio track
+ *
+ * @return int <= 0 On behalf of an error, the value corresponds to one of PLAYER_ERROR
+ */
+ virtual int selectAudioTrack(int index) = 0;
+
+ /**
+ * @brief release IMediaPlayer object.
+ *
+ */
+ virtual void release(bool sync = true) = 0;
+
+ virtual ~IMediaPlayer() {}
+};
+
+class IMediaPlayerObserver {
+ public:
+ /**
+ * @brief Triggered when the player state changes
+ *
+ * @param state New player state
+ * @param ec Player error message
+ */
+ virtual void onPlayerStateChanged(ar::media::MEDIA_PLAYER_STATE state,
+ ar::media::MEDIA_PLAYER_ERROR ec) = 0;
+
+ /**
+ * @brief Triggered when the player progress changes, once every 1 second
+ *
+ * @param position Current playback progress, in seconds
+ */
+ virtual void onPositionChanged(const int64_t position) = 0;
+
+ /**
+ * @brief Triggered when the player have some event
+ *
+ * @param event
+ */
+ virtual void onPlayerEvent(ar::media::MEDIA_PLAYER_EVENT event) = 0;
+
+ /**
+ * @brief Triggered when metadata is obtained
+ *
+ * @param type Metadata type
+ * @param data data
+ * @param length data length
+ */
+ virtual void onMetadata(ar::media::MEDIA_PLAYER_METADATA_TYPE type, const uint8_t* data,
+ uint32_t length) = 0;
+
+ virtual ~IMediaPlayerObserver() {}
+};
+
+} // namespace rtc
+} // namespace ar
+
+
+#if defined(_WIN32)
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#define AR_PLAYER_API extern "C" __declspec(dllexport)
+#define AR_PLAYER_CALL
+#elif defined(__APPLE__)
+#include <TargetConditionals.h>
+#define AR_PLAYER_API __attribute__((visibility("default"))) extern "C"
+#define AR_PLAYER_CALL
+#elif defined(__ANDROID__) || defined(__linux__)
+#define AR_PLAYER_API extern "C" __attribute__((visibility("default")))
+#define AR_PLAYER_CALL
+#else
+#define AR_PLAYER_API extern "C"
+#define AR_PLAYER_CALL
+#endif
+
+/**
+ * Creates an anyrtc media player object and returns the pointer.
+ * @return
+ * - The pointer to \ref ar::rtc::IMediaPlayer "IMediaPlayer", if the method call succeeds.
+ * - The empty pointer NULL, if the method call fails.
+ */
+AR_PLAYER_API ar::rtc::IMediaPlayer* AR_PLAYER_CALL createArMediaPlayer();
+
+#endif // __I_AR_MEDIA_PLAYER_H__
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArRtcEngine.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArRtcEngine.h
new file mode 100644
index 0000000..11c726f
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArRtcEngine.h
@@ -0,0 +1,8998 @@
+//
+// ARRtcEngine SDK
+//
+// Copyright (c) 2019 anyrtc.io. All rights reserved.
+//
+
+/**
+ @defgroup createARRtcEngine Create an ARRtcEngine
+ */
+
+#ifndef __I_AR_RTC_ENGINE_H__
+#define __I_AR_RTC_ENGINE_H__
+#include "ArBase.h"
+#include "IArService.h"
+
+#if defined(_WIN32)
+#include "IArMediaEngine.h"
+#endif
+
+#ifndef AR
+#define AR ar::rtc
+#endif
+#ifndef AU
+#define AU ar::util
+#endif
+
+namespace ar {
+namespace rtc {
+ typedef const char* uid_t;
+ typedef void* view_t;
+/** Maximum length of the device ID.
+*/
+enum MAX_DEVICE_ID_LENGTH_TYPE
+{
+ /** The maximum length of the device ID is 512 bytes.
+ */
+ MAX_DEVICE_ID_LENGTH = 512
+};
+/** Maximum length of user account.
+ */
+enum MAX_USER_ACCOUNT_LENGTH_TYPE
+{
+ /** The maximum length of user account is 255 bytes.
+ */
+ MAX_USER_ACCOUNT_LENGTH = 256
+};
+/** Maximum length of channel ID.
+ */
+enum MAX_CHANNEL_ID_LENGTH_TYPE
+{
+ /** The maximum length of channel id is 64 bytes.
+ */
+ MAX_CHANNEL_ID_LENGTH = 65
+};
+/** Formats of the quality report.
+*/
+enum QUALITY_REPORT_FORMAT_TYPE
+{
+ /** 0: The quality report in JSON format,
+ */
+ QUALITY_REPORT_JSON = 0,
+ /** 1: The quality report in HTML format.
+ */
+ QUALITY_REPORT_HTML = 1,
+};
+
+enum MEDIA_ENGINE_EVENT_CODE_TYPE
+{
+ /** 0: For internal use only.
+ */
+ MEDIA_ENGINE_RECORDING_ERROR = 0,
+ /** 1: For internal use only.
+ */
+ MEDIA_ENGINE_PLAYOUT_ERROR = 1,
+ /** 2: For internal use only.
+ */
+ MEDIA_ENGINE_RECORDING_WARNING = 2,
+ /** 3: For internal use only.
+ */
+ MEDIA_ENGINE_PLAYOUT_WARNING = 3,
+ /** 10: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH = 10,
+ /** 12: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS = 12,
+ /** 13: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS = 13,
+ /** 14: For internal use only.
+ */
+ MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED = 14,
+ /** 15: For internal use only.
+ */
+ MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED = 15,
+ // media engine role changed
+ /** 20: For internal use only.
+ */
+ MEDIA_ENGINE_ROLE_BROADCASTER_SOLO = 20,
+ /** 21: For internal use only.
+ */
+ MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE = 21,
+ /** 22: For internal use only.
+ */
+ MEDIA_ENGINE_ROLE_AUDIENCE = 22,
+ /** 23: For internal use only.
+ */
+ MEDIA_ENGINE_ROLE_COMM_PEER = 23,
+ /** 24: For internal use only.
+ */
+ MEDIA_ENGINE_ROLE_GAME_PEER = 24,
+ // iOS adm sample rate changed
+ /** 110: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART = 110,
+ /** 111: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART = 111,
+ /** 112: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS = 112,
+ /** 113: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS = 113,
+ // audio mix state
+ /** 710: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY = 710,
+ /** 711: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED = 711,
+ /** 712: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART = 712,
+ /** 713: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED = 713,
+ /** 714: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR = 714,
+ //Mixing error codes
+ /** 701: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN = 701,
+ /** 702: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT = 702,
+ /** 703: The audio mixing file playback is interrupted. For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF = 703,
+ /** 0: For internal use only.
+ */
+ MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR = 0,
+};
+
+/** The states of the local user's audio mixing file.
+*/
+enum AUDIO_MIXING_STATE_TYPE{
+ /** 710: The audio mixing file is playing.
+ */
+ AUDIO_MIXING_STATE_PLAYING = 710,
+ /** 711: The audio mixing file pauses playing.
+ */
+ AUDIO_MIXING_STATE_PAUSED = 711,
+ /** 713: The audio mixing file stops playing.
+ */
+ AUDIO_MIXING_STATE_STOPPED = 713,
+ /** 714: An exception occurs when playing the audio mixing file. See #AUDIO_MIXING_ERROR_TYPE.
+ */
+ AUDIO_MIXING_STATE_FAILED = 714,
+};
+
+/** The error codes of the local user's audio mixing file.
+*/
+enum AUDIO_MIXING_ERROR_TYPE{
+ /** 701: The SDK cannot open the audio mixing file.
+ */
+ AUDIO_MIXING_ERROR_CAN_NOT_OPEN = 701,
+ /** 702: The SDK opens the audio mixing file too frequently.
+ */
+ AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL = 702,
+ /** 703: The audio mixing file playback is interrupted.
+ */
+ AUDIO_MIXING_ERROR_INTERRUPTED_EOF = 703,
+ /** 0: The SDK can open the audio mixing file.
+ */
+ AUDIO_MIXING_ERROR_OK = 0,
+};
+
+/** Media device states.
+ */
+enum MEDIA_DEVICE_STATE_TYPE
+{
+ /** 1: The device is active.
+ */
+ MEDIA_DEVICE_STATE_ACTIVE = 1,
+ /** 2: The device is disabled.
+ */
+ MEDIA_DEVICE_STATE_DISABLED = 2,
+ /** 4: The device is not present.
+ */
+ MEDIA_DEVICE_STATE_NOT_PRESENT = 4,
+ /** 8: The device is unplugged.
+ */
+ MEDIA_DEVICE_STATE_UNPLUGGED = 8
+};
+
+/** Media device types.
+ */
+enum MEDIA_DEVICE_TYPE
+{
+ /** -1: Unknown device type.
+ */
+ UNKNOWN_AUDIO_DEVICE = -1,
+ /** 0: Audio playback device.
+ */
+ AUDIO_PLAYOUT_DEVICE = 0,
+ /** 1: Audio recording device.
+ */
+ AUDIO_RECORDING_DEVICE = 1,
+ /** 2: Video renderer.
+ */
+ VIDEO_RENDER_DEVICE = 2,
+ /** 3: Video capturer.
+ */
+ VIDEO_CAPTURE_DEVICE = 3,
+ /** 4: Application audio playback device.
+ */
+ AUDIO_APPLICATION_PLAYOUT_DEVICE = 4,
+};
+
+/** Local video state types
+ */
+enum LOCAL_VIDEO_STREAM_STATE
+{
+ /** 0: Initial state */
+ LOCAL_VIDEO_STREAM_STATE_STOPPED = 0,
+ /** 1: The local video capturing device starts successfully.
+ *
+ * The SDK also reports this state when you share a maximized window by calling \ref IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId".
+ */
+ LOCAL_VIDEO_STREAM_STATE_CAPTURING = 1,
+ /** 2: The first video frame is successfully encoded. */
+ LOCAL_VIDEO_STREAM_STATE_ENCODING = 2,
+ /** 3: The local video fails to start. */
+ LOCAL_VIDEO_STREAM_STATE_FAILED = 3
+};
+
+/** Local video state error codes
+ */
+enum LOCAL_VIDEO_STREAM_ERROR {
+ /** 0: The local video is normal. */
+ LOCAL_VIDEO_STREAM_ERROR_OK = 0,
+ /** 1: No specified reason for the local video failure. */
+ LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1,
+ /** 2: No permission to use the local video capturing device. */
+ LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2,
+ /** 3: The local video capturing device is in use. */
+ LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3,
+ /** 4: The local video capture fails. Check whether the capturing device is working properly. */
+ LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4,
+ /** 5: The local video encoding fails. */
+ LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5,
+ /** 6: (iOS only) The application is in the background.
+ *
+ * @since v3.3.0
+ */
+ LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND = 6,
+ /** 7: (iOS only) The application is running in Slide Over, Split View, or Picture in Picture mode.
+ *
+ * @since v3.3.0
+ */
+ LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS = 7,
+ /** 11: The shared window is minimized when you call \ref IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId" to share a window.
+ */
+ LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED = 11,
+ /** 12: The error code indicates that a window shared by the window ID has been closed, or a full-screen window
+ * shared by the window ID has exited full-screen mode.
+ * After exiting full-screen mode, remote users cannot see the shared window. To prevent remote users from seeing a
+ * black screen, AR recommends that you immediately stop screen sharing.
+ *
+ * Common scenarios for reporting this error code:
+ * - When the local user closes the shared window, the SDK reports this error code.
+ * - The local user shows some slides in full-screen mode first, and then shares the windows of the slides. After
+ * the user exits full-screen mode, the SDK reports this error code.
+ * - The local user watches web video or reads web document in full-screen mode first, and then shares the window of
+ * the web video or document. After the user exits full-screen mode, the SDK reports this error code.
+ */
+ LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED = 12,
+};
+
+/** Local audio state types.
+ */
+enum LOCAL_AUDIO_STREAM_STATE
+{
+ /** 0: The local audio is in the initial state.
+ */
+ LOCAL_AUDIO_STREAM_STATE_STOPPED = 0,
+ /** 1: The recording device starts successfully.
+ */
+ LOCAL_AUDIO_STREAM_STATE_RECORDING = 1,
+ /** 2: The first audio frame encodes successfully.
+ */
+ LOCAL_AUDIO_STREAM_STATE_ENCODING = 2,
+ /** 3: The local audio fails to start.
+ */
+ LOCAL_AUDIO_STREAM_STATE_FAILED = 3
+};
+
+/** Local audio state error codes.
+ */
+enum LOCAL_AUDIO_STREAM_ERROR
+{
+ /** 0: The local audio is normal.
+ */
+ LOCAL_AUDIO_STREAM_ERROR_OK = 0,
+ /** 1: No specified reason for the local audio failure.
+ */
+ LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1,
+ /** 2: No permission to use the local audio device.
+ */
+ LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2,
+ /** 3: The microphone is in use.
+ */
+ LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3,
+ /** 4: The local audio recording fails. Check whether the recording device
+ * is working properly.
+ */
+ LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4,
+ /** 5: The local audio encoding fails.
+ */
+ LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5
+};
+
+/** Audio recording qualities.
+*/
+enum AUDIO_RECORDING_QUALITY_TYPE
+{
+ /** 0: Low quality. The sample rate is 32 kHz, and the file size is around
+ * 1.2 MB after 10 minutes of recording.
+ */
+ AUDIO_RECORDING_QUALITY_LOW = 0,
+ /** 1: Medium quality. The sample rate is 32 kHz, and the file size is
+ * around 2 MB after 10 minutes of recording.
+ */
+ AUDIO_RECORDING_QUALITY_MEDIUM = 1,
+ /** 2: High quality. The sample rate is 32 kHz, and the file size is
+ * around 3.75 MB after 10 minutes of recording.
+ */
+ AUDIO_RECORDING_QUALITY_HIGH = 2,
+};
+
+/** Network quality types. */
+enum QUALITY_TYPE
+{
+ /** 0: The network quality is unknown. */
+ QUALITY_UNKNOWN = 0,
+ /** 1: The network quality is excellent. */
+ QUALITY_EXCELLENT = 1,
+ /** 2: The network quality is quite good, but the bitrate may be slightly lower than excellent. */
+ QUALITY_GOOD = 2,
+ /** 3: Users can feel the communication slightly impaired. */
+ QUALITY_POOR = 3,
+ /** 4: Users cannot communicate smoothly. */
+ QUALITY_BAD = 4,
+ /** 5: The network is so bad that users can barely communicate. */
+ QUALITY_VBAD = 5,
+ /** 6: The network is down and users cannot communicate at all. */
+ QUALITY_DOWN = 6,
+ /** 7: Users cannot detect the network quality. (Not in use.) */
+ QUALITY_UNSUPPORTED = 7,
+ /** 8: Detecting the network quality. */
+ QUALITY_DETECTING = 8,
+};
+
+/** Video display modes. */
+enum RENDER_MODE_TYPE
+{
+ /**
+1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.
+ */
+ RENDER_MODE_HIDDEN = 1,
+ /**
+2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black.
+ */
+ RENDER_MODE_FIT = 2,
+ /** **DEPRECATED** 3: This mode is deprecated.
+ */
+ RENDER_MODE_ADAPTIVE = 3,
+ /**
+ 4: The fill mode. In this mode, the SDK stretches or zooms the video to fill the display window.
+ */
+ RENDER_MODE_FILL = 4,
+};
+
+/** Video mirror modes. */
+enum VIDEO_MIRROR_MODE_TYPE
+{
+ /** 0: (Default) The SDK enables the mirror mode.
+ */
+ VIDEO_MIRROR_MODE_AUTO = 0,//determined by SDK
+ /** 1: Enable mirror mode. */
+ VIDEO_MIRROR_MODE_ENABLED = 1,//enabled mirror
+ /** 2: Disable mirror mode. */
+ VIDEO_MIRROR_MODE_DISABLED = 2,//disable mirror
+};
+
+/** **DEPRECATED** Video profiles. */
+enum VIDEO_PROFILE_TYPE
+{
+ /** 0: 160 * 120, frame rate 15 fps, bitrate 65 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_120P = 0,
+ /** 2: 120 * 120, frame rate 15 fps, bitrate 50 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_120P_3 = 2,
+ /** 10: 320*180, frame rate 15 fps, bitrate 140 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_180P = 10,
+ /** 12: 180 * 180, frame rate 15 fps, bitrate 100 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_180P_3 = 12,
+ /** 13: 240 * 180, frame rate 15 fps, bitrate 120 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_180P_4 = 13,
+ /** 20: 320 * 240, frame rate 15 fps, bitrate 200 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_240P = 20,
+ /** 22: 240 * 240, frame rate 15 fps, bitrate 140 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_240P_3 = 22,
+ /** 23: 424 * 240, frame rate 15 fps, bitrate 220 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_240P_4 = 23,
+ /** 30: 640 * 360, frame rate 15 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_360P = 30,
+ /** 32: 360 * 360, frame rate 15 fps, bitrate 260 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_360P_3 = 32,
+ /** 33: 640 * 360, frame rate 30 fps, bitrate 600 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_360P_4 = 33,
+ /** 35: 360 * 360, frame rate 30 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_360P_6 = 35,
+ /** 36: 480 * 360, frame rate 15 fps, bitrate 320 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_360P_7 = 36,
+ /** 37: 480 * 360, frame rate 30 fps, bitrate 490 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_360P_8 = 37,
+ /** 38: 640 * 360, frame rate 15 fps, bitrate 800 Kbps.
+ @note `LIVE_BROADCASTING` profile only.
+ */
+ VIDEO_PROFILE_LANDSCAPE_360P_9 = 38,
+ /** 39: 640 * 360, frame rate 24 fps, bitrate 800 Kbps.
+ @note `LIVE_BROADCASTING` profile only.
+ */
+ VIDEO_PROFILE_LANDSCAPE_360P_10 = 39,
+ /** 100: 640 * 360, frame rate 24 fps, bitrate 1000 Kbps.
+ @note `LIVE_BROADCASTING` profile only.
+ */
+ VIDEO_PROFILE_LANDSCAPE_360P_11 = 100,
+ /** 40: 640 * 480, frame rate 15 fps, bitrate 500 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_480P = 40,
+ /** 42: 480 * 480, frame rate 15 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_480P_3 = 42,
+ /** 43: 640 * 480, frame rate 30 fps, bitrate 750 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_480P_4 = 43,
+ /** 45: 480 * 480, frame rate 30 fps, bitrate 600 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_480P_6 = 45,
+ /** 47: 848 * 480, frame rate 15 fps, bitrate 610 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_480P_8 = 47,
+ /** 48: 848 * 480, frame rate 30 fps, bitrate 930 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_480P_9 = 48,
+ /** 49: 640 * 480, frame rate 10 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_480P_10 = 49,
+ /** 50: 1280 * 720, frame rate 15 fps, bitrate 1130 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_720P = 50,
+ /** 52: 1280 * 720, frame rate 30 fps, bitrate 1710 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_720P_3 = 52,
+ /** 54: 960 * 720, frame rate 15 fps, bitrate 910 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_720P_5 = 54,
+ /** 55: 960 * 720, frame rate 30 fps, bitrate 1380 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_720P_6 = 55,
+ /** 60: 1920 * 1080, frame rate 15 fps, bitrate 2080 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_1080P = 60,
+ /** 62: 1920 * 1080, frame rate 30 fps, bitrate 3150 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_1080P_3 = 62,
+ /** 64: 1920 * 1080, frame rate 60 fps, bitrate 4780 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_1080P_5 = 64,
+ /** 66: 2560 * 1440, frame rate 30 fps, bitrate 4850 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_1440P = 66,
+ /** 67: 2560 * 1440, frame rate 60 fps, bitrate 6500 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_1440P_2 = 67,
+ /** 70: 3840 * 2160, frame rate 30 fps, bitrate 6500 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_4K = 70,
+ /** 72: 3840 * 2160, frame rate 60 fps, bitrate 6500 Kbps. */
+ VIDEO_PROFILE_LANDSCAPE_4K_3 = 72,
+ /** 1000: 120 * 160, frame rate 15 fps, bitrate 65 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_120P = 1000,
+ /** 1002: 120 * 120, frame rate 15 fps, bitrate 50 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_120P_3 = 1002,
+ /** 1010: 180 * 320, frame rate 15 fps, bitrate 140 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_180P = 1010,
+ /** 1012: 180 * 180, frame rate 15 fps, bitrate 100 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_180P_3 = 1012,
+ /** 1013: 180 * 240, frame rate 15 fps, bitrate 120 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_180P_4 = 1013,
+ /** 1020: 240 * 320, frame rate 15 fps, bitrate 200 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_240P = 1020,
+ /** 1022: 240 * 240, frame rate 15 fps, bitrate 140 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_240P_3 = 1022,
+ /** 1023: 240 * 424, frame rate 15 fps, bitrate 220 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_240P_4 = 1023,
+ /** 1030: 360 * 640, frame rate 15 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_360P = 1030,
+ /** 1032: 360 * 360, frame rate 15 fps, bitrate 260 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_360P_3 = 1032,
+ /** 1033: 360 * 640, frame rate 30 fps, bitrate 600 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_360P_4 = 1033,
+ /** 1035: 360 * 360, frame rate 30 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_360P_6 = 1035,
+ /** 1036: 360 * 480, frame rate 15 fps, bitrate 320 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_360P_7 = 1036,
+ /** 1037: 360 * 480, frame rate 30 fps, bitrate 490 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_360P_8 = 1037,
+ /** 1038: 360 * 640, frame rate 15 fps, bitrate 800 Kbps.
+ @note `LIVE_BROADCASTING` profile only.
+ */
+ VIDEO_PROFILE_PORTRAIT_360P_9 = 1038,
+ /** 1039: 360 * 640, frame rate 24 fps, bitrate 800 Kbps.
+ @note `LIVE_BROADCASTING` profile only.
+ */
+ VIDEO_PROFILE_PORTRAIT_360P_10 = 1039,
+ /** 1100: 360 * 640, frame rate 24 fps, bitrate 1000 Kbps.
+ @note `LIVE_BROADCASTING` profile only.
+ */
+ VIDEO_PROFILE_PORTRAIT_360P_11 = 1100,
+ /** 1040: 480 * 640, frame rate 15 fps, bitrate 500 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_480P = 1040,
+ /** 1042: 480 * 480, frame rate 15 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_480P_3 = 1042,
+ /** 1043: 480 * 640, frame rate 30 fps, bitrate 750 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_480P_4 = 1043,
+ /** 1045: 480 * 480, frame rate 30 fps, bitrate 600 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_480P_6 = 1045,
+ /** 1047: 480 * 848, frame rate 15 fps, bitrate 610 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_480P_8 = 1047,
+ /** 1048: 480 * 848, frame rate 30 fps, bitrate 930 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_480P_9 = 1048,
+ /** 1049: 480 * 640, frame rate 10 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_480P_10 = 1049,
+ /** 1050: 720 * 1280, frame rate 15 fps, bitrate 1130 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_720P = 1050,
+ /** 1052: 720 * 1280, frame rate 30 fps, bitrate 1710 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_720P_3 = 1052,
+ /** 1054: 720 * 960, frame rate 15 fps, bitrate 910 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_720P_5 = 1054,
+ /** 1055: 720 * 960, frame rate 30 fps, bitrate 1380 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_720P_6 = 1055,
+ /** 1060: 1080 * 1920, frame rate 15 fps, bitrate 2080 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_1080P = 1060,
+ /** 1062: 1080 * 1920, frame rate 30 fps, bitrate 3150 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_1080P_3 = 1062,
+ /** 1064: 1080 * 1920, frame rate 60 fps, bitrate 4780 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_1080P_5 = 1064,
+ /** 1066: 1440 * 2560, frame rate 30 fps, bitrate 4850 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_1440P = 1066,
+ /** 1067: 1440 * 2560, frame rate 60 fps, bitrate 6500 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_1440P_2 = 1067,
+ /** 1070: 2160 * 3840, frame rate 30 fps, bitrate 6500 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_4K = 1070,
+ /** 1072: 2160 * 3840, frame rate 60 fps, bitrate 6500 Kbps. */
+ VIDEO_PROFILE_PORTRAIT_4K_3 = 1072,
+ /** Default 640 * 360, frame rate 15 fps, bitrate 400 Kbps. */
+ VIDEO_PROFILE_DEFAULT = VIDEO_PROFILE_LANDSCAPE_360P,
+};
+
+/** Audio profiles.
+
+Sets the sample rate, bitrate, encoding mode, and the number of channels:*/
+enum AUDIO_PROFILE_TYPE // sample rate, bit rate, mono/stereo, speech/music codec
+{
+ /**
+ 0: Default audio profile:
+ - For the interactive streaming profile: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 64 Kbps.
+ - For the `COMMUNICATION` profile:
+ - Windows: A sample rate of 16 KHz, music encoding, mono, and a bitrate of up to 16 Kbps.
+ - Android/macOS/iOS: A sample rate of 32 KHz, music encoding, mono, and a bitrate of up to 18 Kbps.
+ */
+ AUDIO_PROFILE_DEFAULT = 0, // use default settings
+ /**
+ 1: A sample rate of 32 KHz, audio encoding, mono, and a bitrate of up to 18 Kbps.
+ */
+ AUDIO_PROFILE_SPEECH_STANDARD = 1, // 32Khz, 18Kbps, mono, speech
+ /**
+ 2: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 64 Kbps.
+ */
+ AUDIO_PROFILE_MUSIC_STANDARD = 2, // 48Khz, 48Kbps, mono, music
+ /**
+ 3: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 80 Kbps.
+ */
+ AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3, // 48Khz, 56Kbps, stereo, music
+ /**
+ 4: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 96 Kbps.
+ */
+ AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4, // 48Khz, 128Kbps, mono, music
+ /**
+ 5: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 128 Kbps.
+ */
+ AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5, // 48Khz, 192Kbps, stereo, music
+ /**
+ 6: A sample rate of 16 KHz, audio encoding, mono, and Acoustic Echo Cancellation (AES) enabled.
+ */
+ AUDIO_PROFILE_IOT = 6,
+ AUDIO_PROFILE_NUM = 7,
+};
+
+/** Audio application scenarios.
+*/
+enum AUDIO_SCENARIO_TYPE // set a suitable scenario for your app type
+{
+ /** 0: Default audio scenario. */
+ AUDIO_SCENARIO_DEFAULT = 0,
+ /** 1: Entertainment scenario where users need to frequently switch the user role. */
+ AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT = 1,
+ /** 2: Education scenario where users want smoothness and stability. */
+ AUDIO_SCENARIO_EDUCATION = 2,
+ /** 3: High-quality audio chatroom scenario where hosts mainly play music. */
+ AUDIO_SCENARIO_GAME_STREAMING = 3,
+ /** 4: Showroom scenario where a single host wants high-quality audio. */
+ AUDIO_SCENARIO_SHOWROOM = 4,
+ /** 5: Gaming scenario for group chat that only contains the human voice. */
+ AUDIO_SCENARIO_CHATROOM_GAMING = 5,
+ /** 6: IoT (Internet of Things) scenario where users use IoT devices with low power consumption. */
+ AUDIO_SCENARIO_IOT = 6,
+ /** 8: Meeting scenario that mainly contains the human voice.
+ *
+ * @since v3.2.0
+ */
+ AUDIO_SCENARIO_MEETING = 8,
+ /** The number of elements in the enumeration.
+ */
+ AUDIO_SCENARIO_NUM = 9,
+};
+
+ /** The channel profile of the AR RtcEngine.
+ */
+enum CHANNEL_PROFILE_TYPE
+{
+ /** (Default) Communication. This profile applies to scenarios such as an audio call or video call,
+ * where all users can publish and subscribe to streams.
+ */
+ CHANNEL_PROFILE_COMMUNICATION = 0,
+ /** Live streaming. In this profile, uses have roles, namely, host and audience (default).
+ * A host both publishes and subscribes to streams, while an audience subscribes to streams only.
+ * This profile applies to scenarios such as a chat room or interactive video streaming.
+ */
+ CHANNEL_PROFILE_LIVE_BROADCASTING = 1,
+ /** 2: Gaming. This profile uses a codec with a lower bitrate and consumes less power. Applies to the gaming scenario, where all game players can talk freely.
+ *
+ * @note AR does not recommend using this setting.
+ */
+ CHANNEL_PROFILE_GAME = 2,
+};
+/// @cond
+/** The role of a user in a live interactive streaming. */
+enum CLIENT_ROLE_TYPE
+{
+ /** 1: Host. A host can both send and receive streams. */
+ CLIENT_ROLE_BROADCASTER = 1,
+ /** 2: (Default) Audience. An `audience` member can only receive streams. */
+ CLIENT_ROLE_AUDIENCE = 2,
+};
+
+/** The latency level of an audience member in a live interactive streaming.
+ *
+ * @note Takes effect only when the user role is `CLIENT_ROLE_BROADCASTER`.
+ */
+enum AUDIENCE_LATENCY_LEVEL_TYPE
+{
+ /** 1: Low latency. */
+ AUDIENCE_LATENCY_LEVEL_LOW_LATENCY = 1,
+ /** 2: (Default) Ultra low latency. */
+ AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY = 2,
+};
+/// @cond
+/** The reason why the super-resolution algorithm is not successfully enabled.
+ */
+enum SUPER_RESOLUTION_STATE_REASON
+{
+ /** 0: The super-resolution algorithm is successfully enabled.
+ */
+ SR_STATE_REASON_SUCCESS = 0,
+ /** 1: The origin resolution of the remote video is beyond the range where
+ * the super-resolution algorithm can be applied.
+ */
+ SR_STATE_REASON_STREAM_OVER_LIMITATION = 1,
+ /** 2: Another user is already using the super-resolution algorithm.
+ */
+ SR_STATE_REASON_USER_COUNT_OVER_LIMITATION = 2,
+ /** 3: The device does not support the super-resolution algorithm.
+ */
+ SR_STATE_REASON_DEVICE_NOT_SUPPORTED = 3,
+};
+/// @endcond
+
+/** Reasons for a user being offline. */
+enum USER_OFFLINE_REASON_TYPE
+{
+ /** 0: The user quits the call. */
+ USER_OFFLINE_QUIT = 0,
+ /** 1: The SDK times out and the user drops offline because no data packet is received within a certain period of time. If the user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. */
+ USER_OFFLINE_DROPPED = 1,
+ /** 2: (Live broadcast only.) The client role switched from the host to the audience. */
+ USER_OFFLINE_BECOME_AUDIENCE = 2,
+};
+/**
+ States of the RTMP streaming.
+ */
+enum RTMP_STREAM_PUBLISH_STATE
+{
+ /** The RTMP streaming has not started or has ended. This state is also triggered after you remove an RTMP address from the CDN by calling removePublishStreamUrl.
+ */
+ RTMP_STREAM_PUBLISH_STATE_IDLE = 0,
+ /** The SDK is connecting to AR's streaming server and the RTMP server. This state is triggered after you call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method.
+ */
+ RTMP_STREAM_PUBLISH_STATE_CONNECTING = 1,
+ /** The RTMP streaming publishes. The SDK successfully publishes the RTMP streaming and returns this state.
+ */
+ RTMP_STREAM_PUBLISH_STATE_RUNNING = 2,
+ /** The RTMP streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP streaming and returns this state.
+
+ - If the SDK successfully resumes the streaming, #RTMP_STREAM_PUBLISH_STATE_RUNNING (2) returns.
+ - If the streaming does not resume within 60 seconds or server errors occur, #RTMP_STREAM_PUBLISH_STATE_FAILURE (4) returns. You can also reconnect to the server by calling the \ref IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods.
+ */
+ RTMP_STREAM_PUBLISH_STATE_RECOVERING = 3,
+ /** The RTMP streaming fails. See the errCode parameter for the detailed error information. You can also call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the RTMP streaming again.
+ */
+ RTMP_STREAM_PUBLISH_STATE_FAILURE = 4,
+};
+
+/**
+ Error codes of the RTMP streaming.
+ */
+enum RTMP_STREAM_PUBLISH_ERROR
+{
+ /** The RTMP streaming publishes successfully. */
+ RTMP_STREAM_PUBLISH_ERROR_OK = 0,
+ /** Invalid argument used. If, for example, you do not call the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method to configure the LiveTranscoding parameters before calling the addPublishStreamUrl method, the SDK returns this error. Check whether you set the parameters in the *setLiveTranscoding* method properly. */
+ RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT = 1,
+ /** The RTMP streaming is encrypted and cannot be published. */
+ RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2,
+ /** Timeout for the RTMP streaming. Call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the streaming again. */
+ RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3,
+ /** An error occurs in AR's streaming server. Call the addPublishStreamUrl method to publish the streaming again. */
+ RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4,
+ /** An error occurs in the RTMP server. */
+ RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5,
+ /** The RTMP streaming publishes too frequently. */
+ RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6,
+ /** The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. */
+ RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7,
+ /** The host manipulates other hosts' URLs. Check your app logic. */
+ RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8,
+ /** AR's server fails to find the RTMP streaming. */
+ RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9,
+ /** The format of the RTMP streaming URL is not supported. Check whether the URL format is correct. */
+ RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10,
+ /** 推流中的背景图片或者水印地址无法拉取 **/
+ RTMP_STREAMING_ERROR_FAILED_LOAD_IMAGE = 11,
+
+};
+
+/** Events during the RTMP streaming. */
+enum RTMP_STREAMING_EVENT
+{
+ /** An error occurs when you add a background image or a watermark image to the RTMP stream.
+ */
+ RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE = 1,
+};
+
+/** States of importing an external video stream in the live interactive streaming. */
+enum INJECT_STREAM_STATUS
+{
+ /** 0: The external video stream imported successfully. */
+ INJECT_STREAM_STATUS_START_SUCCESS = 0,
+ /** 1: The external video stream already exists. */
+ INJECT_STREAM_STATUS_START_ALREADY_EXISTS = 1,
+ /** 2: The external video stream to be imported is unauthorized. */
+ INJECT_STREAM_STATUS_START_UNAUTHORIZED = 2,
+ /** 3: Import external video stream timeout. */
+ INJECT_STREAM_STATUS_START_TIMEDOUT = 3,
+ /** 4: Import external video stream failed. */
+ INJECT_STREAM_STATUS_START_FAILED = 4,
+ /** 5: The external video stream stopped importing successfully. */
+ INJECT_STREAM_STATUS_STOP_SUCCESS = 5,
+ /** 6: No external video stream is found. */
+ INJECT_STREAM_STATUS_STOP_NOT_FOUND = 6,
+ /** 7: The external video stream to be stopped importing is unauthorized. */
+ INJECT_STREAM_STATUS_STOP_UNAUTHORIZED = 7,
+ /** 8: Stop importing external video stream timeout. */
+ INJECT_STREAM_STATUS_STOP_TIMEDOUT = 8,
+ /** 9: Stop importing external video stream failed. */
+ INJECT_STREAM_STATUS_STOP_FAILED = 9,
+ /** 10: The external video stream is corrupted. */
+ INJECT_STREAM_STATUS_BROKEN = 10,
+};
+/** Remote video stream types. */
+enum REMOTE_VIDEO_STREAM_TYPE
+{
+ /** 0: High-stream video. */
+ REMOTE_VIDEO_STREAM_HIGH = 0,
+ /** 1: Low-stream video. */
+ REMOTE_VIDEO_STREAM_LOW = 1,
+};
+
+/** Use modes of the \ref media::IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" callback. */
+enum RAW_AUDIO_FRAME_OP_MODE_TYPE
+{
+ /** 0: Read-only mode: Users only read the \ref AM::IAudioFrameObserver::AudioFrame "AudioFrame" data without modifying anything. For example, when users acquire the data with the AR SDK, then push the RTMP streams. */
+ RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0,
+ /** 1: Write-only mode: Users replace the \ref AM::IAudioFrameObserver::AudioFrame "AudioFrame" data with their own data and pass the data to the SDK for encoding. For example, when users acquire the data. */
+ RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY = 1,
+ /** 2: Read and write mode: Users read the data from \ref AM::IAudioFrameObserver::AudioFrame "AudioFrame", modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change. */
+ RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2,
+};
+
+/** Audio-sample rates. */
+enum AUDIO_SAMPLE_RATE_TYPE
+{
+ /** 32000: 32 kHz */
+ AUDIO_SAMPLE_RATE_32000 = 32000,
+ /** 44100: 44.1 kHz */
+ AUDIO_SAMPLE_RATE_44100 = 44100,
+ /** 48000: 48 kHz */
+ AUDIO_SAMPLE_RATE_48000 = 48000,
+};
+
+/** Video codec profile types. */
+enum VIDEO_CODEC_PROFILE_TYPE
+{ /** 66: Baseline video codec profile. Generally used in video calls on mobile phones. */
+ VIDEO_CODEC_PROFILE_BASELINE = 66,
+ /** 77: Main video codec profile. Generally used in mainstream electronics such as MP4 players, portable video players, PSP, and iPads. */
+ VIDEO_CODEC_PROFILE_MAIN = 77,
+ /** 100: (Default) High video codec profile. Generally used in high-resolution broadcasts or television. */
+ VIDEO_CODEC_PROFILE_HIGH = 100,
+};
+
+/** Video codec types */
+enum VIDEO_CODEC_TYPE {
+ /** Standard VP8 */
+ VIDEO_CODEC_VP8 = 1,
+ /** Standard H264 */
+ VIDEO_CODEC_H264 = 2,
+ /** Enhanced VP8 */
+ VIDEO_CODEC_EVP = 3,
+ /** Enhanced H264 */
+ VIDEO_CODEC_E264 = 4,
+ /** Standard Jpeg*/
+ VIDEO_CODEC_MJPG = 5,
+};
+
+/**
+ * Audio codec type list.
+ */
+enum AUDIO_CODEC_TYPE {
+ /**
+ * 1: OPUS
+ */
+ AUDIO_CODEC_OPUS = 1,
+ /**
+ * 3: G711
+ */
+ AUDIO_CODEC_G711A = 3,
+ AUDIO_CODEC_G711U = 4,
+ /**
+ * 5: G722
+ */
+ AUDIO_CODEC_G722 = 5,
+ /**
+ * 8: AACLC
+ */
+ AUDIO_CODEC_AACLC = 8,
+ /**
+ * 9: HEAAC
+ */
+ AUDIO_CODEC_HEAAC = 9,
+ /**
+ * 253: GENERIC
+ */
+ AUDIO_CODEC_GENERIC = 253,
+};
+
+/** Video Codec types for publishing streams. */
+enum VIDEO_CODEC_TYPE_FOR_STREAM
+{
+ VIDEO_CODEC_H264_FOR_STREAM = 1,
+ VIDEO_CODEC_H265_FOR_STREAM = 2,
+};
+
+/** Audio equalization band frequencies. */
+enum AUDIO_EQUALIZATION_BAND_FREQUENCY
+{
+ /** 0: 31 Hz */
+ AUDIO_EQUALIZATION_BAND_31 = 0,
+ /** 1: 62 Hz */
+ AUDIO_EQUALIZATION_BAND_62 = 1,
+ /** 2: 125 Hz */
+ AUDIO_EQUALIZATION_BAND_125 = 2,
+ /** 3: 250 Hz */
+ AUDIO_EQUALIZATION_BAND_250 = 3,
+ /** 4: 500 Hz */
+ AUDIO_EQUALIZATION_BAND_500 = 4,
+ /** 5: 1 kHz */
+ AUDIO_EQUALIZATION_BAND_1K = 5,
+ /** 6: 2 kHz */
+ AUDIO_EQUALIZATION_BAND_2K = 6,
+ /** 7: 4 kHz */
+ AUDIO_EQUALIZATION_BAND_4K = 7,
+ /** 8: 8 kHz */
+ AUDIO_EQUALIZATION_BAND_8K = 8,
+ /** 9: 16 kHz */
+ AUDIO_EQUALIZATION_BAND_16K = 9,
+};
+
+/** Audio reverberation types. */
+enum AUDIO_REVERB_TYPE
+{
+ /** 0: The level of the dry signal (db). The value is between -20 and 10. */
+ AUDIO_REVERB_DRY_LEVEL = 0, // (dB, [-20,10]), the level of the dry signal
+ /** 1: The level of the early reflection signal (wet signal) (dB). The value is between -20 and 10. */
+ AUDIO_REVERB_WET_LEVEL = 1, // (dB, [-20,10]), the level of the early reflection signal (wet signal)
+ /** 2: The room size of the reflection. The value is between 0 and 100. */
+ AUDIO_REVERB_ROOM_SIZE = 2, // ([0,100]), the room size of the reflection
+ /** 3: The length of the initial delay of the wet signal (ms). The value is between 0 and 200. */
+ AUDIO_REVERB_WET_DELAY = 3, // (ms, [0,200]), the length of the initial delay of the wet signal in ms
+ /** 4: The reverberation strength. The value is between 0 and 100. */
+ AUDIO_REVERB_STRENGTH = 4, // ([0,100]), the strength of the reverberation
+};
+
+/**
+ * Local voice changer options.
+ */
+enum VOICE_CHANGER_PRESET {
+ /**
+ * The original voice (no local voice change).
+ */
+ VOICE_CHANGER_OFF = 0x00000000, //Turn off the voice changer
+ /**
+ * The voice of an old man.
+ */
+ VOICE_CHANGER_OLDMAN = 0x00000001,
+ /**
+ * The voice of a little boy.
+ */
+ VOICE_CHANGER_BABYBOY = 0x00000002,
+ /**
+ * The voice of a little girl.
+ */
+ VOICE_CHANGER_BABYGIRL = 0x00000003,
+ /**
+ * The voice of Zhu Bajie, a character in Journey to the West who has a voice like that of a growling bear.
+ */
+ VOICE_CHANGER_ZHUBAJIE = 0x00000004,
+ /**
+ * The ethereal voice.
+ */
+ VOICE_CHANGER_ETHEREAL = 0x00000005,
+ /**
+ * The voice of Hulk.
+ */
+ VOICE_CHANGER_HULK = 0x00000006,
+ /**
+ * A more vigorous voice.
+ */
+ VOICE_BEAUTY_VIGOROUS = 0x00100001,//7,
+ /**
+ * A deeper voice.
+ */
+ VOICE_BEAUTY_DEEP = 0x00100002,
+ /**
+ * A mellower voice.
+ */
+ VOICE_BEAUTY_MELLOW = 0x00100003,
+ /**
+ * Falsetto.
+ */
+ VOICE_BEAUTY_FALSETTO = 0x00100004,
+ /**
+ * A fuller voice.
+ */
+ VOICE_BEAUTY_FULL = 0x00100005,
+ /**
+ * A clearer voice.
+ */
+ VOICE_BEAUTY_CLEAR = 0x00100006,
+ /**
+ * A more resounding voice.
+ */
+ VOICE_BEAUTY_RESOUNDING = 0x00100007,
+ /**
+ * A more ringing voice.
+ */
+ VOICE_BEAUTY_RINGING = 0x00100008,
+ /**
+ * A more spatially resonant voice.
+ */
+ VOICE_BEAUTY_SPACIAL = 0x00100009,
+ /**
+ * (For male only) A more magnetic voice. Do not use it when the speaker is a female; otherwise, voice distortion occurs.
+ */
+ GENERAL_BEAUTY_VOICE_MALE_MAGNETIC = 0x00200001,
+ /**
+ * (For female only) A fresher voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs.
+ */
+ GENERAL_BEAUTY_VOICE_FEMALE_FRESH = 0x00200002,
+ /**
+ * (For female only) A more vital voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs.
+ */
+ GENERAL_BEAUTY_VOICE_FEMALE_VITALITY = 0x00200003
+
+};
+
+/** Local voice reverberation presets. */
+enum AUDIO_REVERB_PRESET {
+ /**
+ * Turn off local voice reverberation, that is, to use the original voice.
+ */
+ AUDIO_REVERB_OFF = 0x00000000, // Turn off audio reverb
+ /**
+ * The reverberation style typical of a KTV venue (enhanced).
+ */
+ AUDIO_REVERB_FX_KTV = 0x00100001,
+ /**
+ * The reverberation style typical of a concert hall (enhanced).
+ */
+ AUDIO_REVERB_FX_VOCAL_CONCERT = 0x00100002,
+ /**
+ * The reverberation style typical of an uncle's voice.
+ */
+ AUDIO_REVERB_FX_UNCLE = 0x00100003,
+ /**
+ * The reverberation style typical of a little sister's voice.
+ */
+ AUDIO_REVERB_FX_SISTER = 0x00100004,
+ /**
+ * The reverberation style typical of a recording studio (enhanced).
+ */
+ AUDIO_REVERB_FX_STUDIO = 0x00100005,
+ /**
+ * The reverberation style typical of popular music (enhanced).
+ */
+ AUDIO_REVERB_FX_POPULAR = 0x00100006,
+ /**
+ * The reverberation style typical of R&B music (enhanced).
+ */
+ AUDIO_REVERB_FX_RNB = 0x00100007,
+ /**
+ * The reverberation style typical of the vintage phonograph.
+ */
+ AUDIO_REVERB_FX_PHONOGRAPH = 0x00100008,
+ /**
+ * The reverberation style typical of popular music.
+ */
+ AUDIO_REVERB_POPULAR = 0x00000001,
+ /**
+ * The reverberation style typical of R&B music.
+ */
+ AUDIO_REVERB_RNB = 0x00000002,
+ /**
+ * The reverberation style typical of rock music.
+ */
+ AUDIO_REVERB_ROCK = 0x00000003,
+ /**
+ * The reverberation style typical of hip-hop music.
+ */
+ AUDIO_REVERB_HIPHOP = 0x00000004,
+ /**
+ * The reverberation style typical of a concert hall.
+ */
+ AUDIO_REVERB_VOCAL_CONCERT = 0x00000005,
+ /**
+ * The reverberation style typical of a KTV venue.
+ */
+ AUDIO_REVERB_KTV = 0x00000006,
+ /**
+ * The reverberation style typical of a recording studio.
+ */
+ AUDIO_REVERB_STUDIO = 0x00000007,
+ /**
+ * The reverberation of the virtual stereo. The virtual stereo is an effect that renders the monophonic
+ * audio as the stereo audio, so that all users in the channel can hear the stereo voice effect.
+ * To achieve better virtual stereo reverberation, AR recommends setting `profile` in `setAudioProfile`
+ * as `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`.
+ */
+ AUDIO_VIRTUAL_STEREO = 0x00200001,
+ /** 1: Electronic Voice.*/
+ AUDIO_ELECTRONIC_VOICE = 0x00300001,
+ /** 1: 3D Voice.*/
+ AUDIO_THREEDIM_VOICE = 0x00400001
+};
+/** The options for SDK preset voice beautifier effects.
+ */
+enum VOICE_BEAUTIFIER_PRESET
+{
+ /** Turn off voice beautifier effects and use the original voice.
+ */
+ VOICE_BEAUTIFIER_OFF = 0x00000000,
+ /** A more magnetic voice.
+ *
+ * @note AR recommends using this enumerator to process a male-sounding voice; otherwise, you may experience vocal distortion.
+ */
+ CHAT_BEAUTIFIER_MAGNETIC = 0x01010100,
+ /** A fresher voice.
+ *
+ * @note AR recommends using this enumerator to process a female-sounding voice; otherwise, you may experience vocal distortion.
+ */
+ CHAT_BEAUTIFIER_FRESH = 0x01010200,
+ /** A more vital voice.
+ *
+ * @note AR recommends using this enumerator to process a female-sounding voice; otherwise, you may experience vocal distortion.
+ */
+ CHAT_BEAUTIFIER_VITALITY = 0x01010300,
+ /** A more vigorous voice.
+ */
+ TIMBRE_TRANSFORMATION_VIGOROUS = 0x01030100,
+ /** A deeper voice.
+ */
+ TIMBRE_TRANSFORMATION_DEEP = 0x01030200,
+ /** A mellower voice.
+ */
+ TIMBRE_TRANSFORMATION_MELLOW = 0x01030300,
+ /** A falsetto voice.
+ */
+ TIMBRE_TRANSFORMATION_FALSETTO = 0x01030400,
+ /** A falsetto voice.
+ */
+ TIMBRE_TRANSFORMATION_FULL = 0x01030500,
+ /** A clearer voice.
+ */
+ TIMBRE_TRANSFORMATION_CLEAR = 0x01030600,
+ /** A more resounding voice.
+ */
+ TIMBRE_TRANSFORMATION_RESOUNDING = 0x01030700,
+ /** A more ringing voice.
+ */
+ TIMBRE_TRANSFORMATION_RINGING = 0x01030800
+};
+/** The options for SDK preset audio effects.
+ */
+enum AUDIO_EFFECT_PRESET
+{
+ /** Turn off audio effects and use the original voice.
+ */
+ AUDIO_EFFECT_OFF = 0x00000000,
+ /** An audio effect typical of a KTV venue.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`
+ * before setting this enumerator.
+ */
+ ROOM_ACOUSTICS_KTV = 0x02010100,
+ /** An audio effect typical of a concert hall.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`
+ * before setting this enumerator.
+ */
+ ROOM_ACOUSTICS_VOCAL_CONCERT = 0x02010200,
+ /** An audio effect typical of a recording studio.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`
+ * before setting this enumerator.
+ */
+ ROOM_ACOUSTICS_STUDIO = 0x02010300,
+ /** An audio effect typical of a vintage phonograph.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`
+ * before setting this enumerator.
+ */
+ ROOM_ACOUSTICS_PHONOGRAPH = 0x02010400,
+ /** A virtual stereo effect that renders monophonic audio as stereo audio.
+ *
+ * @note Call \ref IRtcEngine::setAudioProfile "setAudioProfile" and set the `profile` parameter to
+ * `AUDIO_PROFILE_MUSIC_STANDARD_STEREO(3)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this
+ * enumerator; otherwise, the enumerator setting does not take effect.
+ */
+ ROOM_ACOUSTICS_VIRTUAL_STEREO = 0x02010500,
+ /** A more spatial audio effect.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`
+ * before setting this enumerator.
+ */
+ ROOM_ACOUSTICS_SPACIAL = 0x02010600,
+ /** A more ethereal audio effect.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`
+ * before setting this enumerator.
+ */
+ ROOM_ACOUSTICS_ETHEREAL = 0x02010700,
+ /** A 3D voice effect that makes the voice appear to be moving around the user. The default cycle period of the 3D
+ * voice effect is 10 seconds. To change the cycle period, call \ref IRtcEngine::setAudioEffectParameters "setAudioEffectParameters"
+ * after this method.
+ *
+ * @note
+ * - Call \ref IRtcEngine::setAudioProfile "setAudioProfile" and set the `profile` parameter to `AUDIO_PROFILE_MUSIC_STANDARD_STEREO(3)`
+ * or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this enumerator; otherwise, the enumerator setting does not take effect.
+ * - If the 3D voice effect is enabled, users need to use stereo audio playback devices to hear the anticipated voice effect.
+ */
+ ROOM_ACOUSTICS_3D_VOICE = 0x02010800,
+ /** The voice of an uncle.
+ *
+ * @note
+ * - AR recommends using this enumerator to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect.
+ * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and
+ * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ VOICE_CHANGER_EFFECT_UNCLE = 0x02020100,
+ /** The voice of an old man.
+ *
+ * @note
+ * - AR recommends using this enumerator to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect.
+ * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting
+ * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting
+ * this enumerator.
+ */
+ VOICE_CHANGER_EFFECT_OLDMAN = 0x02020200,
+ /** The voice of a boy.
+ *
+ * @note
+ * - AR recommends using this enumerator to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect.
+ * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting
+ * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ VOICE_CHANGER_EFFECT_BOY = 0x02020300,
+ /** The voice of a young woman.
+ *
+ * @note
+ * - AR recommends using this enumerator to process a female-sounding voice; otherwise, you may not hear the anticipated voice effect.
+ * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting
+ * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ VOICE_CHANGER_EFFECT_SISTER = 0x02020400,
+ /** The voice of a girl.
+ *
+ * @note
+ * - AR recommends using this enumerator to process a female-sounding voice; otherwise, you may not hear the anticipated voice effect.
+ * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting
+ * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ VOICE_CHANGER_EFFECT_GIRL = 0x02020500,
+ /** The voice of Pig King, a character in Journey to the West who has a voice like a growling bear.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and
+ * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ VOICE_CHANGER_EFFECT_PIGKING = 0x02020600,
+ /** The voice of Hulk.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and
+ * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ VOICE_CHANGER_EFFECT_HULK = 0x02020700,
+ /** An audio effect typical of R&B music.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and
+ * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ STYLE_TRANSFORMATION_RNB = 0x02030100,
+ /** An audio effect typical of popular music.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and
+ * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ STYLE_TRANSFORMATION_POPULAR = 0x02030200,
+ /** A pitch correction effect that corrects the user's pitch based on the pitch of the natural C major scale.
+ * To change the basic mode and tonic pitch, call \ref IRtcEngine::setAudioEffectParameters "setAudioEffectParameters" after this method.
+ *
+ * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and
+ * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
+ * setting this enumerator.
+ */
+ PITCH_CORRECTION = 0x02040100
+};
+/** Audio codec profile types. The default value is LC_ACC. */
+enum AUDIO_CODEC_PROFILE_TYPE
+{
+ /** 0: LC-AAC, which is the low-complexity audio codec type. */
+ AUDIO_CODEC_PROFILE_LC_AAC = 0,
+ /** 1: HE-AAC, which is the high-efficiency audio codec type. */
+ AUDIO_CODEC_PROFILE_HE_AAC = 1,
+};
+
+/** Remote audio states.
+ */
+enum REMOTE_AUDIO_STATE
+{
+ /** 0: The remote audio is in the default state, probably due to
+ * #REMOTE_AUDIO_REASON_LOCAL_MUTED (3),
+ * #REMOTE_AUDIO_REASON_REMOTE_MUTED (5), or
+ * #REMOTE_AUDIO_REASON_REMOTE_OFFLINE (7).
+ */
+ REMOTE_AUDIO_STATE_STOPPED = 0, // Default state, audio is started or remote user disabled/muted audio stream
+ /** 1: The first remote audio packet is received.
+ */
+ REMOTE_AUDIO_STATE_STARTING = 1, // The first audio frame packet has been received
+ /** 2: The remote audio stream is decoded and plays normally, probably
+ * due to #REMOTE_AUDIO_REASON_NETWORK_RECOVERY (2),
+ * #REMOTE_AUDIO_REASON_LOCAL_UNMUTED (4), or
+ * #REMOTE_AUDIO_REASON_REMOTE_UNMUTED (6).
+ */
+ REMOTE_AUDIO_STATE_DECODING = 2, // The first remote audio frame has been decoded or fronzen state ends
+ /** 3: The remote audio is frozen, probably due to
+ * #REMOTE_AUDIO_REASON_NETWORK_CONGESTION (1).
+ */
+ REMOTE_AUDIO_STATE_FROZEN = 3, // Remote audio is frozen, probably due to network issue
+ /** 4: The remote audio fails to start, probably due to
+ * #REMOTE_AUDIO_REASON_INTERNAL (0).
+ */
+ REMOTE_AUDIO_STATE_FAILED = 4, // Remote audio play failed
+};
+
+/** Remote audio state reasons.
+ */
+enum REMOTE_AUDIO_STATE_REASON
+{
+ /** 0: Internal reasons.
+ */
+ REMOTE_AUDIO_REASON_INTERNAL = 0,
+ /** 1: Network congestion.
+ */
+ REMOTE_AUDIO_REASON_NETWORK_CONGESTION = 1,
+ /** 2: Network recovery.
+ */
+ REMOTE_AUDIO_REASON_NETWORK_RECOVERY = 2,
+ /** 3: The local user stops receiving the remote audio stream or
+ * disables the audio module.
+ */
+ REMOTE_AUDIO_REASON_LOCAL_MUTED = 3,
+ /** 4: The local user resumes receiving the remote audio stream or
+ * enables the audio module.
+ */
+ REMOTE_AUDIO_REASON_LOCAL_UNMUTED = 4,
+ /** 5: The remote user stops sending the audio stream or disables the
+ * audio module.
+ */
+ REMOTE_AUDIO_REASON_REMOTE_MUTED = 5,
+ /** 6: The remote user resumes sending the audio stream or enables the
+ * audio module.
+ */
+ REMOTE_AUDIO_REASON_REMOTE_UNMUTED = 6,
+ /** 7: The remote user leaves the channel.
+ */
+ REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7,
+};
+
+/** Remote video states. */
+// 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
+// /** 1: The remote video is playing. */
+// REMOTE_VIDEO_STATE_RUNNING = 1, // Running state, remote video can be displayed normally
+// /** 2: The remote video is frozen. */
+// REMOTE_VIDEO_STATE_FROZEN = 2, // Remote video is frozen, probably due to network issue.
+// };
+
+/** The state of the remote video. */
+enum REMOTE_VIDEO_STATE {
+ /** 0: The remote video is in the default state, probably due to #REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED (3), #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5), or #REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE (7).
+ */
+ REMOTE_VIDEO_STATE_STOPPED = 0,
+
+ /** 1: The first remote video packet is received.
+ */
+ REMOTE_VIDEO_STATE_STARTING = 1,
+
+ /** 2: The remote video stream is decoded and plays normally, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), #REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED (4), #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6), or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY (9).
+ */
+ REMOTE_VIDEO_STATE_DECODING = 2,
+
+ /** 3: The remote video is frozen, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION (1) or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK (8).
+ */
+ REMOTE_VIDEO_STATE_FROZEN = 3,
+
+ /** 4: The remote video fails to start, probably due to #REMOTE_VIDEO_STATE_REASON_INTERNAL (0).
+ */
+ REMOTE_VIDEO_STATE_FAILED = 4
+};
+/** The publishing state.
+ */
+enum STREAM_PUBLISH_STATE {
+ /** 0: The initial publishing state after joining the channel.
+ */
+ PUB_STATE_IDLE = 0,
+ /** 1: Fails to publish the local stream. Possible reasons:
+ * - The local user calls \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(true)" or \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(true)" to stop sending local streams.
+ * - The local user calls \ref IRtcEngine::disableAudio "disableAudio" or \ref IRtcEngine::disableVideo "disableVideo" to disable the entire audio or video module.
+ * - The local user calls \ref IRtcEngine::enableLocalAudio "enableLocalAudio(false)" or \ref IRtcEngine::enableLocalVideo "enableLocalVideo(false)" to disable the local audio sampling or video capturing.
+ * - The role of the local user is `AUDIENCE`.
+ */
+ PUB_STATE_NO_PUBLISHED = 1,
+ /** 2: Publishing.
+ */
+ PUB_STATE_PUBLISHING = 2,
+ /** 3: Publishes successfully.
+ */
+ PUB_STATE_PUBLISHED = 3
+};
+/** The subscribing state.
+ */
+enum STREAM_SUBSCRIBE_STATE {
+ /** 0: The initial subscribing state after joining the channel.
+ */
+ SUB_STATE_IDLE = 0,
+ /** 1: Fails to subscribe to the remote stream. Possible reasons:
+ * - The remote user:
+ * - Calls \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(true)" or \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(true)" to stop sending local streams.
+ * - Calls \ref IRtcEngine::disableAudio "disableAudio" or \ref IRtcEngine::disableVideo "disableVideo" to disable the entire audio or video modules.
+ * - Calls \ref IRtcEngine::enableLocalAudio "enableLocalAudio(false)" or \ref IRtcEngine::enableLocalVideo "enableLocalVideo(false)" to disable the local audio sampling or video capturing.
+ * - The role of the remote user is `AUDIENCE`.
+ * - The local user calls the following methods to stop receiving remote streams:
+ * - Calls \ref IRtcEngine::muteRemoteAudioStream "muteRemoteAudioStream(true)", \ref IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams(true)", or \ref IRtcEngine::setDefaultMuteAllRemoteAudioStreams "setDefaultMuteAllRemoteAudioStreams(true)" to stop receiving remote audio streams.
+ * - Calls \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream(true)", \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams(true)", or \ref IRtcEngine::setDefaultMuteAllRemoteVideoStreams "setDefaultMuteAllRemoteVideoStreams(true)" to stop receiving remote video streams.
+ */
+ SUB_STATE_NO_SUBSCRIBED = 1,
+ /** 2: Subscribing.
+ */
+ SUB_STATE_SUBSCRIBING = 2,
+ /** 3: Subscribes to and receives the remote stream successfully.
+ */
+ SUB_STATE_SUBSCRIBED = 3
+};
+
+/** The remote video frozen type. */
+enum XLA_REMOTE_VIDEO_FROZEN_TYPE {
+ /** 0: 500ms video frozen type.
+ */
+ XLA_REMOTE_VIDEO_FROZEN_500MS = 0,
+ /** 1: 200ms video frozen type.
+ */
+ XLA_REMOTE_VIDEO_FROZEN_200MS = 1,
+ /** 2: 600ms video frozen type.
+ */
+ XLA_REMOTE_VIDEO_FROZEN_600MS = 2,
+ /** 3: max video frozen type.
+ */
+ XLA_REMOTE_VIDEO_FROZEN_TYPE_MAX = 3,
+};
+
+/** The remote audio frozen type. */
+enum XLA_REMOTE_AUDIO_FROZEN_TYPE {
+ /** 0: 80ms audio frozen.
+ */
+ XLA_REMOTE_AUDIO_FROZEN_80MS = 0,
+ /** 1: 200ms audio frozen.
+ */
+ XLA_REMOTE_AUDIO_FROZEN_200MS = 1,
+ /** 2: max audio frozen type.
+ */
+ XLA_REMOTE_AUDIO_FROZEN_TYPE_MAX = 2,
+};
+
+/** The reason for the remote video state change. */
+enum REMOTE_VIDEO_STATE_REASON {
+ /** 0: The SDK reports this reason when the video state changes.
+ */
+ REMOTE_VIDEO_STATE_REASON_INTERNAL = 0,
+
+ /** 1: Network congestion.
+ */
+ REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION = 1,
+
+ /** 2: Network recovery.
+ */
+ REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY = 2,
+
+ /** 3: The local user stops receiving the remote video stream or disables the video module.
+ */
+ REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED = 3,
+
+ /** 4: The local user resumes receiving the remote video stream or enables the video module.
+ */
+ REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED = 4,
+
+ /** 5: The remote user stops sending the video stream or disables the video module.
+ */
+ REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED = 5,
+
+ /** 6: The remote user resumes sending the video stream or enables the video module.
+ */
+ REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED = 6,
+
+ /** 7: The remote user leaves the channel.
+ */
+ REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE = 7,
+
+ /** 8: The remote audio-and-video stream falls back to the audio-only stream due to poor network conditions.
+ */
+ REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK = 8,
+
+ /** 9: The remote audio-only stream switches back to the audio-and-video stream after the network conditions improve.
+ */
+ REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY = 9
+
+};
+
+/** Video frame rates. */
+enum FRAME_RATE
+{
+ /** 1: 1 fps */
+ FRAME_RATE_FPS_1 = 1,
+ /** 7: 7 fps */
+ FRAME_RATE_FPS_7 = 7,
+ /** 10: 10 fps */
+ FRAME_RATE_FPS_10 = 10,
+ /** 15: 15 fps */
+ FRAME_RATE_FPS_15 = 15,
+ /** 24: 24 fps */
+ FRAME_RATE_FPS_24 = 24,
+ /** 30: 30 fps */
+ FRAME_RATE_FPS_30 = 30,
+ /** 60: 60 fps (Windows and macOS only) */
+ FRAME_RATE_FPS_60 = 60,
+};
+
+/** Video output orientation modes.
+ */
+enum ORIENTATION_MODE {
+ /** 0: (Default) Adaptive mode.
+
+ The video encoder adapts to the orientation mode of the video input device.
+
+ - If the width of the captured video from the SDK is greater than the height, the encoder sends the video in landscape mode. The encoder also sends the rotational information of the video, and the receiver uses the rotational information to rotate the received video.
+ - When you use a custom video source, the output video from the encoder inherits the orientation of the original video. If the original video is in portrait mode, the output video from the encoder is also in portrait mode. The encoder also sends the rotational information of the video to the receiver.
+ */
+ ORIENTATION_MODE_ADAPTIVE = 0,
+ /** 1: Landscape mode.
+
+ The video encoder always sends the video in landscape mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming.
+ */
+ ORIENTATION_MODE_FIXED_LANDSCAPE = 1,
+ /** 2: Portrait mode.
+
+ The video encoder always sends the video in portrait mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming.
+ */
+ ORIENTATION_MODE_FIXED_PORTRAIT = 2,
+};
+
+/** Video degradation preferences when the bandwidth is a constraint. */
+enum DEGRADATION_PREFERENCE {
+ /** 0: (Default) Degrade the frame rate in order to maintain the video quality. */
+ MAINTAIN_QUALITY = 0,
+ /** 1: Degrade the video quality in order to maintain the frame rate. */
+ MAINTAIN_FRAMERATE = 1,
+ /** 2: (For future use) Maintain a balance between the frame rate and video quality. */
+ MAINTAIN_BALANCED = 2,
+};
+
+/** Stream fallback options. */
+enum STREAM_FALLBACK_OPTIONS
+{
+ /** 0: No fallback behavior for the local/remote video stream when the uplink/downlink network conditions are poor. The quality of the stream is not guaranteed. */
+ STREAM_FALLBACK_OPTION_DISABLED = 0,
+ /** 1: Under poor downlink network conditions, the remote video stream, to which you subscribe, falls back to the low-stream (low resolution and low bitrate) video. You can set this option only in the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. Nothing happens when you set this in the \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" method. */
+ STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW = 1,
+ /** 2: Under poor uplink network conditions, the published video stream falls back to audio only.
+
+ Under poor downlink network conditions, the remote video stream, to which you subscribe, first falls back to the low-stream (low resolution and low bitrate) video; and then to an audio-only stream if the network conditions worsen.*/
+ STREAM_FALLBACK_OPTION_AUDIO_ONLY = 2,
+};
+
+ /** Camera capturer configuration.
+ */
+ enum CAPTURER_OUTPUT_PREFERENCE
+ {
+ /** 0: (Default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality.
+ */
+ CAPTURER_OUTPUT_PREFERENCE_AUTO = 0,
+ /** 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration".
+ */
+ CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1,
+ /** 2: Prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing.
+ */
+ CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2,
+ /** 3: Allows you to customize the width and height of the video image captured by the local camera.
+ *
+ * @since v3.3.0
+ */
+ CAPTURER_OUTPUT_PREFERENCE_MANUAL = 3,
+ };
+
+/** The priority of the remote user.
+ */
+enum PRIORITY_TYPE
+{
+ /** 50: The user's priority is high.
+ */
+ PRIORITY_HIGH = 50,
+ /** 100: (Default) The user's priority is normal.
+ */
+ PRIORITY_NORMAL = 100,
+};
+
+/** Connection states. */
+enum CONNECTION_STATE_TYPE
+{
+ /** 1: The SDK is disconnected from AR's edge server.
+
+ - This is the initial state before calling the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method.
+ - The SDK also enters this state when the application calls the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method.
+ */
+ CONNECTION_STATE_DISCONNECTED = 1,
+ /** 2: The SDK is connecting to AR's edge server.
+
+ - When the application calls the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method, the SDK starts to establish a connection to the specified channel, triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, and switches to the #CONNECTION_STATE_CONNECTING state.
+ - When the SDK successfully joins the channel, it triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_CONNECTED state.
+ - After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback.
+ */
+ CONNECTION_STATE_CONNECTING = 2,
+ /** 3: The SDK is connected to AR's edge server and has joined a channel. You can now publish or subscribe to a media stream in the channel.
+
+ If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers:
+ - The \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback (deprecated).
+ - The \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_RECONNECTING state.
+ */
+ CONNECTION_STATE_CONNECTED = 3,
+ /** 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues.
+
+ - If the SDK cannot rejoin the channel within 10 seconds after being disconnected from AR's edge server, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback, stays in the #CONNECTION_STATE_RECONNECTING state, and keeps rejoining the channel.
+ - If the SDK fails to rejoin the channel 20 minutes after being disconnected from AR's edge server, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, switches to the #CONNECTION_STATE_FAILED state, and stops rejoining the channel.
+ */
+ CONNECTION_STATE_RECONNECTING = 4,
+ /** 5: The SDK fails to connect to AR's edge server or join the channel.
+
+ You must call the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method to leave this state, and call the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method again to rejoin the channel.
+
+ If the SDK is banned from joining the channel by AR's edge server (through the RESTful API), the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionBanned "onConnectionBanned" (deprecated) and \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callbacks.
+ */
+ CONNECTION_STATE_FAILED = 5,
+};
+
+/** Reasons for a connection state change. */
+enum CONNECTION_CHANGED_REASON_TYPE
+{
+ /** 0: The SDK is connecting to AR's edge server. */
+ CONNECTION_CHANGED_CONNECTING = 0,
+ /** 1: The SDK has joined the channel successfully. */
+ CONNECTION_CHANGED_JOIN_SUCCESS = 1,
+ /** 2: The connection between the SDK and AR's edge server is interrupted. */
+ CONNECTION_CHANGED_INTERRUPTED = 2,
+ /** 3: The connection between the SDK and AR's edge server is banned by AR's edge server. */
+ CONNECTION_CHANGED_BANNED_BY_SERVER = 3,
+ /** 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. */
+ CONNECTION_CHANGED_JOIN_FAILED = 4,
+ /** 5: The SDK has left the channel. */
+ CONNECTION_CHANGED_LEAVE_CHANNEL = 5,
+ /** 6: The connection failed since Appid is not valid. */
+ CONNECTION_CHANGED_INVALID_APP_ID = 6,
+ /** 7: The connection failed since channel name is not valid. */
+ CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7,
+ /** 8: The connection failed since token is not valid, possibly because:
+
+ - The App Certificate for the project is enabled in Console, but you do not use Token when joining the channel. If you enable the App Certificate, you must use a token to join the channel.
+ - The uid that you specify in the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method is different from the uid that you pass for generating the token.
+ */
+ CONNECTION_CHANGED_INVALID_TOKEN = 8,
+ /** 9: The connection failed since token is expired. */
+ CONNECTION_CHANGED_TOKEN_EXPIRED = 9,
+ /** 10: The connection is rejected by server. This error usually occurs in the following situations:
+ * - When the user is already in the channel, and still calls the method to join the channel, for example,
+ * \ref IRtcEngine::joinChannel "joinChannel".
+ * - When the user tries to join a channel during \ref IRtcEngine::startEchoTest "startEchoTest". Once you
+ * call \ref IRtcEngine::startEchoTest "startEchoTest", you need to call \ref IRtcEngine::stopEchoTest "stopEchoTest" before joining a channel.
+ *
+ */
+ CONNECTION_CHANGED_REJECTED_BY_SERVER = 10,
+ /** 11: The connection changed to reconnecting since SDK has set a proxy server. */
+ CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11,
+ /** 12: When SDK is in connection failed, the renew token operation will make it connecting. */
+ CONNECTION_CHANGED_RENEW_TOKEN = 12,
+ /** 13: The IP Address of SDK client has changed. i.e., Network type or IP/Port changed by network operator might change client IP address. */
+ CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13,
+ /** 14: Timeout for the keep-alive of the connection between the SDK and AR's edge server. The connection state changes to CONNECTION_STATE_RECONNECTING(4). */
+ CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14,
+};
+
+/** Network type. */
+enum NETWORK_TYPE
+{
+ /** -1: The network type is unknown. */
+ NETWORK_TYPE_UNKNOWN = -1,
+ /** 0: The SDK disconnects from the network. */
+ NETWORK_TYPE_DISCONNECTED = 0,
+ /** 1: The network type is LAN. */
+ NETWORK_TYPE_LAN = 1,
+ /** 2: The network type is Wi-Fi(including hotspots). */
+ NETWORK_TYPE_WIFI = 2,
+ /** 3: The network type is mobile 2G. */
+ NETWORK_TYPE_MOBILE_2G = 3,
+ /** 4: The network type is mobile 3G. */
+ NETWORK_TYPE_MOBILE_3G = 4,
+ /** 5: The network type is mobile 4G. */
+ NETWORK_TYPE_MOBILE_4G = 5,
+};
+
+/** States of the last-mile network probe test. */
+enum LASTMILE_PROBE_RESULT_STATE {
+ /** 1: The last-mile network probe test is complete. */
+ LASTMILE_PROBE_RESULT_COMPLETE = 1,
+ /** 2: The last-mile network probe test is incomplete and the bandwidth estimation is not available, probably due to limited test resources. */
+ LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE = 2,
+ /** 3: The last-mile network probe test is not carried out, probably due to poor network conditions. */
+ LASTMILE_PROBE_RESULT_UNAVAILABLE = 3
+};
+/** Audio output routing. */
+enum AUDIO_ROUTE_TYPE {
+ /** Default.
+ */
+ AUDIO_ROUTE_DEFAULT = -1,
+ /** Headset.
+ */
+ AUDIO_ROUTE_HEADSET = 0,
+ /** Earpiece.
+ */
+ AUDIO_ROUTE_EARPIECE = 1,
+ /** Headset with no microphone.
+ */
+ AUDIO_ROUTE_HEADSET_NO_MIC = 2,
+ /** Speakerphone.
+ */
+ AUDIO_ROUTE_SPEAKERPHONE = 3,
+ /** Loudspeaker.
+ */
+ AUDIO_ROUTE_LOUDSPEAKER = 4,
+ /** Bluetooth headset.
+ */
+ AUDIO_ROUTE_BLUETOOTH = 5,
+ /** USB peripheral.
+ */
+ AUDIO_ROUTE_USB = 6,
+ /** HDMI peripheral.
+ */
+ AUDIO_ROUTE_HDMI = 7,
+ /** DisplayPort peripheral.
+ */
+ AUDIO_ROUTE_DISPLAYPORT = 8,
+ /** Apple AirPlay.
+ */
+ AUDIO_ROUTE_AIRPLAY = 9,
+};
+
+#if (defined(__APPLE__) && TARGET_OS_IOS)
+/** Audio session restriction. */
+enum AUDIO_SESSION_OPERATION_RESTRICTION {
+ /** No restriction, the SDK has full control of the audio session operations. */
+ AUDIO_SESSION_OPERATION_RESTRICTION_NONE = 0,
+ /** The SDK does not change the audio session category. */
+ AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY = 1,
+ /** The SDK does not change any setting of the audio session (category, mode, categoryOptions). */
+ AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION = 1 << 1,
+ /** The SDK keeps the audio session active when leaving a channel. */
+ AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION = 1 << 2,
+ /** The SDK does not configure the audio session anymore. */
+ AUDIO_SESSION_OPERATION_RESTRICTION_ALL = 1 << 7,
+};
+#endif
+
+#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS)
+enum CAMERA_DIRECTION {
+ /** The rear camera. */
+ CAMERA_REAR = 0,
+ /** The front camera. */
+ CAMERA_FRONT = 1,
+};
+#endif
+
+/** The uplink or downlink last-mile network probe test result. */
+struct LastmileProbeOneWayResult {
+ /** The packet loss rate (%). */
+ unsigned int packetLossRate;
+ /** The network jitter (ms). */
+ unsigned int jitter;
+ /* The estimated available bandwidth (bps). */
+ unsigned int availableBandwidth;
+};
+
+/** The uplink and downlink last-mile network probe test result. */
+struct LastmileProbeResult{
+ /** The state of the probe test. */
+ LASTMILE_PROBE_RESULT_STATE state;
+ /** The uplink last-mile network probe test result. */
+ LastmileProbeOneWayResult uplinkReport;
+ /** The downlink last-mile network probe test result. */
+ LastmileProbeOneWayResult downlinkReport;
+ /** The round-trip delay time (ms). */
+ unsigned int rtt;
+};
+
+/** Configurations of the last-mile network probe test. */
+struct LastmileProbeConfig {
+ /** Sets whether or not to test the uplink network. Some users, for example, the audience in a `LIVE_BROADCASTING` channel, do not need such a test:
+ - true: test.
+ - false: do not test. */
+ bool probeUplink;
+ /** Sets whether or not to test the downlink network:
+ - true: test.
+ - false: do not test. */
+ bool probeDownlink;
+ /** The expected maximum sending bitrate (bps) of the local user. The value ranges between 100000 and 5000000. We recommend setting this parameter according to the bitrate value set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration". */
+ unsigned int expectedUplinkBitrate;
+ /** The expected maximum receiving bitrate (bps) of the local user. The value ranges between 100000 and 5000000. */
+ unsigned int expectedDownlinkBitrate;
+};
+
+/** Properties of the audio volume information.
+
+ An array containing the user ID and volume information for each speaker.
+ */
+struct AudioVolumeInfo
+{
+ /**
+ User ID of the speaker. The uid of the local user is 0.
+ */
+ uid_t uid;
+ /** The volume of the speaker. The volume ranges between 0 (lowest volume) and 255 (highest volume).
+ */
+ unsigned int volume;
+ /** Voice activity status of the local user.
+ * - 0: The local user is not speaking.
+ * - 1: The local user is speaking.
+ *
+ * @note
+ * - The `vad` parameter cannot report the voice activity status of the remote users. In the remote users' callback, `vad` = 0.
+ * - Ensure that you set `report_vad`(true) in the \ref ar::rtc::IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method to enable the voice activity detection of the local user.
+ */
+ unsigned int vad;
+ /** The channel ID, which indicates which channel the speaker is in.
+ */
+ const char * channelId;
+};
+/// @cond
+/** The detailed options of a user.
+ */
+struct ClientRoleOptions
+{
+ /** The latency level of an audience member in a live interactive streaming. See #AUDIENCE_LATENCY_LEVEL_TYPE.
+ */
+ AUDIENCE_LATENCY_LEVEL_TYPE audienceLatencyLevel;
+ ClientRoleOptions()
+ : audienceLatencyLevel(AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY) {}
+};
+/// @endcond
+/** Statistics of the channel.
+ */
+struct RtcStats
+{
+ /**
+ Call duration (s), represented by an aggregate value.
+ */
+ unsigned int duration;
+ /**
+ Total number of bytes transmitted, represented by an aggregate value.
+ */
+ unsigned int txBytes;
+ /**
+ Total number of bytes received, represented by an aggregate value.
+ */
+ unsigned int rxBytes;
+ /** Total number of audio bytes sent (bytes), represented
+ * by an aggregate value.
+ */
+ unsigned int txAudioBytes;
+ /** Total number of video bytes sent (bytes), represented
+ * by an aggregate value.
+ */
+ unsigned int txVideoBytes;
+ /** Total number of audio bytes received (bytes) before
+ * network countermeasures, represented by an aggregate value.
+ */
+ unsigned int rxAudioBytes;
+ /** Total number of video bytes received (bytes),
+ * represented by an aggregate value.
+ */
+ unsigned int rxVideoBytes;
+
+ /**
+ Transmission bitrate (Kbps), represented by an instantaneous value.
+ */
+ unsigned short txKBitRate;
+ /**
+ Receive bitrate (Kbps), represented by an instantaneous value.
+ */
+ unsigned short rxKBitRate;
+ /**
+ Audio receive bitrate (Kbps), represented by an instantaneous value.
+ */
+ unsigned short rxAudioKBitRate;
+ /**
+ Audio transmission bitrate (Kbps), represented by an instantaneous value.
+ */
+ unsigned short txAudioKBitRate;
+ /**
+ Video receive bitrate (Kbps), represented by an instantaneous value.
+ */
+ unsigned short rxVideoKBitRate;
+ /**
+ Video transmission bitrate (Kbps), represented by an instantaneous value.
+ */
+ unsigned short txVideoKBitRate;
+ /** Client-server latency (ms)
+ */
+ unsigned short lastmileDelay;
+ /** The packet loss rate (%) from the local client to AR's edge server,
+ * before using the anti-packet-loss method.
+ */
+ unsigned short txPacketLossRate;
+ /** The packet loss rate (%) from AR's edge server to the local client,
+ * before using the anti-packet-loss method.
+ */
+ unsigned short rxPacketLossRate;
+ /** Number of users in the channel.
+
+ - Communication profile: The number of users in the channel.
+ - Live broadcast profile:
+
+ - If the local user is an audience: The number of users in the channel = The number of hosts in the channel + 1.
+ - If the user is a host: The number of users in the channel = The number of hosts in the channel.
+ */
+ unsigned int userCount;
+ /**
+ Application CPU usage (%).
+ */
+ double cpuAppUsage;
+ /**
+ System CPU usage (%).
+ */
+ double cpuTotalUsage;
+ /** The round-trip time delay from the client to the local router.
+ */
+ int gatewayRtt;
+ /**
+ The memory usage ratio of the app (%).
+ @note This value is for reference only. Due to system limitations, you may not get the value of this member.
+ */
+ double memoryAppUsageRatio;
+ /**
+ The memory usage ratio of the system (%).
+ @note This value is for reference only. Due to system limitations, you may not get the value of this member.
+ */
+ double memoryTotalUsageRatio;
+ /**
+ The memory usage of the app (KB).
+ @note This value is for reference only. Due to system limitations, you may not get the value of this member.
+ */
+ int memoryAppUsageInKbytes;
+ RtcStats()
+ : duration(0)
+ , txBytes(0)
+ , rxBytes(0)
+ , txAudioBytes(0)
+ , txVideoBytes(0)
+ , rxAudioBytes(0)
+ , rxVideoBytes(0)
+ , txKBitRate(0)
+ , rxKBitRate(0)
+ , rxAudioKBitRate(0)
+ , txAudioKBitRate(0)
+ , rxVideoKBitRate(0)
+ , txVideoKBitRate(0)
+ , lastmileDelay(0)
+ , txPacketLossRate(0)
+ , rxPacketLossRate(0)
+ , userCount(0)
+ , cpuAppUsage(0)
+ , cpuTotalUsage(0)
+ , gatewayRtt(0)
+ , memoryAppUsageRatio(0)
+ , memoryTotalUsageRatio(0)
+ , memoryAppUsageInKbytes(0) {}
+};
+
+/** Quality change of the local video in terms of target frame rate and target bit rate since last count.
+ */
+enum QUALITY_ADAPT_INDICATION {
+ /** The quality of the local video stays the same. */
+ ADAPT_NONE = 0,
+ /** The quality improves because the network bandwidth increases. */
+ ADAPT_UP_BANDWIDTH = 1,
+ /** The quality worsens because the network bandwidth decreases. */
+ ADAPT_DOWN_BANDWIDTH = 2,
+};
+
+/** The error code in CHANNEL_MEDIA_RELAY_ERROR. */
+enum CHANNEL_MEDIA_RELAY_ERROR {
+ /** 0: The state is normal.
+ */
+ RELAY_OK = 0,
+ /** 1: An error occurs in the server response.
+ */
+ RELAY_ERROR_SERVER_ERROR_RESPONSE = 1,
+ /** 2: No server response. You can call the
+ * \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method to
+ * leave the channel.
+ */
+ RELAY_ERROR_SERVER_NO_RESPONSE = 2,
+ /** 3: The SDK fails to access the service, probably due to limited
+ * resources of the server.
+ */
+ RELAY_ERROR_NO_RESOURCE_AVAILABLE = 3,
+ /** 4: Fails to send the relay request.
+ */
+ RELAY_ERROR_FAILED_JOIN_SRC = 4,
+ /** 5: Fails to accept the relay request.
+ */
+ RELAY_ERROR_FAILED_JOIN_DEST = 5,
+ /** 6: The server fails to receive the media stream.
+ */
+ RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC = 6,
+ /** 7: The server fails to send the media stream.
+ */
+ RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST = 7,
+ /** 8: The SDK disconnects from the server due to poor network
+ * connections. You can call the \ref ar::rtc::IRtcEngine::leaveChannel
+ * "leaveChannel" method to leave the channel.
+ */
+ RELAY_ERROR_SERVER_CONNECTION_LOST = 8,
+ /** 9: An internal error occurs in the server.
+ */
+ RELAY_ERROR_INTERNAL_ERROR = 9,
+ /** 10: The token of the source channel has expired.
+ */
+ RELAY_ERROR_SRC_TOKEN_EXPIRED = 10,
+ /** 11: The token of the destination channel has expired.
+ */
+ RELAY_ERROR_DEST_TOKEN_EXPIRED = 11,
+};
+
+/** The event code in CHANNEL_MEDIA_RELAY_EVENT. */
+enum CHANNEL_MEDIA_RELAY_EVENT {
+ /** 0: The user disconnects from the server due to poor network
+ * connections.
+ */
+ RELAY_EVENT_NETWORK_DISCONNECTED = 0,
+ /** 1: The network reconnects.
+ */
+ RELAY_EVENT_NETWORK_CONNECTED = 1,
+ /** 2: The user joins the source channel.
+ */
+ RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL = 2,
+ /** 3: The user joins the destination channel.
+ */
+ RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL = 3,
+ /** 4: The SDK starts relaying the media stream to the destination channel.
+ */
+ RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL = 4,
+ /** 5: The server receives the video stream from the source channel.
+ */
+ RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC = 5,
+ /** 6: The server receives the audio stream from the source channel.
+ */
+ RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC = 6,
+ /** 7: The destination channel is updated.
+ */
+ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL = 7,
+ /** 8: The destination channel update fails due to internal reasons.
+ */
+ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED = 8,
+ /** 9: The destination channel does not change, which means that the
+ * destination channel fails to be updated.
+ */
+ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE = 9,
+ /** 10: The destination channel name is NULL.
+ */
+ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL = 10,
+ /** 11: The video profile is sent to the server.
+ */
+ RELAY_EVENT_VIDEO_PROFILE_UPDATE = 11,
+};
+
+/** The state code in CHANNEL_MEDIA_RELAY_STATE. */
+enum CHANNEL_MEDIA_RELAY_STATE {
+ /** 0: The SDK is initializing.
+ */
+ RELAY_STATE_IDLE = 0,
+ /** 1: The SDK tries to relay the media stream to the destination channel.
+ */
+ RELAY_STATE_CONNECTING = 1,
+ /** 2: The SDK successfully relays the media stream to the destination
+ * channel.
+ */
+ RELAY_STATE_RUNNING = 2,
+ /** 3: A failure occurs. See the details in code.
+ */
+ RELAY_STATE_FAILURE = 3,
+};
+
+/** Statistics of the local video stream.
+ */
+struct LocalVideoStats
+{
+ /** Bitrate (Kbps) sent in the reported interval, which does not include
+ * the bitrate of the retransmission video after packet loss.
+ */
+ int sentBitrate;
+ /** Frame rate (fps) sent in the reported interval, which does not include
+ * the frame rate of the retransmission video after packet loss.
+ */
+ int sentFrameRate;
+ /** The encoder output frame rate (fps) of the local video.
+ */
+ int encoderOutputFrameRate;
+ /** The render output frame rate (fps) of the local video.
+ */
+ int rendererOutputFrameRate;
+ /** The target bitrate (Kbps) of the current encoder. This value is estimated by the SDK based on the current network conditions.
+ */
+ int targetBitrate;
+ /** The target frame rate (fps) of the current encoder.
+ */
+ int targetFrameRate;
+ /** Quality change of the local video in terms of target frame rate and
+ * target bit rate in this reported interval. See #QUALITY_ADAPT_INDICATION.
+ */
+ QUALITY_ADAPT_INDICATION qualityAdaptIndication;
+ /** The encoding bitrate (Kbps), which does not include the bitrate of the
+ * re-transmission video after packet loss.
+ */
+ int encodedBitrate;
+ /** The width of the encoding frame (px).
+ */
+ int encodedFrameWidth;
+ /** The height of the encoding frame (px).
+ */
+ int encodedFrameHeight;
+ /** The value of the sent frames, represented by an aggregate value.
+ */
+ int encodedFrameCount;
+ /** The codec type of the local video:
+ * - VIDEO_CODEC_VP8 = 1: VP8.
+ * - VIDEO_CODEC_H264 = 2: (Default) H.264.
+ */
+ VIDEO_CODEC_TYPE codecType;
+ /** The video packet loss rate (%) from the local client to the AR edge server before applying the anti-packet loss strategies.
+ */
+ unsigned short txPacketLossRate;
+ /** The capture frame rate (fps) of the local video.
+ */
+ int captureFrameRate;
+};
+
+/** Statistics of the remote video stream.
+ */
+struct RemoteVideoStats
+{
+/**
+ User ID of the remote user sending the video streams.
+ */
+uid_t uid;
+/** **DEPRECATED** Time delay (ms).
+ *
+ * In scenarios where audio and video is synchronized, you can use the value of
+ * `networkTransportDelay` and `jitterBufferDelay` in `RemoteAudioStats` to know the delay statistics of the remote video.
+ */
+int delay;
+/** Width (pixels) of the video stream.
+ */
+int width;
+/**
+ Height (pixels) of the video stream.
+ */
+int height;
+/**
+ Bitrate (Kbps) received since the last count.
+ */
+int receivedBitrate;
+/** The decoder output frame rate (fps) of the remote video.
+ */
+int decoderOutputFrameRate;
+/** The render output frame rate (fps) of the remote video.
+ */
+int rendererOutputFrameRate;
+/** Packet loss rate (%) of the remote video stream after using the anti-packet-loss method.
+ */
+int packetLossRate;
+/** The type of the remote video stream: #REMOTE_VIDEO_STREAM_TYPE
+ */
+REMOTE_VIDEO_STREAM_TYPE rxStreamType;
+/**
+ The total freeze time (ms) of the remote video stream after the remote user joins the channel.
+ In a video session where the frame rate is set to no less than 5 fps, video freeze occurs when
+ the time interval between two adjacent renderable video frames is more than 500 ms.
+ */
+int totalFrozenTime;
+/**
+ The total video freeze time as a percentage (%) of the total time when the video is available.
+ */
+int frozenRate;
+/**
+ The total time (ms) when the remote user in the Communication profile or the remote
+ broadcaster in the Live-broadcast profile neither stops sending the video stream nor
+ disables the video module after joining the channel.
+
+ @since v3.0.1
+*/
+int totalActiveTime;
+/**
+ * The total publish duration (ms) of the remote video stream.
+ */
+int publishDuration;
+};
+
+/** Audio statistics of the local user */
+struct LocalAudioStats
+{
+ /** The number of channels.
+ */
+ int numChannels;
+ /** The sample rate (Hz).
+ */
+ int sentSampleRate;
+ /** The average sending bitrate (Kbps).
+ */
+ int sentBitrate;
+ /** The audio packet loss rate (%) from the local client to the AR edge server before applying the anti-packet loss strategies.
+ */
+ unsigned short txPacketLossRate;
+};
+
+/** Audio statistics of a remote user */
+struct RemoteAudioStats
+{
+ /** User ID of the remote user sending the audio streams.
+ *
+ */
+ uid_t uid;
+ /** Audio quality received by the user: #QUALITY_TYPE.
+ */
+ int quality;
+ /** Network delay (ms) from the sender to the receiver.
+ */
+ int networkTransportDelay;
+ /** Network delay (ms) from the receiver to the jitter buffer.
+ */
+ int jitterBufferDelay;
+ /** The audio frame loss rate in the reported interval.
+ */
+ int audioLossRate;
+ /** The number of channels.
+ */
+ int numChannels;
+ /** The sample rate (Hz) of the received audio stream in the reported
+ * interval.
+ */
+ int receivedSampleRate;
+ /** The average bitrate (Kbps) of the received audio stream in the
+ * reported interval. */
+ int receivedBitrate;
+ /** The total freeze time (ms) of the remote audio stream after the remote user joins the channel. In a session, audio freeze occurs when the audio frame loss rate reaches 4%.
+ */
+ int totalFrozenTime;
+ /** The total audio freeze time as a percentage (%) of the total time when the audio is available. */
+ int frozenRate;
+ /** The total time (ms) when the remote user in the `COMMUNICATION` profile or the remote host in
+ the `LIVE_BROADCASTING` profile neither stops sending the audio stream nor disables the audio module after joining the channel.
+ */
+ int totalActiveTime;
+ /**
+ * The total publish duration (ms) of the remote audio stream.
+ */
+ int publishDuration;
+ /**
+ * Quality of experience (QoE) of the local user when receiving a remote audio stream. See #EXPERIENCE_QUALITY_TYPE.
+ *
+ * @since v3.3.0
+ */
+ int qoeQuality;
+ /**
+ * The reason for poor QoE of the local user when receiving a remote audio stream. See #EXPERIENCE_POOR_REASON.
+ *
+ * @since v3.3.0
+ */
+ int qualityChangedReason;
+ /**
+ * The mos value of remote audio.
+ */
+ int mosValue;
+};
+
+/**
+ * Video dimensions.
+ */
+struct VideoDimensions {
+ /** Width (pixels) of the video. */
+ int width;
+ /** Height (pixels) of the video. */
+ int height;
+ VideoDimensions()
+ : width(640), height(480)
+ {}
+ VideoDimensions(int w, int h)
+ : width(w), height(h)
+ {}
+};
+
+/** (Recommended) The standard bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method.
+
+ In this mode, the bitrates differ between the live interactive streaming and communication profiles:
+
+ - `COMMUNICATION` profile: The video bitrate is the same as the base bitrate.
+ - `LIVE_BROADCASTING` profile: The video bitrate is twice the base bitrate.
+
+ */
+const int STANDARD_BITRATE = 0;
+
+/** The compatible bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method.
+
+ The bitrate remains the same regardless of the channel profile. If you choose this mode in the Live-broadcast profile, the video frame rate may be lower than the set value.
+ */
+const int COMPATIBLE_BITRATE = -1;
+
+/** Use the default minimum bitrate.
+ */
+const int DEFAULT_MIN_BITRATE = -1;
+
+/** Video encoder configurations.
+ */
+struct VideoEncoderConfiguration {
+ /** The video frame dimensions (px) used to specify the video quality and measured by the total number of pixels along a frame's width and height: VideoDimensions. The default value is 640 x 360.
+ */
+ VideoDimensions dimensions;
+ /** The frame rate of the video: #FRAME_RATE. The default value is 15.
+
+ Note that we do not recommend setting this to a value greater than 30.
+ */
+ FRAME_RATE frameRate;
+ /** The minimum frame rate of the video. The default value is -1.
+ */
+ int minFrameRate;
+ /** The video encoding bitrate (Kbps).
+
+ Choose one of the following options:
+
+ - #STANDARD_BITRATE: (Recommended) The standard bitrate.
+ - the `COMMUNICATION` profile: the encoding bitrate equals the base bitrate.
+ - the `LIVE_BROADCASTING` profile: the encoding bitrate is twice the base bitrate.
+ - #COMPATIBLE_BITRATE: The compatible bitrate: the bitrate stays the same regardless of the profile.
+
+ the `COMMUNICATION` profile prioritizes smoothness, while the `LIVE_BROADCASTING` profile prioritizes video quality (requiring a higher bitrate). We recommend setting the bitrate mode as #STANDARD_BITRATE to address this difference.
+
+ The following table lists the recommended video encoder configurations, where the base bitrate applies to the `COMMUNICATION` profile. Set your bitrate based on this table. If you set a bitrate beyond the proper range, the SDK automatically sets it to within the range.
+
+ @note
+ In the following table, **Base Bitrate** applies to the `COMMUNICATION` profile, and **Live Bitrate** applies to the `LIVE_BROADCASTING` profile.
+
+ | Resolution | Frame Rate (fps) | Base Bitrate (Kbps) | Live Bitrate (Kbps) |
+ |------------------------|------------------|----------------------------------------|----------------------------------------|
+ | 160 * 120 | 15 | 65 | 130 |
+ | 120 * 120 | 15 | 50 | 100 |
+ | 320 * 180 | 15 | 140 | 280 |
+ | 180 * 180 | 15 | 100 | 200 |
+ | 240 * 180 | 15 | 120 | 240 |
+ | 320 * 240 | 15 | 200 | 400 |
+ | 240 * 240 | 15 | 140 | 280 |
+ | 424 * 240 | 15 | 220 | 440 |
+ | 640 * 360 | 15 | 400 | 800 |
+ | 360 * 360 | 15 | 260 | 520 |
+ | 640 * 360 | 30 | 600 | 1200 |
+ | 360 * 360 | 30 | 400 | 800 |
+ | 480 * 360 | 15 | 320 | 640 |
+ | 480 * 360 | 30 | 490 | 980 |
+ | 640 * 480 | 15 | 500 | 1000 |
+ | 480 * 480 | 15 | 400 | 800 |
+ | 640 * 480 | 30 | 750 | 1500 |
+ | 480 * 480 | 30 | 600 | 1200 |
+ | 848 * 480 | 15 | 610 | 1220 |
+ | 848 * 480 | 30 | 930 | 1860 |
+ | 640 * 480 | 10 | 400 | 800 |
+ | 1280 * 720 | 15 | 1130 | 2260 |
+ | 1280 * 720 | 30 | 1710 | 3420 |
+ | 960 * 720 | 15 | 910 | 1820 |
+ | 960 * 720 | 30 | 1380 | 2760 |
+ | 1920 * 1080 | 15 | 2080 | 4160 |
+ | 1920 * 1080 | 30 | 3150 | 6300 |
+ | 1920 * 1080 | 60 | 4780 | 6500 |
+ | 2560 * 1440 | 30 | 4850 | 6500 |
+ | 2560 * 1440 | 60 | 6500 | 6500 |
+ | 3840 * 2160 | 30 | 6500 | 6500 |
+ | 3840 * 2160 | 60 | 6500 | 6500 |
+
+ */
+ int bitrate;
+ /** The minimum encoding bitrate (Kbps).
+
+ The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. That said, unless you have special requirements for image quality, AR does not recommend changing this value.
+
+ @note This parameter applies only to the `LIVE_BROADCASTING` profile.
+ */
+ int minBitrate;
+ /** The video orientation mode of the video: #ORIENTATION_MODE.
+ */
+ ORIENTATION_MODE orientationMode;
+ /** The video encoding degradation preference under limited bandwidth: #DEGRADATION_PREFERENCE.
+ */
+ DEGRADATION_PREFERENCE degradationPreference;
+ /** Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See #VIDEO_MIRROR_MODE_TYPE
+
+ @note: The SDK disables the mirror mode by default.
+ */
+ VIDEO_MIRROR_MODE_TYPE mirrorMode;
+
+ VideoEncoderConfiguration(
+ const VideoDimensions& d, FRAME_RATE f,
+ int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO)
+ : dimensions(d), frameRate(f), minFrameRate(-1), bitrate(b),
+ minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m),
+ degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr)
+ {}
+ VideoEncoderConfiguration(
+ int width, int height, FRAME_RATE f,
+ int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO)
+ : dimensions(width, height), frameRate(f),
+ minFrameRate(-1), bitrate(b),
+ minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m),
+ degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr)
+ {}
+ VideoEncoderConfiguration()
+ : dimensions(640, 480)
+ , frameRate(FRAME_RATE_FPS_15)
+ , minFrameRate(-1)
+ , bitrate(STANDARD_BITRATE)
+ , minBitrate(DEFAULT_MIN_BITRATE)
+ , orientationMode(ORIENTATION_MODE_ADAPTIVE)
+ , degradationPreference(MAINTAIN_QUALITY)
+ , mirrorMode(VIDEO_MIRROR_MODE_AUTO)
+ {}
+};
+
+/** The video and audio properties of the user displaying the video in the CDN live. AR supports a maximum of 17 transcoding users in a CDN streaming channel.
+*/
+typedef struct TranscodingUser {
+ /** User ID of the user displaying the video in the CDN live.
+ */
+ uid_t uid;
+
+/** Horizontal position (pixel) of the video frame relative to the top left corner.
+*/
+ int x;
+ /** Vertical position (pixel) of the video frame relative to the top left corner.
+ */
+ int y;
+ /** Width (pixel) of the video frame. The default value is 360.
+ */
+ int width;
+ /** Height (pixel) of the video frame. The default value is 640.
+ */
+ int height;
+
+ /** The layer index of the video frame. An integer. The value range is [0, 100].
+
+ - 0: (Default) Bottom layer.
+ - 100: Top layer.
+
+ @note
+ - If zOrder is beyond this range, the SDK reports #ERR_INVALID_ARGUMENT.
+ - As of v2.3, the SDK supports zOrder = 0.
+ */
+ int zOrder;
+ /** The transparency level of the user's video. The value ranges between 0 and 1.0:
+
+ - 0: Completely transparent
+ - 1.0: (Default) Opaque
+ */
+ double alpha;
+ /** The audio channel of the sound. The default value is 0:
+
+ - 0: (Default) Supports dual channels at most, depending on the upstream of the host.
+ - 1: The audio stream of the host uses the FL audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first.
+ - 2: The audio stream of the host uses the FC audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first.
+ - 3: The audio stream of the host uses the FR audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first.
+ - 4: The audio stream of the host uses the BL audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first.
+ - 5: The audio stream of the host uses the BR audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first.
+
+ @note If your setting is not 0, you may need a specialized player.
+ */
+ int audioChannel;
+ TranscodingUser()
+ : uid(0)
+ , x(0)
+ , y(0)
+ , width(0)
+ , height(0)
+ , zOrder(0)
+ , alpha(1.0)
+ , audioChannel(0)
+ {}
+
+} TranscodingUser;
+
+/** Image properties.
+
+ The properties of the watermark and background images.
+ */
+typedef struct RtcImage {
+ RtcImage() :
+ url(NULL),
+ x(0),
+ y(0),
+ width(0),
+ height(0)
+ {}
+ /** HTTP/HTTPS URL address of the image on the live video. The maximum length of this parameter is 1024 bytes. */
+ const char* url;
+ /** Horizontal position of the image from the upper left of the live video. */
+ int x;
+ /** Vertical position of the image from the upper left of the live video. */
+ int y;
+ /** Width of the image on the live video. */
+ int width;
+ /** Height of the image on the live video. */
+ int height;
+} RtcImage;
+/** The configuration for advanced features of the RTMP streaming with transcoding.
+ */
+typedef struct LiveStreamAdvancedFeature {
+ LiveStreamAdvancedFeature() : featureName(NULL) , opened(false) {
+ }
+
+ /** The advanced feature for high-quality video with a lower bitrate. */
+ const char* LBHQ = "lbhq";
+ /** The advanced feature for the optimized video encoder. */
+ const char* VEO = "veo";
+
+ /** The name of the advanced feature. It contains LBHQ and VEO.
+ */
+ const char* featureName;
+
+ /** Whether to enable the advanced feature:
+ * - true: Enable the advanced feature.
+ * - false: (Default) Disable the advanced feature.
+ */
+ bool opened;
+} LiveStreamAdvancedFeature;
+
+/** A struct for managing CDN live audio/video transcoding settings.
+*/
+typedef struct LiveTranscoding {
+ /** The width of the video in pixels. The default value is 360.
+ * - When pushing video streams to the CDN, ensure that `width` is at least 64; otherwise, the AR server adjusts the value to 64.
+ * - When pushing audio streams to the CDN, set `width` and `height` as 0.
+ */
+ int width;
+ /** The height of the video in pixels. The default value is 640.
+ * - When pushing video streams to the CDN, ensure that `height` is at least 64; otherwise, the AR server adjusts the value to 64.
+ * - When pushing audio streams to the CDN, set `width` and `height` as 0.
+ */
+ int height;
+ /** Bitrate of the CDN live output video stream. The default value is 400 Kbps.
+
+ Set this parameter according to the Video Bitrate Table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range.
+ */
+ int videoBitrate;
+ /** Frame rate of the output video stream set for the CDN live streaming. The default value is 15 fps, and the value range is (0,30].
+
+ @note The AR server adjusts any value over 30 to 30.
+ */
+ int videoFramerate;
+
+ /** **DEPRECATED** Latency mode:
+
+ - true: Low latency with unassured quality.
+ - false: (Default) High latency with assured quality.
+ */
+ bool lowLatency;
+
+ /** Video GOP in frames. The default value is 30 fps.
+ */
+ int videoGop;
+ /** Self-defined video codec profile: #VIDEO_CODEC_PROFILE_TYPE.
+
+ @note If you set this parameter to other values, AR adjusts it to the default value of 100.
+ */
+ VIDEO_CODEC_PROFILE_TYPE videoCodecProfile;
+ /** The background color in RGB hex value. Value only. Do not include a preceeding #. For example, 0xFFB6C1 (light pink). The default value is 0x000000 (black).
+ */
+ unsigned int backgroundColor;
+
+ /** video codec type */
+ VIDEO_CODEC_TYPE_FOR_STREAM videoCodecType;
+
+ /** The number of users in the live interactive streaming.
+ */
+ unsigned int userCount;
+ /** TranscodingUser
+ */
+ TranscodingUser *transcodingUsers;
+ /** Reserved property. Extra user-defined information to send SEI for the H.264/H.265 video stream to the CDN live client. Maximum length: 4096 Bytes.
+
+ For more information on SEI frame, see [SEI-related questions](https://docs.ar.io/en/faq/sei).
+ */
+ const char *transcodingExtraInfo;
+
+ /** **DEPRECATED** The metadata sent to the CDN live client defined by the RTMP or FLV metadata.
+ */
+ const char *metadata;
+ /** The watermark image added to the CDN live publishing stream.
+
+ Ensure that the format of the image is PNG. Once a watermark image is added, the audience of the CDN live publishing stream can see the watermark image. See RtcImage.
+ */
+ RtcImage* watermark;
+ /** The background image added to the CDN live publishing stream.
+
+ Once a background image is added, the audience of the CDN live publishing stream can see the background image. See RtcImage.
+ */
+ RtcImage* backgroundImage;
+ /** Self-defined audio-sample rate: #AUDIO_SAMPLE_RATE_TYPE.
+ */
+ AUDIO_SAMPLE_RATE_TYPE audioSampleRate;
+ /** Bitrate of the CDN live audio output stream. The default value is 48 Kbps, and the highest value is 128.
+ */
+ int audioBitrate;
+ /** The numbder of audio channels for the CDN live stream. ar recommends choosing 1 (mono), or 2 (stereo) audio channels. Special players are required if you choose option 3, 4, or 5:
+
+ - 1: (Default) Mono.
+ - 2: Stereo.
+ - 3: Three audio channels.
+ - 4: Four audio channels.
+ - 5: Five audio channels.
+ */
+ int audioChannels;
+ /** Self-defined audio codec profile: #AUDIO_CODEC_PROFILE_TYPE.
+ */
+
+ AUDIO_CODEC_PROFILE_TYPE audioCodecProfile;
+
+ /** Advanced features of the RTMP streaming with transcoding. See LiveStreamAdvancedFeature.
+ *
+ * @since v3.1.0
+ */
+ LiveStreamAdvancedFeature* advancedFeatures;
+
+ /** The number of enabled advanced features. The default value is 0. */
+ unsigned int advancedFeatureCount;
+
+ LiveTranscoding()
+ : width(360)
+ , height(640)
+ , videoBitrate(400)
+ , videoFramerate(15)
+ , lowLatency(false)
+ , videoGop(30)
+ , videoCodecProfile(VIDEO_CODEC_PROFILE_HIGH)
+ , backgroundColor(0x000000)
+ , videoCodecType(VIDEO_CODEC_H264_FOR_STREAM)
+ , userCount(0)
+ , transcodingUsers(NULL)
+ , transcodingExtraInfo(NULL)
+ , metadata(NULL)
+ , watermark(NULL)
+ , backgroundImage(NULL)
+ , audioSampleRate(AUDIO_SAMPLE_RATE_48000)
+ , audioBitrate(48)
+ , audioChannels(1)
+ , audioCodecProfile(AUDIO_CODEC_PROFILE_LC_AAC)
+ , advancedFeatures(NULL)
+ , advancedFeatureCount(0)
+ {}
+} LiveTranscoding;
+
+ /** Camera capturer configuration.
+ */
+ struct CameraCapturerConfiguration{
+
+ /** Camera capturer preference settings. See: #CAPTURER_OUTPUT_PREFERENCE. */
+ CAPTURER_OUTPUT_PREFERENCE preference;
+ /** The width (px) of the video image captured by the local camera.
+ * To customize the width of the video image, set `preference` as #CAPTURER_OUTPUT_PREFERENCE_MANUAL (3) first,
+ * and then use `captureWidth`.
+ *
+ * @since v3.3.0
+ */
+ int captureWidth;
+ /** The height (px) of the video image captured by the local camera.
+ * To customize the height of the video image, set `preference` as #CAPTURER_OUTPUT_PREFERENCE_MANUAL (3) first,
+ * and then use `captureHeight`.
+ *
+ * @since v3.3.0
+ */
+ int captureHeight;
+ #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS)
+ /** Camera direction settings (for Android/iOS only). See: #CAMERA_DIRECTION. */
+ CAMERA_DIRECTION cameraDirection;
+ #endif
+
+ CameraCapturerConfiguration()
+ :preference(CAPTURER_OUTPUT_PREFERENCE_AUTO)
+ ,captureWidth(640)
+ ,captureHeight(480)
+ {}
+
+ CameraCapturerConfiguration(int width, int height)
+ :preference(CAPTURER_OUTPUT_PREFERENCE_MANUAL)
+ ,captureWidth(width)
+ ,captureHeight(height)
+ {}
+ };
+/** The configurations for the data stream.
+ *
+ * @since v3.3.0
+ *
+ * |`syncWithAudio` |`ordered`| SDK behaviors|
+ * |--------------|--------|-------------|
+ * | false | false |The SDK triggers the `onStreamMessage` callback immediately after the receiver receives a data packet |
+ * | true | false | <p>If the data packet delay is within the audio delay, the SDK triggers the `onStreamMessage` callback when the synchronized audio packet is played out.</p><p>If the data packet delay exceeds the audio delay, the SDK triggers the `onStreamMessage` callback as soon as the data packet is received. In this case, the data packet is not synchronized with the audio packet.</p> |
+ * | false | true | <p>If the delay of a data packet is within five seconds, the SDK corrects the order of the data packet.</p><p>If the delay of a data packet exceeds five seconds, the SDK discards the data packet.</p> |
+ * | true | true | <p>If the delay of a data packet is within the audio delay, the SDK corrects the order of the data packet.</p><p>If the delay of a data packet exceeds the audio delay, the SDK discards this data packet.</p> |
+ */
+struct DataStreamConfig {
+ /** Whether to synchronize the data packet with the published audio packet.
+ *
+ * - true: Synchronize the data packet with the audio packet.
+ * - false: Do not synchronize the data packet with the audio packet.
+ *
+ * When you set the data packet to synchronize with the audio, then if the data
+ * packet delay is within the audio delay, the SDK triggers the `onStreamMessage` callback when
+ * the synchronized audio packet is played out. Do not set this parameter as `true` if you
+ * need the receiver to receive the data packet immediately. AR recommends that you set
+ * this parameter to `true` only when you need to implement specific functions, for example
+ * lyric synchronization.
+ */
+ bool syncWithAudio;
+ /** Whether the SDK guarantees that the receiver receives the data in the sent order.
+ *
+ * - true: Guarantee that the receiver receives the data in the sent order.
+ * - false: Do not guarantee that the receiver receives the data in the sent order.
+ *
+ * Do not set this parameter to `true` if you need the receiver to receive the data immediately.
+ */
+ bool ordered;
+};
+/** Configuration of the injected media stream.
+ */
+struct InjectStreamConfig {
+ /** Width of the injected stream in the live interactive streaming. The default value is 0 (same width as the original stream).
+ */
+ int width;
+ /** Height of the injected stream in the live interactive streaming. The default value is 0 (same height as the original stream).
+ */
+ int height;
+ /** Video GOP (in frames) of the injected stream in the live interactive streaming. The default value is 30 fps.
+ */
+ int videoGop;
+ /** Video frame rate of the injected stream in the live interactive streaming. The default value is 15 fps.
+ */
+ int videoFramerate;
+ /** Video bitrate of the injected stream in the live interactive streaming. The default value is 400 Kbps.
+
+ @note The setting of the video bitrate is closely linked to the resolution. If the video bitrate you set is beyond a reasonable range, the SDK sets it within a reasonable range.
+ */
+ int videoBitrate;
+ /** Audio-sample rate of the injected stream in the live interactive streaming: #AUDIO_SAMPLE_RATE_TYPE. The default value is 48000 Hz.
+
+ @note We recommend setting the default value.
+ */
+ AUDIO_SAMPLE_RATE_TYPE audioSampleRate;
+ /** Audio bitrate of the injected stream in the live interactive streaming. The default value is 48.
+
+ @note We recommend setting the default value.
+ */
+ int audioBitrate;
+ /** Audio channels in the live interactive streaming.
+
+ - 1: (Default) Mono
+ - 2: Two-channel stereo
+
+ @note We recommend setting the default value.
+ */
+ 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)
+ {}
+};
+/** The definition of ChannelMediaInfo.
+ */
+struct ChannelMediaInfo {
+ /** The channel name.
+ */
+ const char* channelName;
+ /** The token that enables the user to join the channel.
+ */
+ const char* token;
+ /** The user ID.
+ */
+ uid_t uid;
+};
+
+/** The definition of ChannelMediaRelayConfiguration.
+ */
+struct ChannelMediaRelayConfiguration {
+ /** Pointer to the information of the source channel: ChannelMediaInfo. It contains the following members:
+ * - `channelName`: The name of the source channel. The default value is `NULL`, which means the SDK applies the name of the current channel.
+ * - `uid`: ID of the host whose media stream you want to relay. The default value is 0, which means the SDK generates a random UID. You must set it as 0.
+ * - `token`: The token for joining the source channel. It is generated with the `channelName` and `uid` you set in `srcInfo`.
+ * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID.
+ * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`, and the `uid` must be set as 0.
+ */
+ ChannelMediaInfo *srcInfo;
+ /** Pointer to the information of the destination channel: ChannelMediaInfo. It contains the following members:
+ * - `channelName`: The name of the destination channel.
+ * - `uid`: ID of the host in the destination channel. The value ranges from 0 to (2<sup>32</sup>-1). To avoid UID conflicts, this `uid` must be different from any other UIDs in the destination channel. The default value is 0, which means the SDK generates a random UID.
+ * - `token`: The token for joining the destination channel. It is generated with the `channelName` and `uid` you set in `destInfos`.
+ * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID.
+ * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`.
+ */
+ ChannelMediaInfo *destInfos;
+ /** The number of destination channels. The default value is 0, and the
+ * value range is [0,4). Ensure that the value of this parameter
+ * corresponds to the number of ChannelMediaInfo structs you define in
+ * `destInfos`.
+ */
+ int destCount;
+
+ ChannelMediaRelayConfiguration()
+ : srcInfo(nullptr)
+ , destInfos(nullptr)
+ , destCount(0)
+ {}
+};
+
+/** **DEPRECATED** Lifecycle of the CDN live video stream.
+*/
+enum RTMP_STREAM_LIFE_CYCLE_TYPE
+{
+ /** Bind to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds.
+ */
+ RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL = 1,
+ /** Bind to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately.
+ */
+ RTMP_STREAM_LIFE_CYCLE_BIND2OWNER = 2,
+};
+
+/** Content hints for screen sharing.
+*/
+enum VideoContentHint
+{
+ /** (Default) No content hint.
+ */
+ CONTENT_HINT_NONE,
+ /** Motion-intensive content. Choose this option if you prefer smoothness or when you are sharing a video clip, movie, or video game.
+ */
+ CONTENT_HINT_MOTION,
+ /** Motionless content. Choose this option if you prefer sharpness or when you are sharing a picture, PowerPoint slide, or text.
+ */
+ CONTENT_HINT_DETAILS
+};
+
+/** The relative location of the region to the screen or window.
+ */
+struct Rectangle
+{
+ /** The horizontal offset from the top-left corner.
+ */
+ int x;
+ /** The vertical offset from the top-left corner.
+ */
+ int y;
+ /** The width of the region.
+ */
+ int width;
+ /** The height of the region.
+ */
+ int height;
+
+ Rectangle(): x(0), y(0), width(0), height(0) {}
+ Rectangle(int xx, int yy, int ww, int hh): x(xx), y(yy), width(ww), height(hh) {}
+};
+
+/** **DEPRECATED** Definition of the rectangular region. */
+typedef struct Rect {
+ /** Y-axis of the top line.
+ */
+ int top;
+ /** X-axis of the left line.
+ */
+ int left;
+ /** Y-axis of the bottom line.
+ */
+ int bottom;
+ /** X-axis of the right line.
+ */
+ 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;
+
+/** The options of the watermark image to be added. */
+typedef struct WatermarkOptions {
+ /** Sets whether or not the watermark image is visible in the local video preview:
+ * - true: (Default) The watermark image is visible in preview.
+ * - false: The watermark image is not visible in preview.
+ */
+ bool visibleInPreview;
+ /**
+ * The watermark position in the landscape mode. See Rectangle.
+ * For detailed information on the landscape mode, see the advanced guide *Video Rotation*.
+ */
+ Rectangle positionInLandscapeMode;
+ /**
+ * The watermark position in the portrait mode. See Rectangle.
+ * For detailed information on the portrait mode, see the advanced guide *Video Rotation*.
+ */
+ Rectangle positionInPortraitMode;
+
+ WatermarkOptions()
+ : visibleInPreview(true)
+ , positionInLandscapeMode(0, 0, 0, 0)
+ , positionInPortraitMode(0, 0, 0, 0)
+ {}
+} WatermarkOptions;
+
+/** Screen sharing encoding parameters.
+*/
+struct ScreenCaptureParameters
+{
+ /** The maximum encoding dimensions of the shared region in terms of width * height.
+
+ The default value is 1920 * 1080 pixels, that is, 2073600 pixels. AR uses the value of this parameter to calculate the charges.
+
+ If the aspect ratio is different between the encoding dimensions and screen dimensions, AR applies the following algorithms for encoding. Suppose the encoding dimensions are 1920 x 1080:
+
+ - If the value of the screen dimensions is lower than that of the encoding dimensions, for example, 1000 × 1000, the SDK uses 1000 × 1000 for encoding.
+ - If the value of the screen dimensions is higher than that of the encoding dimensions, for example, 2000 × 1500, the SDK uses the maximum value under 1920 × 1080 with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 × 1080.
+ */
+ VideoDimensions dimensions;
+ /** The frame rate (fps) of the shared region.
+
+ The default value is 5. We do not recommend setting this to a value greater than 15.
+ */
+ int frameRate;
+ /** The bitrate (Kbps) of the shared region.
+
+ The default value is 0 (the SDK works out a bitrate according to the dimensions of the current screen).
+ */
+ int bitrate;
+ /** Sets whether or not to capture the mouse for screen sharing:
+
+ - true: (Default) Capture the mouse.
+ - false: Do not capture the mouse.
+ */
+ bool captureMouseCursor;
+
+ /** Whether to bring the window to the front when calling \ref IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId" to share the window:
+ * - true: Bring the window to the front.
+ * - false: (Default) Do not bring the window to the front.
+ */
+ bool windowFocus;
+ /** A list of IDs of windows to be blocked.
+ *
+ * When calling \ref IRtcEngine::startScreenCaptureByScreenRect "startScreenCaptureByScreenRect" to start screen sharing, you can use this parameter to block the specified windows.
+ * When calling \ref IRtcEngine::updateScreenCaptureParameters "updateScreenCaptureParameters" to update the configuration for screen sharing, you can use this parameter to dynamically block the specified windows during screen sharing.
+ */
+ view_t* excludeWindowList;
+ /** The number of windows to be blocked.
+ */
+ int excludeWindowCount;
+
+ /** Sets whether or not to capture the speaker audio for screen sharing:
+
+ - true: Capture the speaker audio.
+ - false: (Default) Do not capture the speaker audio.
+ */
+ bool captureAudio;
+
+ ScreenCaptureParameters() : dimensions(1920, 1080), frameRate(5), bitrate(STANDARD_BITRATE), captureMouseCursor(true), windowFocus(false), excludeWindowList(NULL), excludeWindowCount(0) {}
+ ScreenCaptureParameters(const VideoDimensions& d, int f, int b, bool c, bool focus, view_t *ex = NULL, int cnt = 0) : dimensions(d), frameRate(f), bitrate(b), captureMouseCursor(c), windowFocus(focus), excludeWindowList(ex), excludeWindowCount(cnt) {}
+ ScreenCaptureParameters(int width, int height, int f, int b, bool c, bool focus, view_t *ex = NULL, int cnt = 0) : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(c), windowFocus(focus), excludeWindowList(ex), excludeWindowCount(cnt) {}
+};
+
+/** Video display settings of the VideoCanvas class.
+*/
+struct VideoCanvas
+{
+ /** Video display window (view).
+ */
+ view_t view;
+ /** The rendering mode of the video view. See RENDER_MODE_TYPE
+ */
+ int renderMode;
+ /** The unique channel name for the ARRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
+ - All lowercase English letters: a to z.
+ - All uppercase English letters: A to Z.
+ - All numeric characters: 0 to 9.
+ - The space character.
+ - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
+
+ @note
+ - The default value is the empty string "". Use the default value if the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IRtcEngine class. The `VideoCanvas` struct defines the video canvas of the user in the channel.
+ - If the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IChannel class, set this parameter as the `channelId` of the `IChannel` object. The `VideoCanvas` struct defines the video canvas of the user in the channel with the specified channel ID.
+ */
+ char channelId[MAX_CHANNEL_ID_LENGTH];
+ /** The user ID. */
+ uid_t uid;
+ void *priv; // private data (underlying video engine denotes it)
+ /** The mirror mode of the video view. See VIDEO_MIRROR_MODE_TYPE
+ @note
+ - For the mirror mode of the local video view: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default.
+ - For the mirror mode of the remote video view: The SDK disables the mirror mode by default.
+ */
+ VIDEO_MIRROR_MODE_TYPE mirrorMode;
+
+ VideoCanvas()
+ : view(NULL)
+ , renderMode(RENDER_MODE_HIDDEN)
+ , uid(0)
+ , priv(NULL)
+ , mirrorMode(VIDEO_MIRROR_MODE_AUTO)
+ {
+ channelId[0] = '\0';
+ }
+ VideoCanvas(view_t v, int m, uid_t u)
+ : view(v)
+ , renderMode(m)
+ , uid(u)
+ , priv(NULL)
+ , mirrorMode(VIDEO_MIRROR_MODE_AUTO)
+ {
+ channelId[0] = '\0';
+ }
+ VideoCanvas(view_t v, int m, const char *ch, uid_t u)
+ : view(v)
+ , renderMode(m)
+ , uid(u)
+ , priv(NULL)
+ , mirrorMode(VIDEO_MIRROR_MODE_AUTO)
+ {
+ strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH);
+ channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0';
+ }
+ VideoCanvas(view_t v, int rm, uid_t u, VIDEO_MIRROR_MODE_TYPE mm)
+ : view(v)
+ , renderMode(rm)
+ , uid(u)
+ , priv(NULL)
+ , mirrorMode(mm)
+ {
+ channelId[0] = '\0';
+ }
+ VideoCanvas(view_t v, int rm, const char *ch, uid_t u, VIDEO_MIRROR_MODE_TYPE mm)
+ : view(v)
+ , renderMode(rm)
+ , uid(u)
+ , priv(NULL)
+ , mirrorMode(mm)
+ {
+ strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH);
+ channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0';
+ }
+};
+
+/** Image enhancement options.
+*/
+struct BeautyOptions {
+ /** The contrast level, used with the @p lightening parameter.
+ */
+ enum LIGHTENING_CONTRAST_LEVEL
+ {
+ /** Low contrast level. */
+ LIGHTENING_CONTRAST_LOW = 0,
+ /** (Default) Normal contrast level. */
+ LIGHTENING_CONTRAST_NORMAL,
+ /** High contrast level. */
+ LIGHTENING_CONTRAST_HIGH
+ };
+
+/** The contrast level, used with the @p lightening parameter.
+*/
+LIGHTENING_CONTRAST_LEVEL lighteningContrastLevel;
+
+/** The brightness level. The value ranges from 0.0 (original) to 1.0. */
+float lighteningLevel;
+
+/** The sharpness level. The value ranges between 0 (original) and 1. This parameter is usually used to remove blemishes.
+ */
+float smoothnessLevel;
+
+/** The redness level. The value ranges between 0 (original) and 1. This parameter adjusts the red saturation level.
+*/
+float rednessLevel;
+
+BeautyOptions(LIGHTENING_CONTRAST_LEVEL contrastLevel, float lightening, float smoothness, float redness)
+ : lighteningLevel(lightening),
+ smoothnessLevel(smoothness),
+ rednessLevel(redness),
+ lighteningContrastLevel(contrastLevel) {}
+
+BeautyOptions()
+ : lighteningLevel(0),
+ smoothnessLevel(0),
+ rednessLevel(0),
+ lighteningContrastLevel(LIGHTENING_CONTRAST_NORMAL) {}
+};
+
+/**
+ * The UserInfo struct.
+ */
+struct UserInfo {
+ /**
+ * The user ID.
+ */
+ uid_t uid;
+ /**
+ * The user account.
+ */
+ char userAccount[MAX_USER_ACCOUNT_LENGTH];
+ UserInfo()
+ : uid(0) {
+ userAccount[0] = '\0';
+ }
+};
+
+/**
+ * Regions for connetion.
+ */
+enum AREA_CODE {
+ /**
+ * Mainland China.
+ */
+ AREA_CODE_CN = 0x00000001,
+ /**
+ * North America.
+ */
+ AREA_CODE_NA = 0x00000002,
+ /**
+ * Europe.
+ */
+ AREA_CODE_EU = 0x00000004,
+ /**
+ * Asia, excluding Mainland China.
+ */
+ AREA_CODE_AS = 0x00000008,
+ /**
+ * Japan.
+ */
+ AREA_CODE_JP = 0x00000010,
+ /**
+ * India.
+ */
+ AREA_CODE_IN = 0x00000020,
+ /**
+ * (Default) Global.
+ */
+ AREA_CODE_GLOB = 0xFFFFFFFF
+};
+
+enum ENCRYPTION_CONFIG {
+ /**
+ * - 1: Force set master key and mode;
+ * - 0: Not force set, checking whether encryption plugin exists
+ */
+ ENCRYPTION_FORCE_SETTING = (1 << 0),
+ /**
+ * - 1: Force not encrypting packet;
+ * - 0: Not force encrypting;
+ */
+ ENCRYPTION_FORCE_DISABLE_PACKET = (1 << 1)
+};
+/** Definition of IPacketObserver.
+*/
+class IPacketObserver
+{
+public:
+/** Definition of Packet.
+ */
+ struct Packet
+ {
+ /** Buffer address of the sent or received data.
+ * @note AR recommends that the value of buffer is more than 2048 bytes, otherwise, you may meet undefined behaviors such as a crash.
+ */
+ const unsigned char* buffer;
+ /** Buffer size of the sent or received data.
+ */
+ unsigned int size;
+ };
+ /** Occurs when the local user sends an audio packet.
+
+ @param packet The sent audio packet. See Packet.
+ @return
+ - true: The audio packet is sent successfully.
+ - false: The audio packet is discarded.
+ */
+ virtual bool onSendAudioPacket(Packet& packet) = 0;
+ /** Occurs when the local user sends a video packet.
+
+ @param packet The sent video packet. See Packet.
+ @return
+ - true: The video packet is sent successfully.
+ - false: The video packet is discarded.
+ */
+ virtual bool onSendVideoPacket(Packet& packet) = 0;
+ /** Occurs when the local user receives an audio packet.
+
+ @param packet The received audio packet. See Packet.
+ @return
+ - true: The audio packet is received successfully.
+ - false: The audio packet is discarded.
+ */
+ virtual bool onReceiveAudioPacket(Packet& packet) = 0;
+ /** Occurs when the local user receives a video packet.
+
+ @param packet The received video packet. See Packet.
+ @return
+ - true: The video packet is received successfully.
+ - false: The video packet is discarded.
+ */
+ virtual bool onReceiveVideoPacket(Packet& packet) = 0;
+};
+
+
+#if defined(_WIN32)||defined(__ANDROID__) || (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_MAC))
+/** The capture type of the custom video source.
+ */
+enum VIDEO_CAPTURE_TYPE {
+ /** Unknown type.
+ */
+ VIDEO_CAPTURE_UNKNOWN,
+ /** (Default) Video captured by the camera.
+ */
+ VIDEO_CAPTURE_CAMERA,
+ /** Video for screen sharing.
+ */
+ VIDEO_CAPTURE_SCREEN,
+};
+
+/** The IVideoFrameConsumer class. The SDK uses it to receive the video frame that you capture.
+ */
+class IVideoFrameConsumer {
+public:
+ /** Receives the raw video frame.
+ *
+ * @note Ensure that the video frame type that you specify in this method is the same as that in the \ref ar::rtc::IVideoSource::getBufferType "getBufferType" callback.
+ *
+ * @param buffer The video buffer.
+ * @param frameType The video frame type. See \ref AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT "VIDEO_PIXEL_FORMAT".
+ * @param width The width (px) of the video frame.
+ * @param height The height (px) of the video frame.
+ * @param rotation The angle (degree) at which the video frame rotates clockwise. If you set the rotation angle, the
+ * SDK rotates the video frame after receiving it. You can set the rotation angle as `0`, `90`, `180`, and `270`.
+ * @param timestamp The Unix timestamp (ms) of the video frame. You must set a timestamp for each video frame.
+ */
+#if defined(_WIN32)
+ virtual void consumeRawVideoFrame(const unsigned char *buffer, AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT frameType, int width, int height, int rotation, long timestamp) = 0;
+#endif
+};
+
+/** The IVideoSource class. You can use it to customize the video source.
+ */
+class IVideoSource {
+public:
+ /** Notification for initializing the custom video source.
+ *
+ * The SDK triggers this callback to remind you to initialize the custom video source. After receiving this callback,
+ * you can do some preparation, such as enabling the camera, and then use the return value to tell the SDK whether the
+ * custom video source is prepared.
+ *
+ * @param consumer An IVideoFrameConsumer object that the SDK passes to you. You need to reserve this object and use it
+ * to send the video frame to the SDK once the custom video source is started. See IVideoFrameConsumer.
+ *
+ * @return
+ * - true: The custom video source is initialized.
+ * - false: The custom video source is not ready or fails to initialize. The SDK stops and reports the error.
+ */
+ virtual bool onInitialize(IVideoFrameConsumer *consumer) = 0;
+
+ /** Notification for disabling the custom video source.
+ *
+ * The SDK triggers this callback to remind you to disable the custom video source device. This callback tells you
+ * that the SDK is about to release the IVideoFrameConsumer object. Ensure that you no longer use IVideoFrameConsumer
+ * after receiving this callback.
+ */
+ virtual void onDispose() = 0;
+
+ /** Notification for starting the custom video source.
+ *
+ * The SDK triggers this callback to remind you to start the custom video source for capturing video. The SDK uses
+ * IVideoFrameConsumer to receive the video frame that you capture after the video source is started. You must use
+ * the return value to tell the SDK whether the custom video source is started.
+ *
+ * @return
+ * - true: The custom video source is started.
+ * - false: The custom video source fails to start. The SDK stops and reports the error.
+ */
+ virtual bool onStart() = 0;
+
+ /** Notification for stopping capturing video.
+ *
+ * The SDK triggers this callback to remind you to stop capturing video. This callback tells you that the SDK is about
+ * to stop using IVideoFrameConsumer to receive the video frame that you capture.
+ */
+ virtual void onStop() = 0;
+
+ /** Gets the video frame type.
+ *
+ * Before you initialize the custom video source, the SDK triggers this callback to query the video frame type. You
+ * must specify the video frame type in the return value and then pass it to the SDK.
+ *
+ * @note Ensure that the video frame type that you specify in this callback is the same as that in the \ref ar::rtc::IVideoFrameConsumer::consumeRawVideoFrame "consumeRawVideoFrame" method.
+ *
+ * @return \ref AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT "VIDEO_PIXEL_FORMAT"
+ */
+#if defined(_WIN32)
+ virtual AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT getBufferType() = 0;
+#endif
+ /** Gets the capture type of the custom video source.
+ *
+ * Before you initialize the custom video source, the SDK triggers this callback to query the capture type of the video source.
+ * You must specify the capture type in the return value and then pass it to the SDK. The SDK enables the corresponding video
+ * processing algorithm according to the capture type after receiving the video frame.
+ *
+ * @return #VIDEO_CAPTURE_TYPE
+ */
+ virtual VIDEO_CAPTURE_TYPE getVideoCaptureType() = 0;
+ /** Gets the content hint of the custom video source.
+ *
+ * If you specify the custom video source as a screen-sharing video, the SDK triggers this callback to query the
+ * content hint of the video source before you initialize the video source. You must specify the content hint in the
+ * return value and then pass it to the SDK. The SDK enables the corresponding video processing algorithm according
+ * to the content hint after receiving the video frame.
+ *
+ * @return \ref ar::rtc::VideoContentHint "VideoContentHint"
+ */
+ virtual VideoContentHint getVideoContentHint() = 0;
+};
+#endif
+
+/** The SDK uses the IRtcEngineEventHandler interface class to send callbacks to the application. The application inherits the methods of this interface class to retrieve these callbacks.
+
+ All methods in this interface class have default (empty) implementations. Therefore, the application can only inherit some required events. In the callbacks, avoid time-consuming tasks or calling blocking APIs, such as the SendMessage method. Otherwise, the SDK may not work properly.
+ */
+class IRtcEngineEventHandler
+{
+public:
+ virtual ~IRtcEngineEventHandler() {}
+
+ /** Reports a warning during SDK runtime.
+
+ In most cases, the application can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running. For example, when losing connection with the server, the SDK may report #WARN_LOOKUP_CHANNEL_TIMEOUT and automatically try to reconnect.
+
+ @param warn Warning code: #WARN_CODE_TYPE.
+ @param msg Pointer to the warning message.
+ */
+ virtual void onWarning(int warn, const char* msg) {
+ (void)warn;
+ (void)msg;
+ }
+
+ /** Reports an error during SDK runtime.
+
+ In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue.
+
+ For example, the SDK reports an #ERR_START_CALL error when failing to initialize a call. The application informs the user that the call initialization failed and invokes the \ref IRtcEngine::leaveChannel "leaveChannel" method to leave the channel.
+
+ @param err Error code: #ERROR_CODE_TYPE.
+ @param msg Pointer to the error message.
+ */
+ virtual void onError(int err, const char* msg) {
+ (void)err;
+ (void)msg;
+ }
+
+ /** Occurs when a user joins a channel.
+
+ This callback notifies the application that a user joins a specified channel when the application calls the \ref IRtcEngine::joinChannel "joinChannel" method.
+
+ The channel name assignment is based on @p channelName specified in the \ref IRtcEngine::joinChannel "joinChannel" method.
+
+ If the @p uid is not specified in the *joinChannel* method, the server automatically assigns a @p uid.
+
+ @param channel Pointer to the channel name.
+ @param uid User ID of the user joining the channel.
+ @param elapsed Time elapsed (ms) from the user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback.
+ */
+ virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) {
+ (void)channel;
+ (void)uid;
+ (void)elapsed;
+ }
+
+ /** Occurs when a user rejoins the channel after disconnection due to network problems.
+
+ When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection.
+
+ @param channel Pointer to the channel name.
+ @param uid User ID of the user rejoining the channel.
+ @param elapsed Time elapsed (ms) from starting to reconnect until the SDK triggers this callback.
+ */
+ virtual void onRejoinChannelSuccess(const char* channel, uid_t uid, int elapsed) {
+ (void)channel;
+ (void)uid;
+ (void)elapsed;
+ }
+
+ /** Occurs when a user leaves the channel.
+
+ This callback notifies the application that a user leaves the channel when the application calls the \ref IRtcEngine::leaveChannel "leaveChannel" method.
+
+ The application retrieves information, such as the call duration and statistics.
+
+ @param stats Pointer to the statistics of the call: RtcStats.
+ */
+ virtual void onLeaveChannel(const RtcStats& stats) {
+ (void)stats;
+ }
+
+ /** Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa.
+
+ This callback notifies the application of a user role switch when the application calls the \ref IRtcEngine::setClientRole "setClientRole" method.
+
+ The SDK triggers this callback when the local user switches the user role by calling the \ref ar::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel.
+ @param oldRole Role that the user switches from: #CLIENT_ROLE_TYPE.
+ @param newRole Role that the user switches to: #CLIENT_ROLE_TYPE.
+ */
+ virtual void onClientRoleChanged(CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) {
+ }
+
+ /** Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel.
+
+ - Communication profile: This callback notifies the application that another user joins the channel. If other users are already in the channel, the SDK also reports to the application on the existing users.
+ - Live-broadcast profile: This callback notifies the application that the host joins the channel. If other hosts are already in the channel, the SDK also reports to the application on the existing hosts. We recommend limiting the number of hosts to 17.
+
+ The SDK triggers this callback under one of the following circumstances:
+ - A remote user/host joins the channel by calling the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method.
+ - A remote user switches the user role to the host by calling the \ref ar::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel.
+ - A remote user/host rejoins the channel after a network interruption.
+ - The host injects an online media stream into the channel by calling the \ref ar::rtc::IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method.
+
+ @note In the Live-broadcast profile:
+ - The host receives this callback when another host joins the channel.
+ - The audience in the channel receives this callback when a new host joins the channel.
+ - When a web application joins the channel, the SDK triggers this callback as long as the web application publishes streams.
+
+ @param uid User ID of the user or host joining the channel.
+ @param elapsed Time delay (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback.
+ */
+ virtual void onUserJoined(uid_t uid, int elapsed) {
+ (void)uid;
+ (void)elapsed;
+ }
+
+ /** Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel.
+
+ Reasons why the user is offline:
+
+ - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When the message is received, the SDK assumes that the user/host leaves the channel.
+ - Drop offline: When no data packet of the user or host is received for a certain period of time, the SDK assumes that the user/host drops offline. Unreliable network connections may lead to false detections, so we recommend using a signaling system for more reliable offline detection.
+
+ @param uid User ID of the user leaving the channel or going offline.
+ @param reason Reason why the user is offline: #USER_OFFLINE_REASON_TYPE.
+ */
+ virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) {
+ (void)uid;
+ (void)reason;
+ }
+
+ /** Reports the last mile network quality of the local user once every two seconds before the user joins the channel.
+
+ Last mile refers to the connection between the local device and AR's edge server. After the application calls the \ref IRtcEngine::enableLastmileTest "enableLastmileTest" method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel.
+
+ @param quality The last mile network quality: #QUALITY_TYPE.
+ */
+ virtual void onLastmileQuality(int quality) {
+ (void)quality;
+ }
+
+ /** Reports the last-mile network probe result.
+
+ The SDK triggers this callback within 30 seconds after the app calls the \ref ar::rtc::IRtcEngine::startLastmileProbeTest "startLastmileProbeTest" method.
+
+ @param result The uplink and downlink last-mile network probe test result. See LastmileProbeResult.
+ */
+ virtual void onLastmileProbeResult(const LastmileProbeResult& result) {
+ (void)result;
+ }
+
+ /** **DEPRECATED** Occurs when the connection between the SDK and the server is interrupted.
+
+ Deprecated as of v2.3.2. Replaced by the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_RECONNECTING, CONNECTION_CHANGED_INTERRUPTED)" callback.
+
+ The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established.
+
+ After triggering this callback, the SDK tries reconnecting to the server. You can use this callback to implement pop-up reminders.
+
+ This callback is different from \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost":
+ - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel.
+ - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel.
+
+ If the SDK fails to rejoin the channel 20 minutes after being disconnected from AR's edge server, the SDK stops rejoining the channel.
+
+ */
+ virtual void onConnectionInterrupted() {}
+
+ /** Occurs when the SDK cannot reconnect to AR's edge server 10 seconds after its connection to the server is interrupted.
+
+ The SDK triggers this callback when it cannot connect to the server 10 seconds after calling the \ref IRtcEngine::joinChannel "joinChannel" method, whether or not it is in the channel.
+
+ This callback is different from \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted":
+
+ - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel.
+ - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel.
+
+ If the SDK fails to rejoin the channel 20 minutes after being disconnected from AR's edge server, the SDK stops rejoining the channel.
+
+ */
+ virtual void onConnectionLost() {}
+
+ /** **DEPRECATED** Deprecated as of v2.3.2. Replaced by the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_FAILED, CONNECTION_CHANGED_BANNED_BY_SERVER)" callback.
+
+ Occurs when your connection is banned by the AR Server.
+ */
+ virtual void onConnectionBanned() {}
+
+ /** Occurs when a method is executed by the SDK.
+
+ @param err The error code (#ERROR_CODE_TYPE) returned by the SDK when a method call fails. If the SDK returns 0, then the method call is successful.
+ @param api Pointer to the method executed by the SDK.
+ @param result Pointer to the result of the method call.
+ */
+ virtual void onApiCallExecuted(int err, const char* api, const char* result) {
+ (void)err;
+ (void)api;
+ (void)result;
+ }
+
+ /** Occurs when the token expires.
+
+ After a token is specified by calling the \ref IRtcEngine::joinChannel "joinChannel" method, if the SDK losses connection with the AR server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server.
+
+ This callback notifies the application to generate a new token. Call the \ref IRtcEngine::renewToken "renewToken" method to renew the token.
+ */
+ virtual void onRequestToken() {
+ }
+
+ /** Occurs when the token expires in 30 seconds.
+
+ The user becomes offline if the token used in the \ref IRtcEngine::joinChannel "joinChannel" method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the \ref IRtcEngine::renewToken "renewToken" method to pass the new token to the SDK.
+
+ @param token Pointer to the token that expires in 30 seconds.
+ */
+ virtual void onTokenPrivilegeWillExpire(const char* token) {
+ (void)token;
+ }
+
+ /** **DEPRECATED** Reports the statistics of the audio stream from each remote user/host.
+
+ Deprecated as of v2.3.2. Use the \ref ar::rtc::IRtcEngineEventHandler::onRemoteAudioStats "onRemoteAudioStats" callback instead.
+
+ The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple users/hosts sending audio streams, the SDK triggers this callback as many times.
+
+ @param uid User ID of the speaker.
+ @param quality Audio quality of the user: #QUALITY_TYPE.
+ @param delay Time delay (ms) of sending the audio packet from the sender to the receiver, including the time delay of audio sampling pre-processing, transmission, and the jitter buffer.
+ @param lost Packet loss rate (%) of the audio packet sent from the sender to the receiver.
+ */
+ virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost) {
+ (void)uid;
+ (void)quality;
+ (void)delay;
+ (void)lost;
+ }
+
+ /** Reports the statistics of the current call.
+
+ The SDK triggers this callback once every two seconds after the user joins the channel.
+
+ @param stats Statistics of the RtcEngine: RtcStats.
+ */
+ virtual void onRtcStats(const RtcStats& stats) {
+ (void)stats;
+ }
+
+ /** Reports the last mile network quality of each user in the channel once every two seconds.
+
+ Last mile refers to the connection between the local device and AR's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, the SDK triggers this callback as many times.
+
+ @param uid User ID. The network quality of the user with this @p uid is reported. If @p uid is 0, the local network quality is reported.
+ @param txQuality Uplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. @p txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 × 480 and a frame rate of 15 fps in the Live-broadcast profile, but may be inadequate for resolutions higher than 1280 × 720. See #QUALITY_TYPE.
+ @param rxQuality Downlink network quality rating of the user in terms of the packet loss rate, average RTT, and jitter of the downlink network. See #QUALITY_TYPE.
+ */
+ virtual void onNetworkQuality(uid_t uid, int txQuality, int rxQuality) {
+ (void)uid;
+ (void)txQuality;
+ (void)rxQuality;
+ }
+
+ /** Reports the statistics of the local video stream.
+ *
+ * The SDK triggers this callback once every two seconds for each
+ * user/host. If there are multiple users/hosts in the channel, the SDK
+ * triggers this callback as many times.
+ *
+ * @note
+ * If you have called the \ref ar::rtc::IRtcEngine::enableDualStream
+ * "enableDualStream" method, the \ref onLocalVideoStats()
+ * "onLocalVideoStats" callback reports the statistics of the high-video
+ * stream (high bitrate, and high-resolution video stream).
+ *
+ * @param stats Statistics of the local video stream. See LocalVideoStats.
+ */
+ virtual void onLocalVideoStats(const LocalVideoStats& stats) {
+ (void)stats;
+ }
+
+ /** Reports the statistics of the video stream from each remote user/host.
+ *
+ * The SDK triggers this callback once every two seconds for each remote
+ * user/host. If a channel includes multiple remote users, the SDK
+ * triggers this callback as many times.
+ *
+ * @param stats Statistics of the remote video stream. See
+ * RemoteVideoStats.
+ */
+ virtual void onRemoteVideoStats(const RemoteVideoStats& stats) {
+ (void)stats;
+ }
+
+ /** Reports the statistics of the local audio stream.
+ *
+ * The SDK triggers this callback once every two seconds.
+ *
+ * @param stats The statistics of the local audio stream.
+ * See LocalAudioStats.
+ */
+ virtual void onLocalAudioStats(const LocalAudioStats& stats) {
+ (void)stats;
+ }
+
+ /** Reports the statistics of the audio stream from each remote user/host.
+
+ This callback replaces the \ref ar::rtc::IRtcEngineEventHandler::onAudioQuality "onAudioQuality" callback.
+
+ The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.
+
+ @param stats Pointer to the statistics of the received remote audio streams. See RemoteAudioStats.
+ */
+ virtual void onRemoteAudioStats(const RemoteAudioStats& stats) {
+ (void)stats;
+ }
+
+ /** Occurs when the local audio state changes.
+ *
+ * This callback indicates the state change of the local audio stream,
+ * including the state of the audio recording and encoding, and allows
+ * you to troubleshoot issues when exceptions occur.
+ *
+ * @note
+ * When the state is #LOCAL_AUDIO_STREAM_STATE_FAILED (3), see the `error`
+ * parameter for details.
+ *
+ * @param state State of the local audio. See #LOCAL_AUDIO_STREAM_STATE.
+ * @param error The error information of the local audio.
+ * See #LOCAL_AUDIO_STREAM_ERROR.
+ */
+ virtual void onLocalAudioStateChanged(LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error) {
+ (void)state;
+ (void)error;
+ }
+
+ /** Occurs when the remote audio state changes.
+ *
+ * This callback indicates the state change of the remote audio stream.
+ *
+ * @param uid ID of the remote user whose audio state changes.
+ * @param state State of the remote audio. See #REMOTE_AUDIO_STATE.
+ * @param reason The reason of the remote audio state change.
+ * See #REMOTE_AUDIO_STATE_REASON.
+ * @param elapsed Time elapsed (ms) from the local user calling the
+ * \ref IRtcEngine::joinChannel "joinChannel" method until the SDK
+ * triggers this callback.
+ */
+ virtual void onRemoteAudioStateChanged(uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed) {
+ (void)uid;
+ (void)state;
+ (void)reason;
+ (void)elapsed;
+ }
+
+ /** Occurs when the audio publishing state changes.
+ *
+ * @since v3.1.0
+ *
+ * This callback indicates the publishing state change of the local audio stream.
+ *
+ * @param channel The channel name.
+ * @param oldState The previous publishing state. For details, see #STREAM_PUBLISH_STATE.
+ * @param newState The current publishing state. For details, see #STREAM_PUBLISH_STATE.
+ * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state.
+ */
+ virtual void onAudioPublishStateChanged(const char* channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState) {
+ (void)channel;
+ (void)oldState;
+ (void)newState;
+ (void)elapseSinceLastState;
+ }
+
+ /** Occurs when the video publishing state changes.
+ *
+ * @since v3.1.0
+ *
+ * This callback indicates the publishing state change of the local video stream.
+ *
+ * @param channel The channel name.
+ * @param oldState The previous publishing state. For details, see #STREAM_PUBLISH_STATE.
+ * @param newState The current publishing state. For details, see #STREAM_PUBLISH_STATE.
+ * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state.
+ */
+ virtual void onVideoPublishStateChanged(const char* channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState) {
+ (void)channel;
+ (void)oldState;
+ (void)newState;
+ (void)elapseSinceLastState;
+ }
+
+ /** Occurs when the audio subscribing state changes.
+ *
+ * @since v3.1.0
+ *
+ * This callback indicates the subscribing state change of a remote audio stream.
+ *
+ * @param channel The channel name.
+ * @param uid The ID of the remote user.
+ * @param oldState The previous subscribing state. For details, see #STREAM_SUBSCRIBE_STATE.
+ * @param newState The current subscribing state. For details, see #STREAM_SUBSCRIBE_STATE.
+ * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state.
+ */
+ virtual void onAudioSubscribeStateChanged(const char* channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) {
+ (void)channel;
+ (void)uid;
+ (void)oldState;
+ (void)newState;
+ (void)elapseSinceLastState;
+ }
+
+ /** Occurs when the audio subscribing state changes.
+ *
+ * @since v3.1.0
+ *
+ * This callback indicates the subscribing state change of a remote video stream.
+ *
+ * @param channel The channel name.
+ * @param uid The ID of the remote user.
+ * @param oldState The previous subscribing state. For details, see #STREAM_SUBSCRIBE_STATE.
+ * @param newState The current subscribing state. For details, see #STREAM_SUBSCRIBE_STATE.
+ * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state.
+ */
+ virtual void onVideoSubscribeStateChanged(const char* channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) {
+ (void)channel;
+ (void)uid;
+ (void)oldState;
+ (void)newState;
+ (void)elapseSinceLastState;
+ }
+
+ /** Reports which users are speaking, the speakers' volume and whether the local user is speaking.
+
+ This callback reports the IDs and volumes of the loudest speakers at the moment in the channel, and whether the local user is speaking.
+
+ By default, this callback is disabled. You can enable it by calling the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method.
+ Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not.
+
+ The SDK triggers two independent `onAudioVolumeIndication` callbacks at one time, which separately report the volume information of the local user and all the remote speakers.
+ For more information, see the detailed parameter descriptions.
+
+ @note
+ - To enable the voice activity detection of the local user, ensure that you set `report_vad`(true) in the `enableAudioVolumeIndication` method.
+ - Calling the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method affects the SDK's behavior:
+ - If the local user calls the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method, the SDK stops triggering the local user's callback.
+ - 20 seconds after a remote speaker calls the *muteLocalAudioStream* method, the remote speakers' callback excludes this remote user's information; 20 seconds after all remote users call the *muteLocalAudioStream* method, the SDK stops triggering the remote speakers' callback.
+ - An empty @p speakers array in the *onAudioVolumeIndication* callback suggests that no remote user is speaking at the moment.
+
+ @param speakers A pointer to AudioVolumeInfo:
+ - In the local user's callback, this struct contains the following members:
+ - `uid` = 0,
+ - `volume` = `totalVolume`, which reports the sum of the voice volume and audio-mixing volume of the local user, and
+ - `vad`, which reports the voice activity status of the local user.
+ - In the remote speakers' callback, this array contains the following members:
+ - `uid` of the remote speaker,
+ - `volume`, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and
+ - `vad` = 0.
+
+ An empty speakers array in the callback indicates that no remote user is speaking at the moment.
+ @param speakerNumber Total number of speakers. The value range is [0, 3].
+ - In the local user’s callback, `speakerNumber` = 1, regardless of whether the local user speaks or not.
+ - In the remote speakers' callback, the callback reports the IDs and volumes of the three loudest speakers when there are more than three remote users in the channel, and `speakerNumber` = 3.
+ @param totalVolume Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume).
+ - In the local user’s callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of the local user.
+ - In the remote speakers' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of all the remote speakers.
+ */
+ virtual void onAudioVolumeIndication(const AudioVolumeInfo* speakers, unsigned int speakerNumber, int totalVolume) {
+ (void)speakers;
+ (void)speakerNumber;
+ (void)totalVolume;
+ }
+
+ /** Occurs when the most active speaker is detected.
+
+ After a successful call of \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication",
+ the SDK continuously detects which remote user has the loudest volume. During the current period, the remote user,
+ who is detected as the loudest for the most times, is the most active user.
+
+ When the number of user is no less than two and an active speaker exists, the SDK triggers this callback and reports the `uid` of the most active speaker.
+ - If the most active speaker is always the same user, the SDK triggers this callback only once.
+ - If the most active speaker changes to another user, the SDK triggers this callback again and reports the `uid` of the new active speaker.
+
+ @param uid The user ID of the most active speaker.
+ */
+ virtual void onActiveSpeaker(uid_t uid) {
+ (void)uid;
+ }
+
+ /** **DEPRECATED** Occurs when the video stops playing.
+
+ The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing.
+
+ Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_STOPPED(0) in the \ref ar::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead.
+ */
+ virtual void onVideoStopped() {}
+
+ /** Occurs when the first local video frame is displayed/rendered on the local video view.
+
+ @param width Width (px) of the first local video frame.
+ @param height Height (px) of the first local video frame.
+ @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback.
+ If you call the \ref IRtcEngine::startPreview "startPreview" method before calling the *joinChannel* method, then @p elapsed is the time elapsed from calling the *startPreview* method until the SDK triggers this callback.
+ */
+ virtual void onFirstLocalVideoFrame(int width, int height, int elapsed) {
+ (void)width;
+ (void)height;
+ (void)elapsed;
+ }
+
+ /** Occurs when the first video frame is published.
+ *
+ * @since v3.1.0
+ *
+ * The SDK triggers this callback under one of the following circumstances:
+ * - The local client enables the video module and calls \ref IRtcEngine::joinChannel "joinChannel" successfully.
+ * - The local client calls \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(true)" and \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(false)" in sequence.
+ * - The local client calls \ref IRtcEngine::disableVideo "disableVideo" and \ref IRtcEngine::enableVideo "enableVideo" in sequence.
+ *
+ * @param elapsed The time elapsed (ms) from the local client calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback.
+ */
+ virtual void onFirstLocalVideoFramePublished(int elapsed) {
+ (void)elapsed;
+ }
+
+ /** Occurs when the first remote video frame is received and decoded.
+ *
+ * @deprecated
+ * This callback is deprecated and replaced by the
+ * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback
+ * with the following parameters:
+ * - #REMOTE_VIDEO_STATE_STARTING (1)
+ * - #REMOTE_VIDEO_STATE_DECODING (2)
+ *
+ * This callback is triggered in either of the following scenarios:
+ *
+ * - The remote user joins the channel and sends the video stream.
+ * - The remote user stops sending the video stream and re-sends it after
+ * 15 seconds. Reasons for such an interruption include:
+ * - The remote user leaves the channel.
+ * - The remote user drops offline.
+ * - The remote user calls the
+ * \ref ar::rtc::IRtcEngine::muteLocalVideoStream "muteLocalVideoStream"
+ * method to stop sending the video stream.
+ * - The remote user calls the
+ * \ref ar::rtc::IRtcEngine::disableVideo "disableVideo" method to
+ * disable video.
+ *
+ * The application can configure the user view settings in this callback.
+ *
+ * @param uid User ID of the remote user sending the video stream.
+ * @param width Width (px) of the video stream.
+ * @param height Height (px) of the video stream.
+ * @param elapsed Time elapsed (ms) from the local user calling the
+ * \ref IRtcEngine::joinChannel "joinChannel" method until the SDK
+ * triggers this callback.
+ */
+ virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) {
+ (void)uid;
+ (void)width;
+ (void)height;
+ (void)elapsed;
+ }
+
+ /** Occurs when the first remote video frame is rendered.
+
+ The SDK triggers this callback when the first frame of the remote video is displayed in the user's video window. The application can retrieve the time elapsed from a user joining the channel until the first video frame is displayed.
+
+ @param uid User ID of the remote user sending the video stream.
+ @param width Width (px) of the video frame.
+ @param height Height (px) of the video stream.
+ @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback.
+ */
+ virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) {
+ (void)uid;
+ (void)width;
+ (void)height;
+ (void)elapsed;
+ }
+
+ /** @deprecated This method is deprecated from v3.0.0, use the \ref ar::rtc::IRtcEngineEventHandler::onRemoteAudioStateChanged "onRemoteAudioStateChanged" callback instead.
+
+ Occurs when a remote user's audio stream playback pauses/resumes.
+
+ The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method.
+
+ @note This callback does not work properly when the number of users (in the `COMMUNICATION` profile) or hosts (in the `LIVE_BROADCASTING` profile) in the channel exceeds 17.
+
+ @param uid User ID of the remote user.
+ @param muted Whether the remote user's audio stream is muted/unmuted:
+ - true: Muted.
+ - false: Unmuted.
+ */
+ virtual void onUserMuteAudio(uid_t uid, bool muted) {
+ (void)uid;
+ (void)muted;
+ }
+
+ /** Occurs when a remote user's video stream playback pauses/resumes.
+ *
+ * You can also use the
+ * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback
+ * with the following parameters:
+ * - #REMOTE_VIDEO_STATE_STOPPED (0) and
+ * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5).
+ * - #REMOTE_VIDEO_STATE_DECODING (2) and
+ * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6).
+ *
+ * The SDK triggers this callback when the remote user stops or resumes
+ * sending the video stream by calling the
+ * \ref ar::rtc::IRtcEngine::muteLocalVideoStream
+ * "muteLocalVideoStream" method.
+ *
+ * @note This callback does not work properly when the number of users (in the `COMMUNICATION` profile) or hosts (in the `LIVE_BROADCASTING` profile) in the channel exceeds 17.
+ *
+ * @param uid User ID of the remote user.
+ * @param muted Whether the remote user's video stream playback is
+ * paused/resumed:
+ * - true: Paused.
+ * - false: Resumed.
+ */
+ virtual void onUserMuteVideo(uid_t uid, bool muted) {
+ (void)uid;
+ (void)muted;
+ }
+
+ /** Occurs when a specific remote user enables/disables the video
+ * module.
+ *
+ * @deprecated
+ * This callback is deprecated and replaced by the
+ * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback
+ * with the following parameters:
+ * - #REMOTE_VIDEO_STATE_STOPPED (0) and
+ * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5).
+ * - #REMOTE_VIDEO_STATE_DECODING (2) and
+ * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6).
+ *
+ * Once the video module is disabled, the remote user can only use a
+ * voice call. The remote user cannot send or receive any video from
+ * other users.
+ *
+ * The SDK triggers this callback when the remote user enables or disables
+ * the video module by calling the
+ * \ref ar::rtc::IRtcEngine::enableVideo "enableVideo" or
+ * \ref ar::rtc::IRtcEngine::disableVideo "disableVideo" method.
+ *
+ * @note This callback returns invalid when the number of users in a
+ * channel exceeds 20.
+ *
+ * @param uid User ID of the remote user.
+ * @param enabled Whether the remote user enables/disables the video
+ * module:
+ * - true: Enable. The remote user can enter a video session.
+ * - false: Disable. The remote user can only enter a voice session, and
+ * cannot send or receive any video stream.
+ */
+ virtual void onUserEnableVideo(uid_t uid, bool enabled) {
+ (void)uid;
+ (void)enabled;
+ }
+
+ /** Occurs when the audio device state changes.
+
+ This callback notifies the application that the system's audio device state is changed. For example, a headset is unplugged from the device.
+
+ @param deviceId Pointer to the device ID.
+ @param deviceType Device type: #MEDIA_DEVICE_TYPE.
+ @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE.
+ */
+ virtual void onAudioDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) {
+ (void)deviceId;
+ (void)deviceType;
+ (void)deviceState;
+ }
+
+ /** Occurs when the volume of the playback device, microphone, or application changes.
+
+ @param deviceType Device type: #MEDIA_DEVICE_TYPE.
+ @param volume Volume of the device. The value ranges between 0 and 255.
+ @param muted
+ - true: The audio device is muted.
+ - false: The audio device is not muted.
+ */
+ virtual void onAudioDeviceVolumeChanged(MEDIA_DEVICE_TYPE deviceType, int volume, bool muted) {
+ (void)deviceType;
+ (void)volume;
+ (void)muted;
+ }
+
+ /** **DEPRECATED** Occurs when the camera turns on and is ready to capture the video.
+
+ If the camera fails to turn on, fix the error reported in the \ref IRtcEngineEventHandler::onError "onError" callback.
+
+ Deprecated as of v2.4.1. Use #LOCAL_VIDEO_STREAM_STATE_CAPTURING (1) in the \ref ar::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead.
+ */
+ virtual void onCameraReady() {}
+
+ /** Occurs when the camera focus area changes.
+
+ The SDK triggers this callback when the local user changes the camera focus position by calling the setCameraFocusPositionInPreview method.
+
+ @note This callback is for Android and iOS only.
+
+ @param x x coordinate of the changed camera focus area.
+ @param y y coordinate of the changed camera focus area.
+ @param width Width of the changed camera focus area.
+ @param height Height of the changed camera focus area.
+ */
+ virtual void onCameraFocusAreaChanged(int x, int y, int width, int height) {
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ }
+#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS)
+ /**
+ * Reports the face detection result of the local user. Applies to Android and iOS only.
+ * @since v3.0.1
+ *
+ * Once you enable face detection by calling \ref IRtcEngine::enableFaceDetection "enableFaceDetection"(true), you can get the following information on the local user in real-time:
+ * - The width and height of the local video.
+ * - The position of the human face in the local video.
+ * - The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face.
+ *
+ * @note
+ * - If the SDK does not detect a face, it reduces the frequency of this callback to reduce power consumption on the local device.
+ * - The SDK stops triggering this callback when a human face is in close proximity to the screen.
+ * - On Android, the `distance` value reported in this callback may be slightly different from the actual distance. Therefore, AR does not recommend using it for
+ * accurate calculation.
+ * @param imageWidth The width (px) of the local video.
+ * @param imageHeight The height (px) of the local video.
+ * @param vecRectangle The position and size of the human face on the local video:
+ * - `x`: The x coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin,
+ * the x coordinate represents the relative lateral displacement of the top left corner of the human face to the origin.
+ * - `y`: The y coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin,
+ * the y coordinate represents the relative longitudinal displacement of the top left corner of the human face to the origin.
+ * - `width`: The width (px) of the human face in the captured video.
+ * - `height`: The height (px) of the human face in the captured video.
+ * @param vecDistance The distance (cm) between the human face and the screen.
+ * @param numFaces The number of faces detected. If the value is 0, it means that no human face is detected.
+ */
+ virtual void onFacePositionChanged(int imageWidth, int imageHeight, Rectangle* vecRectangle, int* vecDistance, int numFaces){
+ (void)imageWidth;
+ (void)imageHeight;
+ (void)vecRectangle;
+ (void)vecDistance;
+ (void)numFaces;
+ }
+#endif
+ /** Occurs when the camera exposure area changes.
+
+ The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method.
+
+ @note This callback is for Android and iOS only.
+
+ @param x x coordinate of the changed camera exposure area.
+ @param y y coordinate of the changed camera exposure area.
+ @param width Width of the changed camera exposure area.
+ @param height Height of the changed camera exposure area.
+ */
+ virtual void onCameraExposureAreaChanged(int x, int y, int width, int height) {
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ }
+
+ /** Occurs when the audio mixing file playback finishes.
+
+ **DEPRECATED** use onAudioMixingStateChanged instead.
+
+ You can start an audio mixing file playback by calling the \ref IRtcEngine::startAudioMixing "startAudioMixing" method. The SDK triggers this callback when the audio mixing file playback finishes.
+
+ If the *startAudioMixing* method call fails, an error code returns in the \ref IRtcEngineEventHandler::onError "onError" callback.
+
+ */
+ virtual void onAudioMixingFinished() {
+ }
+
+ /** Occurs when the state of the local user's audio mixing file changes.
+
+ When you call the \ref IRtcEngine::startAudioMixing "startAudioMixing" method and the state of audio mixing file changes, the SDK triggers this callback.
+ - When the audio mixing file plays, pauses playing, or stops playing, this callback returns 710, 711, or 713 in @p state, and 0 in @p errorCode.
+ - When exceptions occur during playback, this callback returns 714 in @p state and an error in @p errorCode.
+ - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701.
+
+ @param state The state code. See #AUDIO_MIXING_STATE_TYPE.
+ @param errorCode The error code. See #AUDIO_MIXING_ERROR_TYPE.
+ */
+ virtual void onAudioMixingStateChanged(AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode){
+ }
+ /** Occurs when a remote user starts audio mixing.
+
+ When a remote user calls \ref IRtcEngine::startAudioMixing "startAudioMixing" to play the background music, the SDK reports this callback.
+ */
+ virtual void onRemoteAudioMixingBegin() {
+ }
+ /** Occurs when a remote user finishes audio mixing.
+ */
+ virtual void onRemoteAudioMixingEnd() {
+ }
+
+ /** Occurs when the local audio effect playback finishes.
+
+ The SDK triggers this callback when the local audio effect file playback finishes.
+
+ @param soundId ID of the local audio effect. Each local audio effect has a unique ID.
+ */
+ virtual void onAudioEffectFinished(int soundId) {
+ }
+
+
+ /**
+ Occurs when the SDK decodes the first remote audio frame for playback.
+
+ @deprecated v3.0.0
+
+ This callback is deprecated. Use `onRemoteAudioStateChanged` instead.
+
+ This callback is triggered in either of the following scenarios:
+
+ - The remote user joins the channel and sends the audio stream.
+ - The remote user stops sending the audio stream and re-sends it after 15 seconds. Reasons for such an interruption include:
+ - The remote user leaves channel.
+ - The remote user drops offline.
+ - The remote user calls the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method to stop sending the local audio stream.
+ - The remote user calls the \ref ar::rtc::IRtcEngine::disableAudio "disableAudio" method to disable audio.
+
+ @param uid User ID of the remote user sending the audio stream.
+ @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback.
+ */
+ virtual void onFirstRemoteAudioDecoded(uid_t uid, int elapsed) {
+ (void)uid;
+ (void)elapsed;
+ }
+
+ /** Occurs when the video device state changes.
+
+ @note On a Windows device with an external camera for video capturing, the video disables once the external camera is unplugged.
+
+ @param deviceId Pointer to the device ID of the video device that changes state.
+ @param deviceType Device type: #MEDIA_DEVICE_TYPE.
+ @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE.
+ */
+ virtual void onVideoDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) {
+ (void)deviceId;
+ (void)deviceType;
+ (void)deviceState;
+ }
+
+ /** Occurs when the local video stream state changes.
+
+ This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur.
+
+ @note For some device models, the SDK will not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment.
+
+ @param localVideoState State type #LOCAL_VIDEO_STREAM_STATE. When the state is LOCAL_VIDEO_STREAM_STATE_FAILED (3), see the `error` parameter for details.
+ @param error The detailed error information: #LOCAL_VIDEO_STREAM_ERROR.
+ */
+ virtual void onLocalVideoStateChanged(LOCAL_VIDEO_STREAM_STATE localVideoState, LOCAL_VIDEO_STREAM_ERROR error) {
+ (void)localVideoState;
+ (void)error;
+ }
+
+ /** Occurs when the video size or rotation of a specified user changes.
+
+ @param uid User ID of the remote user or local user (0) whose video size or rotation changes.
+ @param width New width (pixels) of the video.
+ @param height New height (pixels) of the video.
+ @param rotation New rotation of the video [0 to 360).
+ */
+ virtual void onVideoSizeChanged(uid_t uid, int width, int height, int rotation) {
+ (void)uid;
+ (void)width;
+ (void)height;
+ (void)rotation;
+ }
+ /** Occurs when the remote video state changes.
+ *
+ * @param uid ID of the remote user whose video state changes.
+ * @param state State of the remote video. See #REMOTE_VIDEO_STATE.
+ * @param reason The reason of the remote video state change. See
+ * #REMOTE_VIDEO_STATE_REASON.
+ * @param elapsed Time elapsed (ms) from the local user calling the
+ * \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method until the
+ * SDK triggers this callback.
+ */
+ virtual void onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) {
+ (void)uid;
+ (void)state;
+ (void)reason;
+ (void)elapsed;
+ }
+
+ /** Occurs when a specified remote user enables/disables the local video
+ * capturing function.
+ *
+ * @deprecated
+ * This callback is deprecated and replaced by the
+ * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback
+ * with the following parameters:
+ * - #REMOTE_VIDEO_STATE_STOPPED (0) and
+ * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5).
+ * - #REMOTE_VIDEO_STATE_DECODING (2) and
+ * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6).
+ *
+ * This callback is only applicable to the scenario when the user only
+ * wants to watch the remote video without sending any video stream to the
+ * other user.
+ *
+ * The SDK triggers this callback when the remote user resumes or stops
+ * capturing the video stream by calling the
+ * \ref ar::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo" method.
+ *
+ * @param uid User ID of the remote user.
+ * @param enabled Whether the specified remote user enables/disables the
+ * local video capturing function:
+ * - true: Enable. Other users in the channel can see the video of this
+ * remote user.
+ * - false: Disable. Other users in the channel can no longer receive the
+ * video stream from this remote user, while this remote user can still
+ * receive the video streams from other users.
+ */
+ virtual void onUserEnableLocalVideo(uid_t uid, bool enabled) {
+ (void)uid;
+ (void)enabled;
+ }
+
+// virtual void onStreamError(int streamId, int code, int parameter, const char* message, size_t length) {}
+ /** Occurs when the local user receives the data stream from the remote user within five seconds.
+
+ The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method.
+ @param uid User ID of the remote user sending the message.
+ @param streamId Stream ID.
+ @param data Pointer to the data received by the local user.
+ @param length Length of the data in bytes.
+ */
+ virtual void onStreamMessage(uid_t uid, int streamId, const char* data, size_t length) {
+ (void)uid;
+ (void)streamId;
+ (void)data;
+ (void)length;
+ }
+
+ /** Occurs when the local user does not receive the data stream from the remote user within five seconds.
+
+ The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method.
+ @param uid User ID of the remote user sending the message.
+ @param streamId Stream ID.
+ @param code Error code: #ERROR_CODE_TYPE.
+ @param missed Number of lost messages.
+ @param cached Number of incoming cached messages when the data stream is interrupted.
+ */
+ virtual void onStreamMessageError(uid_t uid, int streamId, int code, int missed, int cached) {
+ (void)uid;
+ (void)streamId;
+ (void)code;
+ (void)missed;
+ (void)cached;
+ }
+
+ /** Occurs when the media engine loads.*/
+ virtual void onMediaEngineLoadSuccess() {
+ }
+ /** Occurs when the media engine call starts.*/
+ virtual void onMediaEngineStartCallSuccess() {
+ }
+ /// @cond
+ /** Reports whether the super-resolution algorithm is enabled.
+ *
+ * @since v3.2.0
+ *
+ * After calling \ref IRtcEngine::enableRemoteSuperResolution "enableRemoteSuperResolution", the SDK triggers this
+ * callback to report whether the super-resolution algorithm is successfully enabled. If not successfully enabled,
+ * you can use reason for troubleshooting.
+ *
+ * @param uid The ID of the remote user.
+ * @param enabled Whether the super-resolution algorithm is successfully enabled:
+ * - true: The super-resolution algorithm is successfully enabled.
+ * - false: The super-resolution algorithm is not successfully enabled.
+ * @param reason The reason why the super-resolution algorithm is not successfully enabled. See #SUPER_RESOLUTION_STATE_REASON.
+ */
+ virtual void onUserSuperResolutionEnabled(uid_t uid, bool enabled, SUPER_RESOLUTION_STATE_REASON reason) {
+ (void)uid;
+ (void)enabled;
+ (void)reason;
+ }
+ /// @endcond
+
+ /** Occurs when the state of the media stream relay changes.
+ *
+ * The SDK returns the state of the current media relay with any error
+ * message.
+ *
+ * @param state The state code in #CHANNEL_MEDIA_RELAY_STATE.
+ * @param code The error code in #CHANNEL_MEDIA_RELAY_ERROR.
+ */
+ virtual void onChannelMediaRelayStateChanged(CHANNEL_MEDIA_RELAY_STATE state,CHANNEL_MEDIA_RELAY_ERROR code) {
+ }
+
+ /** Reports events during the media stream relay.
+ *
+ * @param code The event code in #CHANNEL_MEDIA_RELAY_EVENT.
+ */
+ virtual void onChannelMediaRelayEvent(CHANNEL_MEDIA_RELAY_EVENT code) {
+ }
+
+ /** Occurs when the engine sends the first local audio frame.
+
+ @deprecated Deprecated as of v3.1.0. Use the \ref IRtcEngineEventHandler::onFirstLocalAudioFramePublished "onFirstLocalAudioFramePublished" callback instead.
+
+ @param elapsed Time elapsed (ms) from the local user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback.
+ */
+ virtual void onFirstLocalAudioFrame(int elapsed) {
+ (void)elapsed;
+ }
+
+ /** Occurs when the first audio frame is published.
+ *
+ * @since v3.1.0
+ *
+ * The SDK triggers this callback under one of the following circumstances:
+ * - The local client enables the audio module and calls \ref IRtcEngine::joinChannel "joinChannel" successfully.
+ * - The local client calls \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(true)" and \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(false)" in sequence.
+ * - The local client calls \ref IRtcEngine::disableAudio "disableAudio" and \ref IRtcEngine::enableAudio "enableAudio" in sequence.
+ *
+ * @param elapsed The time elapsed (ms) from the local client calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback.
+ */
+ virtual void onFirstLocalAudioFramePublished(int elapsed) {
+ (void)elapsed;
+ }
+
+ /** Occurs when the engine receives the first audio frame from a specific remote user.
+
+ @param uid User ID of the remote user.
+ @param elapsed Time elapsed (ms) from the remote user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback.
+ */
+ virtual void onFirstRemoteAudioFrame(uid_t uid, int elapsed) {
+ (void)uid;
+ (void)elapsed;
+ }
+
+ /**
+ Occurs when the state of the RTMP streaming changes.
+
+ The SDK triggers this callback to report the result of the local user calling the \ref ar::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" or \ref ar::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method.
+
+ This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the *errCode* parameter.
+
+ @param url The RTMP URL address.
+ @param state The RTMP streaming state. See: #RTMP_STREAM_PUBLISH_STATE.
+ @param errCode The detailed error information for streaming. See: #RTMP_STREAM_PUBLISH_ERROR.
+ */
+ virtual void onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) {
+ (void) url;
+ (void) state;
+ (void) errCode;
+ }
+
+ /** Reports events during the RTMP streaming.
+ *
+ * @since v3.1.0
+ *
+ * @param url The RTMP streaming URL.
+ * @param eventCode The event code. See #RTMP_STREAMING_EVENT
+ */
+ virtual void onRtmpStreamingEvent(const char* url, RTMP_STREAMING_EVENT eventCode) {
+ (void) url;
+ (void) eventCode;
+ }
+
+ /** @deprecated This method is deprecated, use the \ref ar::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback instead.
+
+ Reports the result of calling the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method. (CDN live only.)
+
+ @param url The RTMP URL address.
+ @param error Error code: #ERROR_CODE_TYPE. Main errors include:
+ - #ERR_OK (0): The publishing succeeds.
+ - #ERR_FAILED (1): The publishing fails.
+ - #ERR_INVALID_ARGUMENT (2): Invalid argument used. If, for example, you did not call \ref ar::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" to configure LiveTranscoding before calling \ref ar::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl", the SDK reports #ERR_INVALID_ARGUMENT.
+ - #ERR_TIMEDOUT (10): The publishing timed out.
+ - #ERR_ALREADY_IN_USE (19): The chosen URL address is already in use for CDN live streaming.
+ - #ERR_RESOURCE_LIMITED (22): The backend system does not have enough resources for the CDN live streaming.
+ - #ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH (130): You cannot publish an encrypted stream.
+ - #ERR_PUBLISH_STREAM_CDN_ERROR (151)
+ - #ERR_PUBLISH_STREAM_NUM_REACH_LIMIT (152)
+ - #ERR_PUBLISH_STREAM_NOT_AUTHORIZED (153)
+ - #ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR (154)
+ - #ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED (156)
+ */
+ virtual void onStreamPublished(const char *url, int error) {
+ (void)url;
+ (void)error;
+ }
+ /** Reports the result of calling the \ref ar::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. (CDN live only.)
+
+ This callback indicates whether you have successfully removed an RTMP stream from the CDN.
+
+ @param url The RTMP URL address.
+ */
+ virtual void onStreamUnpublished(const char *url) {
+ (void)url;
+ }
+/** Occurs when the publisher's transcoding is updated.
+ *
+ * When the `LiveTranscoding` class in the \ref ar::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" method updates, the SDK triggers the `onTranscodingUpdated` callback to report the update information to the local host.
+ *
+ * @note If you call the `setLiveTranscoding` method to set the LiveTranscoding class for the first time, the SDK does not trigger the `onTranscodingUpdated` callback.
+ *
+ */
+ virtual void onTranscodingUpdated() {
+ }
+ /** Occurs when a voice or video stream URL address is added to a live broadcast.
+
+ @param url Pointer to the URL address of the externally injected stream.
+ @param uid User ID.
+ @param status State of the externally injected stream: #INJECT_STREAM_STATUS.
+ */
+ virtual void onStreamInjectedStatus(const char* url, uid_t uid, int status) {
+ (void)url;
+ (void)uid;
+ (void)status;
+ }
+
+ /** Occurs when the local audio route changes.
+
+ The SDK triggers this callback when the local audio route switches to an earpiece, speakerphone, headset, or Bluetooth device.
+
+ @note This callback is for Android and iOS only.
+
+ @param routing Audio output routing. See: #AUDIO_ROUTE_TYPE.
+ */
+ virtual void onAudioRouteChanged(AUDIO_ROUTE_TYPE routing) {
+ (void)routing;
+ }
+
+ /** Occurs when the locally published media stream falls back to an audio-only stream due to poor network conditions or switches back to the video after the network conditions improve.
+
+ If you call \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" and set *option* as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves.
+
+ @param isFallbackOrRecover Whether the locally published stream falls back to audio-only or switches back to the video:
+ - true: The locally published stream falls back to audio-only due to poor network conditions.
+ - false: The locally published stream switches back to the video after the network conditions improve.
+ */
+ virtual void onLocalPublishFallbackToAudioOnly(bool isFallbackOrRecover) {
+ (void)isFallbackOrRecover;
+ }
+
+ /** Occurs when the remote media stream falls back to audio-only stream
+ * due to poor network conditions or switches back to the video stream
+ * after the network conditions improve.
+ *
+ * If you call
+ * \ref IRtcEngine::setRemoteSubscribeFallbackOption
+ * "setRemoteSubscribeFallbackOption" and set
+ * @p option as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this
+ * callback when the remote media stream falls back to audio-only mode due
+ * to poor uplink conditions, or when the remote media stream switches
+ * back to the video after the uplink network condition improves.
+ *
+ * @note Once the remote media stream switches to the low stream due to
+ * poor network conditions, you can monitor the stream switch between a
+ * high and low stream in the RemoteVideoStats callback.
+ *
+ * @param uid ID of the remote user sending the stream.
+ * @param isFallbackOrRecover Whether the remotely subscribed media stream
+ * falls back to audio-only or switches back to the video:
+ * - true: The remotely subscribed media stream falls back to audio-only
+ * due to poor network conditions.
+ * - false: The remotely subscribed media stream switches back to the
+ * video stream after the network conditions improved.
+ */
+ virtual void onRemoteSubscribeFallbackToAudioOnly(uid_t uid, bool isFallbackOrRecover) {
+ (void)uid;
+ (void)isFallbackOrRecover;
+ }
+
+ /** Reports the transport-layer statistics of each remote audio stream.
+ *
+ * @deprecated
+ * This callback is deprecated and replaced by the
+ * \ref onRemoteAudioStats() "onRemoteAudioStats" callback.
+ *
+ * This callback reports the transport-layer statistics, such as the
+ * packet loss rate and network time delay, once every two seconds after
+ * the local user receives an audio packet from a remote user.
+ *
+ * @param uid User ID of the remote user sending the audio packet.
+ * @param delay Network time delay (ms) from the remote user sending the
+ * audio packet to the local user.
+ * @param lost Packet loss rate (%) of the audio packet sent from the
+ * remote user.
+ * @param rxKBitRate Received bitrate (Kbps) of the audio packet sent
+ * from the remote user.
+ */
+ virtual void onRemoteAudioTransportStats(
+ uid_t uid, unsigned short delay, unsigned short lost,
+ unsigned short rxKBitRate) {
+ (void)uid;
+ (void)delay;
+ (void)lost;
+ (void)rxKBitRate;
+ }
+
+ /** Reports the transport-layer statistics of each remote video stream.
+ *
+ * @deprecated
+ * This callback is deprecated and replaced by the
+ * \ref onRemoteVideoStats() "onRemoteVideoStats" callback.
+ *
+ * This callback reports the transport-layer statistics, such as the
+ * packet loss rate and network time delay, once every two seconds after
+ * the local user receives a video packet from a remote user.
+ *
+ * @param uid User ID of the remote user sending the video packet.
+ * @param delay Network time delay (ms) from the remote user sending the
+ * video packet to the local user.
+ * @param lost Packet loss rate (%) of the video packet sent from the
+ * remote user.
+ * @param rxKBitRate Received bitrate (Kbps) of the video packet sent
+ * from the remote user.
+ */
+ virtual void onRemoteVideoTransportStats(
+ uid_t uid, unsigned short delay, unsigned short lost,
+ unsigned short rxKBitRate) {
+ (void)uid;
+ (void)delay;
+ (void)lost;
+ (void)rxKBitRate;
+ }
+
+ /** **DEPRECATED** Occurs when the microphone is enabled/disabled.
+ *
+ * The \ref onMicrophoneEnabled() "onMicrophoneEnabled" callback is
+ * deprecated. Use #LOCAL_AUDIO_STREAM_STATE_STOPPED (0) or
+ * #LOCAL_AUDIO_STREAM_STATE_RECORDING (1) in the
+ * \ref onLocalAudioStateChanged() "onLocalAudioStateChanged" callback
+ * instead.
+ *
+ * The SDK triggers this callback when the local user resumes or stops
+ * capturing the local audio stream by calling the
+ * \ref ar::rtc::IRtcEngine::enableLocalAudio "enbaleLocalAudio" method.
+ *
+ * @param enabled Whether the microphone is enabled/disabled:
+ * - true: Enabled.
+ * - false: Disabled.
+ */
+ virtual void onMicrophoneEnabled(bool enabled) {
+ (void)enabled;
+ }
+ /** Occurs when the connection state between the SDK and the server changes.
+
+ @param state See #CONNECTION_STATE_TYPE.
+ @param reason See #CONNECTION_CHANGED_REASON_TYPE.
+ */
+ virtual void onConnectionStateChanged(
+ CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason) {
+ (void)state;
+ (void)reason;
+ }
+
+ /** Occurs when the local network type changes.
+
+ When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions.
+
+ @param type See #NETWORK_TYPE.
+ */
+ virtual void onNetworkTypeChanged(NETWORK_TYPE type) {
+ (void)type;
+ }
+ /** Occurs when the local user successfully registers a user account by calling the \ref ar::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method or joins a channel by calling the \ref ar::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method.This callback reports the user ID and user account of the local user.
+
+ @param uid The ID of the local user.
+ @param userAccount The user account of the local user.
+ */
+ virtual void onLocalUserRegistered(uid_t uid, const char* userAccount) {
+ (void)uid;
+ (void)userAccount;
+ }
+ /** Occurs when the SDK gets the user ID and user account of the remote user.
+
+ After a remote user joins the channel, the SDK gets the UID and user account of the remote user,
+ caches them in a mapping table object (`userInfo`), and triggers this callback on the local client.
+
+ @param uid The ID of the remote user.
+ @param info The `UserInfo` object that contains the user ID and user account of the remote user.
+ */
+ virtual void onUserInfoUpdated(uid_t uid, const UserInfo& info) {
+ (void)uid;
+ (void)info;
+ }
+};
+
+/**
+* Video device collection methods.
+
+ The IVideoDeviceCollection interface class retrieves the video device information.
+*/
+class IVideoDeviceCollection
+{
+protected:
+ virtual ~IVideoDeviceCollection(){}
+public:
+ /** Retrieves the total number of the indexed video devices in the system.
+
+ @return Total number of the indexed video devices:
+ */
+ virtual int getCount() = 0;
+
+ /** Retrieves a specified piece of information about an indexed video device.
+
+ @param index The specified index of the video device that must be less than the return value of \ref IVideoDeviceCollection::getCount "getCount".
+ @param deviceName Pointer to the video device name.
+ @param deviceId Pointer to the video device ID.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Sets the device with the device ID.
+
+ @param deviceId Device ID of the device.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Releases all IVideoDeviceCollection resources.
+ */
+ virtual void release() = 0;
+};
+
+/** Video device management methods.
+
+ The IVideoDeviceManager interface class tests the video device interfaces. Instantiate an AVideoDeviceManager class to retrieve an IVideoDeviceManager interface.
+*/
+class IVideoDeviceManager
+{
+protected:
+ virtual ~IVideoDeviceManager(){}
+public:
+
+ /** Enumerates the video devices.
+
+ This method returns an IVideoDeviceCollection object including all video devices in the system. With the IVideoDeviceCollection object, the application can enumerate the video devices. The application must call the \ref IVideoDeviceCollection::release "release" method to release the returned object after using it.
+
+ @return
+ - An IVideoDeviceCollection object including all video devices in the system: Success.
+ - NULL: Failure.
+ */
+ virtual IVideoDeviceCollection* enumerateVideoDevices() = 0;
+
+ /** Starts the video-capture device test.
+
+ This method tests whether the video-capture device works properly. Before calling this method, ensure that you have already called the \ref IRtcEngine::enableVideo "enableVideo" method, and the window handle (*hwnd*) parameter is valid.
+
+ @param hwnd The window handle used to display the screen.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startDeviceTest(view_t hwnd) = 0;
+
+ /** Stops the video-capture device test.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopDeviceTest() = 0;
+
+ /** Sets a device with the device ID.
+
+ @param deviceId Pointer to the video-capture device ID. Call the \ref IVideoDeviceManager::enumerateVideoDevices "enumerateVideoDevices" method to retrieve it.
+
+ @note Plugging or unplugging the device does not change the device ID.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Retrieves the video-capture device that is in use.
+
+ @param deviceId Pointer to the video-capture device ID.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Select video device for Screen cast.
+
+ @param deviceId Pointer to the video-capture device ID.
+ @note: deviceId - scree0 for default desktop
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int selectScreenCastDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Releases all IVideoDeviceManager resources.
+ */
+ virtual void release() = 0;
+};
+
+/** Audio device collection methods.
+
+The IAudioDeviceCollection interface class retrieves device-related information.
+*/
+class IAudioDeviceCollection
+{
+protected:
+ virtual ~IAudioDeviceCollection(){}
+public:
+
+ /** Retrieves the total number of audio playback or audio recording devices.
+
+ @note You must first call the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" or \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method before calling this method to return the number of audio playback or audio recording devices.
+
+ @return Number of audio playback or audio recording devices.
+ */
+ virtual int getCount() = 0;
+
+ /** Retrieves a specified piece of information about an indexed audio device.
+
+ @param index The specified index that must be less than the return value of \ref IAudioDeviceCollection::getCount "getCount".
+ @param deviceName Pointer to the audio device name.
+ @param deviceId Pointer to the audio device ID.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Specifies a device with the device ID.
+
+ @param deviceId Pointer to the device ID of the device.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Sets the volume of the application.
+
+ @param volume Application volume. The value ranges between 0 (lowest volume) and 255 (highest volume).
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setApplicationVolume(int volume) = 0;
+
+ /** Retrieves the volume of the application.
+
+ @param volume Pointer to the application volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getApplicationVolume(int& volume) = 0;
+
+ /** Mutes the application.
+
+ @param mute Sets whether to mute/unmute the application:
+ - true: Mute the application.
+ - false: Unmute the application.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setApplicationMute(bool mute) = 0;
+ /** Gets the mute state of the application.
+
+ @param mute Pointer to whether the application is muted/unmuted.
+ - true: The application is muted.
+ - false: The application is not muted.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int isApplicationMute(bool& mute) = 0;
+
+ /** Releases all IAudioDeviceCollection resources.
+ */
+ virtual void release() = 0;
+};
+/** Audio device management methods.
+
+ The IAudioDeviceManager interface class allows for audio device interface testing. Instantiate an AAudioDeviceManager class to retrieve the IAudioDeviceManager interface.
+*/
+class IAudioDeviceManager
+{
+protected:
+ virtual ~IAudioDeviceManager(){}
+public:
+
+ /** Enumerates the audio playback devices.
+
+ This method returns an IAudioDeviceCollection object that includes all audio playback devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio playback devices.
+
+ @note The application must call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it.
+
+ @return
+ - Success: Returns an IAudioDeviceCollection object that includes all audio playback devices in the system. For wireless Bluetooth headset devices with master and slave headsets, the master headset is the playback device.
+ - Returns NULL: Failure.
+ */
+ virtual IAudioDeviceCollection* enumeratePlaybackDevices() = 0;
+
+ /** Enumerates the audio recording devices.
+
+ This method returns an IAudioDeviceCollection object that includes all audio recording devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio recording devices.
+
+ @note The application needs to call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it.
+
+ @return
+ - Returns an IAudioDeviceCollection object that includes all audio recording devices in the system: Success.
+ - Returns NULL: Failure.
+ */
+ virtual IAudioDeviceCollection* enumerateRecordingDevices() = 0;
+
+ /** Sets the audio playback device using the device ID.
+
+ @note Plugging or unplugging the audio device does not change the device ID.
+
+ @param deviceId Device ID of the audio playback device, retrieved by calling the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" method.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setPlaybackDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Sets the audio recording device using the device ID.
+
+ @param deviceId Device ID of the audio recording device, retrieved by calling the \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method.
+
+ @note Plugging or unplugging the audio device does not change the device ID.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRecordingDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Starts the audio playback device test.
+
+ This method tests if the playback device works properly. In the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly.
+
+ @param testAudioFilePath Pointer to the path of the audio file for the audio playback device test in UTF-8:
+ - Supported file formats: wav, mp3, m4a, and aac.
+ - Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz.
+
+ @return
+ - 0: Success, and you can hear the sound of the specified audio file.
+ - < 0: Failure.
+ */
+ virtual int startPlaybackDeviceTest(const char* testAudioFilePath) = 0;
+
+ /** Stops the audio playback device test.
+
+ This method stops testing the audio playback device. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startPlaybackDeviceTest "startPlaybackDeviceTest" method.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopPlaybackDeviceTest() = 0;
+
+ /** Sets the volume of the audio playback device.
+
+ @param volume Sets the volume of the audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume).
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setPlaybackDeviceVolume(int volume) = 0;
+
+ /** Retrieves the volume of the audio playback device.
+
+ @param volume Pointer to the audio playback device volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume).
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getPlaybackDeviceVolume(int *volume) = 0;
+
+ /** Sets the volume of the microphone.
+
+ @param volume Sets the volume of the microphone. The value ranges between 0 (lowest volume) and 255 (highest volume).
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRecordingDeviceVolume(int volume) = 0;
+
+ /** Retrieves the volume of the microphone.
+
+ @param volume Pointer to the microphone volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume).
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getRecordingDeviceVolume(int *volume) = 0;
+
+ /** Mutes the audio playback device.
+
+ @param mute Sets whether to mute/unmute the audio playback device:
+ - true: Mutes.
+ - false: Unmutes.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setPlaybackDeviceMute(bool mute) = 0;
+ /** Retrieves the mute status of the audio playback device.
+
+ @param mute Pointer to whether the audio playback device is muted/unmuted.
+ - true: Muted.
+ - false: Unmuted.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getPlaybackDeviceMute(bool *mute) = 0;
+ /** Mutes/Unmutes the microphone.
+
+ @param mute Sets whether to mute/unmute the microphone:
+ - true: Mutes.
+ - false: Unmutes.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRecordingDeviceMute(bool mute) = 0;
+
+ /** Retrieves the microphone's mute status.
+
+ @param mute Pointer to whether the microphone is muted/unmuted.
+ - true: Muted.
+ - false: Unmuted.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getRecordingDeviceMute(bool *mute) = 0;
+
+ /** Starts the microphone test.
+
+ This method tests whether the microphone works properly. Once the test starts, the SDK uses the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback to notify the application with the volume information.
+
+ @param indicationInterval Interval period (ms) of the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback cycle.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startRecordingDeviceTest(int indicationInterval) = 0;
+
+ /** Stops the microphone test.
+
+ This method stops the microphone test. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startRecordingDeviceTest "startRecordingDeviceTest" method.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopRecordingDeviceTest() = 0;
+
+ /** Retrieves the audio playback device associated with the device ID.
+
+ @param deviceId Pointer to the ID of the audio playback device.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getPlaybackDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Retrieves the audio playback device information associated with the device ID and device name.
+
+ @param deviceId Pointer to the device ID of the audio playback device.
+ @param deviceName Pointer to the device name of the audio playback device.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getPlaybackDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Retrieves the audio recording device associated with the device ID.
+
+ @param deviceId Pointer to the device ID of the audio recording device.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getRecordingDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Retrieves the audio recording device information associated with the device ID and device name.
+
+ @param deviceId Pointer to the device ID of the recording audio device.
+ @param deviceName Pointer to the device name of the recording audio device.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getRecordingDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0;
+
+ /** Starts the audio device loopback test.
+
+ This method tests whether the local audio devices are working properly. After calling this method, the microphone captures the local audio and plays it through the speaker. The \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns the local audio volume information at the set interval.
+
+ @note This method tests the local audio devices and does not report the network conditions.
+
+ @param indicationInterval The time interval (ms) at which the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startAudioDeviceLoopbackTest(int indicationInterval) = 0;
+
+ /** Stops the audio device loopback test.
+
+ @note Ensure that you call this method to stop the loopback test after calling the \ref IAudioDeviceManager::startAudioDeviceLoopbackTest "startAudioDeviceLoopbackTest" method.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopAudioDeviceLoopbackTest() = 0;
+
+ /** Releases all IAudioDeviceManager resources.
+ */
+ virtual void release() = 0;
+};
+
+/** The configuration of the log files.
+ *
+ * @since v3.3.0
+ */
+struct LogConfig
+{
+ /** The absolute path of log files.
+ *
+ * The default file path is:
+ * - Android: `/storage/emulated/0/Android/data/<package name>/files/ar_sdk.log`
+ * - iOS: `App Sandbox/Library/caches/ar_sdk.log`
+ * - macOS:
+ * - Sandbox enabled: `App Sandbox/Library/Logs/ar_sdk.log`, such as `/Users/<username>/Library/Containers/<App Bundle Identifier>/Data/Library/Logs/ar_sdk.log`.
+ * - Sandbox disabled: `~/Library/Logs/ar_sdk.log`.
+ * - Windows: `C:\Users\<user_name>\AppData\Local\AR\<process_name>\ar_sdk.log`
+ *
+ * Ensure that the directory for the log files exists and is writable. You can use this parameter to rename the log files.
+ */
+ const char* filePath;
+ /** The size (KB) of a log file. The default value is 1024 KB. If you set `fileSize` to 1024 KB, the SDK outputs at most 5 MB log files;
+ * if you set it to less than 1024 KB, the setting is invalid, and the maximum size of a log file is still 1024 KB.
+ */
+ int fileSize;
+ /** The output log level of the SDK. See #LOG_LEVEL.
+ *
+ * For example, if you set the log level to WARN, the SDK outputs the logs within levels FATAL, ERROR, and WARN.
+ */
+ LOG_LEVEL level;
+ LogConfig()
+ :filePath(NULL)
+ ,fileSize(-1)
+ ,level(LOG_LEVEL::LOG_LEVEL_INFO)
+ {}
+};
+
+/** Definition of RtcEngineContext.
+*/
+struct RtcEngineContext
+{
+ /** The IRtcEngineEventHandler object.
+ */
+ IRtcEngineEventHandler* eventHandler;
+ /** App ID issued to you by AR. Apply for a new App ID from AR if
+ * it is missing from your kit.
+ */
+ const char* appId;
+ // For android, it the context(Activity or Application
+ // for windows,Video hot plug device
+ /** The video window handle. Once set, this parameter enables you to plug
+ * or unplug the video devices while they are powered.
+ */
+ void* context;
+ /**
+ * The region for connection. This advanced feature applies to scenarios that have regional restrictions.
+ *
+ * For the regions that AR supports, see #AREA_CODE. After specifying the region, the app that integrates the AR SDK connects to the AR servers within that region.
+ */
+ unsigned int areaCode;
+ /** The configuration of the log files that the SDK outputs. See LogConfig.
+ *
+ * @since v3.3.0
+ *
+ * By default, the SDK outputs five log files, `ar_sdk.log`, `ar_sdk_1.log`, `ar_sdk_2.log`, `ar_sdk_3.log`, `ar_sdk_4.log`, each with
+ * a default size of 1024 KB. These log files are encoded in UTF-8. The SDK writes the latest logs in `ar_sdk.log`. When `ar_sdk.log` is
+ * full, the SDK deletes the log file with the earliest modification time among the other four, renames `ar_sdk.log` to the name of the
+ * deleted log file, and creates a new `ar_sdk.log` to record latest logs.
+ *
+ */
+ LogConfig logConfig;
+ RtcEngineContext()
+ :eventHandler(NULL)
+ ,appId(NULL)
+ ,context(NULL)
+ ,areaCode(rtc::AREA_CODE_GLOB)
+ {}
+};
+
+/** Definition of IMetadataObserver
+*/
+class IMetadataObserver
+{
+public:
+ /** Metadata type of the observer.
+ @note We only support video metadata for now.
+ */
+ enum METADATA_TYPE
+ {
+ /** -1: the metadata type is unknown.
+ */
+ UNKNOWN_METADATA = -1,
+ /** 0: the metadata type is video.
+ */
+ VIDEO_METADATA = 0,
+ };
+
+ struct Metadata
+ {
+ /** The User ID.
+
+ - For the receiver: the ID of the user who sent the metadata.
+ - For the sender: ignore it.
+ */
+ char* uid;
+ /** Buffer size of the sent or received Metadata.
+ */
+ unsigned int size;
+ /** Buffer address of the sent or received Metadata.
+ */
+ unsigned char *buffer;
+ /** Time statmp of the frame following the metadata.
+ */
+ long long timeStampMs;
+ };
+
+ virtual ~IMetadataObserver() {};
+
+ /** Occurs when the SDK requests the maximum size of the Metadata.
+
+ The metadata includes the following parameters:
+ - `uid`: ID of the user who sends the metadata.
+ - `size`: The size of the sent or received metadata.
+ - `buffer`: The sent or received metadata.
+ - `timeStampMs`: The timestamp of the metadata.
+
+ The SDK triggers this callback after you successfully call the \ref ar::rtc::IRtcEngine::registerMediaMetadataObserver "registerMediaMetadataObserver" method. You need to specify the maximum size of the metadata in the return value of this callback.
+
+ @return The maximum size of the buffer of the metadata that you want to use. The highest value is 1024 bytes. Ensure that you set the return value.
+ */
+ virtual int getMaxMetadataSize() = 0;
+
+ /** Occurs when the SDK is ready to receive and send metadata.
+
+ @note Ensure that the size of the metadata does not exceed the value set in the \ref ar::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback.
+
+ @param metadata The Metadata to be sent.
+ @return
+ - true: Send.
+ - false: Do not send.
+ */
+ virtual bool onReadyToSendMetadata(Metadata &metadata) = 0;
+
+ /** Occurs when the local user receives the metadata.
+
+ @param metadata The received Metadata.
+ */
+ virtual void onMetadataReceived(const Metadata &metadata) = 0;
+};
+
+/** Encryption mode.
+*/
+enum ENCRYPTION_MODE
+{
+ /** 1: (Default) 128-bit AES encryption, XTS mode.
+ */
+ AES_128_XTS = 1,
+ /** 2: 128-bit AES encryption, ECB mode.
+ */
+ AES_128_ECB = 2,
+ /** 3: 256-bit AES encryption, XTS mode.
+ */
+ AES_256_XTS = 3,
+ /** 4: 128-bit SM4 encryption, ECB mode.
+ */
+ SM4_128_ECB = 4,
+ /** Enumerator boundary.
+ */
+ MODE_END,
+};
+
+/** Configurations of built-in encryption schemas. */
+struct EncryptionConfig{
+ /**
+ * Encryption mode. The default encryption mode is `AES_128_XTS`. See #ENCRYPTION_MODE.
+ */
+ ENCRYPTION_MODE encryptionMode;
+ /**
+ * Encryption key in string type.
+ *
+ * @note If you do not set an encryption key or set it as NULL, you cannot use the built-in encryption, and the SDK returns #ERR_INVALID_ARGUMENT (-2).
+ */
+ const char* encryptionKey;
+
+ EncryptionConfig() {
+ encryptionMode = AES_128_XTS;
+ encryptionKey = nullptr;
+ }
+
+ /// @cond
+ const char* getEncryptionString() const {
+ switch(encryptionMode)
+ {
+ case AES_128_XTS:
+ return "aes-128-xts";
+ case AES_128_ECB:
+ return "aes-128-ecb";
+ case AES_256_XTS:
+ return "aes-256-xts";
+ case SM4_128_ECB:
+ return "sm4-128-ecb";
+ default:
+ return "aes-128-xts";
+ }
+ return "aes-128-xts";
+ }
+ /// @endcond
+};
+
+/** IRtcEngine is the base interface class of the AR SDK that provides the main AR SDK methods invoked by your application.
+
+Enable the AR SDK's communication functionality through the creation of an IRtcEngine object, then call the methods of this object.
+ */
+class IRtcEngine
+{
+protected:
+ virtual ~IRtcEngine() {}
+public:
+
+ /** 初始化 anyRTC SDK 服务.
+ *
+ * 请确保在调用其他 API 前先调用 createARRtcEngine 和 initialize 创建并初始化 IRtcEngine
+ *
+ * @param context Pointer to the RTC engine context. 详见 RtcEngineContext.
+ *
+ * @return
+ * - 0(ERR_OK): 方法调用成功.
+ * - < 0: 方法调用失败.
+ * - -1(ERR_FAILED): 一般性的错误(未明确归类)。
+ * - -2(ERR_INALID_ARGUMENT): 未提供 IRtcEngineEventHandler 指针。
+ * - -7(ERR_NOT_INITIALIZED): SDK 初始化失败。请检查 context 内容是否正确。
+ * - -22(ERR_RESOURCE_LIMITED): 资源申请失败。当 app 占用资源过多,或系统资源耗尽时,SDK 分配资源失败,会返回该错误
+ * - -101(ERR_INVALID_APP_ID): 不是有效的 App ID.
+ */
+ virtual int initialize(const RtcEngineContext& context) = 0;
+
+ /** 销毁 IRtcEngine 对象并释放资源.
+ *
+ * 该方法释放 anyRTC SDK 使用的所有资源。有些 app 只在用户需要时才进行实时音视频通信,不需要时则将资源释放出来用于其他操作, 该方法适用于此类情况。调用 release 方法后,你将无法再使用 SDK 的其它方法和回调。如需再次使用实时音视频通信功能, 你必须重新依次调用 createARRtcEngine 和 initialize 方法创建一个新的 IRtcEngine 对象.
+ *
+ * @note 如需在销毁后再次创建 IRtcEngine 对象,需要等待 release 方法执行结束后再创建实例.
+ *
+ * @param sync
+ * - true: 该方法为同步调用。需要等待 IRtcEngine 资源释放后才能执行其他操作,所以我们建议在子线程中调用该方法,避免主线程阻塞。此外,我们不建议在 SDK 的回调中调用 release,否则由于 SDK 要等待回调返回才能回收相关的对象资源,会造成死锁。SDK 会自动检测这种死锁并转为异步调用,但是检测本身会消耗额外的时间.
+ * - false: 该方法为异步调用。不需要等待 IRtcEngine 资源释放后就能执行其他操作。使用异步调用时要注意,不要在该调用后立即卸载 SDK 动态库,否则可能会因为 SDK 的清理线程还没有退出而崩溃.
+ */
+ virtual void release(bool sync=false) = 0;
+
+ /** 设置频道场景.
+ *
+ * 该方法用于设置 anyRTC IRtcEngine 频道的使用场景。RtcEngine 会针对不同的使用场景采用不同的优化策略,如通信场景偏好流畅,直播场景偏好画质.
+ *
+ * @warning
+ * - 为保证实时音视频质量,我们建议相同频道内的用户使用同一种频道场景.
+ * - 该方法必须在 joinChannel 前调用和进行设置,进入频道后无法再设置.(Join之后设置返回0,参数不会生效,生成错误日志)
+ * - 不同的频道场景下,SDK 的默认音频路由和默认视频编码码率是不同的,详见 setDefaultAudioRouteToSpeakerphone 和 setVideoEncoderConfiguration 方法中的说明.
+ *
+ * @param profile 频道使用场景. 详见 #CHANNEL_PROFILE_TYPE
+ * @return
+ * - 0(ERR_OK): 方法调用成功.
+ * - < 0: 方法调用失败.
+ * - -2 (ERR_INVALID_ARGUMENT): 参数无效.
+ * - -7(ERR_NOT_INITIALIZED): SDK 尚未初始化.
+ */
+ virtual int setChannelProfile(CHANNEL_PROFILE_TYPE profile) = 0;
+
+ /** 设置用户角色.
+ *
+ * 在加入频道前,用户需要通过本方法设置观众(默认)或主播。在加入频道后,用户可以通过本方法切换用户角色.
+ *
+ * 直播场景下,如果你在加入频道后调用该方法切换用户角色,调用成功后,本地会触发 onClientRoleChanged 回调; 远端会触发 onUserJoined 回调或 onUserOffline (BECOME_AUDIENCE) 回调
+ *
+ * @note
+ * This method applies only to the `LIVE_BROADCASTING` profile.
+ *
+ * @param role Sets the role of the user. See #CLIENT_ROLE_TYPE.
+ *
+ * @return
+ * - 0(ERR_OK): Success.
+ * - < 0: Failure.
+ * - -1(ERR_FAILED): A general error occurs (no specified reason).
+ * - -2(ERR_INALID_ARGUMENT): The parameter is invalid.
+ * - -7(ERR_NOT_INITIALIZED): The SDK is not initialized.
+ */
+ virtual int setClientRole(CLIENT_ROLE_TYPE role) = 0;
+ /// @cond
+ /** Sets the role of a user in a live interactive streaming.
+ *
+ * @since v3.2.0
+ *
+ * You can call this method either before or after joining the channel to set the user role as audience or host. If
+ * you call this method to switch the user role after joining the channel, the SDK triggers the following callbacks:
+ * - The local client: \ref IRtcEngineEventHandler::onClientRoleChanged "onClientRoleChanged".
+ * - The remote client: \ref IRtcEngineEventHandler::onUserJoined "onUserJoined"
+ * or \ref IRtcEngineEventHandler::onUserOffline "onUserOffline".
+ *
+ * @note
+ * - This method applies to the `LIVE_BROADCASTING` profile only (when the `profile` parameter in
+ * \ref IRtcEngine::setChannelProfile "setChannelProfile" is set as `CHANNEL_PROFILE_LIVE_BROADCASTING`).
+ * - The difference between this method and \ref IRtcEngine::setClientRole(CLIENT_ROLE_TYPE) "setClientRole1" is that
+ * this method can set the user level in addition to the user role.
+ * - The user role determines the permissions that the SDK grants to a user, such as permission to send local
+ * streams, receive remote streams, and push streams to a CDN address.
+ * - The user level determines the level of services that a user can enjoy within the permissions of the user's
+ * role. For example, an audience can choose to receive remote streams with low latency or ultra low latency. Levels
+ * affect prices.
+ *
+ * **Example**
+ * ```cpp
+ * ClientRoleOptions options;
+ * options.audienceLatencyLevel = AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY;
+ * options.audienceLatencyLevel = AUDIENCE_LATENCY_LEVEL_LOW_LATENCY;
+ * arEngine->setClientRole(role, options);
+ * ```
+ *
+ * @param role The role of a user in a live interactive streaming. See #CLIENT_ROLE_TYPE.
+ * @param options The detailed options of a user, including user level. See ClientRoleOptions.
+ *
+ * @return
+ * - 0(ERR_OK): Success.
+ * - < 0: Failure.
+ * - -1(ERR_FAILED): A general error occurs (no specified reason).
+ * - -2(ERR_INALID_ARGUMENT): The parameter is invalid.
+ * - -7(ERR_NOT_INITIALIZED): The SDK is not initialized.
+ */
+ virtual int setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions& options) = 0;
+ /// @endcond
+ /** 加入频道.
+
+ 该方法让用户加入通话频道,在同一个频道内的用户可以互相通话,多个用户加入同一个频道,可以群聊。 使用不同 App ID 的 App 是不能互通的.
+
+ 如果已在通话中,用户必须调用 leaveChannel 退出当前通话,才能进入下一个频道.
+
+ 成功调用该方加入频道后,会触发如下回调:
+ - 本地:客户端会触发:onJoinChannelSuccess 回调
+ - 远端:通信场景下的用户和直播场景下的主播加入频道后,远端会触发 onUserJoined 回调.
+
+ 在网络状况不理想的情况下,客户端可能会与 anyRTC 的服务器失去连接;SDK 会自动尝试重连,重连成功后,本地会触发 onRejoinChannelSuccess 回调.
+
+ 用户成功加入频道后,默认订阅频道内所有其他用户的音频流和视频流,因此产生用量并影响计费。如果想取消订阅,可以通过调用相应的 mute 方法实现
+
+ @note 频道内每个用户的用户 ID 必须是唯一的。如果将 uid 设为NULL或空字符串,系统将自动分配一个 uid。如果想要从不同的设备同时接入同一个频道,请确保每个设备上使用的 uid 是不同的.
+ @warning 请务必确保用于生成 Token 的 App ID 和 initialize 方法初始化引擎时用的是同一个 App ID,否则会造成旁路推流失败.
+
+ @param 动态秘钥 (由应用的服务端生成。在大多数情况下,应用程序ID即可满足安全需求。为了增加更高安全性,还请使用令牌).
+ - 安全要求不高: 将值设为 NULL.
+ - 安全要求高: 将值设置为 Token。如果你已经启用了 App Certificate, 请务必使用 Token.
+ @param channelId 标识通话的频道名称,长度在 64 字节以内的字符串。以下为支持的字符集范围(共 89 个字符):
+ - 26 个小写英文字母(All lowercase English letters): a to z.
+ - 26 个大写英文字母(All uppercase English letters): A to Z.
+ - 10个数字(All numeric characters): 0 to 9.
+ - 空格(The space character).
+ - 特殊字符(Punctuation characters and other symbols, including): "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
+ @param info (非必选项) 开发者需加入的任何附加信息。一般可设置为空字符串,或频道相关信息。该信息不会传递给频道内的其他用户.
+ @param uid (非必选项) 用户 ID,最多32位字符串,并保证唯一性。如果不指定(即设为NULL或空字符串),SDK 会自动分配一个,并在 onJoinChannelSuccess 回调方法中返回,App 层必须记住该返回值并维护,SDK 不对该返回值进行维护.
+
+ @返回
+ - 0(ERR_OK): 方法调用成功。
+ - < 0: 方法调用失败。
+ - -2(ERR_INALID_ARGUMENT): 参数无效。
+ - -3(ERR_NOT_READY): SDK 初始化失败,请尝试重新初始化 SDK。
+ - -5(ERR_REFUSED): 调用被拒绝。可能有如下两个原因:
+ 已经创建了一个同名的 IChannel 频道。
+ 已经通过 IChannel 加入了一个频道,并在该 IChannel 频道中发布了音视频流。由于通过 IRtcEngine 加入频道会默认发布音视频流,而 SDK 不支持同时在两个频道发布音视频流,因此会报错。
+ - -7(ERR_NOT_INITIALIZED): SDK 尚未初始化,就调用该方法。请确认在调用 API 之前已创建 IRtcEngine 对象并完成初始化。
+ */
+ virtual int joinChannel(const char* token, const char* channelId, const char* info, uid_t uid) = 0;
+ /** 快速切换直播频道.
+ *
+ * 当直播频道中的观众想从一个频道切换到另一个频道时,可以调用该方法,实现快速切换.
+ *
+ * 成功调用该方切换频道后,本地会先收到离开原频道的回调 onLeaveChannel,再收到成功加入新频道的回调 onJoinChannelSuccess。
+ * 用户成功切换频道后,默认订阅频道内所有其他用户的音频流和视频流,因此产生用量并影响计费。如果想取消订阅,可以通过调用相应的 mute 方法实现。
+ *
+ * @note
+ * 该方法仅适用于直播场景中,角色为观众的用户。
+ *
+ * @param token 在服务器端生成的用于鉴权的 Token:
+ * - 安全要求不高:你可以使用控制台生成的临时 Token,详见 获取临时 Token.
+ * - 安全要求高:将值设为你的服务端生成的正式 Token,详见 获取正式 Token.
+ * @param channelId 标识频道的频道名,最大不超过 64 字节。以下为支持的字符集范围 (共 89 个字符):
+ * - The 26 lowercase English letters: a to z.
+ * - The 26 uppercase English letters: A to Z.
+ * - The 10 numbers: 0 to 9.
+ * - The space.
+ * - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".",
+ * ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
+
+ @return
+ - 0(ERR_OK): Success.
+ - < 0: Failure.
+ - -1(ERR_FAILED): 一般性的错误(未明确归类)。
+ - -2(ERR_INALID_ARGUMENT): 参数无效。
+ - -5(ERR_REFUSED): 调用被拒绝。可能因为用户角色不是观众。
+ - -7(ERR_NOT_INITIALIZED): SDK 尚未初始化。
+ - -102(ERR_INVALID_CHANNEL_NAME): 频道名无效。请更换有效的频道名。
+ - -113(ERR_NOT_IN_CHANNEL): 用户不在频道内。
+
+ */
+ virtual int switchChannel(const char* token, const char* channelId) = 0;
+
+ /** 离开频道,即挂断或退出通话.
+
+ 当调用 joinChannel 方法后,必须调用 leaveChannel 结束通话,否则无法开始下一次通话。不管当前是否在通话中,都可以调用 leaveChannel,没有副作用。
+
+ 该方法会把会话相关的所有资源释放掉。
+
+ 该方法是异步操作,调用返回时并没有真正退出频道。
+
+ 在真正退出频道后,SDK 会触发 onLeaveChannel 回调:
+ - 成功调用该方法离开频道后,本地会触发 onLeaveChannel 回调;
+ - 通信场景下的用户和直播场景下的主播离开频道后,远端会触发 onUserOffline 回调。
+
+ @note
+ - 如果你调用了 leaveChannel 后立即调用 release,SDK 将无法触发 onLeaveChannel 回调。
+ - 如果你在旁路推流时调用 leaveChannel 方法, SDK 将自动调用 removePublishStreamUrl 方法。
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ - -1(ERR_FAILED): 一般性的错误(未明确归类)。
+ - -2(ERR_INALID_ARGUMENT): 参数无效。
+ - -7(ERR_NOT_INITIALIZED): SDK 尚未初始化。
+ */
+ virtual int leaveChannel() = 0;
+
+ /** 更新 Token.
+
+ 该方法用于更新 Token。如果启用了 Token 机制,过一段时间后使用的 Token 会失效。当:
+
+ - 发生 onTokenPrivilegeWillExpire 回调时,或发生
+ - onConnectionStateChanged 回调报告 CONNECTION_CHANGED_TOKEN_EXPIRED(9) 时。
+
+ App 应重新获取 Token,然后调用该方法更新 Token,否则 SDK 无法和服务器建立连接。
+
+ @param token Pointer to the new token.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ - -1(ERR_FAILED): 一般性的错误(未明确归类)。
+ - -2(ERR_INALID_ARGUMENT): 参数无效。
+ - -7(ERR_NOT_INITIALIZED): SDK 尚未初始化。
+ */
+ virtual int renewToken(const char* token) = 0;
+
+ /** 获取设备管理员对象的指针.
+
+ @param iid 想要获取的接口的ID.
+ @param inter 指向 DeviceManager 对象的指针.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0;
+
+ /** Registers a user account.
+
+ Once registered, the user account can be used to identify the local user when the user joins the channel.
+ After the user successfully registers a user account, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" callback on the local client,
+ reporting the user ID and user account of the local user.
+
+ To join a channel with a user account, you can choose either of the following:
+
+ - Call the \ref ar::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method to create a user account, and then the \ref ar::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel.
+ - Call the \ref ar::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel.
+
+ The difference between the two is that for the former, the time elapsed between calling the \ref ar::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method
+ and joining the channel is shorter than the latter.
+
+ @note
+ - Ensure that you set the `userAccount` parameter. Otherwise, this method does not take effect.
+ - Ensure that the value of the `userAccount` parameter is unique in the channel.
+ - To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the AR Web SDK, ensure that the uid of the user is set to the same parameter type.
+
+ @param appId The App ID of your project.
+ @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
+ - All lowercase English letters: a to z.
+ - All uppercase English letters: A to Z.
+ - All numeric characters: 0 to 9.
+ - The space character.
+ - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int registerLocalUserAccount(
+ const char* appId, const char* userAccount) = 0;
+ /** Joins the channel with a user account.
+
+ After the user successfully joins the channel, the SDK triggers the following callbacks:
+
+ - The local client: \ref ar::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" and \ref ar::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" .
+ The remote client: \ref ar::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" and \ref ar::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" , if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile.
+
+ @note To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account.
+ If a user joins the channel with the AR Web SDK, ensure that the uid of the user is set to the same parameter type.
+
+ @param token The token generated at your server:
+ - For low-security requirements: You can use the temporary token generated at Console. For details, see [Get a temporary toke](https://docs.ar.io/en/Voice/token?platform=All%20Platforms#get-a-temporary-token).
+ - For high-security requirements: Set it as the token generated at your server. For details, see [Get a token](https://docs.ar.io/en/Voice/token?platform=All%20Platforms#get-a-token).
+ @param channelId The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
+ The 26 lowercase English letters: a to z.
+ - The 26 uppercase English letters: A to Z.
+ - The 10 numbers: 0 to 9.
+ - The space.
+ - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
+ @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
+ - The 26 lowercase English letters: a to z.
+ - The 26 uppercase English letters: A to Z.
+ - The 10 numbers: 0 to 9.
+ - The space.
+ - "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ - #ERR_INVALID_ARGUMENT (-2)
+ - #ERR_NOT_READY (-3)
+ - #ERR_REFUSED (-5)
+ */
+ virtual int joinChannelWithUserAccount(const char* token,
+ const char* channelId,
+ const char* userAccount) = 0;
+
+ /** Gets the user information by passing in the user account.
+
+ After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them
+ in a mapping table object (`userInfo`), and triggers the \ref ar::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client.
+
+ After receiving the o\ref ar::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback, you can call this method to get the user ID of the
+ remote user from the `userInfo` object by passing in the user account.
+
+ @param userAccount The user account of the user. Ensure that you set this parameter.
+ @param[in/out] userInfo A userInfo object that identifies the user:
+ - Input: A userInfo object.
+ - Output: A userInfo object that contains the user account and user ID of the user.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getUserInfoByUserAccount(const char* userAccount, UserInfo* userInfo) = 0;
+ /** Gets the user information by passing in the user ID.
+
+ After a remote user joins the channel, the SDK gets the user ID and user account of the remote user,
+ caches them in a mapping table object (`userInfo`), and triggers the \ref ar::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client.
+
+ After receiving the \ref ar::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback, you can call this method to get the user account of the remote user
+ from the `userInfo` object by passing in the user ID.
+
+ @param uid The user ID of the remote user. Ensure that you set this parameter.
+ @param[in/out] userInfo A userInfo object that identifies the user:
+ - Input: A userInfo object.
+ - Output: A userInfo object that contains the user account and user ID of the user.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getUserInfoByUid(uid_t uid, UserInfo* userInfo) = 0;
+
+ /** **DEPRECATED** Starts an audio call test.
+
+ This method is deprecated as of v2.4.0.
+
+ This method starts an audio call test to check whether the audio devices (for example, headset and speaker) and the network connection are working properly.
+
+ To conduct the test:
+
+ - The user speaks and the recording is played back within 10 seconds.
+ - If the user can hear the recording within 10 seconds, the audio devices and network connection are working properly.
+
+ @note
+ - After calling this method, always call the \ref IRtcEngine::stopEchoTest "stopEchoTest" method to end the test. Otherwise, the application cannot run the next echo test.
+ - In the Live-broadcast profile, only the hosts can call this method. If the user switches from the Communication to Live-broadcast profile, the user must call the \ref IRtcEngine::setClientRole "setClientRole" method to change the user role from the audience (default) to the host before calling this method.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startEchoTest() = 0;
+
+ /** 开始语音通话回路测试.
+
+ 该方法启动语音通话测试,目的是测试系统的音频设备(耳麦、扬声器等)和网络连接是否正常。
+
+ 在测试过程中,用户先说一段话,声音会在设置的时间间隔(单位为秒)后回放出来。 如果用户能正常听到自己刚才说的话,就表示系统音频设备和网络连接都是正常的。
+
+ @note
+ - 请在加入频道前调用该方法。
+ - 调用 startEchoTest 后必须调用 stopEchoTest 以结束测试,否则不能进行下一次回声测试,也无法加入频道。
+ - 直播场景下,该方法仅能由用户角色为主播的用户调用。
+ @param intervalInSeconds 设置返回语音通话回路测试结果的时间间隔,取值范围为 [2, 10],单位为秒,默认为 10 秒。
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startEchoTest(int intervalInSeconds) = 0;
+
+ /** 停止语音通话回路测试。
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopEchoTest() = 0;
+
+ /** Enables the video module.
+
+ Call this method either before joining a channel or during a call. If this method is called before joining a channel, the call starts in the video mode. If this method is called during an audio call, the audio mode switches to the video mode. To disable the video module, call the \ref IRtcEngine::disableVideo "disableVideo" method.
+
+ A successful \ref ar::rtc::IRtcEngine::enableVideo "enableVideo" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (true) callback on the remote client.
+ @note
+ - This method affects the internal engine and can be called after the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method.
+ - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately:
+ - \ref IRtcEngine::enableLocalVideo "enableLocalVideo": Whether to enable the camera to create the local video stream.
+ - \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream": Whether to publish the local video stream.
+ - \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream": Whether to subscribe to and play the remote video stream.
+ - \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams": Whether to subscribe to and play all remote video streams.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableVideo() = 0;
+
+ /** Disables the video module.
+
+ This method can be called before joining a channel or during a call. If this method is called before joining a channel, the call starts in audio mode. If this method is called during a video call, the video mode switches to the audio mode. To enable the video module, call the \ref IRtcEngine::enableVideo "enableVideo" method.
+
+ A successful \ref ar::rtc::IRtcEngine::disableVideo "disableVideo" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (false) callback on the remote client.
+ @note
+ - This method affects the internal engine and can be called after the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method.
+ - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately:
+ - \ref IRtcEngine::enableLocalVideo "enableLocalVideo": Whether to enable the camera to create the local video stream.
+ - \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream": Whether to publish the local video stream.
+ - \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream": Whether to subscribe to and play the remote video stream.
+ - \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams": Whether to subscribe to and play all remote video streams.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int disableVideo() = 0;
+
+ /** **DEPRECATED** Sets the video profile.
+
+ This method is deprecated as of v2.3. Use the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method instead.
+
+ Each video profile includes a set of parameters, such as the resolution, frame rate, and bitrate. If the camera device does not support the specified resolution, the SDK automatically chooses a suitable camera resolution, keeping the encoder resolution specified by the *setVideoProfile* method.
+
+ @note
+ - If you do not need to set the video profile after joining the channel, call this method before the \ref IRtcEngine::enableVideo "enableVideo" method to reduce the render time of the first video frame.
+ - Always set the video profile before calling the \ref IRtcEngine::joinChannel "joinChannel" or \ref IRtcEngine::startPreview "startPreview" method.
+
+ @param profile Sets the video profile. See #VIDEO_PROFILE_TYPE.
+ @param swapWidthAndHeight Sets whether to swap the width and height of the video stream:
+ - true: Swap the width and height.
+ - false: (Default) Do not swap the width and height.
+ The width and height of the output video are consistent with the set video profile.
+ @note Since the landscape or portrait mode of the output video can be decided directly by the video profile, We recommend setting *swapWidthAndHeight* to *false* (default).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setVideoProfile(VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight) = 0;
+
+ /** Sets the video encoder configuration.
+
+ Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation.
+
+ The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found.
+
+ @note If you do not need to set the video encoder configuration after joining the channel, you can call this method before the \ref IRtcEngine::enableVideo "enableVideo" method to reduce the render time of the first video frame.
+
+ @param config Sets the local video encoder configuration. See VideoEncoderConfiguration.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setVideoEncoderConfiguration(const VideoEncoderConfiguration& config) = 0;
+ /** Sets the camera capture configuration.
+
+ For a video call or live broadcast, generally the SDK controls the camera output parameters. When the default camera capturer settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration:
+
+ - If the resolution or frame rate of the captured raw video data are higher than those set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration", processing video frames requires extra CPU and RAM usage and degrades performance. We recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1 to avoid such problems.
+ - If you do not need local video preview or are willing to sacrifice preview quality, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1 to optimize CPU and RAM usage.
+ - If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2.
+
+ @note Call this method before enabling the local camera. That said, you can call this method before calling \ref ar::rtc::IRtcEngine::joinChannel "joinChannel", \ref ar::rtc::IRtcEngine::enableVideo "enableVideo", or \ref IRtcEngine::enableLocalVideo "enableLocalVideo", depending on which method you use to turn on your local camera.
+
+ @param config Sets the camera capturer configuration. See CameraCapturerConfiguration.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setCameraCapturerConfiguration(const CameraCapturerConfiguration& config) = 0;
+
+ /** Initializes the local video view.
+
+ This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream.
+
+ Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view.
+ The binding is still valid after the user leaves the channel, which means that the window still displays. To unbind the view, set the *view* in VideoCanvas to NULL.
+
+ @note
+ - Call this method before joining a channel.
+ - To update the rendering or mirror mode of the local video view during a call, use the \ref IRtcEngine::setLocalRenderMode "setLocalRenderMode" method.
+ @param canvas Pointer to the local video view and settings. See VideoCanvas.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setupLocalVideo(const VideoCanvas& canvas) = 0;
+
+ /** Initializes the video view of a remote user.
+
+ This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees.
+
+ Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view.
+
+ The application specifies the uid of the remote video in this method before the remote user joins the channel. If the remote uid is unknown to the application, set it after the application receives the \ref IRtcEngineEventHandler::onUserJoined "onUserJoined" callback.
+ If the Video Recording function is enabled, the Video Recording Service joins the channel as a dummy client, causing other clients to also receive the \ref IRtcEngineEventHandler::onUserJoined "onUserJoined" callback. Do not bind the dummy client to the application view because the dummy client does not send any video streams. If your application does not recognize the dummy client, bind the remote user to the view when the SDK triggers the \ref IRtcEngineEventHandler::onFirstRemoteVideoDecoded "onFirstRemoteVideoDecoded" callback.
+ To unbind the remote user from the view, set the view in VideoCanvas to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user.
+
+ @note To update the rendering or mirror mode of the remote video view during a call, use the \ref IRtcEngine::setRemoteRenderMode "setRemoteRenderMode" method.
+
+ @param canvas Pointer to the remote video view and settings. See VideoCanvas.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setupRemoteVideo(const VideoCanvas& canvas) = 0;
+
+ /** Starts the local video preview before joining the channel.
+
+ Before calling this method, you must:
+
+ - Call the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" method to set up the local preview window and configure the attributes.
+ - Call the \ref IRtcEngine::enableVideo "enableVideo" method to enable video.
+
+ @note Once the startPreview method is called to start the local video preview, if you leave the channel by calling the \ref IRtcEngine::leaveChannel "leaveChannel" method, the local video preview remains until you call the \ref IRtcEngine::stopPreview "stopPreview" method to disable it.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startPreview() = 0;
+
+ /** Prioritizes a remote user's stream.
+
+ Use this method with the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality.
+
+ @note The AR SDK supports setting @p userPriority as high for one user only.
+
+ @param uid The ID of the remote user.
+ @param userPriority Sets the priority of the remote user. See #PRIORITY_TYPE.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRemoteUserPriority(uid_t uid, PRIORITY_TYPE userPriority) = 0;
+
+ /** Stops the local video preview and disables video.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopPreview() = 0;
+
+ /** Enables the audio module.
+
+ The audio mode is enabled by default.
+
+ @note
+ - This method affects the internal engine and can be called after the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method. You can call this method either before or after joining a channel.
+ - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the audio engine modules separately:
+ - \ref IRtcEngine::enableLocalAudio "enableLocalAudio": Whether to enable the microphone to create the local audio stream.
+ - \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream": Whether to publish the local audio stream.
+ - \ref IRtcEngine::muteRemoteAudioStream "muteRemoteAudioStream": Whether to subscribe to and play the remote audio stream.
+ - \ref IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams": Whether to subscribe to and play all remote audio streams.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableAudio() = 0;
+
+ /** Disables/Re-enables the local audio function.
+
+ The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capturing.
+
+ This method does not affect receiving or playing the remote audio streams,and enableLocalAudio(false) is applicable to scenarios where the user wants to
+ receive remote audio streams without sending any audio stream to other users in the channel.
+
+ The SDK triggers the \ref IRtcEngineEventHandler::onMicrophoneEnabled "onMicrophoneEnabled" callback once the local audio function is disabled or enabled.
+
+ @note
+ - Call this method after the \ref IRtcEngine::joinChannel "joinChannel" method.
+ - This method is different from the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method:
+
+ - \ref ar::rtc::IRtcEngine::enableLocalAudio "enableLocalAudio": Disables/Re-enables the local audio capturing and processing.
+ If you disable or re-enable local audio recording using the `enableLocalAudio` method, the local user may hear a pause in the remote audio playback.
+ - \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream": Sends/Stops sending the local audio streams.
+
+ @param enabled Sets whether to disable/re-enable the local audio function:
+ - true: (Default) Re-enable the local audio function, that is, to start the local audio capturing device (for example, the microphone).
+ - false: Disable the local audio function, that is, to stop local audio capturing.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableLocalAudio(bool enabled) = 0;
+
+ /** Disables the audio module.
+
+ @note
+ - This method affects the internal engine and can be called after the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method. You can call this method either before or after joining a channel.
+ - This method resets the internal engine and takes some time to take effect. We recommend using the \ref ar::rtc::IRtcEngine::enableLocalAudio "enableLocalAudio" and \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" methods to capture, process, and send the local audio streams.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int disableAudio() = 0;
+
+ /** Sets the audio parameters and application scenarios.
+
+ @note
+ - The *setAudioProfile* method must be called before the \ref IRtcEngine::joinChannel "joinChannel" method.
+ - In the Communication and Live-broadcast profiles, the bitrate may be different from your settings due to network self-adaptation.
+ - In scenarios requiring high-quality audio, for example, a music teaching scenario, we recommend setting profile as AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4) and scenario as AUDIO_SCENARIO_GAME_STREAMING (3).
+
+ @param profile Sets the sample rate, bitrate, encoding mode, and the number of channels. See #AUDIO_PROFILE_TYPE.
+ @param scenario Sets the audio application scenario. See #AUDIO_SCENARIO_TYPE. Under different audio scenarios, the device uses different volume tracks, i.e. either the in-call volume or the media volume. For details, see [What is the difference between the in-call volume and the media volume?](https://docs.ar.io/en/faq/system_volume).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) = 0;
+ /** Stops/Resumes sending the local audio stream.
+
+ A successful \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onUserMuteAudio "onUserMuteAudio" callback on the remote client.
+ @note
+ - When @p mute is set as @p true, this method does not disable the microphone, which does not affect any ongoing recording.
+ - If you call \ref ar::rtc::IRtcEngine::setChannelProfile "setChannelProfile" after this method, the SDK resets whether or not to mute the local audio according to the channel profile and user role. Therefore, we recommend calling this method after the `setChannelProfile` method.
+
+ @param mute Sets whether to send/stop sending the local audio stream:
+ - true: Stops sending the local audio stream.
+ - false: (Default) Sends the local audio stream.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int muteLocalAudioStream(bool mute) = 0;
+ /** Stops/Resumes receiving all remote users' audio streams.
+
+ @param mute Sets whether to receive/stop receiving all remote users' audio streams.
+ - true: Stops receiving all remote users' audio streams.
+ - false: (Default) Receives all remote users' audio streams.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int muteAllRemoteAudioStreams(bool mute) = 0;
+ /** Stops/Resumes receiving all remote users' audio streams by default.
+
+ You can call this method either before or after joining a channel. If you call `setDefaultMuteAllRemoteAudioStreams (true)` after joining a channel, the remote audio streams of all subsequent users are not received.
+
+ @note If you want to resume receiving the audio stream, call \ref ar::rtc::IRtcEngine::muteRemoteAudioStream "muteRemoteAudioStream (false)",
+ and specify the ID of the remote user whose audio stream you want to receive.
+ To receive the audio streams of multiple remote users, call `muteRemoteAudioStream (false)` as many times.
+ Calling `setDefaultMuteAllRemoteAudioStreams (false)` resumes receiving the audio streams of subsequent users only.
+
+ @param mute Sets whether to receive/stop receiving all remote users' audio streams by default:
+ - true: Stops receiving all remote users' audio streams by default.
+ - false: (Default) Receives all remote users' audio streams by default.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setDefaultMuteAllRemoteAudioStreams(bool mute) = 0;
+
+ /** Adjusts the playback volume of a specified remote user.
+
+ You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user.
+
+ @note
+ - Call this method after joining a channel.
+ - The playback volume here refers to the mixed volume of a specified remote user.
+ - This method can only adjust the playback volume of one specified remote user at a time. To adjust the playback volume of different remote users, call the method as many times, once for each remote user.
+
+ @param uid The ID of the remote user.
+ @param volume The playback volume of the specified remote user. The value ranges from 0 to 100:
+ - 0: Mute.
+ - 100: Original volume.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int adjustUserPlaybackSignalVolume(AR::uid_t uid, int volume) = 0;
+ /** Stops/Resumes receiving a specified remote user's audio stream.
+
+ @note If you called the \ref ar::rtc::IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams" method and set @p mute as @p true to stop receiving all remote users' audio streams, call the *muteAllRemoteAudioStreams* method and set @p mute as @p false before calling this method. The *muteAllRemoteAudioStreams* method sets all remote audio streams, while the *muteRemoteAudioStream* method sets a specified remote audio stream.
+
+ @param userId User ID of the specified remote user sending the audio.
+ @param mute Sets whether to receive/stop receiving a specified remote user's audio stream:
+ - true: Stops receiving the specified remote user's audio stream.
+ - false: (Default) Receives the specified remote user's audio stream.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+
+ */
+ virtual int muteRemoteAudioStream(uid_t userId, bool mute) = 0;
+ /** Stops/Resumes sending the local video stream.
+
+ A successful \ref ar::rtc::IRtcEngine::muteLocalVideoStream "muteLocalVideoStream" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onUserMuteVideo "onUserMuteVideo" callback on the remote client.
+
+ @note
+ - When set to *true*, this method does not disable the camera which does not affect the retrieval of the local video streams. This method executes faster than the \ref ar::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo" method which controls the sending of the local video stream.
+ - If you call \ref ar::rtc::IRtcEngine::setChannelProfile "setChannelProfile" after this method, the SDK resets whether or not to mute the local video according to the channel profile and user role. Therefore, we recommend calling this method after the `setChannelProfile` method.
+
+ @param mute Sets whether to send/stop sending the local video stream:
+ - true: Stop sending the local video stream.
+ - false: (Default) Send the local video stream.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int muteLocalVideoStream(bool mute) = 0;
+ /** Enables/Disables the local video capture.
+
+ This method disables or re-enables the local video capturer, and does not affect receiving the remote video stream.
+
+ After you call the \ref ar::rtc::IRtcEngine::enableVideo "enableVideo" method, the local video capturer is enabled by default. You can call \ref ar::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo(false)" to disable the local video capturer. If you want to re-enable it, call \ref ar::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo(true)".
+
+ After the local video capturer is successfully disabled or re-enabled, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onUserEnableLocalVideo "onUserEnableLocalVideo" callback on the remote client.
+
+ @note This method affects the internal engine and can be called after the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method.
+
+ @param enabled Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender:
+ - true: (Default) Re-enable the local video.
+ - false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of the other remote users.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableLocalVideo(bool enabled) = 0;
+ /** Stops/Resumes receiving all video stream from a specified remote user.
+
+ @param mute Sets whether to receive/stop receiving all remote users' video streams:
+ - true: Stop receiving all remote users' video streams.
+ - false: (Default) Receive all remote users' video streams.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int muteAllRemoteVideoStreams(bool mute) = 0;
+ /** Stops/Resumes receiving all remote users' video streams by default.
+
+ @param mute Sets whether to receive/stop receiving all remote users' video streams by default:
+ - true: Stop receiving all remote users' video streams by default.
+ - false: (Default) Receive all remote users' video streams by default.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setDefaultMuteAllRemoteVideoStreams(bool mute) = 0;
+ /** Stops/Resumes receiving the video stream from a specified remote user.
+
+ @note If you called the \ref ar::rtc::IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" method and set @p mute as @p true to stop receiving all remote video streams, call the *muteAllRemoteVideoStreams* method and set @p mute as @p false before calling this method.
+
+ @param userId User ID of the specified remote user.
+ @param mute Sets whether to stop/resume receiving the video stream from a specified remote user:
+ - true: Stop receiving the specified remote user's video stream.
+ - false: (Default) Receive the specified remote user's video stream.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int muteRemoteVideoStream(uid_t userId, bool mute) = 0;
+ /** Sets the remote user's video stream type received by the local user when the remote user sends dual streams.
+
+ This method allows the application to adjust the corresponding video-stream type based on the size of the video window to reduce the bandwidth and resources.
+
+ - If the remote user enables the dual-stream mode by calling the \ref ar::rtc::IRtcEngine::enableDualStreamMode "enableDualStreamMode" method, the SDK receives the high-stream video by default.
+ - If the dual-stream mode is not enabled, the SDK receives the high-stream video by default.
+
+ The method result returns in the \ref ar::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. The SDK receives the high-stream video by default to reduce the bandwidth. If needed, users may use this method to switch to the low-stream video.
+ By default, the aspect ratio of the low-stream video is the same as the high-stream video. Once the resolution of the high-stream video is set, the system automatically sets the resolution, frame rate, and bitrate of the low-stream video.
+
+ @param userId ID of the remote user sending the video stream.
+ @param streamType Sets the video-stream type. See #REMOTE_VIDEO_STREAM_TYPE.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRemoteVideoStreamType(uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType) = 0;
+ /** Sets the default video-stream type for the video received by the local user when the remote user sends dual streams.
+
+ - If the dual-stream mode is enabled by calling the \ref ar::rtc::IRtcEngine::enableDualStreamMode "enableDualStreamMode" method, the user receives the high-stream video by default. The @p setRemoteDefaultVideoStreamType method allows the application to adjust the corresponding video-stream type according to the size of the video window, reducing the bandwidth and resources.
+ - If the dual-stream mode is not enabled, the user receives the high-stream video by default.
+
+ The result after calling this method is returned in the \ref ar::rtc::IRtcEngineEventHandler::onApiCallExecuted "onApiCallExecuted" callback. The AR SDK receives the high-stream video by default to reduce the bandwidth. If needed, users can switch to the low-stream video through this method.
+
+ @param streamType Sets the default video-stream type. See #REMOTE_VIDEO_STREAM_TYPE.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRemoteDefaultVideoStreamType(REMOTE_VIDEO_STREAM_TYPE streamType) = 0;
+
+ /** Enables the \ref ar::rtc::IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback at a set time interval to report on which users are speaking and the speakers' volume.
+
+ Once this method is enabled, the SDK returns the volume indication in the \ref ar::rtc::IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback at the set time interval, whether or not any user is speaking in the channel.
+
+ @param interval Sets the time interval between two consecutive volume indications:
+ - ≤ 0: Disables the volume indication.
+ - > 0: Time interval (ms) between two consecutive volume indications. We recommend setting @p interval > 200 ms. Do not set @p interval < 10 ms, or the *onAudioVolumeIndication* callback will not be triggered.
+ @param smooth Smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3.
+ @param report_vad
+
+ - true: Enable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the `onAudioVolumeIndication` callback reports the voice activity status of the local user.
+ - false: (Default) Disable the voice activity detection of the local user. Once it is disabled, the `vad` parameter of the `onAudioVolumeIndication` callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableAudioVolumeIndication(int interval, int smooth, bool report_vad) = 0;
+ /** **DEPRECATED** Starts an audio recording.
+ * Use \ref IRtcEngine::startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) "startAudioRecording"2 instead.
+
+ The SDK allows recording during a call. Supported formats:
+
+ - .wav: Large file size with high fidelity.
+ - .aac: Small file size with low fidelity.
+
+ This method has a fixed sample rate of 32 kHz.
+
+ Ensure that the directory to save the recording file exists and is writable.
+ This method is usually called after the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method.
+ The recording automatically stops when the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method is called.
+
+ @param filePath Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8.
+ @param quality Sets the audio recording quality. See #AUDIO_RECORDING_QUALITY_TYPE.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) = 0;
+
+ /** Starts an audio recording on the client.
+ *
+ * The SDK allows recording during a call. After successfully calling this method, you can record the audio of all the users in the channel and get an audio recording file.
+ * Supported formats of the recording file are as follows:
+ * - .wav: Large file size with high fidelity.
+ * - .aac: Small file size with low fidelity.
+ *
+ * @note
+ * - Ensure that the directory you use to save the recording file exists and is writable.
+ * - This method is usually called after the `joinChannel` method. The recording automatically stops when you call the `leaveChannel` method.
+ * - For better recording effects, set quality as #AUDIO_RECORDING_QUALITY_MEDIUM or #AUDIO_RECORDING_QUALITY_HIGH when `sampleRate` is 44.1 kHz or 48 kHz.
+ *
+ * @param filePath Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8.
+ * @param sampleRate Sample rate (kHz) of the recording file. Supported values are as follows:
+ * - 16
+ * - (Default) 32
+ * - 44.1
+ * - 48
+ * @param quality Sets the audio recording quality. See #AUDIO_RECORDING_QUALITY_TYPE.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int startAudioRecording(const char* filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) = 0;
+ /** Stops an audio recording on the client.
+
+ You can call this method before calling the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method else, the recording automatically stops when the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method is called.
+
+ @return
+ - 0: Success
+ - < 0: Failure.
+ */
+ virtual int stopAudioRecording() = 0;
+ /** Starts playing and mixing the music file.
+
+ This method mixes the specified local audio file with the audio stream from the microphone, or replaces the microphone's audio stream with the specified local audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. This method also supports online music playback.
+
+ When the audio mixing file playback finishes after calling this method, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onAudioMixingFinished "onAudioMixingFinished" callback.
+
+ A successful \ref ar::rtc::IRtcEngine::startAudioMixing "startAudioMixing" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged "onAudioMixingStateChanged" (PLAY) callback on the local client.
+
+ When the audio mixing file playback finishes, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged "onAudioMixingStateChanged" (STOPPED) callback on the local client.
+ @note
+ - Call this method when you are in a channel.
+ - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701.
+
+ @param filePath Pointer to the absolute path of the local or online audio file to mix. Supported audio formats: 3GP, ASF, ADTS, AVI, MP3, MPEG-4, SAMI, and WAVE. For more information, see [Supported Media Formats in Media Foundation](https://docs.microsoft.com/en-us/windows/desktop/medfound/supported-media-formats-in-media-foundation).
+ @param loopback Sets which user can hear the audio mixing:
+ - true: Only the local user can hear the audio mixing.
+ - false: Both users can hear the audio mixing.
+ @param replace Sets the audio mixing content:
+ - true: Only the specified audio file is published; the audio stream received by the microphone is not published.
+ - false: The local audio file is mixed with the audio stream from the microphone.
+ @param cycle Sets the number of playback loops:
+ - Positive integer: Number of playback loops.
+ - -1: Infinite playback loops.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startAudioMixing(const char* filePath, bool loopback, bool replace, int cycle) = 0;
+ /** Stops playing and mixing the music file.
+
+ Call this method when you are in a channel.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopAudioMixing() = 0;
+ /** Pauses playing and mixing the music file.
+
+ Call this method when you are in a channel.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int pauseAudioMixing() = 0;
+ /** Resumes playing and mixing the music file.
+
+ Call this method when you are in a channel.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int resumeAudioMixing() = 0;
+ /** **DEPRECATED** AR does not recommend using this method.
+
+ Sets the high-quality audio preferences. Call this method and set all parameters before joining a channel.
+
+ Do not call this method again after joining a channel.
+
+ @param fullband Sets whether to enable/disable full-band codec (48-kHz sample rate). Not compatible with SDK versions before v1.7.4:
+ - true: Enable full-band codec.
+ - false: Disable full-band codec.
+ @param stereo Sets whether to enable/disable stereo codec. Not compatible with SDK versions before v1.7.4:
+ - true: Enable stereo codec.
+ - false: Disable stereo codec.
+ @param fullBitrate Sets whether to enable/disable high-bitrate mode. Recommended in voice-only mode:
+ - true: Enable high-bitrate mode.
+ - false: Disable high-bitrate mode.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setHighQualityAudioParameters(bool fullband, bool stereo, bool fullBitrate) = 0;
+ /** Adjusts the volume during audio mixing.
+
+ Call this method when you are in a channel.
+
+ @note Calling this method does not affect the volume of audio effect file playback invoked by the \ref ar::rtc::IRtcEngine::playEffect "playEffect" method.
+
+ @param volume Audio mixing volume. The value ranges between 0 and 100 (default).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int adjustAudioMixingVolume(int volume) = 0;
+ /** Adjusts the audio mixing volume for local playback.
+
+ @note Call this method when you are in a channel.
+
+ @param volume Audio mixing volume for local playback. The value ranges between 0 and 100 (default).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int adjustAudioMixingPlayoutVolume(int volume) = 0;
+ /** Retrieves the audio mixing volume for local playback.
+
+ This method helps troubleshoot audio volume related issues.
+
+ @note Call this method when you are in a channel.
+
+ @return
+ - ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
+ - < 0: Failure.
+ */
+ virtual int getAudioMixingPlayoutVolume() = 0;
+ /** Adjusts the audio mixing volume for publishing (for remote users).
+
+ @note Call this method when you are in a channel.
+
+ @param volume Audio mixing volume for publishing. The value ranges between 0 and 100 (default).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int adjustAudioMixingPublishVolume(int volume) = 0;
+ /** Retrieves the audio mixing volume for publishing.
+
+ This method helps troubleshoot audio volume related issues.
+
+ @note Call this method when you are in a channel.
+
+ @return
+ - ≥ 0: The audio mixing volume for publishing, if this method call succeeds. The value range is [0,100].
+ - < 0: Failure.
+ */
+ virtual int getAudioMixingPublishVolume() = 0;
+
+ /** Retrieves the duration (ms) of the music file.
+
+ Call this method when you are in a channel.
+
+ @return
+ - ≥ 0: The audio mixing duration, if this method call succeeds.
+ - < 0: Failure.
+ */
+ virtual int getAudioMixingDuration() = 0;
+ /** Retrieves the playback position (ms) of the music file.
+
+ Call this method when you are in a channel.
+
+ @return
+ - ≥ 0: The current playback position of the audio mixing, if this method call succeeds.
+ - < 0: Failure.
+ */
+ virtual int getAudioMixingCurrentPosition() = 0;
+ /** Sets the playback position of the music file to a different starting position (the default plays from the beginning).
+
+ @param pos The playback starting position (ms) of the music file.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setAudioMixingPosition(int pos /*in ms*/) = 0;
+ /** Sets the pitch of the local music file.
+ * @since v3.0.1
+ *
+ * When a local music file is mixed with a local human voice, call this method to set the pitch of the local music file only.
+ *
+ * @note
+ * Call this method after calling `startAudioMixing`.
+ *
+ * @param pitch Sets the pitch of the local music file by chromatic scale. The default value is 0,
+ * which means keeping the original pitch. The value ranges from -12 to 12, and the pitch value between
+ * consecutive values is a chromatic value. The greater the absolute value of this parameter, the
+ * higher or lower the pitch of the local music file.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int setAudioMixingPitch(int pitch) = 0;
+ /** Retrieves the volume of the audio effects.
+
+ The value ranges between 0.0 and 100.0.
+
+ @return
+ - ≥ 0: Volume of the audio effects, if this method call succeeds.
+
+ - < 0: Failure.
+ */
+ virtual int getEffectsVolume() = 0;
+ /** Sets the volume of the audio effects.
+
+ @param volume Sets the volume of the audio effects. The value ranges between 0 and 100 (default).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setEffectsVolume(int volume) = 0;
+ /** Sets the volume of a specified audio effect.
+
+ @param soundId ID of the audio effect. Each audio effect has a unique ID.
+ @param volume Sets the volume of the specified audio effect. The value ranges between 0 and 100 (default).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setVolumeOfEffect(int soundId, int volume) = 0;
+
+#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS)
+ /**
+ * Enables/Disables face detection for the local user. Applies to Android and iOS only.
+ * @since v3.0.1
+ *
+ * Once face detection is enabled, the SDK triggers the \ref IRtcEngineEventHandler::onFacePositionChanged "onFacePositionChanged" callback
+ * to report the face information of the local user, which includes the following aspects:
+ * - The width and height of the local video.
+ * - The position of the human face in the local video.
+ * - The distance between the human face and the device screen.
+ *
+ * @param enable Determines whether to enable the face detection function for the local user:
+ * - true: Enable face detection.
+ * - false: (Default) Disable face detection.
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int enableFaceDetection(bool enable) = 0;
+#endif
+ /** Plays a specified local or online audio effect file.
+
+ This method allows you to set the loop count, pitch, pan, and gain of the audio effect file, as well as whether the remote user can hear the audio effect.
+
+ To play multiple audio effect files simultaneously, call this method multiple times with different soundIds and filePaths. We recommend playing no more than three audio effect files at the same time.
+
+ @param soundId ID of the specified audio effect. Each audio effect has a unique ID.
+
+ @note
+ - If the audio effect is preloaded into the memory through the \ref IRtcEngine::preloadEffect "preloadEffect" method, the value of @p soundID must be the same as that in the *preloadEffect* method.
+ - Playing multiple online audio effect files simultaneously is not supported on macOS and Windows.
+
+ @param filePath The absolute path to the local audio effect file or the URL of the online audio effect file.
+ @param loopCount Sets the number of times the audio effect loops:
+ - 0: Play the audio effect once.
+ - 1: Play the audio effect twice.
+ - -1: Play the audio effect in an indefinite loop until the \ref IRtcEngine::stopEffect "stopEffect" or \ref IRtcEngine::stopAllEffects "stopAllEffects" method is called.
+ @param pitch Sets the pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch.
+ @param pan Sets the spatial position of the audio effect. The value ranges between -1.0 and 1.0:
+ - 0.0: The audio effect displays ahead.
+ - 1.0: The audio effect displays to the right.
+ - -1.0: The audio effect displays to the left.
+ @param gain Sets the volume of the audio effect. The value ranges between 0 and 100 (default). The lower the value, the lower the volume of the audio effect.
+ @param publish Sets whether or not to publish the specified audio effect to the remote stream:
+ - true: The locally played audio effect is published to the AR Cloud and the remote users can hear it.
+ - false: The locally played audio effect is not published to the AR Cloud and the remote users cannot hear it.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int playEffect(int soundId, const char* filePath, int loopCount, double pitch, double pan, int gain, bool publish = false) = 0;
+ /** Stops playing a specified audio effect.
+
+ @param soundId ID of the audio effect to stop playing. Each audio effect has a unique ID.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopEffect(int soundId) = 0;
+ /** Stops playing all audio effects.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopAllEffects() = 0;
+
+ /** Preloads a specified audio effect file into the memory.
+
+ @note This method does not support online audio effect files.
+
+ To ensure smooth communication, limit the size of the audio effect file. We recommend using this method to preload the audio effect before calling the \ref IRtcEngine::joinChannel "joinChannel" method.
+
+ Supported audio formats: mp3, aac, m4a, 3gp, and wav.
+
+ @param soundId ID of the audio effect. Each audio effect has a unique ID.
+ @param filePath Pointer to the absolute path of the audio effect file.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int preloadEffect(int soundId, const char* filePath) = 0;
+ /** Releases a specified preloaded audio effect from the memory.
+
+ @param soundId ID of the audio effect. Each audio effect has a unique ID.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int unloadEffect(int soundId) = 0;
+ /** Pauses a specified audio effect.
+
+ @param soundId ID of the audio effect. Each audio effect has a unique ID.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int pauseEffect(int soundId) = 0;
+ /** Pauses all audio effects.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int pauseAllEffects() = 0;
+ /** Resumes playing a specified audio effect.
+
+ @param soundId ID of the audio effect. Each audio effect has a unique ID.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int resumeEffect(int soundId) = 0;
+ /** Resumes playing all audio effects.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int resumeAllEffects() = 0;
+ /** Enables/Disables stereo panning for remote users.
+
+ Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling \ref ar::rtc::IRtcEngine::setRemoteVoicePosition "setRemoteVoicePosition".
+
+ @param enabled Sets whether or not to enable stereo panning for remote users:
+ - true: enables stereo panning.
+ - false: disables stereo panning.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableSoundPositionIndication(bool enabled) = 0;
+ /** Sets the sound position and gain of a remote user.
+
+ When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
+
+ @note
+ - For this method to work, enable stereo panning for remote users by calling the \ref ar::rtc::IRtcEngine::enableSoundPositionIndication "enableSoundPositionIndication" method before joining a channel.
+ - This method requires hardware support. For the best sound positioning, we recommend using a stereo speaker.
+
+ @param uid The ID of the remote user.
+ @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0:
+ - 0.0: the remote sound comes from the front.
+ - -1.0: the remote sound comes from the left.
+ - 1.0: the remote sound comes from the right.
+ @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRemoteVoicePosition(uid_t uid, double pan, double gain) = 0;
+
+ /** Changes the voice pitch of the local speaker.
+
+ @param pitch Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch).
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalVoicePitch(double pitch) = 0;
+ /** Sets the local voice equalization effect.
+
+ @param bandFrequency Sets the band frequency. The value ranges between 0 and 9, representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. See #AUDIO_EQUALIZATION_BAND_FREQUENCY.
+ @param bandGain Sets the gain of each band in dB. The value ranges between -15 and 15.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) = 0;
+ /** Sets the local voice reverberation.
+
+ v2.4.0 adds the \ref ar::rtc::IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset" method, a more user-friendly method for setting the local voice reverberation. You can use this method to set the local reverberation effect, such as pop music, R&B, rock music, and hip-hop.
+
+ @param reverbKey Sets the reverberation key. See #AUDIO_REVERB_TYPE.
+ @param value Sets the value of the reverberation key.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalVoiceReverb(AUDIO_REVERB_TYPE reverbKey, int value) = 0;
+ /** Sets the local voice changer option.
+
+ @note Do not use this method together with the \ref ar::rtc::IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset" method, because the method called later overrides the one called earlier.
+
+ @param voiceChanger Sets the local voice changer option. See #VOICE_CHANGER_PRESET.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalVoiceChanger(VOICE_CHANGER_PRESET voiceChanger) = 0;
+ /** Sets the preset local voice reverberation effect.
+
+ @note
+ - Do not use this method together with \ref ar::rtc::IRtcEngine::setLocalVoiceReverb "setLocalVoiceReverb".
+ - Do not use this method together with the \ref ar::rtc::IRtcEngine::setLocalVoiceChanger "setLocalVoiceChanger" method, because the method called later overrides the one called earlier.
+
+ @param reverbPreset Sets the preset audio reverberation configuration. See #AUDIO_REVERB_PRESET.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalVoiceReverbPreset(AUDIO_REVERB_PRESET reverbPreset) = 0;
+ /** Sets an SDK preset voice beautifier effect.
+ *
+ * @since v3.2.0
+ *
+ * Call this method to set an SDK preset voice beautifier effect for the local user who sends an audio stream. After
+ * setting a voice beautifier effect, all users in the channel can hear the effect.
+ *
+ * You can set different voice beautifier effects for different scenarios. See *Set the Voice Beautifier and Audio Effects*.
+ *
+ * To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and
+ * setting the `scenario` parameter to `AUDIO_SCENARIO_GAME_STREAMING(3)` and the `profile` parameter to
+ * `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before calling this method.
+ *
+ * @note
+ * - You can call this method either before or after joining a channel.
+ * - Do not set the `profile` parameter of \ref IRtcEngine::setAudioProfile "setAudioProfile" to `AUDIO_PROFILE_SPEECH_STANDARD(1)`
+ * or `AUDIO_PROFILE_IOT(6)`; otherwise, this method call fails.
+ * - This method works best with the human voice. AR does not recommend using this method for audio containing music.
+ * - After calling this method, AR recommends not calling the following methods, because they can override \ref IRtcEngine::setAudioEffectParameters "setAudioEffectParameters":
+ * - \ref IRtcEngine::setAudioEffectPreset "setAudioEffectPreset"
+ * - \ref IRtcEngine::setVoiceBeautifierPreset "setVoiceBeautifierPreset"
+ * - \ref IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset"
+ * - \ref IRtcEngine::setLocalVoiceChanger "setLocalVoiceChanger"
+ * - \ref IRtcEngine::setLocalVoicePitch "setLocalVoicePitch"
+ * - \ref IRtcEngine::setLocalVoiceEqualization "setLocalVoiceEqualization"
+ * - \ref IRtcEngine::setLocalVoiceReverb "setLocalVoiceReverb"
+ *
+ * @param preset The options for SDK preset voice beautifier effects: #VOICE_BEAUTIFIER_PRESET.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int setVoiceBeautifierPreset(VOICE_BEAUTIFIER_PRESET preset) = 0;
+ /** Sets an SDK preset audio effect.
+ *
+ * @since v3.2.0
+ *
+ * Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect
+ * does not change the gender characteristics of the original voice. After setting an audio effect, all users in the
+ * channel can hear the effect.
+ *
+ * You can set different audio effects for different scenarios. See *Set the Voice Beautifier and Audio Effects*.
+ *
+ * To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `scenario` parameter to `AUDIO_SCENARIO_GAME_STREAMING(3)` before calling this method.
+ *
+ * @note
+ * - You can call this method either before or after joining a channel.
+ * - Do not set the profile `parameter` of `setAudioProfile` to `AUDIO_PROFILE_SPEECH_STANDARD(1)` or `AUDIO_PROFILE_IOT(6)`;
+ * otherwise, this method call fails.
+ * - This method works best with the human voice. AR does not recommend using this method for audio containing music.
+ * - If you call this method and set the `preset` parameter to enumerators except `ROOM_ACOUSTICS_3D_VOICE` or `PITCH_CORRECTION`,
+ * do not call \ref IRtcEngine::setAudioEffectParameters "setAudioEffectParameters"; otherwise, `setAudioEffectParameters`
+ * overrides this method.
+ * - After calling this method, AR recommends not calling the following methods, because they can override `setAudioEffectPreset`:
+ * - \ref IRtcEngine::setVoiceBeautifierPreset "setVoiceBeautifierPreset"
+ * - \ref IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset"
+ * - \ref IRtcEngine::setLocalVoiceChanger "setLocalVoiceChanger"
+ * - \ref IRtcEngine::setLocalVoicePitch "setLocalVoicePitch"
+ * - \ref IRtcEngine::setLocalVoiceEqualization "setLocalVoiceEqualization"
+ * - \ref IRtcEngine::setLocalVoiceReverb "setLocalVoiceReverb"
+ *
+ * @param preset The options for SDK preset audio effects. See #AUDIO_EFFECT_PRESET.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int setAudioEffectPreset(AUDIO_EFFECT_PRESET preset) = 0;
+ /** Sets parameters for SDK preset audio effects.
+ *
+ * @since v3.2.0
+ *
+ * Call this method to set the following parameters for the local user who send an audio stream:
+ * - 3D voice effect: Sets the cycle period of the 3D voice effect.
+ * - Pitch correction effect: Sets the basic mode and tonic pitch of the pitch correction effect. Different songs
+ * have different modes and tonic pitches. AR recommends bounding this method with interface elements to enable
+ * users to adjust the pitch correction interactively.
+ *
+ * After setting parameters, all users in the channel can hear the relevant effect.
+ *
+ * You can call this method directly or after \ref IRtcEngine::setAudioEffectPreset "setAudioEffectPreset". If you
+ * call this method after \ref IRtcEngine::setAudioEffectPreset "setAudioEffectPreset", ensure that you set the preset
+ * parameter of `setAudioEffectPreset` to `ROOM_ACOUSTICS_3D_VOICE` or `PITCH_CORRECTION` and then call this method
+ * to set the same enumerator; otherwise, this method overrides `setAudioEffectPreset`.
+ *
+ * @note
+ * - You can call this method either before or after joining a channel.
+ * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile"
+ * and setting the `scenario` parameter to `AUDIO_SCENARIO_GAME_STREAMING(3)` before calling this method.
+ * - Do not set the `profile` parameter of \ref IRtcEngine::setAudioProfile "setAudioProfile" to `AUDIO_PROFILE_SPEECH_STANDARD(1)` or
+ * `AUDIO_PROFILE_IOT(6)`; otherwise, this method call fails.
+ * - This method works best with the human voice. AR does not recommend using this method for audio containing music.
+ * - After calling this method, AR recommends not calling the following methods, because they can override `setAudioEffectParameters`:
+ * - \ref IRtcEngine::setAudioEffectPreset "setAudioEffectPreset"
+ * - \ref IRtcEngine::setVoiceBeautifierPreset "setVoiceBeautifierPreset"
+ * - \ref IRtcEngine::setLocalVoiceReverbPreset "setLocalVoiceReverbPreset"
+ * - \ref IRtcEngine::setLocalVoiceChanger "setLocalVoiceChanger"
+ * - \ref IRtcEngine::setLocalVoicePitch "setLocalVoicePitch"
+ * - \ref IRtcEngine::setLocalVoiceEqualization "setLocalVoiceEqualization"
+ * - \ref IRtcEngine::setLocalVoiceReverb "setLocalVoiceReverb"
+ *
+ * @param preset The options for SDK preset audio effects:
+ * - 3D voice effect: `ROOM_ACOUSTICS_3D_VOICE`.
+ * - Call \ref IRtcEngine::setAudioProfile "setAudioProfile" and set the `profile` parameter to `AUDIO_PROFILE_MUSIC_STANDARD_STEREO(3)`
+ * or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this enumerator; otherwise, the enumerator setting does not take effect.
+ * - If the 3D voice effect is enabled, users need to use stereo audio playback devices to hear the anticipated voice effect.
+ * - Pitch correction effect: `PITCH_CORRECTION`. To achieve better audio effect quality, AR recommends calling
+ * \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or
+ * `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this enumerator.
+ * @param param1
+ * - If you set `preset` to `ROOM_ACOUSTICS_3D_VOICE`, the `param1` sets the cycle period of the 3D voice effect.
+ * The value range is [1,60] and the unit is a second. The default value is 10 seconds, indicating that the voice moves
+ * around you every 10 seconds.
+ * - If you set `preset` to `PITCH_CORRECTION`, `param1` sets the basic mode of the pitch correction effect:
+ * - `1`: (Default) Natural major scale.
+ * - `2`: Natural minor scale.
+ * - `3`: Japanese pentatonic scale.
+ * @param param2
+ * - If you set `preset` to `ROOM_ACOUSTICS_3D_VOICE`, you do not need to set `param2`.
+ * - If you set `preset` to `PITCH_CORRECTION`, `param2` sets the tonic pitch of the pitch correction effect:
+ * - `1`: A
+ * - `2`: A#
+ * - `3`: B
+ * - `4`: (Default) C
+ * - `5`: C#
+ * - `6`: D
+ * - `7`: D#
+ * - `8`: E
+ * - `9`: F
+ * - `10`: F#
+ * - `11`: G
+ * - `12`: G#
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int setAudioEffectParameters(AUDIO_EFFECT_PRESET preset, int param1, int param2) = 0;
+ /** Sets the log files that the SDK outputs.
+ *
+ * By default, the SDK outputs five log files, `arsdk.log`, `arsdk_1.log`, `arsdk_2.log`, `arsdk_3.log`, `arsdk_4.log`, each with a default size of 1024 KB.
+ * These log files are encoded in UTF-8. The SDK writes the latest logs in `arsdk.log`. When `arsdk.log` is full, the SDK deletes the log file with the earliest
+ * modification time among the other four, renames `arsdk.log` to the name of the deleted log file, and create a new `arsdk.log` to record latest logs.
+ *
+ * @note Ensure that you call this method immediately after calling \ref ar::rtc::IRtcEngine::initialize "initialize" , otherwise the output logs may not be complete.
+ *
+ * @see \ref IRtcEngine::setLogFileSize "setLogFileSize"
+ * @see \ref IRtcEngine::setLogFilter "setLogFilter"
+ *
+ * @param filePath The absolute path of log files. The default file path is `C: \Users\<user_name>\AppData\Local\AR\<process_name>\arsdk.log`.
+ * Ensure that the directory for the log files exists and is writable. You can use this parameter to rename the log files.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int setLogFile(const char* filePath) = 0;
+ /** Sets the output log level of the SDK.
+
+ You can use one or a combination of the log filter levels. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level.
+
+ If you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING.
+
+ @param filter Sets the log filter level. See #LOG_FILTER_TYPE.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLogFilter(unsigned int filter) = 0;
+ /** Sets the log file size (KB).
+
+ The SDK has two log files, each with a default size of 512 KB. If you set @p fileSizeInBytes as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.
+
+ @param fileSizeInKBytes The SDK log file size (KB).
+ @return
+ - 0: Success.
+ - <0: Failure.
+ */
+ virtual int setLogFileSize(unsigned int fileSizeInKBytes) = 0;
+ /**
+ @deprecated This method is deprecated, use the \ref IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode"2 method instead.
+ Sets the local video display mode.
+
+ This method can be called multiple times during a call to change the display mode.
+
+ @param renderMode Sets the local video display mode. See #RENDER_MODE_TYPE.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalRenderMode(RENDER_MODE_TYPE renderMode) = 0;
+ /** Updates the display mode of the local video view.
+
+ After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream.
+
+ @note
+ - Ensure that you have called the \ref IRtcEngine::setupLocalVideo "setupLocalVideo" method to initialize the local video view before calling this method.
+ @param renderMode The rendering mode of the local video view. See #RENDER_MODE_TYPE.
+ @param mirrorMode
+ - The mirror mode of the local video view. See #VIDEO_MIRROR_MODE_TYPE.
+ - **Note**: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0;
+ /**
+ @deprecated This method is deprecated, use the \ref IRtcEngine::setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setRemoteRenderMode"2 method instead.
+ Sets the video display mode of a specified remote user.
+
+ This method can be called multiple times during a call to change the display mode.
+
+ @param userId ID of the remote user.
+ @param renderMode Sets the video display mode. See #RENDER_MODE_TYPE.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode) = 0;
+ /** Updates the display mode of the video view of a remote user.
+
+ After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees.
+
+ @note
+ - Ensure that you have called the \ref IRtcEngine::setupRemoteVideo "setupRemoteVideo" method to initialize the remote video view before calling this method.
+ - During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user.
+
+ @param userId The ID of the remote user.
+ @param renderMode The rendering mode of the remote video view. See #RENDER_MODE_TYPE.
+ @param mirrorMode
+ - The mirror mode of the remote video view. See #VIDEO_MIRROR_MODE_TYPE.
+ - **Note**: The SDK disables the mirror mode by default.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRemoteRenderMode(uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0;
+ /**
+ @deprecated This method is deprecated, use the \ref IRtcEngine::setupLocalVideo "setupLocalVideo"
+ or \ref IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode" method instead.
+ Sets the local video mirror mode.
+
+ You must call this method before calling the \ref ar::rtc::IRtcEngine::startPreview "startPreview" method, otherwise the mirror mode will not work.
+
+ @warning
+ - Call this method after calling the \ref ar::rtc::IRtcEngine::setupLocalVideo "setupLocalVideo" method to initialize the local video view.
+ - During a call, you can call this method as many times as necessary to update the mirror mode of the local video view.
+
+ @param mirrorMode Sets the local video mirror mode. See #VIDEO_MIRROR_MODE_TYPE.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0;
+ /** Sets the stream mode to the single-stream (default) or dual-stream mode. (Live broadcast only.)
+
+ If the dual-stream mode is enabled, the receiver can choose to receive the high stream (high-resolution and high-bitrate video stream), or the low stream (low-resolution and low-bitrate video stream).
+
+ @param enabled Sets the stream mode:
+ - true: Dual-stream mode.
+ - false: (Default) Single-stream mode.
+ */
+ virtual int enableDualStreamMode(bool enabled) = 0;
+ /** Sets the external audio source. Please call this method before \ref ar::rtc::IRtcEngine::joinChannel "joinChannel".
+
+ @param enabled Sets whether to enable/disable the external audio source:
+ - true: Enables the external audio source.
+ - false: (Default) Disables the external audio source.
+ @param sampleRate Sets the sample rate (Hz) of the external audio source, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
+ @param channels Sets the number of audio channels of the external audio source:
+ - 1: Mono.
+ - 2: Stereo.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setExternalAudioSource(bool enabled, int sampleRate, int channels) = 0;
+ /** Sets the external audio sink.
+ * This method applies to scenarios where you want to use external audio
+ * data for playback. After enabling the external audio sink, you can call
+ * the \ref AM::IMediaEngine::pullAudioFrame "pullAudioFrame" method to pull the remote audio data, process
+ * it, and play it with the audio effects that you want.
+ *
+ * @note
+ * Once you enable the external audio sink, the app will not retrieve any
+ * audio data from the
+ * \ref AM::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback.
+ *
+ * @param enabled
+ * - true: Enables the external audio sink.
+ * - false: (Default) Disables the external audio sink.
+ * @param sampleRate Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000.
+ * @param channels Sets the number of audio channels of the external
+ * audio sink:
+ * - 1: Mono.
+ * - 2: Stereo.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int setExternalAudioSink(bool enabled, int sampleRate, int channels) = 0;
+ /** Sets the audio recording format for the \ref AM::IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" callback.
+
+
+ @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onRecordAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
+ @param channel Sets the number of audio channels (@p channels) returned in the *onRecordAudioFrame* callback:
+ - 1: Mono
+ - 2: Stereo
+ @param mode Sets the use mode (see #RAW_AUDIO_FRAME_OP_MODE_TYPE) of the *onRecordAudioFrame* callback.
+ @param samplesPerCall Sets the number of samples returned in the *onRecordAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming.
+
+
+ @note The SDK triggers the `onRecordAudioFrame` callback according to the sample interval. Ensure that the sample interval >= 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` x `channel`).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRecordingAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) = 0;
+ /** Sets the audio playback format for the \ref AM::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback.
+
+
+ @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onPlaybackAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
+ @param channel Sets the number of channels (@p channels) returned in the *onPlaybackAudioFrame* callback:
+ - 1: Mono
+ - 2: Stereo
+ @param mode Sets the use mode (see #RAW_AUDIO_FRAME_OP_MODE_TYPE) of the *onPlaybackAudioFrame* callback.
+ @param samplesPerCall Sets the number of samples returned in the *onPlaybackAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming.
+
+ @note The SDK triggers the `onPlaybackAudioFrame` callback according to the sample interval. Ensure that the sample interval >= 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` x `channel`).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setPlaybackAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall) = 0;
+ /** Sets the mixed audio format for the \ref AM::IAudioFrameObserver::onMixedAudioFrame "onMixedAudioFrame" callback.
+
+
+ @param sampleRate Sets the sample rate (@p samplesPerSec) returned in the *onMixedAudioFrame* callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
+ @param samplesPerCall Sets the number of samples (`samples`) returned in the *onMixedAudioFrame* callback. `samplesPerCall` is usually set as 1024 for RTMP streaming.
+
+ @note The SDK triggers the `onMixedAudioFrame` callback according to the sample interval. Ensure that the sample interval >= 0.01 (s). And, Sample interval (sec) = `samplePerCall`/(`sampleRate` x `channels`).
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setMixedAudioFrameParameters(int sampleRate, int samplesPerCall) = 0;
+ /** Adjusts the recording volume.
+
+ @param volume Recording volume. The value ranges between 0 and 400:
+ - 0: Mute.
+ - 100: Original volume.
+ - 400: (Maximum) Four times the original volume with signal clipping protection.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int adjustRecordingSignalVolume(int volume) = 0;
+ /** Adjusts the playback volume of all remote users.
+
+ @note
+ - This method adjusts the playback volume that is the mixed volume of all remote users.
+ - (Since v2.3.2) To mute the local audio playback, call both the `adjustPlaybackSignalVolume` and \ref IRtcEngine::adjustAudioMixingVolume "adjustAudioMixingVolume" methods and set the volume as `0`.
+
+ @param volume The playback volume of all remote users. The value ranges from 0 to 400:
+ - 0: Mute.
+ - 100: Original volume.
+ - 400: (Maximum) Four times the original volume with signal clipping protection.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int adjustPlaybackSignalVolume(int volume) = 0;
+
+ /**
+ @deprecated This method is deprecated. As of v3.0.0, the Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method.
+ Enables interoperability with the AR Web SDK.
+
+ @note
+ - This method applies only to the Live-broadcast profile. In the Communication profile, interoperability with the AR Web SDK is enabled by default.
+ - If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user.
+
+ @param enabled Sets whether to enable/disable interoperability with the AR Web SDK:
+ - true: Enable.
+ - false: (Default) Disable.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableWebSdkInteroperability(bool enabled) = 0;
+ //only for live broadcast
+ /** **DEPRECATED** Sets the preferences for the high-quality video. (Live broadcast only).
+
+ This method is deprecated as of v2.4.0.
+
+ @param preferFrameRateOverImageQuality Sets the video quality preference:
+ - true: Frame rate over image quality.
+ - false: (Default) Image quality over frame rate.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setVideoQualityParameters(bool preferFrameRateOverImageQuality) = 0;
+ /** Sets the fallback option for the locally published video stream based on the network conditions.
+
+ If `option` is set as #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK will:
+
+ - Disable the upstream video but enable audio only when the network conditions deteriorate and cannot support both video and audio.
+ - Re-enable the video when the network conditions improve.
+
+ When the locally published video stream falls back to audio only or when the audio-only stream switches back to the video, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onLocalPublishFallbackToAudioOnly "onLocalPublishFallbackToAudioOnly" callback.
+
+ @note AR does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only.
+
+ @param option Sets the fallback option for the locally published video stream:
+ - #STREAM_FALLBACK_OPTION_DISABLED (0): (Default) No fallback behavior for the locally published video stream when the uplink network condition is poor. The stream quality is not guaranteed.
+ - #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2): The locally published video stream falls back to audio only when the uplink network condition is poor.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLocalPublishFallbackOption(STREAM_FALLBACK_OPTIONS option) = 0;
+ /** Sets the fallback option for the remotely subscribed video stream based on the network conditions.
+
+ The default setting for `option` is #STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW (1), where the remotely subscribed video stream falls back to the low-stream video (low resolution and low bitrate) under poor downlink network conditions.
+
+ If `option` is set as #STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve.
+
+ When the remotely subscribed video stream falls back to audio only or when the audio-only stream switches back to the video stream, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onRemoteSubscribeFallbackToAudioOnly "onRemoteSubscribeFallbackToAudioOnly" callback.
+
+ @param option Sets the fallback option for the remotely subscribed video stream. See #STREAM_FALLBACK_OPTIONS.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setRemoteSubscribeFallbackOption(STREAM_FALLBACK_OPTIONS option) = 0;
+
+#if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS)
+ /** Switches between front and rear cameras.
+
+ @note This method is for Android and iOS only.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int switchCamera() = 0;
+ /** Switches between front and rear cameras.
+
+ @note This method is for Android and iOS only, and it is private.
+
+ @param direction Sets the camera to be used:
+ - CAMERA_DIRECTION.CAMERA_REAR: Use the rear camera.
+ - CAMERA_DIRECTION.CAMERA_FRONT: Use the front camera.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int switchCamera(CAMERA_DIRECTION direction) = 0;
+ /** Sets the default audio playback route.
+
+ This method sets whether the received audio is routed to the earpiece or speakerphone by default before joining a channel.
+ If a user does not call this method, the audio is routed to the earpiece by default. If you need to change the default audio route after joining a channel, call the \ref IRtcEngine::setEnableSpeakerphone "setEnableSpeakerphone" method.
+
+ The default setting for each profile:
+ - `COMMUNICATION`: In a voice call, the default audio route is the earpiece. In a video call, the default audio route is the speakerphone. If a user who is in the `COMMUNICATION` profile calls
+ the \ref IRtcEngine.disableVideo "disableVideo" method or if the user calls
+ the \ref IRtcEngine.muteLocalVideoStream "muteLocalVideoStream" and
+ \ref IRtcEngine.muteAllRemoteVideoStreams "muteAllRemoteVideoStreams" methods, the
+ default audio route switches back to the earpiece automatically.
+ - `LIVE_BROADCASTING`: Speakerphone.
+
+ @note
+ - This method is for Android and iOS only.
+ - This method only works in audio mode.
+ - Call this method before calling the \ref IRtcEngine::joinChannel "joinChannel" method.
+ - Regardless of whether the audio is routed to the speakerphone or earpiece by default, once a headset is plugged in or Bluetooth device is connected, the default audio route changes. The default audio route switches to the earpiece once removing the headset or disconnecting the Bluetooth device.
+
+ @param defaultToSpeaker Sets the default audio route:
+ - true: Route the audio to the speakerphone. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the speakerphone.
+ - false: (Default) Route the audio to the earpiece. If a headset is plugged in, the audio is routed to the headset.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setDefaultAudioRouteToSpeakerphone(bool defaultToSpeaker) = 0;
+ /** Enables/Disables the audio playback route to the speakerphone.
+
+ This method sets whether the audio is routed to the speakerphone or earpiece.
+
+ See the default audio route explanation in the \ref IRtcEngine::setDefaultAudioRouteToSpeakerphone "setDefaultAudioRouteToSpeakerphone" method and check whether it is necessary to call this method.
+
+ @note
+ - This method is for Android and iOS only.
+ - Ensure that you have successfully called the \ref IRtcEngine::joinChannel "joinChannel" method before calling this method.
+ - After calling this method, the SDK returns the \ref IRtcEngineEventHandler::onAudioRouteChanged "onAudioRouteChanged" callback to indicate the changes.
+ - This method does not take effect if a headset is used.
+
+ @param speakerOn Sets whether to route the audio to the speakerphone or earpiece:
+ - true: Route the audio to the speakerphone.
+ - false: Route the audio to the earpiece.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setEnableSpeakerphone(bool speakerOn) = 0;
+ /** Enables in-ear monitoring (for Android and iOS only).
+ @param enabled Sets whether to enable/disable in-ear monitoring:
+ - true: Enable.
+ - false: (Default) Disable.
+
+ * @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableInEarMonitoring(bool enabled) = 0;
+ /** Sets the volume of the in-ear monitor.
+
+ @param volume Sets the volume of the in-ear monitor. The value ranges between 0 and 100 (default).
+
+ @note This method is for Android and iOS only.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setInEarMonitoringVolume(int volume) = 0;
+ /** Checks whether the speakerphone is enabled.
+
+ @note This method is for Android and iOS only.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual bool isSpeakerphoneEnabled() = 0;
+
+ virtual bool isCameraZoomSupported() = 0;
+ virtual bool isCameraTorchSupported() = 0;
+ virtual bool isCameraFocusPositionInPreviewSupported() = 0;
+ virtual bool isCameraExposurePositionSupported() = 0;
+ virtual bool isCameraAutoFocusFaceModeSupported() = 0;
+ virtual float setCameraZoomFactor(float zoomFactor) = 0;
+ virtual bool setCameraFocusPositionInPreview(float x, float y) = 0;
+ virtual bool setCameraExposurePosition(float x, float y) = 0;
+ virtual bool setCameraTorchOn(bool enabled) = 0;
+ virtual bool setCameraAutoFocusFaceModeEnabled(bool enabled) = 0;
+
+#endif
+
+#if (defined(__APPLE__) && TARGET_OS_IOS)
+ /** Sets the audio session’s operational restriction.
+
+ The SDK and the app can both configure the audio session by default. The app may occasionally use other apps or third-party components to manipulate the audio session and restrict the SDK from doing so. This method allows the app to restrict the SDK’s manipulation of the audio session.
+
+ You can call this method at any time to return the control of the audio sessions to the SDK.
+
+ @note
+ - This method is for iOS only.
+ - This method restricts the SDK’s manipulation of the audio session. Any operation to the audio session relies solely on the app, other apps, or third-party components.
+
+ @param restriction The operational restriction (bit mask) of the SDK on the audio session. See #AUDIO_SESSION_OPERATION_RESTRICTION.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setAudioSessionOperationRestriction(AUDIO_SESSION_OPERATION_RESTRICTION restriction) = 0;
+#endif
+
+#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) || defined(_WIN32)
+ /** Enables loopback recording.
+
+ If you enable loopback recording, the output of the sound card is mixed into the audio stream sent to the other end.
+
+ @param enabled Sets whether to enable/disable loopback recording.
+ - true: Enable loopback recording.
+ - false: (Default) Disable loopback recording.
+ @param deviceName Pointer to the device name of the sound card. The default value is NULL (the default sound card).
+
+ @note
+ - This method is for macOS and Windows only.
+ - macOS does not support loopback recording of the default sound card. If you need to use this method, please use a virtual sound card and pass its name to the deviceName parameter. AR has tested and recommends using soundflower.
+
+ */
+ virtual int enableLoopbackRecording(bool enabled, const char* deviceName = NULL) = 0;
+
+#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE)
+ /** Shares the whole or part of a screen by specifying the display ID.
+
+ @note This method is for macOS only.
+
+ @param displayId The display ID of the screen to be shared. This parameter specifies which screen you want to share.
+ @param regionRect (Optional) Sets the relative location of the region to the screen. NIL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen.
+ @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters.
+
+
+ @return
+ - 0: Success.
+ - < 0: Failure:
+ - #ERR_INVALID_ARGUMENT: the argument is invalid.
+ */
+ virtual int startScreenCaptureByDisplayId(unsigned int displayId, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0;
+#endif
+
+#if defined(_WIN32)
+ /** Shares the whole or part of a screen by specifying the screen rect.
+
+ @param screenRect Sets the relative location of the screen to the virtual screen. For information on how to get screenRect, see [Share the Screen](https://docs.ar.io/en/Video/screensharing_windows?platform=Windows).
+ @param regionRect (Optional) Sets the relative location of the region to the screen. NULL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen.
+ @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters.
+
+ @return
+ - 0: Success.
+ - < 0: Failure:
+ - ERR_INVALID_STATE: the screen sharing state is invalid, probably because another screen or window is being shared. Call \ref ar::rtc::IRtcEngine::stopScreenCapture "stopScreenCapture" to stop the current screen sharing.
+ - ERR_INVALID_ARGUMENT: the argument is invalid.
+ */
+ virtual int startScreenCaptureByScreenRect(const Rectangle& screenRect, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0;
+#endif
+
+ /** Shares the whole or part of a window by specifying the window ID.
+
+ Since v3.0.0, this method supports sharing with common Windows platforms. AR tests the mainstream Windows applications, see details as follows:
+
+ <table>
+ <tr>
+ <td><b>OS version</b></td>
+ <td><b>Software</b></td>
+ <td><b>Software name</b></td>
+ <td><b>Whether support</b></td>
+ </tr>
+ <tr>
+ <td rowspan="8">win10</td>
+ <td >Chrome</td>
+ <td>76.0.3809.100</td>
+ <td>No</td>
+ </tr>
+ <tr>
+ <td>Office Word</td>
+ <td rowspan="3">18.1903.1152.0</td>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <td>Office Excel</td>
+ <td>No</td>
+ </tr>
+ <tr>
+ <td>Office PPT</td>
+ <td>No</td>
+ </tr>
+ <tr>
+ <td>WPS Word</td>
+ <td rowspan="3">11.1.0.9145</td>
+ <td rowspan="3">Yes</td>
+ </tr>
+ <tr>
+ <td>WPS Excel</td>
+ </tr>
+ <tr>
+ <td>WPS PPT</td>
+ </tr>
+ <tr>
+ <td>Media Player (come with the system)</td>
+ <td>All</td>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <td rowspan="8">win8</td>
+ <td >Chrome</td>
+ <td>All</td>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <td>Office Word</td>
+ <td rowspan="3">All</td>
+ <td rowspan="3">Yes</td>
+ </tr>
+ <tr>
+ <td>Office Excel</td>
+ </tr>
+ <tr>
+ <td>Office PPT</td>
+ </tr>
+ <tr>
+ <td>WPS Word</td>
+ <td rowspan="3">11.1.0.9098</td>
+ <td rowspan="3">Yes</td>
+ </tr>
+ <tr>
+ <td>WPS Excel</td>
+ </tr>
+ <tr>
+ <td>WPS PPT</td>
+ </tr>
+ <tr>
+ <td>Media Player(come with the system)</td>
+ <td>All</td>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <td rowspan="8">win7</td>
+ <td >Chrome</td>
+ <td>73.0.3683.103</td>
+ <td>No</td>
+ </tr>
+ <tr>
+ <td>Office Word</td>
+ <td rowspan="3">All</td>
+ <td rowspan="3">Yes</td>
+ </tr>
+ <tr>
+ <td>Office Excel</td>
+ </tr>
+ <tr>
+ <td>Office PPT</td>
+ </tr>
+ <tr>
+ <td>WPS Word</td>
+ <td rowspan="3">11.1.0.9098</td>
+ <td rowspan="3">No</td>
+ </tr>
+ <tr>
+ <td>WPS Excel</td>
+ </tr>
+ <tr>
+ <td>WPS PPT</td>
+ </tr>
+ <tr>
+ <td>Media Player(come with the system)</td>
+ <td>All</td>
+ <td>No</td>
+ </tr>
+ </table>
+
+ @param windowId The ID of the window to be shared. For information on how to get the windowId, see the advanced guide *Share Screen*.
+ @param regionRect (Optional) The relative location of the region to the window. NULL/NIL means sharing the whole window. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window.
+ @param captureParams Window sharing encoding parameters. See ScreenCaptureParameters.
+
+ @return
+ - 0: Success.
+ - < 0: Failure:
+ - #ERR_INVALID_ARGUMENT: the argument is invalid.
+ */
+ virtual int startScreenCaptureByWindowId(view_t windowId, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) = 0;
+
+ /** Sets the content hint for screen sharing.
+
+ A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithm to different types of content.
+
+ @param contentHint Sets the content hint for screen sharing. See VideoContentHint.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setScreenCaptureContentHint(VideoContentHint contentHint) = 0;
+
+ /** Updates the screen sharing parameters.
+
+ @param captureParams Sets the screen sharing encoding parameters. See ScreenCaptureParameters.
+
+ @return
+ - 0: Success.
+ - < 0: Failure:
+ - #ERR_NOT_READY: no screen or windows is being shared.
+ */
+ virtual int updateScreenCaptureParameters(const ScreenCaptureParameters& captureParams) = 0;
+
+ /** Updates the screen sharing region.
+
+ @param regionRect Sets the relative location of the region to the screen or window. NULL means sharing the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window.
+
+ @return
+ - 0: Success.
+ - < 0: Failure:
+ - #ERR_NOT_READY: no screen or window is being shared.
+ */
+ virtual int updateScreenCaptureRegion(const Rectangle& regionRect) = 0;
+
+ /** Stop screen sharing.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int stopScreenCapture() = 0;
+
+#if defined(__APPLE__)
+ typedef unsigned int WindowIDType;
+#elif defined(_WIN32)
+ typedef HWND WindowIDType;
+#endif
+
+ /** **DEPRECATED** Starts screen sharing.
+
+ This method is deprecated as of v2.4.0. See the following methods instead:
+
+ - \ref ar::rtc::IRtcEngine::startScreenCaptureByDisplayId "startScreenCaptureByDisplayId"
+ - \ref ar::rtc::IRtcEngine::startScreenCaptureByScreenRect "startScreenCaptureByScreenRect"
+ - \ref ar::rtc::IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId"
+
+ This method shares the whole screen, specified window, or specified region:
+
+ - Whole screen: Set @p windowId as 0 and @p rect as NULL.
+ - Specified window: Set @p windowId as a value other than 0. Each window has a @p windowId that is not 0.
+ - Specified region: Set @p windowId as 0 and @p rect not as NULL. In this case, you can share the specified region, for example by dragging the mouse or implementing your own logic.
+
+ @note The specified region is a region on the whole screen. Currently, sharing a specified region in a specific window is not supported.
+ *captureFreq* is the captured frame rate once the screen-sharing function is enabled. The mandatory value ranges between 1 fps and 15 fps.
+
+ @param windowId Sets the screen sharing area. See WindowIDType.
+ @param captureFreq (Mandatory) The captured frame rate. The value ranges between 1 fps and 15 fps.
+ @param rect Specifies the screen-sharing region. @p rect is valid when @p windowsId is set as 0. When @p rect is set as NULL, the whole screen is shared.
+ @param bitrate The captured bitrate.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startScreenCapture(WindowIDType windowId, int captureFreq, const Rect *rect, int bitrate) = 0;
+
+ /** **DEPRECATED** Updates the screen capture region.
+
+ @param rect Specifies the required region inside the screen or window.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int updateScreenCaptureRegion(const Rect *rect) = 0;
+#endif
+
+#if defined(_WIN32)||defined(__ANDROID__) || (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_MAC))
+ /** Sets a custom video source.
+ *
+ * During real-time communication, the AR SDK enables the default video input device, that is, the built-in camera to
+ * capture video. If you need a custom video source, implement the IVideoSource class first, and call this method to add
+ * the custom video source to the SDK.
+ *
+ * @param source The custom video source. See IVideoSource.
+ *
+ * @return
+ * - true: The custom video source is added to the SDK.
+ * - false: The custom video source is not added to the SDK.
+ */
+ virtual bool setVideoSource(IVideoSource *source) = 0;
+#endif
+
+ /** Retrieves the current call ID.
+
+ When a user joins a channel on a client, a @p callId is generated to identify the call from the client. Feedback methods, such as \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain", must be called after the call ends to submit feedback to the SDK.
+
+ The \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain" methods require the @p callId parameter retrieved from the *getCallId* method during a call. @p callId is passed as an argument into the \ref IRtcEngine::rate "rate" and \ref IRtcEngine::complain "complain" methods after the call ends.
+
+ @param callId Pointer to the current call ID.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getCallId(ar::util::AString& callId) = 0;
+
+ /** Allows a user to rate a call after the call ends.
+
+ @param callId Pointer to the ID of the call, retrieved from the \ref IRtcEngine::getCallId "getCallId" method.
+ @param rating Rating of the call. The value is between 1 (lowest score) and 5 (highest score). If you set a value out of this range, the #ERR_INVALID_ARGUMENT (2) error returns.
+ @param description (Optional) Pointer to the description of the rating, with a string length of less than 800 bytes.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int rate(const char* callId, int rating, const char* description) = 0;
+
+ /** Allows a user to complain about the call quality after a call ends.
+
+ @param callId Pointer to the ID of the call, retrieved from the \ref IRtcEngine::getCallId "getCallId" method.
+ @param description (Optional) Pointer to the description of the complaint, with a string length of less than 800 bytes.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+
+ */
+ virtual int complain(const char* callId, const char* description) = 0;
+
+ /** Retrieves the SDK version number.
+
+ @param build Pointer to the build number.
+ @return The version of the current SDK in the string format. For example, 2.3.1.
+ */
+ virtual const char* getVersion(int* build) = 0;
+
+ /** Enables the network connection quality test.
+
+ This method tests the quality of the users' network connections and is disabled by default.
+
+ Before a user joins a channel or before an audience switches to a host, call this method to check the uplink network quality.
+
+ This method consumes additional network traffic, and hence may affect communication quality.
+
+ Call the \ref IRtcEngine::disableLastmileTest "disableLastmileTest" method to disable this test after receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" callback, and before joining a channel.
+
+ @note
+ - Do not call any other methods before receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" callback. Otherwise, the callback may be interrupted by other methods, and hence may not be triggered.
+ - A host should not call this method after joining a channel (when in a call).
+ - If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the \ref ar::rtc::IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. After you join the channel, whether you have called the `disableLastmileTest` method or not, the SDK automatically stops consuming the bandwidth.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int enableLastmileTest() = 0;
+
+ /** Disables the network connection quality test.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int disableLastmileTest() = 0;
+
+ /** Starts the last-mile network probe test.
+
+ This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
+
+ Call this method to check the uplink network quality before users join a channel or before an audience switches to a host.
+ Once this method is enabled, the SDK returns the following callbacks:
+ - \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality": the SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience.
+ - \ref IRtcEngineEventHandler::onLastmileProbeResult "onLastmileProbeResult": the SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective.
+
+ @note
+ - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with enableLastmileTest.
+ - Do not call other methods before receiving the \ref IRtcEngineEventHandler::onLastmileQuality "onLastmileQuality" and \ref IRtcEngineEventHandler::onLastmileProbeResult "onLastmileProbeResult" callbacks. Otherwise, the callbacks may be interrupted.
+ - In the Live-broadcast profile, a host should not call this method after joining a channel.
+
+ @param config Sets the configurations of the last-mile network probe test. See LastmileProbeConfig.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int startLastmileProbeTest(const LastmileProbeConfig& config) = 0;
+
+ /** Stops the last-mile network probe test. */
+ virtual int stopLastmileProbeTest() = 0;
+
+ /** Retrieves the warning or error description.
+
+ @param code Warning code or error code returned in the \ref ar::rtc::IRtcEngineEventHandler::onWarning "onWarning" or \ref ar::rtc::IRtcEngineEventHandler::onError "onError" callback.
+
+ @return #WARN_CODE_TYPE or #ERROR_CODE_TYPE.
+ */
+ virtual const char* getErrorDescription(int code) = 0;
+
+ /** Enables built-in encryption with an encryption password before users join a channel.
+
+ All users in a channel must use the same encryption password. The encryption password is automatically cleared once a user leaves the channel.
+
+ If an encryption password is not specified, the encryption functionality will be disabled.
+
+ @note
+ - Do not use this method for CDN live streaming.
+ - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption.
+
+ @param secret Pointer to the encryption password.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setEncryptionSecret(const char* secret) = 0;
+
+ /** Sets the built-in encryption mode.
+
+ The AR SDK supports built-in encryption, which is set to the @p aes-128-xts mode by default. Call this method to use other encryption modes.
+
+ All users in the same channel must use the same encryption mode and password.
+
+ Refer to the information related to the AES encryption algorithm on the differences between the encryption modes.
+
+ @note Call the \ref IRtcEngine::setEncryptionSecret "setEncryptionSecret" method to enable the built-in encryption function before calling this method.
+
+ @param encryptionMode Pointer to the set encryption mode:
+ - "aes-128-xts": (Default) 128-bit AES encryption, XTS mode.
+ - "aes-128-ecb": 128-bit AES encryption, ECB mode.
+ - "aes-256-xts": 256-bit AES encryption, XTS mode.
+ - "": When encryptionMode is set as NULL, the encryption mode is set as "aes-128-xts" by default.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setEncryptionMode(const char* encryptionMode) = 0;
+
+ /** Enables/Disables the built-in encryption.
+ *
+ * @since v3.1.0
+ *
+ * In scenarios requiring high security, AR recommends calling this method to enable the built-in encryption before joining a channel.
+ *
+ * All users in the same channel must use the same encryption mode and encryption key. Once all users leave the channel, the encryption key of this channel is automatically cleared.
+ *
+ * @note
+ * - If you enable the built-in encryption, you cannot use the RTMP streaming function.
+ * - AR supports four encryption modes. If you choose an encryption mode (excepting `SM4_128_ECB` mode), you need to add an external encryption library when integrating the SDK. See the advanced guide *Channel Encryption*.
+ *
+ * @param enabled Whether to enable the built-in encryption:
+ * - true: Enable the built-in encryption.
+ * - false: Disable the built-in encryption.
+ * @param config Configurations of built-in encryption schemas. See EncryptionConfig.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ * - -2(ERR_INVALID_ARGUMENT): An invalid parameter is used. Set the parameter with a valid value.
+ * - -4(ERR_NOT_SUPPORTED): The encryption mode is incorrect or the SDK fails to load the external encryption library. Check the enumeration or reload the external encryption library.
+ * - -7(ERR_NOT_INITIALIZED): The SDK is not initialized. Initialize the `IRtcEngine` instance before calling this method.
+ */
+ virtual int enableEncryption(bool enabled, const EncryptionConfig& config) = 0;
+
+ /** Registers a packet observer.
+
+ The AR SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission.
+
+ @note
+ - The size of the packet sent to the network after processing should not exceed 1200 bytes, otherwise, the packet may fail to be sent.
+ - Ensure that both receivers and senders call this method, otherwise, you may meet undefined behaviors such as no voice and black screen.
+ - When you use CDN live streaming, recording or storage functions, AR doesn't recommend calling this method.
+
+ @param observer Pointer to the registered packet observer. See IPacketObserver.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int registerPacketObserver(IPacketObserver* observer) = 0;
+
+ /** Creates a data stream.
+
+ Each user can create up to five data streams during the lifecycle of the IRtcEngine.
+
+ @note Set both the @p reliable and @p ordered parameters to true or false. Do not set one as true and the other as false.
+
+ @param streamId Pointer to the ID of the created data stream.
+ @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:
+ - true: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, an error is reported to the application.
+ - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream.
+ @param ordered Sets whether or not the recipients receive the data stream in the sent order:
+ - true: The recipients receive the data stream in the sent order.
+ - false: The recipients do not receive the data stream in the sent order.
+
+ @return
+ - Returns 0: Success.
+ - < 0: Failure.
+ */
+ virtual int createDataStream(int* streamId, bool reliable, bool ordered) = 0;
+
+ /** Sends data stream messages to all users in a channel.
+
+ The SDK has the following restrictions on this method:
+ - Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB.
+ - Each client can send up to 6 kB of data per second.
+ - Each user can have up to five data streams simultaneously.
+
+ A successful \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onStreamMessage "onStreamMessage" callback on the remote client, from which the remote user gets the stream message.
+
+ A failed \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onStreamMessageError "onStreamMessage" callback on the remote client.
+ @note This method applies only to the Communication profile or to the hosts in the Live-broadcast profile. If an audience in the Live-broadcast profile calls this method, the audience may be switched to a host.
+
+ @param streamId ID of the sent data stream, returned in the \ref IRtcEngine::createDataStream "createDataStream" method.
+ @param data Pointer to the sent data.
+ @param length Length of the sent data.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int sendStreamMessage(int streamId, const char* data, size_t length) = 0;
+
+ /** Publishes the local stream to a specified CDN live RTMP address. (CDN live only.)
+
+ The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback.
+
+ The \ref ar::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of adding a local stream to the CDN.
+ @note
+ - Ensure that the user joins the channel before calling this method.
+ - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.ar.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites).
+ - This method adds only one stream RTMP URL address each time it is called.
+ - This method applies to Live Broadcast only.
+
+ @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters.
+ @param transcodingEnabled Sets whether transcoding is enabled/disabled:
+ - true: Enable transcoding. To [transcode](https://docs.ar.io/en/AR%20Platform/terms?platform=All%20Platforms#transcoding) the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. If you set this parameter as `true`, ensure that you call the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method before this method.
+ - false: Disable transcoding.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ - #ERR_INVALID_ARGUMENT (2): The RTMP URL address is NULL or has a string length of 0.
+ - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream.
+ */
+ virtual int addPublishStreamUrl(const char *url, bool transcodingEnabled) = 0;
+
+ /** Removes an RTMP stream from the CDN. (CDN live only.)
+
+ This method removes the RTMP URL address (added by the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method) from a CDN live stream. The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamUnpublished "onStreamUnpublished" callback.
+
+ The \ref ar::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method call triggers the \ref ar::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of removing an RTMP stream from the CDN.
+ @note
+ - This method removes only one RTMP URL address each time it is called.
+ - The RTMP URL address must not contain special characters, such as Chinese language characters.
+ - This method applies to Live Broadcast only.
+
+ @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int removePublishStreamUrl(const char *url) = 0;
+
+ /** Sets the video layout and audio settings for CDN live. (CDN live only.)
+
+ The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onTranscodingUpdated "onTranscodingUpdated" callback when you call the `setLiveTranscoding` method to update the transcoding setting.
+
+ @note
+ - This method applies to Live Broadcast only.
+ - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.ar.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites).
+ - If you call the `setLiveTranscoding` method to update the transcoding setting for the first time, the SDK does not trigger the `onTranscodingUpdated` callback.
+
+ @param transcoding Sets the CDN live audio/video transcoding settings. See LiveTranscoding.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setLiveTranscoding(const LiveTranscoding &transcoding) = 0;
+
+ /** **DEPRECATED** Adds a watermark image to the local video or CDN live stream.
+
+ This method is deprecated from v2.9.1. Use \ref ar::rtc::IRtcEngine::addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) "addVideoWatermark"2 instead.
+
+ This method adds a PNG watermark image to the local video stream for the recording device, channel audience, and CDN live audience to view and capture.
+
+ To add the PNG file to the CDN live publishing stream, see the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method.
+
+ @param watermark Pointer to the watermark image to be added to the local video stream. See RtcImage.
+
+ @note
+ - The URL descriptions are different for the local video and CDN live streams:
+ - In a local video stream, @p url in RtcImage refers to the absolute path of the added watermark image file in the local video stream.
+ - In a CDN live stream, @p url in RtcImage refers to the URL address of the added watermark image in the CDN live broadcast.
+ - The source file of the watermark image must be in the PNG file format. If the width and height of the PNG file differ from your settings in this method, the PNG file will be cropped to conform to your settings.
+ - The AR SDK supports adding only one watermark image onto a local video or CDN live stream. The newly added watermark image replaces the previous one.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int addVideoWatermark(const RtcImage& watermark) = 0;
+
+ /** Adds a watermark image to the local video.
+
+ This method adds a PNG watermark image to the local video in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included),
+ and the recording device can see and capture it. AR supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.
+
+ The watermark position depends on the settings in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method:
+ - If the orientation mode of the encoding video is #ORIENTATION_MODE_FIXED_LANDSCAPE, or the landscape mode in #ORIENTATION_MODE_ADAPTIVE, the watermark uses the landscape orientation.
+ - If the orientation mode of the encoding video is #ORIENTATION_MODE_FIXED_PORTRAIT, or the portrait mode in #ORIENTATION_MODE_ADAPTIVE, the watermark uses the portrait orientation.
+ - When setting the watermark position, the region must be less than the dimensions set in the `setVideoEncoderConfiguration` method. Otherwise, the watermark image will be cropped.
+
+ @note
+ - Ensure that you have called the \ref ar::rtc::IRtcEngine::enableVideo "enableVideo" method to enable the video module before calling this method.
+ - If you only want to add a watermark image to the local video for the audience in the CDN live broadcast channel to see and capture, you can call this method or the \ref ar::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" method.
+ - This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray.
+ - If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings.
+ - If you have enabled the local video preview by calling the \ref ar::rtc::IRtcEngine::startPreview "startPreview" method, you can use the `visibleInPreview` member in the WatermarkOptions class to set whether or not the watermark is visible in preview.
+ - If you have mirrored the local video by calling the \ref ar::rtc::IRtcEngine::setupLocalVideo "setupLocalVideo" or \ref ar::rtc::IRtcEngine::setLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) "setLocalRenderMode" method, the watermark image in preview is also mirrored.
+
+ @param watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path.
+ @param options Pointer to the watermark's options to be added. See WatermarkOptions for more infomation.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) = 0;
+
+ /** Removes the watermark image from the video stream added by the \ref ar::rtc::IRtcEngine::addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) "addVideoWatermark" method.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int clearVideoWatermarks() = 0;
+
+ /** Enables/Disables image enhancement and sets the options.
+
+ @note
+ - Call this method after calling the enableVideo method.
+ - Currently this method does not apply for macOS.
+
+ @param enabled Sets whether or not to enable image enhancement:
+ - true: enables image enhancement.
+ - false: disables image enhancement.
+ @param options Sets the image enhancement option. See BeautyOptions.
+ */
+ virtual int setBeautyEffectOptions(bool enabled, BeautyOptions options) = 0;
+
+ /** Adds a voice or video stream URL address to a live broadcast.
+
+ The \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback returns the inject status. If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other.
+
+ The \ref ar::rtc::IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method call triggers the following callbacks:
+ - The local client:
+ - \ref ar::rtc::IRtcEngineEventHandler::onStreamInjectedStatus "onStreamInjectedStatus" , with the state of the injecting the online stream.
+ - \ref ar::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel.
+ - The remote client:
+ - \ref ar::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" (uid: 666), if the method call is successful and the online media stream is injected into the channel.
+
+ @note
+ - Ensure that you enable the RTMP Converter service before using this function. See [Prerequisites](https://docs.ar.io/en/Interactive%20Broadcast/cdn_streaming_windows?platform=Windows#prerequisites).
+ - This method applies to the Native SDK v2.4.1 and later.
+
+ @param url Pointer to the URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV.
+ - Supported FLV audio codec type: AAC.
+ - Supported FLV video codec type: H264 (AVC).
+ @param config Pointer to the InjectStreamConfig object that contains the configuration of the added voice or video stream.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ - #ERR_INVALID_ARGUMENT (2): The injected URL does not exist. Call this method again to inject the stream and ensure that the URL is valid.
+ - #ERR_NOT_READY (3): The user is not in the channel.
+ - #ERR_NOT_SUPPORTED (4): The channel profile is not live broadcast. Call the \ref ar::rtc::IRtcEngine::setChannelProfile "setChannelProfile" method and set the channel profile to live broadcast before calling this method.
+ - #ERR_NOT_INITIALIZED (7): The SDK is not initialized. Ensure that the IRtcEngine object is initialized before calling this method.
+ */
+ virtual int addInjectStreamUrl(const char* url, const InjectStreamConfig& config) = 0;
+ /** Starts to relay media streams across channels.
+ *
+ * After a successful method call, the SDK triggers the
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged
+ * "onChannelMediaRelayStateChanged" and
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent
+ * "onChannelMediaRelayEvent" callbacks, and these callbacks return the
+ * state and events of the media stream relay.
+ * - If the
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged
+ * "onChannelMediaRelayStateChanged" callback returns
+ * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), and the
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent
+ * "onChannelMediaRelayEvent" callback returns
+ * #RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL (4), the broadcaster starts
+ * sending data to the destination channel.
+ * - If the
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged
+ * "onChannelMediaRelayStateChanged" callback returns
+ * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream
+ * relay.
+ *
+ * @note
+ * - Call this method after the \ref joinChannel() "joinChannel" method.
+ * - This method takes effect only when you are a broadcaster in a
+ * Live-broadcast channel.
+ * - After a successful method call, if you want to call this method
+ * again, ensure that you call the
+ * \ref stopChannelMediaRelay() "stopChannelMediaRelay" method to quit the
+ * current relay.
+ * - Contact sales-us@ar.io before implementing this function.
+ * - We do not support string user accounts in this API.
+ *
+ * @param configuration The configuration of the media stream relay:
+ * ChannelMediaRelayConfiguration.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int startChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0;
+ /** Updates the channels for media stream relay. After a successful
+ * \ref startChannelMediaRelay() "startChannelMediaRelay" method call, if
+ * you want to relay the media stream to more channels, or leave the
+ * current relay channel, you can call the
+ * \ref updateChannelMediaRelay() "updateChannelMediaRelay" method.
+ *
+ * After a successful method call, the SDK triggers the
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent
+ * "onChannelMediaRelayEvent" callback with the
+ * #RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code.
+ *
+ * @note
+ * Call this method after the
+ * \ref startChannelMediaRelay() "startChannelMediaRelay" method to update
+ * the destination channel.
+ *
+ * @param configuration The media stream relay configuration:
+ * ChannelMediaRelayConfiguration.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int updateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0;
+ /** Stops the media stream relay.
+ *
+ * Once the relay stops, the broadcaster quits all the destination
+ * channels.
+ *
+ * After a successful method call, the SDK triggers the
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged
+ * "onChannelMediaRelayStateChanged" callback. If the callback returns
+ * #RELAY_STATE_IDLE (0) and #RELAY_OK (0), the broadcaster successfully
+ * stops the relay.
+ *
+ * @note
+ * If the method call fails, the SDK triggers the
+ * \ref ar::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged
+ * "onChannelMediaRelayStateChanged" callback with the
+ * #RELAY_ERROR_SERVER_NO_RESPONSE (2) or
+ * #RELAY_ERROR_SERVER_CONNECTION_LOST (8) state code. You can leave the
+ * channel by calling the \ref leaveChannel() "leaveChannel" method, and
+ * the media stream relay automatically stops.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int stopChannelMediaRelay() = 0;
+
+ /** Removes the voice or video stream URL address from a live broadcast.
+
+ This method removes the URL address (added by the \ref IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method) from the live broadcast.
+
+ @note If this method is called successfully, the SDK triggers the \ref IRtcEngineEventHandler::onUserOffline "onUserOffline" callback and returns a stream uid of 666.
+
+ @param url Pointer to the URL address of the added stream to be removed.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int removeInjectStreamUrl(const char* url) = 0;
+ virtual bool registerEventHandler(IRtcEngineEventHandler *eventHandler) = 0;
+ virtual bool unregisterEventHandler(IRtcEngineEventHandler *eventHandler) = 0;
+ /** AR supports reporting and analyzing customized messages.
+ *
+ * @since v3.1.0
+ *
+ * This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes.
+ * To try out this function, contact [support@ar.io](mailto:support@ar.io) and discuss the format of customized messages with us.
+ */
+ virtual int sendCustomReportMessage(const char *id, const char* category, const char* event, const char* label, int value) = 0;
+ /** Gets the current connection state of the SDK.
+
+ @return #CONNECTION_STATE_TYPE.
+ */
+ virtual CONNECTION_STATE_TYPE getConnectionState() = 0;
+ /// @cond
+ /** Enables/Disables the super-resolution algorithm for a remote user's video stream.
+ *
+ * @since v3.2.0
+ *
+ * The algorithm effectively improves the resolution of the specified remote user's video stream. When the original
+ * resolution of the remote video stream is axb pixels, you can receive and render the stream at a higher
+ * resolution (2ax2b pixels) by enabling the algorithm.
+ *
+ * After calling this method, the SDK triggers the
+ * \ref IRtcEngineEventHandler::onUserSuperResolutionEnabled "onUserSuperResolutionEnabled" callback to report
+ * whether you have successfully enabled the super-resolution algorithm.
+ *
+ * @warning The super-resolution algorithm requires extra system resources.
+ * To balance the visual experience and system usage, the SDK poses the following restrictions:
+ * - The algorithm can only be used for a single user at a time.
+ * - On the Android platform, the original resolution of the remote video must not exceed 640x360 pixels.
+ * - On the iOS platform, the original resolution of the remote video must not exceed 640x480 pixels.
+ * If you exceed these limitations, the SDK triggers the \ref IRtcEngineEventHandler::onWarning "onWarning"
+ * callback with the corresponding warning codes:
+ * - #WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION (1610): The origin resolution of the remote video is beyond the range where the super-resolution algorithm can be applied.
+ * - #WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION (1611): Another user is already using the super-resolution algorithm.
+ * - #WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED (1612): The device does not support the super-resolution algorithm.
+ *
+ * @note
+ * - This method applies to Android and iOS only.
+ * - Requirements for the user's device:
+ * - Android: The following devices are known to support the method:
+ * - VIVO: V1821A, NEX S, 1914A, 1916A, and 1824BA
+ * - OPPO: PCCM00
+ * - OnePlus: A6000
+ * - Xiaomi: Mi 8, Mi 9, MIX3, and Redmi K20 Pro
+ * - SAMSUNG: SM-G9600, SM-G9650, SM-N9600, SM-G9708, SM-G960U, and SM-G9750
+ * - HUAWEI: SEA-AL00, ELE-AL00, VOG-AL00, YAL-AL10, HMA-AL00, and EVR-AN00
+ * - iOS: This method is supported on devices running iOS 12.0 or later. The following
+ * device models are known to support the method:
+ * - iPhone XR
+ * - iPhone XS
+ * - iPhone XS Max
+ * - iPhone 11
+ * - iPhone 11 Pro
+ * - iPhone 11 Pro Max
+ * - iPad Pro 11-inch (3rd Generation)
+ * - iPad Pro 12.9-inch (3rd Generation)
+ * - iPad Air 3 (3rd Generation)
+ *
+ * @param userId The ID of the remote user.
+ * @param enable Whether to enable the super-resolution algorithm:
+ * - true: Enable the super-resolution algorithm.
+ * - false: Disable the super-resolution algorithm.
+ *
+ * @return
+ * - 0: Success.
+ * - < 0: Failure.
+ */
+ virtual int enableRemoteSuperResolution(uid_t userId, bool enable) = 0;
+ /// @endcond
+
+ /** Registers the metadata observer.
+
+ Registers the metadata observer. You need to implement the IMetadataObserver class and specify the metadata type in this method. A successful call of this method triggers the \ref ar::rtc::IMetadataObserver::getMaxMetadataSize "getMaxMetadataSize" callback.
+ This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes.
+
+ @note
+ - Call this method before the joinChannel method.
+ - This method applies to the Live-broadcast channel profile.
+
+ @param observer The IMetadataObserver class. See the definition of IMetadataObserver for details.
+ @param type See \ref IMetadataObserver::METADATA_TYPE "METADATA_TYPE". The SDK supports VIDEO_METADATA (0) only for now.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int registerMediaMetadataObserver(IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type) = 0;
+ /** Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
+
+ The JSON options are not public by default. AR is working on making commonly used JSON options public in a standard way.
+
+ @param parameters Sets the parameter as a JSON string in the specified format.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setParameters(const char* parameters) = 0;
+};
+
+
+class IRtcEngineParameter
+{
+public:
+ virtual ~IRtcEngineParameter () {}
+ /**
+ * Releases all IRtcEngineParameter resources.
+ */
+ virtual void release() = 0;
+
+ /** Sets the bool value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Sets the value.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setBool(const char* key, bool value) = 0;
+
+ /** Sets the int value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Sets the value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setInt(const char* key, int value) = 0;
+
+ /** Sets the unsigned int value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Sets the value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setUInt(const char* key, unsigned int value) = 0;
+
+ /** Sets the double value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Sets the value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setNumber(const char* key, double value) = 0;
+
+ /** Sets the string value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the set value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setString(const char* key, const char* value) = 0;
+
+ /** Sets the object value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the set value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setObject(const char* key, const char* value) = 0;
+
+ /** Retrieves the bool value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the retrieved value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getBool(const char* key, bool& value) = 0;
+
+ /** Retrieves the int value of the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the retrieved value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getInt(const char* key, int& value) = 0;
+
+ /** Retrieves the unsigned int value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the retrieved value.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getUInt(const char* key, unsigned int& value) = 0;
+
+ /** Retrieves the double value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the retrieved value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getNumber(const char* key, double& value) = 0;
+
+ /** Retrieves the string value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the retrieved value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getString(const char* key, ar::util::AString& value) = 0;
+
+ /** Retrieves a child object value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the retrieved value.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getObject(const char* key, ar::util::AString& value) = 0;
+
+ /** Retrieves the array value of a specified key in the JSON format.
+
+ @param key Pointer to the name of the key.
+ @param value Pointer to the retrieved value.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int getArray(const char* key, ar::util::AString& value) = 0;
+
+ /** Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.
+
+ @param parameters Pointer to the set parameters in a JSON string.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setParameters(const char* parameters) = 0;
+
+ /** Sets the profile to control the RTC engine.
+
+ @param profile Pointer to the set profile.
+ @param merge Sets whether to merge the profile data with the original value:
+ - true: Merge the profile data with the original value.
+ - false: Do not merge the profile data with the original value.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int setProfile(const char* profile, bool merge) = 0;
+
+ virtual int convertPath(const char* filePath, ar::util::AString& value) = 0;
+};
+
+class AAudioDeviceManager : public ar::util::AutoPtr<IAudioDeviceManager>
+{
+public:
+ AAudioDeviceManager(IRtcEngine* engine)
+ {
+ queryInterface(engine, AR_IID_AUDIO_DEVICE_MANAGER);
+ }
+};
+
+class AVideoDeviceManager : public ar::util::AutoPtr<IVideoDeviceManager>
+{
+public:
+ AVideoDeviceManager(IRtcEngine* engine)
+ {
+ queryInterface(engine, AR_IID_VIDEO_DEVICE_MANAGER);
+ }
+};
+
+class AParameter : public ar::util::AutoPtr<IRtcEngineParameter>
+{
+public:
+ AParameter(IRtcEngine& engine) { initialize(&engine); }
+ AParameter(IRtcEngine* engine) { initialize(engine); }
+ AParameter(IRtcEngineParameter* p) :ar::util::AutoPtr<IRtcEngineParameter>(p) {}
+private:
+ bool initialize(IRtcEngine* engine)
+ {
+ IRtcEngineParameter* p = NULL;
+ if (engine && !engine->queryInterface(AR_IID_RTC_ENGINE_PARAMETER, (void**)&p))
+ reset(p);
+ return p != NULL;
+ }
+};
+/** **DEPRECATED** The RtcEngineParameters class is deprecated, use the IRtcEngine class instead.
+*/
+class RtcEngineParameters
+{
+public:
+ RtcEngineParameters(IRtcEngine& engine)
+ :m_parameter(&engine){}
+ RtcEngineParameters(IRtcEngine* engine)
+ :m_parameter(engine){}
+
+
+ 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");
+ }
+
+
+
+ int muteLocalVideoStream(bool mute) {
+ return setParameters("{\"rtc.video.mute_me\":%s,\"che.video.local.send\":%s}", mute ? "true" : "false", mute ? "false" : "true");
+ }
+
+
+ int muteAllRemoteVideoStreams(bool mute) {
+ return m_parameter ? m_parameter->setBool("rtc.video.mute_peers", mute) : -ERR_NOT_INITIALIZED;
+ }
+
+
+
+ int setDefaultMuteAllRemoteVideoStreams(bool mute) {
+ return m_parameter ? m_parameter->setBool("rtc.video.set_default_mute_peers", mute) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int muteRemoteVideoStream(uid_t uid, bool mute) {
+ return setObject("rtc.video.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute ? "true" : "false");
+ }
+
+
+ int setPlaybackDeviceVolume(int volume) {// [0,255]
+ return m_parameter ? m_parameter->setInt("che.audio.output.volume", volume) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) {
+ return startAudioRecording(filePath, 32000, quality);
+ }
+
+ int startAudioRecording(const char* filePath, int sampleRate, 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\",\"sampleRate\":%d,\"quality\":%d}", filePath, sampleRate, quality);
+ }
+
+
+ int stopAudioRecording() {
+ return m_parameter ? m_parameter->setBool("che.audio.stop_recording", true) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ 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);
+ }
+
+
+ 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) {
+ int ret = adjustAudioMixingPlayoutVolume(volume);
+ if (ret == 0) {
+ adjustAudioMixingPublishVolume(volume);
+ }
+ return ret;
+ }
+
+
+ int adjustAudioMixingPlayoutVolume(int volume) {
+ return m_parameter ? m_parameter->setInt("che.audio.set_file_as_playout_volume", volume) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int getAudioMixingPlayoutVolume() {
+ int volume = 0;
+ int r = m_parameter ? m_parameter->getInt("che.audio.get_file_as_playout_volume", volume) : -ERR_NOT_INITIALIZED;
+ if (r == 0)
+ r = volume;
+ return r;
+ }
+
+
+ int adjustAudioMixingPublishVolume(int volume) {
+ return m_parameter ? m_parameter->setInt("che.audio.set_file_as_playout_publish_volume", volume) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int getAudioMixingPublishVolume() {
+ int volume = 0;
+ int r = m_parameter ? m_parameter->getInt("che.audio.get_file_as_playout_publish_volume", volume) : -ERR_NOT_INITIALIZED;
+ if (r == 0)
+ r = volume;
+ return r;
+ }
+
+
+ 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;
+ }
+
+ int setAudioMixingPitch(int pitch) {
+ if (!m_parameter) {
+ return -ERR_NOT_INITIALIZED;
+ }
+ if (pitch > 12 || pitch < -12) {
+ return -ERR_INVALID_ARGUMENT;
+ }
+ return m_parameter->setInt("che.audio.set_playout_file_pitch_semitones", pitch);
+ }
+
+ 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;
+ }
+
+
+ int setEffectsVolume(int volume) {
+ return m_parameter ? m_parameter->setInt("che.audio.game_set_effects_volume", volume) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int setVolumeOfEffect(int soundId, int volume) {
+ return setObject(
+ "che.audio.game_adjust_effect_volume",
+ "{\"soundId\":%d,\"gain\":%d}",
+ soundId, volume);
+ }
+
+
+ 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);
+ }
+
+
+ int stopEffect(int soundId) {
+ return m_parameter ? m_parameter->setInt(
+ "che.audio.game_stop_effect", soundId) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int stopAllEffects() {
+ return m_parameter ? m_parameter->setBool(
+ "che.audio.game_stop_all_effects", true) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int preloadEffect(int soundId, char* filePath) {
+ return setObject(
+ "che.audio.game_preload_effect",
+ "{\"soundId\":%d,\"filePath\":\"%s\"}",
+ soundId, filePath);
+ }
+
+
+ int unloadEffect(int soundId) {
+ return m_parameter ? m_parameter->setInt(
+ "che.audio.game_unload_effect", soundId) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int pauseEffect(int soundId) {
+ return m_parameter ? m_parameter->setInt(
+ "che.audio.game_pause_effect", soundId) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int pauseAllEffects() {
+ return m_parameter ? m_parameter->setBool(
+ "che.audio.game_pause_all_effects", true) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int resumeEffect(int soundId) {
+ return m_parameter ? m_parameter->setInt(
+ "che.audio.game_resume_effect", soundId) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int resumeAllEffects() {
+ return m_parameter ? m_parameter->setBool(
+ "che.audio.game_resume_all_effects", true) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int enableSoundPositionIndication(bool enabled) {
+ return m_parameter ? m_parameter->setBool(
+ "che.audio.enable_sound_position", enabled) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int setRemoteVoicePosition(uid_t uid, double pan, double gain) {
+ return setObject("che.audio.game_place_sound_position", "{\"uid\":%u,\"pan\":%lf,\"gain\":%lf}", uid, pan, gain);
+ }
+
+
+ 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);
+ }
+
+
+ int setLocalVoiceChanger(VOICE_CHANGER_PRESET voiceChanger) {
+ if(!m_parameter)
+ return -ERR_NOT_INITIALIZED;
+ if(voiceChanger == 0x00000000) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", static_cast<int>(voiceChanger));
+ }
+ else if(voiceChanger > 0x00000000 && voiceChanger < 0x00100000) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", static_cast<int>(voiceChanger));
+ }
+ else if(voiceChanger > 0x00100000 && voiceChanger < 0x00200000) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", static_cast<int>(voiceChanger - 0x00100000 + 6));
+ }
+ else if(voiceChanger > 0x00200000 && voiceChanger < 0x00300000) {
+ return m_parameter->setInt("che.audio.morph.beauty_voice", static_cast<int>(voiceChanger - 0x00200000));
+ }
+ else {
+ return -ERR_INVALID_ARGUMENT;
+ }
+ }
+
+
+ int setLocalVoiceReverbPreset(AUDIO_REVERB_PRESET reverbPreset) {
+ if(!m_parameter)
+ return -ERR_NOT_INITIALIZED;
+ if(reverbPreset == 0x00000000) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", static_cast<int>(reverbPreset));
+ }
+ else if(reverbPreset > 0x00000000 && reverbPreset < 0x00100000) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", static_cast<int>(reverbPreset + 8));
+ }
+ else if(reverbPreset > 0x00100000 && reverbPreset < 0x00200000) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", static_cast<int>(reverbPreset - 0x00100000));
+ }
+ else if(reverbPreset > 0x00200000 && reverbPreset < 0x00200002) {
+ return m_parameter->setInt("che.audio.morph.virtual_stereo", static_cast<int>(reverbPreset - 0x00200000));
+ }
+ else if (reverbPreset > (AUDIO_REVERB_PRESET) 0x00300000 && reverbPreset < (AUDIO_REVERB_PRESET) 0x00300002)
+ return setObject( "che.audio.morph.electronic_voice", "{\"key\":%d,\"value\":%d}", 1, 4);
+ else if (reverbPreset > (AUDIO_REVERB_PRESET) 0x00400000 && reverbPreset < (AUDIO_REVERB_PRESET) 0x00400002)
+ return m_parameter->setInt("che.audio.morph.threedim_voice", 10);
+ else {
+ return -ERR_INVALID_ARGUMENT;
+ }
+ }
+
+ int setAudioEffectPreset(AUDIO_EFFECT_PRESET preset){
+ if(!m_parameter)
+ return -ERR_NOT_INITIALIZED;
+ if(preset == AUDIO_EFFECT_OFF) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 0);
+ }
+ if(preset == ROOM_ACOUSTICS_KTV){
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 1);
+ }
+ if(preset == ROOM_ACOUSTICS_VOCAL_CONCERT) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 2);
+ }
+ if(preset == ROOM_ACOUSTICS_STUDIO) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 5);
+ }
+ if(preset == ROOM_ACOUSTICS_PHONOGRAPH) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 8);
+ }
+ if(preset == ROOM_ACOUSTICS_VIRTUAL_STEREO) {
+ return m_parameter->setInt("che.audio.morph.virtual_stereo", 1);
+ }
+ if(preset == ROOM_ACOUSTICS_SPACIAL) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 15);
+ }
+ if(preset == ROOM_ACOUSTICS_ETHEREAL) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 5);
+ }
+ if(preset == ROOM_ACOUSTICS_3D_VOICE) {
+ return m_parameter->setInt("che.audio.morph.threedim_voice", 10);
+ }
+ if(preset == VOICE_CHANGER_EFFECT_UNCLE) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 3);
+ }
+ if(preset == VOICE_CHANGER_EFFECT_OLDMAN) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 1);
+ }
+ if(preset == VOICE_CHANGER_EFFECT_BOY) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 2);
+ }
+ if(preset == VOICE_CHANGER_EFFECT_SISTER) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 4);
+ }
+ if(preset == VOICE_CHANGER_EFFECT_GIRL) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 3);
+ }
+ if(preset == VOICE_CHANGER_EFFECT_PIGKING) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 4);
+ }
+ if(preset == VOICE_CHANGER_EFFECT_HULK) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 6);
+ }
+ if(preset == STYLE_TRANSFORMATION_RNB) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 7);
+ }
+ if(preset == STYLE_TRANSFORMATION_POPULAR) {
+ return m_parameter->setInt("che.audio.morph.reverb_preset", 6);
+ }
+ if(preset == PITCH_CORRECTION) {
+ return setObject( "che.audio.morph.electronic_voice", "{\"key\":%d,\"value\":%d}", 1, 4);
+ }
+ return -ERR_INVALID_ARGUMENT;
+ }
+
+ int setVoiceBeautifierPreset(VOICE_BEAUTIFIER_PRESET preset) {
+ if(!m_parameter)
+ return -ERR_NOT_INITIALIZED;
+ if(preset == VOICE_BEAUTIFIER_OFF) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 0);
+ }
+ if(preset == CHAT_BEAUTIFIER_MAGNETIC) {
+ return m_parameter->setInt("che.audio.morph.beauty_voice", 1);
+ }
+ if(preset == CHAT_BEAUTIFIER_FRESH) {
+ return m_parameter->setInt("che.audio.morph.beauty_voice", 2);
+ }
+ if(preset == CHAT_BEAUTIFIER_VITALITY) {
+ return m_parameter->setInt("che.audio.morph.beauty_voice", 3);
+ }
+ /*if(preset == SINGING_BEAUTIFICATION_MAN) {
+ return m_parameter->setInt("che.audio.morph.beauty_sing", 1);
+ }
+ if(preset == SINGING_BEAUTIFICATION_WOMAN) {
+ return m_parameter->setInt("che.audio.morph.beauty_sing", 2);
+ }*/
+ if(preset == TIMBRE_TRANSFORMATION_VIGOROUS) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 7);
+ }
+ if(preset == TIMBRE_TRANSFORMATION_DEEP) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 8);
+ }
+ if(preset == TIMBRE_TRANSFORMATION_MELLOW) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 9);
+ }
+ if(preset == TIMBRE_TRANSFORMATION_FALSETTO) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 10);
+ }
+ if(preset == TIMBRE_TRANSFORMATION_FULL) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 11);
+ }
+ if(preset == TIMBRE_TRANSFORMATION_CLEAR) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 12);
+ }
+ if(preset == TIMBRE_TRANSFORMATION_RESOUNDING) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 13);
+ }
+ if(preset == TIMBRE_TRANSFORMATION_RINGING) {
+ return m_parameter->setInt("che.audio.morph.voice_changer", 14);
+ }
+ return -ERR_INVALID_ARGUMENT;
+ }
+
+ int setAudioEffectParameters(AUDIO_EFFECT_PRESET preset, int param1, int param2){
+ if(!m_parameter)
+ return -ERR_NOT_INITIALIZED;
+ if(preset == PITCH_CORRECTION){
+ return setObject( "che.audio.morph.electronic_voice", "{\"key\":%d,\"value\":%d}", param1, param2);
+ }
+ if(preset == ROOM_ACOUSTICS_3D_VOICE){
+ return m_parameter->setInt("che.audio.morph.threedim_voice", param1);
+ }
+ return -ERR_INVALID_ARGUMENT;
+ }
+
+ /** **DEPRECATED** Use \ref IRtcEngine::disableAudio "disableAudio" instead. Disables the audio function in the channel.
+
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ int pauseAudio() {
+ return m_parameter ? m_parameter->setBool("che.pause.audio", true) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int resumeAudio() {
+ return m_parameter ? m_parameter->setBool("che.pause.audio", false) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ 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 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;
+ }
+
+
+ int enableAudioVolumeIndication(int interval, int smooth, bool report_vad) { // in ms: <= 0: disable, > 0: enable, interval in ms
+ if (interval < 0)
+ interval = 0;
+ return setObject("che.audio.volume_indication", "{\"interval\":%d,\"smooth\":%d,\"vad\":%d}", interval, smooth, report_vad);
+ }
+
+
+ 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
+
+
+ int muteRemoteAudioStream(uid_t uid, bool mute) {
+ return setObject("rtc.audio.mute_peer", "{\"uid\":%u,\"mute\":%s}", uid, mute?"true":"false");
+ }
+
+
+ int muteAllRemoteAudioStreams(bool mute) {
+ return m_parameter ? m_parameter->setBool("rtc.audio.mute_peers", mute) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int setDefaultMuteAllRemoteAudioStreams(bool mute) {
+ return m_parameter ? m_parameter->setBool("rtc.audio.set_default_mute_peers", mute) : -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}");
+ }
+
+
+ int setExternalAudioSink(bool enabled, int sampleRate, int channels) {
+ if (enabled)
+ return setParameters("{\"che.audio.external_render\":true,\"che.audio.external_render.pull\":true,\"che.audio.set_render_raw_audio_format\":{\"sampleRate\":%d,\"channelCnt\":%d,\"mode\":%d}}", sampleRate, channels, RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY);
+ else
+ return setParameters("{\"che.audio.external_render\":false,\"che.audio.external_render.pull\":false}");
+ }
+
+
+ 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);
+ }
+
+
+ int setLogFilter(unsigned int filter) {
+ return m_parameter ? m_parameter->setUInt("rtc.log_filter", filter&LOG_FILTER_MASK) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int setLogFileSize(unsigned int fileSizeInKBytes) {
+ return m_parameter ? m_parameter->setUInt("rtc.log_size", fileSizeInKBytes) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int setLocalRenderMode(RENDER_MODE_TYPE renderMode) {
+ return setRemoteRenderMode(0, renderMode);
+ }
+
+
+ int setRemoteRenderMode(uid_t uid, RENDER_MODE_TYPE renderMode) {
+ return setParameters("{\"che.video.render_mode\":[{\"uid\":%u,\"renderMode\":%d}]}", uid, renderMode);
+ }
+
+
+ int setCameraCapturerConfiguration(const CameraCapturerConfiguration& config) {
+ if (!m_parameter) return -ERR_NOT_INITIALIZED;
+ return m_parameter->setInt("che.video.camera_capture_mode", (int)config.preference);
+ }
+
+
+ int enableDualStreamMode(bool enabled) {
+ return setParameters("{\"rtc.dual_stream_mode\":%s,\"che.video.enableLowBitRateStream\":%d}", enabled ? "true" : "false", enabled ? 1 : 0);
+ }
+
+
+ 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;
+ }
+
+
+ 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 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 broadcast
+
+ 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 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 setLocalPublishFallbackOption(STREAM_FALLBACK_OPTIONS option) {
+ return m_parameter ? m_parameter->setInt("rtc.local_publish_fallback_option", option) : -ERR_NOT_INITIALIZED;
+ }
+
+
+ int setRemoteSubscribeFallbackOption(STREAM_FALLBACK_OPTIONS option) {
+ return m_parameter ? m_parameter->setInt("rtc.remote_subscribe_fallback_option", option) : -ERR_NOT_INITIALIZED;
+ }
+
+#if (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE) || defined(_WIN32)
+
+ int enableLoopbackRecording(bool enabled, const char* deviceName = NULL) {
+ if (!deviceName) {
+ return setParameters("{\"che.audio.loopback.recording\":%s}", enabled ? "true" : "false");
+ }
+ else {
+ return setParameters("{\"che.audio.loopback.deviceName\":\"%s\",\"che.audio.loopback.recording\":%s}", deviceName, enabled ? "true" : "false");
+ }
+ }
+#endif
+
+
+ int setInEarMonitoringVolume(int volume) {
+ return m_parameter ? m_parameter->setInt("che.audio.headset.monitoring.parameter", volume) : -ERR_NOT_INITIALIZED;
+ }
+
+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 stopAllRemoteVideo() {
+ return m_parameter ? m_parameter->setBool("che.video.peer.stop_render", true) : -ERR_NOT_INITIALIZED;
+ }
+private:
+ AParameter m_parameter;
+};
+
+} //namespace rtc
+} // namespace ar
+
+
+#define getARRtcEngineVersion getARSdkVersion
+
+////////////////////////////////////////////////////////
+/** \addtogroup createARRtcEngine
+ @{
+ */
+////////////////////////////////////////////////////////
+
+/** Creates the IRtcEngine object and returns the pointer.
+ *
+ * @return Pointer to the IRtcEngine object.
+ */
+AR_API ar::rtc::IRtcEngine* AR_CALL createARRtcEngine();
+
+////////////////////////////////////////////////////////
+/** @} */
+////////////////////////////////////////////////////////
+
+#define getARRtcEngineErrorDescription getARSdkErrorDescription
+#define setARRtcEngineExternalSymbolLoader setARSdkExternalSymbolLoader
+
+#endif
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArService.h b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArService.h
new file mode 100644
index 0000000..0a01981
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Headers/IArService.h
@@ -0,0 +1,76 @@
+// AR SDK
+//
+// Copyright (c) 2019 AR.io. All rights reserved.
+//
+
+#ifndef __I_AR_SERVICE_H__
+#define __I_AR_SERVICE_H__
+#include "ArBase.h"
+
+namespace ar {
+ namespace rtc {
+ class IRtcEngine;
+ }
+ namespace rtm {
+ class IRtmService;
+ }
+namespace base {
+
+struct ARServiceContext
+{
+};
+
+
+class IARService
+{
+protected:
+ virtual ~IARService(){}
+public:
+ virtual void release() = 0;
+
+ /** Initializes the engine.
+
+ @param context RtcEngine context.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+ */
+ virtual int initialize(const ARServiceContext& context) = 0;
+
+ /** Retrieves the SDK version number.
+ * @param build Build number.
+ * @return The current SDK version in the string format. For example, 2.4.0
+ */
+ virtual const char* getVersion(int* build) = 0;
+
+ virtual rtm::IRtmService* createRtmService() = 0;
+};
+
+} //namespace base
+} // namespace ar
+
+/** Gets the SDK version number.
+
+ @param build Build number of the AR SDK.
+ @return
+ - 0: Success.
+ - < 0: Failure.
+*/
+AR_API const char* AR_CALL getARSdkVersion(int* build);
+
+/**
+* Creates the RtcEngine object and returns the pointer.
+* @param err Error code
+* @return returns Description of the error code
+*/
+AR_API const char* AR_CALL getARSdkErrorDescription(int err);
+
+/**
+* Creates the AR Service object and returns the pointer.
+* @return returns Pointer of the AR Service object
+*/
+AR_API ar::base::IARService* AR_CALL createARService();
+
+AR_API int AR_CALL setARSdkExternalSymbolLoader(void* (*func)(const char* symname));
+
+#endif
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Info.plist b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Info.plist
new file mode 100644
index 0000000..09c64f8
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Info.plist
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Modules/module.modulemap b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Modules/module.modulemap
new file mode 100644
index 0000000..416e62f
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ARtcKit.framework/Modules/module.modulemap
@@ -0,0 +1,6 @@
+framework module ARtcKit {
+ umbrella header "ARtcKit.h"
+
+ export *
+ module * { export * }
+}
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/ArRtcUniPlugin b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/ArRtcUniPlugin
new file mode 100644
index 0000000..026c065
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/ArRtcUniPlugin
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/ARtcKit b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/ARtcKit
new file mode 100644
index 0000000..319d1df
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/ARtcKit
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/Info.plist b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/Info.plist
new file mode 100644
index 0000000..09c64f8
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/Info.plist
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/_CodeSignature/CodeResources b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/_CodeSignature/CodeResources
new file mode 100644
index 0000000..dfd443b
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Frameworks/ARtcKit.framework/_CodeSignature/CodeResources
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>files</key>
+ <dict>
+ <key>Info.plist</key>
+ <data>
+ ea52Cqx2Xud4WA0lw2WZ1aUYdyE=
+ </data>
+ </dict>
+ <key>files2</key>
+ <dict/>
+ <key>rules</key>
+ <dict>
+ <key>^.*</key>
+ <true/>
+ <key>^.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^version.plist$</key>
+ <true/>
+ </dict>
+ <key>rules2</key>
+ <dict>
+ <key>.*\.dSYM($|/)</key>
+ <dict>
+ <key>weight</key>
+ <real>11</real>
+ </dict>
+ <key>^(.*/)?\.DS_Store$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>2000</real>
+ </dict>
+ <key>^.*</key>
+ <true/>
+ <key>^.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^Info\.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^PkgInfo$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^embedded\.provisionprofile$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^version\.plist$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Info.plist b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Info.plist
new file mode 100644
index 0000000..cffeb97
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/Info.plist
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeDirectory b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeDirectory
new file mode 100644
index 0000000..496380b
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeDirectory
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements
new file mode 100644
index 0000000..153a630
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements-1 b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements-1
new file mode 100644
index 0000000..e57b6de
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeRequirements-1
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeResources b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeResources
new file mode 100644
index 0000000..fb547ca
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeResources
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>files</key>
+ <dict>
+ <key>Frameworks/ARtcKit.framework/ARtcKit</key>
+ <data>
+ zSTdfD26r2Z5oNp2BjEkOyIAJi8=
+ </data>
+ <key>Frameworks/ARtcKit.framework/Info.plist</key>
+ <data>
+ ea52Cqx2Xud4WA0lw2WZ1aUYdyE=
+ </data>
+ <key>Frameworks/ARtcKit.framework/_CodeSignature/CodeResources</key>
+ <data>
+ FNzX1qfO6b1WYfbM5ft9XvZjJDU=
+ </data>
+ <key>Info.plist</key>
+ <data>
+ FlAs63hum7QtW+kVR2M2RDY8570=
+ </data>
+ </dict>
+ <key>files2</key>
+ <dict>
+ <key>Frameworks/ARtcKit.framework/ARtcKit</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ zSTdfD26r2Z5oNp2BjEkOyIAJi8=
+ </data>
+ <key>hash2</key>
+ <data>
+ XN9KFvy17so6EVuc6EqPjdL0zJrNKkZZlNFXBYTzhpw=
+ </data>
+ </dict>
+ <key>Frameworks/ARtcKit.framework/Info.plist</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ ea52Cqx2Xud4WA0lw2WZ1aUYdyE=
+ </data>
+ <key>hash2</key>
+ <data>
+ lWoQu2XnhV26Xzkbh3xQFJN2WJO/s+w8+94MDmaJs+k=
+ </data>
+ </dict>
+ <key>Frameworks/ARtcKit.framework/_CodeSignature/CodeResources</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ FNzX1qfO6b1WYfbM5ft9XvZjJDU=
+ </data>
+ <key>hash2</key>
+ <data>
+ wujn+kDmAWCNHbxPR0cKrNpyI2fKLSE2hDVbFt8OqcQ=
+ </data>
+ </dict>
+ </dict>
+ <key>rules</key>
+ <dict>
+ <key>^.*</key>
+ <true/>
+ <key>^.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^version.plist$</key>
+ <true/>
+ </dict>
+ <key>rules2</key>
+ <dict>
+ <key>.*\.dSYM($|/)</key>
+ <dict>
+ <key>weight</key>
+ <real>11</real>
+ </dict>
+ <key>^(.*/)?\.DS_Store$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>2000</real>
+ </dict>
+ <key>^.*</key>
+ <true/>
+ <key>^.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^Info\.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^PkgInfo$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^embedded\.provisionprofile$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^version\.plist$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeSignature b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeSignature
new file mode 100644
index 0000000..6d41f5c
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/ios/ArRtcUniPlugin.framework/_CodeSignature/CodeSignature
Binary files differ
diff --git a/nativePlugins/AR-RtcModule/package.json b/nativePlugins/AR-RtcModule/package.json
new file mode 100644
index 0000000..80dfb50
--- /dev/null
+++ b/nativePlugins/AR-RtcModule/package.json
@@ -0,0 +1,81 @@
+{
+ "name": "AR-RtcModule",
+ "id": "AR-RtcModule",
+ "version": "1.0.5",
+ "description": "anyRTC音视频插件提供音视频功能,支持Android、iOS。",
+ "_dp_type": "nativeplugin",
+ "_dp_nativeplugin": {
+ "android": {
+ "plugins": [{
+ "type": "module",
+ "name": "AR-RtcModule",
+ "class": "org.ar.arsdk.RtcModule"
+ },
+ {
+ "type": "component",
+ "name": "AR-CanvasView",
+ "class": "org.ar.arsdk.RtcComponent"
+ }
+ ],
+ "integrateType": "aar",
+ "dependencies": [
+ "com.github.bumptech.glide:glide:4.9.0",
+ "com.alibaba:fastjson:1.1.46.android",
+ "com.android.support:recyclerview-v7:26.1.0",
+ "com.facebook.fresco:fresco:1.13.0",
+ "com.facebook.fresco:animated-gif:1.13.0",
+ "com.github.bumptech.glide:glide:4.9.0",
+ "com.alibaba:fastjson:1.1.46.android"
+ ],
+ "compileOptions": {
+ "sourceCompatibility": "1.8",
+ "targetCompatibility": "1.8"
+ },
+ "abis": [
+ "armeabi-v7a",
+ "x86"
+ ],
+ "minSdkVersion": "19",
+ "useAndroidX": false,
+ "permissions": [
+ "android.permission.INTERNET",
+ "android.permission.RECORD_AUDIO",
+ "android.permission.MODIFY_AUDIO_SETTINGS",
+ "android.permission.ACCESS_NETWORK_STATE",
+ "android.permission.READ_PHONE_STATE",
+ "android.permission.CAMERA",
+ "android.permission.WRITE_EXTERNAL_STORAGE",
+ "android.permission.BLUETOOTH",
+ "android.permission.WAKE_LOCK",
+ "android.permission.READ_EXTERNAL_STORAGE"
+ ]
+ },
+ "ios": {
+ "plugins": [
+ {
+ "type": "module",
+ "name": "AR-RtcModule",
+ "class": "RtcModule"
+ },
+ {
+ "type": "component",
+ "name": "AR-CanvasView",
+ "class": "RtcComponent"
+ }
+ ],
+ "frameworks": [
+ "ARtcKit.framework"
+ ],
+ "embedFrameworks": [
+ "ARtcKit.framework"
+ ],
+ "integrateType": "framework",
+ "deploymentTarget": "9.0",
+ "privacies": [
+ "NSCameraUsageDescription",
+ "NSMicrophoneUsageDescription"
+ ]
+ }
+ }
+}
+
diff --git a/pages.json b/pages.json
index 74c1c38..de0edcc 100644
--- a/pages.json
+++ b/pages.json
@@ -3,6 +3,13 @@
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"pages": [{
+ "path": "pages/home/home",
+ "style": {
+ "navigationBarTitleText": "首页",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ }, {
"path": "pages/login/login-account",
"style": {
"navigationBarTitleText": "登录",
@@ -21,14 +28,16 @@
// "animationDuration": 300
// }
}
- }, {
- "path": "pages/home/home",
- "style": {
- "navigationBarTitleText": "首页",
- "enablePullDownRefresh": false,
- "navigationStyle": "custom"
- }
- }, {
+ },
+ // {
+ // "path": "pages/home/home",
+ // "style": {
+ // "navigationBarTitleText": "首页",
+ // "enablePullDownRefresh": false,
+ // "navigationStyle": "custom"
+ // }
+ // },
+ {
"path": "pages/service/service",
"style": {
"navigationBarTitleText": "服务",
@@ -328,7 +337,16 @@
"navigationStyle": "custom"
}
}
- ],
+ ,{
+ "path" : "pages/videoCall/videoCall",
+ "style" :
+ {
+ "navigationBarTitleText": "视频通话",
+ "enablePullDownRefresh": false
+ }
+
+ }
+ ],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
diff --git a/pages/home/home.vue b/pages/home/home.vue
index c58b990..03866a3 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -114,6 +114,8 @@
</view>
<!-- 新闻模块 end -->
</view>
+ <u-button class="ccbut" type="primary" @click="openVideo('Mains')">测试点视频通话:主播</u-button>
+ <u-button class="ccbut" type="primary" @click="openVideo('Receiver')">测试点视频通话:第二个</u-button>
</view>
</template>
@@ -179,6 +181,11 @@
}, 2000);
},
methods: {
+ openVideo(val){
+ uni.navigateTo({
+ url: '../videoCall/videoCall?state=' + val
+ });
+ },
changePicker(e) {
console.log(this.pickerArr[e.detail.value].name);
this.position = this.pickerArr[e.detail.value].name;
diff --git a/pages/securityStaff/information.vue b/pages/securityStaff/information.vue
index 585912b..eecb301 100644
--- a/pages/securityStaff/information.vue
+++ b/pages/securityStaff/information.vue
@@ -135,9 +135,7 @@
},
showi: false,
showc: false,
- cylist: {
-
- }
+ cylist: []
}
},
methods: {
diff --git a/pages/videoCall/videoCall.vue b/pages/videoCall/videoCall.vue
new file mode 100644
index 0000000..f100b08
--- /dev/null
+++ b/pages/videoCall/videoCall.vue
@@ -0,0 +1,781 @@
+<template>
+ <view class="content">
+ <!-- 加入频道 -->
+ <view class="index" v-if="!videoShow">
+ <!-- 输入频道 -->
+ <!-- <view class="chanel">
+ <input class="uni-input activetext" v-model="channel" focus placeholder="请输入频道号" />
+ </view>
+
+ <view class="setrole">
+
+ <button type="default" :class="role == 1? 'active': 'button'" @click="setClientRole(1)"><text class="text button_text"
+ :class="role == 1? 'activetext': ''">我是主播</text></button>
+
+ <button type="default" :class="role == 2? 'active': 'button'" @click="setClientRole(2)"><text class="text" :class="role == 2? 'activetext': ''">我是游客</text></button>
+ </view>
+
+ <view class="join">
+ <button type="primary" class="button jion_bg" @click="join"><text class="activetext">加入频道</text></button>
+ </view> -->
+ <view class="Mains" v-if="isMain">
+ <view class="title">
+ 正在呼叫{{MainName}}
+ <u-loading size="36" mode="flower"></u-loading>
+ </view>
+
+ <!-- 挂断 -->
+ <view class="open" @click="phoneFnMain">
+ <image class="video_bg_img" src="../../static/over.png" mode=""></image>
+ <text class="open_text">取消呼叫</text>
+
+ </view>
+ </view>
+ <view class="Receiver" v-if="!isMain">
+ <!-- <u-button class="ccbut" type="primary" @click="join('Receiver')">确认进入{{channel}}号房间</u-button> -->
+ <!-- <u-button class="ccbut" type="primary" @click="comeBack">拒绝进入</u-button> -->
+ <view class="open" @click="join('Receiver')">
+ <image class="video_bg_img" src="../../static/phone.png" mode=""></image>
+ <text class="open_text">接受</text>
+
+ </view>
+ <view class="open" @click="comeBack">
+ <image class="video_bg_img" src="../../static/over.png" mode=""></image>
+ <text class="open_text">挂断</text>
+
+ </view>
+ </view>
+ </view>
+
+ <!-- 视频 -->
+ <view class="vedio vedioWatch" v-else>
+
+ <view class="video_bg">
+ <image class="video_bg_img" src="../../static/BG.png" mode=""></image>
+ <!-- <text class="activetext" v-if="videoShowBg"></text> -->
+ <!-- <view class="video_bg video_bg_text">
+
+ <text class="activetext">{{promptText}}</text>
+ </view> -->
+ </view>
+
+ <view class="video_region" :class="PeerVideoUser.length > 1 ? 'video_region_padding' : ''">
+ <!-- 渲染视频 -->
+ <view v-for="peervideo in PeerVideoUser" :key="peervideo">
+ <view :class="PeerVideoUserStyle" v-if="peervideo == uid && role == 2 ? false : true">
+ <AR-CanvasView :ref="`popup${peervideo}`" style="flex: 1;"></AR-CanvasView>
+ </view>
+
+ </view>
+ </view>
+
+ <!-- 转换摄像头 -->
+ <view class="camera position" @click="cameraSwitchFn" v-if="role == 1">
+ <image class="video_bg_img" src="../../static/camera.png" mode=""></image>
+
+ </view>
+ <!-- 音视频基本开关 -->
+ <view class="videoshow_control position">
+ <!-- 音频开关 -->
+ <view class="open" @click="audioSwitchFn" v-if="role == 1">
+ <image class="video_bg_img" src="../../static/au_in.png" mode="" v-if="audioSwitch == 'open'">
+ </image>
+ <image class="video_bg_img" src="../../static/au_on.png" mode="" v-else></image>
+ <text class="open_text">音频</text>
+ </view>
+
+ <!-- 挂断 -->
+ <view class="open" @click="phoneFn">
+ <image class="video_bg_img" src="../../static/over.png" mode=""></image>
+ <text class="open_text">挂断</text>
+
+ </view>
+
+ <!-- 视频开关 -->
+ <view class="open" @click="vedioSwitchFn" v-if="role == 1">
+ <image class="video_bg_img" src="../../static/vi_on.png" mode="" v-if="vedioSwitch == 'open'">
+ </image>
+ <image class="video_bg_img" src="../../static/vi_in.png" mode="" v-else></image>
+ <text class="open_text">视频</text>
+ </view>
+
+ <!-- <scroll-view scroll-y="true" style="height: 500px;padding: 20px;">
+ <view v-for="(item,value) in closeArray" :key='item+value'>{{item}}</view>
+ </scroll-view> -->
+ </view>
+ <!-- 提示文字 -->
+ <view class="video_bg video_bg_text" v-if="promptText">
+ <!-- <view class="video_bg video_bg_text"> -->
+ <text class="activetext">{{promptText}}</text>
+ <!-- </view> -->
+ </view>
+ </view>
+ <uni-popup ref="popup" type="center">
+ <uni-popup-message :type="popupType" :message="popupMessage" :duration="2000"></uni-popup-message>
+ </uni-popup>
+ </view>
+
+
+</template>
+
+<script>
+ const RtcModule = uni.requireNativePlugin('AR-RtcModule');
+ import uniPopup from '@/components/uni-popup/uni-popup.vue'
+ import uniPopupMessage from '@/components/uni-popup-message/uni-popup-message.vue'
+ import uniPopupDialog from '@/components/uni-popup-dialog/uni-popup-dialog.vue'
+ import permision from "@/js_sdk/wa-permission/permission.js"
+ export default {
+ components: {
+ uniPopup,
+ uniPopupMessage,
+ uniPopupDialog
+ },
+ data() {
+ return {
+ //anyRTC 为 App 开发者签发的 App ID。每个项目都应该有一个独一无二的 App ID。如果你的开发包里没有 App ID,请从anyRTC官网(https://www.anyrtc.io)申请一个新的 App ID
+ appid: "d5a164cd8e0a8352ee108c561ba2e44e",
+ channel: "",
+ uid: "",
+ role: 1, //角色 主播-游客
+
+ videoShow: false, //视频展示
+ // videoShowBg: true, //背景展示
+ promptText: "loading...",
+
+ PeerVideoUser: [{
+ a: 1
+ }, {
+ a: 2
+ }, {
+ a: 3
+ }], //用户视频加入存储
+ PeerVideoUserStyle: "video_local", //用户视频加入样式
+
+ // 本地
+ audioSwitch: "open", //音频开关
+ vedioSwitch: "open", //视频开关
+
+ videoWidth: 0,
+ videoHeight: 0,
+ //提示
+ popupType: "",
+ popupMessage: "",
+
+ isMain: false,
+ MainName: '222',
+ userName: '111'
+
+ // closeArray: []
+ }
+ },
+ // 页面初始加载(仅执行一次)
+ onReady() {
+ // 初始化
+ this.channel = 2554;
+ this.init();
+ },
+ onLoad(option) {
+ console.log(option.state);
+ if (option.state == "Mains") {
+ this.isMain = true;
+ setTimeout(res => {
+ this.join();
+ }, 2000)
+ } else if (option.state == "Receiver") {
+ this.isMain = false;
+ }
+ },
+
+ watch: {
+ PeerVideoUser: function(newName) {
+ if (this.role == 2) {
+ newName = newName.filter((x) => x !== this.uid);
+ }
+ // video_local
+ if (newName.length == 1) {
+ this.PeerVideoUserStyle = "video_local"
+ } else if (newName.length > 1 && newName.length < 5) {
+ this.PeerVideoUserStyle = "video_local_1"
+ } else if (newName.length > 4 && newName.length < 10) {
+ this.PeerVideoUserStyle = "video_local_2"
+ } else if (newName.length > 9 && newName.length < 17) {
+ this.PeerVideoUserStyle = "video_local_3"
+ } else if (newName.length == 0) {
+ this.role == 2 ? this.promptText = "暂无主播播放视频" : this.promptText = "loading..."
+ }
+ }
+ },
+ methods: {
+ // 初始化
+ async init() {
+ // 查看权限
+ if (uni.getSystemInfoSync().platform == 'ios') {
+ //查看相机权限
+ await this.requestAndroidPermission("camera", 'ios');
+ //查看录音权限
+ await this.requestAndroidPermission("record", 'ios');
+
+ } else if (uni.getSystemInfoSync().platform === 'android') {
+ //查看相机权限
+ await this.requestAndroidPermission("android.permission.CAMERA", 'android');
+ //查看录音权限
+ await this.requestAndroidPermission("android.permission.RECORD_AUDIO", 'android');
+ }
+ // 初始化 setCallBack
+ await this.callbackFn();
+ // 初始化 create
+
+ await RtcModule.create({
+ "appId": this.appid
+ }, (res) => {
+
+ });
+ this.uid = this.randomFn(6);
+ },
+ //设置角色
+ setClientRole(num) {
+ this.role = num;
+ //设置直播场景下的用户角色
+ RtcModule.setClientRole({
+ "role": num
+ }, (ret) => {});
+ },
+
+
+ //加入频道 跳转到视频
+ async join(val) {
+ var that = this;
+ // if (val == "Mains") { //视频发起人进入
+ console.log('视频发起人进入');
+ uni.showLoading({
+ title: '加载中',
+ mask: true
+ });
+ //加入房间
+ await RtcModule.joinChannel({
+ "token": "",
+ "channelId": this.channel,
+ "uid": this.uid
+ }, (res) => {
+ console.log(res, 'join break');
+ console.log('成功进入房间:' + that.channel);
+ })
+ // } else if (val == 'Receiver') { //视频接收人进入
+ // console.log('视频接收人进入');
+ // uni.showLoading({
+ // title: '加载中',
+ // mask: true
+ // });
+ // //加入房间
+ // await RtcModule.joinChannel({
+ // "token": "",
+ // "channelId": this.channel,
+ // "uid": this.uid
+ // }, (res) => {
+ // console.log(res, 'join break');
+ // console.log('成功进入房间:' + that.channel);
+ // })
+ // }
+
+ },
+ // 等待时候挂断
+ phoneFnMain() {
+ // RtcModule.leaveChannel((res) => {});
+ console.log("等待时候挂断");
+ uni.navigateBack();
+ },
+ //拒绝进入视频
+ comeBack() {
+ console.log("拒绝进入视频");
+ uni.navigateBack();
+ },
+
+ // 挂断 离开
+ phoneFn() {
+ //离开频道
+ RtcModule.leaveChannel((res) => {})
+ },
+
+ //添加本地视频到页面
+ setupLocalVideoFn() {
+ //视频
+ RtcModule.enableVideo((res) => {});
+ this.$refs[`popup${this.uid}`][0].setupLocalVideo({
+ "renderMode": 1,
+ "channelId": this.channel,
+ "uid": this.uid,
+ "mirrorMode": 0
+ }, (res) => {});
+ // 本地预览
+ RtcModule.startPreview((res) => {});
+ },
+
+ // 视频
+ vedioSwitchFn() {
+ let open = true;
+
+ if (this.vedioSwitch == "open") {
+ this.vedioSwitch = "colse";
+ open = false;
+ } else {
+ this.vedioSwitch = "open";
+ open = true;
+ }
+ RtcModule.enableLocalVideo({
+ "enabled": open
+ }, (res) => {
+ if (res.code == 0) {
+ open == false ? this.promptFn("warn", "关闭本地视频采集") : this.promptFn("info", "开启本地视频采集");
+ }
+ });
+ },
+ // 音频
+ audioSwitchFn() {
+ let open = true;
+ if (this.audioSwitch == "open") {
+ this.audioSwitch = "colse";
+ open = false;
+ } else {
+ this.audioSwitch = "open";
+ open = true;
+ }
+
+ RtcModule.enableLocalAudio({
+ "enabled": open
+ }, (res) => {
+ if (res.code == 0) {
+ open == false ? this.promptFn("warn", "关闭本地音频采集") : this.promptFn("info", "开启本地音频采集");
+ }
+ });
+ },
+ //转化摄像头
+ cameraSwitchFn() {
+ RtcModule.switchCamera((res) => {
+ res.code == 0 ? this.promptFn("success", "切换摄像头成功") : this.promptFn("error", "切换摄像头失败");
+ })
+ },
+
+ //callback 接收
+ callbackFn() {
+ RtcModule.setCallBack((res) => {
+ switch (res.engineEvent) {
+ case "onWarning":
+ this.promptFn("warn", res.warningCode);
+ break;
+ case "onError":
+ res.errorCode != 18 ? this.promptFn("error", res.errorCode) : '';
+ break;
+ case "onJoinChannelSuccess": //用户加入成功
+ uni.hideLoading();
+ this.role == 1 ? this.PeerVideoUser.push(res.uid) : "";
+ this.videoShow = true;
+ setTimeout(() => {
+ // this.videoShowBg = false;
+ this.promptText = ""
+ //扬声器
+ RtcModule.setEnableSpeakerphone({
+ "enabled": true
+ }, (res) => {})
+ setTimeout(() => {
+ // 启用视频模块。
+ this.role == 1 ? this.setupLocalVideoFn() : RtcModule
+ .enableVideo((res) => {});
+ }, 200)
+ }, 2000)
+ break;
+ case "onLeaveChannel": //离开频道回调
+ setTimeout(() => {
+ this.closeAll()
+ }, 500)
+ break;
+ case "onUserJoined": //远端用户加入当前频道回调。
+ // this.promptFn("info", "远端用户加入当前频道回调");
+ this.PeerVideoUser.push(res.uid);
+ break;
+ case "onUserOffline": //远端用户离开当前频道回调。
+ this.PeerVideoUser = this.PeerVideoUser.filter((x) => x !== res.uid);
+ break;
+
+ case "onFirstLocalAudioFrame": //已发送本地音频首帧的回调。(页面上添加音频)
+ break;
+ case "onFirstLocalVideoFrame": //已显示本地视频首帧的回调。(页面添加本地视频)
+ // this.promptFn("error", "已显示本地视频首帧的回调");
+ break;
+ case "onFirstRemoteVideoDecoded": //已完成远端视频首帧解码回调。(页面添加远端视频)
+ // this.promptFn("info", "已完成远端视频首帧解码回调");
+ this.promptText = "请稍等。。。"
+ let uid = []
+ uid.push(res.uid)
+ setTimeout(() => {
+ this.promptText = "";
+ // this.videoShowBg = false; //设置背景开关
+ setTimeout(() => {
+ uid.map(item => {
+ this.$refs[`popup${item}`][0].setupRemoteVideo({
+ "renderMode": 1,
+ "channelId": this.chanel,
+ "uid": item,
+ "mirrorMode": 0
+ }, (res) => {})
+ //预览
+ RtcModule.startPreview((res) => {});
+ })
+ }, 500)
+
+ }, 2000)
+ break;
+ }
+
+ })
+ },
+ //提示
+ promptFn(type, content) {
+ this.popupType = type;
+ this.popupMessage = content;
+ this.$refs.popup.open()
+ },
+ //支持自定义字符长度和特征字符集合
+ randomFn(len, charSet) {
+ charSet = charSet || 'abcdefghijklmnopqrstuvwxyz0123456789';
+ let randomString = '';
+ for (let i = 0; i < len; i++) {
+ let randomPoz = Math.floor(Math.random() * charSet.length);
+ randomString += charSet.substring(randomPoz, randomPoz + 1);
+ }
+ return randomString;
+ },
+ // 离开清空
+ async closeAll() {
+ // 销毁实例
+ await RtcModule.destroyRtc((res) => {});
+ this.videoShow = false; //视频展示
+ // this.videoShowBg = true; //背景展示
+ this.promptText = "loading...";
+
+ this.PeerVideoUser = []; //远端用户加入存储
+ // 本地
+ this.audioSwitch = "open"; //音频开关
+ this.vedioSwitch = "open"; //视频开关
+ // 重新创建实例
+ await this.init();
+ // 如果需要跳转其它页面请按下边步骤
+ // await uni.redirectTo({
+ // url: '..',
+ // success: () => {
+ // RtcModule.destroyRtc((res) => {
+ // console.log("页面销毁", res.code);
+ // });
+ // }
+ // });
+
+ },
+ //查看授权
+ async requestAndroidPermission(permisionID, type) {
+ let result = 0;
+ let strStatus = "";
+ type == 'ios' ? result = await permision.judgeIosPermission(permisionID) : result = await permision
+ .requestAndroidPermission(
+ permisionID);
+ if (result == 1) {
+ strStatus = "已获得授权"
+ } else if (result == 0) {
+ strStatus = "未获得授权"
+ } else {
+ strStatus = "被永久拒绝权限"
+ }
+ },
+
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ .content {
+ flex: 1;
+ }
+
+ /* 加入频道 */
+ .index {
+ flex: 1;
+ background-color: #0A1621;
+ height: 100vh;
+ }
+
+ /* 等待时候样式 Main */
+ .ccbut {
+ position: relative;
+ top: 45vh;
+ }
+
+ .Mains {
+ // position: absolute;
+ // width: 100%;
+ // height: 5rem;
+ width: 100%;
+ height: 100vh;
+ box-sizing: border-box;
+ // border: 1px solid #fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ // bottom: 0;
+ .title {
+ color: #fff;
+ }
+
+ .open {
+ // border: 1px solid #fff;
+ position: fixed;
+ bottom: 3rem;
+ width: 100%;
+ height: 4.3rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+
+ .video_bg_img {
+ width: 3rem;
+ height: 2rem;
+ }
+
+ .open_text {
+ padding: 5px 0 0;
+ text-align: center;
+ display: block;
+ // border: 1px solid #fff;
+ color: #fff;
+ }
+ }
+ }
+
+ .Receiver {
+ // position: absolute;
+ // width: 100%;
+ // height: 5rem;
+ width: 100%;
+ height: 100vh;
+ box-sizing: border-box;
+ // border: 1px solid #fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ // bottom: 0;
+ .title {
+ color: #fff;
+ }
+
+ .open {
+ // border: 1px solid #fff;
+ position: relative;
+ top: 12rem;
+ width: 100%;
+ height: 4.3rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+
+ .video_bg_img {
+ width: 3rem;
+ height: 2rem;
+ }
+
+ .open_text {
+ padding: 5px 0 0;
+ text-align: center;
+ display: block;
+ // border: 1px solid #fff;
+ color: #fff;
+ }
+ }
+ }
+
+ .chanel {
+ padding: 120px 20px 20px;
+ }
+
+ .uni-input {
+ height: 120rpx;
+ padding: 0 20px;
+ background-color: #2F3041;
+ border-radius: 6px;
+ }
+
+ .setrole {
+ padding: 60px 20px;
+ flex-direction: row;
+ justify-content: space-between;
+ }
+
+ .button {
+ padding: 10px 70rpx;
+ background-color: #2F3041;
+ border-radius: 6px;
+ border-width: 2px;
+ border-color: #2f3041;
+ }
+
+ .text {
+ color: #B4B5BE;
+ }
+
+
+
+ .activetext {
+ color: #fff;
+ }
+
+ .active {
+ padding: 10px 70rpx;
+ border-radius: 6px;
+ border-width: 2px;
+ border-color: #40a3fb;
+ background-color: #0A1621;
+ }
+
+ .join {
+ padding: 20px;
+ }
+
+ .jion_bg {
+ background-color: #40A3FB;
+ border-width: 0;
+ }
+
+
+ /* 视频 */
+ .vedioWatch {
+ flex: 1;
+ position: relative;
+ width: 100%;
+ height: 100vh;
+ background-color: #0A1621;
+
+
+ }
+
+ /* 初始背景 */
+ .video_bg {
+ flex: 1;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: transparent;
+ }
+
+ .video_bg_img {
+ flex: 1;
+ width: 100%;
+ }
+
+ .video_bg_text {
+ justify-content: center;
+ align-items: center;
+ }
+
+ /* 转换摄像头 */
+ .camera {
+ width: 44px;
+ height: 37px;
+ /* position: absolute; */
+ left: 20px;
+ top: 40px;
+ }
+
+ /* 视频区域 */
+ .video_region {
+ flex: 1;
+ /* position: absolute; */
+ flex-wrap: wrap;
+ flex-direction: row;
+ background-color: transparent;
+ }
+
+ /* 1个视频 */
+ .video_local {
+ width: 750rpx;
+ height: 1334rpx;
+ background-color: transparent;
+ }
+
+ .video_region_padding {
+ margin-top: 20px;
+ padding: 200rpx 0 260rpx;
+ width: 750rpx;
+ height: 840rpx;
+ }
+
+ /* 4个视频 */
+ .video_local_1 {
+ width: 375rpx;
+ height: 420rpx;
+ }
+
+ /* 9个视频 */
+ .video_local_2 {
+ width: 250rpx;
+ height: 280rpx;
+ }
+
+ /* 16个视频 */
+ .video_local_3 {
+ width: 187.5rpx;
+ height: 210rpx;
+ }
+
+ /* 音视频基本开关 */
+ .videoshow_control {
+ position: absolute;
+ bottom: 3rem;
+ left: 0;
+ width: 750rpx;
+ /* background-color: #007AFF; */
+ /* height: 250rpx; */
+ padding: 20px;
+ background-color: transparent;
+ color: #fff;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+
+ image {
+ width: 3rem;
+ }
+
+ .open {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ height: 4.3rem;
+ }
+ }
+
+ .camera {
+ image {
+ width: 2rem;
+ height: 2rem;
+ }
+ }
+
+ .open {
+ height: 205rpx;
+ width: 128rpx;
+ justify-content: center;
+ }
+
+ .open_text {
+ padding: 5px 0 0;
+ text-align: center;
+ color: #fff;
+ }
+
+ .position {
+ position: absolute;
+ }
+</style>
diff --git a/static/BG.png b/static/BG.png
new file mode 100644
index 0000000..7d539ec
--- /dev/null
+++ b/static/BG.png
Binary files differ
diff --git a/static/au_in.png b/static/au_in.png
new file mode 100644
index 0000000..bb7e437
--- /dev/null
+++ b/static/au_in.png
Binary files differ
diff --git a/static/au_on.png b/static/au_on.png
new file mode 100644
index 0000000..dd79d7d
--- /dev/null
+++ b/static/au_on.png
Binary files differ
diff --git a/static/camera.png b/static/camera.png
new file mode 100644
index 0000000..b3e5de9
--- /dev/null
+++ b/static/camera.png
Binary files differ
diff --git a/static/logo.png b/static/logo.png
new file mode 100644
index 0000000..b5771e2
--- /dev/null
+++ b/static/logo.png
Binary files differ
diff --git a/static/over.png b/static/over.png
new file mode 100644
index 0000000..6f7508a
--- /dev/null
+++ b/static/over.png
Binary files differ
diff --git a/static/phone.png b/static/phone.png
new file mode 100644
index 0000000..1345081
--- /dev/null
+++ b/static/phone.png
Binary files differ
diff --git a/static/vi_in.png b/static/vi_in.png
new file mode 100644
index 0000000..8d5d782
--- /dev/null
+++ b/static/vi_in.png
Binary files differ
diff --git a/static/vi_on.png b/static/vi_on.png
new file mode 100644
index 0000000..d3ff572
--- /dev/null
+++ b/static/vi_on.png
Binary files differ
--
Gitblit v1.9.3