FlightDisplayViewController.h 1.47 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.
 *
 ****************************************************************************/
dogmaphobic's avatar
dogmaphobic committed
9 10


11 12
#ifndef FlightDisplayViewController_H
#define FlightDisplayViewController_H
dogmaphobic's avatar
dogmaphobic committed
13

14
#include <QObject>
dogmaphobic's avatar
dogmaphobic committed
15
#include <QTimer>
dogmaphobic's avatar
dogmaphobic committed
16

17 18 19 20
#include "VideoSurface.h"
#include "VideoReceiver.h"

class FlightDisplayViewController : public QObject
dogmaphobic's avatar
dogmaphobic committed
21 22 23
{
    Q_OBJECT

24 25 26
public:
    FlightDisplayViewController(QObject* parent = NULL);
    ~FlightDisplayViewController();
dogmaphobic's avatar
dogmaphobic committed
27

28 29
    Q_PROPERTY(bool hasVideo READ hasVideo CONSTANT)

30 31 32
    Q_PROPERTY(VideoSurface*    videoSurface    MEMBER _videoSurface    CONSTANT);
    Q_PROPERTY(VideoReceiver*   videoReceiver   MEMBER _videoReceiver   CONSTANT);

dogmaphobic's avatar
dogmaphobic committed
33 34
    Q_PROPERTY(bool             videoRunning    READ videoRunning       NOTIFY videoRunningChanged)

35 36 37 38 39 40
#if defined(QGC_GST_STREAMING)
    bool    hasVideo            () { return true; }
#else
    bool    hasVideo            () { return false; }
#endif

dogmaphobic's avatar
dogmaphobic committed
41 42 43 44 45 46 47 48
    bool videoRunning() { return _videoRunning; }

signals:
    void videoRunningChanged();

private:
    void _updateTimer(void);

49 50 51
private:
    VideoSurface*   _videoSurface;
    VideoReceiver*  _videoReceiver;
dogmaphobic's avatar
dogmaphobic committed
52 53 54 55
    bool            _videoRunning;
#if defined(QGC_GST_STREAMING)
    QTimer          _frameTimer;
#endif
dogmaphobic's avatar
dogmaphobic committed
56 57
};

58
#endif