NERTC iOS SDK V5.9.1
载入中...
搜索中...
未找到
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#pragma clang diagnostic push
12#pragma clang diagnostic ignored "-Wdocumentation"
13
14
15NS_ASSUME_NONNULL_BEGIN
16
25@protocol NERtcEngineDelegate <NSObject>
26
27@optional
28
43- (void)onNERtcEngineDidError:(NERtcError)errCode;
44
63- (void)onNERtcEngineDidWarning:(NERtcWarning)warnCode msg:(NSString *)msg;
64
65- (void)onNERtcEngineApiDidExecuted:(NSString *)apiName errCode:(NERtcError)errCode msg:(NSString *)msg;
66
81- (void)onNERtcEngineConnectionStateChangeWithState:(NERtcConnectionStateType)state
83
97- (void)onNERtcEngineDidLeaveChannelWithResult:(NERtcError)result;
98
114- (void)onNERtcEngineDidDisconnectWithReason:(NERtcError)reason;
115
128 - (void)onNERtcEngineRejoinChannel:(NERtcError)result;
129
156 - (void)onNERtcEngineUserDidJoinWithUserID:(uint64_t)userID userName:(NSString *)userName;
157
199- (void)onNERtcEngineUserDidJoinWithUserID:(uint64_t)userID userName:(NSString *)userName joinExtraInfo:(nullable NERtcUserJoinExtraInfo *)joinExtraInfo;
200
201
225- (void)onNERtcEngineUserDidLeaveWithUserID:(uint64_t)userID reason:(NERtcSessionLeaveReason)reason;
226
269- (void)onNERtcEngineUserDidLeaveWithUserID:(uint64_t)userID reason:(NERtcSessionLeaveReason)reason leaveExtraInfo:(nullable NERtcUserLeaveExtraInfo *)leaveExtraInfo;
270
292- (void)onNERtcEngineDidClientRoleChanged:(NERtcClientRole)oldRole newRole:(NERtcClientRole)newRole;
293
304- (void)onNERtcEngineReconnectingStart;
305
317- (void)onNERtcEngineUserAudioDidStart:(uint64_t)userID;
318
330- (void)onNERtcEngineUserAudioDidStop:(uint64_t)userID;
331
347- (void)onNERtcEngineUserVideoDidStartWithUserID:(uint64_t)userID videoProfile:(NERtcVideoProfileType)profile;
348
362- (void)onNERtcEngineUserVideoDidStop:(uint64_t)userID;
363
378- (void)onNERtcEngineUserSubStreamDidStartWithUserID:(uint64_t)userID subStreamProfile:(NERtcVideoProfileType)profile;
379
397- (void)onNERtcEngineUserVideoStreamDidStart:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType streamProfile:(NERtcVideoProfileType)profile;
398
411- (void)onNERtcEngineUserSubStreamDidStop:(uint64_t)userID;
412
426- (void)onNERtcEngineUserVideoStreamDidStop:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType;
427
450- (void)onNERtcEngineMediaRightChangeWithAudio:(BOOL)isAudioBannedByServer
451 video:(BOOL)isVideoBannedByServer;
452
465- (void)onNERtcEngineUserSubStreamAudioDidStart:(uint64_t)userID;
466
479- (void)onNERtcEngineUserSubStreamAudioDidStop:(uint64_t)userID;
480
499- (void)onNERtcEngineUser:(uint64_t)userID subStreamAudioMuted:(BOOL)muted;
500
501@end
502
513@protocol NERtcEngineLiveStreamObserver <NSObject>
514
515@optional
530- (void)onNERTCEngineLiveStreamState:(NERtcLiveStreamStateCode)state taskID:(NSString *)taskID url:(NSString *)url;
531
532@end
533
544@protocol NERtcEngineVideoFrameObserver <NSObject>
545
546@optional
547
564- (void)onNERtcEngineVideoFrameCaptured:(CVPixelBufferRef)bufferRef rotation:(NERtcVideoRotationType)rotation;
565
582- (void)onNERtcEngineRemoteVideoFrame:(CVPixelBufferRef)bufferRef rotation:(NERtcVideoRotationType)rotation;
583
584@end
585
594@protocol NERtcEngineAudioSessionObserver <NSObject>
595
596@optional
597//
598//- (void)onNERtcEngineAudioDeviceInterruptionBegan;
599//
600//- (void)onNERtcEngineAudioDeviceInterruptionEnded;
601
612- (void)onNERtcEngineAudioDeviceRoutingDidChange:(NERtcAudioOutputRouting)routing;
613
614@end
615
624@protocol NERtcEngineVideoRenderSink <NSObject>
625
626@optional
639- (void)onNERtcEngineRenderFrame:(NERtcVideoFrame *_Nonnull)frame;
640
641// 渲染所需的 buffer 类型,默认为 NERtcVideoBufferTypeRawData
642- (NERtcVideoBufferType)getFrameBufferType;
643
644@end
655@protocol NERtcEngineVideoSEIObserver <NSObject>
656
657@optional
658
675- (void)onNERtcEngineRecvSEIMsg:(uint64_t)userID message:(NSData *)message;
676
677@end
678
679@protocol NERtcEnginePreDecodeObserver <NSObject>
680 @optional
703- (void)onNERtcEnginePreDecoderFrame:(NERtcPreDecoderFrameInfo *)preDecoderFrame;
704
705@end
706
707@protocol NERtcEngineVideoEncoderQosObserver <NSObject>
708
709 @optional
710
733- (void)onNERtcEngineRequestSendKeyFrame:(NERtcStreamChannelType)videoStreamType;
734
762- (void)onNERtcEngineBitrateUpdated:(int)bitrateBps
763 videoStreamType:(NERtcStreamChannelType)videoStreamType;
764
792- (void)onNERtcEngineVideoCodecUpdated:(NERtcVideoCodecType)videoCodecType
793 videoStreamType:(NERtcStreamChannelType)videoStreamType;
794
795@end
796
797@protocol NERtcEnginePushStreamingObserver <NSObject>
798 @optional
853- (void)onNERtcEngineStartPushStreamingWithResult:(NERtcError)result channelId:(uint64_t)channelId;
870- (void)onNERtcEngineStopPushStreaming:(NERtcError)result;
871
888- (void)onNERtcEnginePushStreamingChangeToReconnectingWithReason:(NERtcError)reason;
889
904- (void)onNERtcEnginePushStreamingReconnectedSuccess;
905
906@end
907
908
909@protocol NERtcEnginePlayStreamingObserver <NSObject>
910 @optional
927- (void)onNERtcEnginePlayStreamingStarted:(NSString*)streamId error:(NERtcError)result;
928
943- (void)onNERtcEnginePlayStreamingReconnectedSuccess:(NSString*)streamId;
944
961- (void)onNERtcEnginePlayStreamingReconnecting:(NSString*)streamId reason:(NERtcError)reason;
962
979- (void)onNERtcEnginePlayStreamingStopped:(NSString*)streamId error:(NERtcError)error;
980
999- (void)onNERtcEnginePlayStreamingReceiveSeiMessage:(NSString*)streamId message:(NSString*)message;
1000
1001@end
1010@protocol NERtcEngineDelegateEx <NERtcEngineDelegate,
1011NERtcEngineVideoFrameObserver, // deprecated, USE setVideoFrameObserver:(id<NERtcEngineVideoFrameObserver>)videoframeObserver instead
1012NERtcEngineAudioSessionObserver,
1013NERtcEngineLiveStreamObserver,
1014NERtcEngineVideoSEIObserver,
1015NERtcEnginePushStreamingObserver,
1016NERtcEnginePlayStreamingObserver>
1017
1018@optional
1019
1034- (void)onNERtcEngineUserVideoProfileDidUpdate:(uint64_t)userID maxProfile:(NERtcVideoProfileType)maxProfile;
1035
1053- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted;
1054
1085- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
1086
1100- (void)onNERtcEngineUser:(uint64_t)userID audioMuted:(BOOL)muted;
1101
1116- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID;
1117
1146- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType;
1147
1186- (void)onNERtcEngineRemoteVideoSizeDidChangedWithUserID:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1187
1221- (void)onNERtcEngineLocalVideoRenderSizeChanged:(NERtcStreamChannelType)streamType width:(uint32_t)width height:(uint32_t)height;
1222
1233- (void)onNERtcEngineFirstAudioDataDidReceiveWithUserID:(uint64_t)userID;
1234
1246- (void)onEngineFirstAudioFrameDecoded:(uint64_t)userID;
1269- (void)onNERtcEngineLocalFirstAudioPacketSent:(NERtcAudioStreamType)streamType;
1288- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height;
1289
1325- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1326
1367- (void)onEngineFirstVideoFrameRender:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height elapsed:(uint64_t)elapsed streamType:(NERtcStreamChannelType)streamType;
1368
1383- (void)onNERtcEngineAudioDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcAudioDeviceType)deviceType deviceState:(NERtcAudioDeviceState)deviceState;
1384
1403- (void)onNERtcEngineVideoDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcVideoDeviceType)deviceType deviceState:(NERtcVideoDeviceState)deviceState;
1404
1417- (void)onNERtcEngineNetworkConnectionTypeChanged:(NERtcNetworkConnectionType)newConnectionType;
1418
1440- (void)onAudioMixingStateChanged:(NERtcAudioMixingState)state errorCode:(NERtcAudioMixingErrorCode)errorCode;
1441
1454- (void)onAudioMixingTimestampUpdate:(uint64_t)timeStampMS;
1455
1456
1468- (void)onAudioEffectFinished:(uint32_t)effectId;
1469
1497- (void)onAudioEffectTimestampUpdateWithId:(uint32_t)effectId timeStampMS:(uint64_t)timeStampMS;
1498
1517- (void)onLocalAudioVolumeIndication:(int)volume;
1518
1537- (void)onLocalAudioVolumeIndication:(int)volume withVad:(BOOL)enableVad;
1538
1539
1562-(void)onRemoteAudioVolumeIndication:(nullable NSArray<NERtcAudioVolumeInfo*> *)speakers totalVolume:(int)totalVolume;
1563
1578- (void)onNERtcEngineHardwareResourceReleased:(NERtcError)result;
1579
1596- (void)onNERtcCameraFocusChanged:(CGPoint)focusPoint;
1597
1612- (void)onNERtcCameraExposureChanged:(CGPoint)exposurePoint;
1613
1614
1615
1630- (void)onNERtcEngineAudioHasHowling;
1631
1645- (void)onNERtcEngineAudioHasHowling:(BOOL)flag;
1646
1659- (void)onNERtcEngineChannelMediaRelayStateDidChange:(NERtcChannelMediaRelayState)state channelName:(NSString *)channelName;
1660
1675- (void)onNERtcEngineDidReceiveChannelMediaRelayEvent:(NERtcChannelMediaRelayEvent)event channelName:(NSString *)channelName error:(NERtcError)error;
1676
1690- (void)onNERtcEngineAudioRecording:(NERtcAudioRecordingCode)code filePath:(NSString *)filePath;
1691
1692
1713- (void)onNERtcEngineLocalPublishFallbackToAudioOnly:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1714
1738- (void)onNERtcEngineRemoteSubscribeFallbackToAudioOnly:(uint64_t)uid isFallback:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1739
1755- (void)onNERtcEngineLastmileQuality:(NERtcNetworkQuality)quality;
1756
1773- (void)onNERtcEngineLastmileProbeTestResult:(NERtcLastmileProbeResult *)result;
1774
1794- (void)onNERtcEngineVirtualBackgroundSourceEnabled:(BOOL)enabled reason:(NERtcVirtualBackgroundSourceStateReason)reason;
1795
1810- (void)onNERtcEngineLocalVideoWatermarkStateWithStreamType:(NERtcStreamChannelType)type
1811 state:(NERtcLocalVideoWatermarkState)state;
1823- (void)onNERtcEnginePermissionKeyWillExpire;
1824
1857- (void)onNERtcEngineUpdatePermissionKey:(NSString *)key error:(NERtcError)error timeout:(NSUInteger)timeout;
1858
1871- (void)onNERtcEngineUserDataDidStart:(uint64_t)userID;
1872
1883- (void)onNERtcEngineUserDataDidStop:(uint64_t)userID;
1884
1897- (void)onNERtcEngineUserDataReceiveMessage:(uint64_t)userID data:(NSData *)data;
1898
1909- (void)onNERtcEngineUserDataStateChanged:(uint64_t)userID;
1910
1923- (void)onNERtcEngineUserDataBufferedAmountChanged:(uint64_t)userID previousAmount:(uint64_t)previousAmount;
1924
1933- (void)onNERtcEngineLabFeatureDidCallbackWithKey:(NSString*)key param:(id)param;
1934
1943- (void)onNERtcEngineAiDataWithType:(NSString*)type data:(NSString*)data;
1944
1956- (void)onNERtcEngineAsrCaptionStateChanged:(NERtcAsrCaptionState)state code:(int)code message:(NSString *)message;
1957
1969- (void)onNERtcEngineAsrCaptionResult:(nullable NSArray<NERtcAsrCaptionResult*> *)results;
1970
1971@end
1972
1983@protocol NERtcEngineAudioFrameObserver <NSObject>
1984
1985@optional
1986
2005- (void)onNERtcEngineAudioFrameDidRecord:(NERtcAudioFrame *)frame;
2006
2007
2026- (void)onNERtcEngineAudioFrameWillPlayback:(NERtcAudioFrame *)frame;
2027
2050- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame;
2051
2076- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
2077
2098- (void)onNERtcEngineMixedAudioFrame:(NERtcAudioFrame *)frame;
2099
2100
2119- (void)onNERtcEngineSubStreamAudioFrameDidRecord:(NERtcAudioFrame *)frame;
2120
2143- (void)onNERtcEnginePlaybackSubStreamAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
2144
2145
2146@end
2147
2148@protocol NERtcEnginePacketObserver <NSObject>
2149
2150 @optional
2156- (BOOL)onSendAudioPacket:(NERtcPacket *)packet;
2162- (BOOL)onSendVideoPacket:(NERtcPacket *)packet;
2168- (BOOL)onReceiveAudioPacket:(NERtcPacket *)packet;
2174- (BOOL)onReceiveVideoPacket:(NERtcPacket *)packet;
2175
2176@end
2177
2178NS_ASSUME_NONNULL_END
2179
2180#pragma clang diagnostic pop
NERtcAudioMixingErrorCode
伴音错误码。
定义 NERtcEngineEnum.h:3137
NERtcAudioDeviceState
音频设备状态。
定义 NERtcEngineEnum.h:3663
NERtcVirtualBackgroundSourceStateReason
虚拟背景未成功启用的原因或确认成功的信息。
定义 NERtcEngineEnum.h:1174
NERtcVideoBufferType
定义 NERtcEngineEnum.h:1072
NERtcAsrCaptionState
定义 NERtcEngineEnum.h:4190
NERtcChannelMediaRelayEvent
媒体流转发回调事件
定义 NERtcEngineEnum.h:3879
NERtcChannelMediaRelayState
媒体流转发状态
定义 NERtcEngineEnum.h:3832
NERtcVideoCodecType
定义 NERtcEngineEnum.h:2740
NERtcAudioDeviceType
音频设备类型。
定义 NERtcEngineEnum.h:3595
NERtcLocalVideoWatermarkState
视频水印状态。
定义 NERtcEngineEnum.h:1356
NERtcAudioOutputRouting
音频路由。
定义 NERtcEngineEnum.h:1973
NERtcAudioMixingState
伴音任务状态。
定义 NERtcEngineEnum.h:3108
NERtcSessionLeaveReason
用户离开房间的原因。
定义 NERtcEngineEnum.h:121
NERtcConnectionStateType
当前房间的连接状态。
定义 NERtcEngineEnum.h:45
NERtcVideoProfileType
视频 profile 类型。
定义 NERtcEngineEnum.h:447
NERtcNetworkConnectionType
网络连接的类型。
定义 NERtcEngineEnum.h:3294
NERtcAudioRecordingCode
录音回调状态码。
定义 NERtcEngineEnum.h:2626
NERtcNetworkQuality
网络质量类型。
定义 NERtcEngineEnum.h:3758
NERtcVideoDeviceState
视频设备状态无限制,SDK 可以完全控制 Audio Session。
定义 NERtcEngineEnum.h:3710
NERtcClientRole
用户角色。
定义 NERtcEngineEnum.h:206
NERtcStreamChannelType
SEI 发送的流通道类型。
定义 NERtcEngineEnum.h:1125
NERtcLiveStreamStateCode
直播推流状态。
定义 NERtcEngineEnum.h:3504
NERtcReasonConnectionChangedType
当前 engine 连接状态变更的原因。
定义 NERtcEngineEnum.h:255
NERtcVideoDeviceType
视频设备类型。
定义 NERtcEngineEnum.h:3633
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
定义 NERtcEngineEnum.h:2299
NERtcVideoRotationType
视频数据的旋转方向
定义 NERtcEngineEnum.h:1033
NERtcError
Engine Error Code。
定义 NERtcEngineErrorCode.h:17
NERtcWarning
定义 NERtcEngineErrorCode.h:854
定义 NERtcEngineBase.h:3356
音频帧。
定义 NERtcEngineBase.h:1532
声音音量信息。
定义 NERtcEngineBase.h:1577
上下行 Last mile 网络质量探测结果。
定义 NERtcEngineBase.h:2535
定义 NERtcEngineBase.h:3163
编码完的媒体数据帧
定义 NERtcEngineBase.h:2913
onUserJoined 回调时的一些可选信息
定义 NERtcEngineBase.h:2847
onUserLeave 回调时的一些可选信息
定义 NERtcEngineBase.h:2859
视频帧信息。
定义 NERtcEngineBase.h:1622