7#include <QtCore/QObject>
8#include <QtCore/QString>
80 [[nodiscard]] std::optional<Failure>
start();
83 void setRecording(
const std::optional<RecordingBranch::Request>& request);
97 void snapshot(
const QString& tag)
const;
105 void _post(std::function<
void()> task);
106 void _fail(
const Failure& failure);
109 GstBusSyncReply _onBusSync(GstMessage* message);
110 void _handleMessage(GstMessage* message);
111 void _onBusError(GstMessage* message);
112 QString _takeStartError();
114 void _noteMissingPlugin(GstMessage* message);
116 void _linkSourcePad(GstPad* pad);
117 void _onFirstFrame();
120 static void _onSourcePadAdded(
GstElement* source, GstPad* pad, gpointer data);
121 static GstPadProbeReturn _teeProbe(GstPad* pad, GstPadProbeInfo* info, gpointer data);
122 static GstPadProbeReturn _sourceEosProbe(GstPad* pad, GstPadProbeInfo* info, gpointer data);
124 const Settings _settings;
139 std::unique_ptr<DecodingBranch> _decoding;
140 std::unique_ptr<RecordingBranch> _recording;
145 enum class Phase : uint8_t
153 bool _tearingDown()
const {
return _phase >= Phase::TearingDown; }
155 Phase _phase = Phase::Running;
156 bool _streaming =
false;
158 QString _missingPlugin;
160 PipelineStatsProbe _statsProbe;
struct _GstElement GstElement
A pipeline's bus, handled from the thread the pump lives on.
virtual void onSessionStreaming()=0
The first frame reached the tee.
virtual void onSessionGraphicsDeviceLost()=0
virtual void onSessionFailed(const Failure &failure)=0
The stream failed; the session ignores further failures until it is shut down.
std::optional< Failure > start()
Builds the pipeline and sets it PLAYING. Returns why when it can't; shut the session down then.
void snapshot(const QString &tag) const
Writes PipelineDotDumper::snapshot() of the pipeline under tag.
GstElement * pipeline() const
~PipelineSession() override
GstQgc::PathStats sinkPathStats() const
void restartDecoder(const char *reason)
void setRecording(const std::optional< RecordingBranch::Request > &request)
void setVideoSink(GstElement *sink)
PipelineSession(const Settings &settings, Listener &listener, StreamWatchdog &watchdog, const PipelineDotDumper &dotDumper, QObject *parent=nullptr)
void sampleStats(VideoStreamStatsMeter::Counters &counters, VideoStreamStats &stats)
PipelineBranch
The tee branch a pipeline element belongs to, so a bus message can be blamed on the part that failed.
@ None
The source, the tee, or the pipeline itself.
std::unique_ptr< GstElement, GstObjectDeleter > GstElementPtr
GstVideoSink that pushes decoded frames into a Qt QVideoSink; sole sink in qgcvideosinkbin....
Formatted per-path frame counts + the total delivered through GPU paths.
QString message
For the user.
bool permanent
Retrying can't help: unsupported URI, missing plugin, refused credentials.
QString reason
For the log.