mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 11:41:44 +08:00
添加停止、恢复rtp代理rtp超时检查功能
This commit is contained in:
@@ -28,6 +28,7 @@ RtpProcess::RtpProcess(const string &stream_id) {
|
||||
_media_info._vhost = DEFAULT_VHOST;
|
||||
_media_info._app = RTP_APP_NAME;
|
||||
_media_info._streamid = stream_id;
|
||||
_stop_rtp_check.store(false);
|
||||
|
||||
GET_CONFIG(string, dump_dir, RtpProxy::kDumpDir);
|
||||
{
|
||||
@@ -134,6 +135,8 @@ void RtpProcess::addTrackCompleted() {
|
||||
}
|
||||
|
||||
bool RtpProcess::alive() {
|
||||
if(_stop_rtp_check.load())
|
||||
return true;
|
||||
GET_CONFIG(int, timeoutSec, RtpProxy::kTimeoutSec)
|
||||
if (_last_frame_time.elapsedTime() / 1000 < timeoutSec) {
|
||||
return true;
|
||||
@@ -141,6 +144,10 @@ bool RtpProcess::alive() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void RtpProcess::setStopCheckRtp(bool is_check){
|
||||
_stop_rtp_check = is_check;
|
||||
}
|
||||
|
||||
void RtpProcess::onDetach() {
|
||||
if (_on_detach) {
|
||||
_on_detach();
|
||||
|
||||
Reference in New Issue
Block a user