diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 92b7f84f2..3a9e2259f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -600,8 +600,8 @@ optional_source(HAVE_DBUS SOURCES osd/osddbus.cpp HEADERS osd/osddbus.h) # GStreamer optional_source(HAVE_GSTREAMER - SOURCES engine/gststartup.cpp engine/gstengine.cpp engine/gstenginepipeline.cpp engine/gstelementdeleter.cpp - HEADERS engine/gststartup.h engine/gstengine.h engine/gstenginepipeline.h engine/gstelementdeleter.h + SOURCES engine/gststartup.cpp engine/gstengine.cpp engine/gstenginepipeline.cpp + HEADERS engine/gststartup.h engine/gstengine.h engine/gstenginepipeline.h ) # VLC diff --git a/src/engine/gstelementdeleter.cpp b/src/engine/gstelementdeleter.cpp deleted file mode 100644 index 12797edf9..000000000 --- a/src/engine/gstelementdeleter.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Strawberry Music Player - * This file was part of Clementine. - * Copyright 2010, David Sansome - * - * Strawberry 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. - * - * Strawberry 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 Strawberry. If not, see . - * - */ - -#include - -#include "config.h" - -#include "gstelementdeleter.h" - -GstElementDeleter::GstElementDeleter(QObject *parent) : QObject(parent) {} - -void GstElementDeleter::DeleteElementLater(GstElement *element) { - QMetaObject::invokeMethod(this, "DeleteElement", Qt::QueuedConnection, Q_ARG(GstElement*, element)); -} - -void GstElementDeleter::DeleteElement(GstElement *element) { - gst_element_set_state(element, GST_STATE_NULL); -} diff --git a/src/engine/gstelementdeleter.h b/src/engine/gstelementdeleter.h deleted file mode 100644 index f78110b3a..000000000 --- a/src/engine/gstelementdeleter.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Strawberry Music Player - * This file was part of Clementine. - * Copyright 2010, David Sansome - * - * Strawberry 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. - * - * Strawberry 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 Strawberry. If not, see . - * - */ - -#ifndef GSTELEMENTDELETER_H -#define GSTELEMENTDELETER_H - -#include "config.h" - -#include - -#include -#include - -class GstElementDeleter : public QObject { - Q_OBJECT - - public: - explicit GstElementDeleter(QObject *parent = nullptr); - - // If you call this function with any gstreamer element, the element will get deleted in the main thread. - // This is useful if you need to delete an element from its own callback. - // It's in a separate object so *your* object (GstEnginePipeline) can be destroyed, - // and the element that you scheduled for deletion is still deleted later regardless. - void DeleteElementLater(GstElement *element); - - private slots: - static void DeleteElement(GstElement *element); -}; - -#endif // GSTELEMENTDELETER_H diff --git a/src/engine/gstenginepipeline.cpp b/src/engine/gstenginepipeline.cpp index 04ce94ef8..863da9413 100644 --- a/src/engine/gstenginepipeline.cpp +++ b/src/engine/gstenginepipeline.cpp @@ -56,7 +56,6 @@ #include "gstengine.h" #include "gstenginepipeline.h" #include "gstbufferconsumer.h" -#include "gstelementdeleter.h" const int GstEnginePipeline::kGstStateTimeoutNanosecs = 10000000; const int GstEnginePipeline::kFaderFudgeMsec = 2000; @@ -65,7 +64,6 @@ const int GstEnginePipeline::kEqBandCount = 10; const int GstEnginePipeline::kEqBandFrequencies[] = { 60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000 }; int GstEnginePipeline::sId = 1; -GstElementDeleter *GstEnginePipeline::sElementDeleter = nullptr; GstEnginePipeline::GstEnginePipeline(GstEngine *engine, QObject *parent) : QObject(parent), @@ -116,10 +114,6 @@ GstEnginePipeline::GstEnginePipeline(GstEngine *engine, QObject *parent) about_to_finish_cb_id_(-1), unsupported_analyzer_(false) { - if (!sElementDeleter) { - sElementDeleter = new GstElementDeleter(engine_); - } - eq_band_gains_.reserve(kEqBandCount); for (int i = 0; i < kEqBandCount; ++i) eq_band_gains_ << 0; diff --git a/src/engine/gstenginepipeline.h b/src/engine/gstenginepipeline.h index 593b5c560..f067af063 100644 --- a/src/engine/gstenginepipeline.h +++ b/src/engine/gstenginepipeline.h @@ -47,7 +47,6 @@ class QTimerEvent; class GstEngine; class GstBufferConsumer; -class GstElementDeleter; namespace Engine { struct SimpleMetaBundle; @@ -177,8 +176,6 @@ class GstEnginePipeline : public QObject { static const int kEqBandCount; static const int kEqBandFrequencies[]; - static GstElementDeleter *sElementDeleter; - GstEngine *engine_; // Using == to compare two pipelines is a bad idea, because new ones often get created in the same address as old ones. This ID will be unique for each pipeline.