QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TeeBranchHead Class Reference

The tee ! queue ! valve head every tee branch starts with. More...

#include <TeeBranchHead.h>

Public Member Functions

bool build (GstElement *pipeline, GstElement *tee, GStreamer::PipelineBranch branch, const char *what)
void reset ()
 Forgets the elements, which the pipeline still owns, and disconnects the overrun handler.
void onOverrun (GCallback callback, gpointer data)
void open ()
 Lets frames through and asks upstream for a keyframe to start from.
void close ()
 Drops frames again; nothing before build().
void requestKeyframe () const
 Asks upstream for a keyframe; nothing before build().
GstElement * queue () const
GstElement * valve () const
bool contains (GstObject *object) const
 Whether object is the queue or the valve.

Static Public Member Functions

static void absorbFlowErrors (GstElement *part)

Detailed Description

The tee ! queue ! valve head every tee branch starts with.

Built closed (the valve drops frames) and marked as one GStreamer::PipelineBranch, so bus messages from it are blamed on that branch. A branch opens the valve once it has linked what follows it, which then starts from the keyframe open() asks upstream for, and closes it again before taking that out. The pipeline owns both elements.

Threading: the receiver's worker, except the overrun handler (streaming threads).

Definition at line 15 of file TeeBranchHead.h.

Member Function Documentation

◆ absorbFlowErrors()

void TeeBranchHead::absorbFlowErrors ( GstElement * part)
static

For part, the bin a branch links behind its valve and takes out again, before it is linked: a push into its "sink" ghost pad that fails for good posts the failure, once, as an ERROR from part and reports success. An element inside that fails without an ERROR of its own (a refused renegotiation) is so reported as its branch's, which the session recovers from, instead of failing the tee through the open valve, and with it the stream.

Definition at line 41 of file TeeBranchHead.cc.

References GStreamer::adoptPad().

◆ build()

bool TeeBranchHead::build ( GstElement * pipeline,
GstElement * tee,
GStreamer::PipelineBranch branch,
const char * what )
nodiscard

Adds the queue and the closed valve to pipeline and links them behind tee. False on failure, logged with what naming the branch; nothing stays built then.

Definition at line 55 of file TeeBranchHead.cc.

References GStreamer::addToBin(), GStreamer::makeElement(), GStreamer::markBranch(), queue(), reset(), and valve().

◆ close()

void TeeBranchHead::close ( )

Drops frames again; nothing before build().

Definition at line 103 of file TeeBranchHead.cc.

◆ contains()

bool TeeBranchHead::contains ( GstObject * object) const

Whether object is the queue or the valve.

Definition at line 118 of file TeeBranchHead.cc.

◆ onOverrun()

void TeeBranchHead::onOverrun ( GCallback callback,
gpointer data )

Connects callback to the queue's "overrun", which fires on a streaming thread when the queue is full, before it leaks or blocks.

Definition at line 87 of file TeeBranchHead.cc.

◆ open()

void TeeBranchHead::open ( )

Lets frames through and asks upstream for a keyframe to start from.

Definition at line 94 of file TeeBranchHead.cc.

References requestKeyframe().

◆ queue()

GstElement * TeeBranchHead::queue ( ) const
inline

Definition at line 35 of file TeeBranchHead.h.

Referenced by build().

◆ requestKeyframe()

void TeeBranchHead::requestKeyframe ( ) const

Asks upstream for a keyframe; nothing before build().

Definition at line 110 of file TeeBranchHead.cc.

References GStreamer::adoptPad(), and GStreamer::requestKeyframe().

Referenced by open().

◆ reset()

void TeeBranchHead::reset ( )

Forgets the elements, which the pipeline still owns, and disconnects the overrun handler.

Definition at line 80 of file TeeBranchHead.cc.

Referenced by build().

◆ valve()

GstElement * TeeBranchHead::valve ( ) const
inline

Definition at line 37 of file TeeBranchHead.h.

Referenced by build().


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