NERtc iOS SDK
INERtcEngineEx.h
浏览该文件的文档.
1 /*
2  * Copyright (c) 2021 NetEase, Inc. All rights reserved.
3  */
4 
5 #ifndef INERtcEngineEx_h
6 #define INERtcEngineEx_h
7 
8 #import "INERtcEngine.h"
10 #import "NERtcEngineBase.h"
11 #import "NERtcEngineDelegate.h"
12 
13 NS_ASSUME_NONNULL_BEGIN
14 
19 
33 - (int)enableDualStreamMode:(BOOL)enable;
34 
51 - (int)setLocalMediaPriority:(NERtcMediaPriorityType)priority preemptive:(BOOL)preemptive;
52 
53 
68 - (int)setLocalPublishFallbackOption:(NERtcStreamFallbackOptions)option;
69 
85 - (int)setRemoteSubscribeFallbackOption:(NERtcStreamFallbackOptions)option;
86 
97 - (int)muteLocalAudio:(BOOL)muted;
98 
111 - (int)subscribeRemoteAudio:(BOOL)subscribe forUserID:(uint64_t)userID;
112 
124 - (int)subscribeAllRemoteAudio:(BOOL)subscribe;
125 
141 - (int)subscribeRemoteVideo:(BOOL)subscribe forUserID:(uint64_t)userID streamType:(NERtcRemoteVideoStreamType)streamType;
142 
153 - (int)startPreview;
154 
165 - (int)stopPreview;
166 
175 - (int)setLocalRenderScaleMode:(NERtcVideoRenderScaleMode)mode;
176 
186 - (int)setRemoteRenderScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
187 
203 - (int)setVideoRotationMode:(NERtcVideoRotationMode)rotationMode;
204 
220 - (int)muteLocalVideo:(BOOL)muted;
221 
232 - (int)setLoudspeakerMode:(bool)enable;
233 
242 - (int)getLoudspeakerMode:(bool *)enabled;
243 
244 
252 - (int)startAudioDump;
253 
259 - (int)stopAudioDump;
260 
261 #pragma mark -- External Video Input
262 
280 - (int)setExternalVideoSource:(BOOL)enable isScreen:(BOOL)isScreen;
281 
296 - (int)pushExternalVideoFrame:(NERtcVideoFrame*)frame;
297 
298 #pragma mark -- Sub Stream
299 
313 - (int)setupLocalSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas;
314 
327 - (int)startScreenCapture:(NERtcVideoSubStreamEncodeConfiguration *)config;
328 
338 - (int)stopScreenCapture;
339 
352 - (int)setLocalRenderSubStreamScaleMode:(NERtcVideoRenderScaleMode)mode;
353 
369 - (int)setupRemoteSubStreamVideoCanvas:(NERtcVideoCanvas *)canvas forUserID:(uint64_t)userID;
370 
382 - (int)subscribeRemoteSubStreamVideo:(BOOL)subscribe forUserID:(uint64_t)userID;
383 
395 - (int)setRemoteRenderSubStreamVideoScaleMode:(NERtcVideoRenderScaleMode)mode forUserID:(uint64_t)userID;
396 
397 #pragma mark -- AUDIO SESSION
398 
411 - (int)setAudioSessionOperationRestriction:(NERtcAudioSessionOperationRestriction)restriction;
412 
413 #pragma mark -- AUDIO DEVICE MANAGER
414 
421 - (int)setPlayoutDeviceMute:(bool)muted;
422 
429 - (int)getPlayoutDeviceMute:(bool *)muted;
430 
431 
438 - (int)setRecordDeviceMute:(bool)muted;
439 
440 
447 - (int)getRecordDeviceMute:(bool *)muted;
448 
449 
450 #pragma mark -- CAMERA & TORCH SETTINGS
451 
461 - (BOOL)isCameraZoomSupported;
462 
473 - (BOOL)isCameraTorchSupported;
474 
484 - (BOOL)isCameraFocusSupported;
485 
496 
509 - (int)setCameraExposurePosition:(CGPoint)positionInView;
510 
521 - (int)setCameraTorchOn:(BOOL)on;
522 
530 - (BOOL)isCameraTorchOn;
531 
543 - (int)setCameraZoomFactor:(float)factor;
544 
554 - (float)maxCameraZoomScale;
555 
569 - (int)setCameraFocusPositionX:(float)focusX Y:(float)focusY;
570 
571 #pragma mark -- AUDIO MIXING
572 
589 - (int)startAudioMixingWithOption:(NERtcCreateAudioMixingOption *)option;
590 
598 - (int)stopAudioMixing;
599 
607 - (int)pauseAudioMixing;
608 
614 - (int)resumeAudioMixing;
615 
622 - (int)setAudioMixingSendVolume:(uint32_t)volume;
623 
632 - (int)getAudioMixingSendVolume:(uint32_t *)volume;
633 
642 - (int)setAudioMixingPlaybackVolume:(uint32_t)volume;
643 
652 - (int)getAudioMixingPlaybackVolume:(uint32_t *)volume;
653 
662 - (int)getAudioMixingDuration:(uint64_t *)duration;
663 
672 - (int)getAudioMixingCurrentPosition:(uint64_t *)position;
673 
682 - (int)setAudioMixingPosition:(uint64_t)position;
683 
684 #pragma mark -- AUDIO EFFECT
701 - (int)playEffectWitdId:(uint32_t)effectId effectOption:(NERtcCreateAudioEffectOption *)option;
702 
711 - (int)stopEffectWitdId:(uint32_t)effectId;
712 
720 - (int)stopAllEffects;
721 
729 - (int)pauseEffectWitdId:(uint32_t)effectId;
730 
739 - (int)resumeEffectWitdId:(uint32_t)effectId;
740 
748 - (int)pauseAllEffects;
749 
757 - (int)resumeAllEffects;
758 
768 - (int)setEffectSendVolumeWithId:(uint32_t)effectId volume:(uint32_t)volume;
769 
779 - (int)getEffectSendVolumeWithId:(uint32_t)effectId volume:(uint32_t *)volume;
780 
790 - (int)setEffectPlaybackVolumeWithId:(uint32_t)effectId volume:(uint32_t)volume;
791 
799 - (int)getEffectPlaybackVolumeWithId:(uint32_t)effectId volume:(uint32_t *)volume;
800 
814 - (int)getEffectDurationWithId:(uint32_t)effectId duration:(uint64_t *)duration;
815 
829 - (int)getEffectCurrentPositionWithId:(uint32_t)effectId position:(uint64_t *)position;
830 
831 #pragma mark -- 耳返
844 - (int)enableEarback:(BOOL)enabled volume:(uint32_t)volume;
845 
852 - (int)setEarbackVolume:(uint32_t)volume;
853 
854 #pragma mark -- audio recording
876 - (int)startAudioRecording:(NSString *)filePath sampleRate:(int)sampleRate quality:(NERtcAudioRecordingQuality)quality;
877 
887 - (int)stopAudioRecording;
888 
889 #pragma mark --External Audio
909 - (int)setExternalAudioSource:(BOOL)enabled sampleRate:(int32_t)sampleRate channels:(int32_t)channels;
910 
925 - (int)pushExternalAudioFrame:(NERtcAudioFrame *)frame;
926 
927 
949 - (int)setExternalAudioRender:(BOOL)enabled sampleRate:(int32_t)sampleRate channels:(int32_t)channels;
950 
965 - (int)pullExternalAudioFrame:(void *_Nonnull)data length:(int)len;
966 
967 #pragma mark -- Media Statistic Observer
968 
975 - (int)addEngineMediaStatsObserver:(id<NERtcEngineMediaStatsObserver>)observer;
976 
983 - (int)removeEngineMediaStatsObserver:(id<NERtcEngineMediaStatsObserver>)observer;
984 
991 
992 
993 #pragma mark -- Live Stream
1010 - (int)addLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
1011 
1025 - (int)updateLiveStreamTask:(NERtcLiveStreamTaskInfo *)taskInfo compeltion:(NERtcLiveStreamCompletion)completion;
1026 
1040 - (int)removeLiveStreamTask:(NSString *)taskId compeltion:(NERtcLiveStreamCompletion)completion;
1041 
1042 #pragma mark -- Audio Frame Observer
1056 - (int)setRecordingAudioFrameParameters:(nullable NERtcAudioFrameRequestFormat *)format;
1057 
1058 
1072 - (int)setPlaybackAudioFrameParameters:(nullable NERtcAudioFrameRequestFormat *)format;
1073 
1087 - (int)setMixedAudioFrameParameters:(nullable NERtcAudioFrameRequestFormat *)format;
1088 
1099 - (int)setAudioFrameObserver:(nullable id<NERtcEngineAudioFrameObserver>)observer;
1100 
1101 
1102 #pragma mark -- Volume indication
1115 - (int)enableAudioVolumeIndication:(BOOL)enable interval:(uint64_t)interval;
1116 
1117 
1118 #pragma mark -- Signal Volume
1130 - (int)adjustRecordingSignalVolume:(uint32_t)volume;
1131 
1143 - (int)adjustPlaybackSignalVolume:(uint32_t)volume;
1144 
1161 - (int)adjustUserPlaybackSignalVolume:(uint32_t)volume forUserID:(uint64_t)userID;
1162 
1163 #pragma mark - voice effects
1164 
1178 - (int)setLocalVoicePitch:(double)pitch;
1179 
1190 - (int)setLocalVoiceEqualizationOfBandFrequency:(NERtcAudioEqualizationBandFrequency)bandFrequency withGain:(NSInteger)gain;
1191 
1203 - (int)setVoiceBeautifierPreset:(NERtcVoiceBeautifierType)type;
1204 
1219 - (int)setAudioEffectPreset:(NERtcVoiceChangerType)type;
1220 
1221 #pragma mark - waterMark
1222 
1235 - (int)setLocalCanvasWatermarkConfigs:(nullable NERtcCanvasWatermarkConfig *)config
1236  withStreamType:(NERtcStreamChannelType)type;
1237 
1251 - (int)setRemoteCanvasWatermarkConfigs:(nullable NERtcCanvasWatermarkConfig *)config
1252  forUserID:(uint64_t)userID
1253  withStreamType:(NERtcStreamChannelType)type;
1254 
1255 #pragma mark -- snapshot
1271 - (int)takeLocalSnapshot:(NERtcStreamChannelType)streamType callback:(NERtcTakeSnapshotCallback)callback;
1272 
1287 - (int)takeRemoteSnapshot:(NERtcStreamChannelType)streamType forUserID:(uint64_t)userID callback:(NERtcTakeSnapshotCallback)callback;
1288 
1289 #pragma mark -- Other
1299 - (int)uploadSdkInfo;
1300 
1301 #pragma mark - SEI
1302 
1325 - (int)sendSEIMsg:(NSData *)data streamChannelType:(NERtcStreamChannelType)type;
1326 
1348 - (int)sendSEIMsg:(NSData *)data;
1349 
1350 #pragma mark- MediaRealy
1351 
1366 - (int)startChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
1367 
1381 - (int)updateChannelMediaRelay:(NERtcChannelMediaRelayConfiguration *_Nonnull)config;
1382 
1391 - (int)stopChannelMediaRelay;
1392 
1407 - (int)enableSuperResolution:(BOOL)enabled;
1408 
1427 - (int)enableEncryption:(BOOL)enable config:(NERtcEncryptionConfig *)config;
1428 @end
1429 
1430 NS_ASSUME_NONNULL_END
1431 
1432 #endif /* INERtcEngineEx_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
截图结果 block 回调。
Definition: INERtcEngine.h:40
void(^ NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode)
互动直播推流 block。
Definition: INERtcEngine.h:32
NERtcAudioEqualizationBandFrequency
频谱子带索引 预设值。
Definition: NERtcEngineEnum.h:481
NERtcVoiceChangerType
变声 预设值
Definition: NERtcEngineEnum.h:507
NERtcVideoRotationMode
视频旋转模式。
Definition: NERtcEngineEnum.h:227
NERtcAudioRecordingQuality
录音音质
Definition: NERtcEngineEnum.h:447
NERtcRemoteVideoStreamType
远端视频流类型
Definition: NERtcEngineEnum.h:191
NERtcStreamFallbackOptions
Definition: NERtcEngineEnum.h:426
NERtcStreamChannelType
SEI发送的流通道类型
Definition: NERtcEngineEnum.h:327
NERtcAudioSessionOperationRestriction
音频会话控制权限 SDK 对 Audio Session 的控制权限
Definition: NERtcEngineEnum.h:408
NERtcVoiceBeautifierType
美声 预设值
Definition: NERtcEngineEnum.h:531
NERtcVideoRenderScaleMode
视频渲染缩放模式
Definition: NERtcEngineEnum.h:215
NERtcMediaPriorityType
Definition: NERtcEngineEnum.h:419
音频帧
Definition: NERtcEngineBase.h:595
音频原始数据回调格式(默认不设置)
Definition: NERtcEngineBase.h:542
画布水印设置。
Definition: NERtcEngineBase.h:834
Definition: NERtcEngineBase.h:689
创建 音效 的可选项
Definition: NERtcEngineBase.h:247
创建 伴音 的可选项
Definition: NERtcEngineBase.h:198
配置媒体流加密模式和密钥。
Definition: NERtcEngineBase.h:856
直播推流任务的配置
Definition: NERtcEngineBase.h:492
视频画布设置
Definition: NERtcEngineBase.h:52
视频帧信息
Definition: NERtcEngineBase.h:633
本地辅流发送配置
Definition: NERtcEngineBase.h:183
NERtcEngine 的常用接口。
Definition: INERtcEngine.h:49
NERtcEngine 扩展接口
Definition: INERtcEngineEx.h:18
BOOL isCameraZoomSupported()
检测设备当前使用的摄像头是否支持缩放功能。
int stopPreview()
停止视频预览。
int stopAudioRecording()
停止客户端录音。
int stopAudioDump()
结束记录音频 dump。
int startPreview()
开启视频预览。
BOOL isCameraFocusSupported()
检测设备是否支持手动对焦功能。
int stopChannelMediaRelay()
停止跨房间媒体流转发。
BOOL isCameraTorchOn()
查询设备是否开启了闪光灯。
BOOL isCameraTorchSupported()
检测设备是否支持闪光灯常亮。
int pauseAudioMixing()
暂停播放音乐文件及混音。
int uploadSdkInfo()
上传 SDK 信息。
int stopScreenCapture()
关闭辅流形式的屏幕共享。
BOOL isCameraExposurePositionSupported()
检测设备是否支持手动曝光功能。
int startAudioDump()
开始记录音频 dump。
int resumeAllEffects()
恢复播放所有音效文件。
int cleanupEngineMediaStatsObserver()
清除全部媒体统计信息观测器。
int stopAudioMixing()
停止播放音乐文件及混音。
int resumeAudioMixing()
该方法恢复混音,继续播放伴奏。请在房间内调用该方法。
float maxCameraZoomScale()
获取摄像头支持最大缩放比例。
int pauseAllEffects()
暂停播放所有音效文件。
int stopAllEffects()
停止播放所有音效文件。
音频数据回调 如果需要对音频数据做处理,需要实现这个 protocol
Definition: NERtcEngineDelegate.h:565
统计信息回调
Definition: NERtcEngineStatistics.h:419