mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-23 09:22:21 +08:00
添加rtp pause接口,目前默认3分钟
This commit is contained in:
@@ -180,6 +180,15 @@ void RtpProcess::addTrack(const Track::Ptr & track){
|
||||
}
|
||||
|
||||
bool RtpProcess::alive() {
|
||||
if(_paused) {
|
||||
if(_pause_rtp_time.elapsedTime()/ 1000 < 180){
|
||||
return true;
|
||||
}else {
|
||||
WarnL << _media_info._streamid << ", pause timeout.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
GET_CONFIG(int,timeoutSec,RtpProxy::kTimeoutSec)
|
||||
if(_last_rtp_time.elapsedTime() / 1000 < timeoutSec){
|
||||
return true;
|
||||
@@ -241,6 +250,12 @@ void RtpProcess::setListener(const std::weak_ptr<MediaSourceEvent> &listener){
|
||||
}
|
||||
}
|
||||
|
||||
void RtpProcess::setRtpPause(bool pause)
|
||||
{
|
||||
_paused = pause;
|
||||
_pause_rtp_time.resetTime();
|
||||
}
|
||||
|
||||
void RtpProcess::emitOnPublish() {
|
||||
weak_ptr<RtpProcess> weak_self = shared_from_this();
|
||||
Broadcast::PublishAuthInvoker invoker = [weak_self](const string &err, bool enableHls, bool enableMP4) {
|
||||
|
||||
Reference in New Issue
Block a user