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.
...@@ -29,13 +29,13 @@ class VideoReceiver : public QObject ...@@ -29,13 +29,13 @@ 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)
explicit VideoReceiver(QObject* parent = 0); explicit VideoReceiver(QObject* parent = 0);
~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; }
...@@ -44,12 +44,12 @@ signals: ...@@ -44,12 +44,12 @@ signals:
void recordingChanged(); void recordingChanged();
public slots: public slots:
void start (); void start ();
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,34 +60,33 @@ private slots: ...@@ -60,34 +60,33 @@ private slots:
private: private:
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
typedef struct typedef struct
{ {
GstPad* teepad; GstPad* teepad;
GstElement* queue; GstElement* queue;
GstElement* mux; GstElement* mux;
GstElement* filesink; GstElement* filesink;
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;
#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
//-- Wait for Video Server to show up before starting //-- Wait for Video Server to show up before starting
......
...@@ -494,7 +494,8 @@ Item { ...@@ -494,7 +494,8 @@ Item {
Item { 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