5#include <QtCore/QObject>
6#include <QtCore/QPointer>
8#include <QtCore/QString>
9#include <QtQmlIntegration/QtQmlIntegration>
54 Q_MOC_INCLUDE(
"QGCVideoStreamInfo.h")
69 bool tile()
const {
return _tile; }
79 QString
name()
const {
return _name; }
107 bool configured()
const {
return _resolvedConfig().has_value(); }
194 std::optional<VideoReceiver::Config> _resolvedConfig()
const;
197 void _onStreamInfoChanged();
199 void _detachVideoOutput();
202 void _forgetDecoded();
203 void _updateReconnecting();
207 QString _displayName;
211 bool _hasOwnReceiver =
false;
212 QPointer<QGCVideoStreamInfo> _streamInfo;
214 QPointer<QQuickItem> _videoOutput;
215 bool _displaySuspended =
false;
219 bool _enabled =
false;
220 bool _applyPending =
false;
221 bool _decoded =
false;
222 bool _reconnecting =
false;
Encapsulates the contents of a VIDEO_STREAM_INFORMATION message.
FileFormat
Values are persisted by VideoSettings::recordingFormat.
void setDisplaySuspended(bool suspended)
QGCVideoStreamInfo * streamInfo() const
void recordingStarted(const QString &file)
void setDisplayName(const QString &displayName)
QQuickItem * videoOutput() const
void recordingFinished(const QString &file, const QString &error)
void restart()
Reconnects now and rebuilds the receiver's display sink, so construct-only sink settings apply.
void encodesRecordingsChanged()
void setCamera(const QString &camera)
QString displayName() const
void displayNameChanged()
~VideoStreamController() override
void startRecording(const QString &file, VideoReceiver::FileFormat format)
VideoReceiver * receiver() const
QString taggedFile(const QString &file) const
file for this source: the thermal stream's name goes before the extension, "<base>....
double aspectRatio() const
bool encodesRecordings() const
bool takeScreenshot(const QString &file, const VideoScreenshot::Exif &exif={}) const
void setReceiver(VideoReceiver *receiver)
QString transport() const
void setEnabled(bool enabled)
The stream plays while it is enabled and configured().
VideoStreamResolver::Role Role
The source is shown in a tile of the video view, rather than as the main picture or with it.
void setRecordingEncoding(const VideoReceiver::RecordingEncoding &encoding)
VideoReceiver::setRecordingEncoding(), for the receiver and for each one set later.
void reconnectNow()
VideoReceiver::reconnectNow(): the stream's source is likely back, so a reconnect doesn't wait out it...
QSize videoSize() const
The size the stream is shown at: the receiver's video size, turned by rotation().
void aspectRatioChanged()
bool reconnecting() const
void setName(const QString &name)
Names a source that has no receiver yet.
bool active() const
True when the receiver is active, accepting startRecording().
VideoStreamStats stats() const
The receiver's VideoReceiver::stats(); invalid without a receiver.
Q_INVOKABLE void registerVideoOutput(QQuickItem *videoOutput)
VideoStreamController(Role role, VideoSettings *videoSettings, QObject *parent=nullptr, VideoReceiver *ownReceiver=nullptr)
ownReceiver, when given, is the source's receiver for good; the source takes ownership of it.
Q_INVOKABLE void unregisterVideoOutput(QQuickItem *videoOutput)
void setRole(Role role)
Makes a stream in a tile the primary stream, or the reverse. What the source plays stays.
void recordingChanged(bool recording)
void setStreamInfo(QGCVideoStreamInfo *streamInfo)
The stream the camera advertises for this role, which takes precedence over the manual settings.
void reconnectingChanged()
void stop()
Disables the stream and stops the receiver now.
void errorOccurred(const QString &message)
bool canTakeScreenshot() const
True while the stream is streaming into a registered output.
Role
What a video source, each with a VideoStreamController, is. VideoSourceRole.Primary,...
How the display sink presents frames. Construct-only: a change applies when restart() rebuilds the si...