Move gstfastspectrum to src

This commit is contained in:
Jonas Kvinge 2024-09-24 16:29:19 +02:00
parent 11d4151a82
commit cf22b183a5
8 changed files with 8 additions and 52 deletions

9
3rdparty/README.md vendored
View File

@ -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.

View File

@ -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}
)

View File

@ -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)

View File

@ -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)

View File

@ -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",

View File

@ -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) {