NERtc iOS SDK  V4.4.301
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 
23 typedef void(^NERtcJoinChannelCompletion)(NSError * _Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid);
24 
25 
32 typedef void(^NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode);
33 
40 typedef void(^NERtcTakeSnapshotCallback)(int errorCode, UIImage * _Nullable image);
41 
42 @class NERtcEngineContext;
44 @class NERtcVideoCanvas;
45 
49 @protocol INERtcEngine <NSObject>
50 
57 
70 - (int)setupEngineWithContext:(NERtcEngineContext *)context;
71 
91 - (int)joinChannelWithToken:(NSString *)token
92  channelName:(NSString *)channelName
93  myUid:(uint64_t)uId
94  completion:(NERtcJoinChannelCompletion)completion;
95 
105 - (int)leaveChannel;
106 
107 
126 - (int)switchChannelWithToken:(NSString *)token channelName:(NSString *)channelName completion:(NERtcJoinChannelCompletion)completion;
127 
143 - (int)enableLocalAudio:(BOOL)enabled;
144 
145 
156 - (int)enableLocalVideo:(BOOL)enabled;
157 
168 - (int)setChannelProfile:(NERtcChannelProfileType)channelProfile;
169 
183 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
184 
194 - (int)setAudioProfile:(NERtcAudioProfileType)profile scenario:(NERtcAudioScenarioType)scenario;
195 
206 - (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
207 
223 - (int)setupRemoteVideoCanvas:(NERtcVideoCanvas *)canvas forUserID:(uint64_t)userID;
224 
234 - (int)switchCamera;
235 
252 - (int)setClientRole:(NERtcClientRole)role;
253 
265 - (int)setParameters:(NSDictionary *)parameters;
266 
267 @end
268 
269 
270 NS_ASSUME_NONNULL_END
271 
272 #endif /* INERtcEngine_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
Returns the screenshot.
Definition: INERtcEngine.h:40
NS_ASSUME_NONNULL_BEGIN typedef void(^ NERtcJoinChannelCompletion)(NSError *_Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid)
Joins the room.
void(^ NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode)
Interactive live streaming.
Definition: INERtcEngine.h:32
NERtcAudioProfileType
Summary of audio quality capabilities Audio profile: sample rate, bitrate, encoding mode,...
Definition: NERtcEngineEnum.h:365
NERtcConnectionStateType
The connection status of the current engine
Definition: NERtcEngineEnum.h:26
NERtcAudioScenarioType
Audio scenarios Different audio scenarios use different audio capture modes (mobile platforms) and pl...
Definition: NERtcEngineEnum.h:391
NERtcChannelProfileType
Sets a room scene.
Definition: NERtcEngineEnum.h:405
NERtcClientRole
User role
Definition: NERtcEngineEnum.h:61
kNERtcLiveStreamError
LiveStream Error Code
Definition: NERtcEngineErrorCode.h:156
Initializes the NERtcEngine instance.
Definition: NERtcEngineContext.h:17
Configures the video canvas.
Definition: NERtcEngineBase.h:53
Local video publishing configuration
Definition: NERtcEngineBase.h:125
The common interface of NERtcEngine.
Definition: INERtcEngine.h:49
NERtcConnectionStateType connectionState()
Gets the connection status.
int switchCamera()
Switches between the front and rear cameras.
int leaveChannel()
Leaves a room, such as hanging up or ending a call.