NERoom SDK V1.32.0
载入中...
搜索中...
未找到
pre_rtc_ctrl_interface.h
浏览该文件的文档.
1// Copyright (c) 2022 NetEase, Inc. All rights reserved.
2// Use of this source code is governed by a MIT license that can be
3// found in the LICENSE file.
4
11#ifndef PRE_RTC_CTRL_INTERFACE_H
12#define PRE_RTC_CTRL_INTERFACE_H
13
14#include "base_ctrl_interface.h"
16
17namespace neroom {
18
23public:
37 typedef void (*VideoFrameOriginalDataCallback)(const std::string userUuid,
38 void* data,
39 NEVideoType type,
40 uint32_t width,
41 uint32_t height,
42 uint32_t count,
43 uint32_t offset[kNEMaxPlaneCount],
44 uint32_t stride[kNEMaxPlaneCount],
45 NEVideoRotation rotation);
46
47public:
51 virtual ~INEPreviewRoomRtcController() = default;
52
57 virtual int startVideoPreview() = 0;
58
63 virtual int stopVideoPreview() = 0;
64
70 virtual int setupLocalVideoCanvas(const NERoomVideoView& videoView) = 0;
71
78
84 virtual int enumCameraDevices(std::vector<NEDeviceBaseInfo>& deviceList) = 0;
85
91 virtual int getSelectedCameraDevice(std::string& deviceId) = 0;
92
98 virtual int selectCameraDevice(const std::string& deviceId) = 0;
99
105 virtual int enumPlayoutDevices(std::vector<NEDeviceBaseInfo>& deviceList) = 0;
106
112 virtual int getDefaultPlayoutDevice(NEDeviceBaseInfo& deviceInfo) = 0;
113
119 virtual int getSelectedPlayoutDevice(std::string& deviceId) = 0;
120
126 virtual int selectPlayoutDevice(const std::string& deviceId) = 0;
127
132 virtual uint32_t getPlayoutDeviceVolume() = 0;
133
139 virtual int setPlayoutDeviceVolume(uint32_t volume) = 0;
140
146 virtual int startPlayoutDeviceTest(const std::string& mediaFile) = 0;
147
152 virtual int stopPlayoutDeviceTest() = 0;
153
159 virtual int enumRecordDevices(std::vector<NEDeviceBaseInfo>& deviceList) = 0;
160
166 virtual int getDefaultRecordDevice(NEDeviceBaseInfo& deviceInfo) = 0;
167
173 virtual int getSelectedRecordDevice(std::string& deviceId) = 0;
174
180 virtual int selectRecordDevice(const std::string& deviceId) = 0;
181
186 virtual uint32_t getRecordDeviceVolume() = 0;
187
193 virtual int setRecordDeviceVolume(uint32_t volume) = 0;
194
200 virtual int startRecordDeviceTest(uint64_t interval = 200) = 0;
201
206 virtual int stopRecordDeviceTest() = 0;
207
213 virtual int setLocalVideoResolution(NEVideoResolution videoResolution) = 0;
214
220 virtual int setLocalVideoFramerate(NEVideoFramerate framerate) = 0;
221
228
239
245 virtual int enableAudioEchoCancellation(bool enable) = 0;
246
253 virtual int enableAudioVolumeIndication(bool enable, int interval) = 0;
254
260 virtual int startAudioDump(NEAudioDumpType type) = 0;
261
266 virtual int stopAudioDump() = 0;
267
273 ROOMKIT_DEPRECATED("Use enableAudioAINS instead")
274 virtual int enableAudioAI(bool enable) = 0;
275
281 virtual int enableAudioAINS(bool enable) = 0;
282
288 virtual int enableAudioVolumeAutoAdjust(bool enable) = 0;
289
296 virtual int enableVirtualBackground(bool enable, const NERoomVirtualBackgroundSource& backgroundSource) = 0;
297
306 virtual int enableVirtualBackground(bool enable, const NERoomVirtualBackgroundSource& backgroundSource, bool force = false) = 0;
307
312 virtual int startBeauty() = 0;
313
320 virtual int startBeauty(const std::string& beautyResourcePath) = 0;
321
326 virtual int stopBeauty() = 0;
327
334 virtual int enableBeauty(bool isOpenBeauty) = 0;
335
342 virtual int addBeautyFilter(const std::string& filterResourcePath) = 0;
343
351 virtual int setBeautyFilterLevel(float level) = 0;
352
357 virtual int removeBeautyFilter() = 0;
358
367 virtual int addBeautySticker(const std::string& stickerResourcePath) = 0;
368
373 virtual int removeBeautySticker() = 0;
374
381 virtual int setBeautyEffect(NERoomBeautyEffectType beautyType, float level) = 0;
382
389 virtual int setExternalVideoSource(bool enabled) = 0;
390
396 virtual int pushExternalVideoFrame(const NERoomVideoFrame& frame) = 0;
397
407 virtual int adjustRecordingSignalVolume(uint32_t volume) = 0;
408
418 virtual int setLocalVoicePitch(double pitch) = 0;
419
425 virtual int setLocalVoiceReverbParam(const NERoomReverbParam& param) = 0;
426
434 virtual int setLocalVoiceEqualization(NERoomAudioEqualizationBandFrequency bandFrequency, int bandGain) = 0;
435
441 virtual int setRecordDeviceMute(bool mute) = 0;
442
448 virtual int setPlayoutDeviceMute(bool mute) = 0;
449
456 virtual int getPlayoutDeviceMute(bool &mute) = 0;
457
464 virtual void setStreamAlignmentProperty(bool enable) = 0;
465
471 virtual int64_t getNtpTimeOffset() = 0;
472
482
489 virtual int setParameters(const std::string& params) = 0;
490
498
507 virtual int setMixedAudioFrameParameters(int sampleRate) = 0;
508
515
522 virtual int adjustPlaybackSignalVolume(int volume) = 0;
523
529 virtual int installAudioCaptureDriver() = 0;
530
543 virtual int enableAudioVolumeIndication(const std::string& channelName, bool enable, int interval, bool enableVad) = 0;
550};
551} // namespace neroom
552
553#endif // PRE_RTC_CTRL_INTERFACE_H
基础控制器头文件
#define kNEMaxPlaneCount
virtual int startAudioDump(NEAudioDumpType type)=0
启用音频Dump
virtual int enumRecordDevices(std::vector< NEDeviceBaseInfo > &deviceList)=0
枚举音频采集设备
virtual int enableAudioAINS(bool enable)=0
开启音频 AI 降噪
virtual int stopBeauty()=0
结束美颜模块
virtual ~INEPreviewRoomRtcController()=default
析构函数
virtual int setBeautyFilterLevel(float level)=0
设置滤镜强度
virtual int setMixedAudioFrameParameters(int sampleRate)=0
设置录制和播放声音混音后的采样率
virtual int startBeauty()=0
启用美颜模块
virtual uint32_t getPlayoutDeviceVolume()=0
获取音频播放设备音量
virtual int startVideoPreview()=0
开始预览
virtual NERoomVirtualBackgroundSupportedType getVirtualBackgroundSupportedType()=0
获取虚拟背景支持类型
virtual int stopVideoPreview()=0
停止预览
virtual int setupLocalVideoCanvas(const NERoomVideoView &videoView)=0
设置本地视频画布
virtual int setParameters(const std::string &params)=0
设置音视频通话的相关参数
virtual int removeBeautyFilter()=0
移除滤镜效果
virtual int getPlayoutDeviceMute(bool &mute)=0
获取音频播放设备静音状态
virtual int enumCameraDevices(std::vector< NEDeviceBaseInfo > &deviceList)=0
枚举视频设备
virtual void setupVideoFrameOriginalDataCallback(const VideoFrameOriginalDataCallback &callback)=0
设置视频原始数据回调
virtual int getDefaultRecordDevice(NEDeviceBaseInfo &deviceInfo)=0
获取默认音频采集设备
virtual int setLocalVoicePitch(double pitch)=0
设置本地语音音调
virtual int setRecordDeviceMute(bool mute)=0
静音或取消静音音频采集设备
virtual int selectPlayoutDevice(const std::string &deviceId)=0
选择音频播放设备
virtual int setLocalVoiceEqualization(NERoomAudioEqualizationBandFrequency bandFrequency, int bandGain)=0
设置本地语音音效均衡,即自定义设置本地人声均衡波段的中心频率
virtual int64_t getNtpTimeOffset()=0
获取本地系统时间与服务端时间差值
virtual int setAudioFrameObserver(INERoomRtcAudioFrameObserver *observer)=0
注册语音观测器对象
virtual int enableAudioVolumeAutoAdjust(bool enable)=0
开启自动调节麦克风音量
virtual int pushExternalVideoFrame(const NERoomVideoFrame &frame)=0
推送外部视频帧
virtual int addBeautyFilter(const std::string &filterResourcePath)=0
添加滤镜效果
virtual int setLocalVideoResolution(NEVideoResolution videoResolution)=0
设置本地视频分辨率
virtual int stopPlayoutDeviceTest()=0
停止音频播放设备测试
virtual uint32_t getRecordDeviceVolume()=0
获取音频采集设备音量
virtual void setStreamAlignmentProperty(bool enable)=0
开启精准对齐功能
virtual int setBeautyEffect(NERoomBeautyEffectType beautyType, float level)=0
开启指定美颜效果,并设置美颜强度
void(* VideoFrameOriginalDataCallback)(const std::string userUuid, void *data, NEVideoType type, uint32_t width, uint32_t height, uint32_t count, uint32_t offset[4], uint32_t stride[4], NEVideoRotation rotation)
自定义渲染回调
virtual int setAudioProfile(NERoomRtcAudioProfileType profile, NERoomRtcAudioScenarioType scenario)=0
设置音频编码属性
virtual int getSelectedPlayoutDevice(std::string &deviceId)=0
获取选中的音频播放设备
virtual int enumPlayoutDevices(std::vector< NEDeviceBaseInfo > &deviceList)=0
枚举音频播放设备
virtual int setPlayoutDeviceMute(bool mute)=0
静音或取消静音音频播放设备
virtual int getSelectedRecordDevice(std::string &deviceId)=0
获取选中的音频采集设备
virtual int setChannelProfile(NERoomRtcChannelProfileType profile)=0
设置房间场景 房间场景可设置为通话或直播场景,不同的场景中 QoS 策略不同。
virtual int stopAudioDump()=0
关闭音频Dump
virtual int removeBeautySticker()=0
移除贴纸效果
virtual int enableAudioEchoCancellation(bool enable)=0
开启回音消除
virtual int enableBeauty(bool isOpenBeauty)=0
打开美颜功能
virtual int enableAudioVolumeIndication(bool enable, int interval)=0
启用说话者音量提示
virtual int installAudioCaptureDriver()=0
检查音频共享驱动是否正确安装
virtual int setExternalVideoSource(bool enabled)=0
开启或关闭外部视频源数据输入
virtual int setRecordDeviceVolume(uint32_t volume)=0
设置音频采集设备音量
virtual int setLocalVideoFramerate(NEVideoFramerate framerate)=0
设置本地视频帧率
virtual int getDefaultPlayoutDevice(NEDeviceBaseInfo &deviceInfo)=0
获取默认音频播放设备
virtual int startPlayoutDeviceTest(const std::string &mediaFile)=0
开始音频播放设备测试
virtual int enableAudioAI(bool enable)=0
开启音频AI降噪
virtual int selectRecordDevice(const std::string &deviceId)=0
选择音频采集设备
virtual int addBeautySticker(const std::string &stickerResourcePath)=0
添加美颜贴纸
virtual int adjustRecordingSignalVolume(uint32_t volume)=0
调节采集信号音量
virtual int selectCameraDevice(const std::string &deviceId)=0
选择视频设备
virtual int enableVirtualBackground(bool enable, const NERoomVirtualBackgroundSource &backgroundSource)=0
开启虚拟背景
virtual int startRecordDeviceTest(uint64_t interval=200)=0
启动音频采集设备测试
virtual int setAudioDeviceAutoSelectType(NEAudioDeviceAutoSelectType type)=0
设置音频设备自动选择策略
virtual int adjustPlaybackSignalVolume(int volume)=0
调节本地播放的所有远端用户的信号音量
virtual int setLocalVoiceReverbParam(const NERoomReverbParam &param)=0
设置本地语音混响参数
virtual int setPlayoutDeviceVolume(uint32_t volume)=0
设置音频播放设备音量
virtual int setRecordingAudioFrameParameters(const NERoomRtcAudioFrameRequestFormat &format)=0
设置录制的声音格式
virtual int getSelectedCameraDevice(std::string &deviceId)=0
获取当前所使用的视频设备Id
virtual int stopRecordDeviceTest()=0
停止音频采集设备测试
#define ROOMKIT_DEPRECATED(message)
struct tagNERoomVirtualBackgroundSource { NEBackgroundSourceType sourceType=NEBackgroundSourceType::kNEBackgroundColor; unsigned int color=0xffffff; std::string path;} NERoomVirtualBackgroundSource
自定义背景图像
struct tagNERoomReverbParam { float wetGain=0.0f; float dryGain=1.0f; float damping=1.0f; float roomSize=0.1f; float decayTime=0.1f; float preDelay=0.0f; } NERoomReverbParam
混响参数
struct tagNERoomVideoFrame { NEVideoType format=kNEVideoTypeI420; uint64_t timestamp=0; uint32_t width=0; uint32_t height=0; NEVideoRotation rotation=kNEVideoRotation_0; void *buffer=nullptr; } NERoomVideoFrame
外部输入的视频帧
enum { kNEVideoRotation_0=0, kNEVideoRotation_90=90, kNEVideoRotation_180=180, kNEVideoRotation_270=270, } NEVideoRotation
视频帧旋转角度
enum tagNEAudioDumpType { kNEAudioDumpTypePCM=0, kNEAudioDumpTypeAll=1, kNEAudioDumpTypeWAV=2 } NEAudioDumpType
音频dump文件类型
enum tagNERoomRtcAudioScenarioType { kNEAudioScenarioDefault=0, kNEAudioScenarioSpeech=1, kNEAudioScenarioMusic=2, } NERoomRtcAudioScenarioType
音频应用场景。不同的场景设置对应不同的音频采集模式、播放模式
enum tagNERoomAudioEqualizationBandFrequency { kNEVoiceEqualizationBand_31=0, kNEVoiceEqualizationBand_62=1, kNEVoiceEqualizationBand_125=2, kNEVoiceEqualizationBand_250=3, kNEVoiceEqualizationBand_500=4, kNEVoiceEqualizationBand_1K=5, kNEVoiceEqualizationBand_2K=6, kNEVoiceEqualizationBand_4K=7, kNEVoiceEqualizationBand_8K=8, kNEVoiceEqualizationBand_16K=9, } NERoomAudioEqualizationBandFrequency
音效均衡波段的中心频率
enum { kNEVideoFramerateFpsDefault=0, kNEVideoFramerateFps_7=7, kNEVideoFramerateFps_10=10, kNEVideoFramerateFps_15=15, kNEVideoFramerateFps_24=24, kNEVideoFramerateFps_30=30, kNEVideoFramerateFps_60=60, } NEVideoFramerate
视频帧率
enum tagNERoomRtcChannelProfileType { kNEChannelProfileCommunication=0, kNEChannelProfileLiveBroadcasting=1, } NERoomRtcChannelProfileType
场景模式
enum { kNEVideoProfileUsingTemplate=-1, kNEVideoProfileLowest=0, kNEVideoProfileLow=1, kNEVideoProfileStandard=2, kNEVideoProfileHD720P=3, kNEVideoProfileHD1080P=4, kNEVideoProfile4KUHD=5, kNEVideoProfile8KUHD=6, kNEVideoProfileNone=7, kNEVideoProfileMAX=kNEVideoProfile8KUHD } NEVideoResolution
视频分辨率
struct tagNERoomVideoView { bool setup=false; void *window=nullptr; NEVideoScalingMode scalingMode=kVideoScaleFit; NEVideoMirrorMode mirrorMode=kVideoMirrorModeDisabled; } NERoomVideoView
视频画布
enum tagVirtualBackgroundSupportedType { kNEVirtualBackgroundSupportFull=0, kNEVirtualBackgroundSupportHardwareLimit=1, kNEVirtualBackgroundSupportPerformanceLimit=2 } NERoomVirtualBackgroundSupportedType
设备支持级别。
enum tagNEVideoType { kNEVideoTypeI420=0, kNEVideoTypeNV12=1, kNEVideoTypeNV21=2, kNEVideoTypeBGRA=3, } NEVideoType
视频帧格式
enum tagNERoomRtcAudioProfileType { kNEAudioProfileDefault=0, kNEAudioProfileStandard=1, kNEAudioProfileStandardExtend=2, kNEAudioProfileMiddleQuality=3, kNEAudioProfileMiddleQualityStereo=4, kNEAudioProfileHighQuality=5, kNEAudioProfileHighQualityStereo=6, } NERoomRtcAudioProfileType
音频属性。设置采样率,码率,编码模式和声道数
enum { kNEAudioDeviceAutoSelectTypeDefault=0, kNEAudioDeviceAutoSelectTypeAvailable=1, } NEAudioDeviceAutoSelectType
音频设备自动选择策略
struct tagNERoomRtcAudioFrameRequestFormat { uint32_t channels=0; uint32_t sampleRate=0; NERoomRtcAudioFrameOpMode mode=kNERawAudioFrameOpModeReadWrite; } NERoomRtcAudioFrameRequestFormat
音频帧请求格式
enum { kNERoomBeautyWhiteTeeth=0, kNERoomBeautyLightEye, kNERoomBeautyWhiten, kNERoomBeautySmooth, kNERoomBeautySmallNose, kNERoomBeautyEyeDis, kNERoomBeautyEyeAngle, kNERoomBeautyMouth, kNERoomcBeautyBigEye, kNERoomBeautySmallFace, kNERoomBeautyJaw, kNERoomBeautyThinFace, kNERoomBeautyFaceRuddy, kNERoomBeautyLongNose, kNERoomBeautyRenZhong, kNERoomBeautyMouthAngle, kNERoomBeautyRoundEye, kNERoomBeautyOpenEyeAngle, kNERoomBeautyVFace, kNERoomBeautyThinUnderjaw, kNERoomBeautyNarrowFace, kNERoomBeautyCheekBone, kNERoomBeautyFaceSharpen } NERoomBeautyEffectType
美颜类型。
struct tagDeviceBaseInfo { std::string deviceName; std::string deviceId; bool unavailable=true; bool defaultDevice=false; int transportType=0; } NEDeviceBaseInfo
设备基本信息
预览房间事件监听头文件