From 0f9149b1bf39e69f3a5c5e24a7fa34a74fa93be1 Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Wed, 4 Jan 2017 00:34:14 -0500 Subject: [PATCH] Fix repeated calls to restart VideoReceiver --- src/FlightDisplay/VideoManager.cc | 4 +++- src/VideoStreaming/VideoReceiver.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/FlightDisplay/VideoManager.cc b/src/FlightDisplay/VideoManager.cc index d920acc4d..85437d3bd 100644 --- a/src/FlightDisplay/VideoManager.cc +++ b/src/FlightDisplay/VideoManager.cc @@ -236,7 +236,9 @@ void VideoManager::_updateTimer() } else { - if(_videoSurface && _videoSurface->lastFrame()) { +// if(_videoSurface && _videoSurface->lastFrame()) { + if(_videoSurface && _videoReceiver->streaming()) { + qDebug() << _videoSurface->lastFrame(); if(!_videoRunning) { _videoRunning = true; diff --git a/src/VideoStreaming/VideoReceiver.h b/src/VideoStreaming/VideoReceiver.h index 276a031d7..2a791fe35 100644 --- a/src/VideoStreaming/VideoReceiver.h +++ b/src/VideoStreaming/VideoReceiver.h @@ -30,6 +30,7 @@ class VideoReceiver : public QObject Q_OBJECT public: Q_PROPERTY(bool recording READ recording NOTIFY recordingChanged) + Q_PROPERTY(bool streaming READ streaming NOTIFY streamingChanged) explicit VideoReceiver(QObject* parent = 0); ~VideoReceiver(); @@ -39,9 +40,11 @@ public: #endif bool recording() { return _recording; } + bool streaming() { return GST_STATE(_pipeline) == GST_STATE_PLAYING; } signals: void recordingChanged(); + void streamingChanged(); public slots: void start (); @@ -71,6 +74,7 @@ private: } Sink; bool _recording; + bool _streaming; static Sink* _sink; static GstElement* _tee; -- 2.22.0