From cf22b183a59fd8a6e5576c3f62282d001784c591 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 24 Sep 2024 16:29:19 +0200 Subject: [PATCH] Move gstfastspectrum to src --- 3rdparty/README.md | 9 ----- 3rdparty/gstfastspectrum/CMakeLists.txt | 34 ------------------- CMakeLists.txt | 3 -- src/CMakeLists.txt | 6 ++-- .../moodbar}/gstfastspectrum.cpp | 0 .../moodbar}/gstfastspectrum.h | 0 src/moodbar/gstfastspectrumplugin.cpp | 6 ++-- src/moodbar/moodbarpipeline.cpp | 2 +- 8 files changed, 8 insertions(+), 52 deletions(-) delete mode 100644 3rdparty/gstfastspectrum/CMakeLists.txt rename {3rdparty/gstfastspectrum => src/moodbar}/gstfastspectrum.cpp (100%) rename {3rdparty/gstfastspectrum => src/moodbar}/gstfastspectrum.h (100%) diff --git a/3rdparty/README.md b/3rdparty/README.md index a6f1d451..c7221d91 100644 --- a/3rdparty/README.md +++ b/3rdparty/README.md @@ -9,12 +9,3 @@ It is also used to pass command-line options through to the first instance. This 3rdparty copy is used only if KDSingleApplication 1.1 or higher is not found on the system. URL: https://github.com/KDAB/KDSingleApplication/ - - -gstfastspectrum ---------------- -A GStreamer spectrum plugin using FFTW3. -It is needed for moodbar support, and is currently not available -in GStreamer. -The plan is to submit it to GStreamer, or move it to -a seperate repository outside of Strawberry. diff --git a/3rdparty/gstfastspectrum/CMakeLists.txt b/3rdparty/gstfastspectrum/CMakeLists.txt deleted file mode 100644 index 5e5308c7..00000000 --- a/3rdparty/gstfastspectrum/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -cmake_minimum_required(VERSION 3.13) - -set(SOURCES gstfastspectrum.cpp) - -add_library(gstfastspectrum STATIC ${SOURCES}) - -target_include_directories(gstfastspectrum SYSTEM PRIVATE - ${GLIB_INCLUDE_DIRS} - ${GOBJECT_INCLUDE_DIRS} - ${GSTREAMER_INCLUDE_DIRS} - ${GSTREAMER_BASE_INCLUDE_DIRS} - ${GSTREAMER_AUDIO_INCLUDE_DIRS} - ${FFTW3_INCLUDE_DIR} -) - -target_include_directories(gstfastspectrum PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - -target_link_directories(gstfastspectrum PRIVATE - ${GLIB_LIBRARY_DIRS} - ${GOBJECT_LIBRARY_DIRS} - ${GSTREAMER_LIBRARY_DIRS} - ${GSTREAMER_BASE_LIBRARY_DIRS} - ${GSTREAMER_AUDIO_LIBRARY_DIRS} - ${FFTW3_LIBRARY_DIRS} -) - -target_link_libraries(gstfastspectrum PRIVATE - ${GLIB_LIBRARIES} - ${GOBJECT_LIBRARIES} - ${GSTREAMER_LIBRARIES} - ${GSTREAMER_BASE_LIBRARIES} - ${GSTREAMER_AUDIO_LIBRARIES} - ${FFTW3_FFTW_LIBRARY} -) diff --git a/CMakeLists.txt b/CMakeLists.txt index d20245c5..87ab6c76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -453,9 +453,6 @@ add_subdirectory(dist) add_subdirectory(ext/libstrawberry-common) add_subdirectory(ext/libstrawberry-tagreader) add_subdirectory(ext/strawberry-tagreader) -if(HAVE_MOODBAR) - add_subdirectory(3rdparty/gstfastspectrum) -endif() if(GTest_FOUND AND GMOCK_LIBRARY AND Qt${QT_VERSION_MAJOR}Test_FOUND) add_subdirectory(tests) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 59b17311..c88bfeba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -987,6 +987,7 @@ optional_source(HAVE_MOODBAR moodbar/moodbarproxystyle.cpp moodbar/moodbarrenderer.cpp moodbar/gstfastspectrumplugin.cpp + moodbar/gstfastspectrum.cpp settings/moodbarsettingspage.cpp HEADERS moodbar/moodbarcontroller.h @@ -1149,8 +1150,9 @@ if(HAVE_GSTREAMER) endif() if(HAVE_MOODBAR) - target_include_directories(strawberry_lib SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/3rdparty/gstfastspectrum) - target_link_libraries(strawberry_lib PRIVATE gstfastspectrum) + target_include_directories(strawberry_lib SYSTEM PRIVATE ${FFTW3_INCLUDE_DIR}) + target_link_directories(strawberry_lib PRIVATE ${FFTW3_LIBRARY_DIRS}) + target_link_libraries(strawberry_lib PRIVATE ${FFTW3_FFTW_LIBRARY}) endif() if(HAVE_VLC) diff --git a/3rdparty/gstfastspectrum/gstfastspectrum.cpp b/src/moodbar/gstfastspectrum.cpp similarity index 100% rename from 3rdparty/gstfastspectrum/gstfastspectrum.cpp rename to src/moodbar/gstfastspectrum.cpp diff --git a/3rdparty/gstfastspectrum/gstfastspectrum.h b/src/moodbar/gstfastspectrum.h similarity index 100% rename from 3rdparty/gstfastspectrum/gstfastspectrum.h rename to src/moodbar/gstfastspectrum.h diff --git a/src/moodbar/gstfastspectrumplugin.cpp b/src/moodbar/gstfastspectrumplugin.cpp index 738ee3ae..db3c22ec 100644 --- a/src/moodbar/gstfastspectrumplugin.cpp +++ b/src/moodbar/gstfastspectrumplugin.cpp @@ -27,14 +27,14 @@ static gboolean gst_strawberry_fastspectrum_plugin_init(GstPlugin *plugin) { GstRegistry *reg = gst_registry_get(); if (reg) { - GstPluginFeature *fastspectrum = gst_registry_lookup_feature(reg, "fastspectrum"); + GstPluginFeature *fastspectrum = gst_registry_lookup_feature(reg, "strawberry-fastspectrum"); if (fastspectrum) { gst_object_unref(fastspectrum); return TRUE; } } - return gst_element_register(plugin, "fastspectrum", GST_RANK_NONE, GST_TYPE_STRAWBERRY_FASTSPECTRUM); + return gst_element_register(plugin, "strawberry-fastspectrum", GST_RANK_NONE, GST_TYPE_STRAWBERRY_FASTSPECTRUM); } @@ -43,7 +43,7 @@ int gst_strawberry_fastspectrum_register_static() { return gst_plugin_register_static( GST_VERSION_MAJOR, GST_VERSION_MINOR, - "fastspectrum", + "strawberry-fastspectrum", "Fast spectrum analyzer for generating Moodbars", gst_strawberry_fastspectrum_plugin_init, "0.1", diff --git a/src/moodbar/moodbarpipeline.cpp b/src/moodbar/moodbarpipeline.cpp index efb7aca7..dca52496 100644 --- a/src/moodbar/moodbarpipeline.cpp +++ b/src/moodbar/moodbarpipeline.cpp @@ -99,7 +99,7 @@ void MoodbarPipeline::Start() { GstElement *decodebin = CreateElement(QStringLiteral("uridecodebin")); convert_element_ = CreateElement(QStringLiteral("audioconvert")); - GstElement *spectrum = CreateElement(QStringLiteral("fastspectrum")); + GstElement *spectrum = CreateElement(QStringLiteral("strawberry-fastspectrum")); GstElement *fakesink = CreateElement(QStringLiteral("fakesink")); if (!decodebin || !convert_element_ || !spectrum || !fakesink) {