NERtc iOS SDK  V5.3.1
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 #pragma clang diagnostic push
18 #pragma clang diagnostic ignored "-Wdocumentation"
19 
20 NS_ASSUME_NONNULL_BEGIN
21 
32 @protocol INERtcChannel <NSObject>
33 
44 - (int)destroy;
45 
60 - (int)setChannelDelegate:(nullable id<NERtcChannelDelegate>)channelDelegate;
61 
78 - (NSString *)getChannelName;
79 
93 
164 - (int)joinChannelWithToken:(NSString *)token
165  completion:(NERtcJoinChannelCompletion)completion;
166 
242 - (int)joinChannelWithToken:(NSString *)token
243  myUid:(uint64_t)uId
244  completion:(NERtcJoinChannelCompletion)completion;
245 
321 - (int)joinChannelWithToken:(NSString *)token
322  myUid:(uint64_t)uId
323  channelOptions:(nullable NERtcJoinChannelOptions *)channelOptions
324  completion:(void(^)(NSError * _Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid, NERtcJoinChannelExtraInfo * _Nullable info))completion;
354 - (int)leaveChannel;
355 
416 - (int)enableLocalAudio:(BOOL)enabled;
417 
469 - (int)enableLocalVideo:(BOOL)enabled;
470 
525 - (int)enableLocalVideo:(BOOL)enabled streamType:(NERtcStreamChannelType)streamType;
526 
567 - (int)enableMediaPub:(BOOL)enabled withMediaType:(NERtcMediaPubType)mediaType;
568 
616 - (int)enableDualStreamMode:(BOOL)enable;
617 
673 - (int)setCameraCaptureConfig:(NERtcCameraCaptureConfiguration *)config;
674 
724 - (int)setCameraCaptureConfig:(NERtcCameraCaptureConfiguration *)config streamType:(NERtcStreamChannelType)streamType;
725 
786 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
787 
851 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config streamType:(NERtcStreamChannelType)streamType;
852 
867  - (int)switchCamera;
868 
883 - (int)switchCameraWithPosition:(NERtcCameraPosition)position;
884 
942 - (int)subscribeRemoteAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
943 
992 - (int)subscribeAllRemoteAudio:(BOOL)subscribe;
993 
1022 - (int)setAudioSubscribeOnlyBy:(NSArray<NSNumber*> *)uidArray;
1023 
1073 - (int)muteLocalAudio:(BOOL)muted;
1074 
1109 - (int)enableAudioVolumeIndication:(BOOL)enable interval:(uint64_t)interval vad:(BOOL)enableVad;
1110 
1161 - (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
1162 
1204 - (int)setLocalRenderScaleMode:(NERtcVideoRenderScaleMode)mode;
1205 
1267 - (int)setupRemoteVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID;
1268 
1318 - (int)setRemoteRenderScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
1319 
1382 - (int)subscribeRemoteVideo:(BOOL)subscribe forUserID:(uint64_t)userID streamType:(NERtcRemoteVideoStreamType)streamType;
1383 
1436 - (int)muteLocalVideo:(BOOL)muted;
1437 
1488 - (int)muteLocalVideo:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
1489 
1490 - (int)setExternalVideoSource:(BOOL)enable streamType:(NERtcStreamChannelType)streamType;
1491 
1507 - (int)pushExternalVideoFrame:(NERtcVideoFrame*)frame streamType:(NERtcStreamChannelType)streamType;
1508 
1567 - (int)setClientRole:(NERtcClientRole)role;
1568 
1625 - (int)adjustUserPlaybackSignalVolume:(uint32_t)volume forUserID:(uint64_t)userID;
1626 
1663 - (int)adjustChannelPlaybackSignalVolume:(uint32_t)volume;
1664 
1665 #pragma mark - Audio Sub Stream
1666 
1691 - (int)enableLocalSubStreamAudio:(BOOL)enabled;
1692 
1748 - (int)subscribeRemoteSubStreamAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
1749 
1774 - (int)muteLocalSubStreamAudio:(BOOL)muted;
1775 
1776 
1777 #pragma mark - Sub Stream
1778 
1827 - (int)setupLocalSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas;
1828 
1879 - (int)startScreenCapture:(NERtcVideoSubStreamEncodeConfiguration *)config;
1880 
1909 - (int)stopScreenCapture;
1910 
1957 - (int)setLocalRenderSubStreamScaleMode:(NERtcVideoRenderScaleMode)mode;
1958 
2023 - (int)setupRemoteSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas forUserID:(uint64_t)userID;
2024 
2079 - (int)subscribeRemoteSubStreamVideo:(BOOL)subscribe forUserID:(uint64_t)userID;
2080 
2132 - (int)setRemoteRenderSubStreamVideoScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
2133 
2168 - (int)setRemoteHighPriorityAudioStream:(BOOL)enable forUserID:(uint64_t)userID streamType:(NERtcAudioStreamType)streamType;
2169 
2170 
2171 #pragma mark - Snapshot
2200 - (int)takeLocalSnapshot:(NERtcStreamChannelType)streamType callback:(NERtcTakeSnapshotCallback)callback;
2201 
2230 - (int)takeRemoteSnapshot:(NERtcStreamChannelType)streamType forUserID:(uint64_t)userID callback:(NERtcTakeSnapshotCallback)callback;
2231 
2232 #pragma mark - SEI
2233 
2272 - (int)sendSEIMsg:(NSData *)data streamChannelType:(NERtcStreamChannelType)type;
2273 
2310 - (int)sendSEIMsg:(NSData *)data;
2311 
2312 #pragma mark - Live Stream
2313 
2373 - (int)addLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
2374 
2429 - (int)updateLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
2430 
2485 - (int)removeLiveStreamTask:(NSString *)taskId compeltion:(NERtcLiveStreamCompletion)completion;
2486 
2501 - (int)addChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
2502 
2517 - (int)removeChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
2518 
2532 
2533 
2562 - (int)startChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
2563 
2590 - (int)updateChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
2591 
2624 - (int)stopChannelMediaRelay;
2625 
2676 - (int)setLocalMediaPriority:(NERtcMediaPriorityType)priority preemptive:(BOOL)preemptive;
2677 
2678 
2703 - (int)setLocalPublishFallbackOption:(NERtcStreamFallbackOptions)option;
2704 
2729 - (int)setRemoteSubscribeFallbackOption:(NERtcStreamFallbackOptions)option;
2730 
2769 - (int)updatePermissionKey:(NSString *)key;
2770 
2771 #pragma mark - Other
2772 
2782 - (int)reportCustomEvent:(NSString *)eventName
2783  customIdentify:(NSString *)customIdentify
2784  param:(NSDictionary *)param;
2785 
2786 @end
2787 
2788 NS_ASSUME_NONNULL_END
2789 
2790 #pragma clang diagnostic pop
2791 
2792 #endif /* INERtcChannel_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
截图结果 block 回调。
Definition: INERtcEngine.h:64
void(^ NERtcJoinChannelCompletion)(NSError *_Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid)
加入房间 block。
Definition: INERtcEngine.h:36
void(^ NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode)
互动直播推流 block。
Definition: INERtcEngine.h:50
NERtcMediaPubType
媒体 pub 类型。
Definition: NERtcEngineEnum.h:235
NERtcConnectionStateType
当前房间的连接状态。
Definition: NERtcEngineEnum.h:45
NERtcCameraPosition
指定的摄像头位置。
Definition: NERtcEngineEnum.h:1360
NERtcRemoteVideoStreamType
远端视频流类型。
Definition: NERtcEngineEnum.h:636
NERtcStreamFallbackOptions
Definition: NERtcEngineEnum.h:1692
NERtcClientRole
用户角色。
Definition: NERtcEngineEnum.h:206
NERtcStreamChannelType
SEI发送的流通道类型。
Definition: NERtcEngineEnum.h:1043
NERtcVideoRenderScaleMode
视频渲染缩放模式。
Definition: NERtcEngineEnum.h:712
NERtcMediaPriorityType
Definition: NERtcEngineEnum.h:1671
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
Definition: NERtcEngineEnum.h:1646
摄像头采集配置。
Definition: NERtcEngineBase.h:485
Definition: NERtcEngineBase.h:1726
joinChannel 回调时的一些可选信息
Definition: NERtcEngineBase.h:2938
joinChannel 时的一些可选信息
Definition: NERtcEngineBase.h:2919
直播推流任务的配置。
Definition: NERtcEngineBase.h:1283
视频画布设置。
Definition: NERtcEngineBase.h:293
本地视频发送配置
Definition: NERtcEngineBase.h:539
视频帧信息。
Definition: NERtcEngineBase.h:1582
本地辅流发送配置。
Definition: NERtcEngineBase.h:645
INERtcChannel 类在指定房间中实现实时音视频功能。通过创建多个 NERtcChannel 对象,用户可以同时加入多个房间。
Definition: INERtcChannel.h:32
int switchCamera()
切换前置/后置摄像头。 该方法需要在相机启动后调用,例如调用 startPreview 或 joinChannel 后。
int leaveChannel()
离开音视频房间。 通过本接口可以实现挂断或退出通话,并释放本房间内的相关资源。
int stopScreenCapture()
关闭屏幕共享。 通过此接口可以实现关闭屏幕共享辅流。
NERtcConnectionStateType connectionState()
获取当前房间连接状态。
int stopChannelMediaRelay()
停止跨房间媒体流转发。 通常在主播离开房间时,跨房间媒体流转发会自动停止;您也可以根据需要随时调用该方法,此时主播会退出所有目标房间。
int cleanupChannelMediaStatsObserver()
清除全部媒体统计信息观测器。
NSString * getChannelName()
获取当前房间名。
NERtcChannelDelegate 类监听和报告指定房间的事件和数据。
Definition: NERtcChannelDelegate.h:30
channel 统计信息回调。
Definition: NERtcEngineStatistics.h:1030