NERtc iOS SDK  V4.6.0
INERtcChannel.h
浏览该文件的文档.
1 //
2 // INERtcChannel.h
3 // NERtcSDK
4 //
5 // Created by yuan on 2021/6/6.
6 // Copyright © 2021 Netease. All rights reserved.
7 //
8 
9 #ifndef INERtcChannel_h
10 #define INERtcChannel_h
11 
12 #import <Foundation/Foundation.h>
13 #import "NERtcChannelDelegate.h"
15 #import "INERtcEngine.h"
16 
17 NS_ASSUME_NONNULL_BEGIN
18 
29 @protocol INERtcChannel <NSObject>
30 
41 - (int)destroy;
42 
57 - (int)setChannelDelegate:(id<NERtcChannelDelegate>)channelDelegate;
58 
75 - (NSString *)getChannelName;
76 
90 
118 - (int)joinChannelWithToken:(NSString *)token
119  completion:(NERtcJoinChannelCompletion)completion;
120 
140 - (int)leaveChannel;
141 
171 - (int)enableLocalAudio:(BOOL)enabled;
172 
193 - (int)enableLocalVideo:(BOOL)enabled;
194 
219 - (int)enableDualStreamMode:(BOOL)enable;
220 
247 - (int)setCameraCaptureConfig:(NERtcCameraCaptureConfiguration *)config;
248 
273 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
274 
298 - (int)subscribeRemoteAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
299 
320 - (int)subscribeAllRemoteAudio:(BOOL)subscribe;
321 
347 - (int)muteLocalAudio:(BOOL)muted;
348 
371 - (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
372 
389 - (int)setLocalRenderScaleMode:(NERtcVideoRenderScaleMode)mode;
390 
422 - (int)setupRemoteVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID;
423 
442 - (int)setRemoteRenderScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
443 
473 - (int)subscribeRemoteVideo:(BOOL)subscribe forUserID:(uint64_t)userID streamType:(NERtcRemoteVideoStreamType)streamType;
474 
506 - (int)muteLocalVideo:(BOOL)muted;
507 
542 - (int)setClientRole:(NERtcClientRole)role;
543 
574 - (int)adjustUserPlaybackSignalVolume:(uint32_t)volume forUserID:(uint64_t)userID;
575 
576 #pragma mark -- Sub Stream
577 
604 - (int)setupLocalSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas;
605 
626 - (int)startScreenCapture:(NERtcVideoSubStreamEncodeConfiguration *)config;
627 
644 - (int)stopScreenCapture;
645 
668 - (int)setLocalRenderSubStreamScaleMode:(NERtcVideoRenderScaleMode)mode;
669 
698 - (int)setupRemoteSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas forUserID:(uint64_t)userID;
699 
722 - (int)subscribeRemoteSubStreamVideo:(BOOL)subscribe forUserID:(uint64_t)userID;
723 
746 - (int)setRemoteRenderSubStreamVideoScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
747 
765 - (int)setRemoteHighPriorityAudioStream:(BOOL)enable forUserID:(uint64_t)userID streamType:(NERtcAudioStreamType)streamType;
766 
767 #pragma mark - waterMark
768 
793 - (int)setLocalCanvasWatermarkConfigs:(nullable NERtcCanvasWatermarkConfig *)config
794  withStreamType:(NERtcStreamChannelType)type;
795 
822 - (int)setRemoteCanvasWatermarkConfigs:(nullable NERtcCanvasWatermarkConfig *)config
823  forUserID:(uint64_t)userID
824  withStreamType:(NERtcStreamChannelType)type;
825 
826 #pragma mark -- snapshot
855 - (int)takeLocalSnapshot:(NERtcStreamChannelType)streamType callback:(NERtcTakeSnapshotCallback)callback;
856 
885 - (int)takeRemoteSnapshot:(NERtcStreamChannelType)streamType forUserID:(uint64_t)userID callback:(NERtcTakeSnapshotCallback)callback;
886 
887 #pragma mark - SEI
888 
927 - (int)sendSEIMsg:(NSData *)data streamChannelType:(NERtcStreamChannelType)type;
928 
965 - (int)sendSEIMsg:(NSData *)data;
966 
967 #pragma mark -- Live Stream
968 
996 - (int)addLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
997 
1020 - (int)updateLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
1021 
1044 - (int)removeLiveStreamTask:(NSString *)taskId compeltion:(NERtcLiveStreamCompletion)completion;
1045 
1060 - (int)addChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
1061 
1076 - (int)removeChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
1077 
1091 
1092 
1121 - (int)startChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
1122 
1149 - (int)updateChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
1150 
1169 - (int)stopChannelMediaRelay;
1170 
1199 - (int)setLocalMediaPriority:(NERtcMediaPriorityType)priority preemptive:(BOOL)preemptive;
1200 
1201 
1226 - (int)setLocalPublishFallbackOption:(NERtcStreamFallbackOptions)option;
1227 
1252 - (int)setRemoteSubscribeFallbackOption:(NERtcStreamFallbackOptions)option;
1253 
1254 @end
1255 
1256 NS_ASSUME_NONNULL_END
1257 
1258 #endif /* INERtcChannel_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
截图结果 block 回调。
Definition: INERtcEngine.h:60
NS_ASSUME_NONNULL_BEGIN typedef void(^ NERtcJoinChannelCompletion)(NSError *_Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid)
加入房间 block。
void(^ NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode)
互动直播推流 block。
Definition: INERtcEngine.h:46
NERtcConnectionStateType
当前房间的连接状态。
Definition: NERtcEngineEnum.h:31
NERtcRemoteVideoStreamType
远端视频流类型。
Definition: NERtcEngineEnum.h:613
NERtcStreamFallbackOptions
Definition: NERtcEngineEnum.h:1340
NERtcClientRole
用户角色。
Definition: NERtcEngineEnum.h:163
NERtcStreamChannelType
SEI发送的流通道类型。
Definition: NERtcEngineEnum.h:1013
NERtcVideoRenderScaleMode
视频渲染缩放模式。
Definition: NERtcEngineEnum.h:689
NERtcMediaPriorityType
Definition: NERtcEngineEnum.h:1319
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
Definition: NERtcEngineEnum.h:1298
摄像头采集配置。
Definition: NERtcEngineBase.h:439
画布水印设置。 同时设置文字、时间戳或图片水印时,如果不同类型的水印位置有重叠,会按照图片、文本、时间戳的顺序进行图层覆盖。
Definition: NERtcEngineBase.h:1820
Definition: NERtcEngineBase.h:1561
直播推流任务的配置。
Definition: NERtcEngineBase.h:1167
视频画布设置。
Definition: NERtcEngineBase.h:251
本地视频发送配置
Definition: NERtcEngineBase.h:502
本地辅流发送配置。
Definition: NERtcEngineBase.h:607
INERtcChannel 类在指定房间中实现实时音视频功能。通过创建多个 NERtcChannel 对象,用户可以同时加入多个房间。
Definition: INERtcChannel.h:29
int leaveChannel()
离开房间,即挂断或退出通话。 结束通话时,必须调用 leaveChannel 结束通话,否则无法开始下一次通话。 成功调用该方法离开房间后,本地会触发 onNERtcEngineDidLeaveCh...
int stopScreenCapture()
关闭辅流形式的屏幕共享。 如果您在加入房间后调用该方法关闭辅流,调用成功后,远端触发 onNERtcEngineUserSubStreamDidStop 回调。
NERtcConnectionStateType connectionState()
获取当前房间连接状态。
int stopChannelMediaRelay()
停止跨房间媒体流转发。 主播离开房间时,跨房间媒体流转发自动停止,您也可以在需要的时候随时调用 stopChannelMediaRelay 方法,此时主播会退出所有目标房间。
int cleanupChannelMediaStatsObserver()
清除全部媒体统计信息观测器。
NSString * getChannelName()
获取当前房间名。
NERtcChannelDelegate 类监听和报告指定房间的事件和数据。
Definition: NERtcChannelDelegate.h:27
channel 统计信息回调。
Definition: NERtcEngineStatistics.h:950