Commit 5cecfdd3 by liulongfei

项目初始化

parents
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
\ No newline at end of file
#ifndef __ITXAUDIOEFFECTMANAGER_H__
#define __ITXAUDIOEFFECTMANAGER_H__
#include <windows.h>
class AudioMusicParam;
class ITXMusicPlayObserver;
enum TXVoiceReverbType;
class ITXAudioEffectManager
{
protected:
virtual ~ITXAudioEffectManager() {};
public:
/////////////////////////////////////////////////////////////////////////////////
//
// (一)人声相关特效函数
//
/////////////////////////////////////////////////////////////////////////////////
/// @name 人声相关特效函数
/// @{
/**
* 1.1 设置人声的混响效果(KTV、小房间、大会堂、低沉、洪亮...)
*/
virtual void setVoiceReverbType(TXVoiceReverbType type) = 0;
/**
* 1.2 设置麦克风采集人声的音量
*
* @param volume 音量大小,100为正常音量,取值范围为0 - 100;默认值:100
*/
virtual void setVoiceCaptureVolume(int volume) = 0;
/// @}
/////////////////////////////////////////////////////////////////////////////////
//
// (二)背景音乐特效函数
//
/////////////////////////////////////////////////////////////////////////////////
/// @name 背景音乐特效函数
/// @{
/**
* 2.1 设置背景音乐的播放进度回调接口
*
* @param id 音乐 ID
* @param observer 具体参考 ITXMusicPlayObserver 中定义接口
*/
virtual void setMusicObserver(int id,ITXMusicPlayObserver* observer) = 0;
/**
* 2.2 开始播放背景音乐
*
* 每个音乐都需要您指定具体的 ID,您可以通过该 ID 对音乐的开始、停止、音量等进行设置。
*
* @note 若您想同时播放多个音乐,请分配不同的 ID 进行播放。
* 如果使用同一个 ID 播放不同音乐,SDK 会先停止播放旧的音乐,再播放新的音乐。
* @param musicParam 音乐参数
*/
virtual void startPlayMusic(AudioMusicParam musicParam) = 0;
/**
* 2.3 停止播放背景音乐
*
* @param id 音乐 ID
*/
virtual void stopPlayMusic(int id) = 0;
/**
* 2.4 暂停播放背景音乐
*
* @param id 音乐 ID
*/
virtual void pausePlayMusic(int id) = 0;
/**
* 2.5 恢复播放背景音乐
*
* @param id 音乐 ID
*/
virtual void resumePlayMusic(int id) = 0;
/**
* 2.6 设置背景音乐的远端音量大小,即主播可以通过此接口设置远端观众能听到的背景音乐的音量大小。
*
* @param id 音乐 ID
* @param volume 音量大小,100为正常音量,取值范围为0 - 100;默认值:100
*/
virtual void setMusicPublishVolume(int id, int volume) = 0;
/**
* 2.7 设置背景音乐的本地音量大小,即主播可以通过此接口设置主播自己本地的背景音乐的音量大小。
*
* @param id 音乐 ID
* @param volume 音量大小,100为正常音量,取值范围为0 - 100;默认值:100
*/
virtual void setMusicPlayoutVolume(int id, int volume) = 0;
/**
* 2.8 设置全局背景音乐的本地和远端音量的大小
*
* @param volume 音量大小,100为正常音量,取值范围为0 - 100;默认值:100
*/
virtual void setAllMusicVolume(int volume) = 0;
/**
* 2.9 调整背景音乐的音调高低
*
* @param id 音乐 ID
* @param pitch 音调,默认值是0.0f,范围是:[-1 ~ 1] 之间的浮点数;
*/
virtual void setMusicPitch(int id, float pitch) = 0;
/**
* 2.10 调整背景音乐的变速效果
*
* @param id 音乐 ID
* @param speedRate 速度,默认值是1.0f,范围是:[0.5 ~ 2] 之间的浮点数;
*/
virtual void setMusicSpeedRate(int id, float speedRate) = 0;
/**
* 2.11 获取背景音乐当前的播放进度(单位:毫秒)
*
* @param id 音乐 ID
* @return 成功返回当前播放时间,单位:毫秒,失败返回-1
*/
virtual long getMusicCurrentPosInMS(int id) = 0;
/**
* 2.12 设置背景音乐的播放进度(单位:毫秒)
*
* @note 请尽量避免频繁地调用该接口,因为该接口可能会再次读写音乐文件,耗时稍高。
* 当配合进度条使用时,请在进度条拖动完毕的回调中调用,而避免在拖动过程中实时调用。
*
* @param id 音乐 ID
* @param pts 单位: 毫秒
*/
virtual void seekMusicToPosInTime(int id, int pts) = 0;
/**
* 2.13 获取景音乐文件的总时长(单位:毫秒)
*
* @param path 音乐文件路径,如果 path 为空,那么返回当前正在播放的 music 时长。
* @return 成功返回时长,失败返回-1
*/
virtual long getMusicDurationInMS(char* path) = 0;
};
/// @}
class AudioMusicParam {
public:
/// 【字段含义】音乐 ID
/// 【特殊说明】SDK 允许播放多路音乐,因此需要音乐 ID 进行标记,用于控制音乐的开始、停止、音量等
int id;
/// 【字段含义】音乐文件的绝对路径
char* path;
/// 【字段含义】音乐循环播放的次数
/// 【推荐取值】取值范围为0 - 任意正整数,默认值:0。0表示播放音乐一次;1表示播放音乐两次;以此类推
int loopCount;
/// 【字段含义】是否将音乐传到远端
/// 【推荐取值】YES:音乐在本地播放的同时,会上行至云端,因此远端用户也能听到该音乐;NO:音乐不会上行至云端,因此只能在本地听到该音乐。默认值:NO
bool publish;
/// 【字段含义】播放的是否为短音乐文件
/// 【推荐取值】YES:需要重复播放的短音乐文件;NO:正常的音乐文件。默认值:NO
bool isShortFile;
/// 【字段含义】音乐开始播放时间点,单位毫秒
long startTimeMS;
/// 【字段含义】音乐结束播放时间点,单位毫秒,0表示播放至文件结尾。
long endTimeMS;
AudioMusicParam(int id_, char* path_) {
path = path_;
id = id_;
loopCount = 0;
publish = false;
isShortFile = false;
startTimeMS = 0;
endTimeMS = 0;
}
};
class ITXMusicPlayObserver {
public:
/// 背景音乐开始播放
virtual void onStart(int id,int errCode) = 0;
/// 背景音乐的播放进度
virtual void onPlayProgress(int id,long curPtsMS,long durationMS) = 0;
/// 背景音乐已播放完毕
virtual void onComplete(int id,int errCode) = 0;
};
enum TXVoiceReverbType
{
TXLiveVoiceReverbType_0 = 0, ///< 关闭混响
TXLiveVoiceReverbType_1 = 1, ///< KTV
TXLiveVoiceReverbType_2 = 2, ///< 小房间
TXLiveVoiceReverbType_3 = 3, ///< 大会堂
TXLiveVoiceReverbType_4 = 4, ///< 低沉
TXLiveVoiceReverbType_5 = 5, ///< 洪亮
TXLiveVoiceReverbType_6 = 6, ///< 磁性
};
/// @}
#endif /* __ITXAUDIOEFFECTMANAGER_H__ */
#ifndef _ILITEAV_LOCAL_RECORD_H_
#define _ILITEAV_LOCAL_RECORD_H_
/*
* Module: ILiteAVLocalRecord @ TXLiteAVSDK
*
* Function: 腾讯云本地录制功能的主要接口类.
*
* Note: 本地录制模块是启动一个单独进程来实现录制功能,依赖以下模块:
* - 录制进程 TXCloudRecord.exe.
* - 提供录制功能的 SDK(liteav.dll、TRAE.dll、LiteAvAudioHook.dll、LiteAvAudioHookService.dll).
* 以上模块必须放在同一个目录下.
*
* 创建/使用/销毁 ITXLiteAVLocalRecord 对象的示例代码:
* <pre>
* ITXLiteAVLocalRecord *pObject = getLocalRecordShareInstance();
* if(pObject)
* {
* pObject->startLocalRecord(...);
* }
* //--------------------------------------------------
* destroyLocalRecordShareInstance();
* pObject = NULL;
* </pre>
*/
#include "TXLiteAVBase.h"
/// @defgroup ITXLiteAVLocalRecord_cplusplus ITXLiteAVLocalRecord
/// 腾讯云本地录制功能的主要接口类
/// @{
class ITXLiteAVLocalRecord;
extern "C" {
/// @name 创建与销毁 ITXLiteAVLocalRecord 单例
/// @{
/**
* 用于动态加载 dll 时,导出 ITXLiteAVLocalRecord C++ 单例对象指针。
*
* @return ITXLiteAVLocalRecord 对象指针,注意:delete ITXLiteAVLocalRecord 会编译错误,需要调用 destroyTXLiteLocalRecord 释放。
*/
LITEAV_API ITXLiteAVLocalRecord* getLocalRecordShareInstance();
/**
* 析构 ITXLiteAVLocalRecord 单例对象
*/
LITEAV_API void destroyLocalRecordShareInstance();
/// @}
}
/**
* 本地录制错误码
*/
enum TXLiteAVLocalRecordError
{
ERR_RECORD_SUCCESS = 0, ///< 启动录制成功回调。
ERR_RECORD_PARAM_INVALID = -1, ///< 启动录制失败,非法参数。
ERR_START_RECORD_EXE_FAULURE = -2, ///< 启动录制失败,录制进程拉起失败。
ERR_CREATE_RECORD_FILE_FAILURE = -3, ///< 启动录制失败,录制文件创建失败。
ERR_RECORD_CANCEL_BY_EXCEPTION = -4, ///< 录制过程中被动关闭,录制进程异常。
};
/**
* 本地录制事件回调接口
*/
class TXLiteAVLocalRecordCallback
{
public:
/**
* 本地录制错误
*
* @param err 录制错误,参考 TXLiteAVLocalRecordError 定义。
* @param msg 错误信息。
*/
virtual void OnRecordError (TXLiteAVLocalRecordError err, const char* msg) = 0;
/**
* 本地录制结果回调
*
* @param path 成功录制文件全路径。
*/
virtual void OnRecordComplete (const char* path) = 0;
/**
* 录制进度回调
*
* @param duration 当前录制文件的时长,单位( MS )。
* @param fileSize 当前录制文件的大小,单位( Byte )。
* @param width 当前录制文件的宽,单位( px )。
* @param height 当前录制文件的高,单位( px )。
*/
virtual void OnRecordProgress(int duration,int fileSize, int width, int height) = 0;
};
class ITXLiteAVLocalRecord
{
protected:
virtual ~ITXLiteAVLocalRecord() {};
public:
/**
* 注册本地录制事件回调接口
*
* @param callback 回调指针。
*/
virtual void setCallback(TXLiteAVLocalRecordCallback * callback) = 0;
/**
* 启动本地录制
*
* 视频源支持如下四种录制内容情况:
* - 录制整个屏幕:source 中 type 为 Screen 的 source,captureRect 设为 { 0, 0, 0, 0 }
* - 录制指定区域:source 中 type 为 Screen 的 source,captureRect 设为非 NULL,例如 { 100, 100, 300, 300 }
* - 录制整个窗口:source 中 type 为 Window 的 source,captureRect 设为 { 0, 0, 0, 0 }
* - 录制窗口区域:source 中 type 为 Window 的 source,captureRect 设为非 NULL,例如 { 100, 100, 300, 300 }
* - 如果 captureRect 取值超出录制屏幕或窗口边界,会被默认设为 { 0, 0, 0, 0 }
*
* 视频源可以通过两种方式获取:
* - 从 SDK API 获取,ITXLivePusher 提供的 getScreenCaptureSources API 获取可录制的窗口、屏幕列表。
* - 从 系统 API 获取,获取需要录制的窗口、屏幕,并构造 LiteAVScreenCaptureSourceInfo 录制信息结构并填写 type、sourceId两个字段。
*
* <pre>
* //从 SDK API 获取录制内容示例代码
* ITXLivePusher *livePusher = createTXLivePusher();
* ILiteAVScreenCaptureSourceList* wndInfoList = livePusher->getScreenCaptureSources(SIZE{ 120, 70 }, SIZE{ 20,20 });
* LiteAVScreenCaptureSourceInfo selectSource;
* for (size_t i = 0; i < wndInfoList->getCount(); ++i)
* {
* selectSource = wndInfoList->getSourceInfo(i);
* }
* ITXLiteAVLocalRecord * pRecorder = getLocalRecordShareInstance();
* pRecorder->startLocalRecord(selectSource....);
* </pre>
*
* 音频源是录制麦克风声音+系统播放的声音。
*
* @param source 指定录制内容,参考 LiteAVScreenCaptureSourceInfo 定义。
* @param captureRect 指定录制目标区域。
* @param szRecordPath 录制文件的全路径,只支持 .mp4 格式( eg:E:\tencent\test.mp4 )。
*/
virtual void startLocalRecord(const LiteAVScreenCaptureSourceInfo &source, const RECT& captureRect, const char* szRecordPath) = 0;
/**
* 停止本地录制
*/
virtual void stopLocalRecord() = 0;
/**
* 暂停本地录制
*/
virtual void pauseLocalRecord() = 0;
/**
* 唤醒本地录制
*/
virtual void resumeLocalRecord() = 0;
};
/// @}
#endif //_ILITEAV_LOCAL_RECORD_H_
#ifndef __ITXLITEAVNETWORKPROXY_H__
#define __ITXLITEAVNETWORKPROXY_H__
#include "TXLiteAVBase.h"
class ITXNetworkProxy;
extern "C" {
/**
* 用于动态加载dll时,导出TXNetworkProxy C++对象。
*
* @return TXNetworkProxy对象指针,注意:delete ITXNetworkProxy*会编译错误,需要调用destroyTXNetworkProxy释放。
*/
LITEAV_API ITXNetworkProxy* createTXNetworkProxy();
/**
* 析构ITXNetworkProxy对象
*
* @param pTXNetworkProxy 传入需要释放的对象指针地址
*/
LITEAV_API void destroyTXNetworkProxy(ITXNetworkProxy** pTXNetworkProxy);
}
class ITXNetworkProxy
{
protected:
virtual ~ITXNetworkProxy() {};
public:
/////////////////////////////////////////////////////////////////////////////////
//
// SDK 代理功能接口
//
/////////////////////////////////////////////////////////////////////////////////
/*
* TRTCCloud 代理设置
*
* socks5 代理模式,设置 socks5 tcp/udp 代理服务器 ip 和 port。
* 设置此接口后,在内网环境可以正常使用进房、发布本地音视频、订阅远端音视频、退房等功能
* 细节请参考TRTC 代理方案<http://trtc-1252463788.file.myqcloud.com/proxy/proxy_server_deploy.zip>
*
* @param host 代理服务器的 ip 地址或者域名地址
* @param port 代理服务器的端口
*
* @return 设置成功返回0,域名解释失败或者ip非法返回-1。
* @note 本接口有以下限制:
* - 设置完,请 destroy TRTCCloud 重新获取 TRTC 对象
* - 如果你只是用 TRTCCloud,则只需要设置Sock5代理接口。
*/
virtual int setSocks5Proxy(const char * host, unsigned short port, const char * username, const char * password) = 0;
/*
* TXLivePusher/TXLivePlayer 代理设置
*
* nat端口转发代理模式,设置NAT端口转发代理服务器的 ip 和 port,
*
* ITXLivePusher/ITXLivePlayer 使用此代理模式进行穿透内网;如果仅使用 ITRTCCloud ,不需要设置此接口。
*
* @param ip 代理服务器的 ip 地址
* @param port 代理服务器的端口
*
* @note 本接口有以下限制:
* - 此接口必须在 createTXLivePlayer/createTXLivePusher 之前调用,以确保内部所有数据都走代理服务器。
* - 如果你只是用直播 SDK 的功能,则只需要设置NAT代理接口。
*/
virtual void setNATProxy(const char * ip, unsigned short port) = 0;
};
#endif //__ITXLITEAVNETWORKPROXY_H__
#ifndef __ITXLIVEPLAYER_H__
#define __ITXLIVEPLAYER_H__
/*
* Module: ITXLivePlayer @ TXLiteAVSDK
*
* Function: 直播拉流功能的主要接口类
*
* 创建/使用/销毁ITXLivePlayer对象的示例代码:
*
* <pre>
* ITXLivePlayer *livePlayer = createTXLivePlayer();
* if(livePlayer)
* {
* int nDevice = livePlayer->speakerDeviceCount();
* }
* destroyTXLivePlayer(&livePlayer);
* livePlayer = NULL;
* </pre>
*/
#include "TXLiveTypeDef.h"
#include "TXLiteAVBase.h"
#include <Windows.h>
#include <memory>
#define SPEAKER_DEVICE_NAME_MAX_SIZE (512)
class ITXLivePlayerCallback;
class ITXLivePlayer;
extern "C" {
/**
* \brief 用于动态加载dll时,导出TXLivePlayer C++对象。
*
* \return TXLivePlayer对象指针,注意:delete ITXLivePlayer*会编译错误,需要调用destroyTXLivePlayer释放。
*/
LITEAV_API ITXLivePlayer* createTXLivePlayer();
/**
* \brief 析构ITXLivePlayer对象
*/
LITEAV_API void destroyTXLivePlayer(ITXLivePlayer** pTXlivePlayer);
}
class ITXLivePlayer
{
protected:
virtual ~ITXLivePlayer() {};
public:
/**
* \brief:设置回调 TXLivePlayer 的回调代理,监听播放事件
* \param:callback - ITXLivePlayerCallback 类型的代理指针
* \param:pUserData - 透传用户数据到 ITXLivePusherCallback 的回调函数,一般情况下传 NULL 就可以了
* \return 无
*/
virtual void setCallback(ITXLivePlayerCallback *callback, void *pUserData) = 0;
/**
* \brief 查询扬声器设备列表
*
* 示例代码:
* <pre>
* ITRTCDeviceCollection * pDevice = m_pCloud->getSpeakerDevicesList();
* for (int i = 0; i < pDevice->getCount(); i++) {
* std::wstring name = UTF82Wide(pDevice->getDeviceName(i));
* }
* pDevice->release();
* pDevice = null;
* </pre>
*
* \note 如果delete ITRTCDeviceCollection*指针会编译错误,SDK维护ITRTCDeviceCollection对象的生命周期。
* \return 扬声器管理器对象指针 ITRTCDeviceCollection*
*/
virtual ILiteAVDeviceCollection* getSpeakerDevicesList() = 0;
/**
* \brief:选择指定的扬声器作为音频播放的设备,不调用该接口时,默认选择索引为0的扬声器
* \param:index - 扬声器设备的索引,要求index值小于 speakerDeviceCount 接口的返回值
*/
virtual void selectSpeakerDevice(unsigned int index) = 0;
/**
* \brief:查询SDK播放的音量,注意查询得到不是系统扬声器的音量大小
* \return:音量值,范围是[0, 65535]
*/
virtual unsigned int speakerVolume() = 0;
/**
* \brief:设置SDK播放的音量,注意设置的不是系统扬声器的音量大小
* \param:volume - 设置的音量大小,范围是[0, 65535]
*/
virtual void setSpeakerVolume(unsigned int volume) = 0;
/**
* \brief:查询已选择扬声器的能量值,指示音量的大小
* \return:能量值,范围是[0, 100]
*/
virtual uint32_t speakerVolumeIndication() = 0;
/**
* \brief: 设置 SDK 采集音量。
* @param volume 音量大小,取值[0, 65535],默认值为65535
*/
virtual void setAudioPlayoutVolume(int volume) = 0;
/**
* \brief: 获取 SDK 采集音量
*/
virtual int getAudioPlayoutVolume() = 0;
/**
* \brief:设置视频图像渲染
* \param:rendHwnd - 承载预览画面的 HWND,目前 SDK 内部会向 rendHwnd (整个窗口)上绘制图像的
* \return:无
*/
virtual void setRenderFrame(HWND rendHwnd) = 0;
/**
* \brief:重设图像渲染窗口
* \param:rendHwnd - 承载预览画面的 HWND,目前 SDK 内部会向 rendHwnd (整个窗口)上绘制图像的
* \return:无
*/
virtual void updateRenderFrame(HWND rendHwnd) = 0;
/**
* \brief:关闭图像渲染
*/
virtual void closeRenderFrame() = 0;
/**
* \brief:开始播放,请在 startPlay 之前 setRenderFrame
* \param:url - 视频播放 URL
* \param:type - 播放类型,参考 TXLiveTypeDef.h 中定义的 TXEPlayType 枚举值
* \return:无
*/
virtual void startPlay(const char * url, TXEPlayType type) = 0;
/**
* \brief:停止播放
*/
virtual void stopPlay() = 0;
/**
* \brief:暂停播放
*/
virtual void pause() = 0;
/**
* \brief:恢复播放
*/
virtual void resume() = 0;
/**
* \brief:是否正在播放
*/
virtual bool isPlaying() = 0;
/**
* \brief:静音接口
* \param:mute - 是否静音
* \return:无
*/
virtual void setMute(bool mute) = 0;
/**
* \brief:设置图像的渲染(填充)模式
* \param:mode - 参考 TXLiveTypeDef.h 中定义的 TXERenderMode 枚举值
* \return:无
*/
virtual void setRenderMode(TXERenderMode mode) = 0;
/**
* \brief:设置图像的顺时针旋转角度
* \param:rotation - 参考 TXLiveTypeDef.h 中定义的 TXEVideoRotationType 枚举值
* \return:无
*/
virtual void setRotation(TXEVideoRotationType rotation) = 0;
/**
* \brief:设置渲染的镜像效果
* \param:mirror - true表示画面左右反转,false表示保持原样
* \return:无
*/
virtual void setRenderYMirror(bool mirror) = 0;
/**
* \brief:设置视频编码格式,默认格式是TXE_OUTPUT_VIDEO_WITHOUT_OUTPUT
* \param:format - 视频编码格式,参考 TXLiveTypeDef.h 中定义的 TXEOutputVideoFormat 枚举值
* \return:无
* \note:自定义渲染必须设置输出格式。
*/
virtual void setOutputVideoFormat(TXEOutputVideoFormat format) = 0;
/**
* \brief:是否开启消息通道, 默认值为 false
* \param:enableMessage - true:开启,false:关闭
*/
///
virtual void setEnableMessage(bool enableMessage) = 0;
/**
* \brief:截图当前拉流的图像到本地,
* \param:filePath - 存储路径,UTF-8编码。
* \param: length - 路径大小
* \return:0成功,非0失败
* \errorRet: -1:失败,-2路径非法,-3文件存在,-4未拉流
*/
virtual int captureVideoSnapShot(const wchar_t * filePath, unsigned int length) = 0;
/**
* \brief:设置播放选项
*
* 缓冲区时长是较为常用的设置项,播放缓冲区的作用是为了抵抗网络波动导致的音视频卡顿。
* 缓冲区时长越大,视频播放的卡顿率越低,观众跟主播之间的时延也就越高。
* 缓冲区时长越小,视频播放的卡顿率越高,观众跟主播之间的时延也就越低。
*
* \note 缓冲区时长不等于观众跟主播之间的时延,一般而言,时延要比缓冲区时长大1-2秒,这取决于 CDN 的质量。
* 如果主播采用的是 OBS 等直播软件,那么时延还会更高一些,因为 OBS 本身会有1秒以上的推流时延。
*
* \param:jsonParam - 属性信息,UTF-8编码。
*
* <pre>
* 1. AutoAdjustCacheTime | bool | 设置是否自动调整缓存时间, 默认值:true。
* - true:启用自动调整,SDK 将根据网络状况在一个范围内调整缓冲区时长,网络越好,缓冲越短,时延越小,调整范围为:[MinAutoAdjustCacheTime - MaxAutoAdjustCacheTime]。
* - false:关闭自动调整,SDK 将固定使用默认的播放缓冲区时长,也就是 “CacheTime” 所设置的值。
*
* 2. CacheTime | float | 默认的播放缓存时长,单位秒,取值需要大于0.2,默认值:5。
*
* 3. MaxAutoAdjustCacheTime | float | 播放器最大缓冲时间,单位秒,取值需要大于0.2,默认值:5,含义:播放器的最大播放延迟大约为 5+1=6 秒(CDN会引入约1秒延迟)。
*
* 4. MinAutoAdjustCacheTime | float | 播放器最小缓冲时间,单位秒,取值需要大于0.2,默认值:1,含义:播放器的最小播放延迟大约为 1+1=2 秒(CDN会引入约1秒延迟)。
*
* 5. VideoBlockThreshold | int | 播放器视频卡顿报警阈值,单位毫秒,默认值为800毫秒,含义:视频卡顿超过 800 毫秒,ITXLivePlayerCallback 会通知 PLAY_WARNING_VIDEO_PLAY_LAG。
*
* 6. ConnectRetryCount | int | 拉流网络断开重连次数,默认值为3。
*
* 7. ConnectRetryInterval | int | 拉流网络断开重连时间间隔,单位秒,默认值为3。
*
* 示例:
* setLivePlayAttribute("{\"AutoAdjustCacheTime\":true, \"MinAutoAdjustCacheTime\": 2.0, \"MaxAutoAdjustCacheTime\": 5.0}");
* 含义:
* 设置播放缓冲区根据网络自动调整,调整范围为2-5秒,观众与主播之间的延迟约为3-6秒(如果主播使用 OBS 推流则为4-7秒),网络越差,延迟越大。
* </pre>
*/
virtual void setLivePlayAttribute(const char *jsonParam) = 0;
};
#endif //__ITXLIVEPLAYER_H__
\ No newline at end of file
/*
* Module: TRTC 关键类型定义
*
* Function: 分辨率、质量等级等枚举和常量值的定义
*
*/
#ifndef __TRTCCLOUDDEF_H__
#define __TRTCCLOUDDEF_H__
#ifdef _WIN32
//防止windows用户引用 TRTCCloudDef.h 报错
#include "TRTCTypeDef.h"
#endif
#endif /* __TRTCCLOUDDEF_H__ */
/*
* Module: TRTC 统计信息定义
*
* Function: 通话质量相关的定义
*
*/
#ifndef __TRTCSTATISTICS_H__
#define __TRTCSTATISTICS_H__
#ifdef _WIN32
//防止windows用户引用 TRTCStatistics.h 报错
#include "ITRTCStatistics.h"
#endif
#endif /* __TRTCSTATISTICS_H__ */
/**
* Module: TXLiteAVBase @ liteav
*
* Function: SDK 公共定义头文件
*
*/
#ifndef __TXLITEAVBASE_H__
#define __TXLITEAVBASE_H__
#ifdef _WIN32
//防止windows用户引用TXLiteAVBase.h报错
#include "TRTCTypeDef.h"
#endif
#ifdef LITEAV_EXPORTS
#define LITEAV_API __declspec(dllexport)
#else
#define LITEAV_API __declspec(dllimport)
#endif
extern "C" {
/// @name SDK 导出基础功能接口
/// @{
/**
* \brief 获取 SDK 版本号
*
* \return 返回 UTF-8 编码的版本号。
*/
LITEAV_API const char* getLiteAvSDKVersion();
/**
* 设置 liteav SDK 接入的环境。
* 腾讯云在全球各地区部署的环境,按照各地区政策法规要求,需要接入不同地区接入点。
*
* @param env_config 需要接入的环境,SDK 默认接入的环境是:默认正式环境。
* @return 0:成功;其他:错误
* @note 目标市场为中国大陆的客户请不要调用此接口,如果目标市场为海外用户,请通过技术支持联系我们,了解 env_config 的配置方法,以确保 App 遵守 GDPR 标准。
*/
LITEAV_API int setGlobalEnv(const char* env_config);
/// @}
}
/**
* 以下定义仅用于兼容原有接口,具体定义参见 TRTCTypeDef.h 文件
*/
typedef TRTCVideoBufferType LiteAVVideoBufferType;
#define LiteAVVideoBufferType_Unknown TRTCVideoBufferType_Unknown
#define LiteAVVideoBufferType_Buffer TRTCVideoBufferType_Buffer
#define LiteAVVideoBufferType_Texture TRTCVideoBufferType_Texture
typedef TRTCVideoPixelFormat LiteAVVideoPixelFormat;
#define LiteAVVideoPixelFormat_Unknown TRTCVideoPixelFormat_Unknown
#define LiteAVVideoPixelFormat_I420 TRTCVideoPixelFormat_I420
#define LiteAVVideoPixelFormat_Texture_2D TRTCVideoPixelFormat_Texture_2D
#define LiteAVVideoPixelFormat_BGRA32 TRTCVideoPixelFormat_BGRA32
#define LiteAVVideoPixelFormat_RGBA32 TRTCVideoPixelFormat_RGBA32
typedef TRTCAudioFrameFormat LiteAVAudioFrameFormat;
#define LiteAVAudioFrameFormatNone TRTCAudioFrameFormatNone
#define LiteAVAudioFrameFormatPCM TRTCAudioFrameFormatPCM
typedef TRTCVideoRotation LiteAVVideoRotation;
#define LiteAVVideoRotation0 TRTCVideoRotation0
#define LiteAVVideoRotation90 TRTCVideoRotation90
#define LiteAVVideoRotation180 TRTCVideoRotation180
#define LiteAVVideoRotation270 TRTCVideoRotation270
typedef TRTCVideoFrame LiteAVVideoFrame;
typedef TRTCAudioFrame LiteAVAudioFrame;
typedef TRTCScreenCaptureSourceType LiteAVScreenCaptureSourceType;
#define LiteAVScreenCaptureSourceTypeUnknown TRTCScreenCaptureSourceTypeUnknown
#define LiteAVScreenCaptureSourceTypeWindow TRTCScreenCaptureSourceTypeWindow
#define LiteAVScreenCaptureSourceTypeScreen TRTCScreenCaptureSourceTypeScreen
#define LiteAVScreenCaptureSourceTypeCustom TRTCScreenCaptureSourceTypeCustom
typedef TRTCImageBuffer LiteAVImageBuffer;
typedef TRTCScreenCaptureSourceInfo LiteAVScreenCaptureSourceInfo;
typedef ITRTCScreenCaptureSourceList ILiteAVScreenCaptureSourceList;
typedef TRTCScreenCaptureProperty LiteAVScreenCaptureProperty;
typedef ITRTCDeviceInfo ILiteAVDeviceInfo;
typedef ITRTCDeviceCollection ILiteAVDeviceCollection;
#endif /* __TXLITEAVBASE_H__ */
#ifndef __ITXVODPLAYER_H__
#define __ITXVODPLAYER_H__
/*
* Module: ITXVodPlayer @ TXLiteAVSDK
*
* Function: 腾讯云视频通话播片功能的主要接口类
*
* 创建/使用/销毁ITXVodPlayer对象的示例代码:
* <pre>
* ITXVodPlayer *vodPlayer = createTXVodPlayer("D:/video/test.mp4");
* if(vodPlayer)
* {
* vodPlayer->start();
* }
* ----------------------------------
* destroyTXVodPlayer(&vodPlayer);
* vodPlayer = NULL;
* </pre>
*/
#include "TXLiteAVBase.h"
#include <memory>
class ITXVodPlayerEventCallback;
class ITXVodPlayerDataCallback;
class ITXVodPlayer;
extern "C" {
/**
* \brief 用于动态加载dll时,导出TXVodPlayer C++对象。
*
* \return ITXVodPlayer对象指针,注意:delete ITXVodPlayer*会编译错误,需要调用destroyTXVodPlayer释放。
*/
LITEAV_API ITXVodPlayer* createTXVodPlayer(const char *mediaFile, bool repeat = false);
/**
* \brief 析构ITXVodPlayer对象
*/
LITEAV_API void destroyTXVodPlayer(ITXVodPlayer** pTXVodPlayer);
}
class ITXVodPlayer
{
protected:
virtual ~ITXVodPlayer() {};
public:
/**
* 绑定 TRTC SDK
* param trtcCloud TRTC 实例指针
* note 用于辅流推送,绑定后音频播放由TRTC接管
*/
virtual void attachTRTC(void* trtcCloud) = 0;
/**
* 解绑TRTC SDK
*/
virtual void detachTRTC() = 0;
/**
* 开始向TRTC发布辅路视频流
*/
virtual void publishVideo() = 0;
/**
* 开始向TRTC发布辅路音频流
*/
virtual void publishAudio() = 0;
/**
* 结束向TRTC发布辅路视频流
*/
virtual void unpublishVideo() = 0;
/**
* 结束向TRTC发布辅路音频流
*/
virtual void unpublishAudio() = 0;
/**
* 设置多媒体事件回调
* param callback 要使用的多媒体文件播放回调接收实例
*/
virtual void setEventCallback(ITXVodPlayerEventCallback* callback) = 0;
/**
* 设置多媒体文件播放回调
* param callback 要使用的多媒体文件播放回调接收实例
*/
virtual void setDataCallback(ITXVodPlayerDataCallback* callback) = 0;
/**
* 开始多媒体文件播放
* 支持的视频格式包括:mp4、avi、mkv、wmv、m4v。
* 支持的音频格式包括:mp3、wav、wma、aac。
*/
virtual void start() = 0;
/**
* 暂停多媒体文件播放
*/
virtual void pause() = 0;
/**
* 恢复多媒体文件播放
*/
virtual void resume() = 0;
/**
* 停止多媒体文件播放
*/
virtual void stop() = 0;
/**
* 设置多媒体文件播放进度
* param msPos 播放进度(单位毫秒)
*/
virtual void seek(uint64_t msPos) = 0;
/**
* 设置多媒体文件播放速度
* param rate 播放速度(0.5-2.0)
*/
virtual void setRate(float rate) = 0;
/**
* 设置播放渲染句柄
* param hwnd 窗口句柄
*/
virtual void setView(HWND hwnd) = 0;
/**
* 获取多媒体文件总时长
*/
virtual long getDuration() = 0;
/**
* 获取视频宽度
*/
virtual int getWidth() = 0;
/**
* 获取视频高度
*/
virtual int getHeight() = 0;
/**
* 设置多媒体音量
* param volume 音量大小,100为原始音量,范围是:[0 ~ 150],默认值为100
*/
virtual void setVolume(int volume) = 0;
/**
* 静音/取消静音
* param mute true:静音;false:取消静音
*/
virtual void mute(bool mute) = 0;
/**
* \brief 设置本地图像的顺时针旋转角度
* \param rotation 支持 TRTCVideoRotation90 、 TRTCVideoRotation180 以及 TRTCVideoRotation270
* 旋转角度,默认值:TRTCVideoRotation0
* \note 用于窗口渲染模式
*/
virtual void setRenderRotation(TRTCVideoRotation rotation) = 0;
/**
* 设置本地图像的填充模式
* param mode
* 填充(画面可能会被拉伸裁剪)或适应(画面可能会有黑边),默认值:TRTCVideoFillMode_Fit
* note 用于窗口渲染模式
*/
virtual void setFillMode(TRTCVideoFillMode mode) = 0;
/**
* 设置本地图像的镜像模式
* param mirror 镜像模式,默认值:false(非镜像模式)
* note 用于窗口渲染模式
*/
virtual void setMirror(bool mirror) = 0;
};
enum TXVodPlayerError
{
TXVodPlayerErrorFileNotExist,
TXVodPlayerErrorFormatNotSupport,
TXVodPlayerErrorOpenfailed
};
class ITXVodPlayerDataCallback {
public:
virtual ~ITXVodPlayerDataCallback(){};
/**
* Vod视频帧回调
* param frame 视频帧数据
*/
virtual int onVodVideoFrame(TRTCVideoFrame& frame) = 0;
/**
* Vod音频帧回调
* param frame 音频帧数据
*/
virtual int onVodAudioFrame(TRTCAudioFrame& frame) = 0;
};
class ITXVodPlayerEventCallback {
public:
virtual ~ITXVodPlayerEventCallback(){};
/**
* 当多媒体文件播放开始时,SDK会通过此回调通知
*
* param msLength 多媒体文件总长度,单位毫秒
*/
virtual void onVodPlayerStarted(uint64_t msLength) {}
/**
* 当多媒体文件播放进度改变时,SDK会通过此回调通知
*
* param msPos 多媒体文件播放进度,单位毫秒
*/
virtual void onVodPlayerProgress(uint64_t msPos) {}
/**
* 当多媒体文件播放暂停时,SDK会通过此回调通知
*/
virtual void onVodPlayerPaused() {};
/**
* 当多媒体文件播放恢复时,SDK会通过此回调通知
*/
virtual void onVodPlayerResumed() {};
/**
* 当多媒体文件播放停止时,SDK会通过此回调通知
*
* param reason 停止原因,0表示用户主动停止,1表示文件播放完,2表示视频断流
*/
virtual void onVodPlayerStoped(int reason) {};
/**
* 当多媒体文件播放出错时,SDK会通过此回调通知
*
* param error 错误码
*/
virtual void onVodPlayerError(int error) = 0;
};
#endif //__ITXVODPLAYER_H__
\ No newline at end of file
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment