mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-24 01:42:22 +08:00
添加配置项ultraLowDelay,可选择是否低延时模式
This commit is contained in:
@@ -11,8 +11,6 @@ using namespace mediakit::Client;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
|
||||
|
||||
RtspPusher::RtspPusher(const EventPoller::Ptr &poller,const RtspMediaSource::Ptr &src) : TcpClient(poller){
|
||||
_pMediaSrc = src;
|
||||
}
|
||||
@@ -392,13 +390,21 @@ void RtspPusher::sendRecord() {
|
||||
},getPoller()));
|
||||
}
|
||||
onPublishResult(SockException(Err_success,"success"));
|
||||
//提高发送性能
|
||||
(*this) << SocketFlags(kSockFlags);
|
||||
SockUtil::setNoDelay(_sock->rawFD(),false);
|
||||
//提升发送性能
|
||||
setSocketFlags();
|
||||
};
|
||||
sendRtspRequest("RECORD",_strContentBase,{"Range","npt=0.000-"});
|
||||
}
|
||||
|
||||
void RtspPusher::setSocketFlags(){
|
||||
GET_CONFIG(bool,ultraLowDelay,General::kUltraLowDelay);
|
||||
if(!ultraLowDelay) {
|
||||
//提高发送性能
|
||||
(*this) << SocketFlags(SOCKET_DEFAULE_FLAGS | FLAG_MORE);
|
||||
SockUtil::setNoDelay(_sock->rawFD(), false);
|
||||
}
|
||||
}
|
||||
|
||||
void RtspPusher::sendRtspRequest(const string &cmd, const string &url, const std::initializer_list<string> &header,const string &sdp ) {
|
||||
string key;
|
||||
StrCaseMap header_map;
|
||||
|
||||
Reference in New Issue
Block a user