gstengine: Add a DumpGraph method to GstEnginePipeline

This will write a .dot graph and can be integrated with the debug console.
This commit is contained in:
Jim Broadus 2020-12-31 13:01:25 -08:00 committed by John Maguire
parent 0ee64a32f6
commit c353deba0c
3 changed files with 18 additions and 0 deletions

View File

@ -143,6 +143,14 @@ GstEngine::~GstEngine() {
}
bool GstEngine::Init() {
// This environment variable is required for GST_DEBUG_BIN_TO_DOT_FILE macros.
// Gstreamer only reads it on init, so make sure it's set now.
QByteArray path = qgetenv("GST_DEBUG_DUMP_DOT_DIR");
if (path.isEmpty()) {
path = QDir::currentPath().toUtf8();
qputenv("GST_DEBUG_DUMP_DOT_DIR", path);
}
initialising_ = QtConcurrent::run(this, &GstEngine::InitialiseGstreamer);
return true;
}

View File

@ -1332,3 +1332,12 @@ void GstEnginePipeline::SetNextReq(const MediaPlaybackRequest& req,
next_beginning_offset_nanosec_ = beginning_nanosec;
next_end_offset_nanosec_ = end_nanosec;
}
void GstEnginePipeline::DumpGraph() {
#ifdef GST_DISABLE_GST_DEBUG
qLog(Debug) << "Cannot dump graph. gstreamer debug is not enabled.";
#else
qLog(Debug) << "Dumping pipeline graph";
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(pipeline_), GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");
#endif
}

View File

@ -106,6 +106,7 @@ class GstEnginePipeline : public QObject {
QString source_device() const { return source_device_; }
void DumpGraph();
public slots:
void SetVolumeModifier(qreal mod);