VideoManager.h 2.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/


#ifndef VideoManager_H
#define VideoManager_H

#include <QObject>
#include <QTimer>
16
#include <QUrl>
17 18 19 20 21 22 23

#include "QGCLoggingCategory.h"
#include "VideoReceiver.h"
#include "QGCToolbox.h"

Q_DECLARE_LOGGING_CATEGORY(VideoManagerLog)

24 25
class VideoSettings;

26 27 28 29 30
class VideoManager : public QGCTool
{
    Q_OBJECT

public:
31
    VideoManager    (QGCApplication* app, QGCToolbox* toolbox);
32 33
    ~VideoManager   ();

34 35 36 37
    Q_PROPERTY(bool             hasVideo            READ    hasVideo                                    NOTIFY hasVideoChanged)
    Q_PROPERTY(bool             isGStreamer         READ    isGStreamer                                 NOTIFY isGStreamerChanged)
    Q_PROPERTY(QString          videoSourceID       READ    videoSourceID                               NOTIFY videoSourceIDChanged)
    Q_PROPERTY(bool             uvcEnabled          READ    uvcEnabled                                  CONSTANT)
38
    Q_PROPERTY(VideoReceiver*   videoReceiver       READ    videoReceiver                               CONSTANT)
39

40 41 42
    bool        hasVideo            ();
    bool        isGStreamer         ();
    QString     videoSourceID       () { return _videoSourceID; }
43

44 45
    VideoReceiver*  videoReceiver   () { return _videoReceiver; }

46 47 48 49 50 51
#if defined(QGC_DISABLE_UVC)
    bool        uvcEnabled          () { return false; }
#else
    bool        uvcEnabled          ();
#endif

52 53 54 55
    // Override from QGCTool
    void        setToolbox          (QGCToolbox *toolbox);

signals:
56 57 58
    void hasVideoChanged            ();
    void isGStreamerChanged         ();
    void videoSourceIDChanged       ();
59

60
private slots:
61 62 63
    void _videoSourceChanged        ();
    void _udpPortChanged            ();
    void _rtspUrlChanged            ();
64

65
private:
66 67
    void _updateSettings            ();
    void _restartVideo              ();
68

69 70
    VideoReceiver*  _videoReceiver;
    VideoSettings*  _videoSettings;
71
    QString         _videoSourceID;
72 73 74
};

#endif