NERtc iOS SDK  V4.6.20
INERtcEngine.h
浏览该文件的文档.
1 /*
2  * Copyright (c) 2021 NetEase, Inc. All rights reserved.
3  */
4 
5 #ifndef INERtcEngine_h
6 #define INERtcEngine_h
7 
8 #import <Foundation/Foundation.h>
9 #import "NERtcEngineEnum.h"
10 #import "NERtcEngineErrorCode.h"
11 
12 NS_ASSUME_NONNULL_BEGIN
13 
14 
31 typedef void(^NERtcJoinChannelCompletion)(NSError * _Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid);
32 
33 
46 typedef void(^NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode);
47 
60 typedef void(^NERtcTakeSnapshotCallback)(int errorCode, UIImage * _Nullable image);
61 
62 @class NERtcEngineContext;
65 @class NERtcVideoCanvas;
66 
75 @protocol INERtcEngine <NSObject>
76 
88 
111 - (int)setupEngineWithContext:(NERtcEngineContext *)context;
112 
147 - (int)joinChannelWithToken:(NSString *)token
148  channelName:(NSString *)channelName
149  myUid:(uint64_t)uId
150  completion:(NERtcJoinChannelCompletion)completion;
151 
166 - (int)leaveChannel;
167 
204 - (int)switchChannelWithToken:(NSString *)token channelName:(NSString *)channelName completion:(NERtcJoinChannelCompletion)completion;
205 
233  - (int)enableLocalAudio:(BOOL)enabled;
234 
254  - (int)enableLocalVideo:(BOOL)enabled;
255 
311  - (int)enableLocalVideo:(BOOL)enabled streamType:(NERtcStreamChannelType)streamType;
312 
354 - (int)enableMediaPub:(BOOL)enabled withMediaType:(NERtcMediaPubType)mediaType;
355 
372 - (int)setChannelProfile:(NERtcChannelProfileType)channelProfile;
373 
374 
400 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
401 
465 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config streamType:(NERtcStreamChannelType)streamType;
466 
488 - (int)setAudioProfile:(NERtcAudioProfileType)profile scenario:(NERtcAudioScenarioType)scenario;
489 
510 - (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
511 
540 - (int)setupRemoteVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID;
541 
556  - (int)switchCamera;
557 
591 - (int)setClientRole:(NERtcClientRole)role;
592 
612 - (int)setParameters:(NSDictionary *)parameters;
613 
614 @end
615 
616 
617 NS_ASSUME_NONNULL_END
618 
619 #endif /* INERtcEngine_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
NERtcAudioProfileType
音频质量能力概要 音频属性:设置采样率,码率,编码模式和声道数
Definition: NERtcEngineEnum.h:1412
NERtcMediaPubType
媒体 pub 类型。
Definition: NERtcEngineEnum.h:206
NERtcConnectionStateType
当前房间的连接状态。
Definition: NERtcEngineEnum.h:45
NERtcAudioScenarioType
音频应用场景。 不同的场景设置对应不同的音频采集模式(移动平台)、播放模式。
Definition: NERtcEngineEnum.h:1496
NERtcChannelProfileType
房间场景。
Definition: NERtcEngineEnum.h:1543
NERtcClientRole
用户角色。
Definition: NERtcEngineEnum.h:177
NERtcStreamChannelType
SEI发送的流通道类型。
Definition: NERtcEngineEnum.h:998
kNERtcLiveStreamError
LiveStream Error Code。
Definition: NERtcEngineErrorCode.h:611
摄像头采集配置。
Definition: NERtcEngineBase.h:449
初始化设置 NERtcEngine
Definition: NERtcEngineContext.h:22
视频画布设置。
Definition: NERtcEngineBase.h:261
本地视频发送配置
Definition: NERtcEngineBase.h:503
NERtcEngine 的常用接口。
Definition: INERtcEngine.h:75
NERtcConnectionStateType connectionState()
获取当前房间连接状态。
int switchCamera()
切换前置/后置摄像头。 该方法需要在相机启动后调用,例如调用 startPreview 或 joinChannel 后。
int leaveChannel()
离开房间,即挂断或退出通话。 结束通话时,必须调用leaveChannel结束通话,否则无法开始下一次通话。 成功调用该方法离开房间后,本地会触发 onNERtcEngineDidLeaveChan...