mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-18 12:32:09 +01:00
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:
parent
0ee64a32f6
commit
c353deba0c
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ class GstEnginePipeline : public QObject {
|
||||
|
||||
QString source_device() const { return source_device_; }
|
||||
|
||||
void DumpGraph();
|
||||
public slots:
|
||||
void SetVolumeModifier(qreal mod);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user