VideoReceiver.h 1.2 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/
Gus Grubba's avatar
Gus Grubba committed
9 10 11 12 13 14 15 16 17 18 19 20


/**
 * @file
 *   @brief QGC Video Receiver
 *   @author Gus Grubba <mavlink@grubba.com>
 */

#ifndef VIDEORECEIVER_H
#define VIDEORECEIVER_H

#include <QObject>
21
#if defined(QGC_GST_STREAMING)
Gus Grubba's avatar
Gus Grubba committed
22
#include <gst/gst.h>
23
#endif
Gus Grubba's avatar
Gus Grubba committed
24 25 26 27 28 29 30 31

class VideoReceiver : public QObject
{
    Q_OBJECT
public:
    explicit VideoReceiver(QObject* parent = 0);
    ~VideoReceiver();

32
#if defined(QGC_GST_STREAMING)
Gus Grubba's avatar
Gus Grubba committed
33
    void setVideoSink(GstElement* sink);
34
#endif
Gus Grubba's avatar
Gus Grubba committed
35 36 37 38 39 40 41

public Q_SLOTS:
    void start  ();
    void stop   ();
    void setUri (const QString& uri);

private:
42 43

#if defined(QGC_GST_STREAMING)
Gus Grubba's avatar
Gus Grubba committed
44 45
    void            _onBusMessage(GstMessage* message);
    static gboolean _onBusMessage(GstBus* bus, GstMessage* msg, gpointer data);
46
#endif
Gus Grubba's avatar
Gus Grubba committed
47 48

    QString     _uri;
49 50

#if defined(QGC_GST_STREAMING)
Gus Grubba's avatar
Gus Grubba committed
51 52
    GstElement* _pipeline;
    GstElement* _videoSink;
53 54
#endif

Gus Grubba's avatar
Gus Grubba committed
55 56 57
};

#endif // VIDEORECEIVER_H