NERTC iOS SDK V5.9.15
载入中...
搜索中...
未找到
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
597- (void)onNERtcEngineRemoteVideoFrame:(NERtcStreamChannelType)videoStreamType
598 userId:(uint64_t)userId
599 data:(void *)data
600 format:(NERtcVideoFormatType)format
601 width:(uint32_t)width
602 height:(uint32_t)height
603 planeCount:(uint32_t)planeCount
604 offset:(int64_t *)offset
605 stride:(uint32_t *)stride
606 rotation:(NERtcVideoRotationType)rotation;
607
637- (void)onNERtcEnginePlayStreamingVideoFrame:(void *)data
638 format:(NERtcVideoFormatType)format
639 width:(uint32_t)width
640 height:(uint32_t)height
641 planeCount:(uint32_t)planeCount
642 offset:(int64_t *)offset
643 stride:(uint32_t *)stride
644 rotation:(NERtcVideoRotationType)rotation
645 streamId:(NSString *)streamId;
646
647@end
648
657@protocol NERtcEngineAudioSessionObserver <NSObject>
658
659@optional
660//
661//- (void)onNERtcEngineAudioDeviceInterruptionBegan;
662//
663//- (void)onNERtcEngineAudioDeviceInterruptionEnded;
664
675- (void)onNERtcEngineAudioDeviceRoutingDidChange:(NERtcAudioOutputRouting)routing;
676
677@end
678
687@protocol NERtcEngineVideoRenderSink <NSObject>
688
689@optional
702- (void)onNERtcEngineRenderFrame:(NERtcVideoFrame *_Nonnull)frame;
703
704// 渲染所需的 buffer 类型,默认为 NERtcVideoBufferTypeRawData
705- (NERtcVideoBufferType)getFrameBufferType;
706
707@end
718@protocol NERtcEngineVideoSEIObserver <NSObject>
719
720@optional
721
738- (void)onNERtcEngineRecvSEIMsg:(uint64_t)userID message:(NSData *)message;
739
740@end
741
742@protocol NERtcEnginePreDecodeObserver <NSObject>
743 @optional
766- (void)onNERtcEnginePreDecoderFrame:(NERtcPreDecoderFrameInfo *)preDecoderFrame;
767
768@end
769
770@protocol NERtcEngineVideoEncoderQosObserver <NSObject>
771
772 @optional
773
796- (void)onNERtcEngineRequestSendKeyFrame:(NERtcStreamChannelType)videoStreamType;
797
825- (void)onNERtcEngineBitrateUpdated:(int)bitrateBps
826 videoStreamType:(NERtcStreamChannelType)videoStreamType;
827
855- (void)onNERtcEngineVideoCodecUpdated:(NERtcVideoCodecType)videoCodecType
856 videoStreamType:(NERtcStreamChannelType)videoStreamType;
857
858@end
859
860@protocol NERtcEnginePushStreamingObserver <NSObject>
861 @optional
916- (void)onNERtcEngineStartPushStreamingWithResult:(NERtcError)result channelId:(uint64_t)channelId;
933- (void)onNERtcEngineStopPushStreaming:(NERtcError)result;
934
951- (void)onNERtcEnginePushStreamingChangeToReconnectingWithReason:(NERtcError)reason;
952
967- (void)onNERtcEnginePushStreamingReconnectedSuccess;
968
969@end
970
971
972@protocol NERtcEnginePlayStreamingObserver <NSObject>
973 @optional
974
996- (void)onNERtcEnginePlayStreamingStateChange:(NSString*)streamId state:(NERtcLivePlayStreamState)state error:(NERtcError)error;
997
1016- (void)onNERtcEnginePlayStreamingReceiveSeiMessage:(NSString*)streamId message:(NSString*)message;
1017
1040- (void)onNERtcEnginePlayStreamingFirstVideoFrameRender:(NSString*)streamId timeMs:(int64_t)time_ms width:(uint32_t)width height:(uint32_t)height;
1041
1060- (void)onNERtcEnginePlayStreamingFirstAudioFramePlayed:(NSString*)streamId timeMs:(int64_t)time_ms;
1061
1082- (void)onNERtcEnginePlayStreamingDuration:(NSString*)streamId totalDurationS:(int64_t)total_duration_s currentPtsS:(int64_t)current_pts_s;
1083
1084@end
1093@protocol NERtcEngineDelegateEx <NERtcEngineDelegate,
1094NERtcEngineVideoFrameObserver, // deprecated, USE setVideoFrameObserver:(id<NERtcEngineVideoFrameObserver>)videoframeObserver instead
1095NERtcEngineAudioSessionObserver,
1096NERtcEngineLiveStreamObserver,
1097NERtcEngineVideoSEIObserver,
1098NERtcEnginePushStreamingObserver,
1099NERtcEnginePlayStreamingObserver>
1100
1101@optional
1102
1117- (void)onNERtcEngineUserVideoProfileDidUpdate:(uint64_t)userID maxProfile:(NERtcVideoProfileType)maxProfile;
1118
1136- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted;
1137
1168- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
1169
1183- (void)onNERtcEngineUser:(uint64_t)userID audioMuted:(BOOL)muted;
1184
1199- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID;
1200
1229- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType;
1230
1269- (void)onNERtcEngineRemoteVideoSizeDidChangedWithUserID:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1270
1304- (void)onNERtcEngineLocalVideoRenderSizeChanged:(NERtcStreamChannelType)streamType width:(uint32_t)width height:(uint32_t)height;
1305
1316- (void)onNERtcEngineFirstAudioDataDidReceiveWithUserID:(uint64_t)userID;
1317
1329- (void)onEngineFirstAudioFrameDecoded:(uint64_t)userID;
1352- (void)onNERtcEngineLocalFirstAudioPacketSent:(NERtcAudioStreamType)streamType;
1371- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height;
1372
1408- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1409
1450- (void)onEngineFirstVideoFrameRender:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height elapsed:(uint64_t)elapsed streamType:(NERtcStreamChannelType)streamType;
1451
1466- (void)onNERtcEngineAudioDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcAudioDeviceType)deviceType deviceState:(NERtcAudioDeviceState)deviceState;
1467
1486- (void)onNERtcEngineVideoDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcVideoDeviceType)deviceType deviceState:(NERtcVideoDeviceState)deviceState;
1487
1500- (void)onNERtcEngineNetworkConnectionTypeChanged:(NERtcNetworkConnectionType)newConnectionType;
1501
1523- (void)onAudioMixingStateChanged:(NERtcAudioMixingState)state errorCode:(NERtcAudioMixingErrorCode)errorCode;
1524
1537- (void)onAudioMixingTimestampUpdate:(uint64_t)timeStampMS;
1538
1539
1551- (void)onAudioEffectFinished:(uint32_t)effectId;
1552
1580- (void)onAudioEffectTimestampUpdateWithId:(uint32_t)effectId timeStampMS:(uint64_t)timeStampMS;
1581
1600- (void)onLocalAudioVolumeIndication:(int)volume;
1601
1620- (void)onLocalAudioVolumeIndication:(int)volume withVad:(BOOL)enableVad;
1621
1622
1645-(void)onRemoteAudioVolumeIndication:(nullable NSArray<NERtcAudioVolumeInfo*> *)speakers totalVolume:(int)totalVolume;
1646
1661- (void)onNERtcEngineHardwareResourceReleased:(NERtcError)result;
1662
1679- (void)onNERtcCameraFocusChanged:(CGPoint)focusPoint;
1680
1695- (void)onNERtcCameraExposureChanged:(CGPoint)exposurePoint;
1696
1697
1698
1713- (void)onNERtcEngineAudioHasHowling;
1714
1728- (void)onNERtcEngineAudioHasHowling:(BOOL)flag;
1729
1742- (void)onNERtcEngineChannelMediaRelayStateDidChange:(NERtcChannelMediaRelayState)state channelName:(NSString *)channelName;
1743
1758- (void)onNERtcEngineDidReceiveChannelMediaRelayEvent:(NERtcChannelMediaRelayEvent)event channelName:(NSString *)channelName error:(NERtcError)error;
1759
1773- (void)onNERtcEngineAudioRecording:(NERtcAudioRecordingCode)code filePath:(NSString *)filePath;
1774
1775
1796- (void)onNERtcEngineLocalPublishFallbackToAudioOnly:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1797
1821- (void)onNERtcEngineRemoteSubscribeFallbackToAudioOnly:(uint64_t)uid isFallback:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1822
1838- (void)onNERtcEngineLastmileQuality:(NERtcNetworkQuality)quality;
1839
1856- (void)onNERtcEngineLastmileProbeTestResult:(NERtcLastmileProbeResult *)result;
1857
1877- (void)onNERtcEngineVirtualBackgroundSourceEnabled:(BOOL)enabled reason:(NERtcVirtualBackgroundSourceStateReason)reason;
1878
1893- (void)onNERtcEngineLocalVideoWatermarkStateWithStreamType:(NERtcStreamChannelType)type
1894 state:(NERtcLocalVideoWatermarkState)state;
1906- (void)onNERtcEnginePermissionKeyWillExpire;
1907
1940- (void)onNERtcEngineUpdatePermissionKey:(NSString *)key error:(NERtcError)error timeout:(NSUInteger)timeout;
1941
1954- (void)onNERtcEngineUserDataDidStart:(uint64_t)userID;
1955
1966- (void)onNERtcEngineUserDataDidStop:(uint64_t)userID;
1967
1980- (void)onNERtcEngineUserDataReceiveMessage:(uint64_t)userID data:(NSData *)data;
1981
1992- (void)onNERtcEngineUserDataStateChanged:(uint64_t)userID;
1993
2006- (void)onNERtcEngineUserDataBufferedAmountChanged:(uint64_t)userID previousAmount:(uint64_t)previousAmount;
2007
2016- (void)onNERtcEngineLabFeatureDidCallbackWithKey:(NSString*)key param:(id)param;
2017
2026- (void)onNERtcEngineAiDataWithType:(NSString*)type data:(NSString*)data;
2027
2039- (void)onNERtcEngineAsrCaptionStateChanged:(NERtcAsrCaptionState)state code:(int)code message:(NSString *)message;
2040
2052- (void)onNERtcEngineAsrCaptionResult:(nullable NSArray<NERtcAsrCaptionResult*> *)results;
2053
2054@end
2055
2066@protocol NERtcEngineAudioFrameObserver <NSObject>
2067
2068@optional
2069
2088- (void)onNERtcEngineAudioFrameDidRecord:(NERtcAudioFrame *)frame;
2089
2090
2109- (void)onNERtcEngineAudioFrameWillPlayback:(NERtcAudioFrame *)frame;
2110
2133- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame;
2134
2155- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingForPlayStreaming:(NSString*)playStreamId frame:(NERtcAudioFrame *)frame;
2156
2181- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
2182
2203- (void)onNERtcEngineMixedAudioFrame:(NERtcAudioFrame *)frame;
2204
2205
2224- (void)onNERtcEngineSubStreamAudioFrameDidRecord:(NERtcAudioFrame *)frame;
2225
2248- (void)onNERtcEnginePlaybackSubStreamAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
2249
2250
2251@end
2252
2253@protocol NERtcEnginePacketObserver <NSObject>
2254
2255 @optional
2261- (BOOL)onSendAudioPacket:(NERtcPacket *)packet;
2267- (BOOL)onSendVideoPacket:(NERtcPacket *)packet;
2273- (BOOL)onReceiveAudioPacket:(NERtcPacket *)packet;
2279- (BOOL)onReceiveVideoPacket:(NERtcPacket *)packet;
2280
2281@end
2282
2283NS_ASSUME_NONNULL_END
2284
2285#pragma clang diagnostic pop
NERtcAudioMixingErrorCode
伴音错误码。
定义 NERtcEngineEnum.h:3231
NERtcAudioDeviceState
音频设备状态。
定义 NERtcEngineEnum.h:3757
NERtcVirtualBackgroundSourceStateReason
虚拟背景未成功启用的原因或确认成功的信息。
定义 NERtcEngineEnum.h:1184
NERtcVideoBufferType
定义 NERtcEngineEnum.h:1072
NERtcLivePlayStreamState
定义 NERtcEngineEnum.h:4314
NERtcAsrCaptionState
定义 NERtcEngineEnum.h:4285
NERtcChannelMediaRelayEvent
媒体流转发回调事件
定义 NERtcEngineEnum.h:3973
NERtcChannelMediaRelayState
媒体流转发状态
定义 NERtcEngineEnum.h:3926
NERtcVideoCodecType
定义 NERtcEngineEnum.h:2834
NERtcVideoFormatType
视频格式类型
定义 NERtcEngineEnum.h:1087
NERtcAudioDeviceType
音频设备类型。
定义 NERtcEngineEnum.h:3689
NERtcLocalVideoWatermarkState
视频水印状态。
定义 NERtcEngineEnum.h:1366
NERtcAudioOutputRouting
音频路由。
定义 NERtcEngineEnum.h:1983
NERtcAudioMixingState
伴音任务状态。
定义 NERtcEngineEnum.h:3202
NERtcSessionLeaveReason
用户离开房间的原因。
定义 NERtcEngineEnum.h:121
NERtcConnectionStateType
当前房间的连接状态。
定义 NERtcEngineEnum.h:45
NERtcVideoProfileType
视频 profile 类型。
定义 NERtcEngineEnum.h:447
NERtcNetworkConnectionType
网络连接的类型。
定义 NERtcEngineEnum.h:3388
NERtcAudioRecordingCode
录音回调状态码。
定义 NERtcEngineEnum.h:2720
NERtcNetworkQuality
网络质量类型。
定义 NERtcEngineEnum.h:3852
NERtcVideoDeviceState
视频设备状态无限制,SDK 可以完全控制 Audio Session。
定义 NERtcEngineEnum.h:3804
NERtcClientRole
用户角色。
定义 NERtcEngineEnum.h:206
NERtcStreamChannelType
SEI 发送的流通道类型。
定义 NERtcEngineEnum.h:1135
NERtcLiveStreamStateCode
直播推流状态。
定义 NERtcEngineEnum.h:3598
NERtcReasonConnectionChangedType
当前 engine 连接状态变更的原因。
定义 NERtcEngineEnum.h:255
NERtcVideoDeviceType
视频设备类型。
定义 NERtcEngineEnum.h:3727
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
定义 NERtcEngineEnum.h:2348
NERtcVideoRotationType
视频数据的旋转方向
定义 NERtcEngineEnum.h:1033
NERtcError
Engine Error Code。
定义 NERtcEngineErrorCode.h:17
NERtcWarning
定义 NERtcEngineErrorCode.h:935
定义 NERtcEngineBase.h:3394
音频帧。
定义 NERtcEngineBase.h:1532
声音音量信息。
定义 NERtcEngineBase.h:1577
上下行 Last mile 网络质量探测结果。
定义 NERtcEngineBase.h:2536
定义 NERtcEngineBase.h:3164
编码完的媒体数据帧
定义 NERtcEngineBase.h:2914
onUserJoined 回调时的一些可选信息
定义 NERtcEngineBase.h:2848
onUserLeave 回调时的一些可选信息
定义 NERtcEngineBase.h:2860
视频帧信息。
定义 NERtcEngineBase.h:1622