From dac81965c81d3b57a523cdebf8711f2d41a8a7d9 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Wed, 7 Nov 2018 12:40:17 -0500 Subject: [PATCH] Make RTSP UDP timeout into a (protected) variable so derived classes have access to it. --- src/VideoStreaming/VideoReceiver.cc | 3 ++- src/VideoStreaming/VideoReceiver.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/VideoStreaming/VideoReceiver.cc b/src/VideoStreaming/VideoReceiver.cc index 0c0cef49d..296d012dc 100644 --- a/src/VideoStreaming/VideoReceiver.cc +++ b/src/VideoStreaming/VideoReceiver.cc @@ -64,6 +64,7 @@ VideoReceiver::VideoReceiver(QObject* parent) , _socket(nullptr) , _serverPresent(false) , _rtspTestInterval_ms(5000) + , _udpReconnect_us(5000000) #endif , _videoSurface(nullptr) , _videoRunning(false) @@ -287,7 +288,7 @@ VideoReceiver::start() QUrl url(_uri); g_object_set(G_OBJECT(dataSource), "host", qPrintable(url.host()), "port", url.port(), nullptr ); } else { - g_object_set(G_OBJECT(dataSource), "location", qPrintable(_uri), "latency", 17, "udp-reconnect", 1, "timeout", static_cast(5000000), NULL); + g_object_set(G_OBJECT(dataSource), "location", qPrintable(_uri), "latency", 17, "udp-reconnect", 1, "timeout", _udpReconnect_us, NULL); } // Currently, we expect H264 when using anything except for TCP. Long term we may want this to be settable diff --git a/src/VideoStreaming/VideoReceiver.h b/src/VideoStreaming/VideoReceiver.h index ea2c50204..04e344e09 100644 --- a/src/VideoStreaming/VideoReceiver.h +++ b/src/VideoStreaming/VideoReceiver.h @@ -138,6 +138,9 @@ protected: bool _serverPresent; int _rtspTestInterval_ms; + //-- RTSP UDP reconnect timeout + uint64_t _udpReconnect_us; + #endif QString _uri; -- 2.22.0