mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
添加配置项:是否直接rtsp拉流代理
This commit is contained in:
parent
d71f1dd293
commit
9c0fb9e676
@ -161,11 +161,13 @@ namespace Rtsp {
|
|||||||
const string kAuthBasic = RTSP_FIELD"authBasic";
|
const string kAuthBasic = RTSP_FIELD"authBasic";
|
||||||
const string kHandshakeSecond = RTSP_FIELD"handshakeSecond";
|
const string kHandshakeSecond = RTSP_FIELD"handshakeSecond";
|
||||||
const string kKeepAliveSecond = RTSP_FIELD"keepAliveSecond";
|
const string kKeepAliveSecond = RTSP_FIELD"keepAliveSecond";
|
||||||
|
const string kDirectProxy = RTSP_FIELD"directProxy";;
|
||||||
onceToken token([](){
|
onceToken token([](){
|
||||||
//默认Md5方式认证
|
//默认Md5方式认证
|
||||||
mINI::Instance()[kAuthBasic] = 0;
|
mINI::Instance()[kAuthBasic] = 0;
|
||||||
mINI::Instance()[kHandshakeSecond] = 15;
|
mINI::Instance()[kHandshakeSecond] = 15;
|
||||||
mINI::Instance()[kKeepAliveSecond] = 15;
|
mINI::Instance()[kKeepAliveSecond] = 15;
|
||||||
|
mINI::Instance()[kDirectProxy] = 1;
|
||||||
},nullptr);
|
},nullptr);
|
||||||
|
|
||||||
} //namespace Rtsp
|
} //namespace Rtsp
|
||||||
|
@ -202,6 +202,13 @@ extern const string kAuthBasic;
|
|||||||
extern const string kHandshakeSecond;
|
extern const string kHandshakeSecond;
|
||||||
//维持链接超时时间,默认15秒
|
//维持链接超时时间,默认15秒
|
||||||
extern const string kKeepAliveSecond;
|
extern const string kKeepAliveSecond;
|
||||||
|
|
||||||
|
//rtsp拉流代理是否直接代理
|
||||||
|
//直接代理后支持任意编码格式,但是会导致GOP缓存无法定位到I帧,可能会导致花屏
|
||||||
|
//并且如果是tcp方式拉流,如果rtp大于mtu会导致无法使用udp方式代理
|
||||||
|
//假定您的拉流源地址不是264或265或AAC,那么你可以使用直接代理的方式来支持rtsp代理
|
||||||
|
//默认开启rtsp直接代理,rtmp由于没有这些问题,是强制开启直接代理的
|
||||||
|
extern const string kDirectProxy;
|
||||||
} //namespace Rtsp
|
} //namespace Rtsp
|
||||||
|
|
||||||
////////////RTMP服务器配置///////////
|
////////////RTMP服务器配置///////////
|
||||||
|
@ -130,7 +130,10 @@ void PlayerProxy::play(const string &strUrlTmp) {
|
|||||||
MediaSource::Ptr mediaSource;
|
MediaSource::Ptr mediaSource;
|
||||||
if(dynamic_pointer_cast<RtspPlayer>(_parser)){
|
if(dynamic_pointer_cast<RtspPlayer>(_parser)){
|
||||||
//rtsp拉流
|
//rtsp拉流
|
||||||
|
GET_CONFIG(bool,directProxy,Rtsp::kDirectProxy);
|
||||||
|
if(directProxy){
|
||||||
mediaSource = std::make_shared<RtspMediaSource>(_strVhost,_strApp,_strSrc);
|
mediaSource = std::make_shared<RtspMediaSource>(_strVhost,_strApp,_strSrc);
|
||||||
|
}
|
||||||
}else if(dynamic_pointer_cast<RtmpPlayer>(_parser)){
|
}else if(dynamic_pointer_cast<RtmpPlayer>(_parser)){
|
||||||
//rtmp拉流
|
//rtmp拉流
|
||||||
mediaSource = std::make_shared<RtmpMediaSource>(_strVhost,_strApp,_strSrc);
|
mediaSource = std::make_shared<RtmpMediaSource>(_strVhost,_strApp,_strSrc);
|
||||||
|
Loading…
Reference in New Issue
Block a user