NERtc iOS SDK  V4.4.301
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 -- In-ear monitoring
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 
1449 - (int)setCloudProxy:(NERtcTransportType)proxyType;
1450 
1451 @end
1452 
1453 NS_ASSUME_NONNULL_END
1454 
1455 #endif /* INERtcEngineEx_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
Returns the screenshot.
Definition: INERtcEngine.h:40
void(^ NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode)
Interactive live streaming.
Definition: INERtcEngine.h:32
NERtcAudioEqualizationBandFrequency
The preset value of the spectrum subband index.
Definition: NERtcEngineEnum.h:490
NERtcVoiceChangerType
The preset value of the voice changer
Definition: NERtcEngineEnum.h:516
NERtcVideoRotationMode
Video rotation Mode.
Definition: NERtcEngineEnum.h:236
NERtcAudioRecordingQuality
Recording sound quality
Definition: NERtcEngineEnum.h:456
NERtcRemoteVideoStreamType
The type of the remote video stream
Definition: NERtcEngineEnum.h:200
NERtcStreamFallbackOptions
Definition: NERtcEngineEnum.h:435
NERtcStreamChannelType
Stream type for sending SEI
Definition: NERtcEngineEnum.h:336
NERtcAudioSessionOperationRestriction
Audio session control permissions The SDK has the permissions of Audio Session
Definition: NERtcEngineEnum.h:417
NERtcTransportType
云代理模式。
Definition: NERtcEngineEnum.h:866
NERtcVoiceBeautifierType
The preset value of the voice beautifier
Definition: NERtcEngineEnum.h:540
NERtcVideoRenderScaleMode
Video rendering zoom mode
Definition: NERtcEngineEnum.h:224
NERtcMediaPriorityType
Definition: NERtcEngineEnum.h:428
The audio frame
Definition: NERtcEngineBase.h:596
The request format of the audio raw data callback (unspecified by default).
Definition: NERtcEngineBase.h:543
Canvas watermark settings.
Definition: NERtcEngineBase.h:835
Definition: NERtcEngineBase.h:690
Options for creating audio effects
Definition: NERtcEngineBase.h:248
Options for creating mixing audios
Definition: NERtcEngineBase.h:199
Configure the media stream encryption mode and key.
Definition: NERtcEngineBase.h:857
Configuration of streaming tasks in a live event
Definition: NERtcEngineBase.h:493
Configures the video canvas.
Definition: NERtcEngineBase.h:53
Video frame information
Definition: NERtcEngineBase.h:634
Local substream publishing configuration
Definition: NERtcEngineBase.h:184
The common interface of NERtcEngine.
Definition: INERtcEngine.h:49
NERtcEngine extended API
Definition: INERtcEngineEx.h:18
BOOL isCameraZoomSupported()
Checks whether the camera zooming feature is supported.
int stopPreview()
Stops video preview.
int stopAudioRecording()
Stops the audio recording on the client.
int stopAudioDump()
Stops recording an audio dump file.
int startPreview()
Enables video preview.
BOOL isCameraFocusSupported()
Checks whether the camera manual focus feature is supported.
int stopChannelMediaRelay()
Stops media stream relay across rooms.
BOOL isCameraTorchOn()
Check whether the flash is turned on on the device.
BOOL isCameraTorchSupported()
Checks whether the camera flash feature is supported.
int pauseAudioMixing()
Pauses playing and mixing the music file.
int uploadSdkInfo()
Uploads the SDK information.
int stopScreenCapture()
Disables screen sharing with the substream transmission.
BOOL isCameraExposurePositionSupported()
Checks whether the camera exposure feature is supported.
int startAudioDump()
Starts recording an audio dump file.
int resumeAllEffects()
Resumes playing all sound effect files.
int cleanupEngineMediaStatsObserver()
Clears all media stats observers.
int stopAudioMixing()
Stops playing or mixing the music file.
int resumeAudioMixing()
The method resumes mixing audio playback and continues playing the mixing audio.
float maxCameraZoomScale()
Gets maximum zoom ratio supported by the camera.
int pauseAllEffects()
Pauses playing all sound effect files.
int stopAllEffects()
Stops playing all sound effect files.
Returns the audio data If you need to process audio data, you need to implement this protocol.
Definition: NERtcEngineDelegate.h:565
Occurs when the stats are collected.
Definition: NERtcEngineStatistics.h:419