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

#include <PipelineDotDumper.h>

Public Member Functions

void setReceiverName (const QString &receiverName)
const QByteArray & pipelineName () const
void dump (GstElement *pipeline, const char *tag) const
 Into GST_DEBUG_DUMP_DOT_DIR as "<pipeline name>-<tag>.dot", when that is set. No-op without a pipeline.
void snapshot (GstElement *pipeline, const QString &tag) const

Static Public Member Functions

static QString dotFileTag (QStringView tag)
static QString writePipelineDot (GstElement *pipeline, QStringView tag, const QString &directory)

Static Public Attributes

static constexpr GstDebugGraphDetails kDiagnosticDotGraphDetails
 Every pipeline graph QGC writes omits element properties, because source properties can contain credentials.

Detailed Description

Writes a receiver pipeline's graph as Graphviz .dot files.

Threading: the receiver's worker only, since a dump walks the pipeline and writes to disk.

Definition at line 11 of file PipelineDotDumper.h.

Member Function Documentation

◆ dotFileTag()

QString PipelineDotDumper::dotFileTag ( QStringView tag)
static

Returns tag as a file-name part: letters, digits, '-' and '' only (anything else becomes ''), at most 57 characters, never empty. A dump tag can then neither leave its directory nor make the file name too long.

Definition at line 16 of file PipelineDotDumper.cc.

Referenced by setReceiverName(), snapshot(), and writePipelineDot().

◆ dump()

void PipelineDotDumper::dump ( GstElement * pipeline,
const char * tag ) const

Into GST_DEBUG_DUMP_DOT_DIR as "<pipeline name>-<tag>.dot", when that is set. No-op without a pipeline.

Definition at line 66 of file PipelineDotDumper.cc.

References kDiagnosticDotGraphDetails.

Referenced by snapshot().

◆ pipelineName()

const QByteArray & PipelineDotDumper::pipelineName ( ) const
inline

Definition at line 30 of file PipelineDotDumper.h.

◆ setReceiverName()

void PipelineDotDumper::setReceiverName ( const QString & receiverName)

Names the pipeline, and so its dump files, "receiver-<receiverName>". VideoManager names each receiver uniquely, so receivers don't overwrite each other's dumps.

Definition at line 60 of file PipelineDotDumper.cc.

References dotFileTag().

◆ snapshot()

void PipelineDotDumper::snapshot ( GstElement * pipeline,
const QString & tag ) const

For bug reports: dump(), or a rotating copy under CacheLocation when GST_DEBUG_DUMP_DOT_DIR isn't set. tag may come from the user; it is reduced to a safe file-name part.

Definition at line 86 of file PipelineDotDumper.cc.

References dotFileTag(), dump(), and writePipelineDot().

◆ writePipelineDot()

QString PipelineDotDumper::writePipelineDot ( GstElement * pipeline,
QStringView tag,
const QString & directory )
static

Writes pipeline's graph (kDiagnosticDotGraphDetails) into directory as "<dotFileTag(tag)>-<UTC time>.dot", keeping at most 10 .dot files there. Returns the file's path, or empty on failure.

Definition at line 29 of file PipelineDotDumper.cc.

References GStreamer::adoptGChar(), QGCFileHelper::atomicWrite(), dotFileTag(), and kDiagnosticDotGraphDetails.

Referenced by snapshot().

Member Data Documentation

◆ kDiagnosticDotGraphDetails

GstDebugGraphDetails PipelineDotDumper::kDiagnosticDotGraphDetails
staticconstexpr
Initial value:
= static_cast<GstDebugGraphDetails>(
GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE | GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS | GST_DEBUG_GRAPH_SHOW_STATES)

Every pipeline graph QGC writes omits element properties, because source properties can contain credentials.

Definition at line 15 of file PipelineDotDumper.h.

Referenced by dump(), and writePipelineDot().


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