NERtc iOS SDK
NERtcEngineDelegate.h
浏览该文件的文档.
1 /*
2  * Copyright (c) 2021 NetEase, Inc. All rights reserved.
3  */
4 
5 #import <Foundation/Foundation.h>
7 #import "NERtcEngineEnum.h"
8 #import "NERtcEngineBase.h"
9 #import <CoreVideo/CoreVideo.h>
10 
11 NS_ASSUME_NONNULL_BEGIN
12 
16 @protocol NERtcEngineDelegate <NSObject>
17 
18 @optional
19 
29 - (void)onNERtcEngineDidError:(NERtcError)errCode;
30 
43 - (void)onNERtcEngineDidWarning:(NERtcWarning)warnCode msg:(NSString *)msg;
44 
53 - (void)onNERtcEngineConnectionStateChangeWithState:(NERtcConnectionStateType)state
54  reason:(NERtcReasonConnectionChangedType)reason;
55 
63 - (void)onNERtcEngineDidLeaveChannelWithResult:(NERtcError)result;
64 
74 - (void)onNERtcEngineDidDisconnectWithReason:(NERtcError)reason;
75 
82 - (void)onNERtcEngineRejoinChannel:(NERtcError)result;
83 
97 - (void)onNERtcEngineUserDidJoinWithUserID:(uint64_t)userID userName:(NSString *)userName;
98 
110 - (void)onNERtcEngineUserDidLeaveWithUserID:(uint64_t)userID reason:(NERtcSessionLeaveReason)reason;
111 
125 - (void)onNERtcEngineDidClientRoleChanged:(NERtcClientRole)oldRole newRole:(NERtcClientRole)newRole;
126 
133 
139 - (void)onNERtcEngineUserAudioDidStart:(uint64_t)userID;
140 
146 - (void)onNERtcEngineUserAudioDidStop:(uint64_t)userID;
147 
157 - (void)onNERtcEngineUserVideoDidStartWithUserID:(uint64_t)userID videoProfile:(NERtcVideoProfileType)profile;
158 
166 - (void)onNERtcEngineUserVideoDidStop:(uint64_t)userID;
167 
176 - (void)onNERtcEngineUserSubStreamDidStartWithUserID:(uint64_t)userID subStreamProfile:(NERtcVideoProfileType)profile;
177 
185 - (void)onNERtcEngineUserSubStreamDidStop:(uint64_t)userID;
186 
187 @end
188 
193 @protocol NERtcEngineLiveStreamObserver <NSObject>
194 
195 @optional
203 - (void)onNERTCEngineLiveStreamState:(NERtcLiveStreamStateCode)state taskID:(NSString *)taskID url:(NSString *)url;
204 
205 @end
206 
211 @protocol NERtcEngineVideoFrameObserver <NSObject>
212 
213 @optional
214 
226 - (void)onNERtcEngineVideoFrameCaptured:(CVPixelBufferRef)bufferRef rotation:(NERtcVideoRotationType)rotation;
227 
228 @end
229 
234 
235 @optional
236 //
237 //- (void)onNERtcEngineAudioDeviceInterruptionBegan;
238 //
239 //- (void)onNERtcEngineAudioDeviceInterruptionEnded;
240 
246 - (void)onNERtcEngineAudioDeviceRoutingDidChange:(NERtcAudioOutputRouting)routing;
247 
248 @end
249 
253 @protocol NERtcEngineVideoRenderSink <NSObject>
254 
255 @optional
262 - (void)onNERtcEngineRenderFrame:(NERtcVideoFrame *_Nonnull)frame;
263 
264 @end
265 
266 
272 @protocol NERtcEngineVideoSEIObserver <NSObject>
273 
274 @optional
275 
286 - (void)onNERtcEngineRecvSEIMsg:(uint64_t)userID message:(NSData *)message;
287 
288 @end
289 
294 
295 @optional
296 
305 - (void)onNERtcEngineUserVideoProfileDidUpdate:(uint64_t)userID maxProfile:(NERtcVideoProfileType)maxProfile;
306 
315 - (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted;
316 
323 - (void)onNERtcEngineUser:(uint64_t)userID audioMuted:(BOOL)muted;
324 
334 - (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID;
335 
341 - (void)onNERtcEngineFirstAudioDataDidReceiveWithUserID:(uint64_t)userID;
342 
348 - (void)onEngineFirstAudioFrameDecoded:(uint64_t)userID;
349 
361 - (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height;
362 
370 - (void)onNERtcEngineAudioDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcAudioDeviceType)deviceType deviceState:(NERtcAudioDeviceState)deviceState;
371 
383 - (void)onNERtcEngineVideoDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcVideoDeviceType)deviceType deviceState:(NERtcVideoDeviceState)deviceState;
384 
392 - (void)onNERtcEngineNetworkConnectionTypeChanged:(NERtcNetworkConnectionType)newConnectionType;
393 
394 
407 - (void)onAudioMixingStateChanged:(NERtcAudioMixingState)state errorCode:(NERtcAudioMixingErrorCode)errorCode;
408 
416 - (void)onAudioMixingTimestampUpdate:(uint64_t)timeStampMS;
417 
418 
424 - (void)onAudioEffectFinished:(uint32_t)effectId;
425 
426 
438 - (void)onLocalAudioVolumeIndication:(int)volume;
439 
440 
455 -(void)onRemoteAudioVolumeIndication:(nullable NSArray<NERtcAudioVolumeInfo*> *)speakers totalVolume:(int)totalVolume;
456 
466 - (void)onNERtcEngineHardwareResourceReleased:(NERtcError)result;
467 
479 - (void)onNERtcCameraFocusChanged:(CGPoint)focusPoint;
480 
490 - (void)onNERtcCameraExposureChanged:(CGPoint)exposurePoint;
491 
492 
493 
502 
508 - (void)onNERtcEngineChannelMediaRelayStateDidChange:(NERtcChannelMediaRelayState)state channelName:(NSString *)channelName;
509 
516 - (void)onNERtcEngineDidReceiveChannelMediaRelayEvent:(NERtcChannelMediaRelayEvent)event channelName:(NSString *)channelName error:(NERtcError)error;
517 
524 - (void)onNERtcEngineAudioRecording:(NERtcAudioRecordingCode)code filePath:(NSString *)filePath;
525 
526 
538 - (void)onNERtcEngineLocalPublishFallbackToAudioOnly:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
539 
553 - (void)onNERtcEngineRemoteSubscribeFallbackToAudioOnly:(uint64_t)uid isFallback:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
554 
555 
556 
557 @end
558 
559 
565 @protocol NERtcEngineAudioFrameObserver <NSObject>
566 
567 @optional
568 
580 - (void)onNERtcEngineAudioFrameDidRecord:(NERtcAudioFrame *)frame;
581 
582 
594 - (void)onNERtcEngineAudioFrameWillPlayback:(NERtcAudioFrame *)frame;
595 
608 - (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame;
609 
622 - (void)onNERtcEngineMixedAudioFrame:(NERtcAudioFrame *)frame;
623 
624 @end
625 
626 NS_ASSUME_NONNULL_END
NERtcAudioMixingErrorCode
伴音错误码
Definition: NERtcEngineEnum.h:587
NERtcAudioDeviceState
音频设备状态
Definition: NERtcEngineEnum.h:754
NERtcChannelMediaRelayEvent
媒体流转发回调事件
Definition: NERtcEngineEnum.h:817
NERtcChannelMediaRelayState
媒体流转发状态
Definition: NERtcEngineEnum.h:803
NERtcAudioDeviceType
音频设备类型
Definition: NERtcEngineEnum.h:731
NERtcAudioOutputRouting
音频路由
Definition: NERtcEngineEnum.h:339
NERtcAudioMixingState
伴音任务状态
Definition: NERtcEngineEnum.h:577
NERtcSessionLeaveReason
用户离开房间的原因
Definition: NERtcEngineEnum.h:45
NERtcConnectionStateType
当前 engine 的连接状态
Definition: NERtcEngineEnum.h:26
NERtcVideoProfileType
视频 profile 类型
Definition: NERtcEngineEnum.h:104
NERtcNetworkConnectionType
网络连接的类型
Definition: NERtcEngineEnum.h:627
NERtcAudioRecordingCode
录音回调状态码
Definition: NERtcEngineEnum.h:459
NERtcVideoDeviceState
视频设备状态无限制,SDK 可以完全控制 Audio Session。
Definition: NERtcEngineEnum.h:768
NERtcClientRole
用户角色
Definition: NERtcEngineEnum.h:61
NERtcStreamChannelType
SEI发送的流通道类型
Definition: NERtcEngineEnum.h:327
NERtcLiveStreamStateCode
直播推流状态
Definition: NERtcEngineEnum.h:697
NERtcReasonConnectionChangedType
当前engine连接状态变更的原因
Definition: NERtcEngineEnum.h:71
NERtcVideoDeviceType
视频设备类型
Definition: NERtcEngineEnum.h:743
NERtcVideoRotationType
视频数据的旋转方向
Definition: NERtcEngineEnum.h:301
NERtcError
Engine Error Code
Definition: NERtcEngineErrorCode.h:12
NERtcWarning
Definition: NERtcEngineErrorCode.h:145
音频帧
Definition: NERtcEngineBase.h:595
声音音量信息
Definition: NERtcEngineBase.h:613
视频帧信息
Definition: NERtcEngineBase.h:633
音频数据回调 如果需要对音频数据做处理,需要实现这个 protocol
Definition: NERtcEngineDelegate.h:565
音频会话回调
Definition: NERtcEngineDelegate.h:233
NERtcEngine 常用回调
Definition: NERtcEngineDelegate.h:16
void onNERtcEngineReconnectingStart()
重连开始回调。
NERtcEngine 扩展回调。
Definition: NERtcEngineDelegate.h:293
void onNERtcEngineAudioHasHowling()
检测到啸叫回调。
直播推流状态回调 如果需要监听直播推流状态,需要实现这个 protocol
Definition: NERtcEngineDelegate.h:193
本地视频数据采集回调 如果需要对采集数据做美颜等处理,需要实现这个 protocol。
Definition: NERtcEngineDelegate.h:211
外部视频渲染。
Definition: NERtcEngineDelegate.h:253
注册 SEI 观测者。
Definition: NERtcEngineDelegate.h:272