QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstQgc::PathSession Class Reference

What qgcqvideosink keeps about the path its frames take through one caps epoch, from set_caps to the next set_caps or stop: the GPU path it resolved, and what is once per epoch, a stream demotion and the tiled-drop warning. Also decides what becomes of a frame that fails to map: dropped, or after a sustained run of failures, an error that ends the stream. More...

#include <GstQgcPathSession.h>

Public Types

enum class  Verdict { Drop , Error }

Public Member Functions

void startEpoch ()
 New caps: the path is resolved anew, and the once-per-epoch bookkeeping starts over.
void stop ()
 The sink stopped: as startEpoch(), and a run of map failures ends.
HwResolvedPathCache * pathCache ()
 For mapSampleToFrame(), which caches the path it resolves in the epoch.
Verdict onMapFailed (const MappedFrame &mapped, SinkCounters &counters)
void onMapped ()
 The frame mapped: a run of failures ends.
quint64 consecutiveMapFailures () const
void onDelivered (const MappedFrame &mapped, SinkCounters &counters)

Static Public Attributes

static constexpr quint64 kMaxConsecutiveMapFailures = 120
 A run of map failures this long is a broken import, not a hiccup: the stream fails so it is set up anew.

Detailed Description

What qgcqvideosink keeps about the path its frames take through one caps epoch, from set_caps to the next set_caps or stop: the GPU path it resolved, and what is once per epoch, a stream demotion and the tiled-drop warning. Also decides what becomes of a frame that fails to map: dropped, or after a sustained run of failures, an error that ends the stream.

Threading: the sink's streaming thread; GstBaseSink serializes set_caps, show_frame and stop.

Definition at line 19 of file GstQgcPathSession.h.

Member Enumeration Documentation

◆ Verdict

enum class GstQgc::PathSession::Verdict
strong
Enumerator
Drop 

Drop the frame and go on.

Error 

Fail the stream.

Definition at line 25 of file GstQgcPathSession.h.

Member Function Documentation

◆ consecutiveMapFailures()

quint64 GstQgc::PathSession::consecutiveMapFailures ( ) const
inline

Definition at line 46 of file GstQgcPathSession.h.

Referenced by gst_qgc_q_video_sink_show_frame().

◆ onDelivered()

void GstQgc::PathSession::onDelivered ( const MappedFrame & mapped,
SinkCounters & counters )

mapped reached the QVideoSink. A frame a GPU path was tried for but the CPU delivered counts as a GPU fallback, the epoch's first also as a stream demotion.

Definition at line 46 of file GstQgcPathSession.cc.

References MappedFrame::demoted, and GstQgc::SinkCounters::noteGpuFallback().

Referenced by gst_qgc_q_video_sink_show_frame().

◆ onMapFailed()

PathSession::Verdict GstQgc::PathSession::onMapFailed ( const MappedFrame & mapped,
SinkCounters & counters )

mapped, which has no frame, failed to map. Counts and logs it, and returns Error once the run of failures reaches kMaxConsecutiveMapFailures.

Definition at line 27 of file GstQgcPathSession.cc.

References Drop, Error, kMaxConsecutiveMapFailures, MappedFrame::noCpuLayout, and GstQgc::SinkCounters::noteTiledDrop().

Referenced by gst_qgc_q_video_sink_show_frame().

◆ onMapped()

void GstQgc::PathSession::onMapped ( )
inline

The frame mapped: a run of failures ends.

Definition at line 44 of file GstQgcPathSession.h.

Referenced by gst_qgc_q_video_sink_show_frame().

◆ pathCache()

HwResolvedPathCache * GstQgc::PathSession::pathCache ( )
inline

For mapSampleToFrame(), which caches the path it resolves in the epoch.

Definition at line 37 of file GstQgcPathSession.h.

Referenced by gst_qgc_q_video_sink_show_frame().

◆ startEpoch()

void GstQgc::PathSession::startEpoch ( )

New caps: the path is resolved anew, and the once-per-epoch bookkeeping starts over.

Definition at line 14 of file GstQgcPathSession.cc.

Referenced by gst_qgc_q_video_sink_set_caps(), and stop().

◆ stop()

void GstQgc::PathSession::stop ( )

The sink stopped: as startEpoch(), and a run of map failures ends.

Definition at line 21 of file GstQgcPathSession.cc.

References startEpoch().

Referenced by gst_qgc_q_video_sink_stop().

Member Data Documentation

◆ kMaxConsecutiveMapFailures

quint64 GstQgc::PathSession::kMaxConsecutiveMapFailures = 120
staticconstexpr

A run of map failures this long is a broken import, not a hiccup: the stream fails so it is set up anew.

Definition at line 23 of file GstQgcPathSession.h.

Referenced by onMapFailed().


The documentation for this class was generated from the following files: