gstengine: Add a gstreamer debug console page
New page initially provides a button that triggers a dump of a graph of the main pipeline.
This commit is contained in:
parent
c353deba0c
commit
409c6b89d1
|
@ -134,6 +134,7 @@ set(SOURCES
|
||||||
engines/devicefinder.cpp
|
engines/devicefinder.cpp
|
||||||
engines/enginebase.cpp
|
engines/enginebase.cpp
|
||||||
engines/gstengine.cpp
|
engines/gstengine.cpp
|
||||||
|
engines/gstenginedebug.cpp
|
||||||
engines/gstenginepipeline.cpp
|
engines/gstenginepipeline.cpp
|
||||||
engines/gstelementdeleter.cpp
|
engines/gstelementdeleter.cpp
|
||||||
|
|
||||||
|
@ -455,6 +456,7 @@ set(HEADERS
|
||||||
|
|
||||||
engines/enginebase.h
|
engines/enginebase.h
|
||||||
engines/gstengine.h
|
engines/gstengine.h
|
||||||
|
engines/gstenginedebug.h
|
||||||
engines/gstenginepipeline.h
|
engines/gstenginepipeline.h
|
||||||
engines/gstelementdeleter.h
|
engines/gstelementdeleter.h
|
||||||
|
|
||||||
|
@ -687,6 +689,8 @@ set(UI
|
||||||
devices/deviceproperties.ui
|
devices/deviceproperties.ui
|
||||||
devices/deviceviewcontainer.ui
|
devices/deviceviewcontainer.ui
|
||||||
|
|
||||||
|
engines/gstenginedebug.ui
|
||||||
|
|
||||||
globalsearch/globalsearchsettingspage.ui
|
globalsearch/globalsearchsettingspage.ui
|
||||||
globalsearch/globalsearchview.ui
|
globalsearch/globalsearchview.ui
|
||||||
globalsearch/searchproviderstatuswidget.ui
|
globalsearch/searchproviderstatuswidget.ui
|
||||||
|
|
|
@ -56,7 +56,7 @@ Player::Player(Application* app, QObject* parent)
|
||||||
: PlayerInterface(parent),
|
: PlayerInterface(parent),
|
||||||
app_(app),
|
app_(app),
|
||||||
lastfm_(nullptr),
|
lastfm_(nullptr),
|
||||||
engine_(new GstEngine(app_->task_manager())),
|
engine_(new GstEngine(app_)),
|
||||||
stream_change_type_(Engine::First),
|
stream_change_type_(Engine::First),
|
||||||
last_state_(Engine::Empty),
|
last_state_(Engine::Empty),
|
||||||
nb_errors_received_(0),
|
nb_errors_received_(0),
|
||||||
|
|
|
@ -40,13 +40,16 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "core/application.h"
|
||||||
#include "core/closure.h"
|
#include "core/closure.h"
|
||||||
#include "core/logging.h"
|
#include "core/logging.h"
|
||||||
#include "core/taskmanager.h"
|
#include "core/taskmanager.h"
|
||||||
#include "core/timeconstants.h"
|
#include "core/timeconstants.h"
|
||||||
#include "core/utilities.h"
|
#include "core/utilities.h"
|
||||||
#include "devicefinder.h"
|
#include "devicefinder.h"
|
||||||
|
#include "gstenginedebug.h"
|
||||||
#include "gstenginepipeline.h"
|
#include "gstenginepipeline.h"
|
||||||
|
#include "ui/console.h"
|
||||||
|
|
||||||
#ifdef HAVE_MOODBAR
|
#ifdef HAVE_MOODBAR
|
||||||
#include "gst/moodbar/plugin.h"
|
#include "gst/moodbar/plugin.h"
|
||||||
|
@ -94,9 +97,9 @@ const char* GstEngine::kEnterprisePipeline =
|
||||||
"audiotestsrc wave=5 ! "
|
"audiotestsrc wave=5 ! "
|
||||||
"audiocheblimit mode=0 cutoff=120";
|
"audiocheblimit mode=0 cutoff=120";
|
||||||
|
|
||||||
GstEngine::GstEngine(TaskManager* task_manager)
|
GstEngine::GstEngine(Application* app)
|
||||||
: Engine::Base(),
|
: Engine::Base(),
|
||||||
task_manager_(task_manager),
|
task_manager_(app->task_manager()),
|
||||||
buffering_task_id_(-1),
|
buffering_task_id_(-1),
|
||||||
latest_buffer_(nullptr),
|
latest_buffer_(nullptr),
|
||||||
equalizer_enabled_(false),
|
equalizer_enabled_(false),
|
||||||
|
@ -119,6 +122,8 @@ GstEngine::GstEngine(TaskManager* task_manager)
|
||||||
seek_timer_->setSingleShot(true);
|
seek_timer_->setSingleShot(true);
|
||||||
seek_timer_->setInterval(kSeekDelayNanosec / kNsecPerMsec);
|
seek_timer_->setInterval(kSeekDelayNanosec / kNsecPerMsec);
|
||||||
connect(seek_timer_, SIGNAL(timeout()), SLOT(SeekNow()));
|
connect(seek_timer_, SIGNAL(timeout()), SLOT(SeekNow()));
|
||||||
|
connect(app, SIGNAL(NewDebugConsole(Console*)), this,
|
||||||
|
SLOT(NewDebugConsole(Console*)));
|
||||||
|
|
||||||
ReloadSettings();
|
ReloadSettings();
|
||||||
|
|
||||||
|
@ -979,3 +984,7 @@ GstEngine::OutputDetailsList GstEngine::GetOutputsList() const {
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GstEngine::NewDebugConsole(Console* console) {
|
||||||
|
console->AddPage(new GstEngineDebug(this), "GstEngine");
|
||||||
|
}
|
||||||
|
|
|
@ -39,7 +39,10 @@
|
||||||
class QTimer;
|
class QTimer;
|
||||||
class QTimerEvent;
|
class QTimerEvent;
|
||||||
|
|
||||||
|
class Application;
|
||||||
|
class Console;
|
||||||
class DeviceFinder;
|
class DeviceFinder;
|
||||||
|
class GstEngineDebug;
|
||||||
class GstEnginePipeline;
|
class GstEnginePipeline;
|
||||||
class TaskManager;
|
class TaskManager;
|
||||||
|
|
||||||
|
@ -57,7 +60,7 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GstEngine(TaskManager* task_manager);
|
GstEngine(Application* app);
|
||||||
~GstEngine();
|
~GstEngine();
|
||||||
|
|
||||||
struct OutputDetails {
|
struct OutputDetails {
|
||||||
|
@ -123,10 +126,19 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
||||||
GTlsDatabase* tls_database() const { return tls_database_; }
|
GTlsDatabase* tls_database() const { return tls_database_; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void NewDebugConsole(Console* console);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetVolumeSW(uint percent);
|
void SetVolumeSW(uint percent);
|
||||||
void timerEvent(QTimerEvent*);
|
void timerEvent(QTimerEvent*);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Used for debug purposes only.
|
||||||
|
friend class GstEngineDebug;
|
||||||
|
std::shared_ptr<GstEnginePipeline> GetCurrentPipeline() {
|
||||||
|
return current_pipeline_;
|
||||||
|
}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void EndOfStreamReached(int pipeline_id, bool has_next_track);
|
void EndOfStreamReached(int pipeline_id, bool has_next_track);
|
||||||
void HandlePipelineError(int pipeline_id, const QString& message, int domain,
|
void HandlePipelineError(int pipeline_id, const QString& message, int domain,
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
/* This file is part of Clementine.
|
||||||
|
Copyright 2020, Jim Broadus <jbroadus@gmail.com>
|
||||||
|
|
||||||
|
Clementine is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Clementine is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "gstenginedebug.h"
|
||||||
|
|
||||||
|
#include "core/logging.h"
|
||||||
|
#include "gstengine.h"
|
||||||
|
#include "gstenginepipeline.h"
|
||||||
|
|
||||||
|
GstEngineDebug::GstEngineDebug(GstEngine* engine, QWidget* parent)
|
||||||
|
: QWidget(parent), engine_(engine) {
|
||||||
|
ui_.setupUi(this);
|
||||||
|
connect(ui_.dump_graph_button, SIGNAL(clicked()), SLOT(DumpGraph()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void GstEngineDebug::DumpGraph() {
|
||||||
|
std::shared_ptr<GstEnginePipeline> pipeline = engine_->GetCurrentPipeline();
|
||||||
|
if (pipeline) {
|
||||||
|
pipeline->DumpGraph();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
/* This file is part of Clementine.
|
||||||
|
Copyright 2020, Jim Broadus <jbroadus@gmail.com>
|
||||||
|
|
||||||
|
Clementine is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Clementine is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GSTENGINEDEBUG_H
|
||||||
|
#define GSTENGINEDEBUG_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "ui_gstenginedebug.h"
|
||||||
|
|
||||||
|
class GstEngine;
|
||||||
|
|
||||||
|
class GstEngineDebug : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
GstEngineDebug(GstEngine* engine, QWidget* parent = nullptr);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void DumpGraph();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::GstEngineDebug ui_;
|
||||||
|
GstEngine* engine_;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GSTENGINEDEBUG_H
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>GstEngineDebug</class>
|
||||||
|
<widget class="QWidget" name="GstEngineDebug">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="graph_group">
|
||||||
|
<property name="title">
|
||||||
|
<string>Pipeline</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="dump_graph_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>Dump Pipeline Graph</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -1337,7 +1337,10 @@ void GstEnginePipeline::DumpGraph() {
|
||||||
#ifdef GST_DISABLE_GST_DEBUG
|
#ifdef GST_DISABLE_GST_DEBUG
|
||||||
qLog(Debug) << "Cannot dump graph. gstreamer debug is not enabled.";
|
qLog(Debug) << "Cannot dump graph. gstreamer debug is not enabled.";
|
||||||
#else
|
#else
|
||||||
qLog(Debug) << "Dumping pipeline graph";
|
if (pipeline_) {
|
||||||
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(pipeline_), GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");
|
qLog(Debug) << "Dumping pipeline graph";
|
||||||
|
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(pipeline_),
|
||||||
|
GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue