NERtc iOS SDK V5.6.30
载入中...
搜索中...
未找到
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
392- (void)onNERtcEngineUserSubStreamDidStop:(uint64_t)userID;
393
416- (void)onNERtcEngineMediaRightChangeWithAudio:(BOOL)isAudioBannedByServer
417 video:(BOOL)isVideoBannedByServer;
418
431- (void)onNERtcEngineUserSubStreamAudioDidStart:(uint64_t)userID;
432
445- (void)onNERtcEngineUserSubStreamAudioDidStop:(uint64_t)userID;
446
465- (void)onNERtcEngineUser:(uint64_t)userID subStreamAudioMuted:(BOOL)muted;
466
467@end
468
479@protocol NERtcEngineLiveStreamObserver <NSObject>
480
481@optional
496- (void)onNERTCEngineLiveStreamState:(NERtcLiveStreamStateCode)state taskID:(NSString *)taskID url:(NSString *)url;
497
498@end
499
510@protocol NERtcEngineVideoFrameObserver <NSObject>
511
512@optional
513
530- (void)onNERtcEngineVideoFrameCaptured:(CVPixelBufferRef)bufferRef rotation:(NERtcVideoRotationType)rotation;
531
532@end
533
542@protocol NERtcEngineAudioSessionObserver <NSObject>
543
544@optional
545//
546//- (void)onNERtcEngineAudioDeviceInterruptionBegan;
547//
548//- (void)onNERtcEngineAudioDeviceInterruptionEnded;
549
560- (void)onNERtcEngineAudioDeviceRoutingDidChange:(NERtcAudioOutputRouting)routing;
561
562@end
563
572@protocol NERtcEngineVideoRenderSink <NSObject>
573
574@optional
587- (void)onNERtcEngineRenderFrame:(NERtcVideoFrame *_Nonnull)frame;
588
589// 渲染所需的 buffer 类型,默认为 NERtcVideoBufferTypeRawData
590- (NERtcVideoBufferType)getFrameBufferType;
591
592@end
603@protocol NERtcEngineVideoSEIObserver <NSObject>
604
605@optional
606
623- (void)onNERtcEngineRecvSEIMsg:(uint64_t)userID message:(NSData *)message;
624
625@end
626
627@protocol NERtcEnginePreDecodeObserver <NSObject>
628 @optional
651- (void)onNERtcEnginePreDecoderFrame:(NERtcPreDecoderFrameInfo *)preDecoderFrame;
652
653@end
654
655@protocol NERtcEngineVideoEncoderQosObserver <NSObject>
656
657 @optional
658
681- (void)onNERtcEngineRequestSendKeyFrame:(NERtcStreamChannelType)videoStreamType;
682
710- (void)onNERtcEngineBitrateUpdated:(int)bitrateBps
711 videoStreamType:(NERtcStreamChannelType)videoStreamType;
712
740- (void)onNERtcEngineVideoCodecUpdated:(NERtcVideoCodecType)videoCodecType
741 videoStreamType:(NERtcStreamChannelType)videoStreamType;
742
743@end
744
745@protocol NERtcEnginePushStreamingObserver <NSObject>
746 @optional
801- (void)onNERtcEngineStartPushStreamingWithResult:(NERtcError)result channelId:(uint64_t)channelId;
818- (void)onNERtcEngineStopPushStreaming:(NERtcError)result;
819
836- (void)onNERtcEnginePushStreamingChangeToReconnectingWithReason:(NERtcError)reason;
837
852- (void)onNERtcEnginePushStreamingReconnectedSuccess;
853
854@end
855
864@protocol NERtcEngineDelegateEx <NERtcEngineDelegate,
865NERtcEngineVideoFrameObserver, // deprecated, USE setVideoFrameObserver:(id<NERtcEngineVideoFrameObserver>)videoframeObserver instead
866NERtcEngineAudioSessionObserver,
867NERtcEngineLiveStreamObserver,
868NERtcEngineVideoSEIObserver,
869NERtcEnginePushStreamingObserver>
870
871@optional
872
887- (void)onNERtcEngineUserVideoProfileDidUpdate:(uint64_t)userID maxProfile:(NERtcVideoProfileType)maxProfile;
888
906- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted;
907
938- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
939
953- (void)onNERtcEngineUser:(uint64_t)userID audioMuted:(BOOL)muted;
954
969- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID;
970
999- (void)onNERtcEngineFirstVideoDataDidReceiveWithUserID:(uint64_t)userID streamType:(NERtcStreamChannelType)streamType;
1000
1039- (void)onNERtcEngineRemoteVideoSizeDidChangedWithUserID:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1040
1074- (void)onNERtcEngineLocalVideoRenderSizeChanged:(NERtcStreamChannelType)streamType width:(uint32_t)width height:(uint32_t)height;
1075
1086- (void)onNERtcEngineFirstAudioDataDidReceiveWithUserID:(uint64_t)userID;
1087
1099- (void)onEngineFirstAudioFrameDecoded:(uint64_t)userID;
1122- (void)onNERtcEngineLocalFirstAudioPacketSent:(NERtcAudioStreamType)streamType;
1141- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height;
1142
1178- (void)onEngineFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
1179
1220- (void)onEngineFirstVideoFrameRender:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height elapsed:(uint64_t)elapsed streamType:(NERtcStreamChannelType)streamType;
1221
1236- (void)onNERtcEngineAudioDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcAudioDeviceType)deviceType deviceState:(NERtcAudioDeviceState)deviceState;
1237
1256- (void)onNERtcEngineVideoDeviceStateChangeWithDeviceID:(NSString *)deviceID deviceType:(NERtcVideoDeviceType)deviceType deviceState:(NERtcVideoDeviceState)deviceState;
1257
1270- (void)onNERtcEngineNetworkConnectionTypeChanged:(NERtcNetworkConnectionType)newConnectionType;
1271
1293- (void)onAudioMixingStateChanged:(NERtcAudioMixingState)state errorCode:(NERtcAudioMixingErrorCode)errorCode;
1294
1307- (void)onAudioMixingTimestampUpdate:(uint64_t)timeStampMS;
1308
1309
1321- (void)onAudioEffectFinished:(uint32_t)effectId;
1322
1350- (void)onAudioEffectTimestampUpdateWithId:(uint32_t)effectId timeStampMS:(uint64_t)timeStampMS;
1351
1370- (void)onLocalAudioVolumeIndication:(int)volume;
1371
1390- (void)onLocalAudioVolumeIndication:(int)volume withVad:(BOOL)enableVad;
1391
1392
1415-(void)onRemoteAudioVolumeIndication:(nullable NSArray<NERtcAudioVolumeInfo*> *)speakers totalVolume:(int)totalVolume;
1416
1431- (void)onNERtcEngineHardwareResourceReleased:(NERtcError)result;
1432
1449- (void)onNERtcCameraFocusChanged:(CGPoint)focusPoint;
1450
1465- (void)onNERtcCameraExposureChanged:(CGPoint)exposurePoint;
1466
1467
1468
1483- (void)onNERtcEngineAudioHasHowling;
1484
1498- (void)onNERtcEngineAudioHasHowling:(BOOL)flag;
1499
1512- (void)onNERtcEngineChannelMediaRelayStateDidChange:(NERtcChannelMediaRelayState)state channelName:(NSString *)channelName;
1513
1528- (void)onNERtcEngineDidReceiveChannelMediaRelayEvent:(NERtcChannelMediaRelayEvent)event channelName:(NSString *)channelName error:(NERtcError)error;
1529
1543- (void)onNERtcEngineAudioRecording:(NERtcAudioRecordingCode)code filePath:(NSString *)filePath;
1544
1545
1566- (void)onNERtcEngineLocalPublishFallbackToAudioOnly:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1567
1591- (void)onNERtcEngineRemoteSubscribeFallbackToAudioOnly:(uint64_t)uid isFallback:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
1592
1608- (void)onNERtcEngineLastmileQuality:(NERtcNetworkQuality)quality;
1609
1626- (void)onNERtcEngineLastmileProbeTestResult:(NERtcLastmileProbeResult *)result;
1627
1647- (void)onNERtcEngineVirtualBackgroundSourceEnabled:(BOOL)enabled reason:(NERtcVirtualBackgroundSourceStateReason)reason;
1648
1663- (void)onNERtcEngineLocalVideoWatermarkStateWithStreamType:(NERtcStreamChannelType)type
1664 state:(NERtcLocalVideoWatermarkState)state;
1676- (void)onNERtcEnginePermissionKeyWillExpire;
1677
1710- (void)onNERtcEngineUpdatePermissionKey:(NSString *)key error:(NERtcError)error timeout:(NSUInteger)timeout;
1711
1724- (void)onNERtcEngineUserDataDidStart:(uint64_t)userID;
1725
1736- (void)onNERtcEngineUserDataDidStop:(uint64_t)userID;
1737
1750- (void)onNERtcEngineUserDataReceiveMessage:(uint64_t)userID data:(NSData *)data;
1751
1762- (void)onNERtcEngineUserDataStateChanged:(uint64_t)userID;
1763
1776- (void)onNERtcEngineUserDataBufferedAmountChanged:(uint64_t)userID previousAmount:(uint64_t)previousAmount;
1777
1786- (void)onNERtcEngineLabFeatureDidCallbackWithKey:(NSString*)key param:(id)param;
1787
1788@end
1789
1800@protocol NERtcEngineAudioFrameObserver <NSObject>
1801
1802@optional
1803
1822- (void)onNERtcEngineAudioFrameDidRecord:(NERtcAudioFrame *)frame;
1823
1824
1843- (void)onNERtcEngineAudioFrameWillPlayback:(NERtcAudioFrame *)frame;
1844
1867- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame;
1868
1893- (void)onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
1894
1915- (void)onNERtcEngineMixedAudioFrame:(NERtcAudioFrame *)frame;
1916
1917
1936- (void)onNERtcEngineSubStreamAudioFrameDidRecord:(NERtcAudioFrame *)frame;
1937
1960- (void)onNERtcEnginePlaybackSubStreamAudioFrameBeforeMixingWithUserID:(uint64_t)userID frame:(NERtcAudioFrame *)frame channelId:(uint64_t)channelId;
1961
1962
1963@end
1964
1965@protocol NERtcEnginePacketObserver <NSObject>
1966
1967 @optional
1973- (BOOL)onSendAudioPacket:(NERtcPacket *)packet;
1979- (BOOL)onSendVideoPacket:(NERtcPacket *)packet;
1985- (BOOL)onReceiveAudioPacket:(NERtcPacket *)packet;
1991- (BOOL)onReceiveVideoPacket:(NERtcPacket *)packet;
1992
1993@end
1994
1995NS_ASSUME_NONNULL_END
1996
1997#pragma clang diagnostic pop
NERtcAudioMixingErrorCode
伴音错误码。
Definition NERtcEngineEnum.h:2608
NERtcAudioDeviceState
音频设备状态。
Definition NERtcEngineEnum.h:3134
NERtcVirtualBackgroundSourceStateReason
虚拟背景未成功启用的原因或确认成功的信息。
Definition NERtcEngineEnum.h:1126
NERtcVideoBufferType
Definition NERtcEngineEnum.h:1042
NERtcChannelMediaRelayEvent
媒体流转发回调事件
Definition NERtcEngineEnum.h:3350
NERtcChannelMediaRelayState
媒体流转发状态
Definition NERtcEngineEnum.h:3303
NERtcVideoCodecType
Definition NERtcEngineEnum.h:2211
NERtcAudioDeviceType
音频设备类型。
Definition NERtcEngineEnum.h:3066
NERtcLocalVideoWatermarkState
视频水印状态。
Definition NERtcEngineEnum.h:1308
NERtcAudioOutputRouting
音频路由。
Definition NERtcEngineEnum.h:1444
NERtcAudioMixingState
伴音任务状态。
Definition NERtcEngineEnum.h:2579
NERtcSessionLeaveReason
用户离开房间的原因。
Definition NERtcEngineEnum.h:121
NERtcConnectionStateType
当前房间的连接状态。
Definition NERtcEngineEnum.h:45
NERtcVideoProfileType
视频 profile 类型。
Definition NERtcEngineEnum.h:447
NERtcNetworkConnectionType
网络连接的类型。
Definition NERtcEngineEnum.h:2765
NERtcAudioRecordingCode
录音回调状态码。
Definition NERtcEngineEnum.h:2097
NERtcNetworkQuality
网络质量类型。
Definition NERtcEngineEnum.h:3229
NERtcVideoDeviceState
视频设备状态无限制,SDK 可以完全控制 Audio Session。
Definition NERtcEngineEnum.h:3181
NERtcClientRole
用户角色。
Definition NERtcEngineEnum.h:206
NERtcStreamChannelType
SEI 发送的流通道类型。
Definition NERtcEngineEnum.h:1095
NERtcLiveStreamStateCode
直播推流状态。
Definition NERtcEngineEnum.h:2975
NERtcReasonConnectionChangedType
当前 engine 连接状态变更的原因。
Definition NERtcEngineEnum.h:255
NERtcVideoDeviceType
视频设备类型。
Definition NERtcEngineEnum.h:3104
NERtcAudioStreamType
音频流类型,目前同时支持音频两路流:主流和辅流
Definition NERtcEngineEnum.h:1770
NERtcVideoRotationType
视频数据的旋转方向
Definition NERtcEngineEnum.h:1003
NERtcError
Engine Error Code。
Definition NERtcEngineErrorCode.h:17
NERtcWarning
Definition NERtcEngineErrorCode.h:854
音频帧。
Definition NERtcEngineBase.h:1519
声音音量信息。
Definition NERtcEngineBase.h:1564
上下行 Last mile 网络质量探测结果。
Definition NERtcEngineBase.h:2482
Definition NERtcEngineBase.h:3110
编码完的媒体数据帧
Definition NERtcEngineBase.h:2860
onUserJoined 回调时的一些可选信息
Definition NERtcEngineBase.h:2794
onUserLeave 回调时的一些可选信息
Definition NERtcEngineBase.h:2806
视频帧信息。
Definition NERtcEngineBase.h:1609