NERTC iOS SDK V5.10.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>
15#import "INERtcEngine.h"
16
17#pragma clang diagnostic push
18#pragma clang diagnostic ignored "-Wdocumentation"
19
20NS_ASSUME_NONNULL_BEGIN
21
32@protocol INERtcChannel <NSObject>
33
44- (int)destroy;
45
60- (int)setChannelDelegate:(nullable id<NERtcChannelDelegate>)channelDelegate;
61
73- (int)setDelegateQueue:(nullable dispatch_queue_t)delegateQueue;
74
91- (NSString *)getChannelName;
92
106
178- (int)joinChannelWithToken:(NSString *)token
179 completion:(NERtcJoinChannelCompletion)completion;
180
257- (int)joinChannelWithToken:(NSString *)token
258 myUid:(uint64_t)uId
259 completion:(NERtcJoinChannelCompletion)completion;
260
337- (int)joinChannelWithToken:(NSString *)token
338 myUid:(uint64_t)uId
339 channelOptions:(nullable NERtcJoinChannelOptions *)channelOptions
340 completion:(void(^)(NSError * _Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid, NERtcJoinChannelExtraInfo * _Nullable info))completion;
371
431- (int)enableLocalAudio:(BOOL)enabled;
432
484- (int)enableLocalVideo:(BOOL)enabled;
485
540- (int)enableLocalVideo:(BOOL)enabled streamType:(NERtcStreamChannelType)streamType;
541
583- (int)enableMediaPub:(BOOL)enabled withMediaType:(NERtcMediaPubType)mediaType;
584
633- (int)enableDualStreamMode:(BOOL)enable;
634
671- (int)setVideoStreamLayerCount:(NERtcVideoStreamLayerCount)layerCount;
672
728- (int)setCameraCaptureConfig:(NERtcCameraCaptureConfiguration *)config;
729
779- (int)setCameraCaptureConfig:(NERtcCameraCaptureConfiguration *)config streamType:(NERtcStreamChannelType)streamType;
780
840- (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
841
904- (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config streamType:(NERtcStreamChannelType)streamType;
905
921
936- (int)switchCameraWithPosition:(NERtcCameraPosition)position;
937
995- (int)subscribeRemoteAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
996
1045- (int)subscribeAllRemoteAudio:(BOOL)subscribe;
1046
1075- (int)setAudioSubscribeOnlyBy:(NSArray<NSNumber*> *)uidArray;
1076
1126- (int)muteLocalAudio:(BOOL)muted;
1127
1162- (int)enableAudioVolumeIndication:(BOOL)enable interval:(uint64_t)interval vad:(BOOL)enableVad;
1163
1214- (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
1215
1257- (int)setLocalRenderScaleMode:(NERtcVideoRenderScaleMode)mode;
1258
1320- (int)setupRemoteVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID;
1321
1389- (int)setupRemoteVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType;
1390
1440- (int)setRemoteRenderScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
1441
1504- (int)subscribeRemoteVideo:(BOOL)subscribe forUserID:(uint64_t)userID streamType:(NERtcRemoteVideoStreamType)streamType;
1505
1566- (int)subscribeRemoteVideo:(BOOL)subscribe forUserID:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType subscribeType:(NERtcRemoteVideoStreamType)subscribeType;
1567
1620- (int)muteLocalVideo:(BOOL)muted;
1621
1672- (int)muteLocalVideo:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
1673
1743- (int)setExternalVideoSource:(BOOL)enable streamType:(NERtcStreamChannelType)streamType;
1744
1760- (int)pushExternalVideoFrame:(NERtcVideoFrame*)frame streamType:(NERtcStreamChannelType)streamType;
1761
1820- (int)setClientRole:(NERtcClientRole)role;
1821
1878- (int)adjustUserPlaybackSignalVolume:(uint32_t)volume forUserID:(uint64_t)userID;
1879
1915- (int)adjustChannelPlaybackSignalVolume:(uint32_t)volume;
1916
1917#pragma mark - Audio Sub Stream
1918
1943- (int)enableLocalSubStreamAudio:(BOOL)enabled;
1944
2000- (int)subscribeRemoteSubStreamAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
2001
2026- (int)muteLocalSubStreamAudio:(BOOL)muted;
2027
2028
2029#pragma mark - Sub Stream
2030
2079- (int)setupLocalSubStreamVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
2080
2131- (int)startScreenCapture:(NERtcVideoSubStreamEncodeConfiguration *)config;
2132
2162
2209- (int)setLocalRenderSubStreamScaleMode:(NERtcVideoRenderScaleMode)mode;
2210
2275- (int)setupRemoteSubStreamVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID;
2276
2331- (int)subscribeRemoteSubStreamVideo:(BOOL)subscribe forUserID:(uint64_t)userID;
2332
2384- (int)setRemoteRenderSubStreamVideoScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
2385
2420- (int)setRemoteHighPriorityAudioStream:(BOOL)enable forUserID:(uint64_t)userID streamType:(NERtcAudioStreamType)streamType;
2421
2434
2435#pragma mark - 3D Audio
2436
2445- (int)setRangeAudioMode:(NERtcRangeAudioMode)mode;
2446
2455-(int)setRangeAudioTeamID:(int32_t)teamId;
2456
2468- (int)setAudioRecvRange:(int)audibleDistance conversationalDistance:(int)conversationalDistance rollOff:(NERtcDistanceRolloffModel)rollOff;
2469
2506- (int)updateSelfPosition:(NERtcPositionInfo *)info;
2507
2520- (int)enableSpatializerRoomEffects:(BOOL)enabled;
2521
2534- (int)setSpatializerRoomProperty:(NERtcSpatializerRoomProperty *)roomProperty;
2535
2548- (int)setSpatializerRenderMode:(NERtcSpatializerRenderMode)mode;
2549
2558
2573- (int)enableSpatializer:(BOOL)enabled applyToTeam:(BOOL)applyToTeam;
2574
2575#pragma mark - ASL black and white list
2591- (int)setSubscribeAudioBlocklist:(NERtcAudioStreamType)type uidArray:(NSArray<NSNumber*> *)uidArray;
2592
2607- (int)setSubscribeAudioAllowlist:(NSArray<NSNumber*> *)uidArray;
2608
2609#pragma mark - Snapshot
2638- (int)takeLocalSnapshot:(NERtcStreamChannelType)streamType callback:(NERtcTakeSnapshotCallback)callback;
2639
2668- (int)takeRemoteSnapshot:(NERtcStreamChannelType)streamType forUserID:(uint64_t)userID callback:(NERtcTakeSnapshotCallback)callback;
2669
2670#pragma mark - SEI
2671
2710- (int)sendSEIMsg:(NSData *)data streamChannelType:(NERtcStreamChannelType)type;
2711
2748- (int)sendSEIMsg:(NSData *)data;
2749
2750#pragma mark - Live Stream
2751
2811- (int)addLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
2812
2867- (int)updateLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
2868
2923- (int)removeLiveStreamTask:(NSString *)taskId compeltion:(NERtcLiveStreamCompletion)completion;
2924
2939- (int)addChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
2940
2955- (int)removeChannelMediaStatsObserver:(id<NERtcChannelMediaStatsObserver>)observer;
2956
2970
2971
3000- (int)startChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
3001
3028- (int)updateChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
3029
3063
3084
3105
3139
3190- (int)setLocalMediaPriority:(NERtcMediaPriorityType)priority preemptive:(BOOL)preemptive;
3191
3192
3217- (int)setLocalPublishFallbackOption:(NERtcStreamFallbackOptions)option;
3218
3243- (int)setRemoteSubscribeFallbackOption:(NERtcStreamFallbackOptions)option;
3244
3283- (int)updatePermissionKey:(NSString *)key;
3284
3319- (int)setLocalVideoMosaic:(BOOL)enabled streamType:(NERtcStreamChannelType)streamType rect:(NERtcFrameNormalizedRect *)rect;
3320
3355- (int)setRemoteVideoMosaic:(BOOL)enabled userId:(uint64_t)userId streamType:(NERtcStreamChannelType)streamType rect:(NERtcFrameNormalizedRect *)rect;
3356
3357#pragma mark - Video Blend
3358
3387- (int)startBlendExternalVideo:(NERtcStreamChannelType)streamType blendConfig:(NERtcVideoExternalBlendConfig *)blendConfig;
3388
3413- (int)stopBlendExternalVideo:(NERtcStreamChannelType)streamType;
3414
3443- (int)pushBlendExternalVideoFrame:(NERtcStreamChannelType)streamType frame:(NERtcVideoFrame *)frame;
3444
3456- (int)enableVideoDenoise:(BOOL)enabled streamType:(NERtcStreamChannelType)streamType;
3457
3470- (int)enableVideoLowlightEnhance:(BOOL)enabled level:(NERtcVideoLowlightEnhanceLevel)level streamType:(NERtcStreamChannelType)streamType;
3471
3472#pragma mark - Other
3473
3483- (int)reportCustomEvent:(NSString *)eventName
3484 customIdentify:(NSString *)customIdentify
3485 param:(NSDictionary *)param;
3486
3487@end
3488
3489NS_ASSUME_NONNULL_END
3490
3491#pragma clang diagnostic pop
3492
3493#endif /* INERtcChannel_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
截图结果 block 回调。
定义 INERtcEngine.h:74
void(^ NERtcJoinChannelCompletion)(NSError *_Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid)
加入房间 block。
定义 INERtcEngine.h:36
void(^ NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode)
互动直播推流 block。
定义 INERtcEngine.h:50
NERtcVideoLowlightEnhanceLevel
定义 NERtcEngineEnum.h:4362
NERtcMediaPubType
媒体 pub 类型。
定义 NERtcEngineEnum.h:235
NERtcVideoStreamLayerCount
定义 NERtcEngineEnum.h:504
NERtcSpatializerRenderMode
空间音效渲染模式
定义 NERtcEngineEnum.h:2551
NERtcDistanceRolloffModel
空间音效衰减模式
定义 NERtcEngineEnum.h:2577
NERtcConnectionStateType
当前房间的连接状态。
定义 NERtcEngineEnum.h:45
NERtcCameraPosition
指定的摄像头位置。
定义 NERtcEngineEnum.h:1470
NERtcRemoteVideoStreamType
远端视频流类型。
定义 NERtcEngineEnum.h:709
NERtcStreamFallbackOptions
定义 NERtcEngineEnum.h:2638
NERtcRangeAudioMode
定义 NERtcEngineEnum.h:2596
NERtcClientRole
用户角色。
定义 NERtcEngineEnum.h:206
NERtcStreamChannelType
SEI 发送的流通道类型。
定义 NERtcEngineEnum.h:1135
NERtcVideoRenderScaleMode
视频渲染缩放模式。
定义 NERtcEngineEnum.h:794
NERtcMediaPriorityType
定义 NERtcEngineEnum.h:2617
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
定义 NERtcEngineEnum.h:2348
摄像头采集配置。
定义 NERtcEngineBase.h:491
定义 NERtcEngineBase.h:1823
需要应用马赛克效果的归一化区域(0~1)。
定义 NERtcEngineBase.h:3577
joinChannel 回调时的一些可选信息
定义 NERtcEngineBase.h:2852
joinChannel 时的一些可选信息
定义 NERtcEngineBase.h:2831
直播推流任务的配置。
定义 NERtcEngineBase.h:1338
3D 音效算法中坐标信息。
定义 NERtcEngineBase.h:3071
3D 音效房间属性设置。
定义 NERtcEngineBase.h:3147
视频画布设置。
定义 NERtcEngineBase.h:299
本地视频发送配置
定义 NERtcEngineBase.h:555
外部视频混合配置。
定义 NERtcEngineBase.h:3625
视频帧信息。
定义 NERtcEngineBase.h:1639
本地辅流发送配置。
定义 NERtcEngineBase.h:661
int switchCamera()
切换前置/后置摄像头。 该方法需要在相机启动后调用,例如调用 startPreview 或 joinChannel 后。
int initSpatializer()
初始化引擎 3D 音效算法
int leaveChannel()
离开音视频房间。 通过本接口可以实现挂断或退出通话,并释放本房间内的相关资源。
int stopScreenCapture()
关闭屏幕共享。 通过此接口可以实现关闭屏幕共享辅流。
NERtcConnectionStateType connectionState()
获取当前房间连接状态。
int stopChannelMediaRelay()
停止跨房间媒体流转发。 通常在主播离开房间时,跨房间媒体流转发会自动停止;您也可以根据需要随时调用该方法,此时主播会退出所有目标房间。
int resumeChannelMediaRelay()
恢复跨房间媒体流转发。
int clearRemoteHighPriorityAudioStream()
清除之前设置的所有高优先级音频流。
int pauseChannelMediaRelay()
暂停跨房间媒体流转发。
int cleanupChannelMediaStatsObserver()
清除全部媒体统计信息观测器。
NSString * getChannelName()
获取当前房间名。