mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-27 04:22:20 +08:00
整理代码
This commit is contained in:
@@ -33,18 +33,6 @@ using namespace toolkit;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
const char PlayerBase::kNetAdapter[] = "net_adapter";
|
||||
const char PlayerBase::kRtpType[] = "rtp_type";
|
||||
const char PlayerBase::kRtspUser[] = "rtsp_user" ;
|
||||
const char PlayerBase::kRtspPwd[] = "rtsp_pwd";
|
||||
const char PlayerBase::kRtspPwdIsMD5[] = "rtsp_pwd_md5";
|
||||
|
||||
const char PlayerBase::kPlayTimeoutMS[] = "play_timeout_ms";
|
||||
const char PlayerBase::kMediaTimeoutMS[] = "media_timeout_ms";
|
||||
const char PlayerBase::kBeatIntervalMS[] = "beat_interval_ms";
|
||||
const char PlayerBase::kMaxAnalysisMS[] = "max_analysis_ms";
|
||||
|
||||
|
||||
PlayerBase::Ptr PlayerBase::createPlayer(const string &strUrl) {
|
||||
static auto releasePlayer = [](PlayerBase *ptr){
|
||||
onceToken token(nullptr,[&](){
|
||||
@@ -63,7 +51,7 @@ PlayerBase::Ptr PlayerBase::createPlayer(const string &strUrl) {
|
||||
}
|
||||
|
||||
PlayerBase::PlayerBase() {
|
||||
this->mINI::operator[](kPlayTimeoutMS) = 10000;
|
||||
this->mINI::operator[](kTimeoutMS) = 10000;
|
||||
this->mINI::operator[](kMediaTimeoutMS) = 5000;
|
||||
this->mINI::operator[](kBeatIntervalMS) = 5000;
|
||||
this->mINI::operator[](kMaxAnalysisMS) = 2000;
|
||||
|
||||
@@ -88,27 +88,6 @@ public:
|
||||
typedef std::shared_ptr<PlayerBase> Ptr;
|
||||
static Ptr createPlayer(const string &strUrl);
|
||||
|
||||
//指定网卡ip
|
||||
static const char kNetAdapter[];
|
||||
//设置rtp传输类型,可选项有0(tcp,默认)、1(udp)、2(组播)
|
||||
//设置方法:player[PlayerBase::kRtpType] = 0/1/2;
|
||||
static const char kRtpType[];
|
||||
//rtsp认证用户名
|
||||
static const char kRtspUser[];
|
||||
//rtsp认证用用户密码,可以是明文也可以是md5,md5密码生成方式 md5(username:realm:password)
|
||||
static const char kRtspPwd[];
|
||||
//rtsp认证用用户密码是否为md5类型
|
||||
static const char kRtspPwdIsMD5[];
|
||||
//播放超时时间,默认10,000 毫秒
|
||||
static const char kPlayTimeoutMS[];
|
||||
//rtp/rtmp包接收超时时间,默认5000秒
|
||||
static const char kMediaTimeoutMS[];
|
||||
//rtsp/rtmp心跳时间,默认5000毫秒
|
||||
static const char kBeatIntervalMS[];
|
||||
//Track编码格式探测最大时间,单位毫秒,默认2000
|
||||
static const char kMaxAnalysisMS[];
|
||||
|
||||
|
||||
PlayerBase();
|
||||
virtual ~PlayerBase(){}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user