Commit efe64000 authored by Jacob Walser's avatar Jacob Walser

Hide recording icon if no video stream present at startup

Other minor formatting and stability improvements
parent 9565d524
This diff is collapsed.
...@@ -35,7 +35,7 @@ public: ...@@ -35,7 +35,7 @@ public:
~VideoReceiver(); ~VideoReceiver();
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
void setVideoSink(GstElement* sink); void setVideoSink(GstElement* _sink);
#endif #endif
bool recording() { return _recording; } bool recording() { return _recording; }
...@@ -48,8 +48,8 @@ public slots: ...@@ -48,8 +48,8 @@ public slots:
void EOS (); void EOS ();
void stop (); void stop ();
void setUri (const QString& uri); void setUri (const QString& uri);
void _stopRecording(); void stopRecording ();
void _startRecording(); void startRecording ();
private slots: private slots:
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
...@@ -60,6 +60,7 @@ private slots: ...@@ -60,6 +60,7 @@ private slots:
private: private:
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
typedef struct typedef struct
{ {
GstPad* teepad; GstPad* teepad;
...@@ -69,16 +70,15 @@ private: ...@@ -69,16 +70,15 @@ private:
gboolean removing; gboolean removing;
} Sink; } Sink;
static Sink* sink; bool _recording;
static Sink* _sink;
static GstElement* _tee;
void _onBusMessage(GstMessage* message); void _onBusMessage(GstMessage* message);
static gboolean _onBusMessage(GstBus* bus, GstMessage* msg, gpointer user_data); static gboolean _onBusMessage(GstBus* bus, GstMessage* msg, gpointer user_data);
static gboolean _eosCB(GstBus* bus, GstMessage* message, gpointer user_data); static gboolean _eosCB(GstBus* bus, GstMessage* message, gpointer user_data);
static GstPadProbeReturn _unlinkCB(GstPad* pad, GstPadProbeInfo* info, gpointer user_data); static GstPadProbeReturn _unlinkCB(GstPad* pad, GstPadProbeInfo* info, gpointer user_data);
bool _recording;
static GstElement* tee;
#endif #endif
QString _uri; QString _uri;
...@@ -86,7 +86,6 @@ private: ...@@ -86,7 +86,6 @@ private:
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
static GstElement* _pipeline; static GstElement* _pipeline;
static GstElement* _pipeline2; static GstElement* _pipeline2;
GstElement* _videoSink; GstElement* _videoSink;
#endif #endif
......
...@@ -495,6 +495,7 @@ Item { ...@@ -495,6 +495,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: height width: height
visible: QGroundControl.videoManager.videoRunning
Rectangle { Rectangle {
anchors.top: parent.top anchors.top: parent.top
...@@ -506,7 +507,7 @@ Item { ...@@ -506,7 +507,7 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: QGroundControl.videoManager.videoReceiver.recording? QGroundControl.videoManager.videoReceiver._stopRecording() : QGroundControl.videoManager.videoReceiver._startRecording() onClicked: QGroundControl.videoManager.videoReceiver.recording? QGroundControl.videoManager.videoReceiver.stopRecording() : QGroundControl.videoManager.videoReceiver.startRecording()
} }
} }
......
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