fix:修改图标和其他
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?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>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>RongRTCLib.framework/RongRTCLib</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>RongRTCLib.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>RongRTCLib.framework/RongRTCLib</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>RongRTCLib.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// RCRTCAudioConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCAudioConfig : NSObject
|
||||
|
||||
/*!
|
||||
本地音频码率
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger bitrate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// RCRTCEffectManager.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/18.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCCodeDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音效代理方法
|
||||
*/
|
||||
@protocol RCRTCSoundEffectProtocol <NSObject>
|
||||
|
||||
/*!
|
||||
当前音效播放进度
|
||||
|
||||
@param progress 播放进度 range [0,1]
|
||||
@discussion
|
||||
当前播放进度
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportEffectPlayingProgress:(float)progress effectId:(NSUInteger)effectId;
|
||||
|
||||
/*!
|
||||
音效播放结束,如果循环播放多次,多次循环后调用
|
||||
|
||||
@discussion
|
||||
播放结束,如果循环播放多次,多次循环后调用
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didEffectFinished:(NSUInteger)effectId;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCAudioEffectManager : NSObject
|
||||
|
||||
/*!
|
||||
delegate
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCSoundEffectProtocol> delegate;
|
||||
|
||||
/*!
|
||||
开启或关闭耳返
|
||||
@param enabled YES 开启,NO 关闭,默认为 NO
|
||||
*/
|
||||
- (void)enableInEarMonitoring:(BOOL)enabled;
|
||||
|
||||
/*!
|
||||
设置耳返音量
|
||||
@param volume [0,100]
|
||||
*/
|
||||
- (void)setInEarMonitoringVolume:(NSUInteger)volume;
|
||||
|
||||
/*!
|
||||
播放指定音效文件,filePath 必须可用,需要指定唯一的 ID,如果调用`preloadEffect`接口设置过 ID,此 ID 要与其相同
|
||||
如果前后传入相同的 ID,但是 filePath 不同,会覆盖,播放最新的 filePath 音效
|
||||
@param soundId 音效的唯一 ID
|
||||
@param filePath 音效的路径
|
||||
@param loopCount 音效的循环次数
|
||||
@param publish 是否将音效推送到远端,设置为 YES,其他端可听到此音效声音,如果设置为 NO,只有本端可以听到
|
||||
*/
|
||||
- (RCRTCCode)playEffect:(NSInteger)soundId
|
||||
filePath:(NSString *)filePath
|
||||
loopCount:(int)loopCount
|
||||
publish:(BOOL)publish;
|
||||
|
||||
/*!
|
||||
播放指定音效文件,filePath 必须可用,需要指定唯一的 ID,如果调用`preloadEffect`接口设置过 ID,此 ID 要与其相同
|
||||
如果前后传入相同的 ID,但是 filePath 不同,会覆盖,播放最新的 filePath 音效
|
||||
@param soundId 音效的唯一 ID
|
||||
@param filePath 音效的路径
|
||||
@param loopCount 音效的循环次数
|
||||
@param volume 音效音量 [0,100]
|
||||
@param publish 是否将音效推送到远端,设置为 YES,其他端可听到此音效声音,如果设置为 NO,只有本端可以听到
|
||||
*/
|
||||
- (RCRTCCode)playEffect:(NSInteger)soundId
|
||||
filePath:(NSString *_Nullable)filePath
|
||||
loopCount:(NSUInteger)loopCount
|
||||
volume:(NSUInteger)volume
|
||||
publish:(BOOL)publish;
|
||||
|
||||
/*!
|
||||
停止指定的音效
|
||||
@param soundId 音效唯一 ID
|
||||
*/
|
||||
- (RCRTCCode)stopEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
停止所有的音效
|
||||
*/
|
||||
- (RCRTCCode)stopAllEffects;
|
||||
|
||||
/*!
|
||||
暂停指定的音效文件
|
||||
@param soundId 指定的音效 ID
|
||||
*/
|
||||
- (RCRTCCode)pauseEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
暂停所有的音效
|
||||
*/
|
||||
- (RCRTCCode)pauseAllEffects;
|
||||
|
||||
/*!
|
||||
恢复播放指定的音效
|
||||
@param soundId 指定的音效 ID
|
||||
*/
|
||||
- (RCRTCCode)resumeEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
恢复播放所有的音效
|
||||
*/
|
||||
- (RCRTCCode)resumeAllEffects;
|
||||
|
||||
/*!
|
||||
预加载指定的音效文件,filePath 必须可用
|
||||
@param soundId 指定的音效 ID
|
||||
@param filePath 音效路径
|
||||
*/
|
||||
- (RCRTCCode)preloadEffect:(NSInteger)soundId filePath:(NSString *)filePath;
|
||||
|
||||
/*!
|
||||
取消加载的音效文件
|
||||
@param soundId 指定的音效 ID
|
||||
*/
|
||||
- (RCRTCCode)unloadEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
设置全局的音效的音量
|
||||
@param volume 音量 [0,100],默认为 100.
|
||||
*/
|
||||
- (RCRTCCode)setEffectsVolume:(NSUInteger)volume;
|
||||
|
||||
/*!
|
||||
设置指定音效的音效音量
|
||||
@param soundId 指定的音效 ID
|
||||
@param volume 音量 [0,100],默认为 100
|
||||
*/
|
||||
- (RCRTCCode)setVolumeOfEffect:(NSInteger)soundId withVolume:(NSUInteger)volume;
|
||||
|
||||
/*!
|
||||
获取指定音效的音量
|
||||
*/
|
||||
- (NSUInteger)getVolumeOfEffectId:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
获取全局音效的音量
|
||||
*/
|
||||
- (NSUInteger)getEffectsVolume;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// RCRTCAudioInputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/6/1.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCInputStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
接收到的的音频流
|
||||
*/
|
||||
@interface RCRTCAudioInputStream : RCRTCInputStream
|
||||
|
||||
/*!
|
||||
远端音频数据回调
|
||||
added from 5.1.6
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioFrameCallback audioDataCallback;
|
||||
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,382 @@
|
||||
//
|
||||
// RCRTCAudioMixer.h
|
||||
// RTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/5/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreAudio/CoreAudioTypes.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCGlobals.h"
|
||||
|
||||
/*!
|
||||
无限期循环
|
||||
*/
|
||||
RONGRTCLIB_EXTERN const UInt32 RCRTCLoopsIndefinitely;
|
||||
|
||||
/*!
|
||||
混音引擎状态
|
||||
deprecated from 5.1.3
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RTCMixEngineStatus) {
|
||||
/*!
|
||||
正常
|
||||
*/
|
||||
RTCMixEngineStatusNormal,
|
||||
/*!
|
||||
准备中
|
||||
*/
|
||||
RTCMixEngineStatusPrepare,
|
||||
/*!
|
||||
播放中(或混音中)
|
||||
*/
|
||||
RTCMixEngineStatusPlaying,
|
||||
/*!
|
||||
暂停中
|
||||
*/
|
||||
RTCMixEngineStatusPause,
|
||||
/*!
|
||||
停止
|
||||
*/
|
||||
RTCMixEngineStatusStop
|
||||
};
|
||||
|
||||
/*!
|
||||
播放(或混音)状态
|
||||
added from 5.1.3
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioMixingState) {
|
||||
/*!
|
||||
播放中(或混音中)
|
||||
*/
|
||||
RCRTCMixingStatePlaying,
|
||||
/*!
|
||||
暂停中
|
||||
*/
|
||||
RCRTCMixingStatePause,
|
||||
/*!
|
||||
停止
|
||||
*/
|
||||
RCRTCMixingStateStop,
|
||||
/*!
|
||||
播放失败
|
||||
*/
|
||||
RCRTCMixingStateFailed
|
||||
};
|
||||
|
||||
/*!
|
||||
播放(或混音)状态改变的原因
|
||||
added from 5.1.3
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioMixingReason) {
|
||||
/*!
|
||||
成功调用 startMixingWithURL:playback:mixerMode:loopCount:;
|
||||
*/
|
||||
RCRTCMixingReasonStartedByUser,
|
||||
/*!
|
||||
混音文件加载完成
|
||||
*/
|
||||
RCRTCMixingReasonFileLoaded,
|
||||
/*!
|
||||
混音文件完成一次循环播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonOneLoopCompleted,
|
||||
/*!
|
||||
混音文件开始新的一次循环播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonStartNewLoop,
|
||||
/*!
|
||||
混音文件完成所有循环播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonAllLoopsCompleted,
|
||||
/*!
|
||||
成功调用 stop 停止播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonStoppedByUser,
|
||||
/*!
|
||||
成功调用 pause 停止播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonPausedByUser,
|
||||
/*!
|
||||
成功调用 resume 停止播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonResumedByUser,
|
||||
/*!
|
||||
混音文件加载失败(文件不存在或者文件格式不支持等原因导致加载失败)
|
||||
*/
|
||||
RCRTCMixingReasonCanNotOpen,
|
||||
};
|
||||
|
||||
/*!
|
||||
混音模式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCMixerMode) {
|
||||
/*!
|
||||
对端只能听见麦克风采集的声音
|
||||
*/
|
||||
RCRTCMixerModeNone,
|
||||
/*!
|
||||
对端能够听到麦克风采集的声音和音频文件的声音
|
||||
*/
|
||||
RCRTCMixerModeMixing,
|
||||
/*!
|
||||
对端只能听到音频文件的声音
|
||||
*/
|
||||
RCRTCMixerModeReplace
|
||||
};
|
||||
|
||||
/**
|
||||
本地音频左右声道混音
|
||||
@discussion Add from 5.1.13
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCAudioDualMonoMode) {
|
||||
/*!
|
||||
当前音频立体声混音
|
||||
*/
|
||||
RCRTCAudioDualMonoStereo = 0,
|
||||
/*!
|
||||
当前音频左声道混音
|
||||
*/
|
||||
RCRTCAudioDualMonoLeft = 1,
|
||||
/*!
|
||||
当前音频右声道混音
|
||||
*/
|
||||
RCRTCAudioDualMonoRight = 2
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
AudioMixer 的播放代理
|
||||
*/
|
||||
@protocol RCRTCAudioMixerAudioPlayDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
当前播放进度
|
||||
|
||||
@param progress 播放进度 range [0,1]
|
||||
@discussion
|
||||
当前播放进度
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportPlayingProgress:(float)progress;
|
||||
|
||||
/*!
|
||||
混音状态
|
||||
|
||||
@param mixingState 混音状态
|
||||
@param mixingReason 混音状态改变的原因
|
||||
@discussion
|
||||
当前混音状态
|
||||
Add from 5.1.3
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didAudioMixingStateChanged:(RCRTCAudioMixingState)mixingState reason:(RCRTCAudioMixingReason)mixingReason;
|
||||
|
||||
@optional
|
||||
/*!
|
||||
播放结束,如果循环播放多次,多次循环后调用
|
||||
|
||||
@discussion
|
||||
播放结束,如果循环播放多次,多次循环后调用
|
||||
@deprecated from 5.1.3
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didPlayToEnd DEPRECATED_MSG_ATTRIBUTE("use didAudioMixingStateChanged:reason: instead");
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
混音引擎
|
||||
*/
|
||||
@interface RCRTCAudioMixer : NSObject
|
||||
|
||||
/*!
|
||||
获取混音引擎单例
|
||||
*/
|
||||
+ (RCRTCAudioMixer *)sharedInstance;
|
||||
|
||||
/*!
|
||||
AudioMixer 的代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCAudioMixerAudioPlayDelegate> delegate;
|
||||
|
||||
/*!
|
||||
音频文件混音时的输入音量, 取值范围 [0,100], 默认值 100
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger mixingVolume;
|
||||
|
||||
/*!
|
||||
音频文件本地播放音量, 取值范围 [0,100], 默认值 100
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger playingVolume;
|
||||
|
||||
/*!
|
||||
混音文件的播放音调相对原始音调的偏移值,取值范围 [-12,12],默认值 0,其中 0 表示原始音调,1 表示升高一个半音,-1 降低一个半音,以此类推。
|
||||
暂不支持处理在线音频
|
||||
*/
|
||||
@property (nonatomic, assign) double pitch;
|
||||
|
||||
/*!
|
||||
混音文件的播放速度,取值范围 [50,400],默认值 100,其中 100 表示原始速度,50 表示 0.5 倍速,400 表示 4 倍速,以此类推。
|
||||
暂不支持处理在线音频
|
||||
*/
|
||||
@property (nonatomic, assign) double playbackSpeed;
|
||||
|
||||
/*!
|
||||
当前混音状态
|
||||
*/
|
||||
@property (nonatomic, assign, readonly)
|
||||
RTCMixEngineStatus status DEPRECATED_MSG_ATTRIBUTE("use didAudioMixingStateChanged:reason: instead");
|
||||
|
||||
/*!
|
||||
方法 writeAudioBufferList:frames:sampleTime:playback: 写入 AudioBufferList 的格式
|
||||
*/
|
||||
@property (nonatomic, readonly, class) AudioStreamBasicDescription writeAsbd;
|
||||
|
||||
/*!
|
||||
当前混音文件时长
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSTimeInterval duration;
|
||||
|
||||
/*!
|
||||
获取指定音频文件的时长
|
||||
|
||||
@param url 音频文件的 File URL
|
||||
@discussion
|
||||
获取指定音频文件的时长,只支持本地音频文件
|
||||
|
||||
@remarks 音频配置
|
||||
@return 音频文件的时长
|
||||
*/
|
||||
+ (Float64)durationOfAudioFile:(NSURL *)url;
|
||||
|
||||
/*!
|
||||
设置播放进度
|
||||
@param progress 设置播放进度 取值范围 [0,1]
|
||||
@discussion
|
||||
设置播放进度
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setPlayProgress:(float)progress;
|
||||
|
||||
/*!
|
||||
设置混音文件的播放音调
|
||||
@param pitch 相对原始音调的偏移值,默认值为 0,取值范围 [-12,12],其中 0 表示原始音调,1 表示升高一个半音,-1 降低一个半音,以此类推。
|
||||
@discussion
|
||||
设置混音文件的播放音调,暂不支持处理在线音频
|
||||
Added from 5.2.0
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setPitch:(double)pitch;
|
||||
|
||||
/*!
|
||||
设置混音文件的播放速度
|
||||
@param playbackSpeed 播放速度,默认值为 100,取值范围 [50,400],其中 100 表示原始速度,50 表示 0.5 倍速,400 表示 4 倍速,以此类推。
|
||||
@discussion
|
||||
设置混音文件的播放速度,暂不支持处理在线音频
|
||||
Added from 5.2.0
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setPlaybackSpeed:(double)playbackSpeed;
|
||||
|
||||
/*!
|
||||
开始混音, 开始新混音之前需要先调用 stop 结束混音, 重复调用会忽略操作
|
||||
@param fileURL 资源 URL
|
||||
@param isPlay 是否播放
|
||||
@param mode 混音行为模式
|
||||
@param count 循环混音或者播放次数
|
||||
|
||||
@discussion
|
||||
混音功能
|
||||
|
||||
@remarks 音频配置
|
||||
@return 开始是否成功
|
||||
*/
|
||||
- (BOOL)startMixingWithURL:(NSURL *)fileURL
|
||||
playback:(BOOL)isPlay
|
||||
mixerMode:(RCRTCMixerMode)mode
|
||||
loopCount:(NSUInteger)count;
|
||||
|
||||
/*!
|
||||
设置混音声道模式
|
||||
@param mode 声道模式 0 立体声混音, 1 左声道混音, 2 右声道混音
|
||||
@discussion
|
||||
只针对本地文件资源产生效果, 不支持网络资源的 url
|
||||
Add from 5.1.13
|
||||
|
||||
@remarks 音频配置
|
||||
@return 设置是否成功
|
||||
*/
|
||||
- (BOOL)setAudioDualMonoMode:(RCRTCAudioDualMonoMode)mode;
|
||||
|
||||
/*!
|
||||
写入自定义音频数据
|
||||
@param abl 音频数据,格式为 PCM
|
||||
@param frames 音频帧个数
|
||||
@param sampleTime 音频帧时间戳
|
||||
@param isPlay 是否在本地播放
|
||||
|
||||
@discussion
|
||||
写入自定义音频数据
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
- (void)writeAudioBufferList:(const AudioBufferList *)abl
|
||||
frames:(UInt32)frames
|
||||
sampleTime:(SInt64)sampleTime
|
||||
playback:(BOOL)isPlay;
|
||||
|
||||
/*!
|
||||
写入自定义音频数据
|
||||
@param abl 音频数据,格式为 PCM
|
||||
@param frames 音频帧个数
|
||||
@param sampleTime 音频帧时间戳
|
||||
@param asbd 音频格式描述
|
||||
@param isPlay 是否在本地播放
|
||||
|
||||
@discussion
|
||||
写入自定义音频数据
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
- (void)writeAudioBufferList:(const AudioBufferList *)abl
|
||||
frames:(UInt32)frames
|
||||
sampleTime:(SInt64)sampleTime
|
||||
asbd:(AudioStreamBasicDescription)asbd
|
||||
playback:(BOOL)isPlay;
|
||||
|
||||
/*!
|
||||
暂停
|
||||
|
||||
@remarks 音频配置
|
||||
@return 暂停是否成功
|
||||
*/
|
||||
- (BOOL)pause;
|
||||
|
||||
/*!
|
||||
恢复
|
||||
|
||||
@remarks 音频配置
|
||||
@return 恢复是否成功
|
||||
*/
|
||||
- (BOOL)resume;
|
||||
|
||||
/*!
|
||||
结束
|
||||
|
||||
@remarks 音频配置
|
||||
@return 结束是否成功
|
||||
*/
|
||||
- (BOOL)stop;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// RCRTCAudioOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/6/2.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCOutputStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCAudioOutputStream : RCRTCOutputStream
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// RCBaseRoom.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/3.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <RongIMLibCore/RongIMLibCore.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCRoomConfig;
|
||||
@class RCRTCRemoteUser;
|
||||
|
||||
@interface RCRTCBaseRoom : NSObject
|
||||
|
||||
/*!
|
||||
房间ID
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *roomId;
|
||||
|
||||
/*!
|
||||
加入房间时设置的房间配置
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCRoomConfig *roomConfig;
|
||||
|
||||
/*!
|
||||
会话 id, 用于 server API,会话唯一标识
|
||||
*/
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *sessionId;
|
||||
|
||||
/*!
|
||||
参与用户
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) NSArray<RCRTCRemoteUser *> *remoteUsers;
|
||||
|
||||
/*!
|
||||
获取指定远端用户
|
||||
|
||||
@param userId 用户 ID
|
||||
@discussion
|
||||
根据用户 ID 获取房间内远端用户,不存在则返回 nil
|
||||
*/
|
||||
- (nullable RCRTCRemoteUser *)getRemoteUser:(NSString *)userId;
|
||||
|
||||
/*!
|
||||
发送消息
|
||||
|
||||
@param content 消息的内容
|
||||
@param successBlock 消息发送成功的回调 [messageId:消息的ID]
|
||||
@param errorBlock 消息发送失败的回调 [nErrorCode:发送失败的错误码,messageId:消息的ID]
|
||||
@discussion
|
||||
该接口只能发送 persistentFlag 为 MessagePersistent_STATUS 的状态消息, 远端用户如果不在线则消息丢失, 自定义消息时下面标识一定要给出, 否则会导致消息发送失败
|
||||
+ (RCMessagePersistent)persistentFlag {
|
||||
return MessagePersistent_STATUS;
|
||||
}
|
||||
|
||||
@remarks 房间管理
|
||||
@return 发送的消息实体
|
||||
*/
|
||||
- (nullable RCMessage *)sendMessage:(RCMessageContent *)content
|
||||
success:(nullable void (^)(long messageId))successBlock
|
||||
error:(nullable void (^)(NSInteger nErrorCode, long messageId))errorBlock;
|
||||
|
||||
/*!
|
||||
设置房间属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setRoomAttributeValue:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use setAttribute:forKey:message:completion: API instead");
|
||||
|
||||
/*!
|
||||
设置房间属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setAttribute:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
删除房间属性
|
||||
|
||||
@param attributeKeys 属性名称数组
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 删除完成回调
|
||||
@discussion
|
||||
删除房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)deleteRoomAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use deleteAttributes:message:completion: API instead");
|
||||
|
||||
/*!
|
||||
删除房间属性
|
||||
|
||||
@param attributeKeys 属性名称数组
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 删除完成回调
|
||||
@discussion
|
||||
删除房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)deleteAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
获取房间属性
|
||||
|
||||
@param attributeKeys 属性名称
|
||||
@param completion 获取结果回调
|
||||
@discussion
|
||||
获取房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)getRoomAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
completion:(nullable RCRTCAttributeOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use getAttributes:completion: API instead");
|
||||
|
||||
/*!
|
||||
获取房间属性
|
||||
|
||||
@param attributeKeys 属性名称
|
||||
@param completion 获取结果回调
|
||||
@discussion
|
||||
获取房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)getAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
completion:(nullable RCRTCAttributeOperationCallback)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// RCRTCBaseStat.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/12/27.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCBaseStat : NSObject
|
||||
|
||||
/*!
|
||||
媒体类型
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *mediaType;
|
||||
|
||||
/*!
|
||||
媒体流类型
|
||||
*/
|
||||
@property (nonatomic, readonly) RCRTCMediaStreamType mediaStreamType;
|
||||
|
||||
/*!
|
||||
音量大小, 0 - 9表示音量高低
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger audioLevel;
|
||||
|
||||
/*!
|
||||
码率
|
||||
*/
|
||||
@property (nonatomic, readonly) float bitRate;
|
||||
|
||||
/*!
|
||||
丢包率
|
||||
*/
|
||||
@property (nonatomic, readonly) float packetLoss;
|
||||
|
||||
/*!
|
||||
视频帧宽度
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger frameWidth;
|
||||
|
||||
/*!
|
||||
视频帧高度
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger frameHeight;
|
||||
|
||||
/*!
|
||||
往返时间
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger rtt;
|
||||
|
||||
/*!
|
||||
帧率
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger frameRate;
|
||||
|
||||
/*!
|
||||
抖动
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger jitterReceived;
|
||||
|
||||
/*!
|
||||
编码名称
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *codecName;
|
||||
|
||||
/*!
|
||||
渲染延时
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger renderDelayMs;
|
||||
|
||||
/*!
|
||||
编解码器名称
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *codecImplementationName;
|
||||
|
||||
/*!
|
||||
nacks 数量
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger googNacksReceived;
|
||||
|
||||
/*!
|
||||
统计格式化字符串
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *formString;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// RCRTCCDNStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/5/18.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCInputStream.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCDrawer.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void (^RCRTCConfigCallback)(BOOL isSuccess, RCRTCCode code);
|
||||
|
||||
@class RCRTCCDNInputStream;
|
||||
|
||||
@protocol RCRTCCDNInputStreamDelegate <NSObject>
|
||||
/*!
|
||||
SEI 数据监听回调
|
||||
|
||||
@param cdnStream 当前 cdn 流对象
|
||||
@param data SEI 数据
|
||||
@discussion
|
||||
订阅 cdn 流成功后,通过 receiver 回调 cdn 流中包含 SEI 信息
|
||||
回调的频次取决于 cdn 流的 SEI 帧数据间隔
|
||||
*/
|
||||
- (void)cdnStream:(RCRTCCDNInputStream *)cdnStream handleSEIData:(NSString *)data;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCCDNInputStream : RCRTCInputStream
|
||||
|
||||
/*!
|
||||
设置 cdn 流监听代理
|
||||
*/
|
||||
@property (nonatomic, weak) id<RCRTCCDNInputStreamDelegate> delegate;
|
||||
|
||||
/*!
|
||||
获取订阅 CDN 流前设置的分辨率
|
||||
*/
|
||||
- (RCRTCVideoSizePreset)getVideoResolution;
|
||||
|
||||
/*!
|
||||
获取订阅 CDN 流前设置的帧率
|
||||
*/
|
||||
- (RCRTCVideoFPS)getVideoFps;
|
||||
|
||||
/*!
|
||||
当前订阅成功的 CDN 流最高支持的分辨率
|
||||
*/
|
||||
- (RCRTCVideoSizePreset)getHighestResolution;
|
||||
|
||||
/*!
|
||||
当前订阅成功的 CDN 流最高支持的帧率
|
||||
*/
|
||||
- (RCRTCVideoFPS)getHighestFPS;
|
||||
|
||||
/*!
|
||||
设置分辨率和帧率
|
||||
@param videoSizePreset 分辨率
|
||||
@param fps 帧率
|
||||
*/
|
||||
- (void)setVideoConfig:(RCRTCVideoSizePreset)videoSizePreset
|
||||
fpsValue:(RCRTCVideoFPS)fps
|
||||
completion:(nullable RCRTCConfigCallback)completion;
|
||||
|
||||
/*!
|
||||
设置视频流的渲染视图
|
||||
|
||||
@param render 渲染视图
|
||||
@discussion
|
||||
接受到远端用户的视频流,然后设置视频流的渲染视图,就可以渲染出远端视频
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoView:(nullable id<RCRTCDrawer>)render;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,290 @@
|
||||
//
|
||||
// RCRTCCameraOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/8.
|
||||
// Copyright © 2019年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreMedia/CoreMedia.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCVideoView.h"
|
||||
#import "RCRTCVideoOutputStream.h"
|
||||
#import "RCRTCVideoStreamConfig.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
摄像头输出流,以摄像头为视频源的视频输出流
|
||||
*/
|
||||
@interface RCRTCCameraOutputStream : RCRTCVideoOutputStream
|
||||
|
||||
/*!
|
||||
当前开启摄像头位置
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCDeviceCamera cameraPosition;
|
||||
|
||||
/*!
|
||||
摄像头采集角度
|
||||
默认以 AVCaptureVideoOrientationPortrait 角度进行采集
|
||||
*/
|
||||
@property (nonatomic, assign) AVCaptureVideoOrientation videoOrientation;
|
||||
|
||||
/*!
|
||||
本地摄像头采集是否镜像
|
||||
|
||||
前置摄像头默认: YES,后置摄像头默认: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isCaptureMirror;
|
||||
|
||||
/*!
|
||||
本地摄像头采集是否镜像
|
||||
|
||||
前置摄像头默认: YES,后置摄像头默认: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isPreviewMirror DEPRECATED_MSG_ATTRIBUTE("use RCRTCCameraOutputStream.h isCaptureMirror instead");;
|
||||
|
||||
/*!
|
||||
本地摄像头发送数据是否镜像
|
||||
|
||||
默认: NO, 不镜像
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEncoderMirror;
|
||||
|
||||
/*!
|
||||
是否启用视频小流
|
||||
|
||||
摄像头视频流,默认开启。自定义视频流,默认关闭
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableTinyStream;
|
||||
|
||||
@property (atomic, copy, nullable) RCRTCVideoCMSampleBufferCallback videoDisplayBufferCallback DEPRECATED_MSG_ATTRIBUTE("please use RCRTCVideoOutputStream.h outputVideoStream:willRenderVideoFrame: instead");
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultVideoStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCCameraOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultVideoStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCCameraOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
写入视频流数据
|
||||
|
||||
@param sample 媒体数据
|
||||
@param error 失败时返回的相关描述
|
||||
@discussion
|
||||
写入视频流数据
|
||||
|
||||
@warning
|
||||
请勿调用,摄像头输出流内部已经实现摄像头数据采集,调用者无需自己写入视频流数据
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)write:(CMSampleBufferRef)sample error:(NSError **)error NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
设置视频源
|
||||
|
||||
@param videoSource 视频源
|
||||
@discussion
|
||||
请勿调用,摄像头输出流的视频源已经封装在 SDK 内,调用者无需设置视频源,如果要自定义视频流,请使用 RCRTCVideoOutputStream
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setVideoSource:(id<RCRTCVideoSourceInterface>)videoSource NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
设置视频流的渲染视图
|
||||
|
||||
@param view 渲染视图
|
||||
@discussion
|
||||
设置本地摄像头采集的视频流渲染视图
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoView:(nullable id<RCRTCDrawer>)view;
|
||||
|
||||
/*!
|
||||
设置视频数的渲染纹理视图
|
||||
|
||||
@param view 渲染纹理视图
|
||||
@discussion
|
||||
设置本地摄像头采集的视频流渲染纹理视图
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoTextureView:(nullable RCRTCVideoTextureView *)view;
|
||||
|
||||
/*!
|
||||
开启摄像头数据采集
|
||||
|
||||
@discussion
|
||||
开启摄像头采集数据
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)startCapture;
|
||||
|
||||
/*!
|
||||
停止摄像头数据采集
|
||||
|
||||
@discussion
|
||||
关闭摄像头采集数据
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)stopCapture;
|
||||
|
||||
/*!
|
||||
切换前后摄像头
|
||||
|
||||
@discussion
|
||||
切换前后摄像头
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)switchCamera;
|
||||
|
||||
/*!
|
||||
摄像头是否支持区域对焦
|
||||
|
||||
@discussion
|
||||
摄像头是否支持手动对焦功能
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraFocusSupported;
|
||||
|
||||
/*!
|
||||
设置预览视图中的对焦点
|
||||
|
||||
@param point 对焦点,(x,y)是在预览视图中归一化的坐标,即对焦点相对预览视图的位置与预览视图宽高的比值,取值范围为[0, 1],左上角是(0, 0)
|
||||
|
||||
@discussion
|
||||
改变对焦位置
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)setCameraFocusPositionInPreview:(CGPoint)point;
|
||||
|
||||
/*!
|
||||
摄像头是否支持区域测光
|
||||
|
||||
@discussion
|
||||
摄像头是否支持手动曝光功能
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraExposurePositionSupported;
|
||||
|
||||
/*!
|
||||
设置预览视图中的曝光点
|
||||
|
||||
@param point 曝光点,(x,y)是在预览视图中归一化的坐标,即曝光点相对预览视图的位置与预览视图宽高的比值,取值范围为[0, 1],左上角是(0, 0)
|
||||
|
||||
@discussion
|
||||
改变对焦位置
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)setCameraExposurePositionInPreview:(CGPoint)point;
|
||||
|
||||
/*!
|
||||
摄像头是否支持闪光灯
|
||||
|
||||
@discussion
|
||||
摄像头是否支持闪光灯
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraTorchSupported;
|
||||
|
||||
/*!
|
||||
设置是否打开摄像头闪光灯
|
||||
|
||||
@param enable YES 为打开,NO 为关闭摄像头闪光灯
|
||||
@discussion
|
||||
设置是否打开摄像头闪光灯
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)enableCameraTorch:(BOOL)enable;
|
||||
|
||||
/*!
|
||||
摄像头是否支持缩放
|
||||
|
||||
@discussion
|
||||
摄像头是否支持缩放
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraZoomSupported;
|
||||
|
||||
/*!
|
||||
设置摄像头缩放比例
|
||||
|
||||
@param zoomFactor 摄像头缩放比例,有效范围从 1.0 到最大缩放
|
||||
@discussion
|
||||
设置摄像头缩放比例
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)setCameraZoomFactor:(float)zoomFactor;
|
||||
|
||||
/*!
|
||||
获取摄像头最大缩放比例
|
||||
|
||||
@discussion
|
||||
获取摄像头最大缩放比例
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (float)getCameraMaxZoomFactor;
|
||||
|
||||
/*!
|
||||
设置小流视频配置
|
||||
|
||||
@param config 视频配置
|
||||
@discussion
|
||||
设置小流视频配置
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (BOOL)setTinyVideoConfig:(RCRTCVideoStreamConfig *)config;
|
||||
|
||||
/*!
|
||||
获取小流视频配置
|
||||
|
||||
@discussion
|
||||
获取小流视频配置
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (nullable RCRTCVideoStreamConfig *)getTinyVideoConfig;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,263 @@
|
||||
//
|
||||
// RongRTCError.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/12.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/*!
|
||||
音视频错误码定义
|
||||
|
||||
服务器返回错误以 4 开头,后两位是业务代码,最后两位是错误码 4XXXX,如 400XX 基础连接部分
|
||||
本地返回错误以 5 开头,后两位是业务代码,最后两位是错误码 5XXXX,如 500XX 初始化基础连接部分
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCCode) {
|
||||
/*!
|
||||
成功
|
||||
*/
|
||||
RCRTCCodeSuccess = 0,
|
||||
/*!
|
||||
初始化失败, 信令服务(IM Server)未连接
|
||||
*/
|
||||
RCRTCCodeSignalServerNotConnect = 50000,
|
||||
/*!
|
||||
参数错误
|
||||
*/
|
||||
RCRTCCodeParameterError = 50001,
|
||||
/*!
|
||||
加入相同房间错误,表示用户在客户端重复加入相同的房间
|
||||
*/
|
||||
RCRTCCodeJoinToSameRoom = 50002,
|
||||
/*!
|
||||
不在房间中
|
||||
*/
|
||||
RCRTCCodeNotInRTCRoom = 50003,
|
||||
/*!
|
||||
请检查是否开通音视频服务
|
||||
*/
|
||||
RCRTCCodeVoIPNotAvailable = 50004,
|
||||
/*!
|
||||
RTC token为空,请查看是否还在房间内或者房间是否销毁
|
||||
*/
|
||||
RCRTCCodeRTCTokenIsNull = 50006,
|
||||
/*!
|
||||
SDK 内部状态错误
|
||||
*/
|
||||
RCRTCCodeIllegalState = 50007,
|
||||
/*!
|
||||
观众加聊天室成功,kv 回调超时(30s)
|
||||
*/
|
||||
RCRTCCodeChatRoomKVTimeout = 50008,
|
||||
/*!
|
||||
HTTP 请求超时
|
||||
*/
|
||||
RCRTCCodeHttpTimeoutError = 50010,
|
||||
/*!
|
||||
HTTP 错误(含 500,404,405 等错误)
|
||||
*/
|
||||
RCRTCCodeHttpError = 50011,
|
||||
/*!
|
||||
发布重复资源
|
||||
*/
|
||||
RCRTCCodePublishDuplicateResources = 50020,
|
||||
/*!
|
||||
设置本地 SDP 错误
|
||||
*/
|
||||
RCRTCCodeSetLocalSDPError = 50021,
|
||||
/*!
|
||||
设置远端 SDP 错误
|
||||
*/
|
||||
RCRTCCodeSetRemoteSDPError = 50022,
|
||||
/*!
|
||||
发布的流的个数已经到达上限
|
||||
*/
|
||||
RCRTCCodePublishStreamsHasReachedMaxCount = 50023,
|
||||
/*!
|
||||
取消发布不存在的资源
|
||||
*/
|
||||
RCRTCCodeUnpublishUnexistStream = 50024,
|
||||
/*!
|
||||
创建本地 Offer 失败
|
||||
*/
|
||||
RCRTCCodeCreateOfferError = 50025,
|
||||
/*!
|
||||
创建本地 Answer 失败
|
||||
*/
|
||||
RCRTCCodeCreateAnswerError = 50026,
|
||||
/*!
|
||||
公有云 SDK 不能访问私有云服务
|
||||
*/
|
||||
RCRTCCodeIncompatibleWithPrivateServer = 50027,
|
||||
/*!
|
||||
无法使用设置的代理服务转发资源
|
||||
*/
|
||||
RCRTCCodeProxyUnavailableError = 50028,
|
||||
/*!
|
||||
订阅不存在的音视频资源
|
||||
*/
|
||||
RCRTCCodeSubscribeNotExistResources = 50030,
|
||||
/*!
|
||||
资源重复订阅
|
||||
*/
|
||||
RCRTCCodeSubscribeDuplicateResources = 50031,
|
||||
/*!
|
||||
取消订阅不存在的音视频资源
|
||||
*/
|
||||
RCRTCCodeUnsubscribeNotExistResouce = 50032,
|
||||
/*!
|
||||
当前房间不存在这个 liveUrl
|
||||
*/
|
||||
RCRTCCodeLiveUrlNotInCurrentRoom = 50033,
|
||||
/*!
|
||||
请检查当前是否开通了语音识别服务
|
||||
*/
|
||||
RCRTCCodeASRNotAvailable= 50034,
|
||||
/*!
|
||||
请检查当前是否开启了语音识别服务
|
||||
*/
|
||||
RCRTCCodeASRNotStart = 50035,
|
||||
/*!
|
||||
RTCConnection 为空
|
||||
*/
|
||||
RCRTCCodeRTCConnectionIsNil = 50065,
|
||||
/*!
|
||||
解析 Json 串出错
|
||||
*/
|
||||
RCRTCCodeParseJsonDataError = 50069,
|
||||
/*!
|
||||
未加入主房间
|
||||
*/
|
||||
RCRTCCodeNotJoinedMainRoom = 50074,
|
||||
/*!
|
||||
操作的副房间号码和主房间号码一致错误
|
||||
*/
|
||||
RCRTCCodeOtherRoomIDSameWithMainRoomId = 50075,
|
||||
/*!
|
||||
取消的跨房间连麦请求不存在
|
||||
*/
|
||||
RCRTCCodeCancelInviteNotExist = 50076,
|
||||
/*!
|
||||
响应的跨房间连麦请求不存在
|
||||
*/
|
||||
RCRTCCodeRespondInviteNotExist = 50077,
|
||||
/*!
|
||||
发布时mediaServer返回的mcu流为空
|
||||
*/
|
||||
RCRTCCodeMCUListNotExist = 50079,
|
||||
/*!
|
||||
cdn 地址配置数量到达上限(最大为5个)
|
||||
*/
|
||||
RCRTCCodeCDNCountReachToLimit = 50080,
|
||||
/*!
|
||||
帧时间戳非法
|
||||
*/
|
||||
RCRTCCodeIllegalFrameTimestamp = 50081,
|
||||
/*!
|
||||
解码视频帧失败
|
||||
*/
|
||||
RCRTCCodeDecodeVideoFrameError = 50082,
|
||||
/*!
|
||||
音效文件数量已经到达最大数量
|
||||
*/
|
||||
RCRTCCodeEffectFileCountHasBeenReached = 50090,
|
||||
/*!
|
||||
处理非法的 soundId,如停止播放没有播放过的音效文件 id,
|
||||
此音效 ID 没有预设或者播放过。
|
||||
*/
|
||||
RCRTCCodeHandlingIllegalEffectSoundId = 50091,
|
||||
/*!
|
||||
自动重连异常
|
||||
*/
|
||||
RCRTCCodeReconnectError = 50100,
|
||||
/*!
|
||||
观众加聊天室成功,pullData KV没有值
|
||||
*/
|
||||
RCRTCCodeChatRoomKVNotExist = 50101,
|
||||
/*!
|
||||
音频设备启动失败
|
||||
*/
|
||||
RCRTCCodeAudioDeviceStartError = 52000,
|
||||
/*!
|
||||
订阅流时,cdn流订阅失败
|
||||
*/
|
||||
RCRTCCodeSubscribeCDNError = 52001,
|
||||
/*!
|
||||
没有集成player SDK
|
||||
*/
|
||||
RCRTCCodePlayerModuleNotFound = 54001,
|
||||
/*!
|
||||
CDN内部错误
|
||||
*/
|
||||
RCRTCCodeCDNInnerError = 54003,
|
||||
/*!
|
||||
数据连接中断 或 音视频源格式不支持
|
||||
*/
|
||||
RCRTCCodeCdnInfoVideoInterrupt = 54008,
|
||||
/*!
|
||||
订阅 CDN 流时,初始化 player 模块异常
|
||||
*/
|
||||
RCRTCCodePlayerInitError = 54009,
|
||||
/*!
|
||||
* Add from 5.1.9
|
||||
* 切换角色时房间类型错误,必须为直播房间
|
||||
*/
|
||||
RCRTCCodeSwitchRoleRoomTypeError = 55001,
|
||||
/*!
|
||||
* Add from 5.1.9
|
||||
* 切换的角色和当前角色相同错误
|
||||
*/
|
||||
RCRTCCodeSwitchRoleSameRoleError = 55002,
|
||||
/*!
|
||||
* Add from 5.1.17
|
||||
* RTC 网络探测未开始
|
||||
*/
|
||||
RCRTCCodeProbeTestNotStart = 56001,
|
||||
/*!
|
||||
* Add from 5.1.17
|
||||
* RTC 网络探测已开始
|
||||
*/
|
||||
RCRTCCodeProbeTestExist = 56002,
|
||||
/*!
|
||||
* Add from 5.1.17
|
||||
* RTC 通道连接断开
|
||||
*/
|
||||
RCRTCCodeMediaServerIceDisConnect = 56003,
|
||||
/*!
|
||||
* RTC 网络探测被中断
|
||||
*/
|
||||
RCRTCCodeProbeTestForceStop = 56004,
|
||||
/*!
|
||||
加房间操作打断探测
|
||||
*/
|
||||
RCRTCCodeInterruptByInternal = 56005,
|
||||
/*!
|
||||
SEI 数据长度超出限制 4096 个字节
|
||||
*/
|
||||
RCRTCCodeSEILengthReachToLimit = 56006,
|
||||
/*!
|
||||
SEI 通道未建立,请检查是否开启 SEI,或者发布音视频
|
||||
*/
|
||||
RCRTCCodeSEIChannelNotExist = 56007,
|
||||
/*!
|
||||
SEI 发送失败
|
||||
*/
|
||||
RCRTCCodeSEISendUnknownError = 56008,
|
||||
/*!
|
||||
SEI 频率超出限制, 1秒内不超过 30 次
|
||||
*/
|
||||
RCRTCCodeSEISendTimePerSecondReachToLimit = 56009,
|
||||
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCCodeDefine : NSObject
|
||||
|
||||
+ (NSString *)codeDesc:(NSInteger)code;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// RCRTCConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/12.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCProxy.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCConfig : NSObject
|
||||
|
||||
/*!
|
||||
默认 YES:断网后一直保持重连; NO:如果音视频房间在超时时间(超时时间管理后台可以配置,默认值 60s)内没有连上网络,SDK 会自动退出音视频房间,这个时间是一个粗略值,不保证精确,有 5s 左右的误差
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEnableAutoReconnect;
|
||||
|
||||
/*!
|
||||
设置房间统计信息的回调间隔
|
||||
单位毫秒, 默认1000ms(1s)。 注意 interval 值太小会影响 SDK 性能,如果小于 100 配置无法生效
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger statusReportInterval;
|
||||
|
||||
/*!
|
||||
默认 NO:是否开启媒体流加密功能(SRTP)
|
||||
特别注意:开启该功能会对性能和用户体验有一定影响,如果没有该需求请不要打开。
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableSRTP;
|
||||
|
||||
/*!
|
||||
默认 YES:是否可以和其它后台 App 进行混音
|
||||
特别注意:如果该属性设置为 NO,切换到其它 App 操作麦克风或者扬声器时,会导致自己 App 麦克风采集和播放被打断。
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableMixWithOthers;
|
||||
|
||||
/*!
|
||||
默认 NO:使用BaseLine进行视频编码; YES:使用HighProfile进行视频编码
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableHardwareEncoderHighProfile;
|
||||
|
||||
/*!
|
||||
默认 YES:Debug模式下检测IMSDK和RTCSDK版本号是否一致
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableVersionMismatch;
|
||||
|
||||
/*!
|
||||
默认 YES:是否支持立体声
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableStereo;
|
||||
|
||||
/*!
|
||||
设置代理服务地址
|
||||
默认: 无
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCProxy *proxy;
|
||||
|
||||
/*!
|
||||
默认 YES:观众是否支持 PlayAndRecord 模式,该设置只对观众身份生效
|
||||
YES:AudioSession Category 为 AVAudioSessionCategoryPlayAndRecord,可以进行听筒/扬声器切换;
|
||||
NO:AudioSession Category 为 AVAudioSessionCategoryPlayback。
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enablePlayAndRecord;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,101 @@
|
||||
//
|
||||
// RCRTCCryptoDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/7/28.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
自定义加密代理
|
||||
*/
|
||||
@protocol RCRTCCustomizedEncryptorDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
加密回调
|
||||
|
||||
@param payloadData 需要加密的数据起始地址
|
||||
@param payloadSize 需要加密的数据的大小
|
||||
@param encryptedFrame 加密后数据起始地址
|
||||
@param bytesWritten 加密后数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义加密需要实现该方法进行加密操作。
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (int)EncryptPayloadData:(const uint8_t *)payloadData
|
||||
payloadSize:(size_t)payloadSize
|
||||
encryptedFrame:(uint8_t *)encryptedFrame
|
||||
bytesWritten:(size_t *)bytesWritten
|
||||
mediastreamId:(NSString *)mediastreamId
|
||||
mediaType:(int)mediatype;
|
||||
|
||||
/*!
|
||||
加密后数据大小
|
||||
|
||||
@param frameSize 加密前数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义加密需要根据自己的加密算法返回加密后数据的大小,SDK 会根据返回加密后数据的大小进行内存申请
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (size_t)GetMaxCiphertextByteSize:(size_t)frameSize mediastreamId:(NSString *)mediastreamId mediaType:(int)mediatype;
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
自定义解密代理
|
||||
*/
|
||||
@protocol RCRTCCustomizedDecryptorDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
解密回调
|
||||
|
||||
@param encryptedFrame 需要解密的数据起始地址
|
||||
@param encryptedFrameSize 需要解密的数据的大小
|
||||
@param frame 解密后数据起始地址
|
||||
@param bytesWritten 解密后数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义解密需要实现该方法进行解密操作。
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (int)DecryptFrame:(const uint8_t *)encryptedFrame
|
||||
frameSize:(size_t)encryptedFrameSize
|
||||
frame:(uint8_t *)frame
|
||||
bytesWritten:(size_t *)bytesWritten
|
||||
mediastreamId:(NSString *)mediastreamId
|
||||
mediaType:(int)mediatype;
|
||||
|
||||
/*!
|
||||
解密后数据大小
|
||||
|
||||
@param frameSize 解密前数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义解密需要根据自己的解密算法返回解密后数据的大小,SDK 会根据返回解密后数据的大小进行内存申请
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (size_t)GetMaxPlaintextByteSize:(size_t)frameSize mediastreamId:(NSString *)mediastreamId mediaType:(int)mediatype;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// RCRTCCustomLayout.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCStream;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCCustomLayout : NSObject
|
||||
|
||||
/*!
|
||||
要混合布局的流,必须为视频流
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) RCRTCStream *videoStream;
|
||||
|
||||
/*!
|
||||
混流图层坐标的 y 值
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger y;
|
||||
|
||||
/*!
|
||||
混流图层坐标的 x 值
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger x;
|
||||
|
||||
/*!
|
||||
视频流的宽
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger width;
|
||||
|
||||
/*!
|
||||
视频流的高
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger height;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// RCRTCCustomMixAudio.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCStream;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCCustomMixAudio : NSObject
|
||||
|
||||
/*!
|
||||
要进行混音的流,必须为音频流
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) RCRTCStream *audioStream;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// RCRTCDrawer.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/11/24.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreGraphics/CoreGraphics.h>
|
||||
|
||||
@class RCRTCVideoFrame;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCRTCDrawer <NSObject>
|
||||
|
||||
/*!
|
||||
接收视频数据尺寸
|
||||
*/
|
||||
- (void)setSize:(CGSize)size;
|
||||
|
||||
/*!
|
||||
接收视频帧数据
|
||||
*/
|
||||
- (void)renderFrame:(nullable RCRTCVideoFrame *)frame;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,499 @@
|
||||
//
|
||||
// RCRTCEngine.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/2.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCAudioEffectManager.h"
|
||||
#import "RCRTCCodeDefine.h"
|
||||
#import "RCRTCConfig.h"
|
||||
#import "RCRTCCryptoDelegate.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCRoomConfig.h"
|
||||
#import "RCRTCJoinedRoomInfo.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCRoom;
|
||||
@class RCRTCOtherRoom;
|
||||
@class RCRTCVideoPreviewView;
|
||||
@class RCRTCVideoStreamConfig;
|
||||
@class RCRTCOutputStream;
|
||||
@class RCRTCMicOutputStream;
|
||||
@class RCRTCCameraOutputStream;
|
||||
@class RCRTCFileVideoOutputStream;
|
||||
@class RCRTCScreenShareOutputStream;
|
||||
@protocol RCRTCStatusReportDelegate;
|
||||
@protocol RCRTCEngineEventDelegate;
|
||||
@protocol RCRTCProbeTestDelegate;
|
||||
|
||||
/*!
|
||||
音视频引擎类
|
||||
*/
|
||||
@interface RCRTCEngine : NSObject
|
||||
|
||||
/*!
|
||||
音视频引擎单例
|
||||
|
||||
@remarks RCRTCEngine
|
||||
*/
|
||||
+ (RCRTCEngine *)sharedInstance;
|
||||
|
||||
/*!
|
||||
请使用 sharedInstance 初始化方法
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
请使用 sharedInstance 初始化方法
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
音视频引擎参数设置
|
||||
|
||||
@param config Engine 配置
|
||||
@return 错误码,参考 RCRTCCode
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
- (int)initWithConfig:(RCRTCConfig *)config;
|
||||
|
||||
/*!
|
||||
音视频引擎销毁资源, 会有主动离开房间操作
|
||||
|
||||
@remarks RCRTCEngine
|
||||
*/
|
||||
- (void)unInit;
|
||||
|
||||
/*!
|
||||
音效管理器,管理播放、暂停等
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) RCRTCAudioEffectManager *audioEffectManager;
|
||||
|
||||
/*!
|
||||
全局音视频配置信息
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCConfig *config;
|
||||
|
||||
/*!
|
||||
当前已加入的房间,已废弃
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCRoom *currentRoom DEPRECATED_MSG_ATTRIBUTE("use room property instead");
|
||||
|
||||
/*!
|
||||
当前已加入的房间
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCRoom *room;
|
||||
|
||||
/*!
|
||||
本地默认音频流
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) RCRTCMicOutputStream *defaultAudioStream;
|
||||
|
||||
/*!
|
||||
本地默认视频流
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) RCRTCCameraOutputStream *defaultVideoStream;
|
||||
|
||||
/*!
|
||||
房间状态报告监听
|
||||
|
||||
@remarks RCRTCEngine:统计接口
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCStatusReportDelegate> statusReportDelegate;
|
||||
|
||||
/*!
|
||||
Engine 代理
|
||||
|
||||
@remarks RCRTCEngine:Engine 通知接口
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCEngineEventDelegate> delegate;
|
||||
|
||||
/*!
|
||||
整体播放音量,范围:0~100,默认值:100
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger playingVolume;
|
||||
|
||||
/*!
|
||||
所有远端流音量,范围:0~200,默认值:100
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger remotePlaybackVolume;
|
||||
|
||||
#pragma mark - 设备检测
|
||||
/*!
|
||||
设备检测
|
||||
@param interval 麦克风录制统计时间[2 10] 单位 s,大于10秒默认为10s 小于2秒按2秒计算
|
||||
|
||||
@remarks RCRTCEngine:设备检测开启接口
|
||||
added from 5.1.9
|
||||
*/
|
||||
- (void)startEchoTest:(NSTimeInterval)interval;
|
||||
|
||||
/*!
|
||||
设备检测
|
||||
|
||||
@remarks RCRTCEngine:设备检测关闭接口
|
||||
added from 5.1.9
|
||||
*/
|
||||
- (void)stopEchoTest;
|
||||
|
||||
#pragma mark - 创建自定义文件视频流
|
||||
/*!
|
||||
创建自定义文件视频流
|
||||
|
||||
@param path 文件路径
|
||||
@param replace 文件中音频是否替换麦克风数据,YES 替换麦克风数据,NO 与麦克风数据混音
|
||||
@param playback 文件中的音频是否在本端播放
|
||||
@param tag 自定义视频文件流标识
|
||||
@param config 自定视频文件流的配置信息
|
||||
|
||||
@return 自定义视频文件流
|
||||
|
||||
@discussion Added from 5.1.9
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
- (nullable RCRTCFileVideoOutputStream *)createFileVideoOutputStream:(NSString *)path
|
||||
replaceAudio:(BOOL)replace
|
||||
playback:(BOOL)playback
|
||||
tag:(NSString *)tag
|
||||
config:(RCRTCVideoStreamConfig *)config;
|
||||
|
||||
#pragma mark - 获取屏幕共享流
|
||||
/*!
|
||||
获取屏幕共享所需流
|
||||
|
||||
@param groupId groupId 苹果开发者账号后台申请
|
||||
|
||||
@remarks RCRTCEngine:RCRTCScreenShareOutputStream get 接口
|
||||
added from 5.1.8
|
||||
*/
|
||||
- (RCRTCScreenShareOutputStream *)getScreenShareVideoStreamWithGroupId:(NSString *)groupId;
|
||||
|
||||
#pragma mark - 设置媒体服务器地址
|
||||
/*!
|
||||
设置媒体服务器地址
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
|
||||
@param url 媒体服务器地址
|
||||
设置媒体服务器地址,特别注意如果设置了会覆盖导航下载下来的 media server url
|
||||
@return 设置是否成功
|
||||
*/
|
||||
- (BOOL)setMediaServerUrl:(NSString *)url;
|
||||
|
||||
#pragma mark - 听筒/扬声器切换
|
||||
/*!
|
||||
启用扬声器
|
||||
|
||||
@param useSpeaker YES 启用扬声器;NO 关闭扬声器
|
||||
@discussion
|
||||
暂态设置启用或关闭扬声器
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
@return 调用成功返回 YES
|
||||
*/
|
||||
- (BOOL)useSpeaker:(BOOL)useSpeaker DEPRECATED_MSG_ATTRIBUTE("use enableSpeaker: API instead");
|
||||
|
||||
/*!
|
||||
启用扬声器
|
||||
|
||||
@param enable 默认值为 YES;YES 启用扬声器;NO 关闭扬声器
|
||||
@discussion
|
||||
暂态设置启用或关闭扬声器,任何用户行为或者音频相关 API 的调用都有可能改变暂态设置
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
@return 调用成功返回 YES
|
||||
*/
|
||||
- (BOOL)enableSpeaker:(BOOL)enable;
|
||||
|
||||
/*!
|
||||
设置默认音频路由
|
||||
|
||||
@param defaultToSpeaker 默认为 NO,不使用扬声器作为默认音频路由;YES 使用扬声器作为默认音频路由
|
||||
@discussion
|
||||
设置默认的音频路由,就是在没有外接设备的前提下,设置系统使用听筒还是扬声器播放音频。
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
@return 调用成功返回 YES
|
||||
*/
|
||||
- (BOOL)setDefaultAudioRouteToSpeaker:(BOOL)defaultToSpeaker;
|
||||
|
||||
#pragma mark - 自定义加密
|
||||
/*!
|
||||
设置音频输出流自定义加密回调
|
||||
|
||||
@param audioEncryptorDelegate 加密代理,接口传入 RCRTCCustomizedEncryptorDelegate 的非空实现对象表示开启自定义加密;
|
||||
如果传入 nil 代表关闭自定义加密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有发送音频进行加密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
*/
|
||||
- (void)setAudioCustomizedEncryptorDelegate:(nullable id<RCRTCCustomizedEncryptorDelegate>)audioEncryptorDelegate;
|
||||
|
||||
/*!
|
||||
设置音频输入流自定义解密回调
|
||||
|
||||
@param audioDecryptorDelegate 加密代理,接口传入 RCRTCDecryptorDelegate 的非空实现对象表示开启自定义解密;
|
||||
如果传入 nil 代表关闭自定义解密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有接收音频进行解密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
|
||||
*/
|
||||
- (void)setAudioCustomizedDecryptorDelegate:(nullable id<RCRTCCustomizedDecryptorDelegate>)audioDecryptorDelegate;
|
||||
|
||||
/*!
|
||||
设置视频输出流自定义加密回调
|
||||
|
||||
@param videoEncryptorDelegate 加密代理,接口传入 RCRTCCustomizedEncryptorDelegate 的非空实现对象表示开启自定义加密;
|
||||
如果传入 nil 代表关闭自定义加密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有发送视频进行加密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
|
||||
*/
|
||||
- (void)setVideoCustomizedEncryptorDelegate:(nullable id<RCRTCCustomizedEncryptorDelegate>)videoEncryptorDelegate;
|
||||
|
||||
/*!
|
||||
设置视频输入流自定义解密回调
|
||||
|
||||
@param videoDecryptorDelegate 加密代理,接口传入 RCRTCDecryptorDelegate 的非空实现对象表示开启自定义解密;
|
||||
如果传入 nil 代表关闭自定义解密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有接收视频进行解密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
*/
|
||||
- (void)setVideoCustomizedDecryptorDelegate:(nullable id<RCRTCCustomizedDecryptorDelegate>)videoDecryptorDelegate;
|
||||
|
||||
#pragma mark - 加入房间
|
||||
/*!
|
||||
加入房间
|
||||
|
||||
@param roomId 房间 Id, 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式 最长 64 个字符
|
||||
@param completion 加入房间回调,其中, room 对象中的 remoteUsers, 存储当前房间中的所有人, 包括发布资源和没有发布资源的人
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)joinRoom:(NSString *)roomId
|
||||
completion:(nullable void (^)(RCRTCRoom *_Nullable room, RCRTCCode code))completion;
|
||||
|
||||
/*!
|
||||
加入指定类型房间
|
||||
|
||||
@param roomId 房间 Id, 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式 最长 64 个字符
|
||||
@param config 加入房间的配置, 主要用于配置直播场景。
|
||||
@param completion 加入房间回调, 其中 room 对象中的 remoteUsers, 存储当前房间中的所有人, 包括发布资源和没有发布资源的人
|
||||
@discussion
|
||||
加入房间
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)joinRoom:(NSString *)roomId
|
||||
config:(RCRTCRoomConfig *)config
|
||||
completion:(nullable void (^)(RCRTCRoom *_Nullable room, RCRTCCode code))completion;
|
||||
|
||||
#pragma mark - 离开房间
|
||||
/*!
|
||||
离开房间,已废弃
|
||||
|
||||
@param roomId 房间 Id
|
||||
@param completion 离开房间回调
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveRoom:(NSString *)roomId
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use leaveRoom: API instead");
|
||||
|
||||
/*!
|
||||
离开房间
|
||||
|
||||
@param completion 离开房间回调
|
||||
@discussion
|
||||
离开房间时不需要调用取消资源发布, SDK 内部会做好取消发布资源逻辑
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveRoom:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 加入副房间
|
||||
/*!
|
||||
连麦邀请后加入副房间
|
||||
|
||||
@param roomId 副房间 Id, 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式 最长 64 个字符
|
||||
@param completion 加入副房间回调
|
||||
@discussion
|
||||
此方法仅供连麦加入副房间使用
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)joinOtherRoom:(NSString *)roomId
|
||||
completion:(nullable void (^)(RCRTCOtherRoom *_Nullable room, RCRTCCode code))completion;
|
||||
|
||||
#pragma mark - 离开副房间
|
||||
/*!
|
||||
离开副房间
|
||||
|
||||
@param roomId 副房间 Id
|
||||
@param isNotify 是否通知所有连麦用户结束, YES:通知 NO:不通知;
|
||||
如果想在退出副房间的同时结束 PK,请调用 RCRTCLocalUser.h 的 quitRoomPK 接口。
|
||||
@param completion 离开房间回调
|
||||
@discussion
|
||||
此方法仅供连麦离开副房间使用
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveOtherRoom:(NSString *)roomId
|
||||
notifyFinished:(BOOL)isNotify
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use leaveOtherRoom:completion: API instead");
|
||||
|
||||
/*!
|
||||
离开副房间
|
||||
|
||||
@param roomId 副房间 Id
|
||||
@param completion 离开房间回调
|
||||
@discussion
|
||||
此方法仅供连麦离开副房间使用
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveOtherRoom:(NSString *)roomId
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 观众订阅,取消订阅
|
||||
/*!
|
||||
观众订阅主播资源,已废弃
|
||||
|
||||
@param url 主播直播的 url
|
||||
@param streamType 需要具体订阅的媒体类型
|
||||
@param completion 动作的回调, 会依次回调主播的 RCRTCInputStream, 根据 streamType 区分是音频流还是视频流, 如主播发布了音视频流, 此回调会回调两次, 分别为音频的 RCRTCInputStream, 和视频的 RCRTCInputStream 。
|
||||
@discussion
|
||||
仅直播模式可用, 作为观众, 直接观看主播的直播, 无需加入房间, 通过传入主播的 url, 仅观众端可用,此接口可具体订阅音频流或视频流或大小流
|
||||
|
||||
@deprecated from 5.1.0
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
- (void)subscribeLiveStream:(NSString *)url
|
||||
streamType:(RCRTCAVStreamType)streamType
|
||||
completion:(nullable RCRTCLiveCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCLocalUser.h subscribeStream:tinyStreams:completion: API instead");
|
||||
|
||||
/*!
|
||||
观众取消订阅主播资源,已废弃
|
||||
|
||||
@param url 主播直播的 url
|
||||
@param completion 动作的回调
|
||||
@discussion
|
||||
仅直播模式可用, 作为观众, 退出观看主播的直播, 仅观众端使用
|
||||
|
||||
@deprecated from 5.1.0
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
- (void)unsubscribeLiveStream:(NSString *)url
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCLocalUser.h unsubscribeStreams:completion: API instead");
|
||||
|
||||
/*!
|
||||
查询当前用户已经加入的房间
|
||||
|
||||
@discussion
|
||||
查询当前用户已经加入的房间
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)queryRTCRoomJoinedInfo:(nullable void(^)(BOOL isSuccess, RCRTCCode code, NSArray <RCRTCJoinedRoomInfo *> * _Nullable infoArray))completion;
|
||||
|
||||
/*!
|
||||
加房间前探测回调
|
||||
|
||||
@discussion Add from 5.1.17
|
||||
|
||||
@remarks RCRTCEngine:统计接口
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCProbeTestDelegate> probeTestDelegate;
|
||||
|
||||
/*!
|
||||
加房间前探测
|
||||
|
||||
@param callback 开始探测操作的回调
|
||||
@discussion
|
||||
与当前的 media server 建立连接,可以从 RCRTCProbeTestDelegate 拿到探测的上下行报表数据,探测持续 30s 自动结束。
|
||||
Add from 5.1.17
|
||||
|
||||
@remarks RCRTCEngine:探测接口
|
||||
*/
|
||||
- (void)startRTCProbeTest:(nullable RCRTCOperationCallback)callback;
|
||||
|
||||
/*!
|
||||
主动结束探测
|
||||
|
||||
@param callback 开始探测操作的回调
|
||||
@discussion
|
||||
探测自动结束前,可以手动调用该接口停止探测。
|
||||
Add from 5.1.17
|
||||
|
||||
@remarks RCRTCEngine:探测接口
|
||||
*/
|
||||
- (void)stopRTCProbeTest:(nullable RCRTCOperationCallback)callback;
|
||||
|
||||
|
||||
#pragma mark - SDK 版本号
|
||||
/*!
|
||||
获取 SDK 版本号,已废弃
|
||||
|
||||
@return 版本号
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
- (NSString *)getRTCLibVersion DEPRECATED_MSG_ATTRIBUTE("use getVersion API instead");
|
||||
|
||||
/*!
|
||||
获取 SDK 版本号
|
||||
|
||||
@return 版本号
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
+ (NSString *)getVersion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// RCRTCEngineDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/2.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
@class RCRTCBaseRoom;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音视频引擎代理
|
||||
*/
|
||||
@protocol RCRTCEngineEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/*!
|
||||
音频路由改变回调
|
||||
|
||||
@remarks RCRTCEngineEventDelegate
|
||||
|
||||
*/
|
||||
- (void)didAudioRouteChanged:(RCRTCAudioRouteType)audioRouteType;
|
||||
|
||||
/*!
|
||||
屏幕共享拓展 结束消息回调
|
||||
|
||||
@remarks RCRTCEngineEventDelegate
|
||||
Added from 5.1.8
|
||||
*/
|
||||
- (void)screenShareExtentionFinished;
|
||||
|
||||
/*!
|
||||
屏幕共享拓展 开始消息回调
|
||||
|
||||
@remarks RCRTCEngineEventDelegate
|
||||
@discussion
|
||||
需要先获取屏幕共享所需流 RCRTCEngine:RCRTCScreenShareOutputStream get 接口
|
||||
Added from 5.2.0
|
||||
*/
|
||||
- (void)screenShareExtentionStarted;
|
||||
|
||||
/*!
|
||||
被 SDK 踢出房间通知
|
||||
|
||||
@param roomId 离开的房间
|
||||
@param reason 被踢出房间原因
|
||||
@discussion
|
||||
如果用户在房间内, 此时由于某种原因被踢离开房间, SDK 会关闭音视频连接, 释放资源, 将用户踢出房间, 回调通知用户,
|
||||
如果用户不在房间内,roomId 为 nil,只释放资源,回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKicked:(nullable NSString *)roomId
|
||||
reason:(RCRTCKickedReason)reason;
|
||||
|
||||
/*!
|
||||
被 SDK 踢出房间通知
|
||||
|
||||
@param roomId 离开的房间
|
||||
@param reason 被踢出房间原因
|
||||
@param extra Server API 自定义数据
|
||||
@discussion
|
||||
如果用户在房间内, 此时由于某种原因被踢离开房间, SDK 会关闭音视频连接, 释放资源, 将用户踢出房间, 回调通知用户,
|
||||
如果用户不在房间内,roomId 为 nil,只释放资源,回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKicked:(nullable NSString *)roomId
|
||||
reason:(RCRTCKickedReason)reason
|
||||
extra:(nullable NSDictionary *)extra;
|
||||
|
||||
- (void)didKicked:(nullable NSString *)roomId
|
||||
Reason:(RCRTCKickedReason)reason DEPRECATED_MSG_ATTRIBUTE("use didKicked:reason: instead");
|
||||
/*!
|
||||
发生错误回调
|
||||
该回调方法表示 SDK 运行时出现了(网络或媒体相关的)错误。通常情况下,SDK 上报的错误意味着 SDK 无法自动恢复,需要 App 干预或提示用户。
|
||||
详细的错误代码,见 RCRTCCode。
|
||||
|
||||
@param errorCode 具体返回数据参考 RCRTCCode 说明
|
||||
*/
|
||||
- (void)didOccurError:(RCRTCCode)errorCode;
|
||||
|
||||
/*!
|
||||
如果用户在房间内, RTC连接状态变化通知
|
||||
|
||||
@param state 连接状态
|
||||
@discussion
|
||||
如果用户在房间内, RTC连接状态变化通知
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didRTCConnectionStateChanged:(RCRTCConnectionState)state;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// RCRTCFileVideoOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/8/30.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RongRTCLib/RongRTCLib.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCRTCFileVideoOutputStreamDelegate;
|
||||
|
||||
/*!
|
||||
自定义文件流
|
||||
|
||||
@discussion Added from 5.1.9
|
||||
*/
|
||||
@interface RCRTCFileVideoOutputStream : RCRTCVideoOutputStream
|
||||
/*!
|
||||
文件路径
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *filePath;
|
||||
|
||||
/*!
|
||||
文件中音频是否替换麦克风数据,YES 替换麦克风数据,NO 与麦克风数据混音
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL replace;
|
||||
|
||||
/*!
|
||||
文件中的音频是否在本端播放
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL playback;
|
||||
|
||||
/*!
|
||||
文件视频流代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCFileVideoOutputStreamDelegate> delegate;
|
||||
|
||||
/*!
|
||||
音频数据回调
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioFrameCallback audioDataCallback;
|
||||
|
||||
/*!
|
||||
停止
|
||||
|
||||
@return 是否调用成功
|
||||
|
||||
@discussion 调用此方法会停止解码文件视频流并释放文件资源
|
||||
*/
|
||||
- (BOOL)stop;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@return 失败
|
||||
|
||||
@warning
|
||||
请勿调用,仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance] 的
|
||||
createFileVideoOutputStream:replaceAudio:playback:tag:config: 方法获取实例。
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@return 失败
|
||||
|
||||
@warning
|
||||
请勿调用,仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance] 的
|
||||
createFileVideoOutputStream:replaceAudio:playback:tag:config: 方法获取实例。
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@return 失败
|
||||
|
||||
@warning
|
||||
请勿调用,仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance] 的
|
||||
createFileVideoOutputStream:replaceAudio:playback:tag:config: 方法获取实例。
|
||||
*/
|
||||
- (instancetype)initVideoOutputStreamWithTag:(NSString *)tag NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
@protocol RCRTCFileVideoOutputStreamDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
开始解码文件视频流
|
||||
*/
|
||||
- (void)fileVideoOutputStreamDidStartRead:(RCRTCFileVideoOutputStream *)stream;
|
||||
|
||||
/*!
|
||||
完成解码文件视频流
|
||||
*/
|
||||
- (void)fileVideoOutputStreamDidReadCompleted:(RCRTCFileVideoOutputStream *)stream;
|
||||
|
||||
/*!
|
||||
解码文件视频流失败
|
||||
*/
|
||||
- (void)fileVideoOutputStreamDidFailed:(RCRTCFileVideoOutputStream *)stream;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// RCRTCGlobals.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/4/3.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef RongRTCGlobals_h
|
||||
#define RongRTCGlobals_h
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define RONGRTCLIB_EXTERN extern "C"
|
||||
#else
|
||||
#define RONGRTCLIB_EXTERN extern
|
||||
#endif
|
||||
|
||||
typedef void(^RCRTCVoidBlock)(void);
|
||||
|
||||
#endif /* RongRTCGlobals_h */
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// RongRTCInputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreVideo/CoreVideo.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCVideoView;
|
||||
@class RCRTCVideoTextureView;
|
||||
@class RCRTCInputStream;
|
||||
|
||||
/*!
|
||||
接收到的音视频流
|
||||
*/
|
||||
@interface RCRTCInputStream : RCRTCStream
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// RCRTCJoinedRoomInfo.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/8/13.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
已经加入房间信息
|
||||
*/
|
||||
@interface RCRTCJoinedRoomInfo : NSObject
|
||||
|
||||
/*!
|
||||
设备ID
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *deviceId;
|
||||
|
||||
/*!
|
||||
房间号
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *roomId;
|
||||
|
||||
/*!
|
||||
房间加入时间 (毫秒)
|
||||
*/
|
||||
@property (nonatomic, assign) long long joinTime;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,745 @@
|
||||
//
|
||||
// RCRTCLibDefine.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/3.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef RCRTCLibDefine_h
|
||||
#define RCRTCLibDefine_h
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCCodeDefine.h"
|
||||
|
||||
@class RongRTCMember;
|
||||
@class RCRTCRoom;
|
||||
@class RCRTCStream;
|
||||
@class RCRTCLiveInfo;
|
||||
@class RCRTCInputStream;
|
||||
@class RCRTCVideoFrame;
|
||||
|
||||
/*!
|
||||
某些操作的回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败描述的错误码
|
||||
@discussion
|
||||
某些操作的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCOperationCallback)(BOOL isSuccess, RCRTCCode code);
|
||||
|
||||
/*!
|
||||
直播操作的回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param liveInfo 当前直播主持人的数据模型
|
||||
@discussion
|
||||
直播操作的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCLiveOperationCallback)(BOOL isSuccess, RCRTCCode code, RCRTCLiveInfo *_Nullable liveInfo);
|
||||
|
||||
/*!
|
||||
观众观看直播的回调
|
||||
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param inputStream 当前直播流
|
||||
@discussion
|
||||
观众观看直播的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCLiveCallback)(RCRTCCode code, RCRTCInputStream *_Nullable inputStream);
|
||||
|
||||
/*!
|
||||
观众观看直播的回调
|
||||
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param inputStreams 当前直播流
|
||||
@discussion
|
||||
观众观看直播的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCLiveUrlCallback)(RCRTCCode code, NSArray<RCRTCInputStream *> *_Nullable inputStreams);
|
||||
|
||||
/*!
|
||||
获取用户属性操作回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败的描述 错误码
|
||||
@param attr 获取结果
|
||||
@discussion
|
||||
获取用户属性操作回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCAttributeOperationCallback)(BOOL isSuccess, RCRTCCode code, NSDictionary *_Nullable attr);
|
||||
|
||||
/*!
|
||||
订阅操作的回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param subscribeErrorList 服务器返回的订阅失败列表
|
||||
@discussion
|
||||
订阅操作的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCSubscribeOperationCallback)(BOOL isSuccess, RCRTCCode code, NSArray<RCRTCInputStream *> *_Nullable subscribeErrorList);
|
||||
|
||||
/*!
|
||||
当前流状态
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCResourceState) {
|
||||
/*!
|
||||
流处于禁用状态
|
||||
*/
|
||||
ResourceStateDisabled = 0,
|
||||
/*!
|
||||
流处于正常状态
|
||||
*/
|
||||
ResourceStateNormal
|
||||
};
|
||||
|
||||
/*!
|
||||
资源类型
|
||||
deprecated from 5.1.8
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RTCMediaType) {
|
||||
/*!
|
||||
只有声音
|
||||
*/
|
||||
RTCMediaTypeAudio,
|
||||
/*!
|
||||
声音视频
|
||||
*/
|
||||
RTCMediaTypeVideo,
|
||||
/*!
|
||||
数据(暂不支持)
|
||||
*/
|
||||
RTCMediaTypeData,
|
||||
/*!
|
||||
空数据
|
||||
*/
|
||||
RTCMediaTypeNothing
|
||||
};
|
||||
|
||||
/*!
|
||||
媒体类型
|
||||
added from 5.1.8
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCMediaType) {
|
||||
/*!
|
||||
音频
|
||||
*/
|
||||
RCRTCMediaTypeAudio,
|
||||
/*!
|
||||
音视频
|
||||
*/
|
||||
RCRTCMediaTypeVideo,
|
||||
/*!
|
||||
数据(暂不支持)
|
||||
*/
|
||||
RCRTCMediaTypeData,
|
||||
/*!
|
||||
空数据
|
||||
*/
|
||||
RCRTCMediaTypeNothing
|
||||
};
|
||||
|
||||
/*!
|
||||
媒体流类型
|
||||
added from 5.1.8
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCMediaStreamType) {
|
||||
/*!
|
||||
默认
|
||||
*/
|
||||
RCRTCMediaStreamTypeDefault,
|
||||
/*!
|
||||
自定义
|
||||
*/
|
||||
RCRTCMediaStreamTypeCustomized,
|
||||
/*!
|
||||
直播合流
|
||||
*/
|
||||
RCRTCMediaStreamTypeMCULive,
|
||||
/*!
|
||||
CDN
|
||||
*/
|
||||
RCRTCMediaStreamTypeCDN,
|
||||
/*!
|
||||
屏幕共享
|
||||
*/
|
||||
RCRTCMediaStreamTypeScreenShare
|
||||
};
|
||||
|
||||
/*!
|
||||
视频分辨率类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoSizePreset) {
|
||||
/*!
|
||||
无效参数
|
||||
*/
|
||||
RCRTCVideoSizePresetInvalid = -1,
|
||||
/*!
|
||||
分辨率 176X144
|
||||
*/
|
||||
RCRTCVideoSizePreset176x144,
|
||||
/*!
|
||||
分辨率 180X180
|
||||
*/
|
||||
RCRTCVideoSizePreset180x180,
|
||||
/*!
|
||||
分辨率 256X144
|
||||
*/
|
||||
RCRTCVideoSizePreset256x144,
|
||||
/*!
|
||||
分辨率 240X180
|
||||
*/
|
||||
RCRTCVideoSizePreset240x180,
|
||||
/*!
|
||||
分辨率 320X180
|
||||
*/
|
||||
RCRTCVideoSizePreset320x180,
|
||||
/*!
|
||||
分辨率 240X240
|
||||
*/
|
||||
RCRTCVideoSizePreset240x240,
|
||||
/*!
|
||||
分辨率 320X240
|
||||
*/
|
||||
RCRTCVideoSizePreset320x240,
|
||||
/*!
|
||||
分辨率 360X360
|
||||
*/
|
||||
RCRTCVideoSizePreset360x360,
|
||||
/*!
|
||||
分辨率 480X360
|
||||
*/
|
||||
RCRTCVideoSizePreset480x360,
|
||||
/*!
|
||||
分辨率 640X360
|
||||
*/
|
||||
RCRTCVideoSizePreset640x360,
|
||||
/*!
|
||||
分辨率 480X480
|
||||
*/
|
||||
RCRTCVideoSizePreset480x480,
|
||||
/*!
|
||||
分辨率 640X480
|
||||
*/
|
||||
RCRTCVideoSizePreset640x480,
|
||||
/*!
|
||||
分辨率 720X480
|
||||
*/
|
||||
RCRTCVideoSizePreset720x480,
|
||||
/*!
|
||||
分辨率 848X480
|
||||
*/
|
||||
RCRTCVideoSizePreset848x480,
|
||||
/*!
|
||||
分辨率 960X720
|
||||
*/
|
||||
RCRTCVideoSizePreset960x720,
|
||||
/*!
|
||||
分辨率 1280X720
|
||||
*/
|
||||
RCRTCVideoSizePreset1280x720,
|
||||
/*!
|
||||
分辨率 1920X1080
|
||||
*/
|
||||
RCRTCVideoSizePreset1920x1080
|
||||
};
|
||||
|
||||
/*!
|
||||
视频方向
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCVideoOrientation) {
|
||||
/*!
|
||||
竖立, home 键在下部
|
||||
*/
|
||||
RCRTCVideoOrientationPortrait = 1,
|
||||
/*!
|
||||
竖立, home 键在上部
|
||||
*/
|
||||
RCRTCVideoOrientationPortraitUpsideDown,
|
||||
/*!
|
||||
横屏, home 键在左侧
|
||||
*/
|
||||
RCRTCVideoOrientationLandscapeRight,
|
||||
/*!
|
||||
竖立, home 键在右侧
|
||||
*/
|
||||
RCRTCVideoOrientationLandscapeLeft
|
||||
};
|
||||
|
||||
/*!
|
||||
视频填充模式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoFillMode) {
|
||||
/*!
|
||||
完整显示, 填充黑边
|
||||
等比例填充,直到一个维度到达区域边界
|
||||
*/
|
||||
RCRTCVideoFillModeAspectFit,
|
||||
RCRTCVideoFillModeAspect
|
||||
__attribute__((deprecated("RCRTCVideoFillModeAspect即将废弃 请更换为RCRTCVideoFillModeAspectFit"))) =
|
||||
RCRTCVideoFillModeAspectFit,
|
||||
/*!
|
||||
满屏显示
|
||||
等比例填充,直到填充满整个视图区域,其中一个维度的部分区域会被裁剪
|
||||
*/
|
||||
RCRTCVideoFillModeAspectFill,
|
||||
/*!
|
||||
非均匀模式。两个维度完全填充至整个视图区域
|
||||
*/
|
||||
RCRTCVideoFillModeResize
|
||||
};
|
||||
|
||||
/*!
|
||||
帧率
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoFPS) {
|
||||
/*!
|
||||
无效参数
|
||||
*/
|
||||
RCRTCVideoFPSInvalid = -1,
|
||||
/*!
|
||||
每秒 10 帧
|
||||
*/
|
||||
RCRTCVideoFPS10,
|
||||
/*!
|
||||
每秒 15 帧
|
||||
*/
|
||||
RCRTCVideoFPS15,
|
||||
/*!
|
||||
每秒 24 帧
|
||||
*/
|
||||
RCRTCVideoFPS24,
|
||||
/*!
|
||||
每秒 30 帧
|
||||
*/
|
||||
RCRTCVideoFPS30
|
||||
};
|
||||
|
||||
/*!
|
||||
视频编解码
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCCodecType) {
|
||||
/*!
|
||||
H264 编码
|
||||
*/
|
||||
RCRTCCodecH264
|
||||
};
|
||||
|
||||
/*!
|
||||
音频编解码
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioCodecType) {
|
||||
/*!
|
||||
PCMU
|
||||
*/
|
||||
RCRTCAudioCodecPCMU = 0,
|
||||
/*!
|
||||
OPUS
|
||||
*/
|
||||
RCRTCAudioCodecOPUS = 111
|
||||
};
|
||||
|
||||
/*!
|
||||
摄像头
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCDeviceCamera) {
|
||||
/*!
|
||||
未指明
|
||||
*/
|
||||
RCRTCCaptureDeviceUnspecified = AVCaptureDevicePositionUnspecified,
|
||||
/*!
|
||||
后置摄像头
|
||||
*/
|
||||
RCRTCCaptureDeviceBack = AVCaptureDevicePositionBack,
|
||||
/*!
|
||||
前置摄像头
|
||||
*/
|
||||
RCRTCCaptureDeviceFront = AVCaptureDevicePositionFront
|
||||
};
|
||||
|
||||
/*!
|
||||
设置加入房间时音视频使用模式
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCRoomType) {
|
||||
/*!
|
||||
普通音视频类型
|
||||
*/
|
||||
RCRTCRoomTypeNormal = 0,
|
||||
/*!
|
||||
直播类型
|
||||
*/
|
||||
RCRTCRoomTypeLive = 2,
|
||||
/*!
|
||||
跨应用多人房间
|
||||
*/
|
||||
RCRTCRoomTypeCrossMuti = 7
|
||||
};
|
||||
|
||||
/*!
|
||||
直播类型
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCLiveType) {
|
||||
/*!
|
||||
当前直播为音视频直播
|
||||
*/
|
||||
RCRTCLiveTypeAudioVideo = 0,
|
||||
|
||||
/*!
|
||||
当前直播为仅音频直播
|
||||
*/
|
||||
RCRTCLiveTypeAudio = 1
|
||||
};
|
||||
|
||||
/*!
|
||||
同一 UserID 多端加入房间处理类型
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCJoinRoomType) {
|
||||
/*!
|
||||
将之前加入房间的端踢出房间
|
||||
*/
|
||||
RCRTCJoinRoomTypeKick = 0,
|
||||
/*!
|
||||
拒绝当前端加入房间
|
||||
*/
|
||||
RCRTCJoinRoomTypeRefuse = 1
|
||||
};
|
||||
|
||||
/*!
|
||||
直播类型下的角色区分
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCLiveRoleType) {
|
||||
/*!
|
||||
当前直播角色为主播
|
||||
*/
|
||||
RCRTCLiveRoleTypeBroadcaster = 0,
|
||||
|
||||
/*!
|
||||
当前直播角色为观众
|
||||
*/
|
||||
RCRTCLiveRoleTypeAudience = 1
|
||||
};
|
||||
|
||||
/*!
|
||||
观众订阅直播类型直播类型
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAVStreamType) {
|
||||
/*!
|
||||
仅订阅音频
|
||||
*/
|
||||
RCRTCAVStreamTypeAudio = 0,
|
||||
|
||||
/*!
|
||||
仅订阅视频(大流)
|
||||
*/
|
||||
RCRTCAVStreamTypeVideo = 1,
|
||||
|
||||
/*!
|
||||
订阅音频+视频(大流)
|
||||
*/
|
||||
RCRTCAVStreamTypeAudioVideo = 2,
|
||||
|
||||
/*!
|
||||
仅订阅视频(小流)
|
||||
*/
|
||||
RCRTCAVStreamTypeVideo_tiny = 3,
|
||||
|
||||
/*!
|
||||
订阅音频+视频(小流)
|
||||
*/
|
||||
RCRTCAVStreamTypeAudioVideo_tiny = 4
|
||||
};
|
||||
|
||||
/*!
|
||||
设置音频通话质量, 默认为普通通话模式 RCRTCAudioQualitySpeech
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioQuality) {
|
||||
/*!
|
||||
人声音质,编码码率最大值为32Kbps
|
||||
*/
|
||||
RCRTCAudioQualitySpeech,
|
||||
/*!
|
||||
标清音乐音质,编码码率最大值为64Kbps
|
||||
*/
|
||||
RCRTCAudioQualityMusic,
|
||||
/*!
|
||||
高清音乐音质,编码码率最大值为128Kbps
|
||||
*/
|
||||
RCRTCAudioQualityMusicHigh,
|
||||
};
|
||||
|
||||
/*!
|
||||
设置音频通话模式, 默认为普通通话模式 RCRTCAudioScenarioDefault
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioScenario) {
|
||||
/*!
|
||||
普通通话模式(普通音质模式), 满足正常音视频场景
|
||||
*/
|
||||
RCRTCAudioScenarioDefault,
|
||||
/*!
|
||||
音乐聊天室模式, 提升声音质量, 适用对音乐演唱要求较高的场景
|
||||
*/
|
||||
RCRTCAudioScenarioMusicChatRoom,
|
||||
/*!
|
||||
音乐教室模式, 提升声音质量, 适用对乐器演奏音质要求较高的场景
|
||||
*/
|
||||
RCRTCAudioScenarioMusicClassRoom
|
||||
};
|
||||
|
||||
/*!
|
||||
被踢原因
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCKickedReason) {
|
||||
/*!
|
||||
被服务端踢下线
|
||||
*/
|
||||
RCRTCKickedReasonForServer = 1,
|
||||
/*!
|
||||
被同一UserId加入其他房间踢出当前房间
|
||||
*/
|
||||
RCRTCKickedReasonForOtherJoinedRoom,
|
||||
/*!
|
||||
关闭 SDK 断线重连,SDK 将用户踢出房间
|
||||
*/
|
||||
RCRTCKickedReasonForSDKDisconnect,
|
||||
/*!
|
||||
IMLib 退出登录,SDK 将用户踢出房间
|
||||
*/
|
||||
RCRTCKickedReasonForIMLogout,
|
||||
/*!
|
||||
被其它端登录挤下线
|
||||
*/
|
||||
RCRTCKickedReasonForOtherClientLogin,
|
||||
/*!
|
||||
服务器销毁房间,被迫离开房间
|
||||
*/
|
||||
RCRTCKickedReasonForSeverDestory
|
||||
};
|
||||
|
||||
/*!
|
||||
RTC连接状态
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCConnectionState) {
|
||||
/*!
|
||||
连接中
|
||||
*/
|
||||
RCRTCConnectionStateConnecting,
|
||||
/*!
|
||||
已连接
|
||||
*/
|
||||
RCRTCConnectionStateConnected
|
||||
};
|
||||
|
||||
/*!
|
||||
代理协议类型
|
||||
*/
|
||||
typedef NS_OPTIONS(NSUInteger, RCRTCProxyOptions) {
|
||||
RCRTCProxyOptionsNone = 0,
|
||||
RCRTCProxyOptionsHTTP = 1 << 0,
|
||||
RCRTCProxyOptionsUDP = 1 << 1,
|
||||
RCRTCProxyOptionsAll = RCRTCProxyOptionsHTTP | RCRTCProxyOptionsUDP
|
||||
};
|
||||
|
||||
/*!
|
||||
视频帧格式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoFrameFormat) {
|
||||
/*!
|
||||
NV12
|
||||
*/
|
||||
RCRTCVideoFrameFormatNV12,
|
||||
/*!
|
||||
BGRA
|
||||
*/
|
||||
RCRTCVideoFrameFormatBGRA,
|
||||
/*!
|
||||
I420
|
||||
*/
|
||||
RCRTCVideoFrameFormatI420
|
||||
};
|
||||
|
||||
/*!
|
||||
音频路由类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCAudioRouteType) {
|
||||
/*!
|
||||
扬声器
|
||||
*/
|
||||
RCRTCAudioRouteTypeSpeaker,
|
||||
/*!
|
||||
听筒
|
||||
*/
|
||||
RCRTCAudioRouteTypeReceiver,
|
||||
/*!
|
||||
耳机
|
||||
*/
|
||||
RCRTCAudioRouteTypeHeadphone,
|
||||
/*!
|
||||
蓝牙设备
|
||||
*/
|
||||
RCRTCAudioRouteTypeBluetooth
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
原始音频数据
|
||||
*/
|
||||
@interface RCRTCAudioFrame : NSObject
|
||||
|
||||
/*!
|
||||
音频数据
|
||||
*/
|
||||
@property (assign, nonatomic) uint8_t * bytes;
|
||||
/*!
|
||||
音频数据长度(字节数)
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t length;
|
||||
/*!
|
||||
声道数
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t channels;
|
||||
/*!
|
||||
采样率
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t sampleRate;
|
||||
/*!
|
||||
位深
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t bytesPerSample;
|
||||
/*!
|
||||
帧数
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t samples;
|
||||
/*!
|
||||
时间戳
|
||||
*/
|
||||
@property (assign, nonatomic) uint64_t renderTimeMs;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCASRContent : NSObject
|
||||
/**
|
||||
当前语音识别关联用户的 ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userId;
|
||||
/**
|
||||
当前语音识别的 ID, 用于关联当前语音识别结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msgId;
|
||||
/**
|
||||
当前语音识别的时间戳, 单位为秒
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval timeUTC;
|
||||
/**
|
||||
当前语音识别结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msg;
|
||||
/**
|
||||
当前语音识别是否结束, 如果为 YES, 则表示当前语音识别已结束
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEnd;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCRealtimeTranslationContent : NSObject
|
||||
/**
|
||||
当前语音翻译的目标语言码
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *destLangCode;
|
||||
/**
|
||||
当前语音翻译关联用户的 ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userId;
|
||||
/**
|
||||
当前语音翻译的 ID, 用于关联当前语音识别和语音翻译结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msgId;
|
||||
/**
|
||||
当前语音翻译的时间戳, 单位为秒
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval timeUTC;
|
||||
/**
|
||||
当前语音翻译结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msg;
|
||||
/**
|
||||
当前语音翻译是否结束, 如果为 YES, 则表示当前语音翻译已结束
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEnd;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
/*!
|
||||
视频帧回调
|
||||
|
||||
@param valid 该视频帧是否有效
|
||||
@param videoFrame 视频帧内容
|
||||
@discussion
|
||||
视频帧回调
|
||||
|
||||
@remarks 视频流处理
|
||||
@return 用户自定义视频帧
|
||||
*/
|
||||
typedef RCRTCVideoFrame *_Nullable (^RCRTCVideoFrameCallback)(BOOL valid, RCRTCVideoFrame *_Nullable videoFrame);
|
||||
|
||||
/*!
|
||||
视频帧回调
|
||||
|
||||
@param valid 该视频帧是否有效
|
||||
@param sampleBuffer 视频帧内容
|
||||
@discussion
|
||||
视频帧回调
|
||||
|
||||
@remarks 视频流处理
|
||||
@return 用户自定义视频帧
|
||||
*/
|
||||
typedef CMSampleBufferRef _Nullable (^RCRTCVideoCMSampleBufferCallback)(BOOL valid,
|
||||
CMSampleBufferRef _Nullable sampleBuffer);
|
||||
|
||||
/*!
|
||||
音频输入输出的回调
|
||||
|
||||
@param inNumberFrames 帧个数
|
||||
@param ioData 音频 pcm 数据
|
||||
@param inTimeStamp 音频时间戳
|
||||
@param asbd 音频数据格式
|
||||
@discussion
|
||||
音频输入输出的回调
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
typedef void (^RCRTCAudioDataCallback)(UInt32 inNumberFrames,
|
||||
AudioBufferList *_Nonnull ioData,
|
||||
const AudioTimeStamp *_Nonnull inTimeStamp,
|
||||
const AudioStreamBasicDescription asbd);
|
||||
|
||||
/*!
|
||||
音频数据的回调
|
||||
|
||||
@param frame 音频数据
|
||||
@discussion
|
||||
音频输入输出的回调
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
typedef void (^RCRTCAudioFrameCallback)(RCRTCAudioFrame *_Nonnull frame);
|
||||
|
||||
#endif /* RCRTCLibDefine_h */
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// RCRTCLiveAudioStatus.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/10/18.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCLiveAudioStatus : NSObject
|
||||
|
||||
/*!
|
||||
用户Id
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *userId;
|
||||
|
||||
/*!
|
||||
流Id
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *streamId;
|
||||
|
||||
/*!
|
||||
音量大小, 0 - 9表示音量高低
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger audioLevel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// RCRTCLiveInfo.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/8/22.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCMixConfig.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCLiveInfo : NSObject
|
||||
|
||||
/**
|
||||
当前的直播地址(已废弃)
|
||||
@discussion 新版观众加房间,直接可以拿到直播合流, 单个主播流,使用常规方式订阅即可
|
||||
@deprecated from 5.1.0
|
||||
*/
|
||||
@property (nonatomic, copy, readonly)
|
||||
NSString *liveUrl DEPRECATED_MSG_ATTRIBUTE("audience can join room on 5.1.0 version");
|
||||
|
||||
/*!
|
||||
设置是否开启内置CDN
|
||||
|
||||
@param enable YES开启,NO关闭, 默认是NO
|
||||
@param completion 动作的回调
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)enableInnerCDN:(BOOL)enable completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion;
|
||||
|
||||
/*!
|
||||
设置混流布局配置
|
||||
|
||||
@param config 混流布局配置
|
||||
@param completion 动作的回调
|
||||
@discussion
|
||||
设置混流布局配置
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setMixStreamConfig:(RCRTCMixConfig *)config
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use setMixConfig:completion: API instead");
|
||||
|
||||
/*!
|
||||
设置混流布局配置
|
||||
|
||||
@param config 混流布局配置
|
||||
@param completion 动作的回调
|
||||
@discussion
|
||||
设置混流布局配置
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setMixConfig:(RCRTCMixConfig *)config completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion;
|
||||
|
||||
/*!
|
||||
添加一个 CDN 直播推流地址
|
||||
|
||||
@param url 推流地址
|
||||
@param completion 回调
|
||||
*/
|
||||
- (void)addPublishStreamUrl:(NSString *)url
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code, NSArray * _Nullable array))completion;
|
||||
|
||||
/*!
|
||||
删除一个 CDN 直播推流地址
|
||||
|
||||
@param url 要删除的推流地址
|
||||
@param completion 回调
|
||||
*/
|
||||
- (void)removePublishStreamUrl:(NSString *)url
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code, NSArray * _Nullable array))completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,592 @@
|
||||
//
|
||||
// RCRTCLocalUser.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/9.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AvailabilityMacros.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RCRTCCodeDefine.h"
|
||||
#import "RCRTCUser.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCOutputStream;
|
||||
@class RCRTCInputStream;
|
||||
@class RCMessageContent;
|
||||
|
||||
/*!
|
||||
音视频本地用户(当前登陆者)
|
||||
*/
|
||||
@interface RCRTCLocalUser : RCRTCUser
|
||||
|
||||
/*!
|
||||
本地用户发布的音视频流
|
||||
*/
|
||||
@property (nonatomic, copy, readonly)
|
||||
NSArray<RCRTCOutputStream *> *localStreams DEPRECATED_MSG_ATTRIBUTE("use streams property instead");
|
||||
|
||||
/*!
|
||||
本地用户发布的音视频流
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSArray<RCRTCOutputStream *> *streams;
|
||||
|
||||
#pragma mark - 用户属性
|
||||
/*!
|
||||
设置全局用户属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息(也不会收到有用户属性变换的回调)
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setAttributeValue:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use setAttribute:forKey:message:completion: API instead");
|
||||
|
||||
/*!
|
||||
设置全局用户属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息(也不会收到有用户属性变换的回调)
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setAttribute:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
删除全局用户属性
|
||||
|
||||
@param attributeKeys 属性名称数组
|
||||
@param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息
|
||||
@param completion 删除完成回调
|
||||
@discussion
|
||||
删除用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)deleteAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
获取全局用户属性
|
||||
|
||||
@param attributeKeys 属性名称
|
||||
@param completion 获取结果回调
|
||||
@discussion
|
||||
获取用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)getAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
completion:(nullable RCRTCAttributeOperationCallback)completion;
|
||||
|
||||
#pragma mark - 发布资源
|
||||
/*!
|
||||
发布本地默认音视频流
|
||||
|
||||
@param completion 发布完成回调
|
||||
@discussion
|
||||
发布默认音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishDefaultStreams:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布本地指定音视频流
|
||||
|
||||
@param stream 发布的音视频流
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
发布音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布多路本地指定音视频流
|
||||
|
||||
@param streams 发布音视频流集合
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
发布多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishStreams:(nullable NSArray<RCRTCOutputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布本地默认音视频流,直播模式专用
|
||||
|
||||
@param completion 发布完成回调
|
||||
@discussion
|
||||
发布主播默认音视频流, 此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishDefaultLiveStreams:(nullable RCRTCLiveOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布本地指定音视频流,直播模式专用
|
||||
|
||||
@param stream 发布的音视频流
|
||||
@param completion 发布的音视频流结果, 包括此主播的推流 url
|
||||
@discussion
|
||||
发布直播音视频流, 此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishLiveStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCLiveOperationCallback)completion;
|
||||
|
||||
#pragma mark - 取消发布资源
|
||||
/*!
|
||||
取消发布本地默认音视频流
|
||||
|
||||
@param completion 取消发布完成回调
|
||||
@discussion
|
||||
取消发布默认音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishDefaultStreams:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布本地指定音视频流
|
||||
|
||||
@param stream 取消发布的音视频流
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
取消发布音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布多路本地指定音视频流
|
||||
|
||||
@param streams 取消发布的音视频流集合
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
取消发布多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishStreams:(nullable NSArray<RCRTCOutputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布本地默认音视频流,直播模式专用
|
||||
|
||||
@param completion 取消发布完成回调
|
||||
@discussion
|
||||
取消发布默认音视频流,此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishDefaultLiveStreams:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布本地指定音视频流,直播模式专用
|
||||
|
||||
@param stream 取消发布的音视频流
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
取消发布音视频流,此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishLiveStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 订阅资源
|
||||
/*!
|
||||
订阅多路远端指定音视频流
|
||||
|
||||
@param avStreams 普通流数组
|
||||
@param tinyStreams 小流数组,同一个流只能填写在 avStreams 或 tinyStreams 中的一个数组中
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
订阅流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStream:(nullable NSArray<RCRTCInputStream *> *)avStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)tinyStreams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
订阅多路远端指定音视频流
|
||||
|
||||
@param avStreams 普通流数组
|
||||
@param tinyStreams 小流数组,同一个流只能填写在 avStreams 或 tinyStreams 中的一个数组中
|
||||
@param callback 完成的回调
|
||||
@discussion
|
||||
订阅流,callback 返回订阅结果,callback 中 subscribeErrorList 为服务器返回的订阅失败列表;另外可能存在 isSuccess 为 YES,但是 subscribeErrorList 不为空的情况,这种情况是部分订阅成功,用户可以根据业务决定是否对 subscribeErrorList 中的流进行重新订阅
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStreams:(nullable NSArray<RCRTCInputStream *> *)avStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)tinyStreams
|
||||
callback:(nullable RCRTCSubscribeOperationCallback)callback;
|
||||
|
||||
/*!
|
||||
观众订阅合流资源
|
||||
|
||||
@param liveUrl 主播直播的 liveUrl (针对 4x版本的主播兼容方案)
|
||||
@param streamType 需要具体订阅的媒体类型
|
||||
@param completion 完成的回调, 会依次回调合流的 RCRTCInputStream, 根据 streamType 区分是音频流还是视频流, 如主播发布了音视频流, 此回调会回调两次, 分别为音频的 RCRTCInputStream, 和视频的 RCRTCInputStream 。
|
||||
@discussion
|
||||
仅直播模式可用, 作为观众, 直接观看主播的直播, 通过传入主播的 url, 仅观众端可用,此接口可具体订阅音频流或视频流或大小流
|
||||
Added from 5.1.0
|
||||
|
||||
@remarks 媒体流操作
|
||||
*/
|
||||
- (void)subscribeLiveUrl:(nullable NSString *)liveUrl
|
||||
streamType:(RCRTCAVStreamType)streamType
|
||||
completion:(nullable RCRTCLiveUrlCallback)completion;
|
||||
|
||||
#pragma mark - 取消订阅资源
|
||||
/*!
|
||||
取消订阅远端指定音视频流
|
||||
|
||||
@param stream 音视频流
|
||||
@param completion 音视频流结果
|
||||
@discussion
|
||||
取消订阅音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unsubscribeStream:(nullable RCRTCInputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消订阅多路远端指定音视频流
|
||||
|
||||
@param streams 音视频流集合
|
||||
@param completion 音视频流结果
|
||||
@discussion
|
||||
取消订阅多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unsubscribeStreams:(nullable NSArray<RCRTCInputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 订阅与取消订阅
|
||||
/*!
|
||||
同时订阅+取消订阅多路远端指定音视频流
|
||||
|
||||
在订阅时, 同一个流只能填写在 subStreams 或 subTinyStreams 中的一个数组中
|
||||
订阅列表与取消订阅列表不能存在重复的音视频流
|
||||
|
||||
@param subStreams 普通音视频流列表
|
||||
@param subTinyStreams 需要携带小流的流数组
|
||||
@param unsubStreams 取消订阅的音视频数组
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
订阅+取消订阅多路远端指定音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStreams:(nullable NSArray<RCRTCInputStream *> *)subStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)subTinyStreams
|
||||
unsubscribeStreams:(nullable NSArray<RCRTCInputStream *> *)unsubStreams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
同时订阅+取消订阅多路远端指定音视频流
|
||||
|
||||
在订阅时, 同一个流只能填写在 subStreams 或 subTinyStreams 中的一个数组中
|
||||
订阅列表与取消订阅列表不能存在重复的音视频流
|
||||
|
||||
@param subStreams 普通音视频流列表
|
||||
@param subTinyStreams 需要携带小流的流数组
|
||||
@param unsubStreams 取消订阅的音视频数组
|
||||
@param callback 完成的回调
|
||||
@discussion
|
||||
订阅+取消订阅多路远端指定音视频流,callback 返回订阅结果,callback 中 subscribeErrorList 为服务器返回的订阅失败列表;另外可能存在 isSuccess 为 YES,但是 subscribeErrorList 不为空的情况,这种情况是部分订阅成功,用户可以根据业务决定是否对 subscribeErrorList 中的流进行重新订阅
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStreams:(nullable NSArray<RCRTCInputStream *> *)subStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)subTinyStreams
|
||||
unsubscribeStreams:(nullable NSArray<RCRTCInputStream *> *)unsubStreams
|
||||
callback:(nullable RCRTCSubscribeOperationCallback)callback;
|
||||
|
||||
#pragma mark - 跨房间连麦
|
||||
/*!
|
||||
向指定用户发送跨房间连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param autoMix 是否将被邀请人音视频资源合流到邀请人房间中
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)requestJoinOtherRoom:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use requestRoomPK:forKey:userId:autoMix:extra:completion: API instead");
|
||||
|
||||
/*!
|
||||
向指定用户发送PK连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param autoMix 是否将被邀请人音视频资源合流到邀请人房间中
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)requestRoomPK:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消正在进行中的跨房间连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)cancelRequestJoinOtherRoom:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use cancelRequestJoinPK:userId:extra:completion: API instead");
|
||||
|
||||
/*!
|
||||
取消正在进行中的PK连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)cancelRequestJoinPK:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
响应跨房间连麦请求
|
||||
|
||||
@param inviterRoomId 邀请人所在的房间号
|
||||
@param inviterUserId 邀请人userId
|
||||
@param agree 是否同意加入副房间
|
||||
@param autoMix 是否将邀请人音视频资源合流到被邀请人(响应邀请的人)房间中
|
||||
@param extra 附加信息, 可随消息发送给邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
取消订阅多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)responseJoinOtherRoom:(nullable NSString *)inviterRoomId
|
||||
userId:(nullable NSString *)inviterUserId
|
||||
agree:(BOOL)agree
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use responseRoomPK:userId:agree:autoMix:extra:completion: API instead");
|
||||
|
||||
/*!
|
||||
响应PK连麦请求
|
||||
|
||||
@param inviterRoomId 邀请人所在的房间号
|
||||
@param inviterUserId 邀请人userId
|
||||
@param agree 是否同意加入副房间
|
||||
@param autoMix 是否将邀请人音视频资源合流到被邀请人(响应邀请的人)房间中
|
||||
@param extra 附加信息, 可随消息发送给邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
取消订阅多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)responseRoomPK:(nullable NSString *)inviterRoomId
|
||||
userId:(nullable NSString *)inviterUserId
|
||||
agree:(BOOL)agree
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
结束PK连麦
|
||||
|
||||
@param roomId 副房间 Id
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
通知所有连麦用户结束连麦
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)quitRoomPK:(nullable NSString *)roomId
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 身份切换
|
||||
/*!
|
||||
主播切换到观众
|
||||
|
||||
@param onSucceed 切换成功的回调。
|
||||
@param onFailed 切换失败会回调,但不影响当前角色继续音视频。
|
||||
@param onKicked 切换失败会回调,SDK内部会退出房间并清理所有资源,该用户只能重新加入房间才能继续音视频。
|
||||
|
||||
@discussion
|
||||
当前角色为主播,切换角色到观众,仅限主播使用。
|
||||
如果当前用户加入了 RCRTCOtherRoom 切换为观众时,RTC SDK 内部会帮其退出所有 RCRTCOtherRoom。
|
||||
Added from 5.1.9
|
||||
*/
|
||||
- (void)switchToAudienceOnSucceed:(nullable void (^)(void))onSucceed
|
||||
onFailed:(nullable void (^)(RCRTCCode code))onFailed
|
||||
onKicked:(nullable void (^)(void))onKicked;
|
||||
|
||||
/*!
|
||||
观众切换到主播
|
||||
|
||||
@param publishStreams 切换成主播后需要发布的流。
|
||||
@param onSucceed 切换成功的回调
|
||||
@param onFailed 切换失败会回调,但不影响当前角色继续音视频。
|
||||
@param onKicked 切换失败会回调,SDK内部会退出房间并清理所有资源,该用户只能重新加入房间才能继续音视频。
|
||||
|
||||
@discussion
|
||||
观众切换角色到主播,仅限观众使用。
|
||||
Added from 5.1.9
|
||||
*/
|
||||
- (void)switchToBroadcaster:(NSArray<RCRTCOutputStream *> *)publishStreams
|
||||
onSucceed:(nullable void (^)(RCRTCLiveInfo *liveInfo))onSucceed
|
||||
onFailed:(nullable void (^)(RCRTCCode code))onFailed
|
||||
onKicked:(nullable void (^)(void))onKicked;
|
||||
|
||||
|
||||
/*!
|
||||
设置开启 SEI 功能
|
||||
|
||||
@param enable YES 开启,NO 不开启,默认 NO
|
||||
@param completion 开启结果的回调
|
||||
|
||||
@discussion 开启 SEI 功能观众身份调用无效,观众不允许发布流,所以不具备 SEI 能力。
|
||||
Added from 5.2.5
|
||||
*/
|
||||
- (void)setEnableSEI:(BOOL)enable
|
||||
completion:(void(^)(BOOL isSuccess, RCRTCCode errCode))completion;
|
||||
|
||||
/*!
|
||||
发送媒体增强补充信息
|
||||
|
||||
@param SEI 数据字符
|
||||
@discussion 此接口可在开发者推流传输音视频流数据并且[setEnableSEI] 开启SEI 功能的同时,发送流媒体增强补充信息来同步一些其他附加信息。
|
||||
一般如同步音乐歌词或视频画面精准布局等场景,可选择使用发送 SEI。当推流方发送 SEI 后,拉流方可通过 RCRTCRoomEventDelegate 监听 [didReceiveSEI] & [didReceiveLiveStreamSEI] 的回调获取 SEI 内容。由于 SEI 信息跟随视频帧,由于网络问题有可能丢帧,因此 SEI 信息也有可能丢,为解决这种情况,应该在限制频率内多发几次。限制频率:1秒钟不要超过30次。SEI 数据长度限制为 4096 字节。
|
||||
@return 0 成功,非 0 失败,返回具体错误码
|
||||
Added from 5.2.5
|
||||
*/
|
||||
- (RCRTCCode)sendSEI:(NSString *)SEI;
|
||||
|
||||
/*!
|
||||
开启语音识别服务
|
||||
|
||||
@param completion 开启语音识别服务回调
|
||||
|
||||
@discussion
|
||||
开启语音识别服务,如果房间内没有人发布流,则无法开启语音识别服务,SDK 会在有人发布流后补偿进行开启语音识别服务
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)startASR:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
停止语音识别服务
|
||||
|
||||
@param completion 停止语音识别服务回调
|
||||
|
||||
@discussion
|
||||
停止语音识别服务
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)stopASR:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
获取语音识别服务是否可用
|
||||
|
||||
@return YES 表示语音识别服务已经开启,NO 表示语音识别服务已经停止
|
||||
|
||||
@discussion
|
||||
获取语音识别服务是否可用,非实时查询接口,根据端上缓存进行的判断
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (BOOL)asrIsAvailable;
|
||||
|
||||
/*!
|
||||
开启语音翻译
|
||||
@param destLangCode 翻译目标语言码
|
||||
|
||||
@discussion
|
||||
1. 语音翻译依赖语音识别服务,需要在收到 RCRTCRoomEventDelegate 的 didReceiveStartASR 回调后,调用开启语音翻译
|
||||
2. 开启语音翻译,会通过 RCRTCRoomEventDelegate 的 didReceiveRealtimeTranslationContent 回调返回语音翻译结果
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)startRealtimeTranslation:(NSString *)destLangCode copmletion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
关闭语音翻译
|
||||
|
||||
@discussion
|
||||
关闭语音翻译
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)stopRealtimeTranslation:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
设置是否接收语音识别信息
|
||||
@param enable 是否接收语音识别信息
|
||||
|
||||
@discussion
|
||||
设置接收语音识别信息时候,会通过 RCRTCRoomEventDelegate 的 didReceiveASRContent 回调返回语音识别结果
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (int)setEnableASR:(BOOL)enable;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// RCLocalPreviewView.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2018/12/17.
|
||||
// Copyright © 2018年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "RCRTCVideoPreviewView.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
⚠️ RCRTCLocalVideoView 即将废弃 , 请使用RCRTCVideoView
|
||||
|
||||
@discussion deprecated from 5.1.10
|
||||
*/
|
||||
__attribute__((deprecated("Class RCRTCLocalVideoView is deprecated , use Class RCRTCVideoView instead")))
|
||||
|
||||
@interface RCRTCLocalVideoView : RCRTCVideoPreviewView
|
||||
/*!
|
||||
刷新渲染视图 View
|
||||
|
||||
@discussion
|
||||
刷新渲染视图 View
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)flushVideoView DEPRECATED_MSG_ATTRIBUTE("Method flushVideoView is deprecated");
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// RCRTCMediaConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCVideoConfig;
|
||||
@class RCRTCAudioConfig;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCMediaConfig : NSObject
|
||||
|
||||
/*!
|
||||
视频配置
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCVideoConfig *videoConfig;
|
||||
|
||||
/*!
|
||||
音频配置
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCAudioConfig *audioConfig;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// RCRTCMicOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/4/16.
|
||||
// Copyright © 2020年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCAudioMixer.h"
|
||||
#import "RCRTCAudioOutputStream.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCOutputStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
麦克风输出流,以麦克风为音频源的音频输出流
|
||||
*/
|
||||
@interface RCRTCMicOutputStream : RCRTCAudioOutputStream
|
||||
|
||||
/*!
|
||||
麦克风的音量,范围:0~200,默认值:100
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger recordingVolume;
|
||||
|
||||
/*!
|
||||
音频码率
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) NSInteger bitrateValue;
|
||||
|
||||
/*!
|
||||
音频编解码方式
|
||||
默认: OPUS
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) RCRTCAudioCodecType audioCodecType;
|
||||
|
||||
/*!
|
||||
音频通话质量
|
||||
默认: 人声音质,RCRTCAudioQualitySpeech
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) RCRTCAudioQuality audioQuality;
|
||||
|
||||
/*!
|
||||
音频通话模式
|
||||
默认: 普通通话模式,RCRTCAudioScenarioDefault
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) RCRTCAudioScenario audioScenario;
|
||||
|
||||
/*!
|
||||
本地发送的音频数据(合流)回调
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioDataCallback willSendAudioBufferCallback;
|
||||
|
||||
/*!
|
||||
麦克风的音频数据回调
|
||||
added from 5.1.6
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioFrameCallback recordAudioDataCallback;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultAudioStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return 失败
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultAudioStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return 失败
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
关闭/打开麦克风
|
||||
|
||||
@param disable YES 关闭,NO 打开
|
||||
@discussion
|
||||
关闭/打开麦克风
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setMicrophoneDisable:(BOOL)disable;
|
||||
|
||||
/*!
|
||||
设置音频通话质量和音频通话模式
|
||||
|
||||
@param audioQuality 音频通话质量, audioScenario 音频通话模式
|
||||
@discussion
|
||||
设置音频通话质量和音频通话模式
|
||||
|
||||
@remarks 音频流处理
|
||||
@return 设置是否成功
|
||||
*/
|
||||
- (BOOL)setAudioQuality:(RCRTCAudioQuality)audioQuality Scenario:(RCRTCAudioScenario)audioScenario;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// RCRTCMixConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCCustomLayout.h"
|
||||
#import "RCRTCCustomMixAudio.h"
|
||||
#import "RCRTCMediaConfig.h"
|
||||
#import "RCRTCStream.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCMixLayoutMode) {
|
||||
/*!
|
||||
自定义布局
|
||||
*/
|
||||
RCRTCMixLayoutModeCustom = 1,
|
||||
/*!
|
||||
悬浮布局
|
||||
*/
|
||||
RCRTCMixLayoutModeSuspension = 2,
|
||||
/*!
|
||||
自适应布局
|
||||
*/
|
||||
RCRTCMixLayoutModeAdaptive = 3
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCMixMediaType) {
|
||||
/*!
|
||||
音频
|
||||
*/
|
||||
RCRTCMixMediaType_Audio = 1,
|
||||
/*!
|
||||
视频
|
||||
*/
|
||||
RCRTCMixMediaType_Video = 2,
|
||||
/*!
|
||||
音视频
|
||||
*/
|
||||
RCRTCMixMediaType_AV = 3
|
||||
};
|
||||
|
||||
@interface RCRTCMixConfig : NSObject
|
||||
|
||||
/*!
|
||||
合流服务版本,不支持修改
|
||||
|
||||
@discussion
|
||||
从 5.1.1 版本,version 变更为 2
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSInteger version;
|
||||
|
||||
/*!
|
||||
合流布局模式
|
||||
|
||||
1:自定义布局,需要设置 customLayouts 2:悬浮布局 3:自适应布局
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCMixLayoutMode layoutMode;
|
||||
|
||||
/**
|
||||
mode 为 2 或者 3 时可用,作用将此 stream 置顶,必须为视频流
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) RCRTCStream *hostVideoStream;
|
||||
|
||||
/*!
|
||||
自定义模式开关
|
||||
|
||||
@discussion
|
||||
1. version == 1 时,customMode 字段不传, 保持上次逻辑不变,上次是按需订阅,就按需订阅。
|
||||
2. version == 2 时,customMode == YES,按自定义视频布局列表 customLayouts,自定义混音音频列表 customMixAudios 来筛选。
|
||||
2.1 当 customLayouts == nil,按之前逻辑通过设置 layoutMode 控制合流;
|
||||
2.2 当 customLayouts != nil,且 customLayouts.count == 0,所有视频流都不合流;
|
||||
2.3 当 customLayouts != nil,且 customLayouts.count != 0,layoutMode == 2 || layoutMode == 3,按 customLayouts 列表指定的视频流进行合流,但里面的 x,y,width,height 不会生效;
|
||||
2.4 当 customLayouts != nil,且 customLayouts.count != 0,layoutMode == 1,按 customLayouts 列表指定的视频流进行合流,并且按照设置的 x,y,width,height 进行布局;
|
||||
2.5 当 customMixAudios == nil,可参与合流的音频流和之前保持一致;
|
||||
2.6 当 customMixAudios != nil,且 customMixAudios.count == 0,所有音频流都不合流;
|
||||
2.7 当 customMixAudios != nil,且 customMixAudios.count != 0,按照 customMixAudios 列表指定的音频流进行合流;
|
||||
3. version == 2 时,customMode == NO,取消之前设置过的参数筛选配置
|
||||
Added from 5.1.1
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL customMode;
|
||||
|
||||
/*!
|
||||
自定义视频流列表,SDK 根据输入视频流列表中的流进行混流,效果为设置其他人的窗口排版
|
||||
*/
|
||||
@property (nonatomic, strong) NSMutableArray<RCRTCCustomLayout *> *customLayouts;
|
||||
|
||||
/*!
|
||||
自定义音频流列表,SDK 根据输入音频流列表中的流进行混流
|
||||
|
||||
@discussion
|
||||
Added from 5.1.1
|
||||
*/
|
||||
@property (nonatomic, strong) NSMutableArray<RCRTCCustomMixAudio *> *customMixAudios;
|
||||
|
||||
/*!
|
||||
合流音视频配置,包括音频和视频
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCMediaConfig *mediaConfig;
|
||||
|
||||
/*!
|
||||
设置 MCU 混流配置
|
||||
|
||||
@param mixVideos 视频输入混流列表,为 nil 代表视频全混流,为空数组代表视频全不混流,否则按输入列表进行混流
|
||||
@param mixAudios 音频输入混流列表,为 nil 代表音频全混流,为空数组代表音频全不混流,否则按输入列表进行混流
|
||||
@discussion
|
||||
通过传入音频、视频混流列表,设置 MCU 的音视频混流
|
||||
|
||||
@remarks RCRTCMixConfig:混流操作
|
||||
Added from 5.1.3
|
||||
*/
|
||||
- (void)setMixInputFilterByStreams:(nullable NSArray<RCRTCCustomLayout *> *)mixVideos
|
||||
mixAudios:(nullable NSArray<RCRTCCustomMixAudio *> *)mixAudios;
|
||||
|
||||
/*!
|
||||
设置 MCU 混流配置
|
||||
|
||||
@param roomIds 混流房间列表
|
||||
@param mixMediaType 混流媒体类型
|
||||
@param isAppend 是否为增量混流,YES 为增量混流,NO 为全量覆盖混流
|
||||
@discussion
|
||||
通过传入混流房间列表,设置 MCU 的音视频混流
|
||||
|
||||
@remarks RCRTCMixConfig:混流操作
|
||||
Added from 5.1.3
|
||||
*/
|
||||
- (void)setMixInputFilterByRoomIds:(nullable NSArray<NSString *> *)roomIds
|
||||
mixMediaType:(RCRTCMixMediaType)mixMediaType
|
||||
isAppend:(BOOL)isAppend;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// RCRTCOtherRoom.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/3.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCBaseRoom.h"
|
||||
#import "RCRTCOtherRoomEventDelegate.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCOtherRoom : RCRTCBaseRoom
|
||||
|
||||
/*!
|
||||
副房间代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCOtherRoomEventDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,205 @@
|
||||
//
|
||||
// RCRTCOtherRoomEventDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef RCRTCOtherRoomEventDelegate_h
|
||||
#define RCRTCOtherRoomEventDelegate_h
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCRemoteUser;
|
||||
@class RCRTCInputStream;
|
||||
@class RCRTCRoom;
|
||||
@class RCRTCBaseRoom;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音视频通话的房间代理, 实现这个代理之后房间成员变化以及资源的变化都会通过代理通知给您
|
||||
*/
|
||||
@protocol RCRTCOtherRoomEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/*!
|
||||
有用户加入的回调, 此时 user 不包含任何资源, 只是标记有人加入, 此时无法订阅这个人的流
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 加入的用户信息
|
||||
@discussion
|
||||
有用户加入的回调, 此时 user 不包含任何资源, 只是标记有人加入, 此时无法订阅这个人的流
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didJoinUser:(nullable RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
有用户离开时的回调, 当有用户离开的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 离开的用户
|
||||
@discussion
|
||||
有用户离开时的回调, 当有用户离开的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didLeaveUser:(nullable RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
有用户掉线时的回调, 当有用户掉线的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 掉线的用户
|
||||
@discussion
|
||||
有用户掉线时的回调, 当有用户掉线的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didOfflineUser:(nullable RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
副房间远端用户切换身份通知
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 切换身份的用户
|
||||
@param roleType 该用户当前的身份
|
||||
|
||||
@discussion
|
||||
当副房间用户切换身份的时候,副房间内其他主播会收到该消息。
|
||||
如果订阅了当前 user 的流,SDK 会主动取消订阅,不需要手动取消订阅。
|
||||
added from 5.2.6
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didSwitchRoleWithUser:(RCRTCRemoteUser *)user roleType:(RCRTCLiveRoleType)roleType;
|
||||
|
||||
/*!
|
||||
订阅远端资源成功后, 音频或视频首帧到达通知
|
||||
|
||||
@param room 事件所在房间
|
||||
@param stream 开始接收数据的 stream
|
||||
@param mediaType 数据流类型(如视频流、音频流)
|
||||
@discussion
|
||||
数据流第一个关键帧到达
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didReportFirstFrame:(nullable RCRTCInputStream *)stream mediaType:(RCRTCMediaType)mediaType;
|
||||
|
||||
/*!
|
||||
当有远端用户发布资源时, 通过此方法回调通知上报该用户发布的流
|
||||
|
||||
@param room 事件所在房间
|
||||
@param streams 用户发布的资源信息
|
||||
@discussion
|
||||
当有远端用户发布资源时, 通过此方法回调通知上报该用户发布的流, 其中流中有
|
||||
userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息,
|
||||
可调用订阅接口, 订阅其中的流
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didPublishStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
当有远端用户取消发布资源时, 通过此方法回调, SDK 默认会取消订阅这些流, 其中流中有
|
||||
userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息,
|
||||
APP 可根据这些关键信息自定义化, 无需再次调用取消订阅接口
|
||||
|
||||
@param streams 取消发布资源
|
||||
@discussion
|
||||
当有远端用户取消发布资源时, 通过此方法回调, SDK 默认会取消订阅这些流, 其中流中有
|
||||
userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息,
|
||||
APP 可根据这些关键信息自定义化, 无需再次调用取消订阅接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didUnpublishStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
接收到副房间内远端用户发送的 SEI 通知
|
||||
|
||||
@param room 事件所在房间
|
||||
@param SEI sei 数据
|
||||
@param userId 用户id
|
||||
@discussion 监听远端用户发送的 SEI 内容,通过 userId 区分。
|
||||
Added from 5.2.5
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(RCRTCBaseRoom *)room didReceiveSEI:(NSString *)SEI userId:(NSString *)userId;
|
||||
|
||||
/*!
|
||||
音频状态改变
|
||||
|
||||
@param stream 流信息
|
||||
@param mute 当前流是否可用
|
||||
@discussion
|
||||
音频状态改变
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room stream:(nullable RCRTCInputStream *)stream didAudioMute:(BOOL)mute;
|
||||
|
||||
/*!
|
||||
视频状态改变
|
||||
|
||||
@param stream 流信息
|
||||
@param enable 当前流是否可用
|
||||
@discussion
|
||||
视频状态改变
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room stream:(nullable RCRTCInputStream *)stream didVideoEnable:(BOOL)enable;
|
||||
|
||||
/*!
|
||||
接收到其他人发送到 room 里的消息
|
||||
|
||||
@param message 消息体, 参考 IMLib 中 RCMessage
|
||||
@discussion
|
||||
接收到其他人发送到 room 里的消息
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didReceiveMessage:(RCMessage *)message;
|
||||
|
||||
/*!
|
||||
如果用户调用 RCRTCEngine 的 setReconnectEnable 关闭 SDK 断线重连,
|
||||
1分钟没有链接上信令服务器, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@param room 离开的房间
|
||||
@discussion
|
||||
如果用户调用 RCRTCEngine 的 setReconnectEnable 关闭 SDK 断线重连,
|
||||
1分钟没有链接上信令服务器, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKickedOutOfTheRoom:(nullable RCRTCRoom *)room
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCEngineEventDelegate.h didKicked:reason: instead");
|
||||
|
||||
/*!
|
||||
如果用户在房间内, 此时收到服务器封禁的通知, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@param room 离开的房间
|
||||
@discussion
|
||||
如果用户在房间内, 此时收到服务器封禁的通知, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKickedOtherRoomByServer:(nullable RCRTCBaseRoom *)room
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCEngineEventDelegate.h didKicked:reason: instead");
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif /* RongRTCRoomDelegate_h */
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// RCRTCOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/8.
|
||||
// Copyright © 2019年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreMedia/CoreMedia.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
本地输出音视频流
|
||||
*/
|
||||
@interface RCRTCOutputStream : RCRTCStream
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// RCRTCProbeStatusForm.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/12/21.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCProbeQualityLevel) {
|
||||
RCRTCProbeQualityLevel_Excellent,
|
||||
RCRTCProbeQualityLevel_Good,
|
||||
RCRTCProbeQualityLevel_Pool,
|
||||
RCRTCProbeQualityLevel_Bad,
|
||||
RCRTCProbeQualityLevel_VeryBad,
|
||||
RCRTCProbeQualityLevel_Down,
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCStreamDirection) {
|
||||
RCRTCStreamDirection_UpLink = 1,
|
||||
RCRTCStreamDirection_DownLink = 2,
|
||||
};
|
||||
|
||||
@class RCRTCBaseStat;
|
||||
/// Add from 5.1.17
|
||||
@interface RCRTCProbeStatusForm : NSObject
|
||||
|
||||
@property (nonatomic, readonly) RCRTCProbeQualityLevel qualityLevel;
|
||||
|
||||
@property (nonatomic, readonly) RCRTCStreamDirection direction;
|
||||
|
||||
@property (nonatomic, readonly) RCRTCBaseStat *stat;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// RCRTCProbeTestDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/12/16.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCProbeStatusForm;
|
||||
|
||||
/// Add from 5.1.17
|
||||
@protocol RCRTCProbeTestDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
汇报探测状态数据
|
||||
*/
|
||||
- (void)didReportProbeForms:(NSArray <RCRTCProbeStatusForm *>*)forms;
|
||||
|
||||
/*!
|
||||
探测完成
|
||||
*/
|
||||
- (void)didRTCProbeComplete;
|
||||
|
||||
/*!
|
||||
探测中断
|
||||
*/
|
||||
- (void)didRTCProbeInterrput:(RCRTCCode)errorCode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// RCRTCProxyInfo.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2022/09/06.
|
||||
// Copyright © 2022 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCProxy : NSObject
|
||||
|
||||
/*!
|
||||
代理地址, 默认值: @"", 非 nil 或非 @"" 时有效
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *host;
|
||||
|
||||
/*!
|
||||
代理地址对应IP, 只读, 不可设置
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *ip;
|
||||
|
||||
/*!
|
||||
代理端口, 默认值: -1, 大于 0 时有效
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger port;
|
||||
|
||||
/*!
|
||||
代理服务登录用户名, 默认值: @""
|
||||
如果需要则填写, 不需要可不填写,
|
||||
userName 与 password 同时非 nil 或非 @"" 时有效
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userName;
|
||||
|
||||
/*!
|
||||
代理服务登录密码, 默认值: @""
|
||||
如果需要则填写, 不需要可不填写,
|
||||
userName 与 password 同时非 nil 或非 @"" 时有效
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *password;
|
||||
|
||||
/*!
|
||||
可通过代理服务连接的协议类型, 默认值: RCRTCProxyOptionsAll, 全支持
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCProxyOptions proxyOption;
|
||||
|
||||
/*!
|
||||
验证设置数据是否有效
|
||||
*/
|
||||
- (BOOL)isValid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// RCRTCRemoteUser.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/9.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "RCRTCInputStream.h"
|
||||
#import "RCRTCUser.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音视频远端用户
|
||||
*/
|
||||
@interface RCRTCRemoteUser : RCRTCUser
|
||||
|
||||
/*!
|
||||
获取该远端用户发布的所有音视频流
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSArray<RCRTCInputStream *> *remoteStreams;
|
||||
|
||||
/*!
|
||||
将一个视频流切换成小码率视频流
|
||||
|
||||
@param streams 要切换的流
|
||||
@param completion 切换是否成功
|
||||
@discussion
|
||||
将一个视频流切换成小码率视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)switchToTinyStream:(nullable NSArray<RCRTCInputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
将一个视频流切换成正常码率视频流
|
||||
|
||||
@param streams 要切换的视频流
|
||||
@param completion 切换是否成功
|
||||
@discussion
|
||||
将一个视频流切换成正常码率视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)switchToNormalStream:(nullable NSArray<RCRTCInputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// RCRemoteVideoView.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2018/12/17.
|
||||
// Copyright © 2018年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCVideoPreviewView.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
⚠️ RCRTCRemoteVideoView 即将废弃 , 请使用RCRTCVideoView
|
||||
|
||||
@discussion deprecated from 5.1.10
|
||||
*/
|
||||
__attribute__((deprecated("Class RCRTCRemoteVideoView is deprecated , use Class RCRTCVideoView instead")))
|
||||
|
||||
@interface RCRTCRemoteVideoView : RCRTCVideoPreviewView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// RCRTCRoom.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCBaseRoom.h"
|
||||
#import "RCRTCRoomEventDelegate.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCLocalUser;
|
||||
@class RCRTCCDNInputStream;
|
||||
|
||||
/*!
|
||||
音视频通话的房间
|
||||
*/
|
||||
@interface RCRTCRoom : RCRTCBaseRoom
|
||||
|
||||
/*!
|
||||
房间事件代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCRoomEventDelegate> delegate;
|
||||
|
||||
/*!
|
||||
当前用户
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCLocalUser *localUser;
|
||||
|
||||
/*!
|
||||
主房间中主播已经加入的副房间Id列表
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) NSArray<NSString *> *otherRoomIdArray;
|
||||
|
||||
/*!
|
||||
远端音频数据(合流)回调
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioDataCallback receivedAudioBufferCallback;
|
||||
|
||||
/*!
|
||||
设置所有远端用户是否静音
|
||||
|
||||
@param mute 是否静音所有远端用户, YES 禁止 NO 允许
|
||||
@discussion
|
||||
将所有远端用户静音, 注: 该功能只是不播放接收到的音频数据
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
- (void)muteAllRemoteAudio:(BOOL)mute;
|
||||
|
||||
/*!
|
||||
获取直播合流数组
|
||||
|
||||
@discussion
|
||||
只要有主播就会存在, 房间内没有主播则为 空数组
|
||||
Added from 5.1.0
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (NSArray<RCRTCInputStream *> *)getLiveStreams;
|
||||
|
||||
/*!
|
||||
获取CDN流
|
||||
|
||||
@discussion
|
||||
只要有房间有cdn流发布
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (nullable RCRTCCDNInputStream *)getCDNStream;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// RCRTCRoomConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/5/21.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCRoomConfig : NSObject
|
||||
|
||||
/*!
|
||||
语音识别源语言
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *srcLanguageCode;
|
||||
|
||||
/*!
|
||||
加入房间场景, 默认值: RCRTCRoomTypeNormal
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCRoomType roomType;
|
||||
|
||||
/*!
|
||||
直播类型,仅在 RCRTCRoomType 为 RCRTCRoomTypeLive 时可用,选择当前为音频直播还是音视频直播, 默认值: RCRTCLiveTypeAudioVideo
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCLiveType liveType;
|
||||
|
||||
/*!
|
||||
直播角色类型,仅在 RCRTCRoomType 为 RCRTCRoomTypeLive 时可用,默认值: RCRTCLiveRoleTypeBroadcaster
|
||||
|
||||
@discussion add from 5.1.0
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCLiveRoleType roleType;
|
||||
|
||||
/*!
|
||||
加入房间类型, 同一 UserID 多端加入房间时的处理类型
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCJoinRoomType joinType;
|
||||
|
||||
/*!
|
||||
设置用户属性
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSDictionary <NSString *, NSString *> *localUserDatas;
|
||||
|
||||
/*!
|
||||
离开房间是否停止混音和短音效,默认值:YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL stopAudioMixer;
|
||||
|
||||
/*!
|
||||
请求超时时间,默认值:30s
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger timeout;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,383 @@
|
||||
//
|
||||
// RCRTCRoomEventDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef RongRTCRoomDelegate_h
|
||||
#define RongRTCRoomDelegate_h
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCRemoteUser;
|
||||
@class RCRTCAudioInputStream;
|
||||
@class RCRTCVideoInputStream;
|
||||
@class RCRTCRoom;
|
||||
@class RCRTCCDNInputStream;
|
||||
@class RCRTCASR;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音视频通话的房间代理, 实现这个代理之后房间成员变化以及资源的变化都会通过代理通知给您
|
||||
*/
|
||||
@protocol RCRTCRoomEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/*!
|
||||
语音识别服务开启通知回调
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReceiveStartASR;
|
||||
|
||||
/*!
|
||||
语音识别服务停止通知回调
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReceiveStopASR;
|
||||
|
||||
/*!
|
||||
语音识别信息回调
|
||||
|
||||
@param asrContent 语音识别信息
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReceiveASRContent:(RCRTCASRContent *)asrContent;
|
||||
|
||||
/*!
|
||||
语音翻译结果回调
|
||||
|
||||
@param content 语音翻译结果
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReceiveRealtimeTranslationContent:(RCRTCRealtimeTranslationContent *)content;
|
||||
|
||||
/*!
|
||||
远端用户加入通知
|
||||
|
||||
@param user 加入的用户信息
|
||||
@discussion
|
||||
有用户加入的回调, 此时 user 不包含任何资源, 只是标记有人加入, 此时无法订阅这个人的流
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didJoinUser:(RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
远端用户离开通知
|
||||
|
||||
@param user 离开的用户
|
||||
@discussion
|
||||
有用户离开时的回调, 当有用户离开的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didLeaveUser:(RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
远端用户切换身份通知
|
||||
|
||||
@param user 切换身份的用户
|
||||
@param roleType 该用户当前的身份
|
||||
|
||||
@discussion
|
||||
有切换身份时的回调,当有用户切换身份的时候,当前房间内其他主播会收到该消息。
|
||||
如果订阅了当前 user 的流,SDK 会主动取消订阅,不需要手动取消订阅。
|
||||
added from 5.1.9
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didSwitchRoleWithUser:(RCRTCRemoteUser *)user roleType:(RCRTCLiveRoleType)roleType;
|
||||
|
||||
|
||||
/*!
|
||||
远端用户掉线通知
|
||||
|
||||
@param user 掉线的用户
|
||||
@discussion
|
||||
有用户掉线时的回调, 当有用户掉线的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didOfflineUser:(RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
第一个视频关键帧到达通知
|
||||
|
||||
@param stream 开始接收数据的 stream
|
||||
@discussion
|
||||
数据流第一个关键帧到达
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportFirstKeyframe:(RCRTCVideoInputStream *)stream
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCRoomEventDelegate.h didReportFirstFrame:mediaType: instead");
|
||||
|
||||
/*!
|
||||
加入房间后, 第一个音频关键帧到达通知
|
||||
|
||||
@param stream 开始接收数据的 stream
|
||||
@discussion
|
||||
数据流第一个关键帧到达
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportFirstAudioFrame:(RCRTCAudioInputStream *)stream
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCRoomEventDelegate.h didReportFirstFrame:mediaType: instead");
|
||||
|
||||
/*!
|
||||
订阅远端资源成功后, 音频或视频首帧到达通知
|
||||
|
||||
@param stream 开始接收数据的 stream
|
||||
@param mediaType 数据流类型(如视频流、音频流)
|
||||
@discussion
|
||||
数据流第一个关键帧到达
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportFirstFrame:(RCRTCInputStream *)stream mediaType:(RCRTCMediaType)mediaType;
|
||||
|
||||
/*!
|
||||
远端用户发布资源通知
|
||||
|
||||
@param streams 用户发布的资源信息
|
||||
@discussion
|
||||
当有远端用户发布资源时, 通过此方法回调通知上报该用户发布的流, 其中流中有 userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息, 可调用订阅接口, 订阅其中的流
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didPublishStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
远端用户取消发布资源通知
|
||||
|
||||
@param streams 取消发布资源
|
||||
@discussion
|
||||
当有远端用户取消发布资源时, 通过此方法回调, SDK 默认会取消订阅这些流, 其中流中有 userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息, APP 可根据这些关键信息自定义化, 无需再次调用取消订阅接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didUnpublishStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
远端直播合流发布资源通知
|
||||
|
||||
@param streams 发布的直播资源
|
||||
@discussion
|
||||
当直播存在的时候(只要有一个主播存在),直播合流就存在,代理会通知到用户liveStreams已经发布
|
||||
用户可以使用RCRTCLocal.h 里面的 subscribeStream:tinyStreams:completion: api去订阅.
|
||||
Added from 5.1.0
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didPublishLiveStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
远端直播合流取消发布资源通知
|
||||
|
||||
@param streams 取消发布的直播资源
|
||||
@discussion
|
||||
当房间内没有任何主播在发布资源的时候, 直播的合流就不存在了,
|
||||
代理会通知到用户liveStreams已经取消发布,sdk内部会主动取消订阅一次,用户也可以进行一次取消订阅合流.
|
||||
Added from 5.1.0
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didUnpublishLiveStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
远端CDN流发布资源通知
|
||||
|
||||
@param stream 发布的CDN资源
|
||||
@discussion
|
||||
Added from 5.1.5
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didPublishCDNStream:(RCRTCCDNInputStream *)stream;
|
||||
|
||||
/*!
|
||||
远端CDN流取消发布资源通知
|
||||
|
||||
@param stream 取消发布的CDN资源
|
||||
@discussion
|
||||
Added from 5.1.5
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didUnpublishCDNStream:(RCRTCCDNInputStream *)stream;
|
||||
|
||||
/*!
|
||||
接收到远端用户发送的 SEI 通知
|
||||
|
||||
@param SEI sei 数据
|
||||
@param userId 用户id
|
||||
@discussion 监听远端用户发送的 SEI 内容,通过 userId 区分。
|
||||
Added from 5.2.5
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReceiveSEI:(NSString *)SEI userId:(NSString *)userId;
|
||||
|
||||
/*!
|
||||
观众接收到合流 SEI 通知
|
||||
|
||||
@param SEI sei 数据
|
||||
@discussion 观众角色订阅 liveStreams 后,该回调会接收以下两种类型的数据。
|
||||
1.mcu server 会主动通过该接口回调主播合流布局的信息 {"mcuRoomState":"xxx"}
|
||||
2.如果远端主播有发送 SEI,可以通过此回调接收数据。
|
||||
Added from 5.2.5
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReceiveLiveStreamSEI:(NSString *)SEI;
|
||||
|
||||
/*!
|
||||
接收到其他人发送到 room 里的消息
|
||||
|
||||
@param message 消息体, 参考 IMLib 中 RCMessage
|
||||
@discussion
|
||||
接收到其他人发送到 room 里的消息
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReceiveMessage:(RCMessage *)message;
|
||||
|
||||
/*!
|
||||
如果用户调用 RCRTCEngine 的 setReconnectEnable 关闭 SDK 断线重连, 1分钟没有链接上信令服务器, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@param room 离开的房间
|
||||
@discussion
|
||||
如果用户调用 RCRTCEngine 的 setReconnectEnable 关闭 SDK 断线重连, 1分钟没有链接上信令服务器, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
@deprecated from 5.1.0
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKickedOutOfTheRoom:(RCRTCRoom *)room
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCEngineEventDelegate.h didKicked instead");
|
||||
|
||||
/*!
|
||||
被服务端踢下线通知
|
||||
|
||||
@param room 离开的房间
|
||||
@discussion
|
||||
如果用户在房间内, 此时收到服务器封禁的通知, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
@deprecated from 5.1.0
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKickedByServer:(RCRTCBaseRoom *)room
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCEngineEventDelegate.h didKicked instead");
|
||||
|
||||
/*!
|
||||
远端用户音频静默改变通知
|
||||
|
||||
@param stream 流信息
|
||||
@param mute 当前流是否可用
|
||||
@discussion
|
||||
音频状态改变
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)stream:(RCRTCInputStream *)stream didAudioMute:(BOOL)mute;
|
||||
|
||||
/*!
|
||||
远端用户视频静默改变通知
|
||||
|
||||
@param stream 流信息
|
||||
@param enable 当前流是否可用
|
||||
@discussion
|
||||
视频状态改变
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)stream:(RCRTCInputStream *)stream didVideoEnable:(BOOL)enable;
|
||||
|
||||
#pragma mark - 邀请跨房间连麦
|
||||
/*!
|
||||
其他房间邀请人调用 RCRTCLocalUser 类中 requestJoinOtherRoom:userId:autoMix:extra:completion: 方法,
|
||||
定向发起连麦邀请后, 被邀请人收到的回调, 其他非被邀请人不会收到此回调
|
||||
|
||||
@param inviterRoomId 邀请人所在房间号
|
||||
@param inviterUserId 邀请人的用户Id
|
||||
@param extra 自定义扩展信息, 邀请人发起邀请时填写的自定义扩展信息
|
||||
@discussion
|
||||
其他房间邀请人定向发起连麦邀请后, 被邀请人收到的回调, 其他非被邀请人不会收到此回调
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didRequestJoinOtherRoom:(NSString *)inviterRoomId
|
||||
inviterUserId:(nullable NSString *)inviterUserId
|
||||
extra:(nullable NSString *)extra;
|
||||
|
||||
/*!
|
||||
其他房间邀请人调用 RCRTCLocalUser 类中 cancelRequestJoinOtherRoom:userId:extra:completion: 方法,
|
||||
取消之前发起的连麦邀请后, 被邀请人收到的回调, 其他非被邀请人不会收到此回调
|
||||
|
||||
@param inviterRoomId 邀请人所在房间号
|
||||
@param inviterUserId 邀请人的用户Id
|
||||
@param extra 自定义扩展信息, 邀请人取消邀请时填写的自定义扩展信息
|
||||
@discussion
|
||||
其他房间邀请人取消之前发起的连麦邀请后, 被邀请人收到的回调, 其他非被邀请人不会收到此回调
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didCancelRequestOtherRoom:(NSString *)inviterRoomId
|
||||
inviterUserId:(nullable NSString *)inviterUserId
|
||||
extra:(nullable NSString *)extra;
|
||||
|
||||
/*!
|
||||
被邀请人调用 RCRTCLocalUser 类中 responseJoinOtherRoom:userId:agree:autoMix:extra:completion: 方法,
|
||||
被邀请人应答同意连麦邀请后, 邀请人及其房间中其他非观众用户收到的回调
|
||||
被邀请人应答拒绝连麦邀请后, 只有邀请人收到的回调, 其他用户不会收到此回调
|
||||
|
||||
@param inviterRoomId 邀请人所在房间号
|
||||
@param inviterUserId 邀请人的用户Id
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人的用户Id
|
||||
@param agree 被邀请人同意/拒绝
|
||||
@param extra 自定义扩展信息, 被邀请人应答时填写的自定义扩展信息
|
||||
@discussion
|
||||
被邀请人应答同意连麦邀请后, 邀请人及其房间中其他非观众用户收到的回调
|
||||
被邀请人应答拒绝连麦邀请后, 只有邀请人收到的回调, 其他用户不会收到此回调
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didResponseJoinOtherRoom:(nullable NSString *)inviterRoomId
|
||||
inviterUserId:(nullable NSString *)inviterUserId
|
||||
inviteeRoomId:(nullable NSString *)inviteeRoomId
|
||||
inviteeUserId:(nullable NSString *)inviteeUserId
|
||||
agree:(BOOL)agree
|
||||
extra:(nullable NSString *)extra;
|
||||
|
||||
/*!
|
||||
结束连麦用户在调用 RCRTCEngine 类中 leaveOtherRoom:notifyFinished:completion: 方法时,
|
||||
如果将 notifyFinished 对应的参数填写为 YES, 正在跨房间连麦的所有用户将会收到此回调, 否则不会收到此回调
|
||||
|
||||
@param roomId 结束连麦用户所在房间号
|
||||
@param userId 结束连麦用户Id
|
||||
@discussion
|
||||
结束连麦用户在调用 leaveOtherRoom:notifyFinished:completion: 方法时,
|
||||
如果将 notifyFinished 对应的参数填写为 YES, 正在跨房间连麦的所有用户将会收到此回调, 否则不会收到此回调
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didFinishOtherRoom:(NSString *)roomId userId:(NSString *)userId;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif /* RongRTCRoomDelegate_h */
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// RCRTCScreenShareOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/8/24.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RongRTCLib/RongRTCLib.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/*
|
||||
Added from 5.1.8
|
||||
*/
|
||||
@interface RCRTCScreenShareOutputStream : RCRTCVideoOutputStream
|
||||
|
||||
/*!
|
||||
音频数据回调
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioFrameCallback audioDataCallback;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initVideoOutputStreamWithTag:(NSString *)tag NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// RCRTCStatusForm.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/5/30.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCGlobals.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCStreamStat.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
RONGRTCLIB_EXTERN NSString *const RongRTCMediaTypeVideo;
|
||||
RONGRTCLIB_EXTERN NSString *const RongRTCMediaTypeAudio;
|
||||
|
||||
typedef NS_ENUM(NSInteger, RongRTCStreamState) { Equivocal = -1, Disabled = 0, Enabled = 1 };
|
||||
|
||||
/*!
|
||||
sdk 状态统计表
|
||||
*/
|
||||
@interface RCRTCStatusForm : NSObject
|
||||
|
||||
/*!
|
||||
cpu 使用率
|
||||
*/
|
||||
@property (nonatomic, readonly) float cpuUsage;
|
||||
|
||||
/*!
|
||||
上行码率
|
||||
*/
|
||||
@property (nonatomic, readonly) float totalSendBitRate;
|
||||
|
||||
/*!
|
||||
下行码率
|
||||
*/
|
||||
@property (nonatomic, readonly) float totalRecvBitRate;
|
||||
|
||||
/*!
|
||||
系统 cpu 使用率
|
||||
*/
|
||||
@property (nonatomic, readonly) float cpuUsageOfOS;
|
||||
|
||||
/*!
|
||||
网络类型,wlan 4g
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *networkType;
|
||||
|
||||
/*!
|
||||
往返时间
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger rtt;
|
||||
|
||||
/*!
|
||||
ip 地址
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *ipAddress;
|
||||
|
||||
/*!
|
||||
可接收带宽
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger availableReceiveBandwidth;
|
||||
|
||||
/*!
|
||||
可发送带宽
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger availableSendBandwidth;
|
||||
|
||||
/*!
|
||||
发送端丢包数
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger packetsDiscardedOnSend;
|
||||
|
||||
/*!
|
||||
上行 媒体流状态统计 数组
|
||||
*/
|
||||
@property (nonatomic, readonly) NSArray<RCRTCStreamStat *> *sendStats;
|
||||
|
||||
/*!
|
||||
下行 媒体流状态统计 数组
|
||||
*/
|
||||
@property (nonatomic, readonly) NSArray<RCRTCStreamStat *> *recvStats;
|
||||
|
||||
/*!
|
||||
通过 trackId 查找到此 Track 所属的 UserId
|
||||
*/
|
||||
+ (NSString *)fetchUserIdFromTrackId:(NSString *)trackId
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCStreamStat userId property instead");
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// RCRTCStatusReportDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/6/12.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCStatusForm;
|
||||
@class RCRTCLiveAudioStatus;
|
||||
|
||||
@protocol RCRTCStatusReportDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
汇报 SDK 状态数据
|
||||
|
||||
@param form 状态表单对象
|
||||
@discussion
|
||||
汇报 SDK 状态数据
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportStatusForm:(RCRTCStatusForm *)form;
|
||||
|
||||
@optional
|
||||
/*!
|
||||
汇报直播音频合流音声状态
|
||||
|
||||
@param audioStatus 音频流声音状态
|
||||
@discussion
|
||||
当前用户订阅了直播音频合流,汇报合流声音状态,例如当前音频合流有 A B C 三个主播的声音,
|
||||
此时 A 在发声,audioStatus 数组里面就会上报 A 的 audioLevel [0 ~ 9]
|
||||
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportLiveAudioStatus:(NSArray <RCRTCLiveAudioStatus *>*)audioStatus;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// RCRTCStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/5/18.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音视频流
|
||||
*/
|
||||
@interface RCRTCStream : NSObject
|
||||
|
||||
/*!
|
||||
媒体流 ID
|
||||
*/
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *streamId;
|
||||
|
||||
/*!
|
||||
媒体流类型
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) RCRTCMediaStreamType mediaStreamType;
|
||||
|
||||
/*!
|
||||
媒体类型
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) RCRTCMediaType mediaType;
|
||||
|
||||
/*!
|
||||
媒体流扩展标识符
|
||||
*/
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *tag;
|
||||
|
||||
/*!
|
||||
媒体流所属的用户 ID
|
||||
*/
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *userId;
|
||||
|
||||
/*!
|
||||
媒体流资源状态
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) RCRTCResourceState resourceState;
|
||||
|
||||
/*!
|
||||
媒体流禁用状态
|
||||
注:
|
||||
1. 对于远端流(输入流),只是不解码视频与音频,但是音视频数据是正常接收的,如果不想接收数据可以进行取消订阅远端流
|
||||
2. 对于本地流(输出流),不编码和发送音视频数据,不影响采集。
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) BOOL isMute;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// RCRTCStreamStat.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/12/27.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCBaseStat.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCStreamStat : RCRTCBaseStat
|
||||
/*!
|
||||
trackId
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *trackId DEPRECATED_MSG_ATTRIBUTE("use streamId property instead");
|
||||
|
||||
/*!
|
||||
流Id
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *streamId;
|
||||
|
||||
/*!
|
||||
用户Id
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *userId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// RCRTCStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/2.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
列席会议的成员信息
|
||||
*/
|
||||
@interface RCRTCUser : NSObject
|
||||
|
||||
/*!
|
||||
请勿调用初始化方法
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
请勿调用初始化方法
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
用户 ID
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *userId;
|
||||
|
||||
/*!
|
||||
用户扩展信息
|
||||
*/
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *extra;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// RCRTCVideoConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCVideoExtend.h"
|
||||
#import "RCRTCVideoLayout.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCVideoConfig : NSObject
|
||||
|
||||
/*!
|
||||
视频大流配置
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCVideoLayout *videoLayout;
|
||||
|
||||
/*!
|
||||
视频小流配置
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCVideoLayout *tinyVideoLayout;
|
||||
|
||||
/*!
|
||||
视频扩展配置
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCVideoExtend *videoExtend;
|
||||
|
||||
/*!
|
||||
合流布局背景色
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *backgroundColor;
|
||||
|
||||
/*!
|
||||
设置合流布局背景色
|
||||
|
||||
@param red 取值范围: 0 ~ 255
|
||||
@param green 取值范围: 0 ~ 255
|
||||
@param blue 取值范围: 0 ~ 255
|
||||
@discussion
|
||||
此方法与 setBackgroundColor: 二选一使用, 效果相同
|
||||
如果两个方法都使用, 将以最后一次设置为准
|
||||
*/
|
||||
- (BOOL)setBackgroundColorWithRed:(NSUInteger)red green:(NSUInteger)green blue:(NSUInteger)blue;
|
||||
|
||||
/*!
|
||||
设置合流布局背景色
|
||||
|
||||
@param backgroundColor 取值范围: 0x000000 ~ 0xffffff
|
||||
@discussion
|
||||
此方法与 setBackgroundColorWithRed:green:blue: 二选一使用, 效果相同
|
||||
如果两个方法都使用, 将以最后一次设置为准
|
||||
*/
|
||||
- (BOOL)setBackgroundColor:(NSUInteger)backgroundColor;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// RCRTCVideoExtend.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoRenderMode) {
|
||||
/*!
|
||||
自适应裁剪
|
||||
*/
|
||||
RCRTCVideoRenderModeCrop = 1,
|
||||
/*!
|
||||
填充
|
||||
*/
|
||||
RCRTCVideoRenderModeWhole = 2
|
||||
};
|
||||
|
||||
@interface RCRTCVideoExtend : NSObject
|
||||
|
||||
/*!
|
||||
本地输出视频流的裁剪模式
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCVideoRenderMode renderMode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// RCRTCVideoFrame.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/11/22.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
视频帧数据
|
||||
*/
|
||||
@interface RCRTCVideoFrame : NSObject
|
||||
|
||||
/*!
|
||||
视频帧格式
|
||||
*/
|
||||
@property (nonatomic, readonly) RCRTCVideoFrameFormat format;
|
||||
|
||||
/*!
|
||||
视频宽度,单位为像素
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger width;
|
||||
|
||||
/*!
|
||||
视频高度,单位为像素
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger height;
|
||||
|
||||
/*!
|
||||
储存视频 buffer 对象
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) CVPixelBufferRef pixelBuffer;
|
||||
|
||||
/*!
|
||||
视频原始数据
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSData *data;
|
||||
|
||||
/*!
|
||||
旋转角度,0,90,180,270 顺时针
|
||||
*/
|
||||
@property (nonatomic, readonly) int rotation;
|
||||
|
||||
/*!
|
||||
显示时间戳,单位为纳秒
|
||||
*/
|
||||
@property (nonatomic, readonly) int64_t timeStampNs;
|
||||
|
||||
/*!
|
||||
初始化视频帧数据
|
||||
|
||||
@param pixelBuffer 储存视频 buffer 对象, 只支持 NV12(420f) 或者 BGRA 格式视频
|
||||
@param timeStampNs 显示时间戳,单位为纳秒
|
||||
@param rotation 旋转角度,0,90,180,270
|
||||
|
||||
@return 视频帧数据
|
||||
@discussion SDK 内部会持有 pixelBuffer,所以使用者生成的 pixelBuffer 需要 CVBufferRelease()
|
||||
*/
|
||||
- (nullable instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
|
||||
timeStampNs:(int64_t)timeStampNs
|
||||
rotation:(int)rotation;
|
||||
|
||||
/*!
|
||||
初始化视频帧数据
|
||||
|
||||
@param sampleBuffer 储存视频 buffer 对象, 只支持 NV12(420f) 或者 BGRA 格式视频
|
||||
@param rotation 旋转角度,0,90,180,270
|
||||
|
||||
@return 视频帧数据
|
||||
@discussion SDK 内部会持有 sampleBuffer,所以使用者生成的 sampleBuffer 需要 CFRelease()
|
||||
*/
|
||||
- (nullable instancetype)initWithSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||
rotation:(int)rotation;
|
||||
|
||||
/*!
|
||||
转码视频数据
|
||||
|
||||
@param pixelBuffer 转码后保存视频数据的buffer
|
||||
|
||||
@discussion
|
||||
注意:
|
||||
1.需要确保传入 CVPixelBufferRef 的宽高和 RCRTCVideoFrame 的宽高一致,否则会放弃转码。
|
||||
2.请传入一个 NV12 或者 BGRA 格式的 CVPixelBufferRef, 否则会放弃转码。
|
||||
|
||||
added from 5.1.15
|
||||
*/
|
||||
- (void)convertToPixelBuffer:(CVPixelBufferRef)pixelBuffer;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// RCRTCVideoInputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/6/1.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCInputStream.h"
|
||||
#import "RCRTCDrawer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCVideoInputStream;
|
||||
/*!
|
||||
接收到视频流的代理
|
||||
*/
|
||||
DEPRECATED_MSG_ATTRIBUTE("please use RCRTCInputStream.h RCRTCVideoInputStreamEventDelegate instead")
|
||||
@protocol RCRTCVideoInputStreamDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
即将渲染视频帧的数据回调
|
||||
|
||||
@param ref 即将渲染的视频帧数据
|
||||
@param stream 即将渲染的视频帧数据所属接收到的流
|
||||
@discussion
|
||||
即将渲染视频帧数据, 如果需要自定义视频显示的话需要修改该视频帧
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)willRenderCVPixelBufferRef:(CVPixelBufferRef)ref stream:(RCRTCInputStream *)stream;
|
||||
@end
|
||||
|
||||
|
||||
/*!
|
||||
接收到视频流事件的代理
|
||||
*/
|
||||
@protocol RCRTCVideoInputStreamEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/*!
|
||||
视频数据大小发生变化回调
|
||||
|
||||
@param stream 流信息
|
||||
@param size 流变化后的宽高
|
||||
|
||||
@discussion
|
||||
回调给流size的数据变化
|
||||
|
||||
@remarks 代理
|
||||
added from 5.1.14
|
||||
*/
|
||||
- (void)inputVideoStream:(RCRTCVideoInputStream *)stream didChangedFrameSize:(CGSize)size;
|
||||
|
||||
/*!
|
||||
视频数据方向发生变化回调
|
||||
|
||||
@param stream 流信息
|
||||
@param rotation 0、90、180、270
|
||||
|
||||
@discussion
|
||||
回调给流方向的数据变化
|
||||
|
||||
@remarks 代理
|
||||
added from 5.1.14
|
||||
*/
|
||||
- (void)inputVideoStream:(RCRTCVideoInputStream *)stream didChangedRotation:(NSInteger)rotation;
|
||||
|
||||
/*!
|
||||
即将渲染视频帧的数据回调
|
||||
|
||||
@param videoFrame 即将渲染的视频帧数据
|
||||
@param stream 即将渲染的视频帧数据所属接收到的流
|
||||
@discussion
|
||||
即将渲染视频帧数据,如果修改该视频帧,会影响本地渲染远端用户的视频帧,不支持修改数据格式
|
||||
|
||||
@remarks 代理
|
||||
added from 5.1.14
|
||||
*/
|
||||
- (void)inputVideoStream:(RCRTCVideoInputStream *)stream willRenderVideoFrame:(nullable RCRTCVideoFrame *)videoFrame;
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
接收到的视频流
|
||||
*/
|
||||
@interface RCRTCVideoInputStream : RCRTCInputStream
|
||||
|
||||
/*!
|
||||
接收到视频流事件的代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCVideoInputStreamEventDelegate> streamEventDelegate;
|
||||
|
||||
/*!
|
||||
接收到的视频流代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCVideoInputStreamDelegate> delegate DEPRECATED_MSG_ATTRIBUTE(
|
||||
"please use RCRTCVideoInputStream.h streamEventDelegate instead");
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCVideoInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCVideoInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
设置视频流的渲染视图
|
||||
|
||||
@param view 渲染视图 RCRTCVideoView 对象
|
||||
@discussion
|
||||
接受到远端用户的视频流,然后设置视频流的渲染视图,就可以渲染出远端视频
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoView:(nullable id<RCRTCDrawer>)view;
|
||||
|
||||
/*!
|
||||
设置视频流的渲染纹理视图
|
||||
|
||||
@param view 渲染纹理视图
|
||||
@discussion
|
||||
接受到远端用户的视频流,然后设置视频流的渲染纹理视图,就可以渲染出远端视频
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoTextureView:(nullable RCRTCVideoTextureView *)view;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// RCRTCVideoLayout.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCVideoLayout : NSObject
|
||||
|
||||
/*!
|
||||
输出视频合流宽度
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger width;
|
||||
|
||||
/*!
|
||||
输出视频合流高度
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger height;
|
||||
|
||||
/*!
|
||||
输出视频合流帧率
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger fps;
|
||||
|
||||
/*!
|
||||
输出视频合流码率
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger bitrate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,226 @@
|
||||
//
|
||||
// RCRTCVideoOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/6/2.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCOutputStream.h"
|
||||
#import "RCRTCVideoSourceInterface.h"
|
||||
#import "RCRTCDrawer.h"
|
||||
@class RCRTCVideoView;
|
||||
@class RCRTCVideoTextureView;
|
||||
@class RCRTCVideoOutputStream;
|
||||
@class RCRTCVideoFrame;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCVideoStreamConfig;
|
||||
|
||||
/*!
|
||||
接收到视频流事件的代理
|
||||
*/
|
||||
@protocol RCRTCVideoOutputStreamEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/*!
|
||||
视频数据大小发生变化回调
|
||||
|
||||
@param stream 流信息
|
||||
@param size 流变化后的宽和高
|
||||
|
||||
@discussion
|
||||
回调给流size的数据变化
|
||||
|
||||
@remarks 代理
|
||||
added from 5.1.14
|
||||
*/
|
||||
- (void)outputVideoStream:(RCRTCVideoOutputStream *)stream didChangedFrameSize:(CGSize)size;
|
||||
|
||||
/*!
|
||||
视频数据方向发生变化回调
|
||||
|
||||
@param stream 流信息
|
||||
@param rotation 0、90、180、270
|
||||
|
||||
@discussion
|
||||
回调给流方向的数据变化
|
||||
|
||||
@remarks 代理
|
||||
added from 5.1.14
|
||||
*/
|
||||
- (void)outputVideoStream:(RCRTCVideoOutputStream *)stream didChangedRotation:(NSInteger)rotation;
|
||||
|
||||
/*!
|
||||
采集视频数据回调
|
||||
|
||||
@param videoFrame 采集的视频数据,类型为 RCRTCVideoFrameFormatNV12
|
||||
@param stream 采集的视频帧数据所属接收到的流
|
||||
@discussion
|
||||
采集的视频数据,如果修改该视频帧,会影响本地渲染和编码发送的视频帧数据,不支持修改数据格式
|
||||
|
||||
@remarks 代理
|
||||
added from 5.2.3
|
||||
*/
|
||||
- (void)outputVideoStream:(RCRTCVideoOutputStream *)stream captureVideoFrame:(nullable RCRTCVideoFrame *)videoFrame;
|
||||
|
||||
/*!
|
||||
即将渲染视频帧的数据回调
|
||||
|
||||
@param videoFrame 即将渲染的视频帧数据,类型为 RCRTCVideoFrameFormatI420
|
||||
@param stream 即将渲染的视频帧数据所属接收到的流
|
||||
@discussion
|
||||
即将渲染视频帧数据,如果修改该视频帧,会影响本地视频渲染,不支持修改数据格式
|
||||
|
||||
@remarks 代理
|
||||
added from 5.1.14
|
||||
*/
|
||||
- (void)outputVideoStream:(RCRTCVideoOutputStream *)stream willRenderVideoFrame:(nullable RCRTCVideoFrame *)videoFrame;
|
||||
|
||||
/*!
|
||||
即将编码发送的视频帧数据回调
|
||||
|
||||
@param videoFrame 即将编码发送的视频帧数据,类型为 RCRTCVideoFrameFormatI420
|
||||
@param stream 即将编码发送的视频帧数据所属接收到的流
|
||||
@discussion
|
||||
即将编码发送的视频帧数据,如果修改该视频帧,会影响发送出去的视频帧,不支持修改数据格式
|
||||
|
||||
@remarks 代理
|
||||
added from 5.2.1
|
||||
*/
|
||||
- (void)outputVideoStream:(RCRTCVideoOutputStream *)stream willEncodeVideoFrame:(nullable RCRTCVideoFrame *)videoFrame;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
视频数据写入接口
|
||||
*/
|
||||
@protocol RCRTCVideoObserverInterface <NSObject>
|
||||
|
||||
/*!
|
||||
写入媒体流
|
||||
|
||||
@param videoFrame 媒体数据
|
||||
@param error 失败时返回的相关描述
|
||||
@discussion 写入媒体流, 该方法会直接将视频数据进行视频编码并发送至远端
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)writeVideoFrame:(RCRTCVideoFrame *)videoFrame error:(NSError **)error;
|
||||
|
||||
/*!
|
||||
写入媒体流
|
||||
|
||||
@param videoFrame 媒体数据
|
||||
@param mirror 视频数据是否镜像发送
|
||||
@param error 失败时返回的相关描述
|
||||
@discussion 写入媒体流, 该方法会直接将视频数据进行视频编码并发送至远端
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)writeVideoFrame:(RCRTCVideoFrame *)videoFrame mirror:(BOOL)mirror error:(NSError **)error;
|
||||
|
||||
|
||||
- (void)write:(CMSampleBufferRef)sample
|
||||
error:(NSError **)error DEPRECATED_MSG_ATTRIBUTE("use writeVideoFrame:error: instead");
|
||||
- (void)write:(CMSampleBufferRef)sample
|
||||
mirror:(BOOL)mirror
|
||||
error:(NSError **)error DEPRECATED_MSG_ATTRIBUTE("use writeVideoFrame:mirror:error: instead");
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCVideoOutputStream : RCRTCOutputStream <RCRTCVideoObserverInterface>
|
||||
|
||||
/**
|
||||
本地视频配置
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCVideoStreamConfig *videoConfig;
|
||||
|
||||
/**
|
||||
输出视频源
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCVideoSourceInterface> videoSource;
|
||||
|
||||
@property (atomic, copy, nullable) RCRTCVideoFrameCallback videoFrameSendCallback DEPRECATED_MSG_ATTRIBUTE("use RCRTCVideoOutputStream.h outputVideoStream:willEncodeVideoFrame: instead");
|
||||
|
||||
@property (atomic, copy, nullable) RCRTCVideoCMSampleBufferCallback videoSendBufferCallback DEPRECATED_MSG_ATTRIBUTE("use RCRTCVideoOutputStream.h outputVideoStream:willEncodeVideoFrame: instead");
|
||||
|
||||
/*!
|
||||
接收到视频流事件的代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCVideoOutputStreamEventDelegate> streamEventDelegate;
|
||||
|
||||
/*!
|
||||
初始化视频流数据并设置标签
|
||||
|
||||
@param tag 用户自定标签,注:用户不能传特殊字符,只支持 ASCII
|
||||
@discussion
|
||||
初始化流数据的参数
|
||||
|
||||
@remarks 资源管理
|
||||
@return 流对象
|
||||
*/
|
||||
- (instancetype)initVideoOutputStreamWithTag:(NSString *)tag;
|
||||
|
||||
/*!
|
||||
设置视频流的渲染视图
|
||||
|
||||
@param view 渲染界面,传空则将原视图删除
|
||||
@discussion
|
||||
设置视频媒体数据的渲染界面
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setVideoView:(nullable id<RCRTCDrawer>)view;
|
||||
|
||||
/*!
|
||||
设置视频媒体数据的渲染纹理界面
|
||||
|
||||
@param view 渲染纹理界面,传空则将原视图删除
|
||||
@discussion
|
||||
设置视频媒体数据的渲染纹理界面
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setVideoTextureView:(nullable RCRTCVideoTextureView *)view;
|
||||
|
||||
/*!
|
||||
设置视频源
|
||||
|
||||
@param source 视频源
|
||||
@discussion
|
||||
设置视频源,如果使用者需要自定义视频流的话,需要实现 RCRTCVideoSourceInterface 协议,视频源中通过调用 RCRTCVideoOutputStream 的 write 方法写入视频数据
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setVideoSource:(nullable id<RCRTCVideoSourceInterface>)source;
|
||||
|
||||
#pragma mark - 水印
|
||||
|
||||
/*!
|
||||
设置水印
|
||||
|
||||
@param image 水印图片,如果该参数为 nil,则移除水印
|
||||
@param position 水印位置尺寸
|
||||
|
||||
@return 水印是否设置成功
|
||||
|
||||
@discussion Added from 5.1.15
|
||||
position 范围 0 ~ 1, 左上角为原点,
|
||||
x:水印的坐标,取值范围为0 ~ 1的浮点数。
|
||||
y:水印的坐标,取值范围为0 ~ 1的浮点数。
|
||||
width:水印的宽度,取值范围为0 ~ 1的浮点数。
|
||||
height:不用设置,内部会根据水印图片的宽高比自动计算一个合适的高度。
|
||||
|
||||
例如:当前视频的编码分辨率是 640 × 480 ,且 position 设置为(0.1,0.1,0.2,0.0)
|
||||
那么水印的左上坐标点就是(480 × 0.1,640 × 0.1)即(48,64)
|
||||
水印的宽度是 480 × 0.2 = 96px,水印的高度会根据水印图片的宽高比由 SDK 自动算出。
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
- (BOOL)setWaterMark:(nullable UIImage *)image position:(CGRect)position;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// RCVideoPreview.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2018/12/17.
|
||||
// Copyright © 2018年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RCRTCVideoView.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
⚠️ RCRTCVideoPreviewView 即将废弃 , 请使用RCRTCVideoView
|
||||
|
||||
@discussion deprecated from 5.1.10
|
||||
*/
|
||||
__attribute__((deprecated("Class RCRTCVideoPreviewView is deprecated , use Class RCRTCVideoView instead")))
|
||||
|
||||
@interface RCRTCVideoPreviewView : RCRTCVideoView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// RCRTCVideoSourceInterface.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/6/4.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol RCRTCVideoObserverInterface;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
视频数据源接口
|
||||
*/
|
||||
@protocol RCRTCVideoSourceInterface <NSObject>
|
||||
|
||||
/**
|
||||
视频流接口,RCRTCVideoOutputStream 实现了该接口,使用者可以通过 write 方法往视频输出流里写入视频数据
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCVideoObserverInterface> observer;
|
||||
|
||||
/*!
|
||||
初始化回调
|
||||
|
||||
@discussion
|
||||
调用 RCRTCVideoOutputStream 中 setVideoSource 方法成功,SDK 会通过 didInit 进行回调通知,接口实现类可以进行视频数据源的初始化工作
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)didInit;
|
||||
|
||||
/*!
|
||||
开始回调
|
||||
|
||||
@discussion
|
||||
发布 RCRTCVideoOutputStream 成功,SDK 会通过 didStart 进行回调通知,接口实现类可以进行视频数据采集
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)didStart;
|
||||
|
||||
/*!
|
||||
停止回调
|
||||
|
||||
@discussion
|
||||
取消发布 RCRTCVideoOutputStream,SDK 会通过 didStop 进行回调通知,接口实现类可以停止视频数据采集
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)didStop;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// RCRTCVideoStreamConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/10.
|
||||
// Copyright © 2019年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <CoreMedia/CoreMedia.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
视频采集器参数
|
||||
*/
|
||||
@interface RCRTCVideoStreamConfig : NSObject
|
||||
|
||||
/*!
|
||||
视频发送的分辨率
|
||||
默认: RCRTCVideoSizePreset640x480
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCVideoSizePreset videoSizePreset;
|
||||
|
||||
/*!
|
||||
视频发送的帧率
|
||||
默认: 15 FPS
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCVideoFPS videoFps;
|
||||
|
||||
/*!
|
||||
视频发送的最大码率
|
||||
默认 640x480 分辨率时, 默认: 1000 kbps,如果外部修改过该值,使用修改的值
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger maxBitrate;
|
||||
|
||||
/*!
|
||||
视频发送的最小码率
|
||||
默认 640x480 分辨率时, 默认: 350 kbps,如果外部修改过该值,使用修改的值
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger minBitrate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// RCRTCVideoTextureView.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/10/21.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCDrawer.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCRTCVideoTextureViewDelegate <NSObject>
|
||||
|
||||
- (void)changeSize:(int)width height:(int)height;
|
||||
|
||||
- (void)changeRotation:(int)rotation;
|
||||
|
||||
- (void)firstFrameRendered;
|
||||
|
||||
- (void)frameRendered;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCVideoTextureView : NSObject <RCRTCDrawer>
|
||||
|
||||
@property (nonatomic, weak, nullable) id<RCRTCVideoTextureViewDelegate> textureViewDelegate;
|
||||
|
||||
- (CVPixelBufferRef)pixelBufferRef;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// RCRTCVideoUnityView.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCDrawer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RTCUnityVideoFrame : NSObject
|
||||
|
||||
@property (nonatomic, readonly) int width;
|
||||
@property (nonatomic, readonly) int height;
|
||||
@property (nonatomic, readonly, nullable) const uint8_t *dataY;
|
||||
@property (nonatomic, readonly, nullable) const uint8_t *dataU;
|
||||
@property (nonatomic, readonly, nullable) const uint8_t *dataV;
|
||||
@property (nonatomic, readonly) int strideY;
|
||||
@property (nonatomic, readonly) int strideU;
|
||||
@property (nonatomic, readonly) int strideV;
|
||||
|
||||
- (void)clear;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCVideoUnityView : NSObject <RCRTCDrawer>
|
||||
|
||||
- (nullable RTCUnityVideoFrame *)getCurrentFrame;
|
||||
|
||||
- (NSInteger)getBufferLength;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// RCRTCVideoView.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/4/19.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCDrawer.h"
|
||||
|
||||
@protocol RCRTCVideoViewEventDelegate;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
视图渲染类
|
||||
|
||||
@discussion add from 5.1.10
|
||||
*/
|
||||
@interface RCRTCVideoView : UIView <RCRTCDrawer>
|
||||
|
||||
/*!
|
||||
修改 Frame 时,是否使用动画,默认:YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL frameAnimated;
|
||||
|
||||
/*!
|
||||
是否做镜像翻转,只做视图翻转,默认: YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isPreviewMirror;
|
||||
|
||||
/*!
|
||||
视频填充方式
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCVideoFillMode fillMode;
|
||||
|
||||
/*!
|
||||
视频 view 代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCVideoViewEventDelegate> delegate;
|
||||
|
||||
/*!
|
||||
是否隐藏视图
|
||||
|
||||
@param isHidden 是否隐藏,YES 隐藏 NO 不隐藏
|
||||
@discussion
|
||||
隐藏视图
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setHidden:(BOOL)isHidden;
|
||||
|
||||
/*!
|
||||
刷新渲染视图 View
|
||||
|
||||
@discussion
|
||||
刷新渲染视图 View
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)flushVideoView;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// RCRTCVideoViewEventDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/11/9.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCVideoStream;
|
||||
|
||||
/*!
|
||||
视频 view 代理
|
||||
@discussion
|
||||
added from 5.1.10
|
||||
*/
|
||||
@protocol RCRTCVideoViewEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/*!
|
||||
首帧通知
|
||||
|
||||
@param stream 视频流
|
||||
|
||||
@discussion
|
||||
视频数据渲染第一帧的回调
|
||||
added from 5.1.11
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didFirstFrameRendered:(RCRTCStream *)stream;
|
||||
|
||||
/*!
|
||||
远端视频尺寸大小改变通知
|
||||
|
||||
@param size 视频尺寸
|
||||
@discussion
|
||||
当远端视频尺寸大小改变时,会进行回调通知
|
||||
@deprecated from 5.1.11
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didVideoSizeChanged:(CGSize)size DEPRECATED_MSG_ATTRIBUTE("use RCRTCVideoInputStream.h RCRTCVideoInputStreamEventDelegate didFrameSizeChanged:width:height: API instead");
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// RongRTCLib.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2018/12/13.
|
||||
// Copyright © 2018年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for RongRTCLib.
|
||||
FOUNDATION_EXPORT double RongRTCLibVersionNumber;
|
||||
|
||||
//! Project version string for RongRTCLib.
|
||||
FOUNDATION_EXPORT const unsigned char RongRTCLibVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework
|
||||
// using statements like #import <RongRTCLib/PublicHeader.h>
|
||||
|
||||
#import <RongRTCLib/RCRTCAudioConfig.h>
|
||||
#import <RongRTCLib/RCRTCAudioEffectManager.h>
|
||||
#import <RongRTCLib/RCRTCAudioInputStream.h>
|
||||
#import <RongRTCLib/RCRTCAudioMixer.h>
|
||||
#import <RongRTCLib/RCRTCAudioOutputStream.h>
|
||||
#import <RongRTCLib/RCRTCBaseRoom.h>
|
||||
#import <RongRTCLib/RCRTCCDNInputStream.h>
|
||||
#import <RongRTCLib/RCRTCCameraOutputStream.h>
|
||||
#import <RongRTCLib/RCRTCCodeDefine.h>
|
||||
#import <RongRTCLib/RCRTCConfig.h>
|
||||
#import <RongRTCLib/RCRTCCryptoDelegate.h>
|
||||
#import <RongRTCLib/RCRTCCustomLayout.h>
|
||||
#import <RongRTCLib/RCRTCCustomMixAudio.h>
|
||||
#import <RongRTCLib/RCRTCEngine.h>
|
||||
#import <RongRTCLib/RCRTCEngineEventDelegate.h>
|
||||
#import <RongRTCLib/RCRTCGlobals.h>
|
||||
#import <RongRTCLib/RCRTCScreenShareOutputStream.h>
|
||||
#import <RongRTCLib/RCRTCInputStream.h>
|
||||
#import <RongRTCLib/RCRTCLibDefine.h>
|
||||
#import <RongRTCLib/RCRTCLiveInfo.h>
|
||||
#import <RongRTCLib/RCRTCLocalUser.h>
|
||||
#import <RongRTCLib/RCRTCLocalVideoView.h>
|
||||
#import <RongRTCLib/RCRTCRemoteVideoView.h>
|
||||
#import <RongRTCLib/RCRTCMediaConfig.h>
|
||||
#import <RongRTCLib/RCRTCMicOutputStream.h>
|
||||
#import <RongRTCLib/RCRTCMixConfig.h>
|
||||
#import <RongRTCLib/RCRTCOtherRoom.h>
|
||||
#import <RongRTCLib/RCRTCOtherRoomEventDelegate.h>
|
||||
#import <RongRTCLib/RCRTCOutputStream.h>
|
||||
#import <RongRTCLib/RCRTCProxy.h>
|
||||
#import <RongRTCLib/RCRTCRemoteUser.h>
|
||||
#import <RongRTCLib/RCRTCRoom.h>
|
||||
#import <RongRTCLib/RCRTCRoomConfig.h>
|
||||
#import <RongRTCLib/RCRTCRoomEventDelegate.h>
|
||||
#import <RongRTCLib/RCRTCStatusForm.h>
|
||||
#import <RongRTCLib/RCRTCStreamStat.h>
|
||||
#import <RongRTCLib/RCRTCBaseStat.h>
|
||||
#import <RongRTCLib/RCRTCProbeStatusForm.h>
|
||||
#import <RongRTCLib/RCRTCProbeTestDelegate.h>
|
||||
#import <RongRTCLib/RCRTCLiveAudioStatus.h>
|
||||
#import <RongRTCLib/RCRTCStatusReportDelegate.h>
|
||||
#import <RongRTCLib/RCRTCStream.h>
|
||||
#import <RongRTCLib/RCRTCUser.h>
|
||||
#import <RongRTCLib/RCRTCVideoConfig.h>
|
||||
#import <RongRTCLib/RCRTCVideoExtend.h>
|
||||
#import <RongRTCLib/RCRTCVideoInputStream.h>
|
||||
#import <RongRTCLib/RCRTCVideoLayout.h>
|
||||
#import <RongRTCLib/RCRTCVideoOutputStream.h>
|
||||
#import <RongRTCLib/RCRTCVideoSourceInterface.h>
|
||||
#import <RongRTCLib/RCRTCVideoStreamConfig.h>
|
||||
#import <RongRTCLib/RCRTCVideoTextureView.h>
|
||||
#import <RongRTCLib/RCRTCVideoUnityView.h>
|
||||
#import <RongRTCLib/RCRTCVideoView.h>
|
||||
#import <RongRTCLib/RCRTCVideoViewEventDelegate.h>
|
||||
#import <RongRTCLib/RCRTCFileVideoOutputStream.h>
|
||||
#import <RongRTCLib/RCRTCVideoFrame.h>
|
||||
#import <RongRTCLib/RCRTCDrawer.h>
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
framework module RongRTCLib {
|
||||
umbrella header "RongRTCLib.h"
|
||||
export *
|
||||
|
||||
module * { export * }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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>NSPrivacyCollectedDataTypes</key>
|
||||
<array>
|
||||
</array>
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array/>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>35F9.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// RCRTCAudioConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCAudioConfig : NSObject
|
||||
|
||||
/*!
|
||||
本地音频码率
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger bitrate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// RCRTCEffectManager.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/18.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCCodeDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音效代理方法
|
||||
*/
|
||||
@protocol RCRTCSoundEffectProtocol <NSObject>
|
||||
|
||||
/*!
|
||||
当前音效播放进度
|
||||
|
||||
@param progress 播放进度 range [0,1]
|
||||
@discussion
|
||||
当前播放进度
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportEffectPlayingProgress:(float)progress effectId:(NSUInteger)effectId;
|
||||
|
||||
/*!
|
||||
音效播放结束,如果循环播放多次,多次循环后调用
|
||||
|
||||
@discussion
|
||||
播放结束,如果循环播放多次,多次循环后调用
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didEffectFinished:(NSUInteger)effectId;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCAudioEffectManager : NSObject
|
||||
|
||||
/*!
|
||||
delegate
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCSoundEffectProtocol> delegate;
|
||||
|
||||
/*!
|
||||
开启或关闭耳返
|
||||
@param enabled YES 开启,NO 关闭,默认为 NO
|
||||
*/
|
||||
- (void)enableInEarMonitoring:(BOOL)enabled;
|
||||
|
||||
/*!
|
||||
设置耳返音量
|
||||
@param volume [0,100]
|
||||
*/
|
||||
- (void)setInEarMonitoringVolume:(NSUInteger)volume;
|
||||
|
||||
/*!
|
||||
播放指定音效文件,filePath 必须可用,需要指定唯一的 ID,如果调用`preloadEffect`接口设置过 ID,此 ID 要与其相同
|
||||
如果前后传入相同的 ID,但是 filePath 不同,会覆盖,播放最新的 filePath 音效
|
||||
@param soundId 音效的唯一 ID
|
||||
@param filePath 音效的路径
|
||||
@param loopCount 音效的循环次数
|
||||
@param publish 是否将音效推送到远端,设置为 YES,其他端可听到此音效声音,如果设置为 NO,只有本端可以听到
|
||||
*/
|
||||
- (RCRTCCode)playEffect:(NSInteger)soundId
|
||||
filePath:(NSString *)filePath
|
||||
loopCount:(int)loopCount
|
||||
publish:(BOOL)publish;
|
||||
|
||||
/*!
|
||||
播放指定音效文件,filePath 必须可用,需要指定唯一的 ID,如果调用`preloadEffect`接口设置过 ID,此 ID 要与其相同
|
||||
如果前后传入相同的 ID,但是 filePath 不同,会覆盖,播放最新的 filePath 音效
|
||||
@param soundId 音效的唯一 ID
|
||||
@param filePath 音效的路径
|
||||
@param loopCount 音效的循环次数
|
||||
@param volume 音效音量 [0,100]
|
||||
@param publish 是否将音效推送到远端,设置为 YES,其他端可听到此音效声音,如果设置为 NO,只有本端可以听到
|
||||
*/
|
||||
- (RCRTCCode)playEffect:(NSInteger)soundId
|
||||
filePath:(NSString *_Nullable)filePath
|
||||
loopCount:(NSUInteger)loopCount
|
||||
volume:(NSUInteger)volume
|
||||
publish:(BOOL)publish;
|
||||
|
||||
/*!
|
||||
停止指定的音效
|
||||
@param soundId 音效唯一 ID
|
||||
*/
|
||||
- (RCRTCCode)stopEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
停止所有的音效
|
||||
*/
|
||||
- (RCRTCCode)stopAllEffects;
|
||||
|
||||
/*!
|
||||
暂停指定的音效文件
|
||||
@param soundId 指定的音效 ID
|
||||
*/
|
||||
- (RCRTCCode)pauseEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
暂停所有的音效
|
||||
*/
|
||||
- (RCRTCCode)pauseAllEffects;
|
||||
|
||||
/*!
|
||||
恢复播放指定的音效
|
||||
@param soundId 指定的音效 ID
|
||||
*/
|
||||
- (RCRTCCode)resumeEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
恢复播放所有的音效
|
||||
*/
|
||||
- (RCRTCCode)resumeAllEffects;
|
||||
|
||||
/*!
|
||||
预加载指定的音效文件,filePath 必须可用
|
||||
@param soundId 指定的音效 ID
|
||||
@param filePath 音效路径
|
||||
*/
|
||||
- (RCRTCCode)preloadEffect:(NSInteger)soundId filePath:(NSString *)filePath;
|
||||
|
||||
/*!
|
||||
取消加载的音效文件
|
||||
@param soundId 指定的音效 ID
|
||||
*/
|
||||
- (RCRTCCode)unloadEffect:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
设置全局的音效的音量
|
||||
@param volume 音量 [0,100],默认为 100.
|
||||
*/
|
||||
- (RCRTCCode)setEffectsVolume:(NSUInteger)volume;
|
||||
|
||||
/*!
|
||||
设置指定音效的音效音量
|
||||
@param soundId 指定的音效 ID
|
||||
@param volume 音量 [0,100],默认为 100
|
||||
*/
|
||||
- (RCRTCCode)setVolumeOfEffect:(NSInteger)soundId withVolume:(NSUInteger)volume;
|
||||
|
||||
/*!
|
||||
获取指定音效的音量
|
||||
*/
|
||||
- (NSUInteger)getVolumeOfEffectId:(NSInteger)soundId;
|
||||
|
||||
/*!
|
||||
获取全局音效的音量
|
||||
*/
|
||||
- (NSUInteger)getEffectsVolume;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// RCRTCAudioInputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/6/1.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCInputStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
接收到的的音频流
|
||||
*/
|
||||
@interface RCRTCAudioInputStream : RCRTCInputStream
|
||||
|
||||
/*!
|
||||
远端音频数据回调
|
||||
added from 5.1.6
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioFrameCallback audioDataCallback;
|
||||
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,382 @@
|
||||
//
|
||||
// RCRTCAudioMixer.h
|
||||
// RTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/5/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreAudio/CoreAudioTypes.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCGlobals.h"
|
||||
|
||||
/*!
|
||||
无限期循环
|
||||
*/
|
||||
RONGRTCLIB_EXTERN const UInt32 RCRTCLoopsIndefinitely;
|
||||
|
||||
/*!
|
||||
混音引擎状态
|
||||
deprecated from 5.1.3
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RTCMixEngineStatus) {
|
||||
/*!
|
||||
正常
|
||||
*/
|
||||
RTCMixEngineStatusNormal,
|
||||
/*!
|
||||
准备中
|
||||
*/
|
||||
RTCMixEngineStatusPrepare,
|
||||
/*!
|
||||
播放中(或混音中)
|
||||
*/
|
||||
RTCMixEngineStatusPlaying,
|
||||
/*!
|
||||
暂停中
|
||||
*/
|
||||
RTCMixEngineStatusPause,
|
||||
/*!
|
||||
停止
|
||||
*/
|
||||
RTCMixEngineStatusStop
|
||||
};
|
||||
|
||||
/*!
|
||||
播放(或混音)状态
|
||||
added from 5.1.3
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioMixingState) {
|
||||
/*!
|
||||
播放中(或混音中)
|
||||
*/
|
||||
RCRTCMixingStatePlaying,
|
||||
/*!
|
||||
暂停中
|
||||
*/
|
||||
RCRTCMixingStatePause,
|
||||
/*!
|
||||
停止
|
||||
*/
|
||||
RCRTCMixingStateStop,
|
||||
/*!
|
||||
播放失败
|
||||
*/
|
||||
RCRTCMixingStateFailed
|
||||
};
|
||||
|
||||
/*!
|
||||
播放(或混音)状态改变的原因
|
||||
added from 5.1.3
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioMixingReason) {
|
||||
/*!
|
||||
成功调用 startMixingWithURL:playback:mixerMode:loopCount:;
|
||||
*/
|
||||
RCRTCMixingReasonStartedByUser,
|
||||
/*!
|
||||
混音文件加载完成
|
||||
*/
|
||||
RCRTCMixingReasonFileLoaded,
|
||||
/*!
|
||||
混音文件完成一次循环播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonOneLoopCompleted,
|
||||
/*!
|
||||
混音文件开始新的一次循环播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonStartNewLoop,
|
||||
/*!
|
||||
混音文件完成所有循环播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonAllLoopsCompleted,
|
||||
/*!
|
||||
成功调用 stop 停止播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonStoppedByUser,
|
||||
/*!
|
||||
成功调用 pause 停止播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonPausedByUser,
|
||||
/*!
|
||||
成功调用 resume 停止播放(或混音)
|
||||
*/
|
||||
RCRTCMixingReasonResumedByUser,
|
||||
/*!
|
||||
混音文件加载失败(文件不存在或者文件格式不支持等原因导致加载失败)
|
||||
*/
|
||||
RCRTCMixingReasonCanNotOpen,
|
||||
};
|
||||
|
||||
/*!
|
||||
混音模式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCMixerMode) {
|
||||
/*!
|
||||
对端只能听见麦克风采集的声音
|
||||
*/
|
||||
RCRTCMixerModeNone,
|
||||
/*!
|
||||
对端能够听到麦克风采集的声音和音频文件的声音
|
||||
*/
|
||||
RCRTCMixerModeMixing,
|
||||
/*!
|
||||
对端只能听到音频文件的声音
|
||||
*/
|
||||
RCRTCMixerModeReplace
|
||||
};
|
||||
|
||||
/**
|
||||
本地音频左右声道混音
|
||||
@discussion Add from 5.1.13
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCAudioDualMonoMode) {
|
||||
/*!
|
||||
当前音频立体声混音
|
||||
*/
|
||||
RCRTCAudioDualMonoStereo = 0,
|
||||
/*!
|
||||
当前音频左声道混音
|
||||
*/
|
||||
RCRTCAudioDualMonoLeft = 1,
|
||||
/*!
|
||||
当前音频右声道混音
|
||||
*/
|
||||
RCRTCAudioDualMonoRight = 2
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
AudioMixer 的播放代理
|
||||
*/
|
||||
@protocol RCRTCAudioMixerAudioPlayDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
当前播放进度
|
||||
|
||||
@param progress 播放进度 range [0,1]
|
||||
@discussion
|
||||
当前播放进度
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didReportPlayingProgress:(float)progress;
|
||||
|
||||
/*!
|
||||
混音状态
|
||||
|
||||
@param mixingState 混音状态
|
||||
@param mixingReason 混音状态改变的原因
|
||||
@discussion
|
||||
当前混音状态
|
||||
Add from 5.1.3
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didAudioMixingStateChanged:(RCRTCAudioMixingState)mixingState reason:(RCRTCAudioMixingReason)mixingReason;
|
||||
|
||||
@optional
|
||||
/*!
|
||||
播放结束,如果循环播放多次,多次循环后调用
|
||||
|
||||
@discussion
|
||||
播放结束,如果循环播放多次,多次循环后调用
|
||||
@deprecated from 5.1.3
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didPlayToEnd DEPRECATED_MSG_ATTRIBUTE("use didAudioMixingStateChanged:reason: instead");
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
混音引擎
|
||||
*/
|
||||
@interface RCRTCAudioMixer : NSObject
|
||||
|
||||
/*!
|
||||
获取混音引擎单例
|
||||
*/
|
||||
+ (RCRTCAudioMixer *)sharedInstance;
|
||||
|
||||
/*!
|
||||
AudioMixer 的代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCAudioMixerAudioPlayDelegate> delegate;
|
||||
|
||||
/*!
|
||||
音频文件混音时的输入音量, 取值范围 [0,100], 默认值 100
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger mixingVolume;
|
||||
|
||||
/*!
|
||||
音频文件本地播放音量, 取值范围 [0,100], 默认值 100
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger playingVolume;
|
||||
|
||||
/*!
|
||||
混音文件的播放音调相对原始音调的偏移值,取值范围 [-12,12],默认值 0,其中 0 表示原始音调,1 表示升高一个半音,-1 降低一个半音,以此类推。
|
||||
暂不支持处理在线音频
|
||||
*/
|
||||
@property (nonatomic, assign) double pitch;
|
||||
|
||||
/*!
|
||||
混音文件的播放速度,取值范围 [50,400],默认值 100,其中 100 表示原始速度,50 表示 0.5 倍速,400 表示 4 倍速,以此类推。
|
||||
暂不支持处理在线音频
|
||||
*/
|
||||
@property (nonatomic, assign) double playbackSpeed;
|
||||
|
||||
/*!
|
||||
当前混音状态
|
||||
*/
|
||||
@property (nonatomic, assign, readonly)
|
||||
RTCMixEngineStatus status DEPRECATED_MSG_ATTRIBUTE("use didAudioMixingStateChanged:reason: instead");
|
||||
|
||||
/*!
|
||||
方法 writeAudioBufferList:frames:sampleTime:playback: 写入 AudioBufferList 的格式
|
||||
*/
|
||||
@property (nonatomic, readonly, class) AudioStreamBasicDescription writeAsbd;
|
||||
|
||||
/*!
|
||||
当前混音文件时长
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSTimeInterval duration;
|
||||
|
||||
/*!
|
||||
获取指定音频文件的时长
|
||||
|
||||
@param url 音频文件的 File URL
|
||||
@discussion
|
||||
获取指定音频文件的时长,只支持本地音频文件
|
||||
|
||||
@remarks 音频配置
|
||||
@return 音频文件的时长
|
||||
*/
|
||||
+ (Float64)durationOfAudioFile:(NSURL *)url;
|
||||
|
||||
/*!
|
||||
设置播放进度
|
||||
@param progress 设置播放进度 取值范围 [0,1]
|
||||
@discussion
|
||||
设置播放进度
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setPlayProgress:(float)progress;
|
||||
|
||||
/*!
|
||||
设置混音文件的播放音调
|
||||
@param pitch 相对原始音调的偏移值,默认值为 0,取值范围 [-12,12],其中 0 表示原始音调,1 表示升高一个半音,-1 降低一个半音,以此类推。
|
||||
@discussion
|
||||
设置混音文件的播放音调,暂不支持处理在线音频
|
||||
Added from 5.2.0
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setPitch:(double)pitch;
|
||||
|
||||
/*!
|
||||
设置混音文件的播放速度
|
||||
@param playbackSpeed 播放速度,默认值为 100,取值范围 [50,400],其中 100 表示原始速度,50 表示 0.5 倍速,400 表示 4 倍速,以此类推。
|
||||
@discussion
|
||||
设置混音文件的播放速度,暂不支持处理在线音频
|
||||
Added from 5.2.0
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setPlaybackSpeed:(double)playbackSpeed;
|
||||
|
||||
/*!
|
||||
开始混音, 开始新混音之前需要先调用 stop 结束混音, 重复调用会忽略操作
|
||||
@param fileURL 资源 URL
|
||||
@param isPlay 是否播放
|
||||
@param mode 混音行为模式
|
||||
@param count 循环混音或者播放次数
|
||||
|
||||
@discussion
|
||||
混音功能
|
||||
|
||||
@remarks 音频配置
|
||||
@return 开始是否成功
|
||||
*/
|
||||
- (BOOL)startMixingWithURL:(NSURL *)fileURL
|
||||
playback:(BOOL)isPlay
|
||||
mixerMode:(RCRTCMixerMode)mode
|
||||
loopCount:(NSUInteger)count;
|
||||
|
||||
/*!
|
||||
设置混音声道模式
|
||||
@param mode 声道模式 0 立体声混音, 1 左声道混音, 2 右声道混音
|
||||
@discussion
|
||||
只针对本地文件资源产生效果, 不支持网络资源的 url
|
||||
Add from 5.1.13
|
||||
|
||||
@remarks 音频配置
|
||||
@return 设置是否成功
|
||||
*/
|
||||
- (BOOL)setAudioDualMonoMode:(RCRTCAudioDualMonoMode)mode;
|
||||
|
||||
/*!
|
||||
写入自定义音频数据
|
||||
@param abl 音频数据,格式为 PCM
|
||||
@param frames 音频帧个数
|
||||
@param sampleTime 音频帧时间戳
|
||||
@param isPlay 是否在本地播放
|
||||
|
||||
@discussion
|
||||
写入自定义音频数据
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
- (void)writeAudioBufferList:(const AudioBufferList *)abl
|
||||
frames:(UInt32)frames
|
||||
sampleTime:(SInt64)sampleTime
|
||||
playback:(BOOL)isPlay;
|
||||
|
||||
/*!
|
||||
写入自定义音频数据
|
||||
@param abl 音频数据,格式为 PCM
|
||||
@param frames 音频帧个数
|
||||
@param sampleTime 音频帧时间戳
|
||||
@param asbd 音频格式描述
|
||||
@param isPlay 是否在本地播放
|
||||
|
||||
@discussion
|
||||
写入自定义音频数据
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
- (void)writeAudioBufferList:(const AudioBufferList *)abl
|
||||
frames:(UInt32)frames
|
||||
sampleTime:(SInt64)sampleTime
|
||||
asbd:(AudioStreamBasicDescription)asbd
|
||||
playback:(BOOL)isPlay;
|
||||
|
||||
/*!
|
||||
暂停
|
||||
|
||||
@remarks 音频配置
|
||||
@return 暂停是否成功
|
||||
*/
|
||||
- (BOOL)pause;
|
||||
|
||||
/*!
|
||||
恢复
|
||||
|
||||
@remarks 音频配置
|
||||
@return 恢复是否成功
|
||||
*/
|
||||
- (BOOL)resume;
|
||||
|
||||
/*!
|
||||
结束
|
||||
|
||||
@remarks 音频配置
|
||||
@return 结束是否成功
|
||||
*/
|
||||
- (BOOL)stop;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// RCRTCAudioOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/6/2.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCOutputStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCAudioOutputStream : RCRTCOutputStream
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCAudioOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// RCBaseRoom.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/3.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <RongIMLibCore/RongIMLibCore.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCRoomConfig;
|
||||
@class RCRTCRemoteUser;
|
||||
|
||||
@interface RCRTCBaseRoom : NSObject
|
||||
|
||||
/*!
|
||||
房间ID
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *roomId;
|
||||
|
||||
/*!
|
||||
加入房间时设置的房间配置
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCRoomConfig *roomConfig;
|
||||
|
||||
/*!
|
||||
会话 id, 用于 server API,会话唯一标识
|
||||
*/
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *sessionId;
|
||||
|
||||
/*!
|
||||
参与用户
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) NSArray<RCRTCRemoteUser *> *remoteUsers;
|
||||
|
||||
/*!
|
||||
获取指定远端用户
|
||||
|
||||
@param userId 用户 ID
|
||||
@discussion
|
||||
根据用户 ID 获取房间内远端用户,不存在则返回 nil
|
||||
*/
|
||||
- (nullable RCRTCRemoteUser *)getRemoteUser:(NSString *)userId;
|
||||
|
||||
/*!
|
||||
发送消息
|
||||
|
||||
@param content 消息的内容
|
||||
@param successBlock 消息发送成功的回调 [messageId:消息的ID]
|
||||
@param errorBlock 消息发送失败的回调 [nErrorCode:发送失败的错误码,messageId:消息的ID]
|
||||
@discussion
|
||||
该接口只能发送 persistentFlag 为 MessagePersistent_STATUS 的状态消息, 远端用户如果不在线则消息丢失, 自定义消息时下面标识一定要给出, 否则会导致消息发送失败
|
||||
+ (RCMessagePersistent)persistentFlag {
|
||||
return MessagePersistent_STATUS;
|
||||
}
|
||||
|
||||
@remarks 房间管理
|
||||
@return 发送的消息实体
|
||||
*/
|
||||
- (nullable RCMessage *)sendMessage:(RCMessageContent *)content
|
||||
success:(nullable void (^)(long messageId))successBlock
|
||||
error:(nullable void (^)(NSInteger nErrorCode, long messageId))errorBlock;
|
||||
|
||||
/*!
|
||||
设置房间属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setRoomAttributeValue:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use setAttribute:forKey:message:completion: API instead");
|
||||
|
||||
/*!
|
||||
设置房间属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setAttribute:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
删除房间属性
|
||||
|
||||
@param attributeKeys 属性名称数组
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 删除完成回调
|
||||
@discussion
|
||||
删除房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)deleteRoomAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use deleteAttributes:message:completion: API instead");
|
||||
|
||||
/*!
|
||||
删除房间属性
|
||||
|
||||
@param attributeKeys 属性名称数组
|
||||
@param message 是否在设置属性的时候携带消息内容, 传空则不往房间中发送消息
|
||||
@param completion 删除完成回调
|
||||
@discussion
|
||||
删除房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)deleteAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
获取房间属性
|
||||
|
||||
@param attributeKeys 属性名称
|
||||
@param completion 获取结果回调
|
||||
@discussion
|
||||
获取房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)getRoomAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
completion:(nullable RCRTCAttributeOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use getAttributes:completion: API instead");
|
||||
|
||||
/*!
|
||||
获取房间属性
|
||||
|
||||
@param attributeKeys 属性名称
|
||||
@param completion 获取结果回调
|
||||
@discussion
|
||||
获取房间属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)getAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
completion:(nullable RCRTCAttributeOperationCallback)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// RCRTCBaseStat.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/12/27.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCBaseStat : NSObject
|
||||
|
||||
/*!
|
||||
媒体类型
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *mediaType;
|
||||
|
||||
/*!
|
||||
媒体流类型
|
||||
*/
|
||||
@property (nonatomic, readonly) RCRTCMediaStreamType mediaStreamType;
|
||||
|
||||
/*!
|
||||
音量大小, 0 - 9表示音量高低
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger audioLevel;
|
||||
|
||||
/*!
|
||||
码率
|
||||
*/
|
||||
@property (nonatomic, readonly) float bitRate;
|
||||
|
||||
/*!
|
||||
丢包率
|
||||
*/
|
||||
@property (nonatomic, readonly) float packetLoss;
|
||||
|
||||
/*!
|
||||
视频帧宽度
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger frameWidth;
|
||||
|
||||
/*!
|
||||
视频帧高度
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger frameHeight;
|
||||
|
||||
/*!
|
||||
往返时间
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger rtt;
|
||||
|
||||
/*!
|
||||
帧率
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger frameRate;
|
||||
|
||||
/*!
|
||||
抖动
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger jitterReceived;
|
||||
|
||||
/*!
|
||||
编码名称
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *codecName;
|
||||
|
||||
/*!
|
||||
渲染延时
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger renderDelayMs;
|
||||
|
||||
/*!
|
||||
编解码器名称
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *codecImplementationName;
|
||||
|
||||
/*!
|
||||
nacks 数量
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger googNacksReceived;
|
||||
|
||||
/*!
|
||||
统计格式化字符串
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *formString;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// RCRTCCDNStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/5/18.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCInputStream.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCDrawer.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void (^RCRTCConfigCallback)(BOOL isSuccess, RCRTCCode code);
|
||||
|
||||
@class RCRTCCDNInputStream;
|
||||
|
||||
@protocol RCRTCCDNInputStreamDelegate <NSObject>
|
||||
/*!
|
||||
SEI 数据监听回调
|
||||
|
||||
@param cdnStream 当前 cdn 流对象
|
||||
@param data SEI 数据
|
||||
@discussion
|
||||
订阅 cdn 流成功后,通过 receiver 回调 cdn 流中包含 SEI 信息
|
||||
回调的频次取决于 cdn 流的 SEI 帧数据间隔
|
||||
*/
|
||||
- (void)cdnStream:(RCRTCCDNInputStream *)cdnStream handleSEIData:(NSString *)data;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCCDNInputStream : RCRTCInputStream
|
||||
|
||||
/*!
|
||||
设置 cdn 流监听代理
|
||||
*/
|
||||
@property (nonatomic, weak) id<RCRTCCDNInputStreamDelegate> delegate;
|
||||
|
||||
/*!
|
||||
获取订阅 CDN 流前设置的分辨率
|
||||
*/
|
||||
- (RCRTCVideoSizePreset)getVideoResolution;
|
||||
|
||||
/*!
|
||||
获取订阅 CDN 流前设置的帧率
|
||||
*/
|
||||
- (RCRTCVideoFPS)getVideoFps;
|
||||
|
||||
/*!
|
||||
当前订阅成功的 CDN 流最高支持的分辨率
|
||||
*/
|
||||
- (RCRTCVideoSizePreset)getHighestResolution;
|
||||
|
||||
/*!
|
||||
当前订阅成功的 CDN 流最高支持的帧率
|
||||
*/
|
||||
- (RCRTCVideoFPS)getHighestFPS;
|
||||
|
||||
/*!
|
||||
设置分辨率和帧率
|
||||
@param videoSizePreset 分辨率
|
||||
@param fps 帧率
|
||||
*/
|
||||
- (void)setVideoConfig:(RCRTCVideoSizePreset)videoSizePreset
|
||||
fpsValue:(RCRTCVideoFPS)fps
|
||||
completion:(nullable RCRTCConfigCallback)completion;
|
||||
|
||||
/*!
|
||||
设置视频流的渲染视图
|
||||
|
||||
@param render 渲染视图
|
||||
@discussion
|
||||
接受到远端用户的视频流,然后设置视频流的渲染视图,就可以渲染出远端视频
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoView:(nullable id<RCRTCDrawer>)render;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,290 @@
|
||||
//
|
||||
// RCRTCCameraOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/8.
|
||||
// Copyright © 2019年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreMedia/CoreMedia.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCVideoView.h"
|
||||
#import "RCRTCVideoOutputStream.h"
|
||||
#import "RCRTCVideoStreamConfig.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
摄像头输出流,以摄像头为视频源的视频输出流
|
||||
*/
|
||||
@interface RCRTCCameraOutputStream : RCRTCVideoOutputStream
|
||||
|
||||
/*!
|
||||
当前开启摄像头位置
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCDeviceCamera cameraPosition;
|
||||
|
||||
/*!
|
||||
摄像头采集角度
|
||||
默认以 AVCaptureVideoOrientationPortrait 角度进行采集
|
||||
*/
|
||||
@property (nonatomic, assign) AVCaptureVideoOrientation videoOrientation;
|
||||
|
||||
/*!
|
||||
本地摄像头采集是否镜像
|
||||
|
||||
前置摄像头默认: YES,后置摄像头默认: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isCaptureMirror;
|
||||
|
||||
/*!
|
||||
本地摄像头采集是否镜像
|
||||
|
||||
前置摄像头默认: YES,后置摄像头默认: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isPreviewMirror DEPRECATED_MSG_ATTRIBUTE("use RCRTCCameraOutputStream.h isCaptureMirror instead");;
|
||||
|
||||
/*!
|
||||
本地摄像头发送数据是否镜像
|
||||
|
||||
默认: NO, 不镜像
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEncoderMirror;
|
||||
|
||||
/*!
|
||||
是否启用视频小流
|
||||
|
||||
摄像头视频流,默认开启。自定义视频流,默认关闭
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableTinyStream;
|
||||
|
||||
@property (atomic, copy, nullable) RCRTCVideoCMSampleBufferCallback videoDisplayBufferCallback DEPRECATED_MSG_ATTRIBUTE("please use RCRTCVideoOutputStream.h outputVideoStream:willRenderVideoFrame: instead");
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultVideoStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCCameraOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultVideoStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCCameraOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
写入视频流数据
|
||||
|
||||
@param sample 媒体数据
|
||||
@param error 失败时返回的相关描述
|
||||
@discussion
|
||||
写入视频流数据
|
||||
|
||||
@warning
|
||||
请勿调用,摄像头输出流内部已经实现摄像头数据采集,调用者无需自己写入视频流数据
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)write:(CMSampleBufferRef)sample error:(NSError **)error NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
设置视频源
|
||||
|
||||
@param videoSource 视频源
|
||||
@discussion
|
||||
请勿调用,摄像头输出流的视频源已经封装在 SDK 内,调用者无需设置视频源,如果要自定义视频流,请使用 RCRTCVideoOutputStream
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setVideoSource:(id<RCRTCVideoSourceInterface>)videoSource NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
设置视频流的渲染视图
|
||||
|
||||
@param view 渲染视图
|
||||
@discussion
|
||||
设置本地摄像头采集的视频流渲染视图
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoView:(nullable id<RCRTCDrawer>)view;
|
||||
|
||||
/*!
|
||||
设置视频数的渲染纹理视图
|
||||
|
||||
@param view 渲染纹理视图
|
||||
@discussion
|
||||
设置本地摄像头采集的视频流渲染纹理视图
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)setVideoTextureView:(nullable RCRTCVideoTextureView *)view;
|
||||
|
||||
/*!
|
||||
开启摄像头数据采集
|
||||
|
||||
@discussion
|
||||
开启摄像头采集数据
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)startCapture;
|
||||
|
||||
/*!
|
||||
停止摄像头数据采集
|
||||
|
||||
@discussion
|
||||
关闭摄像头采集数据
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)stopCapture;
|
||||
|
||||
/*!
|
||||
切换前后摄像头
|
||||
|
||||
@discussion
|
||||
切换前后摄像头
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)switchCamera;
|
||||
|
||||
/*!
|
||||
摄像头是否支持区域对焦
|
||||
|
||||
@discussion
|
||||
摄像头是否支持手动对焦功能
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraFocusSupported;
|
||||
|
||||
/*!
|
||||
设置预览视图中的对焦点
|
||||
|
||||
@param point 对焦点,(x,y)是在预览视图中归一化的坐标,即对焦点相对预览视图的位置与预览视图宽高的比值,取值范围为[0, 1],左上角是(0, 0)
|
||||
|
||||
@discussion
|
||||
改变对焦位置
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)setCameraFocusPositionInPreview:(CGPoint)point;
|
||||
|
||||
/*!
|
||||
摄像头是否支持区域测光
|
||||
|
||||
@discussion
|
||||
摄像头是否支持手动曝光功能
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraExposurePositionSupported;
|
||||
|
||||
/*!
|
||||
设置预览视图中的曝光点
|
||||
|
||||
@param point 曝光点,(x,y)是在预览视图中归一化的坐标,即曝光点相对预览视图的位置与预览视图宽高的比值,取值范围为[0, 1],左上角是(0, 0)
|
||||
|
||||
@discussion
|
||||
改变对焦位置
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)setCameraExposurePositionInPreview:(CGPoint)point;
|
||||
|
||||
/*!
|
||||
摄像头是否支持闪光灯
|
||||
|
||||
@discussion
|
||||
摄像头是否支持闪光灯
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraTorchSupported;
|
||||
|
||||
/*!
|
||||
设置是否打开摄像头闪光灯
|
||||
|
||||
@param enable YES 为打开,NO 为关闭摄像头闪光灯
|
||||
@discussion
|
||||
设置是否打开摄像头闪光灯
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)enableCameraTorch:(BOOL)enable;
|
||||
|
||||
/*!
|
||||
摄像头是否支持缩放
|
||||
|
||||
@discussion
|
||||
摄像头是否支持缩放
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)isCameraZoomSupported;
|
||||
|
||||
/*!
|
||||
设置摄像头缩放比例
|
||||
|
||||
@param zoomFactor 摄像头缩放比例,有效范围从 1.0 到最大缩放
|
||||
@discussion
|
||||
设置摄像头缩放比例
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (BOOL)setCameraZoomFactor:(float)zoomFactor;
|
||||
|
||||
/*!
|
||||
获取摄像头最大缩放比例
|
||||
|
||||
@discussion
|
||||
获取摄像头最大缩放比例
|
||||
|
||||
@remarks 摄像头配置
|
||||
*/
|
||||
- (float)getCameraMaxZoomFactor;
|
||||
|
||||
/*!
|
||||
设置小流视频配置
|
||||
|
||||
@param config 视频配置
|
||||
@discussion
|
||||
设置小流视频配置
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (BOOL)setTinyVideoConfig:(RCRTCVideoStreamConfig *)config;
|
||||
|
||||
/*!
|
||||
获取小流视频配置
|
||||
|
||||
@discussion
|
||||
获取小流视频配置
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (nullable RCRTCVideoStreamConfig *)getTinyVideoConfig;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,263 @@
|
||||
//
|
||||
// RongRTCError.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/12.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/*!
|
||||
音视频错误码定义
|
||||
|
||||
服务器返回错误以 4 开头,后两位是业务代码,最后两位是错误码 4XXXX,如 400XX 基础连接部分
|
||||
本地返回错误以 5 开头,后两位是业务代码,最后两位是错误码 5XXXX,如 500XX 初始化基础连接部分
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCCode) {
|
||||
/*!
|
||||
成功
|
||||
*/
|
||||
RCRTCCodeSuccess = 0,
|
||||
/*!
|
||||
初始化失败, 信令服务(IM Server)未连接
|
||||
*/
|
||||
RCRTCCodeSignalServerNotConnect = 50000,
|
||||
/*!
|
||||
参数错误
|
||||
*/
|
||||
RCRTCCodeParameterError = 50001,
|
||||
/*!
|
||||
加入相同房间错误,表示用户在客户端重复加入相同的房间
|
||||
*/
|
||||
RCRTCCodeJoinToSameRoom = 50002,
|
||||
/*!
|
||||
不在房间中
|
||||
*/
|
||||
RCRTCCodeNotInRTCRoom = 50003,
|
||||
/*!
|
||||
请检查是否开通音视频服务
|
||||
*/
|
||||
RCRTCCodeVoIPNotAvailable = 50004,
|
||||
/*!
|
||||
RTC token为空,请查看是否还在房间内或者房间是否销毁
|
||||
*/
|
||||
RCRTCCodeRTCTokenIsNull = 50006,
|
||||
/*!
|
||||
SDK 内部状态错误
|
||||
*/
|
||||
RCRTCCodeIllegalState = 50007,
|
||||
/*!
|
||||
观众加聊天室成功,kv 回调超时(30s)
|
||||
*/
|
||||
RCRTCCodeChatRoomKVTimeout = 50008,
|
||||
/*!
|
||||
HTTP 请求超时
|
||||
*/
|
||||
RCRTCCodeHttpTimeoutError = 50010,
|
||||
/*!
|
||||
HTTP 错误(含 500,404,405 等错误)
|
||||
*/
|
||||
RCRTCCodeHttpError = 50011,
|
||||
/*!
|
||||
发布重复资源
|
||||
*/
|
||||
RCRTCCodePublishDuplicateResources = 50020,
|
||||
/*!
|
||||
设置本地 SDP 错误
|
||||
*/
|
||||
RCRTCCodeSetLocalSDPError = 50021,
|
||||
/*!
|
||||
设置远端 SDP 错误
|
||||
*/
|
||||
RCRTCCodeSetRemoteSDPError = 50022,
|
||||
/*!
|
||||
发布的流的个数已经到达上限
|
||||
*/
|
||||
RCRTCCodePublishStreamsHasReachedMaxCount = 50023,
|
||||
/*!
|
||||
取消发布不存在的资源
|
||||
*/
|
||||
RCRTCCodeUnpublishUnexistStream = 50024,
|
||||
/*!
|
||||
创建本地 Offer 失败
|
||||
*/
|
||||
RCRTCCodeCreateOfferError = 50025,
|
||||
/*!
|
||||
创建本地 Answer 失败
|
||||
*/
|
||||
RCRTCCodeCreateAnswerError = 50026,
|
||||
/*!
|
||||
公有云 SDK 不能访问私有云服务
|
||||
*/
|
||||
RCRTCCodeIncompatibleWithPrivateServer = 50027,
|
||||
/*!
|
||||
无法使用设置的代理服务转发资源
|
||||
*/
|
||||
RCRTCCodeProxyUnavailableError = 50028,
|
||||
/*!
|
||||
订阅不存在的音视频资源
|
||||
*/
|
||||
RCRTCCodeSubscribeNotExistResources = 50030,
|
||||
/*!
|
||||
资源重复订阅
|
||||
*/
|
||||
RCRTCCodeSubscribeDuplicateResources = 50031,
|
||||
/*!
|
||||
取消订阅不存在的音视频资源
|
||||
*/
|
||||
RCRTCCodeUnsubscribeNotExistResouce = 50032,
|
||||
/*!
|
||||
当前房间不存在这个 liveUrl
|
||||
*/
|
||||
RCRTCCodeLiveUrlNotInCurrentRoom = 50033,
|
||||
/*!
|
||||
请检查当前是否开通了语音识别服务
|
||||
*/
|
||||
RCRTCCodeASRNotAvailable= 50034,
|
||||
/*!
|
||||
请检查当前是否开启了语音识别服务
|
||||
*/
|
||||
RCRTCCodeASRNotStart = 50035,
|
||||
/*!
|
||||
RTCConnection 为空
|
||||
*/
|
||||
RCRTCCodeRTCConnectionIsNil = 50065,
|
||||
/*!
|
||||
解析 Json 串出错
|
||||
*/
|
||||
RCRTCCodeParseJsonDataError = 50069,
|
||||
/*!
|
||||
未加入主房间
|
||||
*/
|
||||
RCRTCCodeNotJoinedMainRoom = 50074,
|
||||
/*!
|
||||
操作的副房间号码和主房间号码一致错误
|
||||
*/
|
||||
RCRTCCodeOtherRoomIDSameWithMainRoomId = 50075,
|
||||
/*!
|
||||
取消的跨房间连麦请求不存在
|
||||
*/
|
||||
RCRTCCodeCancelInviteNotExist = 50076,
|
||||
/*!
|
||||
响应的跨房间连麦请求不存在
|
||||
*/
|
||||
RCRTCCodeRespondInviteNotExist = 50077,
|
||||
/*!
|
||||
发布时mediaServer返回的mcu流为空
|
||||
*/
|
||||
RCRTCCodeMCUListNotExist = 50079,
|
||||
/*!
|
||||
cdn 地址配置数量到达上限(最大为5个)
|
||||
*/
|
||||
RCRTCCodeCDNCountReachToLimit = 50080,
|
||||
/*!
|
||||
帧时间戳非法
|
||||
*/
|
||||
RCRTCCodeIllegalFrameTimestamp = 50081,
|
||||
/*!
|
||||
解码视频帧失败
|
||||
*/
|
||||
RCRTCCodeDecodeVideoFrameError = 50082,
|
||||
/*!
|
||||
音效文件数量已经到达最大数量
|
||||
*/
|
||||
RCRTCCodeEffectFileCountHasBeenReached = 50090,
|
||||
/*!
|
||||
处理非法的 soundId,如停止播放没有播放过的音效文件 id,
|
||||
此音效 ID 没有预设或者播放过。
|
||||
*/
|
||||
RCRTCCodeHandlingIllegalEffectSoundId = 50091,
|
||||
/*!
|
||||
自动重连异常
|
||||
*/
|
||||
RCRTCCodeReconnectError = 50100,
|
||||
/*!
|
||||
观众加聊天室成功,pullData KV没有值
|
||||
*/
|
||||
RCRTCCodeChatRoomKVNotExist = 50101,
|
||||
/*!
|
||||
音频设备启动失败
|
||||
*/
|
||||
RCRTCCodeAudioDeviceStartError = 52000,
|
||||
/*!
|
||||
订阅流时,cdn流订阅失败
|
||||
*/
|
||||
RCRTCCodeSubscribeCDNError = 52001,
|
||||
/*!
|
||||
没有集成player SDK
|
||||
*/
|
||||
RCRTCCodePlayerModuleNotFound = 54001,
|
||||
/*!
|
||||
CDN内部错误
|
||||
*/
|
||||
RCRTCCodeCDNInnerError = 54003,
|
||||
/*!
|
||||
数据连接中断 或 音视频源格式不支持
|
||||
*/
|
||||
RCRTCCodeCdnInfoVideoInterrupt = 54008,
|
||||
/*!
|
||||
订阅 CDN 流时,初始化 player 模块异常
|
||||
*/
|
||||
RCRTCCodePlayerInitError = 54009,
|
||||
/*!
|
||||
* Add from 5.1.9
|
||||
* 切换角色时房间类型错误,必须为直播房间
|
||||
*/
|
||||
RCRTCCodeSwitchRoleRoomTypeError = 55001,
|
||||
/*!
|
||||
* Add from 5.1.9
|
||||
* 切换的角色和当前角色相同错误
|
||||
*/
|
||||
RCRTCCodeSwitchRoleSameRoleError = 55002,
|
||||
/*!
|
||||
* Add from 5.1.17
|
||||
* RTC 网络探测未开始
|
||||
*/
|
||||
RCRTCCodeProbeTestNotStart = 56001,
|
||||
/*!
|
||||
* Add from 5.1.17
|
||||
* RTC 网络探测已开始
|
||||
*/
|
||||
RCRTCCodeProbeTestExist = 56002,
|
||||
/*!
|
||||
* Add from 5.1.17
|
||||
* RTC 通道连接断开
|
||||
*/
|
||||
RCRTCCodeMediaServerIceDisConnect = 56003,
|
||||
/*!
|
||||
* RTC 网络探测被中断
|
||||
*/
|
||||
RCRTCCodeProbeTestForceStop = 56004,
|
||||
/*!
|
||||
加房间操作打断探测
|
||||
*/
|
||||
RCRTCCodeInterruptByInternal = 56005,
|
||||
/*!
|
||||
SEI 数据长度超出限制 4096 个字节
|
||||
*/
|
||||
RCRTCCodeSEILengthReachToLimit = 56006,
|
||||
/*!
|
||||
SEI 通道未建立,请检查是否开启 SEI,或者发布音视频
|
||||
*/
|
||||
RCRTCCodeSEIChannelNotExist = 56007,
|
||||
/*!
|
||||
SEI 发送失败
|
||||
*/
|
||||
RCRTCCodeSEISendUnknownError = 56008,
|
||||
/*!
|
||||
SEI 频率超出限制, 1秒内不超过 30 次
|
||||
*/
|
||||
RCRTCCodeSEISendTimePerSecondReachToLimit = 56009,
|
||||
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCCodeDefine : NSObject
|
||||
|
||||
+ (NSString *)codeDesc:(NSInteger)code;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// RCRTCConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/12.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCProxy.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCConfig : NSObject
|
||||
|
||||
/*!
|
||||
默认 YES:断网后一直保持重连; NO:如果音视频房间在超时时间(超时时间管理后台可以配置,默认值 60s)内没有连上网络,SDK 会自动退出音视频房间,这个时间是一个粗略值,不保证精确,有 5s 左右的误差
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEnableAutoReconnect;
|
||||
|
||||
/*!
|
||||
设置房间统计信息的回调间隔
|
||||
单位毫秒, 默认1000ms(1s)。 注意 interval 值太小会影响 SDK 性能,如果小于 100 配置无法生效
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger statusReportInterval;
|
||||
|
||||
/*!
|
||||
默认 NO:是否开启媒体流加密功能(SRTP)
|
||||
特别注意:开启该功能会对性能和用户体验有一定影响,如果没有该需求请不要打开。
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableSRTP;
|
||||
|
||||
/*!
|
||||
默认 YES:是否可以和其它后台 App 进行混音
|
||||
特别注意:如果该属性设置为 NO,切换到其它 App 操作麦克风或者扬声器时,会导致自己 App 麦克风采集和播放被打断。
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableMixWithOthers;
|
||||
|
||||
/*!
|
||||
默认 NO:使用BaseLine进行视频编码; YES:使用HighProfile进行视频编码
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableHardwareEncoderHighProfile;
|
||||
|
||||
/*!
|
||||
默认 YES:Debug模式下检测IMSDK和RTCSDK版本号是否一致
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableVersionMismatch;
|
||||
|
||||
/*!
|
||||
默认 YES:是否支持立体声
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enableStereo;
|
||||
|
||||
/*!
|
||||
设置代理服务地址
|
||||
默认: 无
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCProxy *proxy;
|
||||
|
||||
/*!
|
||||
默认 YES:观众是否支持 PlayAndRecord 模式,该设置只对观众身份生效
|
||||
YES:AudioSession Category 为 AVAudioSessionCategoryPlayAndRecord,可以进行听筒/扬声器切换;
|
||||
NO:AudioSession Category 为 AVAudioSessionCategoryPlayback。
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL enablePlayAndRecord;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,101 @@
|
||||
//
|
||||
// RCRTCCryptoDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/7/28.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
自定义加密代理
|
||||
*/
|
||||
@protocol RCRTCCustomizedEncryptorDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
加密回调
|
||||
|
||||
@param payloadData 需要加密的数据起始地址
|
||||
@param payloadSize 需要加密的数据的大小
|
||||
@param encryptedFrame 加密后数据起始地址
|
||||
@param bytesWritten 加密后数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义加密需要实现该方法进行加密操作。
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (int)EncryptPayloadData:(const uint8_t *)payloadData
|
||||
payloadSize:(size_t)payloadSize
|
||||
encryptedFrame:(uint8_t *)encryptedFrame
|
||||
bytesWritten:(size_t *)bytesWritten
|
||||
mediastreamId:(NSString *)mediastreamId
|
||||
mediaType:(int)mediatype;
|
||||
|
||||
/*!
|
||||
加密后数据大小
|
||||
|
||||
@param frameSize 加密前数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义加密需要根据自己的加密算法返回加密后数据的大小,SDK 会根据返回加密后数据的大小进行内存申请
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (size_t)GetMaxCiphertextByteSize:(size_t)frameSize mediastreamId:(NSString *)mediastreamId mediaType:(int)mediatype;
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
自定义解密代理
|
||||
*/
|
||||
@protocol RCRTCCustomizedDecryptorDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
解密回调
|
||||
|
||||
@param encryptedFrame 需要解密的数据起始地址
|
||||
@param encryptedFrameSize 需要解密的数据的大小
|
||||
@param frame 解密后数据起始地址
|
||||
@param bytesWritten 解密后数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义解密需要实现该方法进行解密操作。
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (int)DecryptFrame:(const uint8_t *)encryptedFrame
|
||||
frameSize:(size_t)encryptedFrameSize
|
||||
frame:(uint8_t *)frame
|
||||
bytesWritten:(size_t *)bytesWritten
|
||||
mediastreamId:(NSString *)mediastreamId
|
||||
mediaType:(int)mediatype;
|
||||
|
||||
/*!
|
||||
解密后数据大小
|
||||
|
||||
@param frameSize 解密前数据的大小
|
||||
@param mediastreamId 当前解密的音视频流名称
|
||||
@param mediatype 媒体类型,0为"audio" 1为"video"
|
||||
|
||||
@discussion
|
||||
如果使用自定义解密需要根据自己的解密算法返回解密后数据的大小,SDK 会根据返回解密后数据的大小进行内存申请
|
||||
|
||||
@remarks 加解密配置
|
||||
|
||||
*/
|
||||
- (size_t)GetMaxPlaintextByteSize:(size_t)frameSize mediastreamId:(NSString *)mediastreamId mediaType:(int)mediatype;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// RCRTCCustomLayout.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCStream;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCCustomLayout : NSObject
|
||||
|
||||
/*!
|
||||
要混合布局的流,必须为视频流
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) RCRTCStream *videoStream;
|
||||
|
||||
/*!
|
||||
混流图层坐标的 y 值
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger y;
|
||||
|
||||
/*!
|
||||
混流图层坐标的 x 值
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger x;
|
||||
|
||||
/*!
|
||||
视频流的宽
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger width;
|
||||
|
||||
/*!
|
||||
视频流的高
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger height;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// RCRTCCustomMixAudio.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCStream;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCCustomMixAudio : NSObject
|
||||
|
||||
/*!
|
||||
要进行混音的流,必须为音频流
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) RCRTCStream *audioStream;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// RCRTCDrawer.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/11/24.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreGraphics/CoreGraphics.h>
|
||||
|
||||
@class RCRTCVideoFrame;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCRTCDrawer <NSObject>
|
||||
|
||||
/*!
|
||||
接收视频数据尺寸
|
||||
*/
|
||||
- (void)setSize:(CGSize)size;
|
||||
|
||||
/*!
|
||||
接收视频帧数据
|
||||
*/
|
||||
- (void)renderFrame:(nullable RCRTCVideoFrame *)frame;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,499 @@
|
||||
//
|
||||
// RCRTCEngine.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/2.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCAudioEffectManager.h"
|
||||
#import "RCRTCCodeDefine.h"
|
||||
#import "RCRTCConfig.h"
|
||||
#import "RCRTCCryptoDelegate.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCRoomConfig.h"
|
||||
#import "RCRTCJoinedRoomInfo.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCRoom;
|
||||
@class RCRTCOtherRoom;
|
||||
@class RCRTCVideoPreviewView;
|
||||
@class RCRTCVideoStreamConfig;
|
||||
@class RCRTCOutputStream;
|
||||
@class RCRTCMicOutputStream;
|
||||
@class RCRTCCameraOutputStream;
|
||||
@class RCRTCFileVideoOutputStream;
|
||||
@class RCRTCScreenShareOutputStream;
|
||||
@protocol RCRTCStatusReportDelegate;
|
||||
@protocol RCRTCEngineEventDelegate;
|
||||
@protocol RCRTCProbeTestDelegate;
|
||||
|
||||
/*!
|
||||
音视频引擎类
|
||||
*/
|
||||
@interface RCRTCEngine : NSObject
|
||||
|
||||
/*!
|
||||
音视频引擎单例
|
||||
|
||||
@remarks RCRTCEngine
|
||||
*/
|
||||
+ (RCRTCEngine *)sharedInstance;
|
||||
|
||||
/*!
|
||||
请使用 sharedInstance 初始化方法
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
请使用 sharedInstance 初始化方法
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
音视频引擎参数设置
|
||||
|
||||
@param config Engine 配置
|
||||
@return 错误码,参考 RCRTCCode
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
- (int)initWithConfig:(RCRTCConfig *)config;
|
||||
|
||||
/*!
|
||||
音视频引擎销毁资源, 会有主动离开房间操作
|
||||
|
||||
@remarks RCRTCEngine
|
||||
*/
|
||||
- (void)unInit;
|
||||
|
||||
/*!
|
||||
音效管理器,管理播放、暂停等
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) RCRTCAudioEffectManager *audioEffectManager;
|
||||
|
||||
/*!
|
||||
全局音视频配置信息
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCConfig *config;
|
||||
|
||||
/*!
|
||||
当前已加入的房间,已废弃
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCRoom *currentRoom DEPRECATED_MSG_ATTRIBUTE("use room property instead");
|
||||
|
||||
/*!
|
||||
当前已加入的房间
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) RCRTCRoom *room;
|
||||
|
||||
/*!
|
||||
本地默认音频流
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) RCRTCMicOutputStream *defaultAudioStream;
|
||||
|
||||
/*!
|
||||
本地默认视频流
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) RCRTCCameraOutputStream *defaultVideoStream;
|
||||
|
||||
/*!
|
||||
房间状态报告监听
|
||||
|
||||
@remarks RCRTCEngine:统计接口
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCStatusReportDelegate> statusReportDelegate;
|
||||
|
||||
/*!
|
||||
Engine 代理
|
||||
|
||||
@remarks RCRTCEngine:Engine 通知接口
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCEngineEventDelegate> delegate;
|
||||
|
||||
/*!
|
||||
整体播放音量,范围:0~100,默认值:100
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger playingVolume;
|
||||
|
||||
/*!
|
||||
所有远端流音量,范围:0~200,默认值:100
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger remotePlaybackVolume;
|
||||
|
||||
#pragma mark - 设备检测
|
||||
/*!
|
||||
设备检测
|
||||
@param interval 麦克风录制统计时间[2 10] 单位 s,大于10秒默认为10s 小于2秒按2秒计算
|
||||
|
||||
@remarks RCRTCEngine:设备检测开启接口
|
||||
added from 5.1.9
|
||||
*/
|
||||
- (void)startEchoTest:(NSTimeInterval)interval;
|
||||
|
||||
/*!
|
||||
设备检测
|
||||
|
||||
@remarks RCRTCEngine:设备检测关闭接口
|
||||
added from 5.1.9
|
||||
*/
|
||||
- (void)stopEchoTest;
|
||||
|
||||
#pragma mark - 创建自定义文件视频流
|
||||
/*!
|
||||
创建自定义文件视频流
|
||||
|
||||
@param path 文件路径
|
||||
@param replace 文件中音频是否替换麦克风数据,YES 替换麦克风数据,NO 与麦克风数据混音
|
||||
@param playback 文件中的音频是否在本端播放
|
||||
@param tag 自定义视频文件流标识
|
||||
@param config 自定视频文件流的配置信息
|
||||
|
||||
@return 自定义视频文件流
|
||||
|
||||
@discussion Added from 5.1.9
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
- (nullable RCRTCFileVideoOutputStream *)createFileVideoOutputStream:(NSString *)path
|
||||
replaceAudio:(BOOL)replace
|
||||
playback:(BOOL)playback
|
||||
tag:(NSString *)tag
|
||||
config:(RCRTCVideoStreamConfig *)config;
|
||||
|
||||
#pragma mark - 获取屏幕共享流
|
||||
/*!
|
||||
获取屏幕共享所需流
|
||||
|
||||
@param groupId groupId 苹果开发者账号后台申请
|
||||
|
||||
@remarks RCRTCEngine:RCRTCScreenShareOutputStream get 接口
|
||||
added from 5.1.8
|
||||
*/
|
||||
- (RCRTCScreenShareOutputStream *)getScreenShareVideoStreamWithGroupId:(NSString *)groupId;
|
||||
|
||||
#pragma mark - 设置媒体服务器地址
|
||||
/*!
|
||||
设置媒体服务器地址
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
|
||||
@param url 媒体服务器地址
|
||||
设置媒体服务器地址,特别注意如果设置了会覆盖导航下载下来的 media server url
|
||||
@return 设置是否成功
|
||||
*/
|
||||
- (BOOL)setMediaServerUrl:(NSString *)url;
|
||||
|
||||
#pragma mark - 听筒/扬声器切换
|
||||
/*!
|
||||
启用扬声器
|
||||
|
||||
@param useSpeaker YES 启用扬声器;NO 关闭扬声器
|
||||
@discussion
|
||||
暂态设置启用或关闭扬声器
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
@return 调用成功返回 YES
|
||||
*/
|
||||
- (BOOL)useSpeaker:(BOOL)useSpeaker DEPRECATED_MSG_ATTRIBUTE("use enableSpeaker: API instead");
|
||||
|
||||
/*!
|
||||
启用扬声器
|
||||
|
||||
@param enable 默认值为 YES;YES 启用扬声器;NO 关闭扬声器
|
||||
@discussion
|
||||
暂态设置启用或关闭扬声器,任何用户行为或者音频相关 API 的调用都有可能改变暂态设置
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
@return 调用成功返回 YES
|
||||
*/
|
||||
- (BOOL)enableSpeaker:(BOOL)enable;
|
||||
|
||||
/*!
|
||||
设置默认音频路由
|
||||
|
||||
@param defaultToSpeaker 默认为 NO,不使用扬声器作为默认音频路由;YES 使用扬声器作为默认音频路由
|
||||
@discussion
|
||||
设置默认的音频路由,就是在没有外接设备的前提下,设置系统使用听筒还是扬声器播放音频。
|
||||
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
@return 调用成功返回 YES
|
||||
*/
|
||||
- (BOOL)setDefaultAudioRouteToSpeaker:(BOOL)defaultToSpeaker;
|
||||
|
||||
#pragma mark - 自定义加密
|
||||
/*!
|
||||
设置音频输出流自定义加密回调
|
||||
|
||||
@param audioEncryptorDelegate 加密代理,接口传入 RCRTCCustomizedEncryptorDelegate 的非空实现对象表示开启自定义加密;
|
||||
如果传入 nil 代表关闭自定义加密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有发送音频进行加密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
*/
|
||||
- (void)setAudioCustomizedEncryptorDelegate:(nullable id<RCRTCCustomizedEncryptorDelegate>)audioEncryptorDelegate;
|
||||
|
||||
/*!
|
||||
设置音频输入流自定义解密回调
|
||||
|
||||
@param audioDecryptorDelegate 加密代理,接口传入 RCRTCDecryptorDelegate 的非空实现对象表示开启自定义解密;
|
||||
如果传入 nil 代表关闭自定义解密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有接收音频进行解密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
|
||||
*/
|
||||
- (void)setAudioCustomizedDecryptorDelegate:(nullable id<RCRTCCustomizedDecryptorDelegate>)audioDecryptorDelegate;
|
||||
|
||||
/*!
|
||||
设置视频输出流自定义加密回调
|
||||
|
||||
@param videoEncryptorDelegate 加密代理,接口传入 RCRTCCustomizedEncryptorDelegate 的非空实现对象表示开启自定义加密;
|
||||
如果传入 nil 代表关闭自定义加密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有发送视频进行加密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
|
||||
*/
|
||||
- (void)setVideoCustomizedEncryptorDelegate:(nullable id<RCRTCCustomizedEncryptorDelegate>)videoEncryptorDelegate;
|
||||
|
||||
/*!
|
||||
设置视频输入流自定义解密回调
|
||||
|
||||
@param videoDecryptorDelegate 加密代理,接口传入 RCRTCDecryptorDelegate 的非空实现对象表示开启自定义解密;
|
||||
如果传入 nil 代表关闭自定义解密。
|
||||
|
||||
@discussion
|
||||
该接口设置为全局设置,对所有接收视频进行解密,开启时机为加入房间前或者观众订阅流前,关闭时机为离开房间或者观众取消订阅流后,
|
||||
其它时机调用可能会不生效或者其它负面效果。
|
||||
|
||||
@remarks RCRTCEngine:加密接口
|
||||
*/
|
||||
- (void)setVideoCustomizedDecryptorDelegate:(nullable id<RCRTCCustomizedDecryptorDelegate>)videoDecryptorDelegate;
|
||||
|
||||
#pragma mark - 加入房间
|
||||
/*!
|
||||
加入房间
|
||||
|
||||
@param roomId 房间 Id, 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式 最长 64 个字符
|
||||
@param completion 加入房间回调,其中, room 对象中的 remoteUsers, 存储当前房间中的所有人, 包括发布资源和没有发布资源的人
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)joinRoom:(NSString *)roomId
|
||||
completion:(nullable void (^)(RCRTCRoom *_Nullable room, RCRTCCode code))completion;
|
||||
|
||||
/*!
|
||||
加入指定类型房间
|
||||
|
||||
@param roomId 房间 Id, 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式 最长 64 个字符
|
||||
@param config 加入房间的配置, 主要用于配置直播场景。
|
||||
@param completion 加入房间回调, 其中 room 对象中的 remoteUsers, 存储当前房间中的所有人, 包括发布资源和没有发布资源的人
|
||||
@discussion
|
||||
加入房间
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)joinRoom:(NSString *)roomId
|
||||
config:(RCRTCRoomConfig *)config
|
||||
completion:(nullable void (^)(RCRTCRoom *_Nullable room, RCRTCCode code))completion;
|
||||
|
||||
#pragma mark - 离开房间
|
||||
/*!
|
||||
离开房间,已废弃
|
||||
|
||||
@param roomId 房间 Id
|
||||
@param completion 离开房间回调
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveRoom:(NSString *)roomId
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use leaveRoom: API instead");
|
||||
|
||||
/*!
|
||||
离开房间
|
||||
|
||||
@param completion 离开房间回调
|
||||
@discussion
|
||||
离开房间时不需要调用取消资源发布, SDK 内部会做好取消发布资源逻辑
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveRoom:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 加入副房间
|
||||
/*!
|
||||
连麦邀请后加入副房间
|
||||
|
||||
@param roomId 副房间 Id, 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式 最长 64 个字符
|
||||
@param completion 加入副房间回调
|
||||
@discussion
|
||||
此方法仅供连麦加入副房间使用
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)joinOtherRoom:(NSString *)roomId
|
||||
completion:(nullable void (^)(RCRTCOtherRoom *_Nullable room, RCRTCCode code))completion;
|
||||
|
||||
#pragma mark - 离开副房间
|
||||
/*!
|
||||
离开副房间
|
||||
|
||||
@param roomId 副房间 Id
|
||||
@param isNotify 是否通知所有连麦用户结束, YES:通知 NO:不通知;
|
||||
如果想在退出副房间的同时结束 PK,请调用 RCRTCLocalUser.h 的 quitRoomPK 接口。
|
||||
@param completion 离开房间回调
|
||||
@discussion
|
||||
此方法仅供连麦离开副房间使用
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveOtherRoom:(NSString *)roomId
|
||||
notifyFinished:(BOOL)isNotify
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use leaveOtherRoom:completion: API instead");
|
||||
|
||||
/*!
|
||||
离开副房间
|
||||
|
||||
@param roomId 副房间 Id
|
||||
@param completion 离开房间回调
|
||||
@discussion
|
||||
此方法仅供连麦离开副房间使用
|
||||
|
||||
@remarks RCRTCEngine:房间接口
|
||||
*/
|
||||
- (void)leaveOtherRoom:(NSString *)roomId
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 观众订阅,取消订阅
|
||||
/*!
|
||||
观众订阅主播资源,已废弃
|
||||
|
||||
@param url 主播直播的 url
|
||||
@param streamType 需要具体订阅的媒体类型
|
||||
@param completion 动作的回调, 会依次回调主播的 RCRTCInputStream, 根据 streamType 区分是音频流还是视频流, 如主播发布了音视频流, 此回调会回调两次, 分别为音频的 RCRTCInputStream, 和视频的 RCRTCInputStream 。
|
||||
@discussion
|
||||
仅直播模式可用, 作为观众, 直接观看主播的直播, 无需加入房间, 通过传入主播的 url, 仅观众端可用,此接口可具体订阅音频流或视频流或大小流
|
||||
|
||||
@deprecated from 5.1.0
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
- (void)subscribeLiveStream:(NSString *)url
|
||||
streamType:(RCRTCAVStreamType)streamType
|
||||
completion:(nullable RCRTCLiveCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCLocalUser.h subscribeStream:tinyStreams:completion: API instead");
|
||||
|
||||
/*!
|
||||
观众取消订阅主播资源,已废弃
|
||||
|
||||
@param url 主播直播的 url
|
||||
@param completion 动作的回调
|
||||
@discussion
|
||||
仅直播模式可用, 作为观众, 退出观看主播的直播, 仅观众端使用
|
||||
|
||||
@deprecated from 5.1.0
|
||||
@remarks RCRTCEngine:媒体流操作
|
||||
*/
|
||||
- (void)unsubscribeLiveStream:(NSString *)url
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCLocalUser.h unsubscribeStreams:completion: API instead");
|
||||
|
||||
/*!
|
||||
查询当前用户已经加入的房间
|
||||
|
||||
@discussion
|
||||
查询当前用户已经加入的房间
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)queryRTCRoomJoinedInfo:(nullable void(^)(BOOL isSuccess, RCRTCCode code, NSArray <RCRTCJoinedRoomInfo *> * _Nullable infoArray))completion;
|
||||
|
||||
/*!
|
||||
加房间前探测回调
|
||||
|
||||
@discussion Add from 5.1.17
|
||||
|
||||
@remarks RCRTCEngine:统计接口
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCProbeTestDelegate> probeTestDelegate;
|
||||
|
||||
/*!
|
||||
加房间前探测
|
||||
|
||||
@param callback 开始探测操作的回调
|
||||
@discussion
|
||||
与当前的 media server 建立连接,可以从 RCRTCProbeTestDelegate 拿到探测的上下行报表数据,探测持续 30s 自动结束。
|
||||
Add from 5.1.17
|
||||
|
||||
@remarks RCRTCEngine:探测接口
|
||||
*/
|
||||
- (void)startRTCProbeTest:(nullable RCRTCOperationCallback)callback;
|
||||
|
||||
/*!
|
||||
主动结束探测
|
||||
|
||||
@param callback 开始探测操作的回调
|
||||
@discussion
|
||||
探测自动结束前,可以手动调用该接口停止探测。
|
||||
Add from 5.1.17
|
||||
|
||||
@remarks RCRTCEngine:探测接口
|
||||
*/
|
||||
- (void)stopRTCProbeTest:(nullable RCRTCOperationCallback)callback;
|
||||
|
||||
|
||||
#pragma mark - SDK 版本号
|
||||
/*!
|
||||
获取 SDK 版本号,已废弃
|
||||
|
||||
@return 版本号
|
||||
|
||||
@deprecated 4.0.5
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
- (NSString *)getRTCLibVersion DEPRECATED_MSG_ATTRIBUTE("use getVersion API instead");
|
||||
|
||||
/*!
|
||||
获取 SDK 版本号
|
||||
|
||||
@return 版本号
|
||||
|
||||
@remarks RCRTCEngine:参数配置
|
||||
*/
|
||||
+ (NSString *)getVersion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// RCRTCEngineDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/2.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
@class RCRTCBaseRoom;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音视频引擎代理
|
||||
*/
|
||||
@protocol RCRTCEngineEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/*!
|
||||
音频路由改变回调
|
||||
|
||||
@remarks RCRTCEngineEventDelegate
|
||||
|
||||
*/
|
||||
- (void)didAudioRouteChanged:(RCRTCAudioRouteType)audioRouteType;
|
||||
|
||||
/*!
|
||||
屏幕共享拓展 结束消息回调
|
||||
|
||||
@remarks RCRTCEngineEventDelegate
|
||||
Added from 5.1.8
|
||||
*/
|
||||
- (void)screenShareExtentionFinished;
|
||||
|
||||
/*!
|
||||
屏幕共享拓展 开始消息回调
|
||||
|
||||
@remarks RCRTCEngineEventDelegate
|
||||
@discussion
|
||||
需要先获取屏幕共享所需流 RCRTCEngine:RCRTCScreenShareOutputStream get 接口
|
||||
Added from 5.2.0
|
||||
*/
|
||||
- (void)screenShareExtentionStarted;
|
||||
|
||||
/*!
|
||||
被 SDK 踢出房间通知
|
||||
|
||||
@param roomId 离开的房间
|
||||
@param reason 被踢出房间原因
|
||||
@discussion
|
||||
如果用户在房间内, 此时由于某种原因被踢离开房间, SDK 会关闭音视频连接, 释放资源, 将用户踢出房间, 回调通知用户,
|
||||
如果用户不在房间内,roomId 为 nil,只释放资源,回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKicked:(nullable NSString *)roomId
|
||||
reason:(RCRTCKickedReason)reason;
|
||||
|
||||
/*!
|
||||
被 SDK 踢出房间通知
|
||||
|
||||
@param roomId 离开的房间
|
||||
@param reason 被踢出房间原因
|
||||
@param extra Server API 自定义数据
|
||||
@discussion
|
||||
如果用户在房间内, 此时由于某种原因被踢离开房间, SDK 会关闭音视频连接, 释放资源, 将用户踢出房间, 回调通知用户,
|
||||
如果用户不在房间内,roomId 为 nil,只释放资源,回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKicked:(nullable NSString *)roomId
|
||||
reason:(RCRTCKickedReason)reason
|
||||
extra:(nullable NSDictionary *)extra;
|
||||
|
||||
- (void)didKicked:(nullable NSString *)roomId
|
||||
Reason:(RCRTCKickedReason)reason DEPRECATED_MSG_ATTRIBUTE("use didKicked:reason: instead");
|
||||
/*!
|
||||
发生错误回调
|
||||
该回调方法表示 SDK 运行时出现了(网络或媒体相关的)错误。通常情况下,SDK 上报的错误意味着 SDK 无法自动恢复,需要 App 干预或提示用户。
|
||||
详细的错误代码,见 RCRTCCode。
|
||||
|
||||
@param errorCode 具体返回数据参考 RCRTCCode 说明
|
||||
*/
|
||||
- (void)didOccurError:(RCRTCCode)errorCode;
|
||||
|
||||
/*!
|
||||
如果用户在房间内, RTC连接状态变化通知
|
||||
|
||||
@param state 连接状态
|
||||
@discussion
|
||||
如果用户在房间内, RTC连接状态变化通知
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didRTCConnectionStateChanged:(RCRTCConnectionState)state;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// RCRTCFileVideoOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/8/30.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RongRTCLib/RongRTCLib.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCRTCFileVideoOutputStreamDelegate;
|
||||
|
||||
/*!
|
||||
自定义文件流
|
||||
|
||||
@discussion Added from 5.1.9
|
||||
*/
|
||||
@interface RCRTCFileVideoOutputStream : RCRTCVideoOutputStream
|
||||
/*!
|
||||
文件路径
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *filePath;
|
||||
|
||||
/*!
|
||||
文件中音频是否替换麦克风数据,YES 替换麦克风数据,NO 与麦克风数据混音
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL replace;
|
||||
|
||||
/*!
|
||||
文件中的音频是否在本端播放
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL playback;
|
||||
|
||||
/*!
|
||||
文件视频流代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCFileVideoOutputStreamDelegate> delegate;
|
||||
|
||||
/*!
|
||||
音频数据回调
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioFrameCallback audioDataCallback;
|
||||
|
||||
/*!
|
||||
停止
|
||||
|
||||
@return 是否调用成功
|
||||
|
||||
@discussion 调用此方法会停止解码文件视频流并释放文件资源
|
||||
*/
|
||||
- (BOOL)stop;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@return 失败
|
||||
|
||||
@warning
|
||||
请勿调用,仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance] 的
|
||||
createFileVideoOutputStream:replaceAudio:playback:tag:config: 方法获取实例。
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@return 失败
|
||||
|
||||
@warning
|
||||
请勿调用,仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance] 的
|
||||
createFileVideoOutputStream:replaceAudio:playback:tag:config: 方法获取实例。
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@return 失败
|
||||
|
||||
@warning
|
||||
请勿调用,仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance] 的
|
||||
createFileVideoOutputStream:replaceAudio:playback:tag:config: 方法获取实例。
|
||||
*/
|
||||
- (instancetype)initVideoOutputStreamWithTag:(NSString *)tag NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
@protocol RCRTCFileVideoOutputStreamDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
开始解码文件视频流
|
||||
*/
|
||||
- (void)fileVideoOutputStreamDidStartRead:(RCRTCFileVideoOutputStream *)stream;
|
||||
|
||||
/*!
|
||||
完成解码文件视频流
|
||||
*/
|
||||
- (void)fileVideoOutputStreamDidReadCompleted:(RCRTCFileVideoOutputStream *)stream;
|
||||
|
||||
/*!
|
||||
解码文件视频流失败
|
||||
*/
|
||||
- (void)fileVideoOutputStreamDidFailed:(RCRTCFileVideoOutputStream *)stream;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// RCRTCGlobals.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/4/3.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef RongRTCGlobals_h
|
||||
#define RongRTCGlobals_h
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define RONGRTCLIB_EXTERN extern "C"
|
||||
#else
|
||||
#define RONGRTCLIB_EXTERN extern
|
||||
#endif
|
||||
|
||||
typedef void(^RCRTCVoidBlock)(void);
|
||||
|
||||
#endif /* RongRTCGlobals_h */
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// RongRTCInputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreVideo/CoreVideo.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCVideoView;
|
||||
@class RCRTCVideoTextureView;
|
||||
@class RCRTCInputStream;
|
||||
|
||||
/*!
|
||||
接收到的音视频流
|
||||
*/
|
||||
@interface RCRTCInputStream : RCRTCStream
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCInputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// RCRTCJoinedRoomInfo.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/8/13.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
已经加入房间信息
|
||||
*/
|
||||
@interface RCRTCJoinedRoomInfo : NSObject
|
||||
|
||||
/*!
|
||||
设备ID
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *deviceId;
|
||||
|
||||
/*!
|
||||
房间号
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *roomId;
|
||||
|
||||
/*!
|
||||
房间加入时间 (毫秒)
|
||||
*/
|
||||
@property (nonatomic, assign) long long joinTime;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,745 @@
|
||||
//
|
||||
// RCRTCLibDefine.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/3.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef RCRTCLibDefine_h
|
||||
#define RCRTCLibDefine_h
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCCodeDefine.h"
|
||||
|
||||
@class RongRTCMember;
|
||||
@class RCRTCRoom;
|
||||
@class RCRTCStream;
|
||||
@class RCRTCLiveInfo;
|
||||
@class RCRTCInputStream;
|
||||
@class RCRTCVideoFrame;
|
||||
|
||||
/*!
|
||||
某些操作的回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败描述的错误码
|
||||
@discussion
|
||||
某些操作的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCOperationCallback)(BOOL isSuccess, RCRTCCode code);
|
||||
|
||||
/*!
|
||||
直播操作的回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param liveInfo 当前直播主持人的数据模型
|
||||
@discussion
|
||||
直播操作的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCLiveOperationCallback)(BOOL isSuccess, RCRTCCode code, RCRTCLiveInfo *_Nullable liveInfo);
|
||||
|
||||
/*!
|
||||
观众观看直播的回调
|
||||
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param inputStream 当前直播流
|
||||
@discussion
|
||||
观众观看直播的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCLiveCallback)(RCRTCCode code, RCRTCInputStream *_Nullable inputStream);
|
||||
|
||||
/*!
|
||||
观众观看直播的回调
|
||||
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param inputStreams 当前直播流
|
||||
@discussion
|
||||
观众观看直播的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCLiveUrlCallback)(RCRTCCode code, NSArray<RCRTCInputStream *> *_Nullable inputStreams);
|
||||
|
||||
/*!
|
||||
获取用户属性操作回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败的描述 错误码
|
||||
@param attr 获取结果
|
||||
@discussion
|
||||
获取用户属性操作回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCAttributeOperationCallback)(BOOL isSuccess, RCRTCCode code, NSDictionary *_Nullable attr);
|
||||
|
||||
/*!
|
||||
订阅操作的回调
|
||||
|
||||
@param isSuccess 操作是否成功
|
||||
@param code 成功或者失败描述的错误码
|
||||
@param subscribeErrorList 服务器返回的订阅失败列表
|
||||
@discussion
|
||||
订阅操作的回调
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
typedef void (^RCRTCSubscribeOperationCallback)(BOOL isSuccess, RCRTCCode code, NSArray<RCRTCInputStream *> *_Nullable subscribeErrorList);
|
||||
|
||||
/*!
|
||||
当前流状态
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCResourceState) {
|
||||
/*!
|
||||
流处于禁用状态
|
||||
*/
|
||||
ResourceStateDisabled = 0,
|
||||
/*!
|
||||
流处于正常状态
|
||||
*/
|
||||
ResourceStateNormal
|
||||
};
|
||||
|
||||
/*!
|
||||
资源类型
|
||||
deprecated from 5.1.8
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RTCMediaType) {
|
||||
/*!
|
||||
只有声音
|
||||
*/
|
||||
RTCMediaTypeAudio,
|
||||
/*!
|
||||
声音视频
|
||||
*/
|
||||
RTCMediaTypeVideo,
|
||||
/*!
|
||||
数据(暂不支持)
|
||||
*/
|
||||
RTCMediaTypeData,
|
||||
/*!
|
||||
空数据
|
||||
*/
|
||||
RTCMediaTypeNothing
|
||||
};
|
||||
|
||||
/*!
|
||||
媒体类型
|
||||
added from 5.1.8
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCMediaType) {
|
||||
/*!
|
||||
音频
|
||||
*/
|
||||
RCRTCMediaTypeAudio,
|
||||
/*!
|
||||
音视频
|
||||
*/
|
||||
RCRTCMediaTypeVideo,
|
||||
/*!
|
||||
数据(暂不支持)
|
||||
*/
|
||||
RCRTCMediaTypeData,
|
||||
/*!
|
||||
空数据
|
||||
*/
|
||||
RCRTCMediaTypeNothing
|
||||
};
|
||||
|
||||
/*!
|
||||
媒体流类型
|
||||
added from 5.1.8
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCMediaStreamType) {
|
||||
/*!
|
||||
默认
|
||||
*/
|
||||
RCRTCMediaStreamTypeDefault,
|
||||
/*!
|
||||
自定义
|
||||
*/
|
||||
RCRTCMediaStreamTypeCustomized,
|
||||
/*!
|
||||
直播合流
|
||||
*/
|
||||
RCRTCMediaStreamTypeMCULive,
|
||||
/*!
|
||||
CDN
|
||||
*/
|
||||
RCRTCMediaStreamTypeCDN,
|
||||
/*!
|
||||
屏幕共享
|
||||
*/
|
||||
RCRTCMediaStreamTypeScreenShare
|
||||
};
|
||||
|
||||
/*!
|
||||
视频分辨率类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoSizePreset) {
|
||||
/*!
|
||||
无效参数
|
||||
*/
|
||||
RCRTCVideoSizePresetInvalid = -1,
|
||||
/*!
|
||||
分辨率 176X144
|
||||
*/
|
||||
RCRTCVideoSizePreset176x144,
|
||||
/*!
|
||||
分辨率 180X180
|
||||
*/
|
||||
RCRTCVideoSizePreset180x180,
|
||||
/*!
|
||||
分辨率 256X144
|
||||
*/
|
||||
RCRTCVideoSizePreset256x144,
|
||||
/*!
|
||||
分辨率 240X180
|
||||
*/
|
||||
RCRTCVideoSizePreset240x180,
|
||||
/*!
|
||||
分辨率 320X180
|
||||
*/
|
||||
RCRTCVideoSizePreset320x180,
|
||||
/*!
|
||||
分辨率 240X240
|
||||
*/
|
||||
RCRTCVideoSizePreset240x240,
|
||||
/*!
|
||||
分辨率 320X240
|
||||
*/
|
||||
RCRTCVideoSizePreset320x240,
|
||||
/*!
|
||||
分辨率 360X360
|
||||
*/
|
||||
RCRTCVideoSizePreset360x360,
|
||||
/*!
|
||||
分辨率 480X360
|
||||
*/
|
||||
RCRTCVideoSizePreset480x360,
|
||||
/*!
|
||||
分辨率 640X360
|
||||
*/
|
||||
RCRTCVideoSizePreset640x360,
|
||||
/*!
|
||||
分辨率 480X480
|
||||
*/
|
||||
RCRTCVideoSizePreset480x480,
|
||||
/*!
|
||||
分辨率 640X480
|
||||
*/
|
||||
RCRTCVideoSizePreset640x480,
|
||||
/*!
|
||||
分辨率 720X480
|
||||
*/
|
||||
RCRTCVideoSizePreset720x480,
|
||||
/*!
|
||||
分辨率 848X480
|
||||
*/
|
||||
RCRTCVideoSizePreset848x480,
|
||||
/*!
|
||||
分辨率 960X720
|
||||
*/
|
||||
RCRTCVideoSizePreset960x720,
|
||||
/*!
|
||||
分辨率 1280X720
|
||||
*/
|
||||
RCRTCVideoSizePreset1280x720,
|
||||
/*!
|
||||
分辨率 1920X1080
|
||||
*/
|
||||
RCRTCVideoSizePreset1920x1080
|
||||
};
|
||||
|
||||
/*!
|
||||
视频方向
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCVideoOrientation) {
|
||||
/*!
|
||||
竖立, home 键在下部
|
||||
*/
|
||||
RCRTCVideoOrientationPortrait = 1,
|
||||
/*!
|
||||
竖立, home 键在上部
|
||||
*/
|
||||
RCRTCVideoOrientationPortraitUpsideDown,
|
||||
/*!
|
||||
横屏, home 键在左侧
|
||||
*/
|
||||
RCRTCVideoOrientationLandscapeRight,
|
||||
/*!
|
||||
竖立, home 键在右侧
|
||||
*/
|
||||
RCRTCVideoOrientationLandscapeLeft
|
||||
};
|
||||
|
||||
/*!
|
||||
视频填充模式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoFillMode) {
|
||||
/*!
|
||||
完整显示, 填充黑边
|
||||
等比例填充,直到一个维度到达区域边界
|
||||
*/
|
||||
RCRTCVideoFillModeAspectFit,
|
||||
RCRTCVideoFillModeAspect
|
||||
__attribute__((deprecated("RCRTCVideoFillModeAspect即将废弃 请更换为RCRTCVideoFillModeAspectFit"))) =
|
||||
RCRTCVideoFillModeAspectFit,
|
||||
/*!
|
||||
满屏显示
|
||||
等比例填充,直到填充满整个视图区域,其中一个维度的部分区域会被裁剪
|
||||
*/
|
||||
RCRTCVideoFillModeAspectFill,
|
||||
/*!
|
||||
非均匀模式。两个维度完全填充至整个视图区域
|
||||
*/
|
||||
RCRTCVideoFillModeResize
|
||||
};
|
||||
|
||||
/*!
|
||||
帧率
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoFPS) {
|
||||
/*!
|
||||
无效参数
|
||||
*/
|
||||
RCRTCVideoFPSInvalid = -1,
|
||||
/*!
|
||||
每秒 10 帧
|
||||
*/
|
||||
RCRTCVideoFPS10,
|
||||
/*!
|
||||
每秒 15 帧
|
||||
*/
|
||||
RCRTCVideoFPS15,
|
||||
/*!
|
||||
每秒 24 帧
|
||||
*/
|
||||
RCRTCVideoFPS24,
|
||||
/*!
|
||||
每秒 30 帧
|
||||
*/
|
||||
RCRTCVideoFPS30
|
||||
};
|
||||
|
||||
/*!
|
||||
视频编解码
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCCodecType) {
|
||||
/*!
|
||||
H264 编码
|
||||
*/
|
||||
RCRTCCodecH264
|
||||
};
|
||||
|
||||
/*!
|
||||
音频编解码
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioCodecType) {
|
||||
/*!
|
||||
PCMU
|
||||
*/
|
||||
RCRTCAudioCodecPCMU = 0,
|
||||
/*!
|
||||
OPUS
|
||||
*/
|
||||
RCRTCAudioCodecOPUS = 111
|
||||
};
|
||||
|
||||
/*!
|
||||
摄像头
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCDeviceCamera) {
|
||||
/*!
|
||||
未指明
|
||||
*/
|
||||
RCRTCCaptureDeviceUnspecified = AVCaptureDevicePositionUnspecified,
|
||||
/*!
|
||||
后置摄像头
|
||||
*/
|
||||
RCRTCCaptureDeviceBack = AVCaptureDevicePositionBack,
|
||||
/*!
|
||||
前置摄像头
|
||||
*/
|
||||
RCRTCCaptureDeviceFront = AVCaptureDevicePositionFront
|
||||
};
|
||||
|
||||
/*!
|
||||
设置加入房间时音视频使用模式
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCRoomType) {
|
||||
/*!
|
||||
普通音视频类型
|
||||
*/
|
||||
RCRTCRoomTypeNormal = 0,
|
||||
/*!
|
||||
直播类型
|
||||
*/
|
||||
RCRTCRoomTypeLive = 2,
|
||||
/*!
|
||||
跨应用多人房间
|
||||
*/
|
||||
RCRTCRoomTypeCrossMuti = 7
|
||||
};
|
||||
|
||||
/*!
|
||||
直播类型
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCLiveType) {
|
||||
/*!
|
||||
当前直播为音视频直播
|
||||
*/
|
||||
RCRTCLiveTypeAudioVideo = 0,
|
||||
|
||||
/*!
|
||||
当前直播为仅音频直播
|
||||
*/
|
||||
RCRTCLiveTypeAudio = 1
|
||||
};
|
||||
|
||||
/*!
|
||||
同一 UserID 多端加入房间处理类型
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCJoinRoomType) {
|
||||
/*!
|
||||
将之前加入房间的端踢出房间
|
||||
*/
|
||||
RCRTCJoinRoomTypeKick = 0,
|
||||
/*!
|
||||
拒绝当前端加入房间
|
||||
*/
|
||||
RCRTCJoinRoomTypeRefuse = 1
|
||||
};
|
||||
|
||||
/*!
|
||||
直播类型下的角色区分
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCLiveRoleType) {
|
||||
/*!
|
||||
当前直播角色为主播
|
||||
*/
|
||||
RCRTCLiveRoleTypeBroadcaster = 0,
|
||||
|
||||
/*!
|
||||
当前直播角色为观众
|
||||
*/
|
||||
RCRTCLiveRoleTypeAudience = 1
|
||||
};
|
||||
|
||||
/*!
|
||||
观众订阅直播类型直播类型
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAVStreamType) {
|
||||
/*!
|
||||
仅订阅音频
|
||||
*/
|
||||
RCRTCAVStreamTypeAudio = 0,
|
||||
|
||||
/*!
|
||||
仅订阅视频(大流)
|
||||
*/
|
||||
RCRTCAVStreamTypeVideo = 1,
|
||||
|
||||
/*!
|
||||
订阅音频+视频(大流)
|
||||
*/
|
||||
RCRTCAVStreamTypeAudioVideo = 2,
|
||||
|
||||
/*!
|
||||
仅订阅视频(小流)
|
||||
*/
|
||||
RCRTCAVStreamTypeVideo_tiny = 3,
|
||||
|
||||
/*!
|
||||
订阅音频+视频(小流)
|
||||
*/
|
||||
RCRTCAVStreamTypeAudioVideo_tiny = 4
|
||||
};
|
||||
|
||||
/*!
|
||||
设置音频通话质量, 默认为普通通话模式 RCRTCAudioQualitySpeech
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioQuality) {
|
||||
/*!
|
||||
人声音质,编码码率最大值为32Kbps
|
||||
*/
|
||||
RCRTCAudioQualitySpeech,
|
||||
/*!
|
||||
标清音乐音质,编码码率最大值为64Kbps
|
||||
*/
|
||||
RCRTCAudioQualityMusic,
|
||||
/*!
|
||||
高清音乐音质,编码码率最大值为128Kbps
|
||||
*/
|
||||
RCRTCAudioQualityMusicHigh,
|
||||
};
|
||||
|
||||
/*!
|
||||
设置音频通话模式, 默认为普通通话模式 RCRTCAudioScenarioDefault
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, RCRTCAudioScenario) {
|
||||
/*!
|
||||
普通通话模式(普通音质模式), 满足正常音视频场景
|
||||
*/
|
||||
RCRTCAudioScenarioDefault,
|
||||
/*!
|
||||
音乐聊天室模式, 提升声音质量, 适用对音乐演唱要求较高的场景
|
||||
*/
|
||||
RCRTCAudioScenarioMusicChatRoom,
|
||||
/*!
|
||||
音乐教室模式, 提升声音质量, 适用对乐器演奏音质要求较高的场景
|
||||
*/
|
||||
RCRTCAudioScenarioMusicClassRoom
|
||||
};
|
||||
|
||||
/*!
|
||||
被踢原因
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCKickedReason) {
|
||||
/*!
|
||||
被服务端踢下线
|
||||
*/
|
||||
RCRTCKickedReasonForServer = 1,
|
||||
/*!
|
||||
被同一UserId加入其他房间踢出当前房间
|
||||
*/
|
||||
RCRTCKickedReasonForOtherJoinedRoom,
|
||||
/*!
|
||||
关闭 SDK 断线重连,SDK 将用户踢出房间
|
||||
*/
|
||||
RCRTCKickedReasonForSDKDisconnect,
|
||||
/*!
|
||||
IMLib 退出登录,SDK 将用户踢出房间
|
||||
*/
|
||||
RCRTCKickedReasonForIMLogout,
|
||||
/*!
|
||||
被其它端登录挤下线
|
||||
*/
|
||||
RCRTCKickedReasonForOtherClientLogin,
|
||||
/*!
|
||||
服务器销毁房间,被迫离开房间
|
||||
*/
|
||||
RCRTCKickedReasonForSeverDestory
|
||||
};
|
||||
|
||||
/*!
|
||||
RTC连接状态
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCConnectionState) {
|
||||
/*!
|
||||
连接中
|
||||
*/
|
||||
RCRTCConnectionStateConnecting,
|
||||
/*!
|
||||
已连接
|
||||
*/
|
||||
RCRTCConnectionStateConnected
|
||||
};
|
||||
|
||||
/*!
|
||||
代理协议类型
|
||||
*/
|
||||
typedef NS_OPTIONS(NSUInteger, RCRTCProxyOptions) {
|
||||
RCRTCProxyOptionsNone = 0,
|
||||
RCRTCProxyOptionsHTTP = 1 << 0,
|
||||
RCRTCProxyOptionsUDP = 1 << 1,
|
||||
RCRTCProxyOptionsAll = RCRTCProxyOptionsHTTP | RCRTCProxyOptionsUDP
|
||||
};
|
||||
|
||||
/*!
|
||||
视频帧格式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCVideoFrameFormat) {
|
||||
/*!
|
||||
NV12
|
||||
*/
|
||||
RCRTCVideoFrameFormatNV12,
|
||||
/*!
|
||||
BGRA
|
||||
*/
|
||||
RCRTCVideoFrameFormatBGRA,
|
||||
/*!
|
||||
I420
|
||||
*/
|
||||
RCRTCVideoFrameFormatI420
|
||||
};
|
||||
|
||||
/*!
|
||||
音频路由类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, RCRTCAudioRouteType) {
|
||||
/*!
|
||||
扬声器
|
||||
*/
|
||||
RCRTCAudioRouteTypeSpeaker,
|
||||
/*!
|
||||
听筒
|
||||
*/
|
||||
RCRTCAudioRouteTypeReceiver,
|
||||
/*!
|
||||
耳机
|
||||
*/
|
||||
RCRTCAudioRouteTypeHeadphone,
|
||||
/*!
|
||||
蓝牙设备
|
||||
*/
|
||||
RCRTCAudioRouteTypeBluetooth
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
原始音频数据
|
||||
*/
|
||||
@interface RCRTCAudioFrame : NSObject
|
||||
|
||||
/*!
|
||||
音频数据
|
||||
*/
|
||||
@property (assign, nonatomic) uint8_t * bytes;
|
||||
/*!
|
||||
音频数据长度(字节数)
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t length;
|
||||
/*!
|
||||
声道数
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t channels;
|
||||
/*!
|
||||
采样率
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t sampleRate;
|
||||
/*!
|
||||
位深
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t bytesPerSample;
|
||||
/*!
|
||||
帧数
|
||||
*/
|
||||
@property (assign, nonatomic) int32_t samples;
|
||||
/*!
|
||||
时间戳
|
||||
*/
|
||||
@property (assign, nonatomic) uint64_t renderTimeMs;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCASRContent : NSObject
|
||||
/**
|
||||
当前语音识别关联用户的 ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userId;
|
||||
/**
|
||||
当前语音识别的 ID, 用于关联当前语音识别结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msgId;
|
||||
/**
|
||||
当前语音识别的时间戳, 单位为秒
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval timeUTC;
|
||||
/**
|
||||
当前语音识别结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msg;
|
||||
/**
|
||||
当前语音识别是否结束, 如果为 YES, 则表示当前语音识别已结束
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEnd;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCRTCRealtimeTranslationContent : NSObject
|
||||
/**
|
||||
当前语音翻译的目标语言码
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *destLangCode;
|
||||
/**
|
||||
当前语音翻译关联用户的 ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userId;
|
||||
/**
|
||||
当前语音翻译的 ID, 用于关联当前语音识别和语音翻译结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msgId;
|
||||
/**
|
||||
当前语音翻译的时间戳, 单位为秒
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval timeUTC;
|
||||
/**
|
||||
当前语音翻译结果
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *msg;
|
||||
/**
|
||||
当前语音翻译是否结束, 如果为 YES, 则表示当前语音翻译已结束
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isEnd;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
/*!
|
||||
视频帧回调
|
||||
|
||||
@param valid 该视频帧是否有效
|
||||
@param videoFrame 视频帧内容
|
||||
@discussion
|
||||
视频帧回调
|
||||
|
||||
@remarks 视频流处理
|
||||
@return 用户自定义视频帧
|
||||
*/
|
||||
typedef RCRTCVideoFrame *_Nullable (^RCRTCVideoFrameCallback)(BOOL valid, RCRTCVideoFrame *_Nullable videoFrame);
|
||||
|
||||
/*!
|
||||
视频帧回调
|
||||
|
||||
@param valid 该视频帧是否有效
|
||||
@param sampleBuffer 视频帧内容
|
||||
@discussion
|
||||
视频帧回调
|
||||
|
||||
@remarks 视频流处理
|
||||
@return 用户自定义视频帧
|
||||
*/
|
||||
typedef CMSampleBufferRef _Nullable (^RCRTCVideoCMSampleBufferCallback)(BOOL valid,
|
||||
CMSampleBufferRef _Nullable sampleBuffer);
|
||||
|
||||
/*!
|
||||
音频输入输出的回调
|
||||
|
||||
@param inNumberFrames 帧个数
|
||||
@param ioData 音频 pcm 数据
|
||||
@param inTimeStamp 音频时间戳
|
||||
@param asbd 音频数据格式
|
||||
@discussion
|
||||
音频输入输出的回调
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
typedef void (^RCRTCAudioDataCallback)(UInt32 inNumberFrames,
|
||||
AudioBufferList *_Nonnull ioData,
|
||||
const AudioTimeStamp *_Nonnull inTimeStamp,
|
||||
const AudioStreamBasicDescription asbd);
|
||||
|
||||
/*!
|
||||
音频数据的回调
|
||||
|
||||
@param frame 音频数据
|
||||
@discussion
|
||||
音频输入输出的回调
|
||||
|
||||
@remarks 音频流处理
|
||||
*/
|
||||
typedef void (^RCRTCAudioFrameCallback)(RCRTCAudioFrame *_Nonnull frame);
|
||||
|
||||
#endif /* RCRTCLibDefine_h */
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// RCRTCLiveAudioStatus.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/10/18.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCLiveAudioStatus : NSObject
|
||||
|
||||
/*!
|
||||
用户Id
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *userId;
|
||||
|
||||
/*!
|
||||
流Id
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *streamId;
|
||||
|
||||
/*!
|
||||
音量大小, 0 - 9表示音量高低
|
||||
*/
|
||||
@property (nonatomic, readonly) NSInteger audioLevel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// RCRTCLiveInfo.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/8/22.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCMixConfig.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCLiveInfo : NSObject
|
||||
|
||||
/**
|
||||
当前的直播地址(已废弃)
|
||||
@discussion 新版观众加房间,直接可以拿到直播合流, 单个主播流,使用常规方式订阅即可
|
||||
@deprecated from 5.1.0
|
||||
*/
|
||||
@property (nonatomic, copy, readonly)
|
||||
NSString *liveUrl DEPRECATED_MSG_ATTRIBUTE("audience can join room on 5.1.0 version");
|
||||
|
||||
/*!
|
||||
设置是否开启内置CDN
|
||||
|
||||
@param enable YES开启,NO关闭, 默认是NO
|
||||
@param completion 动作的回调
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)enableInnerCDN:(BOOL)enable completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion;
|
||||
|
||||
/*!
|
||||
设置混流布局配置
|
||||
|
||||
@param config 混流布局配置
|
||||
@param completion 动作的回调
|
||||
@discussion
|
||||
设置混流布局配置
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setMixStreamConfig:(RCRTCMixConfig *)config
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use setMixConfig:completion: API instead");
|
||||
|
||||
/*!
|
||||
设置混流布局配置
|
||||
|
||||
@param config 混流布局配置
|
||||
@param completion 动作的回调
|
||||
@discussion
|
||||
设置混流布局配置
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)setMixConfig:(RCRTCMixConfig *)config completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code))completion;
|
||||
|
||||
/*!
|
||||
添加一个 CDN 直播推流地址
|
||||
|
||||
@param url 推流地址
|
||||
@param completion 回调
|
||||
*/
|
||||
- (void)addPublishStreamUrl:(NSString *)url
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code, NSArray * _Nullable array))completion;
|
||||
|
||||
/*!
|
||||
删除一个 CDN 直播推流地址
|
||||
|
||||
@param url 要删除的推流地址
|
||||
@param completion 回调
|
||||
*/
|
||||
- (void)removePublishStreamUrl:(NSString *)url
|
||||
completion:(nullable void (^)(BOOL isSuccess, RCRTCCode code, NSArray * _Nullable array))completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,592 @@
|
||||
//
|
||||
// RCRTCLocalUser.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/9.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AvailabilityMacros.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RCRTCCodeDefine.h"
|
||||
#import "RCRTCUser.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCOutputStream;
|
||||
@class RCRTCInputStream;
|
||||
@class RCMessageContent;
|
||||
|
||||
/*!
|
||||
音视频本地用户(当前登陆者)
|
||||
*/
|
||||
@interface RCRTCLocalUser : RCRTCUser
|
||||
|
||||
/*!
|
||||
本地用户发布的音视频流
|
||||
*/
|
||||
@property (nonatomic, copy, readonly)
|
||||
NSArray<RCRTCOutputStream *> *localStreams DEPRECATED_MSG_ATTRIBUTE("use streams property instead");
|
||||
|
||||
/*!
|
||||
本地用户发布的音视频流
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSArray<RCRTCOutputStream *> *streams;
|
||||
|
||||
#pragma mark - 用户属性
|
||||
/*!
|
||||
设置全局用户属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息(也不会收到有用户属性变换的回调)
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setAttributeValue:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion
|
||||
DEPRECATED_MSG_ATTRIBUTE("use setAttribute:forKey:message:completion: API instead");
|
||||
|
||||
/*!
|
||||
设置全局用户属性
|
||||
|
||||
@param attributeValue 属性值
|
||||
@param key 属性名称
|
||||
@param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息(也不会收到有用户属性变换的回调)
|
||||
@param completion 设置完成回调
|
||||
@discussion
|
||||
设置用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)setAttribute:(NSString *)attributeValue
|
||||
forKey:(NSString *)key
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
删除全局用户属性
|
||||
|
||||
@param attributeKeys 属性名称数组
|
||||
@param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息
|
||||
@param completion 删除完成回调
|
||||
@discussion
|
||||
删除用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)deleteAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
message:(nullable RCMessageContent *)message
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
获取全局用户属性
|
||||
|
||||
@param attributeKeys 属性名称
|
||||
@param completion 获取结果回调
|
||||
@discussion
|
||||
获取用户属性
|
||||
|
||||
@remarks 房间管理
|
||||
*/
|
||||
- (void)getAttributes:(NSArray<NSString *> *)attributeKeys
|
||||
completion:(nullable RCRTCAttributeOperationCallback)completion;
|
||||
|
||||
#pragma mark - 发布资源
|
||||
/*!
|
||||
发布本地默认音视频流
|
||||
|
||||
@param completion 发布完成回调
|
||||
@discussion
|
||||
发布默认音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishDefaultStreams:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布本地指定音视频流
|
||||
|
||||
@param stream 发布的音视频流
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
发布音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布多路本地指定音视频流
|
||||
|
||||
@param streams 发布音视频流集合
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
发布多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishStreams:(nullable NSArray<RCRTCOutputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布本地默认音视频流,直播模式专用
|
||||
|
||||
@param completion 发布完成回调
|
||||
@discussion
|
||||
发布主播默认音视频流, 此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishDefaultLiveStreams:(nullable RCRTCLiveOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
发布本地指定音视频流,直播模式专用
|
||||
|
||||
@param stream 发布的音视频流
|
||||
@param completion 发布的音视频流结果, 包括此主播的推流 url
|
||||
@discussion
|
||||
发布直播音视频流, 此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)publishLiveStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCLiveOperationCallback)completion;
|
||||
|
||||
#pragma mark - 取消发布资源
|
||||
/*!
|
||||
取消发布本地默认音视频流
|
||||
|
||||
@param completion 取消发布完成回调
|
||||
@discussion
|
||||
取消发布默认音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishDefaultStreams:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布本地指定音视频流
|
||||
|
||||
@param stream 取消发布的音视频流
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
取消发布音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布多路本地指定音视频流
|
||||
|
||||
@param streams 取消发布的音视频流集合
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
取消发布多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishStreams:(nullable NSArray<RCRTCOutputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布本地默认音视频流,直播模式专用
|
||||
|
||||
@param completion 取消发布完成回调
|
||||
@discussion
|
||||
取消发布默认音视频流,此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishDefaultLiveStreams:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消发布本地指定音视频流,直播模式专用
|
||||
|
||||
@param stream 取消发布的音视频流
|
||||
@param completion 发布的音视频流结果
|
||||
@discussion
|
||||
取消发布音视频流,此接口仅直播模式的主播可用, 即 RCRTCRoomType 为 RCRTCRoomTypeLive 可用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unpublishLiveStream:(nullable RCRTCOutputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 订阅资源
|
||||
/*!
|
||||
订阅多路远端指定音视频流
|
||||
|
||||
@param avStreams 普通流数组
|
||||
@param tinyStreams 小流数组,同一个流只能填写在 avStreams 或 tinyStreams 中的一个数组中
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
订阅流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStream:(nullable NSArray<RCRTCInputStream *> *)avStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)tinyStreams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
订阅多路远端指定音视频流
|
||||
|
||||
@param avStreams 普通流数组
|
||||
@param tinyStreams 小流数组,同一个流只能填写在 avStreams 或 tinyStreams 中的一个数组中
|
||||
@param callback 完成的回调
|
||||
@discussion
|
||||
订阅流,callback 返回订阅结果,callback 中 subscribeErrorList 为服务器返回的订阅失败列表;另外可能存在 isSuccess 为 YES,但是 subscribeErrorList 不为空的情况,这种情况是部分订阅成功,用户可以根据业务决定是否对 subscribeErrorList 中的流进行重新订阅
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStreams:(nullable NSArray<RCRTCInputStream *> *)avStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)tinyStreams
|
||||
callback:(nullable RCRTCSubscribeOperationCallback)callback;
|
||||
|
||||
/*!
|
||||
观众订阅合流资源
|
||||
|
||||
@param liveUrl 主播直播的 liveUrl (针对 4x版本的主播兼容方案)
|
||||
@param streamType 需要具体订阅的媒体类型
|
||||
@param completion 完成的回调, 会依次回调合流的 RCRTCInputStream, 根据 streamType 区分是音频流还是视频流, 如主播发布了音视频流, 此回调会回调两次, 分别为音频的 RCRTCInputStream, 和视频的 RCRTCInputStream 。
|
||||
@discussion
|
||||
仅直播模式可用, 作为观众, 直接观看主播的直播, 通过传入主播的 url, 仅观众端可用,此接口可具体订阅音频流或视频流或大小流
|
||||
Added from 5.1.0
|
||||
|
||||
@remarks 媒体流操作
|
||||
*/
|
||||
- (void)subscribeLiveUrl:(nullable NSString *)liveUrl
|
||||
streamType:(RCRTCAVStreamType)streamType
|
||||
completion:(nullable RCRTCLiveUrlCallback)completion;
|
||||
|
||||
#pragma mark - 取消订阅资源
|
||||
/*!
|
||||
取消订阅远端指定音视频流
|
||||
|
||||
@param stream 音视频流
|
||||
@param completion 音视频流结果
|
||||
@discussion
|
||||
取消订阅音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unsubscribeStream:(nullable RCRTCInputStream *)stream completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消订阅多路远端指定音视频流
|
||||
|
||||
@param streams 音视频流集合
|
||||
@param completion 音视频流结果
|
||||
@discussion
|
||||
取消订阅多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)unsubscribeStreams:(nullable NSArray<RCRTCInputStream *> *)streams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 订阅与取消订阅
|
||||
/*!
|
||||
同时订阅+取消订阅多路远端指定音视频流
|
||||
|
||||
在订阅时, 同一个流只能填写在 subStreams 或 subTinyStreams 中的一个数组中
|
||||
订阅列表与取消订阅列表不能存在重复的音视频流
|
||||
|
||||
@param subStreams 普通音视频流列表
|
||||
@param subTinyStreams 需要携带小流的流数组
|
||||
@param unsubStreams 取消订阅的音视频数组
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
订阅+取消订阅多路远端指定音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStreams:(nullable NSArray<RCRTCInputStream *> *)subStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)subTinyStreams
|
||||
unsubscribeStreams:(nullable NSArray<RCRTCInputStream *> *)unsubStreams
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
同时订阅+取消订阅多路远端指定音视频流
|
||||
|
||||
在订阅时, 同一个流只能填写在 subStreams 或 subTinyStreams 中的一个数组中
|
||||
订阅列表与取消订阅列表不能存在重复的音视频流
|
||||
|
||||
@param subStreams 普通音视频流列表
|
||||
@param subTinyStreams 需要携带小流的流数组
|
||||
@param unsubStreams 取消订阅的音视频数组
|
||||
@param callback 完成的回调
|
||||
@discussion
|
||||
订阅+取消订阅多路远端指定音视频流,callback 返回订阅结果,callback 中 subscribeErrorList 为服务器返回的订阅失败列表;另外可能存在 isSuccess 为 YES,但是 subscribeErrorList 不为空的情况,这种情况是部分订阅成功,用户可以根据业务决定是否对 subscribeErrorList 中的流进行重新订阅
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)subscribeStreams:(nullable NSArray<RCRTCInputStream *> *)subStreams
|
||||
tinyStreams:(nullable NSArray<RCRTCInputStream *> *)subTinyStreams
|
||||
unsubscribeStreams:(nullable NSArray<RCRTCInputStream *> *)unsubStreams
|
||||
callback:(nullable RCRTCSubscribeOperationCallback)callback;
|
||||
|
||||
#pragma mark - 跨房间连麦
|
||||
/*!
|
||||
向指定用户发送跨房间连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param autoMix 是否将被邀请人音视频资源合流到邀请人房间中
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)requestJoinOtherRoom:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use requestRoomPK:forKey:userId:autoMix:extra:completion: API instead");
|
||||
|
||||
/*!
|
||||
向指定用户发送PK连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param autoMix 是否将被邀请人音视频资源合流到邀请人房间中
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)requestRoomPK:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
取消正在进行中的跨房间连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)cancelRequestJoinOtherRoom:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use cancelRequestJoinPK:userId:extra:completion: API instead");
|
||||
|
||||
/*!
|
||||
取消正在进行中的PK连麦请求
|
||||
|
||||
@param inviteeRoomId 被邀请人所在房间号
|
||||
@param inviteeUserId 被邀请人userId
|
||||
@param extra 附加信息, 可随消息发送给被邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
仅供连麦使用
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)cancelRequestJoinPK:(nullable NSString *)inviteeRoomId
|
||||
userId:(nullable NSString *)inviteeUserId
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
响应跨房间连麦请求
|
||||
|
||||
@param inviterRoomId 邀请人所在的房间号
|
||||
@param inviterUserId 邀请人userId
|
||||
@param agree 是否同意加入副房间
|
||||
@param autoMix 是否将邀请人音视频资源合流到被邀请人(响应邀请的人)房间中
|
||||
@param extra 附加信息, 可随消息发送给邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
取消订阅多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)responseJoinOtherRoom:(nullable NSString *)inviterRoomId
|
||||
userId:(nullable NSString *)inviterUserId
|
||||
agree:(BOOL)agree
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion DEPRECATED_MSG_ATTRIBUTE("use responseRoomPK:userId:agree:autoMix:extra:completion: API instead");
|
||||
|
||||
/*!
|
||||
响应PK连麦请求
|
||||
|
||||
@param inviterRoomId 邀请人所在的房间号
|
||||
@param inviterUserId 邀请人userId
|
||||
@param agree 是否同意加入副房间
|
||||
@param autoMix 是否将邀请人音视频资源合流到被邀请人(响应邀请的人)房间中
|
||||
@param extra 附加信息, 可随消息发送给邀请人
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
取消订阅多路音视频流
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)responseRoomPK:(nullable NSString *)inviterRoomId
|
||||
userId:(nullable NSString *)inviterUserId
|
||||
agree:(BOOL)agree
|
||||
autoMix:(BOOL)autoMix
|
||||
extra:(nullable NSString *)extra
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
结束PK连麦
|
||||
|
||||
@param roomId 副房间 Id
|
||||
@param completion 完成的回调
|
||||
@discussion
|
||||
通知所有连麦用户结束连麦
|
||||
|
||||
@remarks 资源管理
|
||||
*/
|
||||
- (void)quitRoomPK:(nullable NSString *)roomId
|
||||
completion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
#pragma mark - 身份切换
|
||||
/*!
|
||||
主播切换到观众
|
||||
|
||||
@param onSucceed 切换成功的回调。
|
||||
@param onFailed 切换失败会回调,但不影响当前角色继续音视频。
|
||||
@param onKicked 切换失败会回调,SDK内部会退出房间并清理所有资源,该用户只能重新加入房间才能继续音视频。
|
||||
|
||||
@discussion
|
||||
当前角色为主播,切换角色到观众,仅限主播使用。
|
||||
如果当前用户加入了 RCRTCOtherRoom 切换为观众时,RTC SDK 内部会帮其退出所有 RCRTCOtherRoom。
|
||||
Added from 5.1.9
|
||||
*/
|
||||
- (void)switchToAudienceOnSucceed:(nullable void (^)(void))onSucceed
|
||||
onFailed:(nullable void (^)(RCRTCCode code))onFailed
|
||||
onKicked:(nullable void (^)(void))onKicked;
|
||||
|
||||
/*!
|
||||
观众切换到主播
|
||||
|
||||
@param publishStreams 切换成主播后需要发布的流。
|
||||
@param onSucceed 切换成功的回调
|
||||
@param onFailed 切换失败会回调,但不影响当前角色继续音视频。
|
||||
@param onKicked 切换失败会回调,SDK内部会退出房间并清理所有资源,该用户只能重新加入房间才能继续音视频。
|
||||
|
||||
@discussion
|
||||
观众切换角色到主播,仅限观众使用。
|
||||
Added from 5.1.9
|
||||
*/
|
||||
- (void)switchToBroadcaster:(NSArray<RCRTCOutputStream *> *)publishStreams
|
||||
onSucceed:(nullable void (^)(RCRTCLiveInfo *liveInfo))onSucceed
|
||||
onFailed:(nullable void (^)(RCRTCCode code))onFailed
|
||||
onKicked:(nullable void (^)(void))onKicked;
|
||||
|
||||
|
||||
/*!
|
||||
设置开启 SEI 功能
|
||||
|
||||
@param enable YES 开启,NO 不开启,默认 NO
|
||||
@param completion 开启结果的回调
|
||||
|
||||
@discussion 开启 SEI 功能观众身份调用无效,观众不允许发布流,所以不具备 SEI 能力。
|
||||
Added from 5.2.5
|
||||
*/
|
||||
- (void)setEnableSEI:(BOOL)enable
|
||||
completion:(void(^)(BOOL isSuccess, RCRTCCode errCode))completion;
|
||||
|
||||
/*!
|
||||
发送媒体增强补充信息
|
||||
|
||||
@param SEI 数据字符
|
||||
@discussion 此接口可在开发者推流传输音视频流数据并且[setEnableSEI] 开启SEI 功能的同时,发送流媒体增强补充信息来同步一些其他附加信息。
|
||||
一般如同步音乐歌词或视频画面精准布局等场景,可选择使用发送 SEI。当推流方发送 SEI 后,拉流方可通过 RCRTCRoomEventDelegate 监听 [didReceiveSEI] & [didReceiveLiveStreamSEI] 的回调获取 SEI 内容。由于 SEI 信息跟随视频帧,由于网络问题有可能丢帧,因此 SEI 信息也有可能丢,为解决这种情况,应该在限制频率内多发几次。限制频率:1秒钟不要超过30次。SEI 数据长度限制为 4096 字节。
|
||||
@return 0 成功,非 0 失败,返回具体错误码
|
||||
Added from 5.2.5
|
||||
*/
|
||||
- (RCRTCCode)sendSEI:(NSString *)SEI;
|
||||
|
||||
/*!
|
||||
开启语音识别服务
|
||||
|
||||
@param completion 开启语音识别服务回调
|
||||
|
||||
@discussion
|
||||
开启语音识别服务,如果房间内没有人发布流,则无法开启语音识别服务,SDK 会在有人发布流后补偿进行开启语音识别服务
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)startASR:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
停止语音识别服务
|
||||
|
||||
@param completion 停止语音识别服务回调
|
||||
|
||||
@discussion
|
||||
停止语音识别服务
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)stopASR:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
获取语音识别服务是否可用
|
||||
|
||||
@return YES 表示语音识别服务已经开启,NO 表示语音识别服务已经停止
|
||||
|
||||
@discussion
|
||||
获取语音识别服务是否可用,非实时查询接口,根据端上缓存进行的判断
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (BOOL)asrIsAvailable;
|
||||
|
||||
/*!
|
||||
开启语音翻译
|
||||
@param destLangCode 翻译目标语言码
|
||||
|
||||
@discussion
|
||||
1. 语音翻译依赖语音识别服务,需要在收到 RCRTCRoomEventDelegate 的 didReceiveStartASR 回调后,调用开启语音翻译
|
||||
2. 开启语音翻译,会通过 RCRTCRoomEventDelegate 的 didReceiveRealtimeTranslationContent 回调返回语音翻译结果
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)startRealtimeTranslation:(NSString *)destLangCode copmletion:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
关闭语音翻译
|
||||
|
||||
@discussion
|
||||
关闭语音翻译
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (void)stopRealtimeTranslation:(nullable RCRTCOperationCallback)completion;
|
||||
|
||||
/*!
|
||||
设置是否接收语音识别信息
|
||||
@param enable 是否接收语音识别信息
|
||||
|
||||
@discussion
|
||||
设置接收语音识别信息时候,会通过 RCRTCRoomEventDelegate 的 didReceiveASRContent 回调返回语音识别结果
|
||||
|
||||
@remarks 语音识别
|
||||
*/
|
||||
- (int)setEnableASR:(BOOL)enable;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// RCLocalPreviewView.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2018/12/17.
|
||||
// Copyright © 2018年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "RCRTCVideoPreviewView.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
⚠️ RCRTCLocalVideoView 即将废弃 , 请使用RCRTCVideoView
|
||||
|
||||
@discussion deprecated from 5.1.10
|
||||
*/
|
||||
__attribute__((deprecated("Class RCRTCLocalVideoView is deprecated , use Class RCRTCVideoView instead")))
|
||||
|
||||
@interface RCRTCLocalVideoView : RCRTCVideoPreviewView
|
||||
/*!
|
||||
刷新渲染视图 View
|
||||
|
||||
@discussion
|
||||
刷新渲染视图 View
|
||||
|
||||
@remarks 视频配置
|
||||
*/
|
||||
- (void)flushVideoView DEPRECATED_MSG_ATTRIBUTE("Method flushVideoView is deprecated");
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// RCRTCMediaConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCVideoConfig;
|
||||
@class RCRTCAudioConfig;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCMediaConfig : NSObject
|
||||
|
||||
/*!
|
||||
视频配置
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCVideoConfig *videoConfig;
|
||||
|
||||
/*!
|
||||
音频配置
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCAudioConfig *audioConfig;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// RCRTCMicOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/4/16.
|
||||
// Copyright © 2020年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RCRTCAudioMixer.h"
|
||||
#import "RCRTCAudioOutputStream.h"
|
||||
#import "RCRTCLibDefine.h"
|
||||
#import "RCRTCOutputStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
麦克风输出流,以麦克风为音频源的音频输出流
|
||||
*/
|
||||
@interface RCRTCMicOutputStream : RCRTCAudioOutputStream
|
||||
|
||||
/*!
|
||||
麦克风的音量,范围:0~200,默认值:100
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger recordingVolume;
|
||||
|
||||
/*!
|
||||
音频码率
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) NSInteger bitrateValue;
|
||||
|
||||
/*!
|
||||
音频编解码方式
|
||||
默认: OPUS
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) RCRTCAudioCodecType audioCodecType;
|
||||
|
||||
/*!
|
||||
音频通话质量
|
||||
默认: 人声音质,RCRTCAudioQualitySpeech
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) RCRTCAudioQuality audioQuality;
|
||||
|
||||
/*!
|
||||
音频通话模式
|
||||
默认: 普通通话模式,RCRTCAudioScenarioDefault
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) RCRTCAudioScenario audioScenario;
|
||||
|
||||
/*!
|
||||
本地发送的音频数据(合流)回调
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioDataCallback willSendAudioBufferCallback;
|
||||
|
||||
/*!
|
||||
麦克风的音频数据回调
|
||||
added from 5.1.6
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) RCRTCAudioFrameCallback recordAudioDataCallback;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultAudioStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return 失败
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用,如要获取实例对象,请使用 [RCRTCEngine sharedInstance].defaultAudioStream 获取实例。
|
||||
|
||||
@remarks 资源管理
|
||||
@return 失败
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
关闭/打开麦克风
|
||||
|
||||
@param disable YES 关闭,NO 打开
|
||||
@discussion
|
||||
关闭/打开麦克风
|
||||
|
||||
@remarks 音频配置
|
||||
*/
|
||||
- (void)setMicrophoneDisable:(BOOL)disable;
|
||||
|
||||
/*!
|
||||
设置音频通话质量和音频通话模式
|
||||
|
||||
@param audioQuality 音频通话质量, audioScenario 音频通话模式
|
||||
@discussion
|
||||
设置音频通话质量和音频通话模式
|
||||
|
||||
@remarks 音频流处理
|
||||
@return 设置是否成功
|
||||
*/
|
||||
- (BOOL)setAudioQuality:(RCRTCAudioQuality)audioQuality Scenario:(RCRTCAudioScenario)audioScenario;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// RCRTCMixConfig.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/2/13.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCCustomLayout.h"
|
||||
#import "RCRTCCustomMixAudio.h"
|
||||
#import "RCRTCMediaConfig.h"
|
||||
#import "RCRTCStream.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCMixLayoutMode) {
|
||||
/*!
|
||||
自定义布局
|
||||
*/
|
||||
RCRTCMixLayoutModeCustom = 1,
|
||||
/*!
|
||||
悬浮布局
|
||||
*/
|
||||
RCRTCMixLayoutModeSuspension = 2,
|
||||
/*!
|
||||
自适应布局
|
||||
*/
|
||||
RCRTCMixLayoutModeAdaptive = 3
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCMixMediaType) {
|
||||
/*!
|
||||
音频
|
||||
*/
|
||||
RCRTCMixMediaType_Audio = 1,
|
||||
/*!
|
||||
视频
|
||||
*/
|
||||
RCRTCMixMediaType_Video = 2,
|
||||
/*!
|
||||
音视频
|
||||
*/
|
||||
RCRTCMixMediaType_AV = 3
|
||||
};
|
||||
|
||||
@interface RCRTCMixConfig : NSObject
|
||||
|
||||
/*!
|
||||
合流服务版本,不支持修改
|
||||
|
||||
@discussion
|
||||
从 5.1.1 版本,version 变更为 2
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSInteger version;
|
||||
|
||||
/*!
|
||||
合流布局模式
|
||||
|
||||
1:自定义布局,需要设置 customLayouts 2:悬浮布局 3:自适应布局
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCMixLayoutMode layoutMode;
|
||||
|
||||
/**
|
||||
mode 为 2 或者 3 时可用,作用将此 stream 置顶,必须为视频流
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) RCRTCStream *hostVideoStream;
|
||||
|
||||
/*!
|
||||
自定义模式开关
|
||||
|
||||
@discussion
|
||||
1. version == 1 时,customMode 字段不传, 保持上次逻辑不变,上次是按需订阅,就按需订阅。
|
||||
2. version == 2 时,customMode == YES,按自定义视频布局列表 customLayouts,自定义混音音频列表 customMixAudios 来筛选。
|
||||
2.1 当 customLayouts == nil,按之前逻辑通过设置 layoutMode 控制合流;
|
||||
2.2 当 customLayouts != nil,且 customLayouts.count == 0,所有视频流都不合流;
|
||||
2.3 当 customLayouts != nil,且 customLayouts.count != 0,layoutMode == 2 || layoutMode == 3,按 customLayouts 列表指定的视频流进行合流,但里面的 x,y,width,height 不会生效;
|
||||
2.4 当 customLayouts != nil,且 customLayouts.count != 0,layoutMode == 1,按 customLayouts 列表指定的视频流进行合流,并且按照设置的 x,y,width,height 进行布局;
|
||||
2.5 当 customMixAudios == nil,可参与合流的音频流和之前保持一致;
|
||||
2.6 当 customMixAudios != nil,且 customMixAudios.count == 0,所有音频流都不合流;
|
||||
2.7 当 customMixAudios != nil,且 customMixAudios.count != 0,按照 customMixAudios 列表指定的音频流进行合流;
|
||||
3. version == 2 时,customMode == NO,取消之前设置过的参数筛选配置
|
||||
Added from 5.1.1
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL customMode;
|
||||
|
||||
/*!
|
||||
自定义视频流列表,SDK 根据输入视频流列表中的流进行混流,效果为设置其他人的窗口排版
|
||||
*/
|
||||
@property (nonatomic, strong) NSMutableArray<RCRTCCustomLayout *> *customLayouts;
|
||||
|
||||
/*!
|
||||
自定义音频流列表,SDK 根据输入音频流列表中的流进行混流
|
||||
|
||||
@discussion
|
||||
Added from 5.1.1
|
||||
*/
|
||||
@property (nonatomic, strong) NSMutableArray<RCRTCCustomMixAudio *> *customMixAudios;
|
||||
|
||||
/*!
|
||||
合流音视频配置,包括音频和视频
|
||||
*/
|
||||
@property (nonatomic, strong) RCRTCMediaConfig *mediaConfig;
|
||||
|
||||
/*!
|
||||
设置 MCU 混流配置
|
||||
|
||||
@param mixVideos 视频输入混流列表,为 nil 代表视频全混流,为空数组代表视频全不混流,否则按输入列表进行混流
|
||||
@param mixAudios 音频输入混流列表,为 nil 代表音频全混流,为空数组代表音频全不混流,否则按输入列表进行混流
|
||||
@discussion
|
||||
通过传入音频、视频混流列表,设置 MCU 的音视频混流
|
||||
|
||||
@remarks RCRTCMixConfig:混流操作
|
||||
Added from 5.1.3
|
||||
*/
|
||||
- (void)setMixInputFilterByStreams:(nullable NSArray<RCRTCCustomLayout *> *)mixVideos
|
||||
mixAudios:(nullable NSArray<RCRTCCustomMixAudio *> *)mixAudios;
|
||||
|
||||
/*!
|
||||
设置 MCU 混流配置
|
||||
|
||||
@param roomIds 混流房间列表
|
||||
@param mixMediaType 混流媒体类型
|
||||
@param isAppend 是否为增量混流,YES 为增量混流,NO 为全量覆盖混流
|
||||
@discussion
|
||||
通过传入混流房间列表,设置 MCU 的音视频混流
|
||||
|
||||
@remarks RCRTCMixConfig:混流操作
|
||||
Added from 5.1.3
|
||||
*/
|
||||
- (void)setMixInputFilterByRoomIds:(nullable NSArray<NSString *> *)roomIds
|
||||
mixMediaType:(RCRTCMixMediaType)mixMediaType
|
||||
isAppend:(BOOL)isAppend;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// RCRTCOtherRoom.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/3.
|
||||
// Copyright © 2020 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCBaseRoom.h"
|
||||
#import "RCRTCOtherRoomEventDelegate.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCOtherRoom : RCRTCBaseRoom
|
||||
|
||||
/*!
|
||||
副房间代理
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id<RCRTCOtherRoomEventDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,205 @@
|
||||
//
|
||||
// RCRTCOtherRoomEventDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2020/8/7.
|
||||
// Copyright © 2019 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef RCRTCOtherRoomEventDelegate_h
|
||||
#define RCRTCOtherRoomEventDelegate_h
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RCRTCRemoteUser;
|
||||
@class RCRTCInputStream;
|
||||
@class RCRTCRoom;
|
||||
@class RCRTCBaseRoom;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
音视频通话的房间代理, 实现这个代理之后房间成员变化以及资源的变化都会通过代理通知给您
|
||||
*/
|
||||
@protocol RCRTCOtherRoomEventDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/*!
|
||||
有用户加入的回调, 此时 user 不包含任何资源, 只是标记有人加入, 此时无法订阅这个人的流
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 加入的用户信息
|
||||
@discussion
|
||||
有用户加入的回调, 此时 user 不包含任何资源, 只是标记有人加入, 此时无法订阅这个人的流
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didJoinUser:(nullable RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
有用户离开时的回调, 当有用户离开的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 离开的用户
|
||||
@discussion
|
||||
有用户离开时的回调, 当有用户离开的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didLeaveUser:(nullable RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
有用户掉线时的回调, 当有用户掉线的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 掉线的用户
|
||||
@discussion
|
||||
有用户掉线时的回调, 当有用户掉线的时候, SDK 会取消订阅这个 user, APP 无需再次调用取消订阅的接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didOfflineUser:(nullable RCRTCRemoteUser *)user;
|
||||
|
||||
/*!
|
||||
副房间远端用户切换身份通知
|
||||
|
||||
@param room 用户所在房间
|
||||
@param user 切换身份的用户
|
||||
@param roleType 该用户当前的身份
|
||||
|
||||
@discussion
|
||||
当副房间用户切换身份的时候,副房间内其他主播会收到该消息。
|
||||
如果订阅了当前 user 的流,SDK 会主动取消订阅,不需要手动取消订阅。
|
||||
added from 5.2.6
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didSwitchRoleWithUser:(RCRTCRemoteUser *)user roleType:(RCRTCLiveRoleType)roleType;
|
||||
|
||||
/*!
|
||||
订阅远端资源成功后, 音频或视频首帧到达通知
|
||||
|
||||
@param room 事件所在房间
|
||||
@param stream 开始接收数据的 stream
|
||||
@param mediaType 数据流类型(如视频流、音频流)
|
||||
@discussion
|
||||
数据流第一个关键帧到达
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didReportFirstFrame:(nullable RCRTCInputStream *)stream mediaType:(RCRTCMediaType)mediaType;
|
||||
|
||||
/*!
|
||||
当有远端用户发布资源时, 通过此方法回调通知上报该用户发布的流
|
||||
|
||||
@param room 事件所在房间
|
||||
@param streams 用户发布的资源信息
|
||||
@discussion
|
||||
当有远端用户发布资源时, 通过此方法回调通知上报该用户发布的流, 其中流中有
|
||||
userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息,
|
||||
可调用订阅接口, 订阅其中的流
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didPublishStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
当有远端用户取消发布资源时, 通过此方法回调, SDK 默认会取消订阅这些流, 其中流中有
|
||||
userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息,
|
||||
APP 可根据这些关键信息自定义化, 无需再次调用取消订阅接口
|
||||
|
||||
@param streams 取消发布资源
|
||||
@discussion
|
||||
当有远端用户取消发布资源时, 通过此方法回调, SDK 默认会取消订阅这些流, 其中流中有
|
||||
userID(用户 ID), tag(标识符), type(流类型), state(是否禁用) 等关键信息,
|
||||
APP 可根据这些关键信息自定义化, 无需再次调用取消订阅接口
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didUnpublishStreams:(NSArray<RCRTCInputStream *> *)streams;
|
||||
|
||||
/*!
|
||||
接收到副房间内远端用户发送的 SEI 通知
|
||||
|
||||
@param room 事件所在房间
|
||||
@param SEI sei 数据
|
||||
@param userId 用户id
|
||||
@discussion 监听远端用户发送的 SEI 内容,通过 userId 区分。
|
||||
Added from 5.2.5
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(RCRTCBaseRoom *)room didReceiveSEI:(NSString *)SEI userId:(NSString *)userId;
|
||||
|
||||
/*!
|
||||
音频状态改变
|
||||
|
||||
@param stream 流信息
|
||||
@param mute 当前流是否可用
|
||||
@discussion
|
||||
音频状态改变
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room stream:(nullable RCRTCInputStream *)stream didAudioMute:(BOOL)mute;
|
||||
|
||||
/*!
|
||||
视频状态改变
|
||||
|
||||
@param stream 流信息
|
||||
@param enable 当前流是否可用
|
||||
@discussion
|
||||
视频状态改变
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room stream:(nullable RCRTCInputStream *)stream didVideoEnable:(BOOL)enable;
|
||||
|
||||
/*!
|
||||
接收到其他人发送到 room 里的消息
|
||||
|
||||
@param message 消息体, 参考 IMLib 中 RCMessage
|
||||
@discussion
|
||||
接收到其他人发送到 room 里的消息
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)room:(nullable RCRTCBaseRoom *)room didReceiveMessage:(RCMessage *)message;
|
||||
|
||||
/*!
|
||||
如果用户调用 RCRTCEngine 的 setReconnectEnable 关闭 SDK 断线重连,
|
||||
1分钟没有链接上信令服务器, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@param room 离开的房间
|
||||
@discussion
|
||||
如果用户调用 RCRTCEngine 的 setReconnectEnable 关闭 SDK 断线重连,
|
||||
1分钟没有链接上信令服务器, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKickedOutOfTheRoom:(nullable RCRTCRoom *)room
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCEngineEventDelegate.h didKicked:reason: instead");
|
||||
|
||||
/*!
|
||||
如果用户在房间内, 此时收到服务器封禁的通知, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@param room 离开的房间
|
||||
@discussion
|
||||
如果用户在房间内, 此时收到服务器封禁的通知, SDK 会关闭音视频连接, 释放资源,
|
||||
将用户踢出房间, 回调通知用户
|
||||
|
||||
@remarks 代理
|
||||
*/
|
||||
- (void)didKickedOtherRoomByServer:(nullable RCRTCBaseRoom *)room
|
||||
DEPRECATED_MSG_ATTRIBUTE("use RCRTCEngineEventDelegate.h didKicked:reason: instead");
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif /* RongRTCRoomDelegate_h */
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// RCRTCOutputStream.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2019/1/8.
|
||||
// Copyright © 2019年 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreMedia/CoreMedia.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCRTCStream.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
本地输出音视频流
|
||||
*/
|
||||
@interface RCRTCOutputStream : RCRTCStream
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
初始化
|
||||
|
||||
@discussion
|
||||
初始化
|
||||
|
||||
@warning
|
||||
请勿调用, 仅供 SDK 内部调用
|
||||
|
||||
@remarks 资源管理
|
||||
@return RCRTCOutputStream 实例对象
|
||||
*/
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// RCRTCProbeStatusForm.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/12/21.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCProbeQualityLevel) {
|
||||
RCRTCProbeQualityLevel_Excellent,
|
||||
RCRTCProbeQualityLevel_Good,
|
||||
RCRTCProbeQualityLevel_Pool,
|
||||
RCRTCProbeQualityLevel_Bad,
|
||||
RCRTCProbeQualityLevel_VeryBad,
|
||||
RCRTCProbeQualityLevel_Down,
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCRTCStreamDirection) {
|
||||
RCRTCStreamDirection_UpLink = 1,
|
||||
RCRTCStreamDirection_DownLink = 2,
|
||||
};
|
||||
|
||||
@class RCRTCBaseStat;
|
||||
/// Add from 5.1.17
|
||||
@interface RCRTCProbeStatusForm : NSObject
|
||||
|
||||
@property (nonatomic, readonly) RCRTCProbeQualityLevel qualityLevel;
|
||||
|
||||
@property (nonatomic, readonly) RCRTCStreamDirection direction;
|
||||
|
||||
@property (nonatomic, readonly) RCRTCBaseStat *stat;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// RCRTCProbeTestDelegate.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2021/12/16.
|
||||
// Copyright © 2021 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RCRTCProbeStatusForm;
|
||||
|
||||
/// Add from 5.1.17
|
||||
@protocol RCRTCProbeTestDelegate <NSObject>
|
||||
|
||||
/*!
|
||||
汇报探测状态数据
|
||||
*/
|
||||
- (void)didReportProbeForms:(NSArray <RCRTCProbeStatusForm *>*)forms;
|
||||
|
||||
/*!
|
||||
探测完成
|
||||
*/
|
||||
- (void)didRTCProbeComplete;
|
||||
|
||||
/*!
|
||||
探测中断
|
||||
*/
|
||||
- (void)didRTCProbeInterrput:(RCRTCCode)errorCode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// RCRTCProxyInfo.h
|
||||
// RongRTCLib
|
||||
//
|
||||
// Created by RongCloud on 2022/09/06.
|
||||
// Copyright © 2022 RongCloud. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RCRTCLibDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCRTCProxy : NSObject
|
||||
|
||||
/*!
|
||||
代理地址, 默认值: @"", 非 nil 或非 @"" 时有效
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *host;
|
||||
|
||||
/*!
|
||||
代理地址对应IP, 只读, 不可设置
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *ip;
|
||||
|
||||
/*!
|
||||
代理端口, 默认值: -1, 大于 0 时有效
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger port;
|
||||
|
||||
/*!
|
||||
代理服务登录用户名, 默认值: @""
|
||||
如果需要则填写, 不需要可不填写,
|
||||
userName 与 password 同时非 nil 或非 @"" 时有效
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userName;
|
||||
|
||||
/*!
|
||||
代理服务登录密码, 默认值: @""
|
||||
如果需要则填写, 不需要可不填写,
|
||||
userName 与 password 同时非 nil 或非 @"" 时有效
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *password;
|
||||
|
||||
/*!
|
||||
可通过代理服务连接的协议类型, 默认值: RCRTCProxyOptionsAll, 全支持
|
||||
*/
|
||||
@property (nonatomic, assign) RCRTCProxyOptions proxyOption;
|
||||
|
||||
/*!
|
||||
验证设置数据是否有效
|
||||
*/
|
||||
- (BOOL)isValid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user