NERtc iOS SDK  V4.4.0
NERtcEngineBase.h
浏览该文件的文档.
1 /*
2  * Copyright (c) 2021 NetEase, Inc. All rights reserved.
3  */
4 
5 #import <Foundation/Foundation.h>
6 #import "NERtcEngineEnum.h"
7 
9 
10 NS_ASSUME_NONNULL_BEGIN
11 
16 // channel
17 extern NSString * const kNERtcKeyChannel1V1ModeEnabled; // BOOL, -- 是否开启 1V1 模式,默认值 NO
18 
19 // video
20 extern NSString * const kNERtcKeyVideoPreferHWEncode; // BOOL -- 优先使用硬件编码视频数据。默认值 YES,该值建议在调用初始化接口:setupEngineWithContext 之前设置,否则需要在下次初始化之后才生效
21 extern NSString * const kNERtcKeyVideoPreferHWDecode; // BOOL -- 优先使用硬件解码视频数据。默认值 YES,该值建议在调用初始化接口:setupEngineWithContext 之前设置,否则需要在下次初始化之后才生效
22 extern NSString * const kNERtcKeyVideoCaptureObserverEnabled; // BOOL -- 是否需要开启视频数据采集回调,从而开发者可以获取到原始视频数据。开启之后需要关闭的话,需要通过调用 destroyEngine 来清除。默认值 NO
23 extern NSString * const kNERtcKeyVideoStartWithBackCamera; // BOOL -- 第一次开启摄像头时,使用后摄像头。默认值 NO
24 extern NSString * const kNERtcKeyVideoPreferMetalRender; // BOOL -- 是否优先使用 Metal 渲染,否则使用 OpenGL 渲染。默认值 NO
25 extern NSString * const kNERtcKeyVideoSendOnPubType; // int,通话前设置有效. 默认为初始发送大流 3
26 
27 // audio
28 extern NSString * const kNERtcKeyAutoSubscribeAudio; // BOOL -- 其他用户打开音频时,自动订阅。只支持在通话前设置,通话中设置无效。 默认值 YES 。注意:如果业务场景中会使用subscribeRemoteAudio进行控制,该 Key 必须设置为 NO
29 extern NSString * const KNERtcKeyDisableOverrideSpeakerOnReceiver; //BOOL -- 系统切换听筒事件时,禁用切换到扬声器。默认值 NO。 如设置YES 则禁止SDK在系统切换到听筒时做切换扬声器操作,需要用户自己处理切换听筒事件
30 extern NSString * const KNERtcKeyDisableSWAECOnHeadset; //BOOL -- 设置耳机时不使用软件回声消除功能,默认值 NO。如设置YES 则SDK在耳机模式下不使用软件回声消除功能,会对某些机型下 耳机的音质效果有影响
31 extern NSString * const KNERtcKeyAudioAINSEnable;//BOOL --设置是否开启AI降噪,开启AI降噪,在嘈杂环境下,让对方更清晰听到您的声音
32 
33 
34 // server record
35 extern NSString * const kNERtcKeyRecordHostEnabled; // BOOL -- 是否服务器录制主讲人,默认值 NO
36 extern NSString * const kNERtcKeyRecordAudioEnabled; // BOOL -- 是否开启通话服务器录制语音,默认值 NO
37 extern NSString * const kNERtcKeyRecordVideoEnabled; // BOOL -- 是否开启通话服务器录制视频,默认值 NO
38 extern NSString * const kNERtcKeyRecordType; // int -- 服务器录制模式,具体见 NERtcRecordType 的定义
39 
40 // live stream
41 extern NSString * const kNERtcKeyPublishSelfStreamEnabled; // BOOL -- 是否允许在房间推流时推送自身的媒体流,默认值 NO
42 
43 // log level
44 extern NSString * const kNERtcKeyLogLevel; // int -- SDK 日志等级,具体见 NERtcLogLevel 的定义, 默认值 kNERtcLogLevelInfo
45 
46 extern NSString * const kNERtcKeyExtraInfo; //NSString -- 标识app版本, 上报使用
47 
51 @interface NERtcVideoCanvas : NSObject
52 
56 @property (nonatomic, assign) BOOL useExternalRender;
57 
61 @property (nonatomic, nullable, strong) VIEW_CLASS *container;
62 
66 @property (nonatomic, assign) NERtcVideoRenderScaleMode renderMode;
67 
73 @property (nonatomic, assign) NERtcVideoMirrorMode mirrorMode;
74 
78 @property (nonatomic, strong) id<NERtcEngineVideoRenderSink> externalVideoRender;
79 @end
80 
84 @interface NERtcBaseVideoEncodeConfiguration : NSObject
85 
89 @property (nonatomic, assign) NERtcVideoProfileType maxProfile;
90 
98 @property (nonatomic, assign) NERtcVideoFrameRate frameRate;
99 
103 @property (nonatomic, assign) NSInteger minFrameRate;
104 
111 @property (nonatomic, assign) NSInteger bitrate;
112 
116 @property (nonatomic, assign) NSInteger minBitrate;
117 
118 @end
119 
124 
134 @property (nonatomic, assign) int width;
144 @property (nonatomic, assign) int height;
145 
149 @property (nonatomic, assign) NERtcVideoCropMode cropMode;
150 
160 @property (nonatomic, assign) NERtcDegradationPreference degradationPreference;
161 
167 @property (nonatomic, assign) NERtcVideoMirrorMode mirrorMode;
168 
174 @property (nonatomic, assign) NERtcVideoOutputOrientationMode orientationMode;
175 
176 
177 @end
178 
183 
187 @property (nonatomic, assign) NERtcSubStreamContentPrefer contentPrefer;
188 
189 @end
190 
191 
192 FOUNDATION_EXPORT uint32_t const NERtcAudioMixingMaxVolume;
193 FOUNDATION_EXPORT uint32_t const NERtcAudioMixingDefaultVolume;
194 
195 
197 @interface NERtcCreateAudioMixingOption : NSObject
198 
204 @property (nonatomic, copy) NSString *path;
205 
212 @property (nonatomic, assign) int loopCount;
213 
217 @property (nonatomic, assign) BOOL sendEnabled;
218 
222 @property (nonatomic, assign) BOOL playbackEnabled;
223 
228 @property (nonatomic, assign) uint32_t sendVolume;
229 
234 @property (nonatomic, assign) uint32_t playbackVolume;
235 
241 - (BOOL)isInvalid;
242 
243 @end
244 
246 @interface NERtcCreateAudioEffectOption : NSObject
247 
253 @property (nonatomic, copy) NSString *path;
254 
261 @property (nonatomic, assign) int loopCount;
262 
266 @property (nonatomic, assign) BOOL sendEnabled;
267 
271 @property (nonatomic, assign) BOOL playbackEnabled;
272 
277 @property (nonatomic, assign) uint32_t sendVolume;
278 
283 @property (nonatomic, assign) uint32_t playbackVolume;
284 
285 @end
286 
287 
288 #pragma mark - live stream
292 @interface NERtcLiveConfig: NSObject
293 
301 @property (nonatomic, assign) BOOL singleVideoPassthrough;
309 @property (nonatomic, assign) NSInteger audioBitrate;
310 
318 @property (nonatomic, assign) NERtcLiveStreamAudioSampleRate sampleRate;
319 
325 @property (nonatomic, assign) NSInteger channels;
326 
332 @property (nonatomic, assign) NERtcLiveStreamAudioCodecProfile audioCodecProfile;
333 
334 @end
335 
339 @interface NERtcLiveStreamUserTranscoding: NSObject
340 
344 @property (nonatomic, assign) uint64_t uid;
345 
353 @property (nonatomic, assign) BOOL videoPush;
354 
362 @property (nonatomic, assign) NSInteger x;
363 
371 @property (nonatomic, assign) NSInteger y;
372 
380 @property (nonatomic, assign) NSInteger width;
381 
389 @property (nonatomic, assign) NSInteger height;
390 
396 @property (nonatomic, assign) BOOL audioPush;
397 
401 @property (nonatomic, assign) NSInteger zOrder;
402 
406 @property (nonatomic, assign) NERtcLiveStreamVideoScaleMode adaption;
407 
408 @end
409 
410 
414 @interface NERtcLiveStreamImageInfo: NSObject
415 
419 @property (nonatomic, copy) NSString *url;
420 
428 @property (nonatomic, assign) NSInteger x;
429 
437 @property (nonatomic, assign) NSInteger y;
438 
444 @property (nonatomic, assign) NSInteger width;
445 
451 @property (nonatomic, assign) NSInteger height;
452 
453 @end
454 
455 
459 @interface NERtcLiveStreamLayout: NSObject
460 
464 @property (nonatomic, assign) NSInteger width;
465 
469 @property (nonatomic, assign) NSInteger height;
470 
474 @property (nonatomic, assign) NSUInteger backgroundColor;
475 
479 @property (nonatomic, strong) NSArray<NERtcLiveStreamUserTranscoding *> * users;
480 
484 @property (nonatomic, nullable, strong) NERtcLiveStreamImageInfo* bgImage;
485 
486 @end
487 
491 @interface NERtcLiveStreamTaskInfo: NSObject
492 
496 @property (nonatomic, copy) NSString *taskID;
497 
502 @property (nonatomic, copy) NSString *streamURL;
503 
507 @property (nonatomic, assign) BOOL serverRecordEnabled;
508 
512 @property (nonatomic, assign) NERtcLiveStreamMode lsMode;
513 
517 @property (nonatomic, nullable, strong) NERtcLiveStreamLayout *layout;
518 
522 @property (nonatomic, nullable, strong) NERtcLiveConfig *config;
523 
527 @property (nonatomic, nullable, copy) NSString *extraInfo;
528 
532 - (BOOL)isInvalid;
533 
534 @end
535 
536 
537 #pragma mark -- Audio Frame Observer
541 @interface NERtcAudioFrameRequestFormat : NSObject
549 @property (nonatomic, assign) uint32_t channels;
553 @property (nonatomic, assign) uint32_t sampleRate;
557 @property (nonatomic, assign) NERtcAudioFrameOpMode mode;
558 
559 @end
560 
564 @interface NERtcAudioFormat : NSObject
568 @property (nonatomic, assign) NERtcAudioType type;
575 @property (nonatomic, assign) uint32_t channels;
579 @property (nonatomic, assign) uint32_t sampleRate;
583 @property (nonatomic, assign) uint32_t bytesPerSample;
587 @property (nonatomic, assign) uint32_t samplesPerChannel;
588 
589 @end
590 
594 @interface NERtcAudioFrame : NSObject
598 @property (nonatomic, strong) NERtcAudioFormat* format;
602 @property (nonatomic, assign) void* data;
603 
604 @end
605 
606 
607 #pragma mark -- Volume info
608 
612 @interface NERtcAudioVolumeInfo : NSObject
613 
617 @property (nonatomic, assign) uint64_t uid;
618 
622 @property (nonatomic, assign) unsigned int volume;
623 
624 @end
625 
626 
627 #pragma mark -- Video Frame
628 
632 @interface NERtcVideoFrame : NSObject
633 
637 @property(nonatomic, assign) NERtcVideoFormatType format;
638 
642 @property(nonatomic, assign) uint64_t timestamp;
643 
647 @property(nonatomic, assign) uint32_t width;
648 
652 @property(nonatomic, assign) uint32_t height;
653 
657 @property(nonatomic, assign) NERtcVideoRotationType rotation;
658 
662 @property(nonatomic) void * buffer;
663 
664 @end
665 
666 #pragma mark- MediaRelay
667 
671 @interface NERtcChannelMediaRelayInfo : NSObject
672 
676 @property (nonatomic, copy)NSString *channelName;
680 @property (nonatomic, copy)NSString *token;
684 @property (nonatomic, assign)uint64_t uid;
685 
686 @end
687 
689 
697 @property(nonatomic, strong, readonly)NSDictionary<NSString *, NERtcChannelMediaRelayInfo *> * _Nullable destinationInfos;
698 
706 @property(nonatomic, strong)NERtcChannelMediaRelayInfo *sourceInfo;
707 
717 - (BOOL)setDestinationInfo:(NERtcChannelMediaRelayInfo *_Nonnull)destinationInfo forChannelName:(NSString *_Nonnull)channelName;
718 
725 - (BOOL)removeDestinationInfoForChannelName:(NSString *_Nonnull)channelName;
726 
727 @end
728 
729 #pragma mark - watermark
730 
736 @interface NERtcTextWatermarkConfig : NSObject
744 @property (nonatomic, copy, nullable) NSString *content;
745 
749 @property (nonatomic, assign) CGFloat fontSize;
750 
754 @property (nonatomic, strong, nullable) UIColor *fontColor;
755 
759 @property (nonatomic, strong, nullable) UIColor *wmColor;
760 
764 @property (nonatomic, assign) CGRect frame;
765 
766 @end
767 
774 @interface NERtcTimestampWatermarkConfig : NSObject
775 
779 @property (nonatomic, assign) CGFloat fontSize;
780 
784 @property (nonatomic, strong) UIColor *fontColor;
785 
789 @property (nonatomic, assign) CGRect frame;
790 
794 @property (nonatomic, strong) UIColor *wmColor;
795 
796 @end
797 
803 @interface NERtcImageWatermarkConfig : NSObject
804 
808 @property (nonatomic, strong, nullable) NSArray<UIImage *> *images;
809 
813 @property (nonatomic, assign) NSUInteger fps;
814 
818 @property (nonatomic, assign) BOOL loop;
819 
823 @property (nonatomic, assign) CGRect frame;
824 
825 @end
826 
827 
833 @interface NERtcCanvasWatermarkConfig : NSObject
834 
838 @property (nonatomic, strong, nullable) NSArray<NERtcTextWatermarkConfig *> *textWatermarks;
839 
843 @property (nonatomic, strong, nullable) NERtcTimestampWatermarkConfig *timestampWatermark;
844 
848 @property (nonatomic, strong, nullable) NSArray<NERtcImageWatermarkConfig *> *imageWaterMarks;
849 
850 @end
851 
855 @interface NERtcEncryptionConfig : NSObject
856 
860 @property (nonatomic, assign) NERtcEncryptionMode mode;
861 
865 @property (nonatomic, copy, nullable) NSString *key;
866 
867 @end
868 #pragma mark - privatization
869 
874 @interface NERtcServerAddresses : NSObject
875 
879 @property (nonatomic, copy, nullable) NSString *channelServer;
880 
884 @property (nonatomic, copy, nullable) NSString *statisticsServer;
885 
889 @property (nonatomic, copy, nullable) NSString *roomServer;
890 
894 @property (nonatomic, copy, nullable) NSString *compatServer;
895 
899 @property (nonatomic, copy, nullable) NSString *nosLbsServer;
900 
904 @property (nonatomic, copy, nullable) NSString *nosUploadSever;
905 
909 @property (nonatomic, copy, nullable) NSString *nosTokenServer;
910 
914 @property (nonatomic, assign) BOOL useIPv6;
915 
916 @end
917 
918 #pragma mark -- Log setting
919 
923 @interface NERtcLogSetting : NSObject
924 
928 @property (nonatomic, copy) NSString *logDir;
929 
933 @property (nonatomic, assign) NERtcLogLevel logLevel;
934 
935 @end
936 NS_ASSUME_NONNULL_END
NSString *const kNERtcKeyAutoSubscribeAudio
NSString *const kNERtcKeyRecordType
NSString *const kNERtcKeyRecordVideoEnabled
FOUNDATION_EXPORT uint32_t const NERtcAudioMixingDefaultVolume
Definition: NERtcEngineBase.h:193
NSString *const kNERtcKeyVideoCaptureObserverEnabled
NSString *const KNERtcKeyAudioAINSEnable
FOUNDATION_EXPORT uint32_t const NERtcAudioMixingMaxVolume
Definition: NERtcEngineBase.h:192
NSString *const kNERtcKeyExtraInfo
NSString *const kNERtcKeyVideoStartWithBackCamera
NSString *const kNERtcKeyVideoPreferHWEncode
NSString *const kNERtcKeyVideoPreferMetalRender
NSString *const kNERtcKeyVideoSendOnPubType
NSString *const KNERtcKeyDisableOverrideSpeakerOnReceiver
NSString *const kNERtcKeyPublishSelfStreamEnabled
NSString *const KNERtcKeyDisableSWAECOnHeadset
NSString *const kNERtcKeyLogLevel
NSString *const kNERtcKeyRecordHostEnabled
NSString *const kNERtcKeyVideoPreferHWDecode
NSString *const kNERtcKeyRecordAudioEnabled
NS_ASSUME_NONNULL_BEGIN NSString *const kNERtcKeyChannel1V1ModeEnabled
以下 key 用于 INERtcEngine::setParameters
NERtcLiveStreamMode
直播推流模式
Definition: NERtcEngineEnum.h:673
NERtcVideoCropMode
视频裁剪模式
Definition: NERtcEngineEnum.h:275
NERtcLogLevel
日志级别
Definition: NERtcEngineEnum.h:854
NERtcVideoFormatType
视频格式类型
Definition: NERtcEngineEnum.h:315
NERtcLiveStreamVideoScaleMode
直播推流模式
Definition: NERtcEngineEnum.h:687
NERtcSubStreamContentPrefer
屏幕共享功能的编码策略倾向
Definition: NERtcEngineEnum.h:171
NERtcLiveStreamAudioCodecProfile
直播推流音频编码规格
Definition: NERtcEngineEnum.h:663
NERtcVideoOutputOrientationMode
视频旋转方向模式。
Definition: NERtcEngineEnum.h:252
NERtcVideoProfileType
视频 profile 类型
Definition: NERtcEngineEnum.h:104
NERtcAudioType
音频类型
Definition: NERtcEngineEnum.h:712
NERtcVideoMirrorMode
视频镜像模式。
Definition: NERtcEngineEnum.h:240
NERtcAudioFrameOpMode
音频数据读写模式
Definition: NERtcEngineEnum.h:720
NERtcEncryptionMode
加密模式
Definition: NERtcEngineEnum.h:842
NERtcDegradationPreference
带宽受限时视频编码适应性偏好
Definition: NERtcEngineEnum.h:153
NERtcLiveStreamAudioSampleRate
直播推流音频采样率
Definition: NERtcEngineEnum.h:651
NERtcVideoFrameRate
视频帧率
Definition: NERtcEngineEnum.h:126
NERtcVideoRenderScaleMode
视频渲染缩放模式
Definition: NERtcEngineEnum.h:215
NERtcVideoRotationType
视频数据的旋转方向
Definition: NERtcEngineEnum.h:301
音频格式
Definition: NERtcEngineBase.h:565
音频帧
Definition: NERtcEngineBase.h:595
音频原始数据回调格式(默认不设置)
Definition: NERtcEngineBase.h:542
声音音量信息
Definition: NERtcEngineBase.h:613
本地视频基础发送配置
Definition: NERtcEngineBase.h:85
画布水印设置。
Definition: NERtcEngineBase.h:834
Definition: NERtcEngineBase.h:689
媒体流转发相关的数据结构。
Definition: NERtcEngineBase.h:672
创建 音效 的可选项
Definition: NERtcEngineBase.h:247
创建 伴音 的可选项
Definition: NERtcEngineBase.h:198
配置媒体流加密模式和密钥。
Definition: NERtcEngineBase.h:856
图片水印设置参数。
Definition: NERtcEngineBase.h:804
音视频流编码参数等设置
Definition: NERtcEngineBase.h:293
图片布局
Definition: NERtcEngineBase.h:415
直播布局
Definition: NERtcEngineBase.h:460
直播推流任务的配置
Definition: NERtcEngineBase.h:492
直播成员布局
Definition: NERtcEngineBase.h:340
日志相关设置
Definition: NERtcEngineBase.h:924
私有化服务器配置项
Definition: NERtcEngineBase.h:875
文字水印设置参数。
Definition: NERtcEngineBase.h:737
时间戳水印。
Definition: NERtcEngineBase.h:775
视频画布设置
Definition: NERtcEngineBase.h:52
id< NERtcEngineVideoRenderSink > externalVideoRender
外部渲染器
Definition: NERtcEngineBase.h:78
BOOL useExternalRender
是否使用外部渲染器,默认 NO 不使用,若使用SDK内部会根据externalVideoRender来进行绑定,若不使用SDK内部根据container来进行绑定。暂不支持在通话中切换内部渲染与外部渲染...
Definition: NERtcEngineBase.h:56
NERtcVideoRenderScaleMode renderMode
视频渲染模式
Definition: NERtcEngineBase.h:66
VIEW_CLASS * container
视频窗口容器(SDK内部渲染)
Definition: NERtcEngineBase.h:61
NERtcVideoMirrorMode mirrorMode
视频镜像模式。
Definition: NERtcEngineBase.h:73
本地视频发送配置
Definition: NERtcEngineBase.h:124
视频帧信息
Definition: NERtcEngineBase.h:633
本地辅流发送配置
Definition: NERtcEngineBase.h:183
外部视频渲染。
Definition: NERtcEngineDelegate.h:253