Commit 0f9149b1 authored by Jacob Walser's avatar Jacob Walser

Fix repeated calls to restart VideoReceiver

parent efe64000
...@@ -236,7 +236,9 @@ void VideoManager::_updateTimer() ...@@ -236,7 +236,9 @@ void VideoManager::_updateTimer()
} }
else else
{ {
if(_videoSurface && _videoSurface->lastFrame()) { // if(_videoSurface && _videoSurface->lastFrame()) {
if(_videoSurface && _videoReceiver->streaming()) {
qDebug() << _videoSurface->lastFrame();
if(!_videoRunning) if(!_videoRunning)
{ {
_videoRunning = true; _videoRunning = true;
......
...@@ -30,6 +30,7 @@ class VideoReceiver : public QObject ...@@ -30,6 +30,7 @@ class VideoReceiver : public QObject
Q_OBJECT Q_OBJECT
public: public:
Q_PROPERTY(bool recording READ recording NOTIFY recordingChanged) Q_PROPERTY(bool recording READ recording NOTIFY recordingChanged)
Q_PROPERTY(bool streaming READ streaming NOTIFY streamingChanged)
explicit VideoReceiver(QObject* parent = 0); explicit VideoReceiver(QObject* parent = 0);
~VideoReceiver(); ~VideoReceiver();
...@@ -39,9 +40,11 @@ public: ...@@ -39,9 +40,11 @@ public:
#endif #endif
bool recording() { return _recording; } bool recording() { return _recording; }
bool streaming() { return GST_STATE(_pipeline) == GST_STATE_PLAYING; }
signals: signals:
void recordingChanged(); void recordingChanged();
void streamingChanged();
public slots: public slots:
void start (); void start ();
...@@ -71,6 +74,7 @@ private: ...@@ -71,6 +74,7 @@ private:
} Sink; } Sink;
bool _recording; bool _recording;
bool _streaming;
static Sink* _sink; static Sink* _sink;
static GstElement* _tee; static GstElement* _tee;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment