地面站终端 App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.6 KiB

/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
10 years ago
/**
* @file
* @brief QGC Video Receiver
* @author Gus Grubba <mavlink@grubba.com>
*/
#ifndef VIDEORECEIVER_H
#define VIDEORECEIVER_H
#include <QObject>
#include <QTimer>
#include <QTcpSocket>
#if defined(QGC_GST_STREAMING)
10 years ago
#include <gst/gst.h>
#endif
10 years ago
class VideoReceiver : public QObject
{
Q_OBJECT
public:
explicit VideoReceiver(QObject* parent = 0);
~VideoReceiver();
#if defined(QGC_GST_STREAMING)
10 years ago
void setVideoSink(GstElement* sink);
#endif
10 years ago
public slots:
void start ();
void stop ();
void setUri (const QString& uri);
private slots:
#if defined(QGC_GST_STREAMING)
void _timeout ();
void _connected ();
void _socketError (QAbstractSocket::SocketError socketError);
#endif
10 years ago
private:
#if defined(QGC_GST_STREAMING)
10 years ago
void _onBusMessage(GstMessage* message);
static gboolean _onBusMessage(GstBus* bus, GstMessage* msg, gpointer data);
#endif
10 years ago
QString _uri;
#if defined(QGC_GST_STREAMING)
10 years ago
GstElement* _pipeline;
GstElement* _videoSink;
#endif
//-- Wait for Video Server to show up before starting
#if defined(QGC_GST_STREAMING)
QTimer _timer;
QTcpSocket* _socket;
bool _serverPresent;
#endif
10 years ago
};
#endif // VIDEORECEIVER_H