NERTC iOS SDK V5.9.10
载入中...
搜索中...
未找到
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:(uid_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
1062@end
1071@protocol NERtcEngineDelegateEx <NERtcEngineDelegate,
1072NERtcEngineVideoFrameObserver, // deprecated, USE setVideoFrameObserver:(id<NERtcEngineVideoFrameObserver>)videoframeObserver instead
1073NERtcEngineAudioSessionObserver,
1074NERtcEngineLiveStreamObserver,
1075NERtcEngineVideoSEIObserver,
1076NERtcEnginePushStreamingObserver,
1077NERtcEnginePlayStreamingObserver>
1078
1079@optional
1080
1095- (void)onNERtcEngineUserVideoProfileDidUpdate:(uint64_t)userID maxProfile:(NERtcVideoProfileType)maxProfile;
1096
1114- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted;
1115
1146- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
1147
1161- (void)onNERtcEngineUser:(uint64_t)userID audioMuted:(BOOL)muted;
1162
1177- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID;
1178
1207- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType;
1208
1247- (void)onNERtcEngineRemoteVideoSizeDidChangedWithUserID:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1248
1282- (void)onNERtcEngineLocalVideoRenderSizeChanged:(NERtcStreamChannelType)streamType width:(uint32_t)width height:(uint32_t)height;
1283
1294- (void)onNERtcEngineFirstAudioDataDidReceiveWithUserID:(uint64_t)userID;
1295
1307- (void)onEngineFirstAudioFrameDecoded:(uint64_t)userID;
1330- (void)onNERtcEngineLocalFirstAudioPacketSent:(NERtcAudioStreamType)streamType;
1349- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height;
1350
1386- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1387
1428- (void)onEngineFirstVideoFrameRender:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height elapsed:(uint64_t)elapsed streamType:(NERtcStreamChannelType)streamType;
1429
1444- (void)onNERtcEngineAudioDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcAudioDeviceType)deviceType deviceState:(NERtcAudioDeviceState)deviceState;
1445
1464- (void)onNERtcEngineVideoDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcVideoDeviceType)deviceType deviceState:(NERtcVideoDeviceState)deviceState;
1465
1478- (void)onNERtcEngineNetworkConnectionTypeChanged:(NERtcNetworkConnectionType)newConnectionType;
1479
1501- (void)onAudioMixingStateChanged:(NERtcAudioMixingState)state errorCode:(NERtcAudioMixingErrorCode)errorCode;
1502
1515- (void)onAudioMixingTimestampUpdate:(uint64_t)timeStampMS;
1516
1517
1529- (void)onAudioEffectFinished:(uint32_t)effectId;
1530
1558- (void)onAudioEffectTimestampUpdateWithId:(uint32_t)effectId timeStampMS:(uint64_t)timeStampMS;
1559
1578- (void)onLocalAudioVolumeIndication:(int)volume;
1579
1598- (void)onLocalAudioVolumeIndication:(int)volume withVad:(BOOL)enableVad;
1599
1600
1623-(void)onRemoteAudioVolumeIndication:(nullable NSArray<NERtcAudioVolumeInfo*> *)speakers totalVolume:(int)totalVolume;
1624
1639- (void)onNERtcEngineHardwareResourceReleased:(NERtcError)result;
1640
1657- (void)onNERtcCameraFocusChanged:(CGPoint)focusPoint;
1658
1673- (void)onNERtcCameraExposureChanged:(CGPoint)exposurePoint;
1674
1675
1676
1691- (void)onNERtcEngineAudioHasHowling;
1692
1706- (void)onNERtcEngineAudioHasHowling:(BOOL)flag;
1707
1720- (void)onNERtcEngineChannelMediaRelayStateDidChange:(NERtcChannelMediaRelayState)state channelName:(NSString *)channelName;
1721
1736- (void)onNERtcEngineDidReceiveChannelMediaRelayEvent:(NERtcChannelMediaRelayEvent)event channelName:(NSString *)channelName error:(NERtcError)error;
1737
1751- (void)onNERtcEngineAudioRecording:(NERtcAudioRecordingCode)code filePath:(NSString *)filePath;
1752
1753
1774- (void)onNERtcEngineLocalPublishFallbackToAudioOnly:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1775
1799- (void)onNERtcEngineRemoteSubscribeFallbackToAudioOnly:(uint64_t)uid isFallback:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1800
1816- (void)onNERtcEngineLastmileQuality:(NERtcNetworkQuality)quality;
1817
1834- (void)onNERtcEngineLastmileProbeTestResult:(NERtcLastmileProbeResult *)result;
1835
1855- (void)onNERtcEngineVirtualBackgroundSourceEnabled:(BOOL)enabled reason:(NERtcVirtualBackgroundSourceStateReason)reason;
1856
1871- (void)onNERtcEngineLocalVideoWatermarkStateWithStreamType:(NERtcStreamChannelType)type
1872 state:(NERtcLocalVideoWatermarkState)state;
1884- (void)onNERtcEnginePermissionKeyWillExpire;
1885
1918- (void)onNERtcEngineUpdatePermissionKey:(NSString *)key error:(NERtcError)error timeout:(NSUInteger)timeout;
1919
1932- (void)onNERtcEngineUserDataDidStart:(uint64_t)userID;
1933
1944- (void)onNERtcEngineUserDataDidStop:(uint64_t)userID;
1945
1958- (void)onNERtcEngineUserDataReceiveMessage:(uint64_t)userID data:(NSData *)data;
1959
1970- (void)onNERtcEngineUserDataStateChanged:(uint64_t)userID;
1971
1984- (void)onNERtcEngineUserDataBufferedAmountChanged:(uint64_t)userID previousAmount:(uint64_t)previousAmount;
1985
1994- (void)onNERtcEngineLabFeatureDidCallbackWithKey:(NSString*)key param:(id)param;
1995
2004- (void)onNERtcEngineAiDataWithType:(NSString*)type data:(NSString*)data;
2005
2017- (void)onNERtcEngineAsrCaptionStateChanged:(NERtcAsrCaptionState)state code:(int)code message:(NSString *)message;
2018
2030- (void)onNERtcEngineAsrCaptionResult:(nullable NSArray<NERtcAsrCaptionResult*> *)results;
2031
2032@end
2033
2044@protocol NERtcEngineAudioFrameObserver <NSObject>
2045
2046@optional
2047
2066- (void)onNERtcEngineAudioFrameDidRecord:(NERtcAudioFrame *)frame;
2067
2068
2087- (void)onNERtcEngineAudioFrameWillPlayback:(NERtcAudioFrame *)frame;
2088
2111- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame;
2112
2133- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingForPlayStreaming:(NSString*)playStreamId frame:(NERtcAudioFrame *)frame;
2134
2159- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
2160
2181- (void)onNERtcEngineMixedAudioFrame:(NERtcAudioFrame *)frame;
2182
2183
2202- (void)onNERtcEngineSubStreamAudioFrameDidRecord:(NERtcAudioFrame *)frame;
2203
2226- (void)onNERtcEnginePlaybackSubStreamAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
2227
2228
2229@end
2230
2231@protocol NERtcEnginePacketObserver <NSObject>
2232
2233 @optional
2239- (BOOL)onSendAudioPacket:(NERtcPacket *)packet;
2245- (BOOL)onSendVideoPacket:(NERtcPacket *)packet;
2251- (BOOL)onReceiveAudioPacket:(NERtcPacket *)packet;
2257- (BOOL)onReceiveVideoPacket:(NERtcPacket *)packet;
2258
2259@end
2260
2261NS_ASSUME_NONNULL_END
2262
2263#pragma clang diagnostic pop
NERtcAudioMixingErrorCode
伴音错误码。
定义 NERtcEngineEnum.h:3221
NERtcAudioDeviceState
音频设备状态。
定义 NERtcEngineEnum.h:3747
NERtcVirtualBackgroundSourceStateReason
虚拟背景未成功启用的原因或确认成功的信息。
定义 NERtcEngineEnum.h:1174
NERtcVideoBufferType
定义 NERtcEngineEnum.h:1072
NERtcLivePlayStreamState
定义 NERtcEngineEnum.h:4303
NERtcAsrCaptionState
定义 NERtcEngineEnum.h:4274
NERtcChannelMediaRelayEvent
媒体流转发回调事件
定义 NERtcEngineEnum.h:3963
NERtcChannelMediaRelayState
媒体流转发状态
定义 NERtcEngineEnum.h:3916
NERtcVideoCodecType
定义 NERtcEngineEnum.h:2824
NERtcVideoFormatType
视频格式类型
定义 NERtcEngineEnum.h:1087
NERtcAudioDeviceType
音频设备类型。
定义 NERtcEngineEnum.h:3679
NERtcLocalVideoWatermarkState
视频水印状态。
定义 NERtcEngineEnum.h:1356
NERtcAudioOutputRouting
音频路由。
定义 NERtcEngineEnum.h:1973
NERtcAudioMixingState
伴音任务状态。
定义 NERtcEngineEnum.h:3192
NERtcSessionLeaveReason
用户离开房间的原因。
定义 NERtcEngineEnum.h:121
NERtcConnectionStateType
当前房间的连接状态。
定义 NERtcEngineEnum.h:45
NERtcVideoProfileType
视频 profile 类型。
定义 NERtcEngineEnum.h:447
NERtcNetworkConnectionType
网络连接的类型。
定义 NERtcEngineEnum.h:3378
NERtcAudioRecordingCode
录音回调状态码。
定义 NERtcEngineEnum.h:2710
NERtcNetworkQuality
网络质量类型。
定义 NERtcEngineEnum.h:3842
NERtcVideoDeviceState
视频设备状态无限制,SDK 可以完全控制 Audio Session。
定义 NERtcEngineEnum.h:3794
NERtcClientRole
用户角色。
定义 NERtcEngineEnum.h:206
NERtcStreamChannelType
SEI 发送的流通道类型。
定义 NERtcEngineEnum.h:1125
NERtcLiveStreamStateCode
直播推流状态。
定义 NERtcEngineEnum.h:3588
NERtcReasonConnectionChangedType
当前 engine 连接状态变更的原因。
定义 NERtcEngineEnum.h:255
NERtcVideoDeviceType
视频设备类型。
定义 NERtcEngineEnum.h:3717
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
定义 NERtcEngineEnum.h:2338
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