腾讯云直播服务(LVB)关键类型定义
| struct liteav::V2TXLiveVideoEncoderParam |
Public 成员函数 | |
| V2TXLiveVideoEncoderParam (V2TXLiveVideoResolution resolution) | |
成员变量 | |
| V2TXLiveVideoResolution | videoResolution |
| V2TXLiveVideoResolutionMode | videoResolutionMode |
| uint32_t | videoFps |
| uint32_t | videoBitrate |
| uint32_t | minVideoBitrate |
| V2TXLiveVideoEncoderParam | ( | V2TXLiveVideoResolution | resolution | ) |
| uint32_t minVideoBitrate |
【字段含义】最低视频码率,SDK 会在网络不佳的情况下主动降低视频码率以保持流畅度,最低会降至 minVideoBitrate 所设定的数值。
【推荐取值】您可以通过同时设置 videoBitrate 和 minVideoBitrate 两个参数,用于约束 SDK 对视频码率的调整范围:
| uint32_t videoBitrate |
【字段含义】目标视频码率,SDK 会按照目标码率进行编码,只有在弱网络环境下才会主动降低视频码率。
【推荐取值】请参考 V2TXLiveVideoResolution 在各档位注释的最佳码率,也可以在此基础上适当调高。 比如:V2TXLiveVideoResolution1280x720 对应 1200kbps 的目标码率,您也可以设置为 1500kbps 用来获得更好的观感清晰度。
【特别说明】您可以通过同时设置 videoBitrate 和 minVideoBitrate 两个参数,用于约束 SDK 对视频码率的调整范围:
| uint32_t videoFps |
【字段含义】视频采集帧率
【推荐取值】15fps 或 20fps。5fps 以下,卡顿感明显。10fps 以下,会有轻微卡顿感。20fps 以上,会浪费带宽(电影的帧率为 24fps)。
| V2TXLiveVideoResolution videoResolution |
【字段含义】 视频分辨率
【特别说明】如需使用竖屏分辨率,请指定 videoResolutionMode 为 Portrait,例如: 640 × 360 + Portrait = 360 × 640。
【推荐取值】
| V2TXLiveVideoResolutionMode videoResolutionMode |
【字段含义】分辨率模式(横屏分辨率 or 竖屏分辨率)
【推荐取值】桌面平台(Windows、Mac)建议选择 Landscape。
【特别说明】如需使用竖屏分辨率,请指定 resMode 为 Portrait,例如: 640 × 360 + Portrait = 360 × 640。
| struct liteav::V2TXLiveVideoFrame |
Public 成员函数 | |
| V2TXLiveVideoFrame () | |
成员变量 | |
| V2TXLivePixelFormat | pixelFormat |
| V2TXLiveBufferType | bufferType |
| char * | data |
| int32_t | length |
| int32_t | width |
| int32_t | height |
| V2TXLiveRotation | rotation |
|
inline |
| V2TXLiveBufferType bufferType |
【字段含义】视频数据包装格式
| char* data |
【字段含义】bufferType 为 V2TXLiveBufferTypeByteBuffer 时的视频数据。
| int32_t height |
【字段含义】视频高度
| int32_t length |
【字段含义】视频数据的长度,单位是字节
| V2TXLivePixelFormat pixelFormat |
【字段含义】视频帧像素格式
| V2TXLiveRotation rotation |
【字段含义】视频帧的顺时针旋转角度
| int32_t width |
【字段含义】视频宽度
| struct liteav::V2TXLiveAudioFrame |
Public 成员函数 | |
| V2TXLiveAudioFrame () | |
成员变量 | |
| char * | data |
| uint32_t | length |
| uint32_t | sampleRate |
| uint32_t | channel |
|
inline |
| uint32_t channel |
【字段含义】声道数
| char* data |
【字段含义】音频数据
| uint32_t length |
【字段含义】音频数据的长度
| uint32_t sampleRate |
【字段含义】采样率
| struct liteav::V2TXLiveAudioFrameObserverFormat |
Public 成员函数 | |
| V2TXLiveAudioFrameObserverFormat () | |
成员变量 | |
| int | sampleRate |
| int | channel |
| int | samplesPerCall |
|
inline |
| int channel |
【字段含义】声道数
【推荐取值】默认值:1,代表单声道。可设定的数值只有两个数字:1-单声道,2-双声道。
| int sampleRate |
【字段含义】采样率
【推荐取值】默认值:48000Hz。支持 16000, 32000, 44100, 48000。
| int samplesPerCall |
【字段含义】采样点数
【推荐取值】取值必须是 sampleRate/100 的整数倍。
| struct liteav::V2TXLivePusherStatistics |
Public 成员函数 | |
| V2TXLivePusherStatistics () | |
成员变量 | |
| int32_t | appCpu |
| int32_t | systemCpu |
| int32_t | width |
| int32_t | height |
| int32_t | fps |
| int32_t | videoBitrate |
| int32_t | audioBitrate |
|
inline |
| int32_t appCpu |
【字段含义】当前 App 的 CPU 使用率(%)
| int32_t audioBitrate |
【字段含义】音频码率(Kbps)
| int32_t fps |
【字段含义】帧率(fps)
| int32_t height |
【字段含义】视频高度
| int32_t systemCpu |
【字段含义】当前系统的 CPU 使用率(%)
| int32_t videoBitrate |
【字段含义】视频码率(Kbps)
| int32_t width |
【字段含义】视频宽度
| struct liteav::V2TXLivePlayerStatistics |
Public 成员函数 | |
| V2TXLivePlayerStatistics () | |
成员变量 | |
| int32_t | appCpu |
| int32_t | systemCpu |
| int32_t | width |
| int32_t | height |
| int32_t | fps |
| int32_t | videoBitrate |
| int32_t | audioBitrate |
|
inline |
| int32_t appCpu |
【字段含义】当前 App 的 CPU 使用率(%)
| int32_t audioBitrate |
【字段含义】音频码率(Kbps)
| int32_t fps |
【字段含义】帧率(fps)
| int32_t height |
【字段含义】视频高度
| int32_t systemCpu |
【字段含义】当前系统的 CPU 使用率(%)
| int32_t videoBitrate |
【字段含义】视频码率(Kbps)
| int32_t width |
【字段含义】视频宽度
| struct liteav::V2TXLiveLogConfig |
Public 成员函数 | |
| V2TXLiveLogConfig () | |
成员变量 | |
| V2TXLiveLogLevel | logLevel |
| bool | enableObserver |
| bool | enableConsole |
| bool | enableLogFile |
| const char * | logPath |
|
inline |
| bool enableConsole |
【字段含义】是否允许 SDK 在编辑器(XCoder、Android Studio、Visual Studio 等)的控制台上打印 Log 【推荐取值】默认值:false
| bool enableLogFile |
【字段含义】是否启用本地 Log 文件 【特殊说明】如非特殊需要,请不要关闭本地 Log 文件,否则腾讯云技术团队将无法在出现问题时进行跟踪和定位。 【推荐取值】默认值:true
| bool enableObserver |
【字段含义】是否通过 V2TXLivePremierObserver 接收要打印的 Log 信息 【特殊说明】如果您希望自己实现 Log 写入,可以打开此开关,Log 信息会通过 V2TXLivePremierObserver::onLog 回调给您。 【推荐取值】默认值:false
| V2TXLiveLogLevel logLevel |
【字段含义】设置 Log 级别 【推荐取值】默认值:V2TXLiveLogLevelAll
| const char* logPath |
【字段含义】设置本地 Log 的存储目录,默认 Log 存储位置: Windows:appdata%/liteav/log
| struct liteav::V2TXLiveImage |
Public 成员函数 | |
| V2TXLiveImage () | |
成员变量 | |
| const char * | imageSrc |
| V2TXLiveImageType | imageType |
| uint32_t | imageWidth |
| uint32_t | imageHeight |
| uint32_t | imageLength |
|
inline |
| uint32_t imageHeight |
图片高度,默认为0(图片数据类型为V2TXLiveImageTypeFile,忽略该参数)
| uint32_t imageLength |
图片数据的长度;单位字节
| const char* imageSrc |
V2TXLiveImageTypeFile: 图片路径; 其他类型:图片内容
| V2TXLiveImageType imageType |
图片数据类型,默认为V2TXLiveImageFile V2TXLiveImageType
| uint32_t imageWidth |
图片宽度,默认为0(图片数据类型为V2TXLiveImageTypeFile,忽略该参数)
| struct liteav::V2TXLiveScreenCaptureSourceInfo |
Public 成员函数 | |
| V2TXLiveScreenCaptureSourceInfo () | |
成员变量 | |
| V2TXLiveScreenCaptureSourceType | sourceType |
| void * | sourceId |
| const char * | sourceName |
| V2TXLiveImage | thumbBGRA |
| V2TXLiveImage | iconBGRA |
| bool | isMinimizeWindow |
| bool | isMainScreen |
|
inline |
| V2TXLiveImage iconBGRA |
图标内容
| bool isMainScreen |
是否为主屏,是否为主屏,仅采集源类型为 Screen 时才可用
| bool isMinimizeWindow |
是否为最小化窗口,通过 getScreenCaptureSources 获取列表时的窗口状态,仅采集源为 Window 时才可用
| void* sourceId |
采集源 ID;对于窗口,该字段指示窗口句柄;对于屏幕,该字段指示屏幕 ID
| const char* sourceName |
采集源名称,UTF8 编码
| V2TXLiveScreenCaptureSourceType sourceType |
采集源类型
| V2TXLiveImage thumbBGRA |
缩略图内容
| class liteav::IV2TXLiveScreenCaptureSourceList |
Public 成员函数 | |
| virtual uint32_t | getCount ()=0 |
| virtual V2TXLiveScreenCaptureSourceInfo | getSourceInfo (uint32_t index)=0 |
| virtual void | release ()=0 |
|
inlineprotectedvirtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
遍历完窗口列表后,调用 release 释放资源。
| struct liteav::V2TXLiveScreenCaptureProperty |
Public 成员函数 | |
| V2TXLiveScreenCaptureProperty () | |
成员变量 | |
| bool | enableCaptureMouse |
| bool | enableHighlightBorder |
| bool | enableHighPerformance |
| int | highlightBorderColor |
| int | highlightBorderSize |
| bool | enableCaptureChildWindow |
|
inline |
| bool enableCaptureChildWindow |
窗口采集时是否采集子窗口(与采集窗口具有 Owner 或 Popup 属性),默认为 false
| bool enableCaptureMouse |
是否采集目标内容时顺带采集鼠标,默认为 true
| bool enableHighlightBorder |
是否高亮正在共享的窗口,默认为 true
| bool enableHighPerformance |
是否开启高性能模式(只会在分享屏幕时会生效),开启后屏幕采集性能最佳,但无法过滤远端的高亮边框,默认为 true
| int highlightBorderColor |
指定高亮边框颜色,RGB 格式,传入 0 时采用默认颜色,默认颜色为 #8CBF26
| int highlightBorderSize |
指定高亮边框的宽度,传入0时采用默认描边宽度,默认宽度为 5,最大值为 50
| #define LITEAV_API __declspec(dllexport) |
| #define LITEAV_API __declspec(dllimport) |
| #define MODULE_CPP_V2TXLIVEDEF_H_ |
| #define TARGET_PLATFORM_DESKTOP ((__APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE) || _WIN32) |
| #define TARGET_PLATFORM_PHONE (__ANDROID__ || (__APPLE__ && TARGET_OS_IOS)) |
| #define V2_API __declspec(dllexport) |
| #define V2_API __declspec(dllimport) |
| #define V2_API __attribute__((visibility("default"))) |
| #define V2_API __attribute__((visibility("default"))) |
| #define V2_API |
| #define WIN32_LEAN_AND_MEAN |