Commit 9d8875ca authored by Jacob Walser's avatar Jacob Walser

Make _streaming flag non-gstreamer safe

parent 8115753b
......@@ -180,6 +180,7 @@ VideoReceiver::VideoReceiver(QObject* parent)
: QObject(parent)
#if defined(QGC_GST_STREAMING)
, _recording(false)
, _streaming(false)
, _videoSink(NULL)
, _socket(NULL)
, _serverPresent(false)
......@@ -460,6 +461,7 @@ void VideoReceiver::stop()
gst_object_unref(_pipeline);
_pipeline = NULL;
_serverPresent = false;
_streaming = false;
}
#endif
}
......@@ -494,6 +496,9 @@ void VideoReceiver::_onBusMessage(GstMessage* msg)
} while(0);
stop();
break;
case GST_MESSAGE_STATE_CHANGED:
_streaming = GST_STATE(_pipeline) == GST_STATE_PLAYING;
break;
default:
break;
}
......
......@@ -40,7 +40,7 @@ public:
#endif
bool recording() { return _recording; }
bool streaming() { return GST_STATE(_pipeline) == GST_STATE_PLAYING; }
bool streaming() { return _streaming; }
signals:
void recordingChanged();
......
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