NERtc iOS SDK  V4.6.20
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 
119 - (int)joinChannelWithToken:(NSString *)token
120  completion:(NERtcJoinChannelCompletion)completion;
121 
138 - (int)leaveChannel;
139 
169 - (int)enableLocalAudio:(BOOL)enabled;
170 
192 - (int)enableLocalVideo:(BOOL)enabled;
193 
249 - (int)enableLocalVideo:(BOOL)enabled streamType:(NERtcStreamChannelType)streamType;
250 
292 - (int)enableMediaPub:(BOOL)enabled withMediaType:(NERtcMediaPubType)mediaType;
293 
318 - (int)enableDualStreamMode:(BOOL)enable;
319 
347 - (int)setCameraCaptureConfig:(NERtcCameraCaptureConfiguration *)config;
348 
398 - (int)setCameraCaptureConfig:(NERtcCameraCaptureConfiguration *)config streamType:(NERtcStreamChannelType)streamType;
399 
425 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
426 
490 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config streamType:(NERtcStreamChannelType)streamType;
491 
515 - (int)subscribeRemoteAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
516 
537 - (int)subscribeAllRemoteAudio:(BOOL)subscribe;
538 
567 - (int)setAudioSubscribeOnlyBy:(NSArray<NSNumber*> *)uidArray;
568 
600 - (int)muteLocalAudio:(BOOL)muted;
601 
624 - (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
625 
642 - (int)setLocalRenderScaleMode:(NERtcVideoRenderScaleMode)mode;
643 
675 - (int)setupRemoteVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID;
676 
695 - (int)setRemoteRenderScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
696 
726 - (int)subscribeRemoteVideo:(BOOL)subscribe forUserID:(uint64_t)userID streamType:(NERtcRemoteVideoStreamType)streamType;
727 
760 - (int)muteLocalVideo:(BOOL)muted;
761 
812 - (int)muteLocalVideo:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
813 
848 - (int)setClientRole:(NERtcClientRole)role;
849 
880 - (int)adjustUserPlaybackSignalVolume:(uint32_t)volume forUserID:(uint64_t)userID;
881 
882 #pragma mark -- Audio Sub Stream
883 
908 - (int)enableLocalSubStreamAudio:(BOOL)enabled;
909 
937 - (int)subscribeRemoteSubStreamAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
938 
963 - (int)muteLocalSubStreamAudio:(BOOL)muted;
964 
965 
966 #pragma mark -- Sub Stream
967 
994 - (int)setupLocalSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas;
995 
1016 - (int)startScreenCapture:(NERtcVideoSubStreamEncodeConfiguration *)config;
1017 
1034 - (int)stopScreenCapture;
1035 
1058 - (int)setLocalRenderSubStreamScaleMode:(NERtcVideoRenderScaleMode)mode;
1059 
1088 - (int)setupRemoteSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas forUserID:(uint64_t)userID;
1089 
1112 - (int)subscribeRemoteSubStreamVideo:(BOOL)subscribe forUserID:(uint64_t)userID;
1113 
1136 - (int)setRemoteRenderSubStreamVideoScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
1137 
1172 - (int)setRemoteHighPriorityAudioStream:(BOOL)enable forUserID:(uint64_t)userID streamType:(NERtcAudioStreamType)streamType;
1173 
1174 #pragma mark - waterMark
1175 
1200 - (int)setLocalCanvasWatermarkConfigs:(nullable NERtcCanvasWatermarkConfig *)config
1201  withStreamType:(NERtcStreamChannelType)type;
1202 
1229 - (int)setRemoteCanvasWatermarkConfigs:(nullable NERtcCanvasWatermarkConfig *)config
1230  forUserID:(uint64_t)userID
1231  withStreamType:(NERtcStreamChannelType)type;
1232 
1233 #pragma mark -- snapshot
1262 - (int)takeLocalSnapshot:(NERtcStreamChannelType)streamType callback:(NERtcTakeSnapshotCallback)callback;
1263 
1292 - (int)takeRemoteSnapshot:(NERtcStreamChannelType)streamType forUserID:(uint64_t)userID callback:(NERtcTakeSnapshotCallback)callback;
1293 
1294 #pragma mark - SEI
1295 
1334 - (int)sendSEIMsg:(NSData *)data streamChannelType:(NERtcStreamChannelType)type;
1335 
1372 - (int)sendSEIMsg:(NSData *)data;
1373 
1374 #pragma mark -- Live Stream
1375 
1403 - (int)addLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
1404 
1427 - (int)updateLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
1428 
1451 - (int)removeLiveStreamTask:(NSString *)taskId compeltion:(NERtcLiveStreamCompletion)completion;
1452 
1467 - (int)addChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
1468 
1483 - (int)removeChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
1484 
1498 
1499 
1528 - (int)startChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
1529 
1556 - (int)updateChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
1557 
1576 - (int)stopChannelMediaRelay;
1577 
1606 - (int)setLocalMediaPriority:(NERtcMediaPriorityType)priority preemptive:(BOOL)preemptive;
1607 
1608 
1633 - (int)setLocalPublishFallbackOption:(NERtcStreamFallbackOptions)option;
1634 
1659 - (int)setRemoteSubscribeFallbackOption:(NERtcStreamFallbackOptions)option;
1660 
1661 @end
1662 
1663 NS_ASSUME_NONNULL_END
1664 
1665 #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
NERtcMediaPubType
媒体 pub 类型。
Definition: NERtcEngineEnum.h:206
NERtcConnectionStateType
当前房间的连接状态。
Definition: NERtcEngineEnum.h:45
NERtcRemoteVideoStreamType
远端视频流类型。
Definition: NERtcEngineEnum.h:598
NERtcStreamFallbackOptions
Definition: NERtcEngineEnum.h:1654
NERtcClientRole
用户角色。
Definition: NERtcEngineEnum.h:177
NERtcStreamChannelType
SEI发送的流通道类型。
Definition: NERtcEngineEnum.h:998
NERtcVideoRenderScaleMode
视频渲染缩放模式。
Definition: NERtcEngineEnum.h:674
NERtcMediaPriorityType
Definition: NERtcEngineEnum.h:1633
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
Definition: NERtcEngineEnum.h:1608
摄像头采集配置。
Definition: NERtcEngineBase.h:449
画布水印设置。 同时设置文字、时间戳或图片水印时,如果不同类型的水印位置有重叠,会按照图片、文本、时间戳的顺序进行图层覆盖。
Definition: NERtcEngineBase.h:1893
Definition: NERtcEngineBase.h:1634
直播推流任务的配置。
Definition: NERtcEngineBase.h:1219
视频画布设置。
Definition: NERtcEngineBase.h:261
本地视频发送配置
Definition: NERtcEngineBase.h:503
本地辅流发送配置。
Definition: NERtcEngineBase.h:609
INERtcChannel 类在指定房间中实现实时音视频功能。通过创建多个 NERtcChannel 对象,用户可以同时加入多个房间。
Definition: INERtcChannel.h:29
int leaveChannel()
离开房间,即挂断或退出通话。 结束通话时,必须调用leaveChannel结束通话,否则无法开始下一次通话。 成功调用该方法离开房间后,本地会触发 onNERtcEngineDidLeaveChan...
int stopScreenCapture()
关闭辅流形式的屏幕共享。 如果您在加入房间后调用该方法关闭辅流,调用成功后,远端触发 onNERtcEngineUserSubStreamDidStop 回调。
NERtcConnectionStateType connectionState()
获取当前房间连接状态。
int stopChannelMediaRelay()
停止跨房间媒体流转发。 主播离开房间时,跨房间媒体流转发自动停止,您也可以在需要的时候随时调用 stopChannelMediaRelay 方法,此时主播会退出所有目标房间。
int cleanupChannelMediaStatsObserver()
清除全部媒体统计信息观测器。
NSString * getChannelName()
获取当前房间名。
NERtcChannelDelegate 类监听和报告指定房间的事件和数据。
Definition: NERtcChannelDelegate.h:27
channel 统计信息回调。
Definition: NERtcEngineStatistics.h:1026