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
{
Q_OBJECT
public:
Q_PROPERTY(bool recording READ recording NOTIFY recordingChanged)
Q_PROPERTY(bool recording READ recording NOTIFY recordingChanged)
explicit VideoReceiver(QObject* parent = 0);
~VideoReceiver();
#if defined(QGC_GST_STREAMING)
void setVideoSink(GstElement* sink);
void setVideoSink(GstElement* _sink);
#endif
bool recording() { return _recording; }
......@@ -44,12 +44,12 @@ signals:
void recordingChanged();
public slots:
void start ();
void EOS ();
void stop ();
void setUri (const QString& uri);
void _stopRecording();
void _startRecording();
void start ();
void EOS ();
void stop ();
void setUri (const QString& uri);
void stopRecording ();
void startRecording ();
private slots:
#if defined(QGC_GST_STREAMING)
......@@ -60,34 +60,33 @@ private slots:
private:
#if defined(QGC_GST_STREAMING)
typedef struct
{
GstPad* teepad;
GstElement* queue;
GstElement* mux;
GstElement* filesink;
gboolean removing;
GstPad* teepad;
GstElement* queue;
GstElement* mux;
GstElement* filesink;
gboolean removing;
} Sink;
static Sink* sink;
bool _recording;
static Sink* _sink;
static GstElement* _tee;
void _onBusMessage(GstMessage* message);
static gboolean _onBusMessage(GstBus* bus, GstMessage* msg, gpointer user_data);
static gboolean _eosCB(GstBus* bus, GstMessage* message, gpointer user_data);
static GstPadProbeReturn _unlinkCB(GstPad* pad, GstPadProbeInfo* info, gpointer user_data);
bool _recording;
static GstElement* tee;
#endif
QString _uri;
#if defined(QGC_GST_STREAMING)
static GstElement* _pipeline;
static GstElement* _pipeline2;
GstElement* _videoSink;
static GstElement* _pipeline;
static GstElement* _pipeline2;
GstElement* _videoSink;
#endif
//-- Wait for Video Server to show up before starting
......
......@@ -494,7 +494,8 @@ Item {
Item {
anchors.top: parent.top
anchors.bottom: parent.bottom
width: height
width: height
visible: QGroundControl.videoManager.videoRunning
Rectangle {
anchors.top: parent.top
......@@ -506,7 +507,7 @@ Item {
MouseArea {
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