QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCVideoStreamInfo.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QSize>
5#include <QtQmlIntegration/QtQmlIntegration>
6
7#include "MAVLinkLib.h"
8
11class QGCVideoStreamInfo : public QObject
12{
13 Q_OBJECT
14 QML_ELEMENT
15 QML_UNCREATABLE("")
16 Q_PROPERTY(QString uri READ uri NOTIFY infoChanged)
17 Q_PROPERTY(QString name READ name NOTIFY infoChanged)
18 Q_PROPERTY(quint8 streamID READ streamID NOTIFY infoChanged)
19 Q_PROPERTY(quint8 type READ type NOTIFY infoChanged)
20 Q_PROPERTY(qreal aspectRatio READ aspectRatio NOTIFY infoChanged)
21 Q_PROPERTY(quint16 hfov READ hfov NOTIFY infoChanged)
22 Q_PROPERTY(bool isThermal READ isThermal NOTIFY infoChanged)
23 Q_PROPERTY(bool isActive READ isActive NOTIFY infoChanged)
24 Q_PROPERTY(QSize resolution READ resolution NOTIFY infoChanged)
25 Q_PROPERTY(quint8 encoding READ encoding NOTIFY infoChanged)
26 Q_PROPERTY(quint16 rotation READ rotation NOTIFY infoChanged)
27 Q_PROPERTY(quint32 bitrate READ bitrate NOTIFY infoChanged)
28 Q_PROPERTY(qreal framerate READ framerate NOTIFY infoChanged)
29 Q_ENUM(VIDEO_STREAM_TYPE)
30 Q_ENUM(VIDEO_STREAM_ENCODING)
31 Q_FLAGS(QVIDEO_STREAM_STATUS_FLAGS)
32
33public:
34 explicit QGCVideoStreamInfo(const mavlink_video_stream_information_t &info, QObject *parent = nullptr);
36
37 Q_DECLARE_FLAGS(QVIDEO_STREAM_STATUS_FLAGS, VIDEO_STREAM_STATUS_FLAGS)
38
39 QString uri() const { return QString(_streamInfo.uri); }
40 QString name() const { return QString(_streamInfo.name); }
41 qreal aspectRatio() const;
42 quint16 hfov() const { return _streamInfo.hfov; }
43 quint8 type() const { return _streamInfo.type; }
44 quint8 streamID() const { return _streamInfo.stream_id; }
45 quint8 encoding() const { return _streamInfo.encoding; }
46 bool isThermal() const { return (_streamInfo.flags & VIDEO_STREAM_STATUS_FLAGS_THERMAL); }
47 QSize resolution() const { return QSize(_streamInfo.resolution_h, _streamInfo.resolution_v); }
48 quint16 rotation() const { return _streamInfo.rotation; }
49 bool isActive() const { return (_streamInfo.flags & VIDEO_STREAM_STATUS_FLAGS_RUNNING); }
50 uint32_t bitrate() const { return _streamInfo.bitrate; }
51 qreal framerate() const { return _streamInfo.framerate; }
52
53 bool update(const mavlink_video_stream_status_t &info);
54
55signals:
57
58private:
59 mavlink_video_stream_information_t _streamInfo{};
60};
Encapsulates the contents of a VIDEO_STREAM_INFORMATION message.
quint8 streamID() const
quint16 rotation() const
bool update(const mavlink_video_stream_status_t &info)
quint8 encoding() const
uint32_t bitrate() const