From f741fd1abb9ce23f995ea5e43276ce3276210e3f Mon Sep 17 00:00:00 2001 From: slarbi Date: Fri, 22 Nov 2024 15:43:23 +0100 Subject: [PATCH 001/182] add cmakelists.txt files --- CMakeLists.txt | 75 +++++++++++++++++++++++ extra/CMakeLists.txt | 0 src/CMakeLists.txt | 46 ++++++++++++++ src/apps/CMakeLists.txt | 19 ++++++ src/lib_appcommon/CMakeLists.txt | 11 ++++ src/lib_media/CMakeLists.txt | 5 ++ src/lib_modules/CMakeLists.txt | 38 ++++++++++++ src/lib_pipeline/CMakeLists.txt | 10 +++ src/lib_signals/CMakeLists.txt | 49 +++++++++++++++ src/lib_utils/CMakeLists.txt | 42 +++++++++++++ src/lib_utils/clock.hpp | 2 +- src/lib_utils/i_scheduler.hpp | 2 +- src/lib_utils/log.cpp | 4 +- src/lib_utils/scheduler.cpp | 2 +- src/lib_utils/scheduler.hpp | 2 +- src/lib_utils/time.hpp | 2 +- src/plugins/CMakeLists.txt | 15 +++++ src/plugins/Dasher/CMakeLists.txt | 32 ++++++++++ src/plugins/Fmp4Splitter/CMakeLists.txt | 12 ++++ src/plugins/HlsDemuxer/CMakeLists.txt | 13 ++++ src/plugins/MulticastInput/CMakeLists.txt | 11 ++++ src/plugins/SdlRender/CMakeLists.txt | 56 +++++++++++++++++ src/plugins/Telx2Ttml/CMakeLists.txt | 0 src/plugins/TsDemuxer/CMakeLists.txt | 13 ++++ src/plugins/TsMuxer/CMakeLists.txt | 0 src/plugins/UdpOutput/CMakeLists.txt | 0 src/tests/CMakeLists.txt | 46 ++++++++++++++ 27 files changed, 500 insertions(+), 7 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 extra/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 src/apps/CMakeLists.txt create mode 100644 src/lib_appcommon/CMakeLists.txt create mode 100644 src/lib_media/CMakeLists.txt create mode 100644 src/lib_modules/CMakeLists.txt create mode 100644 src/lib_pipeline/CMakeLists.txt create mode 100644 src/lib_signals/CMakeLists.txt create mode 100644 src/lib_utils/CMakeLists.txt create mode 100644 src/plugins/CMakeLists.txt create mode 100644 src/plugins/Dasher/CMakeLists.txt create mode 100644 src/plugins/Fmp4Splitter/CMakeLists.txt create mode 100644 src/plugins/HlsDemuxer/CMakeLists.txt create mode 100644 src/plugins/MulticastInput/CMakeLists.txt create mode 100644 src/plugins/SdlRender/CMakeLists.txt create mode 100644 src/plugins/Telx2Ttml/CMakeLists.txt create mode 100644 src/plugins/TsDemuxer/CMakeLists.txt create mode 100644 src/plugins/TsMuxer/CMakeLists.txt create mode 100644 src/plugins/UdpOutput/CMakeLists.txt create mode 100644 src/tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..518923008 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,75 @@ +cmake_minimum_required(VERSION 3.15) + +project(Signals VERSION 1.0) + +# Set the C++ standard +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Global compiler options +add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden) + +# Debug-specific options +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-g3) +endif() + +# Release-specific options +if(CMAKE_BUILD_TYPE STREQUAL "Release") + add_compile_options(-w -DNDEBUG) + add_link_options(-s) +endif() + +# Add all the source subdirectories +add_subdirectory(src) + +# Define paths for source and scripts +set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") +set(SRC_DIR "${CMAKE_SOURCE_DIR}/src") +set(BIN_DIR "${CMAKE_BINARY_DIR}/bin") + +# Generate signals_version.h using version.sh +add_custom_command( + OUTPUT ${BIN_DIR}/signals_version.h + COMMAND ${SCRIPTS_DIR}/version.sh > ${BIN_DIR}/signals_version.h + DEPENDS ${SCRIPTS_DIR}/version.sh + COMMENT "Generating signals_version.h" +) + +# Add a custom target to trigger the custom command +add_custom_target(generate_signals_version_header ALL DEPENDS ${BIN_DIR}/signals_version.h) + +message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") + +# Ensure the generated signals_version.h is available globally +set(SIGNALS_VERSION_HEADER "${BIN_DIR}/signals_version.h") + +# Include directories for global availability +include_directories(${BIN_DIR}) + +# make the version header available as part of a global variable +# to be accessible in other sub-projects or libraries +set(GENERATED_SIGNALS_VERSION_HEADER ${SIGNALS_VERSION_HEADER}) + +# Add custom targets for easy builds +add_custom_target(build_all + DEPENDS + utils + appcommon + pipeline + modules + media + plugins + dashcastx + ts2ip + player + mcastdump + mp42tsx + monitor + unittests + COMMENT "Building all targets." +) + +# Add custom install targets (if needed) +install(TARGETS dashcastx ts2ip player mcastdump mp42tsx monitor + RUNTIME DESTINATION bin) diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..ca0cf1731 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,46 @@ +add_subdirectory(lib_utils) +add_subdirectory(lib_appcommon) +add_subdirectory(lib_pipeline) +add_subdirectory(lib_modules) +add_subdirectory(lib_media) +add_subdirectory(lib_signals) + +add_subdirectory(plugins) + +add_subdirectory(apps) +add_subdirectory(tests) + +# Optionally, group targets into folders in IDEs (like Visual Studio) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +# Function to group a target if it exists +function(group_target target_name folder_name) + if (TARGET ${target_name}) + set_target_properties(${target_name} PROPERTIES FOLDER "${folder_name}") + endif() +endfunction() + +# Group libraries +group_target(utils "Libraries") +group_target(appcommon "Libraries") +group_target(pipeline "Libraries") +group_target(modules "Libraries") +group_target(media "Libraries") +group_target(signals "Libraries") + +# Automatically group all plugins into the "Plugins" folder +get_property(PLUGIN_TARGETS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/plugins PROPERTY BUILDSYSTEM_TARGETS) +foreach(plugin ${PLUGIN_TARGETS}) + group_target(${plugin} "Plugins") +endforeach() + +# Group applications +group_target(dashcastx "Applications") +group_target(ts2ip "Applications") +group_target(player "Applications") +group_target(mcastdump "Applications") +group_target(mp42tsx "Applications") +group_target(monitor "Applications") + +# Group tests +group_target(unit_tests "Tests") diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt new file mode 100644 index 000000000..e48ae4914 --- /dev/null +++ b/src/apps/CMakeLists.txt @@ -0,0 +1,19 @@ +file(GLOB_RECURSE APPS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp") + +add_executable(dashcastx dashcastx/main.cpp) +target_link_libraries(dashcastx PRIVATE plugins media modules pipeline appcommon utils) + +add_executable(ts2ip ts2ip/main.cpp) +target_link_libraries(ts2ip PRIVATE plugins media modules pipeline appcommon utils) + +add_executable(player player/player.cpp player/pipeliner_player.cpp) +target_link_libraries(player PRIVATE plugins media modules pipeline appcommon utils) + +add_executable(mcastdump mcastdump/main.cpp) +target_link_libraries(mcastdump PRIVATE plugins media modules pipeline appcommon utils) + +add_executable(mp42tsx mp42tsx/mp42tsx.cpp mp42tsx/options.cpp mp42tsx/pipeliner_mp42ts.cpp) +target_link_libraries(mp42tsx PRIVATE plugins media modules pipeline appcommon utils) + +add_executable(monitor monitor/main.cpp) +target_link_libraries(monitor PRIVATE plugins media modules pipeline appcommon utils) diff --git a/src/lib_appcommon/CMakeLists.txt b/src/lib_appcommon/CMakeLists.txt new file mode 100644 index 000000000..c4aa80d91 --- /dev/null +++ b/src/lib_appcommon/CMakeLists.txt @@ -0,0 +1,11 @@ +set(LIB_APPCOMMON_SRCS + options.cpp + options.hpp + safemain.cpp + timebomb.cpp + timebomb.hpp +) + +add_library(appcommon STATIC ${LIB_APPCOMMON_SRCS}) +target_include_directories(appcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(appcommon PRIVATE utils) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt new file mode 100644 index 000000000..a47f35476 --- /dev/null +++ b/src/lib_media/CMakeLists.txt @@ -0,0 +1,5 @@ +file(GLOB_RECURSE LIB_MEDIA_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp") + +add_library(media STATIC ${LIB_MEDIA_SRCS}) +target_include_directories(media PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(media PRIVATE modules pipeline appcommon utils) diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt new file mode 100644 index 000000000..f59857264 --- /dev/null +++ b/src/lib_modules/CMakeLists.txt @@ -0,0 +1,38 @@ +# Define the library target +add_library(modules SHARED + ${CMAKE_CURRENT_SOURCE_DIR}/core/allocator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/core/connection.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/core/data.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils/helper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils/factory.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils/loader.cpp +) + +# Add include directories +target_include_directories(modules PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib_utils # Assuming lib_utils is required as in the Makefile +) + +# Add compile flags +target_compile_options(modules PRIVATE + -Wall -Wextra -Werror -fPIC +) + +# Add linker flags +target_link_options(modules PRIVATE + -pthread -Wl,--no-undefined +) + +# Link dependencies if any +# Replace ${LIB_UTILS_LIBRARIES} with the actual lib_utils target if it's already defined in your CMake build. +target_link_libraries(modules PRIVATE utils) + +# Set output directory +set_target_properties(modules PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Installation (optional) +install(TARGETS modules DESTINATION lib) + \ No newline at end of file diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt new file mode 100644 index 000000000..c6563b5ed --- /dev/null +++ b/src/lib_pipeline/CMakeLists.txt @@ -0,0 +1,10 @@ +set(LIB_PIPELINE_SRCS + filter.cpp + filter.hpp + pipeline.cpp + pipeline.hpp +) + +add_library(pipeline STATIC ${LIB_PIPELINE_SRCS}) +target_include_directories(pipeline PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(pipeline PRIVATE appcommon utils) diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt new file mode 100644 index 000000000..7152f0734 --- /dev/null +++ b/src/lib_signals/CMakeLists.txt @@ -0,0 +1,49 @@ +# CMakeLists for lib_signals + +# Add the library target +add_library(lib_signals INTERFACE) + +# Specify include directories for the library +target_include_directories(lib_signals + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib_appcommon +) + +# Link dependencies for lib_signals +target_link_libraries(lib_signals + INTERFACE + lib_appcommon + lib_media + lib_modules + lib_pipeline + lib_utils +) + +# Add unit tests +if(BUILD_TESTING) + file(GLOB UNIT_TEST_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/unittests/*.cpp + ) + + add_executable(lib_signals_unittests + ${UNIT_TEST_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/../lib_appcommon/options.cpp + ) + + target_link_libraries(lib_signals_unittests + PRIVATE + lib_signals + lib_appcommon + lib_media + lib_modules + lib_pipeline + lib_utils + ) + + # Add test to CTest + add_test( + NAME lib_signals_unittests + COMMAND lib_signals_unittests + ) +endif() diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt new file mode 100644 index 000000000..aa55f5891 --- /dev/null +++ b/src/lib_utils/CMakeLists.txt @@ -0,0 +1,42 @@ +# List of source files for the utils library +set(LIB_UTILS_SRCS + clock.hpp + fifo.hpp + log.cpp + log.hpp + os.hpp + profiler.cpp + profiler.hpp + scheduler.cpp + scheduler.hpp + time.cpp + time.hpp + version.cpp +) +# Ensure the root-generated version header is included +include_directories(${BIN_DIR}) +list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) + +add_library(utils STATIC ${LIB_UTILS_SRCS}) + +# Platform-specific adjustments +if(APPLE) + # On macOS, we need to include the os_darwin.cpp file + list(APPEND LIB_UTILS_SRCS os_darwin.cpp) + target_link_libraries(utils PRIVATE "-ldl") +elseif(UNIX AND NOT APPLE) + # For Linux/Unix, include os_gnu.cpp and link against necessary libraries + list(APPEND LIB_UTILS_SRCS os_gnu.cpp) + target_link_libraries(utils PRIVATE "-ldl" "-lrt") +elseif(WIN32) + # For Windows, include os_mingw.cpp (if needed for MinGW) + list(APPEND LIB_UTILS_SRCS os_mingw.cpp) +endif() + + +# Specify include directories for the utils target +target_include_directories(utils PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} # Include the current directory where the header files are located + ${CMAKE_CURRENT_SOURCE_DIR}/lib_utils # Add lib_utils directory +) +message(STATUS "Include directories: ${CMAKE_INCLUDE_PATH}") diff --git a/src/lib_utils/clock.hpp b/src/lib_utils/clock.hpp index d8b83d394..317df05c4 100644 --- a/src/lib_utils/clock.hpp +++ b/src/lib_utils/clock.hpp @@ -1,6 +1,6 @@ #pragma once -#include "lib_utils/fraction.hpp" +#include "fraction.hpp" struct IClock { virtual ~IClock() = default; diff --git a/src/lib_utils/i_scheduler.hpp b/src/lib_utils/i_scheduler.hpp index 29895b825..7913baf22 100644 --- a/src/lib_utils/i_scheduler.hpp +++ b/src/lib_utils/i_scheduler.hpp @@ -1,6 +1,6 @@ #pragma once -#include "lib_utils/fraction.hpp" +#include "fraction.hpp" #include typedef std::function TaskFunc; diff --git a/src/lib_utils/log.cpp b/src/lib_utils/log.cpp index b3b0faab7..552f872c6 100644 --- a/src/lib_utils/log.cpp +++ b/src/lib_utils/log.cpp @@ -3,8 +3,8 @@ #include #include #include -#include "lib_utils/system_clock.hpp" -#include "lib_utils/format.hpp" +#include "system_clock.hpp" +#include "format.hpp" #ifdef _WIN32 #include diff --git a/src/lib_utils/scheduler.cpp b/src/lib_utils/scheduler.cpp index e6b288dc6..96b0093c4 100644 --- a/src/lib_utils/scheduler.cpp +++ b/src/lib_utils/scheduler.cpp @@ -1,5 +1,5 @@ #include "scheduler.hpp" -#include "lib_utils/format.hpp" +#include "format.hpp" auto const NEVER = Fraction(-1, 1); diff --git a/src/lib_utils/scheduler.hpp b/src/lib_utils/scheduler.hpp index 1b043e5bf..433aa92e3 100644 --- a/src/lib_utils/scheduler.hpp +++ b/src/lib_utils/scheduler.hpp @@ -3,7 +3,7 @@ #include "i_scheduler.hpp" #include "clock.hpp" -#include "lib_utils/system_clock.hpp" +#include "system_clock.hpp" #include "time.hpp" #include "timer.hpp" #include diff --git a/src/lib_utils/time.hpp b/src/lib_utils/time.hpp index 540a178df..bd8a7375b 100644 --- a/src/lib_utils/time.hpp +++ b/src/lib_utils/time.hpp @@ -2,7 +2,7 @@ #include #include -#include "lib_utils/fraction.hpp" +#include "fraction.hpp" Fraction getUTC(); uint64_t UTC2NTP(uint64_t absTimeUTCInMs); diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt new file mode 100644 index 000000000..a076b7136 --- /dev/null +++ b/src/plugins/CMakeLists.txt @@ -0,0 +1,15 @@ +# Optionally enable X11 support +if(SIGNALS_HAS_X11) + add_subdirectory(SdlRender) +endif() + +# Include other plugins +add_subdirectory(HlsDemuxer) +add_subdirectory(MulticastInput) +add_subdirectory(UdpOutput) +add_subdirectory(TsMuxer) +add_subdirectory(TsDemuxer) +add_subdirectory(Telx2Ttml) +add_subdirectory(Fmp4Splitter) +add_subdirectory(Dasher) + diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt new file mode 100644 index 000000000..37aab2d80 --- /dev/null +++ b/src/plugins/Dasher/CMakeLists.txt @@ -0,0 +1,32 @@ +# Define the plugin target +set(PLUGIN_NAME MPEG_DASH) + +# Add source files +set(SOURCES + ${CMAKE_SOURCE_DIR}/src/lib_media/common/xml.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mpeg_dash.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mpd.cpp +) + +# Add the plugin as a library or executable as per requirements +# Here we assume it's a shared library based on `.smd` extension +add_library(${PLUGIN_NAME} SHARED ${SOURCES}) + +# Include directories +target_include_directories(${PLUGIN_NAME} PRIVATE + ${CMAKE_SOURCE_DIR}/src/lib_media + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Link dependencies (if any) +# Replace `your_dependency` with actual targets if needed +# target_link_libraries(${PLUGIN_NAME} PRIVATE your_dependency) + +# Set the output directory for the plugin +set_target_properties(${PLUGIN_NAME} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Installation +install(TARGETS ${PLUGIN_NAME} DESTINATION bin) diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt new file mode 100644 index 000000000..2804d7baf --- /dev/null +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -0,0 +1,12 @@ +# Define the plugin library +add_library(FMP4SPLITTER STATIC + fmp4_splitter.cpp +) + +# Link dependencies if any +target_link_libraries(FMP4SPLITTER ${CMAKE_THREAD_LIBS_INIT}) + +# Include directories +target_include_directories(FMP4SPLITTER PUBLIC + ${CMAKE_SOURCE_DIR}/include +) diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt new file mode 100644 index 000000000..ce7ad1924 --- /dev/null +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -0,0 +1,13 @@ +# Define the plugin library +add_library(HlsDemuxer STATIC + hls_demux.cpp + hls_demux.hpp +) + +# Link dependencies if any +target_link_libraries(HlsDemuxer ${CMAKE_THREAD_LIBS_INIT}) + +# Include directories +target_include_directories(HlsDemuxer PUBLIC + ${CMAKE_SOURCE_DIR}/include +) diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt new file mode 100644 index 000000000..1cd646e8a --- /dev/null +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(MulticastInput STATIC + multicast_input.cpp + multicast_input.hpp +) + +target_include_directories(MulticastInput PUBLIC + ${CMAKE_SOURCE_DIR}/include +) + +# Link other libraries if necessary +target_link_libraries(MulticastInput ${CMAKE_THREAD_LIBS_INIT}) diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt new file mode 100644 index 000000000..b7c3a094e --- /dev/null +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -0,0 +1,56 @@ +# Plugin directory: SdlRender + +# Define targets for the plugins +set(SDL_VIDEO_PLUGIN SDLVideo) +set(SDL_AUDIO_PLUGIN SDLAudio) + +# Source files for each target +set(SDL_VIDEO_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/sdl_video.cpp +) + +set(SDL_AUDIO_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/sdl_audio.cpp +) + +# SDL2 package requirements +find_package(SDL2 REQUIRED) + +# SDLVideo plugin target +add_library(${SDL_VIDEO_PLUGIN} SHARED ${SDL_VIDEO_SOURCES}) + +# Set include directories for SDLVideo +target_include_directories(${SDL_VIDEO_PLUGIN} PRIVATE + ${SDL2_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Link SDL2 to SDLVideo +target_link_libraries(${SDL_VIDEO_PLUGIN} PRIVATE ${SDL2_LIBRARIES}) + +# Set the output directory for SDLVideo +set_target_properties(${SDL_VIDEO_PLUGIN} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# SDLAudio plugin target +add_library(${SDL_AUDIO_PLUGIN} SHARED ${SDL_AUDIO_SOURCES}) + +# Set include directories for SDLAudio +target_include_directories(${SDL_AUDIO_PLUGIN} PRIVATE + ${SDL2_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Link SDL2 to SDLAudio +target_link_libraries(${SDL_AUDIO_PLUGIN} PRIVATE ${SDL2_LIBRARIES}) + +# Set the output directory for SDLAudio +set_target_properties(${SDL_AUDIO_PLUGIN} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Installation (optional) +install(TARGETS ${SDL_VIDEO_PLUGIN} ${SDL_AUDIO_PLUGIN} DESTINATION bin) diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt new file mode 100644 index 000000000..4e029a985 --- /dev/null +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -0,0 +1,13 @@ +# Define the plugin library +add_library(TSDemuxer STATIC + ts_demuxer.cpp +) + +# Include directories if needed +target_include_directories(TSDemuxer PUBLIC + ${CMAKE_SOURCE_DIR}/include +) + +# Link libraries if required +# Example (if any external libraries are needed): +# target_link_libraries(TSDemuxer some_dependency) \ No newline at end of file diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt new file mode 100644 index 000000000..d989805b0 --- /dev/null +++ b/src/tests/CMakeLists.txt @@ -0,0 +1,46 @@ +# Collect all test sources +file(GLOB_RECURSE UNITTEST_SOURCES + "${CMAKE_SOURCE_DIR}/src/unittests/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/tests.cpp" + "${CMAKE_SOURCE_DIR}/lib_appcommon/options.cpp" + ${LIB_MEDIA_SRCS} + ${LIB_MODULES_SRCS} + ${LIB_PIPELINE_SRCS} + ${LIB_UTILS_SRCS} +) + +# Create the unit tests executable +add_executable(unittests ${UNITTEST_SOURCES}) + +# Include directories for the unittests +target_include_directories(unittests PRIVATE + ${CMAKE_SOURCE_DIR}/lib_appcommon + ${CMAKE_SOURCE_DIR}/lib_media + ${CMAKE_SOURCE_DIR}/lib_modules + ${CMAKE_SOURCE_DIR}/lib_pipeline + ${CMAKE_SOURCE_DIR}/lib_utils + ${CMAKE_SOURCE_DIR}/src/unittests +) + +# Link dependencies to the unit tests +target_link_libraries(unittests PRIVATE + appcommon + media + modules + pipeline + utils +) + +# Enable testing if requested +if(BUILD_TESTING) + enable_testing() + add_test(NAME UnitTests COMMAND unittests) +endif() + +# Set output directory for the test executable +set_target_properties(unittests PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Installation (optional) +install(TARGETS unittests DESTINATION bin) From 65e5a6a3908c5ac69d3dfa7770f91bcf03caf322 Mon Sep 17 00:00:00 2001 From: slarbi Date: Sun, 24 Nov 2024 18:25:57 +0100 Subject: [PATCH 002/182] building modules succefully --- CMakeLists.txt | 9 +++++++-- src/lib_appcommon/safemain.cpp | 2 +- src/lib_modules/CMakeLists.txt | 7 ++++--- src/lib_modules/core/allocator.cpp | 2 +- src/lib_modules/core/connection.cpp | 4 ++-- src/lib_modules/core/data.cpp | 2 +- src/lib_modules/core/database.hpp | 4 ++-- src/lib_modules/utils/helper.cpp | 6 +++--- src/lib_modules/utils/helper.hpp | 2 +- src/lib_modules/utils/helper_input.hpp | 2 +- src/lib_modules/utils/loader.cpp | 8 ++++---- src/lib_modules/utils/loader.hpp | 2 +- src/lib_pipeline/CMakeLists.txt | 11 ++++++++++- src/lib_pipeline/filter.cpp | 8 ++++---- src/lib_pipeline/filter.hpp | 6 +++--- src/lib_pipeline/filter_input.hpp | 2 +- src/lib_pipeline/i_filter.hpp | 2 +- src/lib_pipeline/pipeline.cpp | 12 ++++++------ src/lib_pipeline/pipeline.hpp | 4 ++-- src/lib_signals/CMakeLists.txt | 1 + src/lib_signals/executor_threadpool.hpp | 2 +- src/lib_signals/signals.hpp | 2 +- src/lib_utils/CMakeLists.txt | 11 +++++++++-- 23 files changed, 67 insertions(+), 44 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 518923008..6143e8d71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,19 +27,21 @@ add_subdirectory(src) set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") set(SRC_DIR "${CMAKE_SOURCE_DIR}/src") set(BIN_DIR "${CMAKE_BINARY_DIR}/bin") +file(MAKE_DIRECTORY ${BIN_DIR}) # Generate signals_version.h using version.sh add_custom_command( OUTPUT ${BIN_DIR}/signals_version.h + COMMAND ${CMAKE_COMMAND} -E echo "Working directory: ${CMAKE_BINARY_DIR}" + COMMAND ${SCRIPTS_DIR}/version.sh + COMMAND ${CMAKE_COMMAND} -E echo "Version script executed" COMMAND ${SCRIPTS_DIR}/version.sh > ${BIN_DIR}/signals_version.h DEPENDS ${SCRIPTS_DIR}/version.sh COMMENT "Generating signals_version.h" ) - # Add a custom target to trigger the custom command add_custom_target(generate_signals_version_header ALL DEPENDS ${BIN_DIR}/signals_version.h) -message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") # Ensure the generated signals_version.h is available globally set(SIGNALS_VERSION_HEADER "${BIN_DIR}/signals_version.h") @@ -51,6 +53,9 @@ include_directories(${BIN_DIR}) # to be accessible in other sub-projects or libraries set(GENERATED_SIGNALS_VERSION_HEADER ${SIGNALS_VERSION_HEADER}) +message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") + + # Add custom targets for easy builds add_custom_target(build_all DEPENDS diff --git a/src/lib_appcommon/safemain.cpp b/src/lib_appcommon/safemain.cpp index 95db6f9b4..705cb350f 100644 --- a/src/lib_appcommon/safemain.cpp +++ b/src/lib_appcommon/safemain.cpp @@ -1,4 +1,4 @@ -#include "lib_utils/profiler.hpp" +#include "profiler.hpp" #include #include // cerr diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index f59857264..b04375bf5 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -11,7 +11,9 @@ add_library(modules SHARED # Add include directories target_include_directories(modules PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/lib_utils # Assuming lib_utils is required as in the Makefile + ${CMAKE_SOURCE_DIR}/src/lib_utils + ${CMAKE_SOURCE_DIR}/src/lib_signals + ${CMAKE_SOURCE_DIR}/src/lib_media ) # Add compile flags @@ -25,7 +27,6 @@ target_link_options(modules PRIVATE ) # Link dependencies if any -# Replace ${LIB_UTILS_LIBRARIES} with the actual lib_utils target if it's already defined in your CMake build. target_link_libraries(modules PRIVATE utils) # Set output directory @@ -33,6 +34,6 @@ set_target_properties(modules PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -# Installation (optional) +# Installation (optional) to be tested later install(TARGETS modules DESTINATION lib) \ No newline at end of file diff --git a/src/lib_modules/core/allocator.cpp b/src/lib_modules/core/allocator.cpp index 1b7e43e97..cd9dec18f 100644 --- a/src/lib_modules/core/allocator.cpp +++ b/src/lib_modules/core/allocator.cpp @@ -1,5 +1,5 @@ #include "allocator.hpp" -#include "lib_utils/queue.hpp" +#include "queue.hpp" #include #include diff --git a/src/lib_modules/core/connection.cpp b/src/lib_modules/core/connection.cpp index 4b689d3b1..80c3e2440 100644 --- a/src/lib_modules/core/connection.cpp +++ b/src/lib_modules/core/connection.cpp @@ -1,7 +1,7 @@ #include "connection.hpp" #include "metadata.hpp" -#include "lib_signals/signal.hpp" -#include "lib_utils/log.hpp" // g_Log +#include "signal.hpp" +#include "log.hpp" // g_Log #include namespace Modules { diff --git a/src/lib_modules/core/data.cpp b/src/lib_modules/core/data.cpp index d6c88800c..e59ab580e 100644 --- a/src/lib_modules/core/data.cpp +++ b/src/lib_modules/core/data.cpp @@ -80,7 +80,7 @@ DataRaw::DataRaw(size_t size) { } // TODO: remove this -#include "lib_media/common/attributes.hpp" +#include "common/attributes.hpp" namespace Modules { DataBase::DataBase() { diff --git a/src/lib_modules/core/database.hpp b/src/lib_modules/core/database.hpp index a415acc8b..401f8154c 100644 --- a/src/lib_modules/core/database.hpp +++ b/src/lib_modules/core/database.hpp @@ -4,8 +4,8 @@ #include //memcpy #include #include -#include "lib_utils/small_map.hpp" -#include "lib_utils/clock.hpp" +#include "small_map.hpp" +#include "clock.hpp" namespace Modules { diff --git a/src/lib_modules/utils/helper.cpp b/src/lib_modules/utils/helper.cpp index a19c3a573..14f436a12 100644 --- a/src/lib_modules/utils/helper.cpp +++ b/src/lib_modules/utils/helper.cpp @@ -1,9 +1,9 @@ #include "helper.hpp" #include "helper_dyn.hpp" #include "helper_input.hpp" -#include "lib_utils/log.hpp" -#include "lib_utils/format.hpp" -#include "lib_utils/tools.hpp" // safe_cast +#include "log.hpp" +#include "format.hpp" +#include "tools.hpp" // safe_cast namespace Modules { diff --git a/src/lib_modules/utils/helper.hpp b/src/lib_modules/utils/helper.hpp index a83e0980d..f1b20e28b 100644 --- a/src/lib_modules/utils/helper.hpp +++ b/src/lib_modules/utils/helper.hpp @@ -7,7 +7,7 @@ #include "../core/allocator.hpp" #include "../core/error.hpp" #include "../core/database.hpp" // Data, Metadata -#include "lib_signals/signals.hpp" // Signals::Signal +#include "signals.hpp" // Signals::Signal #include namespace Modules { diff --git a/src/lib_modules/utils/helper_input.hpp b/src/lib_modules/utils/helper_input.hpp index 50d78789e..9283e0af0 100644 --- a/src/lib_modules/utils/helper_input.hpp +++ b/src/lib_modules/utils/helper_input.hpp @@ -1,4 +1,4 @@ -#include "lib_utils/queue.hpp" +#include "queue.hpp" namespace Modules { diff --git a/src/lib_modules/utils/loader.cpp b/src/lib_modules/utils/loader.cpp index 343e26c31..0b00a141e 100644 --- a/src/lib_modules/utils/loader.cpp +++ b/src/lib_modules/utils/loader.cpp @@ -1,10 +1,10 @@ #include #include #include -#include "lib_utils/os.hpp" -#include "lib_utils/tools.hpp" -#include "lib_modules/core/module.hpp" -#include "lib_modules/utils/factory.hpp" +#include "os.hpp" +#include "tools.hpp" +#include "core/module.hpp" +#include "utils/factory.hpp" using namespace std; diff --git a/src/lib_modules/utils/loader.hpp b/src/lib_modules/utils/loader.hpp index 7161f2824..b9dc125f4 100644 --- a/src/lib_modules/utils/loader.hpp +++ b/src/lib_modules/utils/loader.hpp @@ -1,5 +1,5 @@ #pragma once -#include "lib_modules/core/module.hpp" +#include "core/module.hpp" #include diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index c6563b5ed..a8c8ce40a 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -6,5 +6,14 @@ set(LIB_PIPELINE_SRCS ) add_library(pipeline STATIC ${LIB_PIPELINE_SRCS}) -target_include_directories(pipeline PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +# Add include directories +target_include_directories(pipeline PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/lib_modules + ${CMAKE_SOURCE_DIR}/src/lib_signals + ${CMAKE_SOURCE_DIR}/src/lib_utils +) + +# Link libraries target_link_libraries(pipeline PRIVATE appcommon utils) diff --git a/src/lib_pipeline/filter.cpp b/src/lib_pipeline/filter.cpp index 13ce7b93a..67100f505 100644 --- a/src/lib_pipeline/filter.cpp +++ b/src/lib_pipeline/filter.cpp @@ -1,8 +1,8 @@ #include "filter.hpp" -#include "lib_utils/log_sink.hpp" -#include "lib_utils/format.hpp" -#include "lib_utils/tools.hpp" // enforce -#include "lib_signals/executor_threadpool.hpp" +#include "log_sink.hpp" +#include "format.hpp" +#include "tools.hpp" // enforce +#include "executor_threadpool.hpp" #include "stats.hpp" #include "filter_input.hpp" diff --git a/src/lib_pipeline/filter.hpp b/src/lib_pipeline/filter.hpp index b2cda1085..b315adb53 100644 --- a/src/lib_pipeline/filter.hpp +++ b/src/lib_pipeline/filter.hpp @@ -3,9 +3,9 @@ #include #include "i_filter.hpp" -#include "lib_utils/log_sink.hpp" -#include "lib_signals/executor.hpp" // IExecutor -#include "lib_modules/core/module.hpp" +#include "log_sink.hpp" +#include "executor.hpp" // IExecutor +#include "core/module.hpp" using namespace Modules; diff --git a/src/lib_pipeline/filter_input.hpp b/src/lib_pipeline/filter_input.hpp index eeae3b360..d509667cd 100644 --- a/src/lib_pipeline/filter_input.hpp +++ b/src/lib_pipeline/filter_input.hpp @@ -1,6 +1,6 @@ #pragma once -#include "lib_modules/core/module.hpp" +#include "core/module.hpp" namespace Pipelines { diff --git a/src/lib_pipeline/i_filter.hpp b/src/lib_pipeline/i_filter.hpp index 68cea222b..23b151dca 100644 --- a/src/lib_pipeline/i_filter.hpp +++ b/src/lib_pipeline/i_filter.hpp @@ -3,7 +3,7 @@ // Filters are interconnected pipeline elements. // They're seen as such by the applications. -#include "lib_modules/modules.hpp" +#include "modules.hpp" namespace Pipelines { diff --git a/src/lib_pipeline/pipeline.cpp b/src/lib_pipeline/pipeline.cpp index 0f219edc1..b12d884e7 100644 --- a/src/lib_pipeline/pipeline.cpp +++ b/src/lib_pipeline/pipeline.cpp @@ -2,12 +2,12 @@ #include "stats.hpp" #include "graph.hpp" #include "filter.hpp" -#include "lib_modules/utils/helper.hpp" -#include "lib_modules/utils/loader.hpp" -#include "lib_utils/log.hpp" // g_Log -#include "lib_utils/os.hpp" -#include "lib_utils/format.hpp" -#include "lib_utils/tools.hpp" // safe_cast +#include "utils/helper.hpp" +#include "utils/loader.hpp" +#include "log.hpp" // g_Log +#include "os.hpp" +#include "format.hpp" +#include "tools.hpp" // safe_cast #include #include #include diff --git a/src/lib_pipeline/pipeline.hpp b/src/lib_pipeline/pipeline.hpp index 8095bd07d..4febe8fcc 100644 --- a/src/lib_pipeline/pipeline.hpp +++ b/src/lib_pipeline/pipeline.hpp @@ -1,8 +1,8 @@ #pragma once #include "i_filter.hpp" -#include "lib_utils/log_sink.hpp" -#include "lib_modules/modules.hpp" +#include "log_sink.hpp" +#include "modules.hpp" #include #include #include diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt index 7152f0734..7e8a80965 100644 --- a/src/lib_signals/CMakeLists.txt +++ b/src/lib_signals/CMakeLists.txt @@ -8,6 +8,7 @@ target_include_directories(lib_signals INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/lib_appcommon + ${CMAKE_SOURCE_DIR}/lib_utils ) # Link dependencies for lib_signals diff --git a/src/lib_signals/executor_threadpool.hpp b/src/lib_signals/executor_threadpool.hpp index ee08fc20a..287500ff9 100644 --- a/src/lib_signals/executor_threadpool.hpp +++ b/src/lib_signals/executor_threadpool.hpp @@ -1,7 +1,7 @@ #pragma once #include "executor.hpp" -#include "lib_utils/threadpool.hpp" +#include "threadpool.hpp" namespace Signals { diff --git a/src/lib_signals/signals.hpp b/src/lib_signals/signals.hpp index f8f997b05..d32719e25 100644 --- a/src/lib_signals/signals.hpp +++ b/src/lib_signals/signals.hpp @@ -3,7 +3,7 @@ #include "signal.hpp" #include "executor.hpp" // ExecutorSync -#include "lib_utils/small_map.hpp" +#include "small_map.hpp" #include #include diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index aa55f5891..60b869e45 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -5,6 +5,7 @@ set(LIB_UTILS_SRCS log.cpp log.hpp os.hpp + os_gnu.cpp # workaround for linux to be removed profiler.cpp profiler.hpp scheduler.cpp @@ -12,6 +13,8 @@ set(LIB_UTILS_SRCS time.cpp time.hpp version.cpp + system_clock.hpp + sysclock.cpp ) # Ensure the root-generated version header is included include_directories(${BIN_DIR}) @@ -33,10 +36,14 @@ elseif(WIN32) list(APPEND LIB_UTILS_SRCS os_mingw.cpp) endif() +set(BIN_DIR ${CMAKE_BINARY_DIR}/bin) # Specify include directories for the utils target target_include_directories(utils PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} # Include the current directory where the header files are located + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib_utils # Add lib_utils directory + ${BIN_DIR} ) -message(STATUS "Include directories: ${CMAKE_INCLUDE_PATH}") + +# Add -fPIC (required for shared libraries) +target_compile_options(utils PRIVATE -fPIC) \ No newline at end of file From a434ed8d842f67943bd81fe829dd31ca9392e3e5 Mon Sep 17 00:00:00 2001 From: slarbi Date: Sun, 24 Nov 2024 20:49:48 +0100 Subject: [PATCH 003/182] use sysroot for dependencies --- CMakeLists.txt | 14 ++++++++++++++ src/lib_media/CMakeLists.txt | 9 ++++++++- src/lib_utils/CMakeLists.txt | 3 +-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6143e8d71..1a5e8c3cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ add_subdirectory(src) set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") set(SRC_DIR "${CMAKE_SOURCE_DIR}/src") set(BIN_DIR "${CMAKE_BINARY_DIR}/bin") + file(MAKE_DIRECTORY ${BIN_DIR}) # Generate signals_version.h using version.sh @@ -78,3 +79,16 @@ add_custom_target(build_all # Add custom install targets (if needed) install(TARGETS dashcastx ts2ip player mcastdump mp42tsx monitor RUNTIME DESTINATION bin) + +set(SYSROOT_PATH "/home/sohaib/motiospell/CWI/sysroot") + +include_directories(${SYSROOT_PATH}/include) + +link_directories(${SYSROOT_PATH}/lib) + +set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) + + +find_package(PkgConfig REQUIRED) + +# Now you can use pkg-config or link libraries as needed diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index a47f35476..a9f98f024 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -1,5 +1,12 @@ file(GLOB_RECURSE LIB_MEDIA_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp") +file(GLOB_RECURSE LIB_MEDIA_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.hpp") + add_library(media STATIC ${LIB_MEDIA_SRCS}) -target_include_directories(media PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(media PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../ + ) target_link_libraries(media PRIVATE modules pipeline appcommon utils) + + diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 60b869e45..14b905165 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -16,7 +16,6 @@ set(LIB_UTILS_SRCS system_clock.hpp sysclock.cpp ) -# Ensure the root-generated version header is included include_directories(${BIN_DIR}) list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) @@ -41,7 +40,7 @@ set(BIN_DIR ${CMAKE_BINARY_DIR}/bin) # Specify include directories for the utils target target_include_directories(utils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/lib_utils # Add lib_utils directory + ${CMAKE_CURRENT_SOURCE_DIR}/lib_utils ${BIN_DIR} ) From 3044ed6c3aeffdb0d00ca97ef94ea1ecef1973be Mon Sep 17 00:00:00 2001 From: slarbi Date: Mon, 25 Nov 2024 09:51:27 +0100 Subject: [PATCH 004/182] building unittests and lib_signals --- CMakeLists.txt | 4 ++-- src/lib_appcommon/CMakeLists.txt | 12 ++++++++--- src/lib_signals/CMakeLists.txt | 36 ++++++++++++++++++++------------ 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a5e8c3cc..aedf2e12c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Global compiler options -add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden) +add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) # Debug-specific options if(CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -91,4 +91,4 @@ set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) find_package(PkgConfig REQUIRED) -# Now you can use pkg-config or link libraries as needed +set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/src/lib_appcommon/CMakeLists.txt b/src/lib_appcommon/CMakeLists.txt index c4aa80d91..2b7aa99e2 100644 --- a/src/lib_appcommon/CMakeLists.txt +++ b/src/lib_appcommon/CMakeLists.txt @@ -1,11 +1,17 @@ set(LIB_APPCOMMON_SRCS options.cpp - options.hpp safemain.cpp timebomb.cpp - timebomb.hpp ) + + add_library(appcommon STATIC ${LIB_APPCOMMON_SRCS}) -target_include_directories(appcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(appcommon PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ) target_link_libraries(appcommon PRIVATE utils) + +target_compile_options(appcommon PRIVATE + -Wall -Wextra -Werror -fPIC +) \ No newline at end of file diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt index 7e8a80965..a822eb13f 100644 --- a/src/lib_signals/CMakeLists.txt +++ b/src/lib_signals/CMakeLists.txt @@ -1,45 +1,55 @@ -# CMakeLists for lib_signals - # Add the library target add_library(lib_signals INTERFACE) # Specify include directories for the library target_include_directories(lib_signals INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../ + ${CMAKE_CURRENT_SOURCE_DIR}/../lib_utils ${CMAKE_SOURCE_DIR}/lib_appcommon ${CMAKE_SOURCE_DIR}/lib_utils + ${CMAKE_SOURCE_DIR}/src/tests + ) # Link dependencies for lib_signals target_link_libraries(lib_signals INTERFACE - lib_appcommon - lib_media - lib_modules - lib_pipeline - lib_utils + appcommon + media + modules + pipeline + utils ) + + # Add unit tests if(BUILD_TESTING) file(GLOB UNIT_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/unittests/*.cpp + ${CMAKE_SOURCE_DIR}/src/tests/tests.cpp ) add_executable(lib_signals_unittests ${UNIT_TEST_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../lib_appcommon/options.cpp ) + target_include_directories(lib_signals_unittests PRIVATE + ${CMAKE_SOURCE_DIR}/src/lib_appcommon + ${CMAKE_SOURCE_DIR}/src/tests + +) + target_link_libraries(lib_signals_unittests PRIVATE lib_signals - lib_appcommon - lib_media - lib_modules - lib_pipeline - lib_utils + appcommon + media + modules + pipeline + utils ) # Add test to CTest From 2f4c2947ec9024d38a7db34821a65eec3a18c3f7 Mon Sep 17 00:00:00 2001 From: slarbi Date: Mon, 25 Nov 2024 10:39:58 +0100 Subject: [PATCH 005/182] keeping consistency in include directories through out the project --- src/apps/CMakeLists.txt | 2 +- src/lib_modules/CMakeLists.txt | 4 +--- src/lib_modules/core/connection.cpp | 2 +- src/lib_modules/core/data.cpp | 2 +- src/lib_modules/core/database.hpp | 4 ++-- src/lib_modules/utils/helper.hpp | 2 +- src/lib_modules/utils/loader.hpp | 2 +- src/lib_pipeline/CMakeLists.txt | 4 +--- src/lib_pipeline/filter.cpp | 2 +- src/lib_pipeline/filter.hpp | 4 ++-- src/lib_pipeline/filter_input.hpp | 2 +- src/lib_pipeline/i_filter.hpp | 2 +- src/lib_pipeline/pipeline.cpp | 4 ++-- src/lib_pipeline/pipeline.hpp | 2 +- src/lib_signals/CMakeLists.txt | 5 +---- src/lib_signals/signals.hpp | 2 +- src/lib_utils/CMakeLists.txt | 4 +++- src/plugins/Dasher/CMakeLists.txt | 2 +- src/plugins/Fmp4Splitter/CMakeLists.txt | 2 +- src/plugins/HlsDemuxer/CMakeLists.txt | 2 +- src/plugins/MulticastInput/CMakeLists.txt | 2 +- src/plugins/TsDemuxer/CMakeLists.txt | 2 +- 22 files changed, 27 insertions(+), 32 deletions(-) diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index e48ae4914..3c294c9ea 100644 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -1,7 +1,7 @@ file(GLOB_RECURSE APPS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp") add_executable(dashcastx dashcastx/main.cpp) -target_link_libraries(dashcastx PRIVATE plugins media modules pipeline appcommon utils) +target_link_libraries(dashcastx PRIVATE media modules pipeline appcommon utils) add_executable(ts2ip ts2ip/main.cpp) target_link_libraries(ts2ip PRIVATE plugins media modules pipeline appcommon utils) diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index b04375bf5..1c3fb20dd 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -11,9 +11,7 @@ add_library(modules SHARED # Add include directories target_include_directories(modules PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/lib_utils - ${CMAKE_SOURCE_DIR}/src/lib_signals - ${CMAKE_SOURCE_DIR}/src/lib_media + ${CMAKE_SOURCE_DIR}/src ) # Add compile flags diff --git a/src/lib_modules/core/connection.cpp b/src/lib_modules/core/connection.cpp index 80c3e2440..73f8058ad 100644 --- a/src/lib_modules/core/connection.cpp +++ b/src/lib_modules/core/connection.cpp @@ -1,6 +1,6 @@ #include "connection.hpp" #include "metadata.hpp" -#include "signal.hpp" +#include "lib_signals/signal.hpp" #include "log.hpp" // g_Log #include diff --git a/src/lib_modules/core/data.cpp b/src/lib_modules/core/data.cpp index e59ab580e..d6c88800c 100644 --- a/src/lib_modules/core/data.cpp +++ b/src/lib_modules/core/data.cpp @@ -80,7 +80,7 @@ DataRaw::DataRaw(size_t size) { } // TODO: remove this -#include "common/attributes.hpp" +#include "lib_media/common/attributes.hpp" namespace Modules { DataBase::DataBase() { diff --git a/src/lib_modules/core/database.hpp b/src/lib_modules/core/database.hpp index 401f8154c..a415acc8b 100644 --- a/src/lib_modules/core/database.hpp +++ b/src/lib_modules/core/database.hpp @@ -4,8 +4,8 @@ #include //memcpy #include #include -#include "small_map.hpp" -#include "clock.hpp" +#include "lib_utils/small_map.hpp" +#include "lib_utils/clock.hpp" namespace Modules { diff --git a/src/lib_modules/utils/helper.hpp b/src/lib_modules/utils/helper.hpp index f1b20e28b..a83e0980d 100644 --- a/src/lib_modules/utils/helper.hpp +++ b/src/lib_modules/utils/helper.hpp @@ -7,7 +7,7 @@ #include "../core/allocator.hpp" #include "../core/error.hpp" #include "../core/database.hpp" // Data, Metadata -#include "signals.hpp" // Signals::Signal +#include "lib_signals/signals.hpp" // Signals::Signal #include namespace Modules { diff --git a/src/lib_modules/utils/loader.hpp b/src/lib_modules/utils/loader.hpp index b9dc125f4..7161f2824 100644 --- a/src/lib_modules/utils/loader.hpp +++ b/src/lib_modules/utils/loader.hpp @@ -1,5 +1,5 @@ #pragma once -#include "core/module.hpp" +#include "lib_modules/core/module.hpp" #include diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index a8c8ce40a..35ae786a4 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -10,9 +10,7 @@ add_library(pipeline STATIC ${LIB_PIPELINE_SRCS}) # Add include directories target_include_directories(pipeline PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/lib_modules - ${CMAKE_SOURCE_DIR}/src/lib_signals - ${CMAKE_SOURCE_DIR}/src/lib_utils + ${CMAKE_SOURCE_DIR}/src ) # Link libraries diff --git a/src/lib_pipeline/filter.cpp b/src/lib_pipeline/filter.cpp index 67100f505..4f92821c1 100644 --- a/src/lib_pipeline/filter.cpp +++ b/src/lib_pipeline/filter.cpp @@ -2,7 +2,7 @@ #include "log_sink.hpp" #include "format.hpp" #include "tools.hpp" // enforce -#include "executor_threadpool.hpp" +#include "lib_signals/executor_threadpool.hpp" #include "stats.hpp" #include "filter_input.hpp" diff --git a/src/lib_pipeline/filter.hpp b/src/lib_pipeline/filter.hpp index b315adb53..28953bdac 100644 --- a/src/lib_pipeline/filter.hpp +++ b/src/lib_pipeline/filter.hpp @@ -4,8 +4,8 @@ #include "i_filter.hpp" #include "log_sink.hpp" -#include "executor.hpp" // IExecutor -#include "core/module.hpp" +#include "lib_signals/executor.hpp" // IExecutor +#include "lib_modules/core/module.hpp" using namespace Modules; diff --git a/src/lib_pipeline/filter_input.hpp b/src/lib_pipeline/filter_input.hpp index d509667cd..eeae3b360 100644 --- a/src/lib_pipeline/filter_input.hpp +++ b/src/lib_pipeline/filter_input.hpp @@ -1,6 +1,6 @@ #pragma once -#include "core/module.hpp" +#include "lib_modules/core/module.hpp" namespace Pipelines { diff --git a/src/lib_pipeline/i_filter.hpp b/src/lib_pipeline/i_filter.hpp index 23b151dca..68cea222b 100644 --- a/src/lib_pipeline/i_filter.hpp +++ b/src/lib_pipeline/i_filter.hpp @@ -3,7 +3,7 @@ // Filters are interconnected pipeline elements. // They're seen as such by the applications. -#include "modules.hpp" +#include "lib_modules/modules.hpp" namespace Pipelines { diff --git a/src/lib_pipeline/pipeline.cpp b/src/lib_pipeline/pipeline.cpp index b12d884e7..b40afa875 100644 --- a/src/lib_pipeline/pipeline.cpp +++ b/src/lib_pipeline/pipeline.cpp @@ -2,8 +2,8 @@ #include "stats.hpp" #include "graph.hpp" #include "filter.hpp" -#include "utils/helper.hpp" -#include "utils/loader.hpp" +#include "lib_modules/utils/helper.hpp" +#include "lib_modules/utils/loader.hpp" #include "log.hpp" // g_Log #include "os.hpp" #include "format.hpp" diff --git a/src/lib_pipeline/pipeline.hpp b/src/lib_pipeline/pipeline.hpp index 4febe8fcc..8edeae3d0 100644 --- a/src/lib_pipeline/pipeline.hpp +++ b/src/lib_pipeline/pipeline.hpp @@ -2,7 +2,7 @@ #include "i_filter.hpp" #include "log_sink.hpp" -#include "modules.hpp" +#include "lib_modules/modules.hpp" #include #include #include diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt index a822eb13f..48330ac90 100644 --- a/src/lib_signals/CMakeLists.txt +++ b/src/lib_signals/CMakeLists.txt @@ -4,11 +4,8 @@ add_library(lib_signals INTERFACE) # Specify include directories for the library target_include_directories(lib_signals INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/../ - ${CMAKE_CURRENT_SOURCE_DIR}/../lib_utils - ${CMAKE_SOURCE_DIR}/lib_appcommon - ${CMAKE_SOURCE_DIR}/lib_utils ${CMAKE_SOURCE_DIR}/src/tests + ${CMAKE_SOURCE_DIR}/src ) diff --git a/src/lib_signals/signals.hpp b/src/lib_signals/signals.hpp index d32719e25..f8f997b05 100644 --- a/src/lib_signals/signals.hpp +++ b/src/lib_signals/signals.hpp @@ -3,7 +3,7 @@ #include "signal.hpp" #include "executor.hpp" // ExecutorSync -#include "small_map.hpp" +#include "lib_utils/small_map.hpp" #include #include diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 14b905165..b62d44b0b 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -16,7 +16,9 @@ set(LIB_UTILS_SRCS system_clock.hpp sysclock.cpp ) -include_directories(${BIN_DIR}) +include_directories(${BIN_DIR} +${CMAKE_SOURCE_DIR}/src +) list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) add_library(utils STATIC ${LIB_UTILS_SRCS}) diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index 37aab2d80..524db7184 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -14,7 +14,7 @@ add_library(${PLUGIN_NAME} SHARED ${SOURCES}) # Include directories target_include_directories(${PLUGIN_NAME} PRIVATE - ${CMAKE_SOURCE_DIR}/src/lib_media + ${CMAKE_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index 2804d7baf..abcd02c6d 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -8,5 +8,5 @@ target_link_libraries(FMP4SPLITTER ${CMAKE_THREAD_LIBS_INIT}) # Include directories target_include_directories(FMP4SPLITTER PUBLIC - ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/src ) diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index ce7ad1924..c1bcd10df 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -9,5 +9,5 @@ target_link_libraries(HlsDemuxer ${CMAKE_THREAD_LIBS_INIT}) # Include directories target_include_directories(HlsDemuxer PUBLIC - ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/src ) diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index 1cd646e8a..f19b64242 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -4,7 +4,7 @@ add_library(MulticastInput STATIC ) target_include_directories(MulticastInput PUBLIC - ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/src ) # Link other libraries if necessary diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index 4e029a985..403c6a999 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -5,7 +5,7 @@ add_library(TSDemuxer STATIC # Include directories if needed target_include_directories(TSDemuxer PUBLIC - ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/src ) # Link libraries if required From d738cf515f039f527bc769dcd26b4cd308f7f6e5 Mon Sep 17 00:00:00 2001 From: slarbi Date: Mon, 25 Nov 2024 11:49:09 +0100 Subject: [PATCH 006/182] adding dashcastx --- CMakeLists.txt | 6 +++--- src/CMakeLists.txt | 10 +++++----- src/lib_modules/CMakeLists.txt | 11 +++++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aedf2e12c..f56074e98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ add_custom_target(build_all media plugins dashcastx - ts2ip + #ts2ip player mcastdump mp42tsx @@ -77,8 +77,8 @@ add_custom_target(build_all ) # Add custom install targets (if needed) -install(TARGETS dashcastx ts2ip player mcastdump mp42tsx monitor - RUNTIME DESTINATION bin) +#install(TARGETS dashcastx ts2ip player mcastdump mp42tsx monitor +# RUNTIME DESTINATION bin) set(SYSROOT_PATH "/home/sohaib/motiospell/CWI/sysroot") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ca0cf1731..388aa8ea6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,11 +36,11 @@ endforeach() # Group applications group_target(dashcastx "Applications") -group_target(ts2ip "Applications") -group_target(player "Applications") -group_target(mcastdump "Applications") -group_target(mp42tsx "Applications") -group_target(monitor "Applications") +#group_target(ts2ip "Applications") +#group_target(player "Applications") +#group_target(mcastdump "Applications") +#group_target(mp42tsx "Applications") +#group_target(monitor "Applications") # Group tests group_target(unit_tests "Tests") diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 1c3fb20dd..3564c2243 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -9,23 +9,26 @@ add_library(modules SHARED ) # Add include directories -target_include_directories(modules PRIVATE +target_include_directories(modules PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/lib_modules/utils + ${CMAKE_SOURCE_DIR}/src/lib_modules/core + ) # Add compile flags -target_compile_options(modules PRIVATE +target_compile_options(modules PUBLIC -Wall -Wextra -Werror -fPIC ) # Add linker flags -target_link_options(modules PRIVATE +target_link_options(modules PUBLIC -pthread -Wl,--no-undefined ) # Link dependencies if any -target_link_libraries(modules PRIVATE utils) +target_link_libraries(modules PUBLIC utils) # Set output directory set_target_properties(modules PROPERTIES From befa6fd2a04428ec70aece9771477adf9e7a62f7 Mon Sep 17 00:00:00 2001 From: slarbi Date: Wed, 27 Nov 2024 14:23:59 +0100 Subject: [PATCH 007/182] updating last commit --- src/apps/CMakeLists.txt | 26 +++++------------ src/apps/dashcastx/CMakeLists.txt | 48 +++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 src/apps/dashcastx/CMakeLists.txt diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index 3c294c9ea..552e3593e 100644 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -1,19 +1,7 @@ -file(GLOB_RECURSE APPS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp") - -add_executable(dashcastx dashcastx/main.cpp) -target_link_libraries(dashcastx PRIVATE media modules pipeline appcommon utils) - -add_executable(ts2ip ts2ip/main.cpp) -target_link_libraries(ts2ip PRIVATE plugins media modules pipeline appcommon utils) - -add_executable(player player/player.cpp player/pipeliner_player.cpp) -target_link_libraries(player PRIVATE plugins media modules pipeline appcommon utils) - -add_executable(mcastdump mcastdump/main.cpp) -target_link_libraries(mcastdump PRIVATE plugins media modules pipeline appcommon utils) - -add_executable(mp42tsx mp42tsx/mp42tsx.cpp mp42tsx/options.cpp mp42tsx/pipeliner_mp42ts.cpp) -target_link_libraries(mp42tsx PRIVATE plugins media modules pipeline appcommon utils) - -add_executable(monitor monitor/main.cpp) -target_link_libraries(monitor PRIVATE plugins media modules pipeline appcommon utils) +# Include subdirectories for each app +add_subdirectory(dashcastx) +#add_subdirectory(ts2ip) +#add_subdirectory(player) +#add_subdirectory(mcastdump) +#add_subdirectory(mp42tsx) +#add_subdirectory(monitor) \ No newline at end of file diff --git a/src/apps/dashcastx/CMakeLists.txt b/src/apps/dashcastx/CMakeLists.txt new file mode 100644 index 000000000..866c3223c --- /dev/null +++ b/src/apps/dashcastx/CMakeLists.txt @@ -0,0 +1,48 @@ +# Define the path to the sources +set(DASHCASTX_SRCS + main.cpp + pipeliner_dashcastx.cpp + ../../lib_appcommon/safemain.cpp +) + +# Add other source files from libraries (you may need to define these sources separately) +file(GLOB LIB_MEDIA_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_media/*.cpp +) + +file(GLOB LIB_MODULES_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp +) + + +# Combine all source files into a single list +list(APPEND DASHCASTX_SRCS + ${LIB_MEDIA_SRCS} + ${LIB_MODULES_SRCS} +) + +# Define the executable +add_executable(dashcastx ${DASHCASTX_SRCS}) + +# Include directories for libraries (e.g., appcommon, media, etc.) +target_include_directories(dashcastx PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../../lib_appcommon + ${CMAKE_SOURCE_DIR}/src/lib_modules/ +) + +# Link libraries to the executable +target_link_libraries(dashcastx PRIVATE + media + modules + pipeline + appcommon + utils +) + +# Optionally, set the output name or location (if needed) +set_target_properties(dashcastx PROPERTIES + OUTPUT_NAME "dashcastx.exe" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) From f128baab37b9d69bb885b76da6c43296aa628637 Mon Sep 17 00:00:00 2001 From: slarbi Date: Wed, 27 Nov 2024 14:45:32 +0100 Subject: [PATCH 008/182] adding ts2ip --- src/apps/CMakeLists.txt | 13 ++++++++++++- src/apps/dashcastx/CMakeLists.txt | 6 ------ src/apps/ts2ip/CMakeLists.txt | 28 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 src/apps/ts2ip/CMakeLists.txt diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index 552e3593e..252ab1701 100644 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -1,6 +1,17 @@ +file(GLOB LIB_MODULES_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp +) + + +file(GLOB LIB_MEDIA_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_media/*.cpp +) + + # Include subdirectories for each app add_subdirectory(dashcastx) -#add_subdirectory(ts2ip) +add_subdirectory(ts2ip) #add_subdirectory(player) #add_subdirectory(mcastdump) #add_subdirectory(mp42tsx) diff --git a/src/apps/dashcastx/CMakeLists.txt b/src/apps/dashcastx/CMakeLists.txt index 866c3223c..55c71fa59 100644 --- a/src/apps/dashcastx/CMakeLists.txt +++ b/src/apps/dashcastx/CMakeLists.txt @@ -5,16 +5,10 @@ set(DASHCASTX_SRCS ../../lib_appcommon/safemain.cpp ) -# Add other source files from libraries (you may need to define these sources separately) file(GLOB LIB_MEDIA_SRCS ${CMAKE_SOURCE_DIR}/src/lib_media/*.cpp ) -file(GLOB LIB_MODULES_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp - ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp -) - # Combine all source files into a single list list(APPEND DASHCASTX_SRCS diff --git a/src/apps/ts2ip/CMakeLists.txt b/src/apps/ts2ip/CMakeLists.txt new file mode 100644 index 000000000..7e3f9536c --- /dev/null +++ b/src/apps/ts2ip/CMakeLists.txt @@ -0,0 +1,28 @@ +set(EXE_MCASTDUMP_SRCS + ${LIB_MODULES_SRCS} + ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp +) + + +# Add an executable target +add_executable(ts2ip ${EXE_MCASTDUMP_SRCS}) + +# Set the output directory for the executable +set_target_properties(ts2ip PROPERTIES + OUTPUT_NAME "ts2ip.exe" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Include directories for the executable +target_include_directories(ts2ip PRIVATE + ${CMAKE_SOURCE_DIR}/src/lib_modules +) + +# Link necessary libraries (adjust as needed) +target_link_libraries(ts2ip PRIVATE + media + modules + pipeline + utils + appcommon +) From e9cfc8cdec6de7065004b82122b96afd3ad120c6 Mon Sep 17 00:00:00 2001 From: slarbi Date: Wed, 27 Nov 2024 14:50:11 +0100 Subject: [PATCH 009/182] add monitor --- src/apps/CMakeLists.txt | 2 +- src/apps/monitor/CMakeLists.txt | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/apps/monitor/CMakeLists.txt diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index 252ab1701..162e185e4 100644 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -15,4 +15,4 @@ add_subdirectory(ts2ip) #add_subdirectory(player) #add_subdirectory(mcastdump) #add_subdirectory(mp42tsx) -#add_subdirectory(monitor) \ No newline at end of file +add_subdirectory(monitor) \ No newline at end of file diff --git a/src/apps/monitor/CMakeLists.txt b/src/apps/monitor/CMakeLists.txt new file mode 100644 index 000000000..6da4c6075 --- /dev/null +++ b/src/apps/monitor/CMakeLists.txt @@ -0,0 +1,27 @@ +set(EXE_MONITOR_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp +) + + +# Add an executable target +add_executable(monitor ${EXE_MONITOR_SRCS}) + +# Set the output directory for the executable +set_target_properties(monitor PROPERTIES + OUTPUT_NAME "monitor.exe" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Include directories for the executable +target_include_directories(monitor PRIVATE +# ${CMAKE_SOURCE_DIR}/src/lib_modules +) + +# Link necessary libraries (adjust as needed) +target_link_libraries(monitor PRIVATE + media + modules + pipeline + utils + appcommon +) From 9972477f99a5c19c4fa525b1c2d4d0a392b29adf Mon Sep 17 00:00:00 2001 From: slarbi Date: Wed, 27 Nov 2024 15:06:37 +0100 Subject: [PATCH 010/182] adding mp42tsx --- src/apps/CMakeLists.txt | 2 +- src/apps/monitor/CMakeLists.txt | 1 - src/apps/mp42tsx/CMakeLists.txt | 31 +++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/apps/mp42tsx/CMakeLists.txt diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index 162e185e4..80d00ecae 100644 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -14,5 +14,5 @@ add_subdirectory(dashcastx) add_subdirectory(ts2ip) #add_subdirectory(player) #add_subdirectory(mcastdump) -#add_subdirectory(mp42tsx) +add_subdirectory(mp42tsx) add_subdirectory(monitor) \ No newline at end of file diff --git a/src/apps/monitor/CMakeLists.txt b/src/apps/monitor/CMakeLists.txt index 6da4c6075..a63b2aed8 100644 --- a/src/apps/monitor/CMakeLists.txt +++ b/src/apps/monitor/CMakeLists.txt @@ -14,7 +14,6 @@ set_target_properties(monitor PROPERTIES # Include directories for the executable target_include_directories(monitor PRIVATE -# ${CMAKE_SOURCE_DIR}/src/lib_modules ) # Link necessary libraries (adjust as needed) diff --git a/src/apps/mp42tsx/CMakeLists.txt b/src/apps/mp42tsx/CMakeLists.txt new file mode 100644 index 000000000..b7e2fd53b --- /dev/null +++ b/src/apps/mp42tsx/CMakeLists.txt @@ -0,0 +1,31 @@ +set(EXE_MP42TSX_SRCS + ${LIB_MODULES_SRCS} + ${CMAKE_CURRENT_SOURCE_DIR}/mp42tsx.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/options.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipeliner_mp42ts.cpp + ) + + +# Add an executable target +add_executable(mp42tsx ${EXE_MP42TSX_SRCS}) + +# Set the output directory for the executable +set_target_properties(mp42tsx PROPERTIES + OUTPUT_NAME "mp42tsx.exe" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Include directories for the executable +target_include_directories(mp42tsx PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/lib_modules +) + +# Link necessary libraries (adjust as needed) +target_link_libraries(mp42tsx PRIVATE + media + modules + pipeline + utils + appcommon +) From 6b9283fb25399f698ea5c67c906e9dc79f063054 Mon Sep 17 00:00:00 2001 From: slarbi Date: Wed, 27 Nov 2024 15:13:08 +0100 Subject: [PATCH 011/182] adding player --- src/apps/CMakeLists.txt | 2 +- src/apps/player/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/apps/player/CMakeLists.txt diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index 80d00ecae..5f8d53170 100644 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -12,7 +12,7 @@ file(GLOB LIB_MEDIA_SRCS # Include subdirectories for each app add_subdirectory(dashcastx) add_subdirectory(ts2ip) -#add_subdirectory(player) +add_subdirectory(player) #add_subdirectory(mcastdump) add_subdirectory(mp42tsx) add_subdirectory(monitor) \ No newline at end of file diff --git a/src/apps/player/CMakeLists.txt b/src/apps/player/CMakeLists.txt new file mode 100644 index 000000000..e8a6de2ef --- /dev/null +++ b/src/apps/player/CMakeLists.txt @@ -0,0 +1,30 @@ +set(EXE_PLAYER_SRCS + ${LIB_MODULES_SRCS} + ${CMAKE_CURRENT_SOURCE_DIR}/player.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipeliner_player.cpp + ) + + +# Add an executable target +add_executable(player ${EXE_PLAYER_SRCS}) + +# Set the output directory for the executable +set_target_properties(player PROPERTIES + OUTPUT_NAME "player.exe" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Include directories for the executable +target_include_directories(player PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/lib_modules +) + +# Link necessary libraries (adjust as needed) +target_link_libraries(player PRIVATE + media + modules + pipeline + utils + appcommon +) From 8b7c60d8d2bf24683d1d11561a1f793fe29c6aaf Mon Sep 17 00:00:00 2001 From: slarbi Date: Wed, 27 Nov 2024 15:18:26 +0100 Subject: [PATCH 012/182] adding mcastdump --- src/apps/CMakeLists.txt | 2 +- src/apps/dashcastx/CMakeLists.txt | 4 ---- src/apps/mcastdump/CMakeLists.txt | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/apps/mcastdump/CMakeLists.txt diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index 5f8d53170..3dcacfc19 100644 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -13,6 +13,6 @@ file(GLOB LIB_MEDIA_SRCS add_subdirectory(dashcastx) add_subdirectory(ts2ip) add_subdirectory(player) -#add_subdirectory(mcastdump) +add_subdirectory(mcastdump) add_subdirectory(mp42tsx) add_subdirectory(monitor) \ No newline at end of file diff --git a/src/apps/dashcastx/CMakeLists.txt b/src/apps/dashcastx/CMakeLists.txt index 55c71fa59..4856b69d9 100644 --- a/src/apps/dashcastx/CMakeLists.txt +++ b/src/apps/dashcastx/CMakeLists.txt @@ -5,10 +5,6 @@ set(DASHCASTX_SRCS ../../lib_appcommon/safemain.cpp ) -file(GLOB LIB_MEDIA_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_media/*.cpp -) - # Combine all source files into a single list list(APPEND DASHCASTX_SRCS diff --git a/src/apps/mcastdump/CMakeLists.txt b/src/apps/mcastdump/CMakeLists.txt new file mode 100644 index 000000000..018f71f8c --- /dev/null +++ b/src/apps/mcastdump/CMakeLists.txt @@ -0,0 +1,29 @@ +set(EXE_MCASTDUMP_SRCS + ${LIB_MODULES_SRCS} + ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp +) + + +# Add an executable target +add_executable(mcastdump ${EXE_MCASTDUMP_SRCS}) + +# Set the output directory for the executable +set_target_properties(mcastdump PROPERTIES + OUTPUT_NAME "mcastdump.exe" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +# Include directories for the executable +target_include_directories(mcastdump PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/lib_modules +) + +# Link necessary libraries (adjust as needed) +target_link_libraries(mcastdump PRIVATE + media + modules + pipeline + utils + appcommon +) From 53bc9389400bdf42645f41abaac37f2149579abb Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 15:03:28 +0100 Subject: [PATCH 013/182] adding shared AVCC2AnnexBConverter --- src/lib_media/CMakeLists.txt | 158 ++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 3 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index a9f98f024..0f7d09f45 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -1,12 +1,164 @@ -file(GLOB_RECURSE LIB_MEDIA_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp") -file(GLOB_RECURSE LIB_MEDIA_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/**/*.hpp") +# Include source files +set(LIB_MEDIA_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/common/expand_vars.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/http_puller.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/http_sender.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/iso8601.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/mpeg_dash_parser.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/sax_xml_parser.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/xml.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/demux/dash_demux.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/in/file.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/in/mpeg_dash_input.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/in/sound_generator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/in/video_generator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/out/file.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/out/http.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/out/http_sink.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/out/null.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/out/print.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/stream/apple_hls.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/stream/ms_hss.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/stream/adaptive_streaming_common.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/transform/audio_gap_filler.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/transform/restamp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/transform/rectifier.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils/recorder.cpp +) +# Define the media library add_library(media STATIC ${LIB_MEDIA_SRCS}) target_include_directories(media PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ - ) +) target_link_libraries(media PRIVATE modules pipeline appcommon utils) +file(GLOB LIB_MODULES_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp +) + +# Define source files for the AVCC2AnnexBConverter +set(EXE_AVCC2ANNEXBCONVERTER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/transform/avcc2annexb.cpp +) + +# Combine all source files into a single list +list(APPEND EXE_AVCC2ANNEXBCONVERTER_SRCS + ${LIB_MODULES_SRCS} +) + +# Add the target (AVCC2AnnexBConverter.smd) +add_library(AVCC2AnnexBConverter SHARED ${EXE_AVCC2ANNEXBCONVERTER_SRCS}) + +# Include directories for the module +target_include_directories(AVCC2AnnexBConverter PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ +) + +target_link_libraries(AVCC2AnnexBConverter PRIVATE media modules pipeline appcommon utils) + +set_target_properties(AVCC2AnnexBConverter PROPERTIES + OUTPUT_NAME "AVCC2AnnexBConverter" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" +) + + + + + +# add_executable(LibavMuxHLSTS +# "${CMAKE_CURRENT_SOURCE_DIR}/stream/hls_muxer_libav.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# ) +# target_link_libraries(LibavMuxHLSTS PRIVATE media avutil avcodec) + +# add_executable(VideoConvert +# "${CMAKE_CURRENT_SOURCE_DIR}/transform/video_convert.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" +# ) +# target_link_libraries(VideoConvert PRIVATE media avutil avcodec swscale) + +# add_executable(AudioConvert +# "${CMAKE_CURRENT_SOURCE_DIR}/transform/audio_convert.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# ) +# target_link_libraries(AudioConvert PRIVATE media avutil avcodec swresample) + +# add_executable(JPEGTurboDecode +# "${CMAKE_CURRENT_SOURCE_DIR}/decode/jpegturbo_decode.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" +# ) +# target_link_libraries(JPEGTurboDecode PRIVATE media turbojpeg) + +# add_executable(JPEGTurboEncode +# "${CMAKE_CURRENT_SOURCE_DIR}/encode/jpegturbo_encode.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" +# ) +# target_link_libraries(JPEGTurboEncode PRIVATE media turbojpeg) + +# add_executable(Encoder +# "${CMAKE_CURRENT_SOURCE_DIR}/encode/libav_encode.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" +# ) +# target_link_libraries(Encoder PRIVATE media avcodec avutil) + +# add_executable(Decoder +# "${CMAKE_CURRENT_SOURCE_DIR}/decode/decoder.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" +# ) +# target_link_libraries(Decoder PRIVATE media avcodec avutil) + +# add_executable(LibavDemux +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/demux/libav_demux.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/transform/restamp.cpp" +# ) +# target_link_libraries(LibavDemux PRIVATE media avformat avcodec avutil avdevice) + +# add_executable(LibavMux +# "${CMAKE_CURRENT_SOURCE_DIR}/mux/libav_mux.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# ) +# target_link_libraries(LibavMux PRIVATE media avformat avcodec avutil) + +# add_executable(LibavFilter +# "${CMAKE_CURRENT_SOURCE_DIR}/transform/libavfilter.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" +# ) +# target_link_libraries(LibavFilter PRIVATE media avfilter avcodec avutil) + +# add_executable(GPACMuxMP4 "${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4.cpp") +# target_link_libraries(GPACMuxMP4 PRIVATE media gpac) + +# add_executable(GPACMuxMP4MSS +# "${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4_mss.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4.cpp" +# ) +# target_link_libraries(GPACMuxMP4MSS PRIVATE media gpac) + +# add_executable(GPACDemuxMP4Simple "${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_simple.cpp") +# target_link_libraries(GPACDemuxMP4Simple PRIVATE media gpac) + +# add_executable(GPACDemuxMP4Full "${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_full.cpp") +# target_link_libraries(GPACDemuxMP4Full PRIVATE media gpac) + +# add_executable(FileSystemSink "${CMAKE_CURRENT_SOURCE_DIR}/out/filesystem.cpp") +# target_link_libraries(FileSystemSink PRIVATE media) + +# add_executable(LogoOverlay "${CMAKE_CURRENT_SOURCE_DIR}/transform/logo_overlay.cpp") +# target_link_libraries(LogoOverlay PRIVATE media) From 67f126a1583ee418a902d73990e81c4b4949a9bf Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 15:09:31 +0100 Subject: [PATCH 014/182] adding LibavMuxHLSTS.smd --- src/lib_media/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 0f7d09f45..5b181f31a 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -72,6 +72,36 @@ set_target_properties(AVCC2AnnexBConverter PROPERTIES +# Define source files for the LibavMuxHLSTS +set(EXE_LIBAVMUXHLSTS_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/stream/hls_muxer_libav.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp +) + +# Combine all source files into a single list +list(APPEND EXE_LIBAVMUXHLSTS_SRCS + ${LIB_MODULES_SRCS} +) + +# Add the target (LibavMuxHLSTS.smd) +add_library(LibavMuxHLSTS SHARED ${EXE_LIBAVMUXHLSTS_SRCS}) + +# Include directories for the module +target_include_directories(LibavMuxHLSTS PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ +) + +# Link libraries to the target +target_link_libraries(LibavMuxHLSTS PRIVATE media modules pipeline appcommon utils avutil avcodec) + +# Set target properties +set_target_properties(LibavMuxHLSTS PROPERTIES + OUTPUT_NAME "LibavMuxHLSTS" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" +) # add_executable(LibavMuxHLSTS From 51d86fb0be0ee6d0ba773d8cc20aec3777d064a3 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 15:15:29 +0100 Subject: [PATCH 015/182] adding videoconverter.smd --- src/lib_media/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 5b181f31a..80252a4da 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -104,11 +104,42 @@ set_target_properties(LibavMuxHLSTS PROPERTIES ) -# add_executable(LibavMuxHLSTS -# "${CMAKE_CURRENT_SOURCE_DIR}/stream/hls_muxer_libav.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# ) -# target_link_libraries(LibavMuxHLSTS PRIVATE media avutil avcodec) +# Define source files for the VideoConvert target +set(EXE_VIDEOCONVERTER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/transform/video_convert.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp +) + +list(APPEND EXE_VIDEOCONVERTER_SRCS + ${LIB_MODULES_SRCS} +) + +# Add the target (VideoConvert.smd) +add_library(VideoConvert SHARED ${EXE_VIDEOCONVERTER_SRCS}) + +# Include directories for the module +target_include_directories(VideoConvert PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ +) + +# Link the necessary libraries +target_link_libraries(VideoConvert PRIVATE + media modules pipeline appcommon utils + avcodec avutil swscale +) + +# Set properties for the target +set_target_properties(VideoConvert PROPERTIES + OUTPUT_NAME "VideoConvert" # Output name without extension + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) + + + # add_executable(VideoConvert # "${CMAKE_CURRENT_SOURCE_DIR}/transform/video_convert.cpp" From ffe1f61fe3bacef4be310419d8ae76af11e29f23 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 15:34:53 +0100 Subject: [PATCH 016/182] adding remaining libmedia .smd targets --- src/lib_media/CMakeLists.txt | 249 +++++++++++++++++++++++------------ 1 file changed, 167 insertions(+), 82 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 80252a4da..6e8213216 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -139,87 +139,172 @@ set_target_properties(VideoConvert PROPERTIES ) +# AudioConvert target +set(EXE_AUDIOCONVERTER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/transform/audio_convert.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp +) +list(APPEND EXE_AUDIOCONVERTER_SRCS ${LIB_MODULES_SRCS}) +add_library(AudioConvert SHARED ${EXE_AUDIOCONVERTER_SRCS}) +target_include_directories(AudioConvert PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(AudioConvert PRIVATE media modules pipeline appcommon utils avcodec avutil swresample) +set_target_properties(AudioConvert PROPERTIES OUTPUT_NAME "AudioConvert" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + +# JPEGTurboDecode target +set(EXE_JPEGTURBODECODE_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/decode/jpegturbo_decode.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp +) +list(APPEND EXE_JPEGTURBODECODE_SRCS ${LIB_MODULES_SRCS}) +add_library(JPEGTurboDecode SHARED ${EXE_JPEGTURBODECODE_SRCS}) +target_include_directories(JPEGTurboDecode PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(JPEGTurboDecode PRIVATE media modules pipeline appcommon utils turbojpeg) +set_target_properties(JPEGTurboDecode PROPERTIES OUTPUT_NAME "JPEGTurboDecode" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + + +# JPEGTurboEncode target +set(EXE_JPEGTURBOENCODE_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/encode/jpegturbo_encode.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp +) +list(APPEND EXE_JPEGTURBOENCODE_SRCS ${LIB_MODULES_SRCS}) +add_library(JPEGTurboEncode SHARED ${EXE_JPEGTURBOENCODE_SRCS}) +target_include_directories(JPEGTurboEncode PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(JPEGTurboEncode PRIVATE media modules pipeline appcommon utils turbojpeg) +set_target_properties(JPEGTurboEncode PROPERTIES OUTPUT_NAME "JPEGTurboEncode" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + + +# Encoder target +set(EXE_ENCODER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/encode/libav_encode.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp +) +list(APPEND EXE_ENCODER_SRCS ${LIB_MODULES_SRCS}) +add_library(Encoder SHARED ${EXE_ENCODER_SRCS}) +target_include_directories(Encoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(Encoder PRIVATE media modules pipeline appcommon utils avcodec avutil) +set_target_properties(Encoder PROPERTIES OUTPUT_NAME "Encoder" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + + +# Decoder target +set(EXE_DECODER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/decode/decoder.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp +) +list(APPEND EXE_DECODER_SRCS ${LIB_MODULES_SRCS}) +add_library(Decoder SHARED ${EXE_DECODER_SRCS}) +target_include_directories(Decoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(Decoder PRIVATE media modules pipeline appcommon utils avcodec avutil) +set_target_properties(Decoder PROPERTIES OUTPUT_NAME "Decoder" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + +# LibavDemux target +set(EXE_LIBAVDEMUX_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/demux/libav_demux.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/transform/restamp.cpp +) +list(APPEND EXE_LIBAVDEMUX_SRCS ${LIB_MODULES_SRCS}) +add_library(LibavDemux SHARED ${EXE_LIBAVDEMUX_SRCS}) +target_include_directories(LibavDemux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(LibavDemux PRIVATE media modules pipeline appcommon utils avformat avcodec avutil avdevice) +set_target_properties(LibavDemux PROPERTIES OUTPUT_NAME "LibavDemux" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + +# LibavMux target +set(EXE_LIBAVMUX_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/mux/libav_mux.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp +) +list(APPEND EXE_LIBAVMUX_SRCS ${LIB_MODULES_SRCS}) +add_library(LibavMux SHARED ${EXE_LIBAVMUX_SRCS}) +target_include_directories(LibavMux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(LibavMux PRIVATE media modules pipeline appcommon utils avformat avcodec avutil) +set_target_properties(LibavMux PROPERTIES OUTPUT_NAME "LibavMux" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + +# LibavFilter target +set(EXE_LIBAVFILTER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/transform/libavfilter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp +) +list(APPEND EXE_LIBAVFILTER_SRCS ${LIB_MODULES_SRCS}) +add_library(LibavFilter SHARED ${EXE_LIBAVFILTER_SRCS}) +target_include_directories(LibavFilter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(LibavFilter PRIVATE media modules pipeline appcommon utils avfilter avcodec avutil) +set_target_properties(LibavFilter PROPERTIES OUTPUT_NAME "LibavFilter" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + + +# GPACMuxMP4 target +set(EXE_GPACMUXMP4_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4.cpp +) +list(APPEND EXE_GPACMUXMP4_SRCS ${LIB_MODULES_SRCS}) +add_library(GPACMuxMP4 SHARED ${EXE_GPACMUXMP4_SRCS}) +target_include_directories(GPACMuxMP4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(GPACMuxMP4 PRIVATE media modules pipeline appcommon utils gpac) +set_target_properties(GPACMuxMP4 PROPERTIES OUTPUT_NAME "GPACMuxMP4" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + +# GPACMuxMP4MSS target +set(EXE_GPACMUXMP4MSS_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4_mss.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4.cpp +) +list(APPEND EXE_GPACMUXMP4MSS_SRCS ${LIB_MODULES_SRCS}) +add_library(GPACMuxMP4MSS SHARED ${EXE_GPACMUXMP4MSS_SRCS}) +target_include_directories(GPACMuxMP4MSS PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(GPACMuxMP4MSS PRIVATE media modules pipeline appcommon utils gpac) +set_target_properties(GPACMuxMP4MSS PROPERTIES OUTPUT_NAME "GPACMuxMP4MSS" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + +# GPACDemuxMP4Simple target +set(EXE_GPACDEMUXMP4SIMPLE_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_simple.cpp +) +list(APPEND EXE_GPACDEMUXMP4SIMPLE_SRCS ${LIB_MODULES_SRCS}) +add_library(GPACDemuxMP4Simple SHARED ${EXE_GPACDEMUXMP4SIMPLE_SRCS}) +target_include_directories(GPACDemuxMP4Simple PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(GPACDemuxMP4Simple PRIVATE media modules pipeline appcommon utils gpac) +set_target_properties(GPACDemuxMP4Simple PROPERTIES OUTPUT_NAME "GPACDemuxMP4Simple" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + +# GPACDemuxMP4Full target +set(EXE_GPACDEMUXMP4FULL_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_full.cpp +) +list(APPEND EXE_GPACDEMUXMP4FULL_SRCS ${LIB_MODULES_SRCS}) +add_library(GPACDemuxMP4Full SHARED ${EXE_GPACDEMUXMP4FULL_SRCS}) +target_include_directories(GPACDemuxMP4Full PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(GPACDemuxMP4Full PRIVATE media modules pipeline appcommon utils gpac) +set_target_properties(GPACDemuxMP4Full PROPERTIES OUTPUT_NAME "GPACDemuxMP4Full" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + + +# FileSystemSink target +set(EXE_FILESYSTEMSINK_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/out/filesystem.cpp +) +list(APPEND EXE_FILESYSTEMSINK_SRCS ${LIB_MODULES_SRCS}) +add_library(FileSystemSink SHARED ${EXE_FILESYSTEMSINK_SRCS}) +target_include_directories(FileSystemSink PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(FileSystemSink PRIVATE media modules pipeline appcommon utils) +set_target_properties(FileSystemSink PROPERTIES OUTPUT_NAME "FileSystemSink" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") + +# LogoOverlay target +set(EXE_LOGOOVERLAY_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/transform/logo_overlay.cpp +) +list(APPEND EXE_LOGOOVERLAY_SRCS ${LIB_MODULES_SRCS}) +add_library(LogoOverlay SHARED ${EXE_LOGOOVERLAY_SRCS}) +target_include_directories(LogoOverlay PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) +target_link_libraries(LogoOverlay PRIVATE media modules pipeline appcommon utils) +set_target_properties(LogoOverlay PROPERTIES OUTPUT_NAME "LogoOverlay" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") -# add_executable(VideoConvert -# "${CMAKE_CURRENT_SOURCE_DIR}/transform/video_convert.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" -# ) -# target_link_libraries(VideoConvert PRIVATE media avutil avcodec swscale) - -# add_executable(AudioConvert -# "${CMAKE_CURRENT_SOURCE_DIR}/transform/audio_convert.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# ) -# target_link_libraries(AudioConvert PRIVATE media avutil avcodec swresample) - -# add_executable(JPEGTurboDecode -# "${CMAKE_CURRENT_SOURCE_DIR}/decode/jpegturbo_decode.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" -# ) -# target_link_libraries(JPEGTurboDecode PRIVATE media turbojpeg) - -# add_executable(JPEGTurboEncode -# "${CMAKE_CURRENT_SOURCE_DIR}/encode/jpegturbo_encode.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" -# ) -# target_link_libraries(JPEGTurboEncode PRIVATE media turbojpeg) - -# add_executable(Encoder -# "${CMAKE_CURRENT_SOURCE_DIR}/encode/libav_encode.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" -# ) -# target_link_libraries(Encoder PRIVATE media avcodec avutil) - -# add_executable(Decoder -# "${CMAKE_CURRENT_SOURCE_DIR}/decode/decoder.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" -# ) -# target_link_libraries(Decoder PRIVATE media avcodec avutil) - -# add_executable(LibavDemux -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/demux/libav_demux.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/transform/restamp.cpp" -# ) -# target_link_libraries(LibavDemux PRIVATE media avformat avcodec avutil avdevice) - -# add_executable(LibavMux -# "${CMAKE_CURRENT_SOURCE_DIR}/mux/libav_mux.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# ) -# target_link_libraries(LibavMux PRIVATE media avformat avcodec avutil) - -# add_executable(LibavFilter -# "${CMAKE_CURRENT_SOURCE_DIR}/transform/libavfilter.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp" -# ) -# target_link_libraries(LibavFilter PRIVATE media avfilter avcodec avutil) - -# add_executable(GPACMuxMP4 "${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4.cpp") -# target_link_libraries(GPACMuxMP4 PRIVATE media gpac) - -# add_executable(GPACMuxMP4MSS -# "${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4_mss.cpp" -# "${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4.cpp" -# ) -# target_link_libraries(GPACMuxMP4MSS PRIVATE media gpac) - -# add_executable(GPACDemuxMP4Simple "${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_simple.cpp") -# target_link_libraries(GPACDemuxMP4Simple PRIVATE media gpac) - -# add_executable(GPACDemuxMP4Full "${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_full.cpp") -# target_link_libraries(GPACDemuxMP4Full PRIVATE media gpac) - -# add_executable(FileSystemSink "${CMAKE_CURRENT_SOURCE_DIR}/out/filesystem.cpp") -# target_link_libraries(FileSystemSink PRIVATE media) - -# add_executable(LogoOverlay "${CMAKE_CURRENT_SOURCE_DIR}/transform/logo_overlay.cpp") -# target_link_libraries(LogoOverlay PRIVATE media) From aa1cc09258e8c9308c9195091ca9db2de419dc0d Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 16:22:26 +0100 Subject: [PATCH 017/182] adding smd to plugins dasher, fmp4splitter hlsdemux --- src/plugins/Dasher/CMakeLists.txt | 47 ++++++++++++++----------- src/plugins/Fmp4Splitter/CMakeLists.txt | 10 +++++- src/plugins/HlsDemuxer/CMakeLists.txt | 39 +++++++++++++++----- 3 files changed, 66 insertions(+), 30 deletions(-) diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index 524db7184..0c66b0d69 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -1,32 +1,37 @@ -# Define the plugin target -set(PLUGIN_NAME MPEG_DASH) - -# Add source files -set(SOURCES +# Define source files for the MPEG_DASH target +set(EXE_MPEG_DASH_SRCS ${CMAKE_SOURCE_DIR}/src/lib_media/common/xml.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mpeg_dash.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mpd.cpp ) +file(GLOB LIB_MODULES_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp +) -# Add the plugin as a library or executable as per requirements -# Here we assume it's a shared library based on `.smd` extension -add_library(${PLUGIN_NAME} SHARED ${SOURCES}) -# Include directories -target_include_directories(${PLUGIN_NAME} PRIVATE - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_CURRENT_SOURCE_DIR} +list(APPEND EXE_MPEG_DASH_SRCS + ${LIB_MODULES_SRCS} ) -# Link dependencies (if any) -# Replace `your_dependency` with actual targets if needed -# target_link_libraries(${PLUGIN_NAME} PRIVATE your_dependency) +# Add the target (MPEG_DASH.smd) +add_library(MPEG_DASH SHARED ${EXE_MPEG_DASH_SRCS}) -# Set the output directory for the plugin -set_target_properties(${PLUGIN_NAME} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +# Include directories for the module +target_include_directories(MPEG_DASH PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) + +# Link the necessary libraries +target_link_libraries(MPEG_DASH PRIVATE + media modules pipeline appcommon utils ) -# Installation -install(TARGETS ${PLUGIN_NAME} DESTINATION bin) +# Set properties for the target +set_target_properties(MPEG_DASH PROPERTIES + OUTPUT_NAME "MPEG_DASH" # Output name without extension + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index abcd02c6d..0c49b91f5 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -1,5 +1,5 @@ # Define the plugin library -add_library(FMP4SPLITTER STATIC +add_library(FMP4SPLITTER SHARED fmp4_splitter.cpp ) @@ -10,3 +10,11 @@ target_link_libraries(FMP4SPLITTER ${CMAKE_THREAD_LIBS_INIT}) target_include_directories(FMP4SPLITTER PUBLIC ${CMAKE_SOURCE_DIR}/src ) + +# Set properties for the target +set_target_properties(FMP4SPLITTER PROPERTIES + OUTPUT_NAME "Fmp4Splitter" # Output name without extension + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index c1bcd10df..5509ff379 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -1,13 +1,36 @@ -# Define the plugin library -add_library(HlsDemuxer STATIC +# Define source files for the HlsDemuxer target +set(EXE_HlsDemuxer_SRCS hls_demux.cpp - hls_demux.hpp + ${CMAKE_SOURCE_DIR}/src/lib_media/common/http_puller.cpp + ) +file(GLOB LIB_MODULES_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp ) -# Link dependencies if any -target_link_libraries(HlsDemuxer ${CMAKE_THREAD_LIBS_INIT}) -# Include directories -target_include_directories(HlsDemuxer PUBLIC - ${CMAKE_SOURCE_DIR}/src +list(APPEND EXE_HlsDemuxer_SRCS + ${LIB_MODULES_SRCS} +) + +# Add the target (HlsDemuxer.smd) +add_library(HlsDemuxer SHARED ${EXE_HlsDemuxer_SRCS}) + +# Include directories for the module +target_include_directories(HlsDemuxer PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) + +# Link the necessary libraries +target_link_libraries(HlsDemuxer PRIVATE + media modules pipeline appcommon utils curl +) + +# Set properties for the target +set_target_properties(HlsDemuxer PROPERTIES + OUTPUT_NAME "HlsDemuxer" # Output name without extension + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # ) From 9c78c93266fd0c446b3b863f197aea0bd0828947 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 16:31:36 +0100 Subject: [PATCH 018/182] adding MulticastInput to bin folder --- src/plugins/MulticastInput/CMakeLists.txt | 42 ++++++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index f19b64242..e4701b4aa 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -1,11 +1,43 @@ -add_library(MulticastInput STATIC - multicast_input.cpp - multicast_input.hpp +# Define the plugin library (MulticastInput) +set(MulticastInput_src + ${CMAKE_CURRENT_SOURCE_DIR}/multicast_input.cpp # Main plugin source ) +# Platform-specific socket source files +if(MSVC) + # MSVC-specific socket file + list(APPEND MulticastInput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_mingw.cpp) +elseif(MINGW) + # MinGW-specific socket file + list(APPEND MulticastInput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_mingw.cpp) +elseif(APPLE) + # macOS/Darwin-specific socket file + list(APPEND MulticastInput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_gnu.cpp) +elseif(UNIX) + # Linux-specific socket file + list(APPEND MulticastInput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_gnu.cpp) +else() + message(FATAL_ERROR "Unsupported platform") +endif() + +# Add the MulticastInput plugin +add_library(MulticastInput SHARED ${MulticastInput_src}) + +# Link dependencies +target_link_libraries(MulticastInput + ${CMAKE_THREAD_LIBS_INIT} +) + +# Include directories target_include_directories(MulticastInput PUBLIC ${CMAKE_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR} ) -# Link other libraries if necessary -target_link_libraries(MulticastInput ${CMAKE_THREAD_LIBS_INIT}) +# Set properties for the target +set_target_properties(MulticastInput PROPERTIES + OUTPUT_NAME "MulticastInput" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) From cb8de8e9cc57f2ac7054e49b494885ebd67c9770 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 16:41:24 +0100 Subject: [PATCH 019/182] adding SDL render plugin --- src/plugins/CMakeLists.txt | 7 +-- src/plugins/SdlRender/CMakeLists.txt | 79 ++++++++++++++-------------- 2 files changed, 41 insertions(+), 45 deletions(-) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index a076b7136..ec6dcf7f6 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,9 +1,4 @@ -# Optionally enable X11 support -if(SIGNALS_HAS_X11) - add_subdirectory(SdlRender) -endif() - -# Include other plugins +add_subdirectory(SdlRender) add_subdirectory(HlsDemuxer) add_subdirectory(MulticastInput) add_subdirectory(UdpOutput) diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt index b7c3a094e..f8b6d7aca 100644 --- a/src/plugins/SdlRender/CMakeLists.txt +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -1,56 +1,57 @@ -# Plugin directory: SdlRender - -# Define targets for the plugins -set(SDL_VIDEO_PLUGIN SDLVideo) -set(SDL_AUDIO_PLUGIN SDLAudio) - -# Source files for each target -set(SDL_VIDEO_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/sdl_video.cpp +# Define the SDLVideo plugin +set(SDLVideo_src + ${CMAKE_CURRENT_SOURCE_DIR}/sdl_video.cpp # Main source for SDLVideo ) -set(SDL_AUDIO_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/sdl_audio.cpp -) - -# SDL2 package requirements +# Link SDL2 package for SDLVideo find_package(SDL2 REQUIRED) -# SDLVideo plugin target -add_library(${SDL_VIDEO_PLUGIN} SHARED ${SDL_VIDEO_SOURCES}) +# Define the SDLVideo target +add_library(SDLVideo SHARED ${SDLVideo_src}) -# Set include directories for SDLVideo -target_include_directories(${SDL_VIDEO_PLUGIN} PRIVATE - ${SDL2_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR} +# Link dependencies +target_link_libraries(SDLVideo + ${CMAKE_THREAD_LIBS_INIT} + SDL2::SDL2 ) -# Link SDL2 to SDLVideo -target_link_libraries(${SDL_VIDEO_PLUGIN} PRIVATE ${SDL2_LIBRARIES}) +# Include directories +target_include_directories(SDLVideo PUBLIC + ${CMAKE_SOURCE_DIR}/src +) -# Set the output directory for SDLVideo -set_target_properties(${SDL_VIDEO_PLUGIN} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +# Set properties for the target +set_target_properties(SDLVideo PROPERTIES + OUTPUT_NAME "SDLVideo" # Output name without extension LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # ) -# SDLAudio plugin target -add_library(${SDL_AUDIO_PLUGIN} SHARED ${SDL_AUDIO_SOURCES}) +# Define the SDLAudio plugin +set(SDLAudio_src + ${CMAKE_CURRENT_SOURCE_DIR}/sdl_audio.cpp +) + +# Define the SDLAudio target +add_library(SDLAudio SHARED ${SDLAudio_src}) -# Set include directories for SDLAudio -target_include_directories(${SDL_AUDIO_PLUGIN} PRIVATE - ${SDL2_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR} +# Link dependencies +target_link_libraries(SDLAudio + ${CMAKE_THREAD_LIBS_INIT} + SDL2::SDL2 # Link SDL2 ) -# Link SDL2 to SDLAudio -target_link_libraries(${SDL_AUDIO_PLUGIN} PRIVATE ${SDL2_LIBRARIES}) +# Include directories for SDLAudio +target_include_directories(SDLAudio PUBLIC + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/plugins/SdlRender +) -# Set the output directory for SDLAudio -set_target_properties(${SDL_AUDIO_PLUGIN} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +# Set properties for SDLAudio target +set_target_properties(SDLAudio PROPERTIES + OUTPUT_NAME "SDLAudio" # Output name without extension LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # ) - -# Installation (optional) -install(TARGETS ${SDL_VIDEO_PLUGIN} ${SDL_AUDIO_PLUGIN} DESTINATION bin) From 10278b699c114c1938dc48b8a3f871def157d2e5 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 16:54:13 +0100 Subject: [PATCH 020/182] adding Telx2Tml pluggin --- src/plugins/Telx2Ttml/CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index e69de29bb..a3ee620b8 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -0,0 +1,21 @@ +# Define the plugin library +add_library(TeletextToTTML SHARED + telx2ttml.cpp + telx.cpp + ) + +# Link dependencies if any +target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT}) + +# Include directories +target_include_directories(TeletextToTTML PUBLIC + ${CMAKE_SOURCE_DIR}/src +) + +# Set properties for the target +set_target_properties(TeletextToTTML PROPERTIES + OUTPUT_NAME "TeletextToTTML" # Output name without extension + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) From cf9f712a51ec97ddc8ec77196611e6a4851e71cd Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 16:59:51 +0100 Subject: [PATCH 021/182] adding TsDemucer and TsMuxer --- src/plugins/TsDemuxer/CMakeLists.txt | 21 ++++++++++++++------- src/plugins/TsMuxer/CMakeLists.txt | 22 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index 403c6a999..cb630dc98 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -1,13 +1,20 @@ # Define the plugin library -add_library(TSDemuxer STATIC +add_library(TsDemuxer SHARED ts_demuxer.cpp -) + ) + +# Link dependencies if any +target_link_libraries(TsDemuxer ${CMAKE_THREAD_LIBS_INIT}) -# Include directories if needed -target_include_directories(TSDemuxer PUBLIC +# Include directories +target_include_directories(TsDemuxer PUBLIC ${CMAKE_SOURCE_DIR}/src ) -# Link libraries if required -# Example (if any external libraries are needed): -# target_link_libraries(TSDemuxer some_dependency) \ No newline at end of file +# Set properties for the target +set_target_properties(TsDemuxer PROPERTIES + OUTPUT_NAME "TsDemuxer" # Output name without extension + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt index e69de29bb..427a8408d 100644 --- a/src/plugins/TsMuxer/CMakeLists.txt +++ b/src/plugins/TsMuxer/CMakeLists.txt @@ -0,0 +1,22 @@ +# Define the plugin library +add_library(TsMuxer SHARED + mpegts_muxer.cpp + pes.cpp + crc.cpp + ) + +# Link dependencies if any +target_link_libraries(TsMuxer ${CMAKE_THREAD_LIBS_INIT}) + +# Include directories +target_include_directories(TsMuxer PUBLIC + ${CMAKE_SOURCE_DIR}/src +) + +# Set properties for the target +set_target_properties(TsMuxer PROPERTIES + OUTPUT_NAME "TsMuxer" # Output name without extension + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) From 2f60eec2615c0acfedfa37ebd33425c3506aefe4 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 17:03:45 +0100 Subject: [PATCH 022/182] adding udp output --- src/plugins/UdpOutput/CMakeLists.txt | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index e69de29bb..69708bafb 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -0,0 +1,43 @@ +# Define the plugin library (UdpOutput) +set(UdpOutput_src + ${CMAKE_CURRENT_SOURCE_DIR}/udp_output.cpp # Main plugin source +) + +# Platform-specific socket source files +if(MSVC) + # MSVC-specific socket file + list(APPEND UdpOutput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_mingw.cpp) +elseif(MINGW) + # MinGW-specific socket file + list(APPEND UdpOutput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_mingw.cpp) +elseif(APPLE) + # macOS/Darwin-specific socket file + list(APPEND UdpOutput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_gnu.cpp) +elseif(UNIX) + # Linux-specific socket file + list(APPEND UdpOutput_src ${CMAKE_CURRENT_SOURCE_DIR}/socket_gnu.cpp) +else() + message(FATAL_ERROR "Unsupported platform") +endif() + +# Add the UdpOutput plugin +add_library(UdpOutput SHARED ${UdpOutput_src}) + +# Link dependencies +target_link_libraries(UdpOutput + ${CMAKE_THREAD_LIBS_INIT} +) + +# Include directories +target_include_directories(UdpOutput PUBLIC + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Set properties for the target +set_target_properties(UdpOutput PROPERTIES + OUTPUT_NAME "UdpOutput" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" # Set the custom file extension to .smd + PREFIX "" # +) From cbb765935073cbfb7f3ad007db55f07da6bbb086 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 17:18:16 +0100 Subject: [PATCH 023/182] add missing unittests --- src/tests/CMakeLists.txt | 66 ++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index d989805b0..7ce1fd184 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,46 +1,54 @@ -# Collect all test sources -file(GLOB_RECURSE UNITTEST_SOURCES - "${CMAKE_SOURCE_DIR}/src/unittests/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/tests.cpp" - "${CMAKE_SOURCE_DIR}/lib_appcommon/options.cpp" +# Set the directory for the unit test source files +set(TESTSDIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(OUTDIR ${CMAKE_BINARY_DIR}/bin) + +file(GLOB LIB_MODULES_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp +) + + +file(GLOB LIB_MEDIA_SRCS + ${CMAKE_SOURCE_DIR}/src/lib_media/*.cpp +) + + + +# Define the source files for the unit tests +set(EXE_TESTS_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/tests.cpp + ${CMAKE_SOURCE_DIR}/src/lib_appcommon/options.cpp ${LIB_MEDIA_SRCS} ${LIB_MODULES_SRCS} ${LIB_PIPELINE_SRCS} ${LIB_UTILS_SRCS} ) -# Create the unit tests executable -add_executable(unittests ${UNITTEST_SOURCES}) +# Add any additional source files from the 'unittests' directories +file(GLOB_RECURSE UNITTEST_SOURCES "${CMAKE_SOURCE_DIR}/src/*/unittests/*.cpp") +list(APPEND EXE_TESTS_SRCS ${UNITTEST_SOURCES}) -# Include directories for the unittests -target_include_directories(unittests PRIVATE - ${CMAKE_SOURCE_DIR}/lib_appcommon - ${CMAKE_SOURCE_DIR}/lib_media - ${CMAKE_SOURCE_DIR}/lib_modules - ${CMAKE_SOURCE_DIR}/lib_pipeline - ${CMAKE_SOURCE_DIR}/lib_utils - ${CMAKE_SOURCE_DIR}/src/unittests -) +# Define the unit tests executable target +add_executable(unittests ${EXE_TESTS_SRCS}) -# Link dependencies to the unit tests -target_link_libraries(unittests PRIVATE - appcommon +# Link dependencies to the unittests executable +target_link_libraries(unittests + appcommon media modules pipeline utils + curl + avcodec ) -# Enable testing if requested -if(BUILD_TESTING) - enable_testing() - add_test(NAME UnitTests COMMAND unittests) -endif() +# Include directories for unit tests +target_include_directories(unittests PRIVATE + ${CMAKE_SOURCE_DIR}/src +) -# Set output directory for the test executable +# Set the output directory for the unittests executable inside the 'bin' folder set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin -) - -# Installation (optional) -install(TARGETS unittests DESTINATION bin) + SUFFIX ".exe" +) \ No newline at end of file From 064c4ac53c4dac87faf93f0e65b6c61d7ff80496 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 22:19:40 +0100 Subject: [PATCH 024/182] adding script to build deps for cmake --- CMakeLists.txt | 28 ++++++++++++++++++++++++---- cmake-pre-build.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100755 cmake-pre-build.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index f56074e98..9f8797def 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,11 +76,31 @@ add_custom_target(build_all COMMENT "Building all targets." ) -# Add custom install targets (if needed) -#install(TARGETS dashcastx ts2ip player mcastdump mp42tsx monitor -# RUNTIME DESTINATION bin) -set(SYSROOT_PATH "/home/sohaib/motiospell/CWI/sysroot") + +# Check if SYSROOT_PATH is set via an environment variable +if(DEFINED ENV{SYSROOT_PATH}) + set(SYSROOT_PATH $ENV{SYSROOT_PATH}) +elseif(EXISTS "${CMAKE_SOURCE_DIR}/sysroot") + # If not set, use a default relative path or fail gracefully + set(SYSROOT_PATH "${CMAKE_SOURCE_DIR}/sysroot") +endif() + +# Ensure SYSROOT_PATH is valid +if(NOT EXISTS ${SYSROOT_PATH}) + message(FATAL_ERROR "SYSROOT_PATH does not exist or is invalid: ${SYSROOT_PATH}") +endif() + +message(STATUS "Using SYSROOT_PATH: ${SYSROOT_PATH}") + +# Add the include and lib directories from SYSROOT_PATH +include_directories(${SYSROOT_PATH}/include) +link_directories(${SYSROOT_PATH}/lib) + +# Set pkg-config path +set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) + + include_directories(${SYSROOT_PATH}/include) diff --git a/cmake-pre-build.sh b/cmake-pre-build.sh new file mode 100755 index 000000000..e9d8a7286 --- /dev/null +++ b/cmake-pre-build.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Check if a prefix argument is provided +if [ -z "$1" ]; then + echo "Error: No prefix path provided." + echo "Usage: ./cmake-build-dep.sh " + exit 1 +fi + +# Get the prefix argument +PREFIX=$1 + +# Resolve PREFIX to an absolute path +ABSOLUTE_PREFIX=$(realpath "$PREFIX") + +# Set the SYSROOT_PATH environment variable to the resolved absolute prefix +export SYSROOT_PATH="$ABSOLUTE_PREFIX" + +# Print a message to confirm SYSROOT_PATH is set +echo "Setting SYSROOT_PATH to absolute path: $SYSROOT_PATH" + +# Run extra.sh with the absolute PREFIX variable to build the dependencies +echo "Running extra.sh to build dependencies with PREFIX=$ABSOLUTE_PREFIX" +PREFIX="$ABSOLUTE_PREFIX" ./extra.sh + + +# End of the script +echo "Dependencies have been built. SYSROOT_PATH is set to: $SYSROOT_PATH" From 681dce033a6c2b689f150ed8c1ab54e4bddeed78 Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 22:30:46 +0100 Subject: [PATCH 025/182] remove duplicated statement from last commit --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f8797def..a884d3717 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,12 +102,6 @@ set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) -include_directories(${SYSROOT_PATH}/include) - -link_directories(${SYSROOT_PATH}/lib) - -set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) - find_package(PkgConfig REQUIRED) From b74fe867962c41888d755938f54dd5e1bff7a57b Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 28 Nov 2024 22:42:34 +0100 Subject: [PATCH 026/182] Adding FindFFmpeg from snikulov/cmake-modules, which seems to be the most popular one. --- CMakeFiles/FindFFmpeg.cmake | 151 ++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 CMakeFiles/FindFFmpeg.cmake diff --git a/CMakeFiles/FindFFmpeg.cmake b/CMakeFiles/FindFFmpeg.cmake new file mode 100644 index 000000000..6828440c5 --- /dev/null +++ b/CMakeFiles/FindFFmpeg.cmake @@ -0,0 +1,151 @@ +# vim: ts=2 sw=2 +# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC) +# +# Once done this will define +# FFMPEG_FOUND - System has the all required components. +# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers. +# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components. +# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components. +# +# For each of the components it will additionally set. +# - AVCODEC +# - AVDEVICE +# - AVFORMAT +# - AVFILTER +# - AVUTIL +# - POSTPROC +# - SWSCALE +# the following variables will be defined +# _FOUND - System has +# _INCLUDE_DIRS - Include directory necessary for using the headers +# _LIBRARIES - Link these to use +# _DEFINITIONS - Compiler switches required for using +# _VERSION - The components version +# +# Copyright (c) 2006, Matthias Kretz, +# Copyright (c) 2008, Alexander Neundorf, +# Copyright (c) 2011, Michael Jansen, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(FindPackageHandleStandardArgs) + +# The default components were taken from a survey over other FindFFMPEG.cmake files +if (NOT FFmpeg_FIND_COMPONENTS) + set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL) +endif () + +# +### Macro: set_component_found +# +# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present. +# +macro(set_component_found _component ) + if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS) + # message(STATUS " - ${_component} found.") + set(${_component}_FOUND TRUE) + else () + # message(STATUS " - ${_component} not found.") + endif () +endmacro() + +# +### Macro: find_component +# +# Checks for the given component by invoking pkgconfig and then looking up the libraries and +# include directories. +# +macro(find_component _component _pkgconfig _library _header) + + if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(PC_${_component} ${_pkgconfig}) + endif () + endif (NOT WIN32) + + find_path(${_component}_INCLUDE_DIRS ${_header} + HINTS + ${PC_${_component}_INCLUDEDIR} + ${PC_${_component}_INCLUDE_DIRS} + PATH_SUFFIXES + ffmpeg + ) + + find_library(${_component}_LIBRARIES NAMES ${_library} + HINTS + ${PC_${_component}_LIBDIR} + ${PC_${_component}_LIBRARY_DIRS} + ) + + set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.") + set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.") + + set_component_found(${_component}) + + mark_as_advanced( + ${_component}_INCLUDE_DIRS + ${_component}_LIBRARIES + ${_component}_DEFINITIONS + ${_component}_VERSION) + +endmacro() + + +# Check for cached results. If there are skip the costly part. +if (NOT FFMPEG_LIBRARIES) + + # Check for all possible component. + find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h) + find_component(AVFORMAT libavformat avformat libavformat/avformat.h) + find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h) + find_component(AVUTIL libavutil avutil libavutil/avutil.h) + find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h) + find_component(SWSCALE libswscale swscale libswscale/swscale.h) + find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h) + find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h) + + # Check if the required components were found and add their stuff to the FFMPEG_* vars. + foreach (_component ${FFmpeg_FIND_COMPONENTS}) + if (${_component}_FOUND) + # message(STATUS "Required component ${_component} present.") + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES}) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS}) + list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS}) + else () + # message(STATUS "Required component ${_component} missing.") + endif () + endforeach () + + # Build the include path with duplicates removed. + if (FFMPEG_INCLUDE_DIRS) + list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) + endif () + + # cache the vars. + set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE) + + mark_as_advanced(FFMPEG_INCLUDE_DIRS + FFMPEG_LIBRARIES + FFMPEG_DEFINITIONS) + +endif () + +# Now set the noncached _FOUND vars for the components. +foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE) + set_component_found(${_component}) +endforeach () + +# Compile the list of required vars +set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS) +foreach (_component ${FFmpeg_FIND_COMPONENTS}) + list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS) +endforeach () + +# Give a nice error message if some of the required vars are missing. +find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS}) \ No newline at end of file From 28f0d240251fca857c464bde3e56f82c66ec4642 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 28 Nov 2024 22:45:19 +0100 Subject: [PATCH 027/182] Add CMakeFiles to the search path. Move all find_package calls here (for easier debugging) Get rid of global include_directories() and link_directories() so we know we have the correct dependencies deeper down in the targets. --- CMakeLists.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f56074e98..1acf721ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,13 @@ cmake_minimum_required(VERSION 3.15) project(Signals VERSION 1.0) +# Add extension directories (for things like Find) +set(CMAKE_MODULE_PATH + ${CMAKE_CURRENT_LIST_DIR}/CMakeFiles + ${CMAKE_MODULE_PATH} + ) -# Set the C++ standard + # Set the C++ standard set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -80,15 +85,18 @@ add_custom_target(build_all #install(TARGETS dashcastx ts2ip player mcastdump mp42tsx monitor # RUNTIME DESTINATION bin) -set(SYSROOT_PATH "/home/sohaib/motiospell/CWI/sysroot") +#set(SYSROOT_PATH "/home/sohaib/motiospell/CWI/sysroot") -include_directories(${SYSROOT_PATH}/include) +#include_directories(${SYSROOT_PATH}/include) -link_directories(${SYSROOT_PATH}/lib) +#link_directories(${SYSROOT_PATH}/lib) -set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) +#set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) find_package(PkgConfig REQUIRED) +find_package(SDL2 REQUIRED) +find_package(FFmpeg COMPONENTS AVUTIL AVCODEC AVFORMAT AVDEVICE SWSCALE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) From de95fc44ccba708f512a20753c0904aca1e1359d Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 28 Nov 2024 22:47:33 +0100 Subject: [PATCH 028/182] Added FFMPEG_INCLUDE_DIRS and FFMPEG_LIBRARIES where needed. Reformatted some of the lines for better readbility. --- src/lib_media/CMakeLists.txt | 236 ++++++++++++++++++++++++++++++----- 1 file changed, 206 insertions(+), 30 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 6e8213216..54e7c55b0 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -61,7 +61,14 @@ target_include_directories(AVCC2AnnexBConverter PRIVATE ${CMAKE_SOURCE_DIR}/src/ ) -target_link_libraries(AVCC2AnnexBConverter PRIVATE media modules pipeline appcommon utils) +target_link_libraries(AVCC2AnnexBConverter + PRIVATE + media + modules + pipeline + appcommon + utils + ) set_target_properties(AVCC2AnnexBConverter PROPERTIES OUTPUT_NAME "AVCC2AnnexBConverter" @@ -186,8 +193,22 @@ set(EXE_ENCODER_SRCS ) list(APPEND EXE_ENCODER_SRCS ${LIB_MODULES_SRCS}) add_library(Encoder SHARED ${EXE_ENCODER_SRCS}) -target_include_directories(Encoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(Encoder PRIVATE media modules pipeline appcommon utils avcodec avutil) +target_include_directories(Encoder + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} +) + +target_link_libraries(Encoder + PRIVATE + media + modules + pipeline + appcommon + utils + ${FFMPEG_LIBRARIES} + ) set_target_properties(Encoder PROPERTIES OUTPUT_NAME "Encoder" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") @@ -214,9 +235,28 @@ set(EXE_LIBAVDEMUX_SRCS ) list(APPEND EXE_LIBAVDEMUX_SRCS ${LIB_MODULES_SRCS}) add_library(LibavDemux SHARED ${EXE_LIBAVDEMUX_SRCS}) -target_include_directories(LibavDemux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(LibavDemux PRIVATE media modules pipeline appcommon utils avformat avcodec avutil avdevice) -set_target_properties(LibavDemux PROPERTIES OUTPUT_NAME "LibavDemux" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(LibavDemux + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} + ) +target_link_libraries(LibavDemux + PRIVATE + media + modules + pipeline + appcommon + utils + ${FFMPEG_LIBRARIES} + ) +set_target_properties(LibavDemux + PROPERTIES + OUTPUT_NAME "LibavDemux" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # LibavMux target @@ -227,9 +267,27 @@ set(EXE_LIBAVMUX_SRCS ) list(APPEND EXE_LIBAVMUX_SRCS ${LIB_MODULES_SRCS}) add_library(LibavMux SHARED ${EXE_LIBAVMUX_SRCS}) -target_include_directories(LibavMux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(LibavMux PRIVATE media modules pipeline appcommon utils avformat avcodec avutil) -set_target_properties(LibavMux PROPERTIES OUTPUT_NAME "LibavMux" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(LibavMux + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} + ) +target_link_libraries(LibavMux + PRIVATE + media + modules + pipeline + appcommon + utils + ${FFMPEG_LIBRARIES} + ) +set_target_properties(LibavMux PROPERTIES + OUTPUT_NAME "LibavMux" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # LibavFilter target set(EXE_LIBAVFILTER_SRCS @@ -239,9 +297,27 @@ set(EXE_LIBAVFILTER_SRCS ) list(APPEND EXE_LIBAVFILTER_SRCS ${LIB_MODULES_SRCS}) add_library(LibavFilter SHARED ${EXE_LIBAVFILTER_SRCS}) -target_include_directories(LibavFilter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(LibavFilter PRIVATE media modules pipeline appcommon utils avfilter avcodec avutil) -set_target_properties(LibavFilter PROPERTIES OUTPUT_NAME "LibavFilter" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(LibavFilter + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} + ) +target_link_libraries(LibavFilter + PRIVATE + media + modules + pipeline + appcommon + utils + ${FFMPEG_LIBRARIES} +) +set_target_properties(LibavFilter PROPERTIES + OUTPUT_NAME "LibavFilter" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) @@ -251,9 +327,26 @@ set(EXE_GPACMUXMP4_SRCS ) list(APPEND EXE_GPACMUXMP4_SRCS ${LIB_MODULES_SRCS}) add_library(GPACMuxMP4 SHARED ${EXE_GPACMUXMP4_SRCS}) -target_include_directories(GPACMuxMP4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(GPACMuxMP4 PRIVATE media modules pipeline appcommon utils gpac) -set_target_properties(GPACMuxMP4 PROPERTIES OUTPUT_NAME "GPACMuxMP4" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(GPACMuxMP4 + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(GPACMuxMP4 + PRIVATE + media + modules + pipeline + appcommon + utils + gpac + ) +set_target_properties(GPACMuxMP4 PROPERTIES + OUTPUT_NAME "GPACMuxMP4" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # GPACMuxMP4MSS target @@ -263,9 +356,26 @@ set(EXE_GPACMUXMP4MSS_SRCS ) list(APPEND EXE_GPACMUXMP4MSS_SRCS ${LIB_MODULES_SRCS}) add_library(GPACMuxMP4MSS SHARED ${EXE_GPACMUXMP4MSS_SRCS}) -target_include_directories(GPACMuxMP4MSS PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(GPACMuxMP4MSS PRIVATE media modules pipeline appcommon utils gpac) -set_target_properties(GPACMuxMP4MSS PROPERTIES OUTPUT_NAME "GPACMuxMP4MSS" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(GPACMuxMP4MSS + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(GPACMuxMP4MSS + PRIVATE + media + modules + pipeline + appcommon + utils + gpac + ) +set_target_properties(GPACMuxMP4MSS PROPERTIES + OUTPUT_NAME "GPACMuxMP4MSS" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # GPACDemuxMP4Simple target set(EXE_GPACDEMUXMP4SIMPLE_SRCS @@ -273,9 +383,26 @@ set(EXE_GPACDEMUXMP4SIMPLE_SRCS ) list(APPEND EXE_GPACDEMUXMP4SIMPLE_SRCS ${LIB_MODULES_SRCS}) add_library(GPACDemuxMP4Simple SHARED ${EXE_GPACDEMUXMP4SIMPLE_SRCS}) -target_include_directories(GPACDemuxMP4Simple PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(GPACDemuxMP4Simple PRIVATE media modules pipeline appcommon utils gpac) -set_target_properties(GPACDemuxMP4Simple PROPERTIES OUTPUT_NAME "GPACDemuxMP4Simple" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(GPACDemuxMP4Simple + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(GPACDemuxMP4Simple + PRIVATE + media + modules + pipeline + appcommon + utils + gpac + ) +set_target_properties(GPACDemuxMP4Simple PROPERTIES + OUTPUT_NAME "GPACDemuxMP4Simple" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # GPACDemuxMP4Full target set(EXE_GPACDEMUXMP4FULL_SRCS @@ -283,9 +410,26 @@ set(EXE_GPACDEMUXMP4FULL_SRCS ) list(APPEND EXE_GPACDEMUXMP4FULL_SRCS ${LIB_MODULES_SRCS}) add_library(GPACDemuxMP4Full SHARED ${EXE_GPACDEMUXMP4FULL_SRCS}) -target_include_directories(GPACDemuxMP4Full PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(GPACDemuxMP4Full PRIVATE media modules pipeline appcommon utils gpac) -set_target_properties(GPACDemuxMP4Full PROPERTIES OUTPUT_NAME "GPACDemuxMP4Full" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(GPACDemuxMP4Full + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(GPACDemuxMP4Full + PRIVATE + media + modules + pipeline + appcommon + utils + gpac + ) +set_target_properties(GPACDemuxMP4Full PROPERTIES + OUTPUT_NAME "GPACDemuxMP4Full" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # FileSystemSink target @@ -294,9 +438,25 @@ set(EXE_FILESYSTEMSINK_SRCS ) list(APPEND EXE_FILESYSTEMSINK_SRCS ${LIB_MODULES_SRCS}) add_library(FileSystemSink SHARED ${EXE_FILESYSTEMSINK_SRCS}) -target_include_directories(FileSystemSink PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(FileSystemSink PRIVATE media modules pipeline appcommon utils) -set_target_properties(FileSystemSink PROPERTIES OUTPUT_NAME "FileSystemSink" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(FileSystemSink + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(FileSystemSink + PRIVATE + media + modules + pipeline + appcommon + utils + ) +set_target_properties(FileSystemSink PROPERTIES + OUTPUT_NAME "FileSystemSink" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # LogoOverlay target set(EXE_LOGOOVERLAY_SRCS @@ -304,7 +464,23 @@ set(EXE_LOGOOVERLAY_SRCS ) list(APPEND EXE_LOGOOVERLAY_SRCS ${LIB_MODULES_SRCS}) add_library(LogoOverlay SHARED ${EXE_LOGOOVERLAY_SRCS}) -target_include_directories(LogoOverlay PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(LogoOverlay PRIVATE media modules pipeline appcommon utils) -set_target_properties(LogoOverlay PROPERTIES OUTPUT_NAME "LogoOverlay" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(LogoOverlay + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(LogoOverlay + PRIVATE + media + modules + pipeline + appcommon + utils + ) +set_target_properties(LogoOverlay PROPERTIES + OUTPUT_NAME "LogoOverlay" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) From c15864263001539a7c5adea00f3df1b97edf087b Mon Sep 17 00:00:00 2001 From: slarbi Date: Thu, 28 Nov 2024 22:19:40 +0100 Subject: [PATCH 029/182] adding script to build deps for cmake --- CMakeLists.txt | 28 ++++++++++++++++++++++++---- cmake-pre-build.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100755 cmake-pre-build.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 1acf721ec..a189ab63a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,11 +81,31 @@ add_custom_target(build_all COMMENT "Building all targets." ) -# Add custom install targets (if needed) -#install(TARGETS dashcastx ts2ip player mcastdump mp42tsx monitor -# RUNTIME DESTINATION bin) -#set(SYSROOT_PATH "/home/sohaib/motiospell/CWI/sysroot") + +# Check if SYSROOT_PATH is set via an environment variable +if(DEFINED ENV{SYSROOT_PATH}) + set(SYSROOT_PATH $ENV{SYSROOT_PATH}) +elseif(EXISTS "${CMAKE_SOURCE_DIR}/sysroot") + # If not set, use a default relative path or fail gracefully + set(SYSROOT_PATH "${CMAKE_SOURCE_DIR}/sysroot") +endif() + +# Ensure SYSROOT_PATH is valid +if(NOT EXISTS ${SYSROOT_PATH}) + message(FATAL_ERROR "SYSROOT_PATH does not exist or is invalid: ${SYSROOT_PATH}") +endif() + +message(STATUS "Using SYSROOT_PATH: ${SYSROOT_PATH}") + +# Add the include and lib directories from SYSROOT_PATH +include_directories(${SYSROOT_PATH}/include) +link_directories(${SYSROOT_PATH}/lib) + +# Set pkg-config path +set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) + + #include_directories(${SYSROOT_PATH}/include) diff --git a/cmake-pre-build.sh b/cmake-pre-build.sh new file mode 100755 index 000000000..e9d8a7286 --- /dev/null +++ b/cmake-pre-build.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Check if a prefix argument is provided +if [ -z "$1" ]; then + echo "Error: No prefix path provided." + echo "Usage: ./cmake-build-dep.sh " + exit 1 +fi + +# Get the prefix argument +PREFIX=$1 + +# Resolve PREFIX to an absolute path +ABSOLUTE_PREFIX=$(realpath "$PREFIX") + +# Set the SYSROOT_PATH environment variable to the resolved absolute prefix +export SYSROOT_PATH="$ABSOLUTE_PREFIX" + +# Print a message to confirm SYSROOT_PATH is set +echo "Setting SYSROOT_PATH to absolute path: $SYSROOT_PATH" + +# Run extra.sh with the absolute PREFIX variable to build the dependencies +echo "Running extra.sh to build dependencies with PREFIX=$ABSOLUTE_PREFIX" +PREFIX="$ABSOLUTE_PREFIX" ./extra.sh + + +# End of the script +echo "Dependencies have been built. SYSROOT_PATH is set to: $SYSROOT_PATH" From 4b72fa66bcbd81e602296ead5e651e5d39f2c736 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 00:14:15 +0100 Subject: [PATCH 030/182] Allow sysroot to be in .. PKG_CONFIG_PATH should be an environment variable. FFMPEG is required. --- CMakeLists.txt | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a189ab63a..892ac1f79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,9 +86,12 @@ add_custom_target(build_all # Check if SYSROOT_PATH is set via an environment variable if(DEFINED ENV{SYSROOT_PATH}) set(SYSROOT_PATH $ENV{SYSROOT_PATH}) -elseif(EXISTS "${CMAKE_SOURCE_DIR}/sysroot") + elseif(EXISTS "${CMAKE_SOURCE_DIR}/sysroot") # If not set, use a default relative path or fail gracefully set(SYSROOT_PATH "${CMAKE_SOURCE_DIR}/sysroot") +elseif(EXISTS "${CMAKE_SOURCE_DIR}/../sysroot") + # If not set, use a default relative path or fail gracefully + set(SYSROOT_PATH "${CMAKE_SOURCE_DIR}/../sysroot") endif() # Ensure SYSROOT_PATH is valid @@ -99,24 +102,17 @@ endif() message(STATUS "Using SYSROOT_PATH: ${SYSROOT_PATH}") # Add the include and lib directories from SYSROOT_PATH -include_directories(${SYSROOT_PATH}/include) -link_directories(${SYSROOT_PATH}/lib) - -# Set pkg-config path -set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) - - - #include_directories(${SYSROOT_PATH}/include) - #link_directories(${SYSROOT_PATH}/lib) -#set(PKG_CONFIG_PATH ${SYSROOT_PATH}/lib/pkgconfig) +# Set pkg-config path +set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") + find_package(PkgConfig REQUIRED) find_package(SDL2 REQUIRED) -find_package(FFmpeg COMPONENTS AVUTIL AVCODEC AVFORMAT AVDEVICE SWSCALE) +find_package(FFmpeg REQUIRED COMPONENTS AVUTIL AVCODEC AVFORMAT AVDEVICE SWSCALE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) From cbfa488af2808de352e8175c8d4e9b7793ad3dcd Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 00:14:36 +0100 Subject: [PATCH 031/182] Python 2.7 missing is not fatal. --- extra/zen-extra.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/zen-extra.sh b/extra/zen-extra.sh index d3bc12c6f..ff2088aa8 100755 --- a/extra/zen-extra.sh +++ b/extra/zen-extra.sh @@ -542,7 +542,7 @@ function checkForCommonBuildTools { echo "or" echo "port install python27 && ln -s /opt/local/bin/python2.7 /opt/local/bin/python2" echo "" - error="1" + #error="1" fi if isMissing "autoreconf"; then From 3dbb2120468af066f6ed0525f854120704fe8867 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 11:33:36 +0100 Subject: [PATCH 032/182] ffmpeg added to a few more targets. --- src/lib_media/CMakeLists.txt | 90 ++++++++++++++++++++++++---- src/plugins/Telx2Ttml/CMakeLists.txt | 3 +- 2 files changed, 80 insertions(+), 13 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 54e7c55b0..5d9353eec 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -97,10 +97,18 @@ add_library(LibavMuxHLSTS SHARED ${EXE_LIBAVMUXHLSTS_SRCS}) target_include_directories(LibavMuxHLSTS PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) # Link libraries to the target -target_link_libraries(LibavMuxHLSTS PRIVATE media modules pipeline appcommon utils avutil avcodec) +target_link_libraries(LibavMuxHLSTS + PRIVATE + media + modules + pipeline + appcommon + ${FFMPEG_LIBRARIES} + ) # Set target properties set_target_properties(LibavMuxHLSTS PROPERTIES @@ -129,12 +137,13 @@ add_library(VideoConvert SHARED ${EXE_VIDEOCONVERTER_SRCS}) target_include_directories(VideoConvert PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) # Link the necessary libraries target_link_libraries(VideoConvert PRIVATE media modules pipeline appcommon utils - avcodec avutil swscale + ${FFMPEG_LIBRARIES} ) # Set properties for the target @@ -153,9 +162,27 @@ set(EXE_AUDIOCONVERTER_SRCS ) list(APPEND EXE_AUDIOCONVERTER_SRCS ${LIB_MODULES_SRCS}) add_library(AudioConvert SHARED ${EXE_AUDIOCONVERTER_SRCS}) -target_include_directories(AudioConvert PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(AudioConvert PRIVATE media modules pipeline appcommon utils avcodec avutil swresample) -set_target_properties(AudioConvert PROPERTIES OUTPUT_NAME "AudioConvert" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(AudioConvert + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} + ) +target_link_libraries(AudioConvert + PRIVATE + media + modules + pipeline + appcommon + utils + ${FFMPEG_LIBRARIES} + ) +set_target_properties(AudioConvert PROPERTIES + OUTPUT_NAME "AudioConvert" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # JPEGTurboDecode target @@ -165,9 +192,25 @@ set(EXE_JPEGTURBODECODE_SRCS ) list(APPEND EXE_JPEGTURBODECODE_SRCS ${LIB_MODULES_SRCS}) add_library(JPEGTurboDecode SHARED ${EXE_JPEGTURBODECODE_SRCS}) -target_include_directories(JPEGTurboDecode PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(JPEGTurboDecode PRIVATE media modules pipeline appcommon utils turbojpeg) -set_target_properties(JPEGTurboDecode PROPERTIES OUTPUT_NAME "JPEGTurboDecode" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(JPEGTurboDecode + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(JPEGTurboDecode + PRIVATE + media + modules + pipeline + appcommon + utils + turbojpeg + ) +set_target_properties(JPEGTurboDecode PROPERTIES + OUTPUT_NAME "JPEGTurboDecode" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) @@ -209,7 +252,12 @@ target_link_libraries(Encoder utils ${FFMPEG_LIBRARIES} ) -set_target_properties(Encoder PROPERTIES OUTPUT_NAME "Encoder" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +set_target_properties(Encoder PROPERTIES + OUTPUT_NAME "Encoder" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) @@ -221,9 +269,27 @@ set(EXE_DECODER_SRCS ) list(APPEND EXE_DECODER_SRCS ${LIB_MODULES_SRCS}) add_library(Decoder SHARED ${EXE_DECODER_SRCS}) -target_include_directories(Decoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(Decoder PRIVATE media modules pipeline appcommon utils avcodec avutil) -set_target_properties(Decoder PROPERTIES OUTPUT_NAME "Decoder" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_include_directories(Decoder + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} + ) +target_link_libraries(Decoder + PRIVATE + media + modules + pipeline + appcommon + utils + ${FFMPEG_LIBRARIES} + ) +set_target_properties(Decoder PROPERTIES + OUTPUT_NAME "Decoder" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) # LibavDemux target diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index a3ee620b8..5ba84e3e3 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -5,11 +5,12 @@ add_library(TeletextToTTML SHARED ) # Link dependencies if any -target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT} ${FFMPEG_LIBRARIES}) # Include directories target_include_directories(TeletextToTTML PUBLIC ${CMAKE_SOURCE_DIR}/src + ${FFMPEG_INCLUDE_DIRS} ) # Set properties for the target From 4dff5b945499656f4a070565268f345c291a764c Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 11:35:53 +0100 Subject: [PATCH 033/182] Ignore /extra/patches. @sohaib please review. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a2bd2df8e..87848d34f 100644 --- a/.gitignore +++ b/.gitignore @@ -160,6 +160,7 @@ tags /extra/config.guess extra_lib/ doc/html/ +/extra/patches/ # test output: directory is created when tests starts and removed when they pass /out From 6aeb4985d48ae76a8ae9f96617b67dec036e1a10 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 12:28:31 +0100 Subject: [PATCH 034/182] Find gpac with pkgconfig, for now. --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 892ac1f79..4a48142bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,7 +103,8 @@ message(STATUS "Using SYSROOT_PATH: ${SYSROOT_PATH}") # Add the include and lib directories from SYSROOT_PATH #include_directories(${SYSROOT_PATH}/include) -#link_directories(${SYSROOT_PATH}/lib) +# xxxjack temporarily re-enabling this one: +link_directories(${SYSROOT_PATH}/lib) # Set pkg-config path set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") @@ -112,7 +113,12 @@ set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") find_package(PkgConfig REQUIRED) find_package(SDL2 REQUIRED) -find_package(FFmpeg REQUIRED COMPONENTS AVUTIL AVCODEC AVFORMAT AVDEVICE SWSCALE) +find_package(FFmpeg REQUIRED COMPONENTS AVUTIL AVFILTER AVCODEC AVFORMAT AVDEVICE SWSCALE SWRESAMPLE) +find_package(GPAC) +if (NOT GPAC_FOUND) + # Find it using pkgconfig, for now + pkg_check_modules(GPAC REQUIRED gpac) +endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) From 3f16b158b7c195b07b574f5b8cab9e4b00ea89d7 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 12:28:54 +0100 Subject: [PATCH 035/182] More targets needing ffmpeg. --- src/lib_media/CMakeLists.txt | 18 ++++++++++++++---- src/plugins/Telx2Ttml/CMakeLists.txt | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 5d9353eec..669acdf85 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -83,11 +83,13 @@ set_target_properties(AVCC2AnnexBConverter PROPERTIES set(EXE_LIBAVMUXHLSTS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/stream/hls_muxer_libav.cpp ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp + ${FFMPEG_INCLUDE_DIRS} ) # Combine all source files into a single list list(APPEND EXE_LIBAVMUXHLSTS_SRCS ${LIB_MODULES_SRCS} + ${FFMPEG_LIBRARIES} ) # Add the target (LibavMuxHLSTS.smd) @@ -397,6 +399,8 @@ target_include_directories(GPACMuxMP4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} + ${GPAC_INCLUDE_DIRS} ) target_link_libraries(GPACMuxMP4 PRIVATE @@ -405,7 +409,8 @@ target_link_libraries(GPACMuxMP4 pipeline appcommon utils - gpac + ${GPAC_LIBRARIES} + ${FFMPEG_LIBRARIES} ) set_target_properties(GPACMuxMP4 PROPERTIES OUTPUT_NAME "GPACMuxMP4" @@ -426,6 +431,7 @@ target_include_directories(GPACMuxMP4MSS PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${GPAC_INCLUDE_DIRS} ) target_link_libraries(GPACMuxMP4MSS PRIVATE @@ -434,7 +440,7 @@ target_link_libraries(GPACMuxMP4MSS pipeline appcommon utils - gpac + ${GPAC_LIBRARIES} ) set_target_properties(GPACMuxMP4MSS PROPERTIES OUTPUT_NAME "GPACMuxMP4MSS" @@ -453,6 +459,7 @@ target_include_directories(GPACDemuxMP4Simple PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${GPAC_INCLUDE_DIRS} ) target_link_libraries(GPACDemuxMP4Simple PRIVATE @@ -461,7 +468,7 @@ target_link_libraries(GPACDemuxMP4Simple pipeline appcommon utils - gpac + ${GPAC_LIBRARIES} ) set_target_properties(GPACDemuxMP4Simple PROPERTIES OUTPUT_NAME "GPACDemuxMP4Simple" @@ -480,6 +487,8 @@ target_include_directories(GPACDemuxMP4Full PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${GPAC_INCLUDE_DIRS} + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(GPACDemuxMP4Full PRIVATE @@ -488,7 +497,8 @@ target_link_libraries(GPACDemuxMP4Full pipeline appcommon utils - gpac + ${GPAC_LIBRARIES} + ${FFMPEG_LIBRARIES} ) set_target_properties(GPACDemuxMP4Full PROPERTIES OUTPUT_NAME "GPACDemuxMP4Full" diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index 5ba84e3e3..84b598d0a 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -8,7 +8,8 @@ add_library(TeletextToTTML SHARED target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT} ${FFMPEG_LIBRARIES}) # Include directories -target_include_directories(TeletextToTTML PUBLIC +target_include_directories(TeletextToTTML + PUBLIC ${CMAKE_SOURCE_DIR}/src ${FFMPEG_INCLUDE_DIRS} ) From 70e31628fafe0b8a16ae220f2ba874d7ba061226 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 12:36:55 +0100 Subject: [PATCH 036/182] Ensure targets aren't defined until all needed variables are set. Everything now builds! --- CMakeLists.txt | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a48142bb..a5a791147 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,9 +25,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release") add_link_options(-s) endif() -# Add all the source subdirectories -add_subdirectory(src) - # Define paths for source and scripts set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") set(SRC_DIR "${CMAKE_SOURCE_DIR}/src") @@ -61,28 +58,6 @@ set(GENERATED_SIGNALS_VERSION_HEADER ${SIGNALS_VERSION_HEADER}) message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") - -# Add custom targets for easy builds -add_custom_target(build_all - DEPENDS - utils - appcommon - pipeline - modules - media - plugins - dashcastx - #ts2ip - player - mcastdump - mp42tsx - monitor - unittests - COMMENT "Building all targets." -) - - - # Check if SYSROOT_PATH is set via an environment variable if(DEFINED ENV{SYSROOT_PATH}) set(SYSROOT_PATH $ENV{SYSROOT_PATH}) @@ -122,3 +97,26 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + +# Add all the source subdirectories +add_subdirectory(src) + +# Add custom targets for easy builds +add_custom_target(build_all + DEPENDS + utils + appcommon + pipeline + modules + media + plugins + dashcastx + #ts2ip + player + mcastdump + mp42tsx + monitor + unittests + COMMENT "Building all targets." +) From 9da1e93be42421fde21d300a902500fb2bf3b081 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 13:05:17 +0100 Subject: [PATCH 037/182] Reference libjpeg-turbo in the modern" way. --- CMakeLists.txt | 1 + src/lib_media/CMakeLists.txt | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5a791147..bd9fc456e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,7 @@ set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") find_package(PkgConfig REQUIRED) find_package(SDL2 REQUIRED) +find_package(libjpeg-turbo REQUIRED) find_package(FFmpeg REQUIRED COMPONENTS AVUTIL AVFILTER AVCODEC AVFORMAT AVDEVICE SWSCALE SWRESAMPLE) find_package(GPAC) if (NOT GPAC_FOUND) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 669acdf85..8d258786d 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -205,7 +205,7 @@ target_link_libraries(JPEGTurboDecode pipeline appcommon utils - turbojpeg + libjpeg-turbo::turbojpeg ) set_target_properties(JPEGTurboDecode PROPERTIES OUTPUT_NAME "JPEGTurboDecode" @@ -224,8 +224,21 @@ set(EXE_JPEGTURBOENCODE_SRCS list(APPEND EXE_JPEGTURBOENCODE_SRCS ${LIB_MODULES_SRCS}) add_library(JPEGTurboEncode SHARED ${EXE_JPEGTURBOENCODE_SRCS}) target_include_directories(JPEGTurboEncode PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/) -target_link_libraries(JPEGTurboEncode PRIVATE media modules pipeline appcommon utils turbojpeg) -set_target_properties(JPEGTurboEncode PROPERTIES OUTPUT_NAME "JPEGTurboEncode" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".smd" PREFIX "") +target_link_libraries(JPEGTurboEncode + PRIVATE + media + modules + pipeline + appcommon + utils + libjpeg-turbo::turbojpeg + ) +set_target_properties(JPEGTurboEncode PROPERTIES + OUTPUT_NAME "JPEGTurboEncode" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) From 4a3341ed10cb81c53af5eedd7cb0696e21a44713 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 14:14:02 +0100 Subject: [PATCH 038/182] Somehow I broke version.h generation. Fixed by doing it at configure time (in stead of at build time). --- CMakeLists.txt | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd9fc456e..7dc3681c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,21 +33,26 @@ set(BIN_DIR "${CMAKE_BINARY_DIR}/bin") file(MAKE_DIRECTORY ${BIN_DIR}) # Generate signals_version.h using version.sh -add_custom_command( - OUTPUT ${BIN_DIR}/signals_version.h - COMMAND ${CMAKE_COMMAND} -E echo "Working directory: ${CMAKE_BINARY_DIR}" - COMMAND ${SCRIPTS_DIR}/version.sh - COMMAND ${CMAKE_COMMAND} -E echo "Version script executed" - COMMAND ${SCRIPTS_DIR}/version.sh > ${BIN_DIR}/signals_version.h - DEPENDS ${SCRIPTS_DIR}/version.sh - COMMENT "Generating signals_version.h" +set(SIGNALS_VERSION_HEADER "${BIN_DIR}/signals_version.h") +execute_process( + COMMAND "${SCRIPTS_DIR}/version.sh" + OUTPUT_FILE "${SIGNALS_VERSION_HEADER}" ) +#file(TOUCH ${SIGNALS_VERSION_HEADER}) +#add_custom_command( +# OUTPUT ${SIGNALS_VERSION_HEADER} +# COMMAND ${CMAKE_COMMAND} -E echo "Working directory: ${CMAKE_BINARY_DIR}" +# COMMAND ${SCRIPTS_DIR}/version.sh +# COMMAND ${CMAKE_COMMAND} -E echo "Version script executed" +# COMMAND ${SCRIPTS_DIR}/version.sh > ${SIGNALS_VERSION_HEADER} +# DEPENDS ${SCRIPTS_DIR}/version.sh +# COMMENT "Generating signals_version.h" +#) # Add a custom target to trigger the custom command -add_custom_target(generate_signals_version_header ALL DEPENDS ${BIN_DIR}/signals_version.h) +#add_custom_target(generate_signals_version_header ALL DEPENDS ${SIGNALS_VERSION_HEADER}) # Ensure the generated signals_version.h is available globally -set(SIGNALS_VERSION_HEADER "${BIN_DIR}/signals_version.h") # Include directories for global availability include_directories(${BIN_DIR}) @@ -78,8 +83,7 @@ message(STATUS "Using SYSROOT_PATH: ${SYSROOT_PATH}") # Add the include and lib directories from SYSROOT_PATH #include_directories(${SYSROOT_PATH}/include) -# xxxjack temporarily re-enabling this one: -link_directories(${SYSROOT_PATH}/lib) +#link_directories(${SYSROOT_PATH}/lib) # Set pkg-config path set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") @@ -94,6 +98,11 @@ find_package(GPAC) if (NOT GPAC_FOUND) # Find it using pkgconfig, for now pkg_check_modules(GPAC REQUIRED gpac) + add_library(gpac::gpac SHARED IMPORTED) + set_target_properties(gpac::gpac PROPERTIES + IMPORTED_LOCATION "${GPAC_LIBDIR}/libgpac.so" + INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" + ) endif() From eab4a786d3717975cf43dd7dc2c68f8351893753 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 14:15:19 +0100 Subject: [PATCH 039/182] Include gpac the "modern" way, by adding gpac::gpac to the libraries and that'll handle the needed include directories by itself. --- src/lib_media/CMakeLists.txt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 8d258786d..d97b8f514 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -413,7 +413,6 @@ target_include_directories(GPACMuxMP4 ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ ${FFMPEG_INCLUDE_DIRS} - ${GPAC_INCLUDE_DIRS} ) target_link_libraries(GPACMuxMP4 PRIVATE @@ -422,7 +421,7 @@ target_link_libraries(GPACMuxMP4 pipeline appcommon utils - ${GPAC_LIBRARIES} + gpac::gpac ${FFMPEG_LIBRARIES} ) set_target_properties(GPACMuxMP4 PROPERTIES @@ -444,7 +443,6 @@ target_include_directories(GPACMuxMP4MSS PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${GPAC_INCLUDE_DIRS} ) target_link_libraries(GPACMuxMP4MSS PRIVATE @@ -453,7 +451,7 @@ target_link_libraries(GPACMuxMP4MSS pipeline appcommon utils - ${GPAC_LIBRARIES} + gpac::gpac ) set_target_properties(GPACMuxMP4MSS PROPERTIES OUTPUT_NAME "GPACMuxMP4MSS" @@ -472,7 +470,6 @@ target_include_directories(GPACDemuxMP4Simple PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${GPAC_INCLUDE_DIRS} ) target_link_libraries(GPACDemuxMP4Simple PRIVATE @@ -481,7 +478,7 @@ target_link_libraries(GPACDemuxMP4Simple pipeline appcommon utils - ${GPAC_LIBRARIES} + gpac::gpac ) set_target_properties(GPACDemuxMP4Simple PROPERTIES OUTPUT_NAME "GPACDemuxMP4Simple" @@ -500,7 +497,6 @@ target_include_directories(GPACDemuxMP4Full PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${GPAC_INCLUDE_DIRS} ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(GPACDemuxMP4Full @@ -510,7 +506,7 @@ target_link_libraries(GPACDemuxMP4Full pipeline appcommon utils - ${GPAC_LIBRARIES} + gpac::gpac ${FFMPEG_LIBRARIES} ) set_target_properties(GPACDemuxMP4Full PROPERTIES From 3300dd95cedcf423fb4b98a1c01d44d34f7166a1 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 14:36:39 +0100 Subject: [PATCH 040/182] Also create the FFMPEG::xxxxx imported targets. Only works for pkgconfig-based systems at the moment. --- CMakeFiles/FindFFmpeg.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeFiles/FindFFmpeg.cmake b/CMakeFiles/FindFFmpeg.cmake index 6828440c5..6cba98a1e 100644 --- a/CMakeFiles/FindFFmpeg.cmake +++ b/CMakeFiles/FindFFmpeg.cmake @@ -92,6 +92,12 @@ macro(find_component _component _pkgconfig _library _header) ${_component}_DEFINITIONS ${_component}_VERSION) + add_library(FFMPEG::${_component} SHARED IMPORTED) + set_target_properties(FFMPEG::${_component} PROPERTIES + IMPORTED_LOCATION "${PC_${_component}_LIBDIR}/lib${_library}.so" + INTERFACE_INCLUDE_DIRECTORIES "${${_component}_INCLUDE_DIRS}" + ) + message("xxxjack created library ffmpeg::${_component}") endmacro() From dc399a1e5554f8263069a8361ae66f8021686a98 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 14:37:05 +0100 Subject: [PATCH 041/182] Use modern cmake dependency on FFMPEG::AVCODEC. --- src/plugins/Telx2Ttml/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index 84b598d0a..8914690f4 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -5,13 +5,12 @@ add_library(TeletextToTTML SHARED ) # Link dependencies if any -target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT} ${FFMPEG_LIBRARIES}) +target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT} FFMPEG::AVCODEC) # Include directories target_include_directories(TeletextToTTML PUBLIC ${CMAKE_SOURCE_DIR}/src - ${FFMPEG_INCLUDE_DIRS} ) # Set properties for the target From aac0e625b9f5d531e21b54ce4145562ca8cf294c Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 15:55:26 +0100 Subject: [PATCH 042/182] ANother modern ffpmeg dependency. --- src/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 7ce1fd184..c8457bf28 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -39,7 +39,7 @@ target_link_libraries(unittests pipeline utils curl - avcodec + FFMPEG::AVCODEC ) # Include directories for unit tests From 517a945fde1db4b29a35b9aa483c697345864afb Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 16:59:10 +0100 Subject: [PATCH 043/182] Getting started with cmake presets. Getting started with supporting multiple platforms. --- CMakeLists.txt | 81 ++++++----- CMakePresets.json | 243 +++++++++++++++++++++++++++++++++ src/lib_modules/CMakeLists.txt | 18 ++- src/lib_utils/CMakeLists.txt | 11 +- 4 files changed, 317 insertions(+), 36 deletions(-) create mode 100644 CMakePresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dc3681c3..b8f33023a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,19 +11,51 @@ set(CMAKE_MODULE_PATH set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Global compiler options -add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) - -# Debug-specific options -if(CMAKE_BUILD_TYPE STREQUAL "Debug") - add_compile_options(-g3) +# Change some compiler options that are dependent on the target platform. +# xxxjack some are actually dependent on the toolchain... +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) + + # Debug-specific options + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-g3) + endif() + + # Release-specific options + if(CMAKE_BUILD_TYPE STREQUAL "Release") + add_compile_options(-w -DNDEBUG) + add_link_options(-s) + endif() +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) + + # Debug-specific options + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-g3) + endif() + + # Release-specific options + if(CMAKE_BUILD_TYPE STREQUAL "Release") + add_compile_options(-w -DNDEBUG) + add_link_options(-s) + endif() +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) + + # Debug-specific options + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-g3) + endif() + + # Release-specific options + if(CMAKE_BUILD_TYPE STREQUAL "Release") + add_compile_options(-w -DNDEBUG) + add_link_options(-s) + endif() +else() + message(FATAL_ERROR " Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") endif() -# Release-specific options -if(CMAKE_BUILD_TYPE STREQUAL "Release") - add_compile_options(-w -DNDEBUG) - add_link_options(-s) -endif() # Define paths for source and scripts set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") @@ -63,32 +95,17 @@ set(GENERATED_SIGNALS_VERSION_HEADER ${SIGNALS_VERSION_HEADER}) message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") -# Check if SYSROOT_PATH is set via an environment variable -if(DEFINED ENV{SYSROOT_PATH}) - set(SYSROOT_PATH $ENV{SYSROOT_PATH}) - elseif(EXISTS "${CMAKE_SOURCE_DIR}/sysroot") - # If not set, use a default relative path or fail gracefully - set(SYSROOT_PATH "${CMAKE_SOURCE_DIR}/sysroot") -elseif(EXISTS "${CMAKE_SOURCE_DIR}/../sysroot") - # If not set, use a default relative path or fail gracefully - set(SYSROOT_PATH "${CMAKE_SOURCE_DIR}/../sysroot") -endif() # Ensure SYSROOT_PATH is valid if(NOT EXISTS ${SYSROOT_PATH}) - message(FATAL_ERROR "SYSROOT_PATH does not exist or is invalid: ${SYSROOT_PATH}") -endif() - -message(STATUS "Using SYSROOT_PATH: ${SYSROOT_PATH}") - -# Add the include and lib directories from SYSROOT_PATH -#include_directories(${SYSROOT_PATH}/include) -#link_directories(${SYSROOT_PATH}/lib) - -# Set pkg-config path -set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") + message(STATUS "No SYSROOT_PATH pre-set, not using sysroot") +else() + message(STATUS "Using SYSROOT_PATH: ${SYSROOT_PATH}") + # Set pkg-config path + set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") +endif() find_package(PkgConfig REQUIRED) find_package(SDL2 REQUIRED) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..c83315783 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,243 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 22, + "patch": 0 + }, + "configurePresets": [ + { + "name" : "no-vcpkg-no-sysroot", + "displayName" : "Build without vcpkg and without MotionSpell sysroot", + "description" : "Build without vcpkg and without MotionSpell sysroot", + "binaryDir": "${sourceDir}/build", + "hidden": true + }, + { + "name" : "sysroot", + "displayName" : "Build with MotionSpell sysroot", + "description" : "Build with MotionSpell sysroot", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "SYSROOT_PATH": "${sourceDir}/../sysroot" + }, + "hidden": true + }, + { + "name" : "vcpkg", + "displayName" : "Build with vcpkg", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake" + }, + "hidden": true + }, + + { + "name" : "windows", + "description" : "Build for production on Windows", + "generator" : "Visual Studio 17 2022", + "inherits" : "vcpkg", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows" + }, + "installDir": "${sourceDir}/../installed", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "hidden" : true + }, + { + "name" : "windows-production", + "description" : "Build for production on Windows", + "inherits" : "windows" + }, + { + "name" : "windows-develop", + "description" : "Build for development on Windows", + "inherits" : "windows" + },{ + "name" : "mac-production", + "description" : "Build for production on Mac", + "generator" : "Unix Makefiles", + "inherits" : "no-vcpkg-no-sysroot", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "mac-develop", + "description" : "Build for development on Mac", + "generator" : "Unix Makefiles", + "inherits" : "no-vcpkg-no-sysroot", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Debug" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "linux-production", + "description" : "Build for production on Linux", + "generator" : "Unix Makefiles", + "inherits" : "sysroot", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name" : "linux-develop", + "description" : "Build for development on Linux", + "generator" : "Unix Makefiles", + "inherits" : "sysroot", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "RelWithDebInfo" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + } + ], + "buildPresets" : [ + { + "name" : "windows-production", + "configurePreset" : "windows-production", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "windows-develop", + "configurePreset" : "windows-develop", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "mac-production", + "configurePreset" : "mac-production", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "mac-develop", + "configurePreset" : "mac-develop", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "linux-production", + "configurePreset" : "linux-production", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name" : "linux-develop", + "configurePreset" : "linux-develop", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + } + ], + "testPresets" : [ + { + "name" : "windows-production", + "configurePreset" : "windows", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "windows-develop", + "configurePreset" : "windows", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "mac-production", + "configurePreset" : "mac-production", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "mac-develop", + "configurePreset" : "mac-develop", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "linux-production", + "configurePreset" : "linux-production", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name" : "linux-develop", + "configurePreset" : "linux-develop", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + } + ] +} + diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 3564c2243..2bd8e60b3 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -22,10 +22,22 @@ target_compile_options(modules PUBLIC -Wall -Wextra -Werror -fPIC ) -# Add linker flags -target_link_options(modules PUBLIC +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + target_link_options(modules PUBLIC -pthread -Wl,--no-undefined -) + ) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + target_link_options(modules PUBLIC + -undefined error + ) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + target_link_options(modules PUBLIC + -pthread -Wl,--no-undefined + ) +else() + message(ERROR "Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") +endif() +# Add linker flags # Link dependencies if any target_link_libraries(modules PUBLIC utils) diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index b62d44b0b..6093cd289 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -5,7 +5,6 @@ set(LIB_UTILS_SRCS log.cpp log.hpp os.hpp - os_gnu.cpp # workaround for linux to be removed profiler.cpp profiler.hpp scheduler.cpp @@ -16,6 +15,16 @@ set(LIB_UTILS_SRCS system_clock.hpp sysclock.cpp ) +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + list(APPEND LIB_UTILS_SRCS os_mingw.cpp) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + list(APPEND LIB_UTILS_SRCS os_darwin.cpp) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + list(APPEND LIB_UTILS_SRCS os_gnu.cpp) +else() + message(ERROR "Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") +endif() + include_directories(${BIN_DIR} ${CMAKE_SOURCE_DIR}/src ) From 9070e39845c7e075bb70472f707b48dc241617e9 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 17:27:04 +0100 Subject: [PATCH 044/182] Use correct library prefix/suffix for the platform. --- CMakeFiles/FindFFmpeg.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeFiles/FindFFmpeg.cmake b/CMakeFiles/FindFFmpeg.cmake index 6cba98a1e..d46e726e7 100644 --- a/CMakeFiles/FindFFmpeg.cmake +++ b/CMakeFiles/FindFFmpeg.cmake @@ -94,15 +94,17 @@ macro(find_component _component _pkgconfig _library _header) add_library(FFMPEG::${_component} SHARED IMPORTED) set_target_properties(FFMPEG::${_component} PROPERTIES - IMPORTED_LOCATION "${PC_${_component}_LIBDIR}/lib${_library}.so" + IMPORTED_LOCATION "${PC_${_component}_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${_library}${CMAKE_SHARED_LIBRARY_SUFFIX}" INTERFACE_INCLUDE_DIRECTORIES "${${_component}_INCLUDE_DIRS}" ) - message("xxxjack created library ffmpeg::${_component}") + message("Created import library FFMPEG::${_component}") endmacro() # Check for cached results. If there are skip the costly part. -if (NOT FFMPEG_LIBRARIES) +# xxxjack removed for now, because we need the import libraries +# if (NOT FFMPEG_LIBRARIES) +if(TRUE) # Check for all possible component. find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h) From ec8b484ec8c255f860192d259c3fa2e3f71620bd Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 17:27:34 +0100 Subject: [PATCH 045/182] Mac complains about move(), use std::move(). --- src/lib_media/in/mpeg_dash_input.cpp | 2 +- src/lib_media/out/http_sink.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_media/in/mpeg_dash_input.cpp b/src/lib_media/in/mpeg_dash_input.cpp index 25c3b2b79..59446f072 100644 --- a/src/lib_media/in/mpeg_dash_input.cpp +++ b/src/lib_media/in/mpeg_dash_input.cpp @@ -134,7 +134,7 @@ MPEG_DASH_Input::MPEG_DASH_Input(KHost* host, IFilePullerFactory *filePullerFact auto out = addOutput(); out->setMetadata(meta); auto stream = make_unique(out, &rep, Fraction(rep.duration(mpd.get()), rep.timescale(mpd.get())), filePullerFactory->create(), eptr); - m_streams.push_back(move(stream)); + m_streams.push_back(std::move(stream)); } } diff --git a/src/lib_media/out/http_sink.cpp b/src/lib_media/out/http_sink.cpp index ae056e19f..5f0a73d25 100644 --- a/src/lib_media/out/http_sink.cpp +++ b/src/lib_media/out/http_sink.cpp @@ -55,7 +55,7 @@ struct HttpSink : Modules::ModuleS { auto http = Modules::createModule(m_host, httpConfig); http->getInput(0)->push(data); http->process(); - zeroSizeConnections[url] = move(http); + zeroSizeConnections[url] = std::move(http); } else { if (!exists(zeroSizeConnections, url)) { m_host->log(Debug, format("Starting transfer to URL: \"%s\"", url).c_str()); From c29c7a288e6270eb0ffd24d872e81818ef07aa31 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 17:46:02 +0100 Subject: [PATCH 046/182] Rationalizing more ffmpeg library refs in targets. --- src/lib_media/CMakeLists.txt | 46 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index d97b8f514..9158321f5 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -83,14 +83,12 @@ set_target_properties(AVCC2AnnexBConverter PROPERTIES set(EXE_LIBAVMUXHLSTS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/stream/hls_muxer_libav.cpp ${CMAKE_CURRENT_SOURCE_DIR}/common/libav.cpp - ${FFMPEG_INCLUDE_DIRS} ) # Combine all source files into a single list list(APPEND EXE_LIBAVMUXHLSTS_SRCS ${LIB_MODULES_SRCS} - ${FFMPEG_LIBRARIES} -) + ) # Add the target (LibavMuxHLSTS.smd) add_library(LibavMuxHLSTS SHARED ${EXE_LIBAVMUXHLSTS_SRCS}) @@ -99,7 +97,6 @@ add_library(LibavMuxHLSTS SHARED ${EXE_LIBAVMUXHLSTS_SRCS}) target_include_directories(LibavMuxHLSTS PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) # Link libraries to the target @@ -109,7 +106,8 @@ target_link_libraries(LibavMuxHLSTS modules pipeline appcommon - ${FFMPEG_LIBRARIES} + FFMPEG::AVCODEC + FFMPEG::AVUTIL ) # Set target properties @@ -139,13 +137,14 @@ add_library(VideoConvert SHARED ${EXE_VIDEOCONVERTER_SRCS}) target_include_directories(VideoConvert PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) # Link the necessary libraries target_link_libraries(VideoConvert PRIVATE media modules pipeline appcommon utils - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL + FFMPEG::AVCODEC + FFMPEG::SWSCALE ) # Set properties for the target @@ -168,7 +167,6 @@ target_include_directories(AudioConvert PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(AudioConvert PRIVATE @@ -177,7 +175,9 @@ target_link_libraries(AudioConvert pipeline appcommon utils - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL + FFMPEG::AVCODEC + FFMPEG::SWRESAMPLE ) set_target_properties(AudioConvert PROPERTIES OUTPUT_NAME "AudioConvert" @@ -255,7 +255,6 @@ target_include_directories(Encoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(Encoder @@ -265,7 +264,8 @@ target_link_libraries(Encoder pipeline appcommon utils - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL + FFMPEG::AVCODEC ) set_target_properties(Encoder PROPERTIES OUTPUT_NAME "Encoder" @@ -288,7 +288,6 @@ target_include_directories(Decoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(Decoder PRIVATE @@ -297,7 +296,8 @@ target_link_libraries(Decoder pipeline appcommon utils - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL + FFMPEG::AVCODEC ) set_target_properties(Decoder PROPERTIES OUTPUT_NAME "Decoder" @@ -320,7 +320,6 @@ target_include_directories(LibavDemux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(LibavDemux PRIVATE @@ -329,7 +328,10 @@ target_link_libraries(LibavDemux pipeline appcommon utils - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL + FFMPEG::AVFORMAT + FFMPEG::AVCODEC + FFMPEG::AVDEVICE ) set_target_properties(LibavDemux PROPERTIES @@ -352,7 +354,6 @@ target_include_directories(LibavMux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(LibavMux PRIVATE @@ -361,7 +362,9 @@ target_link_libraries(LibavMux pipeline appcommon utils - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL + FFMPEG::AVFORMAT + FFMPEG::AVCODEC ) set_target_properties(LibavMux PROPERTIES OUTPUT_NAME "LibavMux" @@ -382,7 +385,6 @@ target_include_directories(LibavFilter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(LibavFilter PRIVATE @@ -391,7 +393,9 @@ target_link_libraries(LibavFilter pipeline appcommon utils - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL + FFMPEG::AVCODEC + FFMPEG::AVFILTER ) set_target_properties(LibavFilter PROPERTIES OUTPUT_NAME "LibavFilter" @@ -412,7 +416,6 @@ target_include_directories(GPACMuxMP4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(GPACMuxMP4 PRIVATE @@ -422,7 +425,7 @@ target_link_libraries(GPACMuxMP4 appcommon utils gpac::gpac - ${FFMPEG_LIBRARIES} + FFMPEG::AVUTIL ) set_target_properties(GPACMuxMP4 PROPERTIES OUTPUT_NAME "GPACMuxMP4" @@ -497,7 +500,6 @@ target_include_directories(GPACDemuxMP4Full PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ - ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(GPACDemuxMP4Full PRIVATE From 3cfb95fc30f8d4c12b05f1932245cfdbbf598429 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 17:46:35 +0100 Subject: [PATCH 047/182] Temporary fixes for finding the right ffmpeg on OSX. --- CMakeLists.txt | 5 +++++ src/lib_modules/CMakeLists.txt | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8f33023a..ff5926929 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,11 @@ else() set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") endif() +# xxxjack temporary hack +if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/opt/ffmpeg@4/lib/pkgconfig") +endif() + find_package(PkgConfig REQUIRED) find_package(SDL2 REQUIRED) find_package(libjpeg-turbo REQUIRED) diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 2bd8e60b3..f74988ae9 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -27,9 +27,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") -pthread -Wl,--no-undefined ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - target_link_options(modules PUBLIC - -undefined error - ) + # xxxjack -undefined error is deprecated + #target_link_options(modules PUBLIC + #-undefined error + #) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_options(modules PUBLIC -pthread -Wl,--no-undefined From 00282c203c9201f42bf99dab70a4bcc0ae963730 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 29 Nov 2024 18:10:17 +0100 Subject: [PATCH 048/182] Be a bit smarter about SYSROOT. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff5926929..fec366ae6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.22) project(Signals VERSION 1.0) # Add extension directories (for things like Find) @@ -97,7 +97,8 @@ message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADE # Ensure SYSROOT_PATH is valid -if(NOT EXISTS ${SYSROOT_PATH}) +if(NOT SYSROOT_PATH) +elseif(NOT EXISTS ${SYSROOT_PATH}) message(STATUS "No SYSROOT_PATH pre-set, not using sysroot") else() From e68bf160947e47c0a8994f960b1c27237e28c576 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sun, 1 Dec 2024 23:26:14 +0100 Subject: [PATCH 049/182] Ignore toplevel tmp directory. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 87848d34f..a77a79641 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ x64/ build/ [Bb]in/ [Oo]bj/ +tmp/ # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets !packages/*/build/ From b538d0dc55c1bdb5075ca8fa1013d15bcc94bdd2 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sun, 1 Dec 2024 23:31:52 +0100 Subject: [PATCH 050/182] Partial cherry-pick of 0fb5efc3: prepare for building with sysroot on mac. --- .vscode/settings.json | 4 ++++ CMakeLists.txt | 5 ----- CMakePresets.json | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..809e51d15 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "cmake.configureOnOpen": false, + "makefile.configureOnOpen": false +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fec366ae6..210b00a9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,11 +108,6 @@ else() set(ENV{PKG_CONFIG_PATH} "${SYSROOT_PATH}/lib/pkgconfig") endif() -# xxxjack temporary hack -if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/opt/ffmpeg@4/lib/pkgconfig") -endif() - find_package(PkgConfig REQUIRED) find_package(SDL2 REQUIRED) find_package(libjpeg-turbo REQUIRED) diff --git a/CMakePresets.json b/CMakePresets.json index c83315783..9cf94b5ec 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -62,7 +62,7 @@ "name" : "mac-production", "description" : "Build for production on Mac", "generator" : "Unix Makefiles", - "inherits" : "no-vcpkg-no-sysroot", + "inherits" : "sysroot", "cacheVariables" : { "CMAKE_BUILD_TYPE" : "Release" }, @@ -76,7 +76,7 @@ "name" : "mac-develop", "description" : "Build for development on Mac", "generator" : "Unix Makefiles", - "inherits" : "no-vcpkg-no-sysroot", + "inherits" : "sysroot", "cacheVariables" : { "CMAKE_BUILD_TYPE" : "Debug" }, From 895d158ded8a039b9136eb7dd4598cf6a4df0112 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sat, 30 Nov 2024 00:22:49 +0100 Subject: [PATCH 051/182] Use correct prefix and suffix for libraries. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 210b00a9d..e643f1442 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,7 @@ if (NOT GPAC_FOUND) pkg_check_modules(GPAC REQUIRED gpac) add_library(gpac::gpac SHARED IMPORTED) set_target_properties(gpac::gpac PROPERTIES - IMPORTED_LOCATION "${GPAC_LIBDIR}/libgpac.so" + IMPORTED_LOCATION "${GPAC_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gpac${CMAKE_SHARED_LIBRARY_SUFFIX}" INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" ) endif() From b0f8f8b1303850e5bb495f51834e51cc50eb4f36 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sun, 1 Dec 2024 22:57:20 +0100 Subject: [PATCH 052/182] Hand-crafted script to build ffmpeg and gpac on MacOS with the correct options. --- mac-manual-sysroot-build.sh | 120 ++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100755 mac-manual-sysroot-build.sh diff --git a/mac-manual-sysroot-build.sh b/mac-manual-sysroot-build.sh new file mode 100755 index 000000000..99441251c --- /dev/null +++ b/mac-manual-sysroot-build.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# +# Download, build and locally deploy external dependencies +# +build_ffmpeg=true +build_gpac=true +set -x +mkdir -p ../sysroot +PREFIX=`realpath ../sysroot` +mkdir -p tmp/build-sysroot/downloads +pushd tmp/build-sysroot +if $build_ffmpeg; then + wget "http://ffmpeg.org/releases/ffmpeg-4.3.8.tar.bz2" -c -O "downloads/ffmpeg-4.3.8.tar.bz2" --no-verbose + tar xfv "downloads/ffmpeg.tar.bz2" + mkdir -p ffmpeg-4.3.8/build + pushd ffmpeg-4.3.8/build + ../configure \ + --prefix=$PREFIX \ + --enable-pthreads \ + --disable-w32threads \ + --disable-debug \ + --disable-doc \ + --disable-static \ + --enable-shared \ + --enable-libopenh264 \ + --enable-zlib \ + --disable-programs \ + --disable-gnutls \ + --disable-openssl \ + --disable-iconv \ + --disable-bzlib \ + --enable-avresample \ + --disable-decoder=mp3float \ + --pkg-config=pkg-config + make + make install + popd +fi +if $build_gpac; then + if [ ! -d gpac ]; then + git clone https://github.com/gpac/gpac.git gpac + fi + pushd gpac + git checkout -q "c02c9a2fb0815bfd28b7c4c46630601ad7fe291d" + git submodule update --init + mkdir -p build + pushd build + os=Darwin + ../configure \ + --target-os=$os \ + --extra-cflags="-I$PREFIX/include -w -fPIC" \ + --extra-ldflags="-L$PREFIX/lib" \ + --verbose \ + --prefix=$PREFIX \ + --disable-player \ + --disable-ssl \ + --disable-alsa \ + --disable-jack \ + --disable-oss-audio \ + --disable-pulseaudio\ + --use-png=no \ + --use-jpeg=no \ + --disable-3d \ + --disable-atsc \ + --disable-avi \ + --disable-bifs \ + --disable-bifs-enc \ + --disable-crypt \ + --disable-dvb4linux \ + --disable-dvbx \ + --disable-ipv6 \ + --disable-laser \ + --disable-loader-bt \ + --disable-loader-isoff \ + --disable-loader-xmt \ + --disable-m2ps \ + --disable-mcrypt \ + --disable-od-dump \ + --disable-odf \ + --disable-ogg \ + --disable-opt \ + --disable-platinum \ + --disable-qtvr \ + --disable-saf \ + --disable-scene-dump \ + --disable-scene-encode \ + --disable-scene-stats \ + --disable-scenegraph \ + --disable-seng \ + --disable-sman \ + --disable-streaming \ + --disable-svg \ + --disable-swf \ + --disable-vobsub \ + --disable-vrml \ + --disable-wx \ + --disable-x11 \ + --disable-x11-shm \ + --disable-x11-xv \ + --disable-x3d \ + --enable-export \ + --enable-import \ + --enable-parsers \ + --enable-m2ts \ + --enable-m2ts-mux \ + --enable-ttxt \ + --enable-hevc \ + --enable-isoff \ + --enable-isoff-frag \ + --enable-isoff-hds \ + --enable-isoff-hint \ + --enable-isoff-write \ + --enable-isom-dump + make lib + make install + make install-lib + popd + popd + +fi \ No newline at end of file From d3a8c06a9d93ecad12bdac8c2060ed3358aec46f Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sun, 1 Dec 2024 23:24:19 +0100 Subject: [PATCH 053/182] Attempting to fix SdlRenderer build. --- src/plugins/SdlRender/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt index f8b6d7aca..efda182bd 100644 --- a/src/plugins/SdlRender/CMakeLists.txt +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -12,12 +12,14 @@ add_library(SDLVideo SHARED ${SDLVideo_src}) # Link dependencies target_link_libraries(SDLVideo ${CMAKE_THREAD_LIBS_INIT} + modules SDL2::SDL2 ) # Include directories target_include_directories(SDLVideo PUBLIC ${CMAKE_SOURCE_DIR}/src + ${SDL2_INCLUDE_DIRS} ) # Set properties for the target @@ -38,14 +40,16 @@ add_library(SDLAudio SHARED ${SDLAudio_src}) # Link dependencies target_link_libraries(SDLAudio - ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_THREAD_LIBS_INIT} + modules SDL2::SDL2 # Link SDL2 ) # Include directories for SDLAudio target_include_directories(SDLAudio PUBLIC ${CMAKE_SOURCE_DIR}/src - ${CMAKE_CURRENT_SOURCE_DIR}/plugins/SdlRender + ${CMAKE_CURRENT_SOURCE_DIR}/plugins/SdlRender + ${SDL2_INCLUDE_DIRS} ) # Set properties for SDLAudio target From 383cf6db66082918156a22bb6fb7e8796a264553 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 11:36:26 +0100 Subject: [PATCH 054/182] Ouch. A linker -s option sneaked in there, so the shared libraries were stripped. Not good. --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e643f1442..c45c1429b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") # Release-specific options if(CMAKE_BUILD_TYPE STREQUAL "Release") add_compile_options(-w -DNDEBUG) - add_link_options(-s) endif() elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) From 5c57842f6a13dab9b28cfe652b874808c5172aae Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 12:10:26 +0100 Subject: [PATCH 055/182] Missed two more -s options. --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c45c1429b..d1d9be02c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,6 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") # Release-specific options if(CMAKE_BUILD_TYPE STREQUAL "Release") add_compile_options(-w -DNDEBUG) - add_link_options(-s) endif() elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) @@ -49,7 +48,6 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") # Release-specific options if(CMAKE_BUILD_TYPE STREQUAL "Release") add_compile_options(-w -DNDEBUG) - add_link_options(-s) endif() else() message(FATAL_ERROR " Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") From 0bf730e3b3bb2b807b210e27b2ec58b2f4ce743e Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 12:48:40 +0100 Subject: [PATCH 056/182] Set visibility=default (for now), otherwise symbols from the libmodules library can't be seen. --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1d9be02c..f1fa26cf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Change some compiler options that are dependent on the target platform. # xxxjack some are actually dependent on the toolchain... if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) + add_compile_options(-Wall -Wextra -Werror -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated-declarations) # Debug-specific options if(CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -26,8 +26,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") add_compile_options(-w -DNDEBUG) endif() elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) - + add_compile_options(-Wall -Wextra -Werror -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated-declarations) # Debug-specific options if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_compile_options(-g3) @@ -38,7 +37,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") add_compile_options(-w -DNDEBUG) endif() elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - add_compile_options(-Wall -Wextra -Werror -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations) + add_compile_options(-Wall -Wextra -Werror -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated-declarations) # Debug-specific options if(CMAKE_BUILD_TYPE STREQUAL "Debug") From b84e49abeb5d3d165951a16548756cdc0af56af9 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 13:08:06 +0100 Subject: [PATCH 057/182] Various plugins were missing their dependency on modules. Added. Everything now builds on Mac! --- src/plugins/Fmp4Splitter/CMakeLists.txt | 5 ++++- src/plugins/MulticastInput/CMakeLists.txt | 3 ++- src/plugins/Telx2Ttml/CMakeLists.txt | 6 +++++- src/plugins/TsDemuxer/CMakeLists.txt | 5 ++++- src/plugins/TsMuxer/CMakeLists.txt | 5 ++++- src/plugins/UdpOutput/CMakeLists.txt | 3 ++- src/plugins/UdpOutput/socket_gnu.cpp | 1 + 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index 0c49b91f5..6e51ffca8 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -4,7 +4,10 @@ add_library(FMP4SPLITTER SHARED ) # Link dependencies if any -target_link_libraries(FMP4SPLITTER ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(FMP4SPLITTER + ${CMAKE_THREAD_LIBS_INIT} + modules + ) # Include directories target_include_directories(FMP4SPLITTER PUBLIC diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index e4701b4aa..b1ec7f521 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -25,7 +25,8 @@ add_library(MulticastInput SHARED ${MulticastInput_src}) # Link dependencies target_link_libraries(MulticastInput - ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_THREAD_LIBS_INIT} + modules ) # Include directories diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index 8914690f4..942449be6 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -5,7 +5,11 @@ add_library(TeletextToTTML SHARED ) # Link dependencies if any -target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT} FFMPEG::AVCODEC) +target_link_libraries(TeletextToTTML + ${CMAKE_THREAD_LIBS_INIT} + modules + FFMPEG::AVCODEC + ) # Include directories target_include_directories(TeletextToTTML diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index cb630dc98..eb053d111 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -4,7 +4,10 @@ add_library(TsDemuxer SHARED ) # Link dependencies if any -target_link_libraries(TsDemuxer ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(TsDemuxer + ${CMAKE_THREAD_LIBS_INIT} + modules + ) # Include directories target_include_directories(TsDemuxer PUBLIC diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt index 427a8408d..91fa0aa02 100644 --- a/src/plugins/TsMuxer/CMakeLists.txt +++ b/src/plugins/TsMuxer/CMakeLists.txt @@ -6,7 +6,10 @@ add_library(TsMuxer SHARED ) # Link dependencies if any -target_link_libraries(TsMuxer ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(TsMuxer + ${CMAKE_THREAD_LIBS_INIT} + modules + ) # Include directories target_include_directories(TsMuxer PUBLIC diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index 69708bafb..dc267cdff 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -25,7 +25,8 @@ add_library(UdpOutput SHARED ${UdpOutput_src}) # Link dependencies target_link_libraries(UdpOutput - ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_THREAD_LIBS_INIT} + modules ) # Include directories diff --git a/src/plugins/UdpOutput/socket_gnu.cpp b/src/plugins/UdpOutput/socket_gnu.cpp index 7b1dda7eb..49c77a1b8 100644 --- a/src/plugins/UdpOutput/socket_gnu.cpp +++ b/src/plugins/UdpOutput/socket_gnu.cpp @@ -9,6 +9,7 @@ #include #include #include // strerror +#include using namespace std; From 5ba1b56e1f52031d04297bdb9782edf248341aef Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 14:10:47 +0100 Subject: [PATCH 058/182] Boilerplate for vcpkg. --- CMakePresets.json | 43 +++++++++++++++++++++++++++------------- vcpkg-configuration.json | 14 +++++++++++++ vcpkg.json | 8 ++++++++ 3 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg.json diff --git a/CMakePresets.json b/CMakePresets.json index 9cf94b5ec..4933cad07 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -58,20 +58,35 @@ "name" : "windows-develop", "description" : "Build for development on Windows", "inherits" : "windows" - },{ - "name" : "mac-production", - "description" : "Build for production on Mac", - "generator" : "Unix Makefiles", - "inherits" : "sysroot", - "cacheVariables" : { - "CMAKE_BUILD_TYPE" : "Release" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - } - }, + }, + { + "name" : "mac-production", + "description" : "Build for production on Mac", + "generator" : "Unix Makefiles", + "inherits" : "sysroot", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "mac-vcpkg-production", + "description" : "Build for production on Mac", + "generator" : "Unix Makefiles", + "inherits" : "vcpkg", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, { "name" : "mac-develop", "description" : "Build for development on Mac", diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 000000000..5a80f07cf --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,14 @@ +{ + "default-registry": { + "kind": "git", + "baseline": "d2b6159679a36b233b0c31bdf027a57c2bf480db", + "repository": "https://github.com/microsoft/vcpkg" + }, + "registries": [ + { + "kind": "artifact", + "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", + "name": "microsoft" + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 000000000..d50f765a1 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "signals", + "version": "0.1", + "dependencies": [ + "ffmpeg", + "gpac" + ] +} From 4e5de73c52ca1e666cc6ef38b1e9eec7d9297e22 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 15:11:21 +0100 Subject: [PATCH 059/182] Getting started on gpac vcpkg port. --- vcpkg-additions/ports/gpac/portfile.cmake | 9 +++++++++ vcpkg-additions/ports/gpac/vcpkg.json | 14 ++++++++++++++ vcpkg-configuration.json | 3 +++ 3 files changed, 26 insertions(+) create mode 100644 vcpkg-additions/ports/gpac/portfile.cmake create mode 100644 vcpkg-additions/ports/gpac/vcpkg.json diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake new file mode 100644 index 000000000..15c6c6e3a --- /dev/null +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -0,0 +1,9 @@ +vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO gpac/gpac + REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d + SHA512 e0ae99684e54f4862edf53238f3bd095f451cb689878c6f9fff0a2aff882fe2eed28a723ac7596a541ff509d96e64582431b9c145c278444e3e5f5caa1b4f612 + HEAD_REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d +) \ No newline at end of file diff --git a/vcpkg-additions/ports/gpac/vcpkg.json b/vcpkg-additions/ports/gpac/vcpkg.json new file mode 100644 index 000000000..eeeef138f --- /dev/null +++ b/vcpkg-additions/ports/gpac/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "gpac", + "version": "0.8.0", + "description": "multimedia framework oriented towards rich media", + "homepage": "https://microsoft.github.io/scenepic/", + "license": "MIT", + "dependencies": [ + + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} \ No newline at end of file diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 5a80f07cf..e859b443d 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -10,5 +10,8 @@ "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", "name": "microsoft" } + ], + "overlay-ports" : [ + "./vcpkg-additions/ports/gpac" ] } From 5d3916ab6fa3c02a71de680d7a8c850eb4e7ee45 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 16:27:33 +0100 Subject: [PATCH 060/182] Getting started on building gpac through vcpkg. Slow going. --- vcpkg-additions/ports/gpac/portfile.cmake | 86 ++++++++++++++++++++++- vcpkg-additions/ports/gpac/vcpkg.json | 3 +- 2 files changed, 87 insertions(+), 2 deletions(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 15c6c6e3a..29e99d3e0 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -6,4 +6,88 @@ vcpkg_from_github( REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d SHA512 e0ae99684e54f4862edf53238f3bd095f451cb689878c6f9fff0a2aff882fe2eed28a723ac7596a541ff509d96e64582431b9c145c278444e3e5f5caa1b4f612 HEAD_REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d -) \ No newline at end of file +) + +vcpkg_list(SET OPTIONS) + +if(VCPKG_TARGET_IS_OSX) + + + list(APPEND OPTIONS + --target-os=Darwin + --extra-cflags=-I${CURRENT_INSTALLED_DIR}/include + --extra-ldflags=-L${CURRENT_INSTALLED_DIR}/lib + ) +endif() + +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + DETERMINE_BUILD_TRIPLET + NO_ADDITIONAL_PATHS + OPTIONS + ${OPTIONS} + --disable-player + --disable-ssl + --disable-alsa + --disable-jack + --disable-oss-audio + --disable-pulseaudio + --use-png=no + --use-jpeg=no + --disable-3d + --disable-atsc + --disable-avi + --disable-bifs + --disable-bifs-enc + --disable-crypt + --disable-dvb4linux + --disable-dvbx + --disable-ipv6 + --disable-laser + --disable-loader-bt + --disable-loader-isoff + --disable-loader-xmt + --disable-m2ps + --disable-mcrypt + --disable-od-dump + --disable-odf + --disable-ogg + --disable-opt + --disable-platinum + --disable-qtvr + --disable-saf + --disable-scene-dump + --disable-scene-encode + --disable-scene-stats + --disable-scenegraph + --disable-seng + --disable-sman + --disable-streaming + --disable-svg + --disable-swf + --disable-vobsub + --disable-vrml + --disable-wx + --disable-x11 + --disable-x11-shm + --disable-x11-xv + --disable-x3d + --enable-export + --enable-import + --enable-parsers + --enable-m2ts + --enable-m2ts-mux + --enable-ttxt + --enable-hevc + --enable-isoff + --enable-isoff-frag + --enable-isoff-hds + --enable-isoff-hint + --enable-isoff-write + --enable-isom-dump + ${OPTIONS} +) + +vcpkg_install_make() + +vcpkg_fixup_pkgconfig() \ No newline at end of file diff --git a/vcpkg-additions/ports/gpac/vcpkg.json b/vcpkg-additions/ports/gpac/vcpkg.json index eeeef138f..ffc603d64 100644 --- a/vcpkg-additions/ports/gpac/vcpkg.json +++ b/vcpkg-additions/ports/gpac/vcpkg.json @@ -9,6 +9,7 @@ { "name": "vcpkg-cmake-config", "host": true - } + }, + "ffmpeg" ] } \ No newline at end of file From 191f2cd3df26ad848451ac97ad7732a36b757205 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 23:17:50 +0100 Subject: [PATCH 061/182] Trying to build a fairly recent version of gpac. --- vcpkg-additions/ports/gpac/portfile.cmake | 21 +++++++++++---------- vcpkg-additions/ports/gpac/vcpkg.json | 8 +++++--- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 29e99d3e0..580604982 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -3,9 +3,9 @@ vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gpac/gpac - REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d - SHA512 e0ae99684e54f4862edf53238f3bd095f451cb689878c6f9fff0a2aff882fe2eed28a723ac7596a541ff509d96e64582431b9c145c278444e3e5f5caa1b4f612 - HEAD_REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d + REF d0321826c09e3cd7b8c1ed4019626520d166b8f6 + SHA512 b3421f51665a16de2b0d2c5b57754fde61a0190b6627f88b47d71e3bd6d4c4c3839ff35c167307924b54f9df0040085124c5503b1b58eaa676e4dd139d216ba1 + HEAD_REF master ) vcpkg_list(SET OPTIONS) @@ -13,11 +13,11 @@ vcpkg_list(SET OPTIONS) if(VCPKG_TARGET_IS_OSX) - list(APPEND OPTIONS - --target-os=Darwin - --extra-cflags=-I${CURRENT_INSTALLED_DIR}/include - --extra-ldflags=-L${CURRENT_INSTALLED_DIR}/lib - ) +# list(APPEND OPTIONS +# --target-os=Darwin +# --extra-cflags=-I${CURRENT_INSTALLED_DIR}/include +# --extra-ldflags=-L${CURRENT_INSTALLED_DIR}/lib +# ) endif() vcpkg_configure_make( @@ -26,7 +26,8 @@ vcpkg_configure_make( NO_ADDITIONAL_PATHS OPTIONS ${OPTIONS} - --disable-player + # --disable-player xxxjack this will disable the compositor, which will break the build. + --disable-evg # xxxjack added, because it needs svg, which is disabled. --disable-ssl --disable-alsa --disable-jack @@ -59,7 +60,7 @@ vcpkg_configure_make( --disable-scene-dump --disable-scene-encode --disable-scene-stats - --disable-scenegraph + # --disable-scenegraph xxxjack this will disable the compositor, which will break the build. --disable-seng --disable-sman --disable-streaming diff --git a/vcpkg-additions/ports/gpac/vcpkg.json b/vcpkg-additions/ports/gpac/vcpkg.json index ffc603d64..8b8940d26 100644 --- a/vcpkg-additions/ports/gpac/vcpkg.json +++ b/vcpkg-additions/ports/gpac/vcpkg.json @@ -1,8 +1,8 @@ { "name": "gpac", - "version": "0.8.0", + "version": "2.4.0", "description": "multimedia framework oriented towards rich media", - "homepage": "https://microsoft.github.io/scenepic/", + "homepage": "https://gpac.io/", "license": "MIT", "dependencies": [ @@ -10,6 +10,8 @@ "name": "vcpkg-cmake-config", "host": true }, - "ffmpeg" + "ffmpeg", + "libtheora", + "libvorbis" ] } \ No newline at end of file From f86e7eff4d1cf91c7ebe3000ed969625662fb7db Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 23:47:04 +0100 Subject: [PATCH 062/182] Apparently we also need to enable evg and svg, otherwise the compositor isn't included (it's disabled somewhere deep in gpac configuration header files). --- vcpkg-additions/ports/gpac/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 580604982..b711b9490 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -27,7 +27,6 @@ vcpkg_configure_make( OPTIONS ${OPTIONS} # --disable-player xxxjack this will disable the compositor, which will break the build. - --disable-evg # xxxjack added, because it needs svg, which is disabled. --disable-ssl --disable-alsa --disable-jack @@ -64,7 +63,7 @@ vcpkg_configure_make( --disable-seng --disable-sman --disable-streaming - --disable-svg + # --disable-svg xxxjack this will disable evg, which will disable the compositor, which will break the build. --disable-swf --disable-vobsub --disable-vrml From d2f7901ee815be27a8375ddc5ac2ea513bf76634 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 3 Dec 2024 00:08:08 +0100 Subject: [PATCH 063/182] Reverted FFMPEG::libname idea, and use FFMPEG_INCLUDE_DIRS and FFMPEG_LIBRARIES again. The vcpkg-installed ffmpeg supports only that. --- CMakeFiles/FindFFmpeg.cmake | 10 +------ src/lib_media/CMakeLists.txt | 41 ++++++++++++---------------- src/plugins/Telx2Ttml/CMakeLists.txt | 3 +- src/tests/CMakeLists.txt | 3 +- 4 files changed, 23 insertions(+), 34 deletions(-) diff --git a/CMakeFiles/FindFFmpeg.cmake b/CMakeFiles/FindFFmpeg.cmake index d46e726e7..6828440c5 100644 --- a/CMakeFiles/FindFFmpeg.cmake +++ b/CMakeFiles/FindFFmpeg.cmake @@ -92,19 +92,11 @@ macro(find_component _component _pkgconfig _library _header) ${_component}_DEFINITIONS ${_component}_VERSION) - add_library(FFMPEG::${_component} SHARED IMPORTED) - set_target_properties(FFMPEG::${_component} PROPERTIES - IMPORTED_LOCATION "${PC_${_component}_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${_library}${CMAKE_SHARED_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${${_component}_INCLUDE_DIRS}" - ) - message("Created import library FFMPEG::${_component}") endmacro() # Check for cached results. If there are skip the costly part. -# xxxjack removed for now, because we need the import libraries -# if (NOT FFMPEG_LIBRARIES) -if(TRUE) +if (NOT FFMPEG_LIBRARIES) # Check for all possible component. find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 9158321f5..36d2a6258 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -97,6 +97,7 @@ add_library(LibavMuxHLSTS SHARED ${EXE_LIBAVMUXHLSTS_SRCS}) target_include_directories(LibavMuxHLSTS PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) # Link libraries to the target @@ -106,8 +107,7 @@ target_link_libraries(LibavMuxHLSTS modules pipeline appcommon - FFMPEG::AVCODEC - FFMPEG::AVUTIL + ${FFMPEG_LIBRARIES} ) # Set target properties @@ -137,14 +137,13 @@ add_library(VideoConvert SHARED ${EXE_VIDEOCONVERTER_SRCS}) target_include_directories(VideoConvert PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) # Link the necessary libraries target_link_libraries(VideoConvert PRIVATE media modules pipeline appcommon utils - FFMPEG::AVUTIL - FFMPEG::AVCODEC - FFMPEG::SWSCALE + ${FFMPEG_LIBRARIES} ) # Set properties for the target @@ -167,6 +166,7 @@ target_include_directories(AudioConvert PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(AudioConvert PRIVATE @@ -175,9 +175,7 @@ target_link_libraries(AudioConvert pipeline appcommon utils - FFMPEG::AVUTIL - FFMPEG::AVCODEC - FFMPEG::SWRESAMPLE + ${FFMPEG_LIBRARIES} ) set_target_properties(AudioConvert PROPERTIES OUTPUT_NAME "AudioConvert" @@ -255,6 +253,7 @@ target_include_directories(Encoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(Encoder @@ -264,8 +263,7 @@ target_link_libraries(Encoder pipeline appcommon utils - FFMPEG::AVUTIL - FFMPEG::AVCODEC + ${FFMPEG_LIBRARIES} ) set_target_properties(Encoder PROPERTIES OUTPUT_NAME "Encoder" @@ -288,6 +286,7 @@ target_include_directories(Decoder PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(Decoder PRIVATE @@ -296,8 +295,7 @@ target_link_libraries(Decoder pipeline appcommon utils - FFMPEG::AVUTIL - FFMPEG::AVCODEC + F${FFMPEG_LIBRARIES} ) set_target_properties(Decoder PROPERTIES OUTPUT_NAME "Decoder" @@ -320,6 +318,7 @@ target_include_directories(LibavDemux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(LibavDemux PRIVATE @@ -328,10 +327,7 @@ target_link_libraries(LibavDemux pipeline appcommon utils - FFMPEG::AVUTIL - FFMPEG::AVFORMAT - FFMPEG::AVCODEC - FFMPEG::AVDEVICE + ${FFMPEG_LIBRARIES} ) set_target_properties(LibavDemux PROPERTIES @@ -354,6 +350,7 @@ target_include_directories(LibavMux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(LibavMux PRIVATE @@ -362,9 +359,7 @@ target_link_libraries(LibavMux pipeline appcommon utils - FFMPEG::AVUTIL - FFMPEG::AVFORMAT - FFMPEG::AVCODEC + ${FFMPEG_LIBRARIES} ) set_target_properties(LibavMux PROPERTIES OUTPUT_NAME "LibavMux" @@ -385,6 +380,7 @@ target_include_directories(LibavFilter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(LibavFilter PRIVATE @@ -393,9 +389,7 @@ target_link_libraries(LibavFilter pipeline appcommon utils - FFMPEG::AVUTIL - FFMPEG::AVCODEC - FFMPEG::AVFILTER + ${FFMPEG_LIBRARIES} ) set_target_properties(LibavFilter PROPERTIES OUTPUT_NAME "LibavFilter" @@ -416,6 +410,7 @@ target_include_directories(GPACMuxMP4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/ + ${FFMPEG_INCLUDE_DIRS} ) target_link_libraries(GPACMuxMP4 PRIVATE @@ -425,7 +420,7 @@ target_link_libraries(GPACMuxMP4 appcommon utils gpac::gpac - FFMPEG::AVUTIL + ${FFMPEG_LIBRARIES} ) set_target_properties(GPACMuxMP4 PROPERTIES OUTPUT_NAME "GPACMuxMP4" diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index 942449be6..c2130e0b1 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -8,13 +8,14 @@ add_library(TeletextToTTML SHARED target_link_libraries(TeletextToTTML ${CMAKE_THREAD_LIBS_INIT} modules - FFMPEG::AVCODEC + ${FFMPEG_LIBRARIES} ) # Include directories target_include_directories(TeletextToTTML PUBLIC ${CMAKE_SOURCE_DIR}/src + ${FFMPEG_INCLUDE_DIRS} ) # Set properties for the target diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index c8457bf28..7990c9dd6 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -39,12 +39,13 @@ target_link_libraries(unittests pipeline utils curl - FFMPEG::AVCODEC + ${FFMPEG_LIBRARIES} ) # Include directories for unit tests target_include_directories(unittests PRIVATE ${CMAKE_SOURCE_DIR}/src + ${FFMPEG_INCLUDE_DIRS} ) # Set the output directory for the unittests executable inside the 'bin' folder From 1427418aabf92877cce3d58de142054839061de7 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Tue, 3 Dec 2024 12:58:35 +0100 Subject: [PATCH 064/182] Don't use configure-make on Windows. --- vcpkg-additions/ports/gpac/portfile.cmake | 163 +++++++++++----------- 1 file changed, 85 insertions(+), 78 deletions(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index b711b9490..4620a6207 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -8,86 +8,93 @@ vcpkg_from_github( HEAD_REF master ) -vcpkg_list(SET OPTIONS) +if (VCPKG_TARGET_IS_WINDOWS) + message(ERROR "Cannot build for ${TARGET_TRIPLET}") +else() + vcpkg_list(SET OPTIONS) -if(VCPKG_TARGET_IS_OSX) + if(VCPKG_TARGET_IS_OSX) - -# list(APPEND OPTIONS -# --target-os=Darwin -# --extra-cflags=-I${CURRENT_INSTALLED_DIR}/include -# --extra-ldflags=-L${CURRENT_INSTALLED_DIR}/lib -# ) -endif() + + # list(APPEND OPTIONS + # --target-os=Darwin + # --extra-cflags=-I${CURRENT_INSTALLED_DIR}/include + # --extra-ldflags=-L${CURRENT_INSTALLED_DIR}/lib + # ) + elseif(VCPKG_TARGET_IS_LINUX) + else() + message(ERROR "Unknown target ${TARGET_TRIPLET}") + endif() -vcpkg_configure_make( - SOURCE_PATH "${SOURCE_PATH}" - DETERMINE_BUILD_TRIPLET - NO_ADDITIONAL_PATHS - OPTIONS - ${OPTIONS} - # --disable-player xxxjack this will disable the compositor, which will break the build. - --disable-ssl - --disable-alsa - --disable-jack - --disable-oss-audio - --disable-pulseaudio - --use-png=no - --use-jpeg=no - --disable-3d - --disable-atsc - --disable-avi - --disable-bifs - --disable-bifs-enc - --disable-crypt - --disable-dvb4linux - --disable-dvbx - --disable-ipv6 - --disable-laser - --disable-loader-bt - --disable-loader-isoff - --disable-loader-xmt - --disable-m2ps - --disable-mcrypt - --disable-od-dump - --disable-odf - --disable-ogg - --disable-opt - --disable-platinum - --disable-qtvr - --disable-saf - --disable-scene-dump - --disable-scene-encode - --disable-scene-stats - # --disable-scenegraph xxxjack this will disable the compositor, which will break the build. - --disable-seng - --disable-sman - --disable-streaming - # --disable-svg xxxjack this will disable evg, which will disable the compositor, which will break the build. - --disable-swf - --disable-vobsub - --disable-vrml - --disable-wx - --disable-x11 - --disable-x11-shm - --disable-x11-xv - --disable-x3d - --enable-export - --enable-import - --enable-parsers - --enable-m2ts - --enable-m2ts-mux - --enable-ttxt - --enable-hevc - --enable-isoff - --enable-isoff-frag - --enable-isoff-hds - --enable-isoff-hint - --enable-isoff-write - --enable-isom-dump - ${OPTIONS} -) + vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + DETERMINE_BUILD_TRIPLET + NO_ADDITIONAL_PATHS + OPTIONS + ${OPTIONS} + # --disable-player xxxjack this will disable the compositor, which will break the build. + --disable-ssl + --disable-alsa + --disable-jack + --disable-oss-audio + --disable-pulseaudio + --use-png=no + --use-jpeg=no + --disable-3d + --disable-atsc + --disable-avi + --disable-bifs + --disable-bifs-enc + --disable-crypt + --disable-dvb4linux + --disable-dvbx + --disable-ipv6 + --disable-laser + --disable-loader-bt + --disable-loader-isoff + --disable-loader-xmt + --disable-m2ps + --disable-mcrypt + --disable-od-dump + --disable-odf + --disable-ogg + --disable-opt + --disable-platinum + --disable-qtvr + --disable-saf + --disable-scene-dump + --disable-scene-encode + --disable-scene-stats + # --disable-scenegraph xxxjack this will disable the compositor, which will break the build. + --disable-seng + --disable-sman + --disable-streaming + # --disable-svg xxxjack this will disable evg, which will disable the compositor, which will break the build. + --disable-swf + --disable-vobsub + --disable-vrml + --disable-wx + --disable-x11 + --disable-x11-shm + --disable-x11-xv + --disable-x3d + --enable-export + --enable-import + --enable-parsers + --enable-m2ts + --enable-m2ts-mux + --enable-ttxt + --enable-hevc + --enable-isoff + --enable-isoff-frag + --enable-isoff-hds + --enable-isoff-hint + --enable-isoff-write + --enable-isom-dump + ${OPTIONS} + ) -vcpkg_install_make() + vcpkg_install_make() -vcpkg_fixup_pkgconfig() \ No newline at end of file + vcpkg_fixup_pkgconfig() +endif() \ No newline at end of file From 2f992e48200e4d4ed23a1b4d23e8e431c1c19581 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Tue, 3 Dec 2024 12:59:04 +0100 Subject: [PATCH 065/182] Adding sdl2 and libturbo-jpeg dependencies. --- vcpkg.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index d50f765a1..4f2bbf461 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -3,6 +3,8 @@ "version": "0.1", "dependencies": [ "ffmpeg", - "gpac" + "gpac", + "sdl2", + "libjpeg-turbo" ] } From 51c35bad6692068e4cf6517495a80b636bbf7c77 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Tue, 3 Dec 2024 17:23:44 +0100 Subject: [PATCH 066/182] Use msbuild to build on Windows. --- vcpkg-additions/ports/gpac/portfile.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 4620a6207..13cf03ee3 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -9,7 +9,11 @@ vcpkg_from_github( ) if (VCPKG_TARGET_IS_WINDOWS) - message(ERROR "Cannot build for ${TARGET_TRIPLET}") + vcpkg_install_msbuild( + SOURCE_PATH "${SOURCE_PATH}" + PROJECT_SUBPATH "build\\msvc14\\gpac.sln" + + ) else() vcpkg_list(SET OPTIONS) From 5705e4c27222f53ab040e76b291cfb4b2999a17f Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 5 Dec 2024 16:01:46 +0100 Subject: [PATCH 067/182] Oops, an F got inserted that shouldn't be there. --- src/lib_media/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 36d2a6258..62f68ec97 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -295,7 +295,7 @@ target_link_libraries(Decoder pipeline appcommon utils - F${FFMPEG_LIBRARIES} + ${FFMPEG_LIBRARIES} ) set_target_properties(Decoder PROPERTIES OUTPUT_NAME "Decoder" From 81264d7945dfe893bb57d7b7a13daf6cd116c0bc Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 5 Dec 2024 16:02:43 +0100 Subject: [PATCH 068/182] Rationalized presets. But gpac still doesn't build with vcpkg. --- CMakePresets.json | 138 +++++++++++++++++++++++++++------------------- 1 file changed, 82 insertions(+), 56 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 4933cad07..2fcb9def5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -7,16 +7,16 @@ }, "configurePresets": [ { - "name" : "no-vcpkg-no-sysroot", + "name" : "preinstalled", "displayName" : "Build without vcpkg and without MotionSpell sysroot", - "description" : "Build without vcpkg and without MotionSpell sysroot", + "description" : "Build with app required dependencies pre-installed", "binaryDir": "${sourceDir}/build", "hidden": true }, { "name" : "sysroot", "displayName" : "Build with MotionSpell sysroot", - "description" : "Build with MotionSpell sysroot", + "description" : "Build with MotionSpell sysroot/zenbuild for required dependencies", "binaryDir": "${sourceDir}/build", "cacheVariables": { "SYSROOT_PATH": "${sourceDir}/../sysroot" @@ -26,18 +26,19 @@ { "name" : "vcpkg", "displayName" : "Build with vcpkg", + "description" : "Build with vcpkg to install required dependencies", "binaryDir": "${sourceDir}/build", "cacheVariables": { "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake" }, "hidden": true - }, - + }, { "name" : "windows", - "description" : "Build for production on Windows", + "description" : "Build for Windows", "generator" : "Visual Studio 17 2022", "inherits" : "vcpkg", + "hidden" : true, "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-windows" }, @@ -46,89 +47,114 @@ "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" - }, - "hidden" : true + } }, + { + "name" : "mac", + "description" : "Build for MacOS", + "generator" : "Unix Makefiles", + "inherits" : "vcpkg", + "hidden" : true, + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "arm64-osx-dynamic" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name" : "linux", + "description" : "Build for Linux", + "generator" : "Unix Makefiles", + "inherits" : "vcpkg", + "hidden" : true, + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-linux-dynamic" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, { "name" : "windows-production", "description" : "Build for production on Windows", - "inherits" : "windows" + "inherits" : "windows", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + } }, { "name" : "windows-develop", "description" : "Build for development on Windows", - "inherits" : "windows" + "inherits" : "windows", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "RelWithDebInfo" + } }, { "name" : "mac-production", "description" : "Build for production on Mac", - "generator" : "Unix Makefiles", - "inherits" : "sysroot", + "inherits" : "mac", "cacheVariables" : { "CMAKE_BUILD_TYPE" : "Release" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - } - }, - { - "name" : "mac-vcpkg-production", - "description" : "Build for production on Mac", - "generator" : "Unix Makefiles", - "inherits" : "vcpkg", - "cacheVariables" : { - "CMAKE_BUILD_TYPE" : "Release" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - } + } }, { "name" : "mac-develop", "description" : "Build for development on Mac", - "generator" : "Unix Makefiles", - "inherits" : "sysroot", + "inherits" : "mac", "cacheVariables" : { - "CMAKE_BUILD_TYPE" : "Debug" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - } + "CMAKE_BUILD_TYPE" : "RelWithDebInfo" + } }, { "name" : "linux-production", "description" : "Build for production on Linux", - "generator" : "Unix Makefiles", - "inherits" : "sysroot", + "inherits" : "linux", "cacheVariables" : { "CMAKE_BUILD_TYPE" : "Release" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Linux" - } + } }, { "name" : "linux-develop", "description" : "Build for development on Linux", - "generator" : "Unix Makefiles", - "inherits" : "sysroot", + "inherits" : "linux", "cacheVariables" : { "CMAKE_BUILD_TYPE" : "RelWithDebInfo" - }, + } + }, + { + "name" : "linux-production-sysroot", + "description" : "Build for production on Linux using sysroot/zenbuild", + "generator" : "Unix Makefiles", + "inherits" : "sysroot", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + }, "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Linux" + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name" : "linux-develop-sysroot", + "description" : "Build for development on Linux using sysroot/zenbuild", + "generator" : "Unix Makefiles", + "inherits" : "sysroot", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "RelWithDebInfo" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" } - } + } ], "buildPresets" : [ { From edcf8b5de13b29741f69b7fafb0bb1673631b06f Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 6 Dec 2024 00:03:57 +0100 Subject: [PATCH 069/182] Add extra include directories to the msbuild command line. Also trying extra library directories but not yet sure that this works. --- vcpkg-additions/ports/gpac/portfile.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 13cf03ee3..156b3a220 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -9,10 +9,22 @@ vcpkg_from_github( ) if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_list(SET EXTRA_INCLUDE_DIRS) + list(APPEND EXTRA_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include") + vcpkg_list(SET EXTRA_LIB_DIRS) + list(APPEND EXTRA_LIB_DIRS "${CURRENT_INSTALLED_DIR}/lib") + vcpkg_list(SET OPTIONS) + # Enable this line to get the msbuild configuration variable dump in the vcpkg output file + #list(APPEND OPTIONS /v:diag) + list(APPEND OPTIONS + /p:IncludePath=${EXTRA_INCLUDE_DIRS} + /p:AdditionalLibraryDirectories=${EXTRA_LIB_DIRS} + ) vcpkg_install_msbuild( SOURCE_PATH "${SOURCE_PATH}" - PROJECT_SUBPATH "build\\msvc14\\gpac.sln" - + PROJECT_SUBPATH "build/msvc14/gpac.sln" + OPTIONS + ${OPTIONS} ) else() vcpkg_list(SET OPTIONS) From f7b0582b34f6d8701232bc2195451cc01d9fdf6e Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 6 Dec 2024 00:05:24 +0100 Subject: [PATCH 070/182] We also need freetype and nghttp2. --- vcpkg.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 4f2bbf461..a157794ff 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -5,6 +5,8 @@ "ffmpeg", "gpac", "sdl2", - "libjpeg-turbo" + "libjpeg-turbo", + "freetype", + "nghttp2" ] } From 1787238fe24d064ac28508c1d551cbb26d2de348 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 6 Dec 2024 15:17:45 +0100 Subject: [PATCH 071/182] Pin gpac at SHA c02c9a2fb0815bfd28b7c4c46630601ad7fe291d --- vcpkg-additions/ports/gpac/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 156b3a220..cdeac900f 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gpac/gpac - REF d0321826c09e3cd7b8c1ed4019626520d166b8f6 - SHA512 b3421f51665a16de2b0d2c5b57754fde61a0190b6627f88b47d71e3bd6d4c4c3839ff35c167307924b54f9df0040085124c5503b1b58eaa676e4dd139d216ba1 + REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d + SHA512 e0ae99684e54f4862edf53238f3bd095f451cb689878c6f9fff0a2aff882fe2eed28a723ac7596a541ff509d96e64582431b9c145c278444e3e5f5caa1b4f612 HEAD_REF master ) From 459c4ef237cb711e90805f7bbf577cc7966215b6 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 6 Dec 2024 15:18:52 +0100 Subject: [PATCH 072/182] Ignore vcpkg_installed --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a77a79641..478ebbb6c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,8 @@ build/ [Bb]in/ [Oo]bj/ tmp/ +# This directory shows up so often during testing that"ll just ignore it. +vcpkg_installed/ # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets !packages/*/build/ From 539fed45cabd42d78a88bac0caf3173f669cae62 Mon Sep 17 00:00:00 2001 From: "VRTINY\\DIS" Date: Fri, 6 Dec 2024 15:22:11 +0100 Subject: [PATCH 073/182] Also allow building under windows-mingw. --- CMakePresets.json | 112 ++++++++++++++++------ vcpkg-additions/ports/gpac/portfile.cmake | 3 +- vcpkg-additions/ports/gpac/vcpkg.json | 8 +- 3 files changed, 90 insertions(+), 33 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 2fcb9def5..83f5c1f14 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -34,22 +34,38 @@ "hidden": true }, { - "name" : "windows", - "description" : "Build for Windows", - "generator" : "Visual Studio 17 2022", - "inherits" : "vcpkg", + "name" : "windows", + "description" : "Build for Windows", + "generator" : "Visual Studio 17 2022", + "inherits" : "vcpkg", + "hidden" : true, + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows" + }, + "installDir": "${sourceDir}/../installed", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "mingw", + "description" : "Build for Windows mingw", + "generator" : "MinGW Makefiles", + "inherits" : "vcpkg", "hidden" : true, "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows" - }, - "installDir": "${sourceDir}/../installed", - "condition": { + "VCPKG_TARGET_TRIPLET": "x64-mingw-dynamic" + }, + "installDir": "${sourceDir}/../installed", + "condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" } - }, - { + }, + { "name" : "mac", "description" : "Build for MacOS", "generator" : "Unix Makefiles", @@ -95,6 +111,22 @@ "CMAKE_BUILD_TYPE" : "RelWithDebInfo" } }, + { + "name" : "mingw-production", + "description" : "Build for production on Windows with mingw", + "inherits" : "mingw", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + } + }, + { + "name" : "mingw-develop", + "description" : "Build for development on Windows with mingw", + "inherits" : "mingw", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "RelWithDebInfo" + } + }, { "name" : "mac-production", "description" : "Build for production on Mac", @@ -157,27 +189,47 @@ } ], "buildPresets" : [ - { - "name" : "windows-production", - "configurePreset" : "windows-production", - "configuration" : "Release", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } - }, { - "name" : "windows-develop", - "configurePreset" : "windows-develop", - "configuration" : "RelWithDebInfo", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } - }, - { + "name" : "windows-production", + "configurePreset" : "windows-production", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "windows-develop", + "configurePreset" : "windows-develop", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "mingw-production", + "configurePreset" : "mingw-production", + "configuration" : "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name" : "mingw-develop", + "configurePreset" : "mingw-develop", + "configuration" : "RelWithDebInfo", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { "name" : "mac-production", "configurePreset" : "mac-production", "configuration" : "Release", diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 156b3a220..9ad0c48d2 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -8,7 +8,7 @@ vcpkg_from_github( HEAD_REF master ) -if (VCPKG_TARGET_IS_WINDOWS) +if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) vcpkg_list(SET EXTRA_INCLUDE_DIRS) list(APPEND EXTRA_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include") vcpkg_list(SET EXTRA_LIB_DIRS) @@ -38,6 +38,7 @@ else() # --extra-ldflags=-L${CURRENT_INSTALLED_DIR}/lib # ) elseif(VCPKG_TARGET_IS_LINUX) + elseif(VCPKG_TARGET_IS_MINGW) else() message(ERROR "Unknown target ${TARGET_TRIPLET}") endif() diff --git a/vcpkg-additions/ports/gpac/vcpkg.json b/vcpkg-additions/ports/gpac/vcpkg.json index 8b8940d26..2529c45b8 100644 --- a/vcpkg-additions/ports/gpac/vcpkg.json +++ b/vcpkg-additions/ports/gpac/vcpkg.json @@ -12,6 +12,10 @@ }, "ffmpeg", "libtheora", - "libvorbis" - ] + "libvorbis", + "sdl2", + "libjpeg-turbo", + "freetype", + "nghttp2" + ] } \ No newline at end of file From 77ca6482f632729c2ee153d8bdcf434af12ee4b8 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 6 Dec 2024 15:37:38 +0100 Subject: [PATCH 074/182] Disable ffmpeg for gpac. --- vcpkg-additions/ports/gpac/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index ec2720fc3..b522d098f 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -55,6 +55,7 @@ else() --disable-jack --disable-oss-audio --disable-pulseaudio + --use-ffmpeg=no --use-png=no --use-jpeg=no --disable-3d From 92523bfc5c73709e9ceb905805eb24cfec34fa53 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 6 Dec 2024 16:15:39 +0100 Subject: [PATCH 075/182] Various options have to be enabled again for the older gpac. --- vcpkg-additions/ports/gpac/portfile.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index b522d098f..0da40eb3e 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -48,8 +48,7 @@ else() DETERMINE_BUILD_TRIPLET NO_ADDITIONAL_PATHS OPTIONS - ${OPTIONS} - # --disable-player xxxjack this will disable the compositor, which will break the build. + --disable-player --disable-ssl --disable-alsa --disable-jack @@ -83,11 +82,11 @@ else() --disable-scene-dump --disable-scene-encode --disable-scene-stats - # --disable-scenegraph xxxjack this will disable the compositor, which will break the build. + --disable-scenegraph --disable-seng --disable-sman --disable-streaming - # --disable-svg xxxjack this will disable evg, which will disable the compositor, which will break the build. + --disable-svg --disable-swf --disable-vobsub --disable-vrml From 735768c0b5b73125b328172b4a8bc6384d57f079 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 2 Dec 2024 18:31:34 +0100 Subject: [PATCH 076/182] Hacks by Jack to try and get to compile with new gpac and ffmpeg --- src/lib_media/common/gpacpp.hpp | 2 +- src/lib_media/common/libav.cpp | 50 ++++++++++++++--------- src/lib_media/common/libav.hpp | 2 +- src/lib_media/decode/decoder.cpp | 3 +- src/lib_media/demux/libav_demux.cpp | 7 ++-- src/lib_media/encode/libav_encode.cpp | 4 +- src/lib_media/mux/libav_mux.cpp | 2 +- src/lib_media/transform/audio_convert.cpp | 14 ++++--- 8 files changed, 48 insertions(+), 36 deletions(-) diff --git a/src/lib_media/common/gpacpp.hpp b/src/lib_media/common/gpacpp.hpp index 24eff5ecc..ce5c5567f 100644 --- a/src/lib_media/common/gpacpp.hpp +++ b/src/lib_media/common/gpacpp.hpp @@ -21,7 +21,7 @@ extern "C" { #include #include #include -#include +//#include } //#define GPAC_MEM_TRACKER diff --git a/src/lib_media/common/libav.cpp b/src/lib_media/common/libav.cpp index bdb3d180c..5532289cd 100644 --- a/src/lib_media/common/libav.cpp +++ b/src/lib_media/common/libav.cpp @@ -9,6 +9,7 @@ extern "C" { #include +#include #include // av_get_pix_fmt_name } @@ -163,6 +164,7 @@ AudioSampleFormat getFormat(const AVCodecContext* codecCtx) { static AudioLayout getLayout(const AVCodecContext* codecCtx) { +#ifdef xxxjack_old_ffmpeg switch (codecCtx->channel_layout) { case AV_CH_LAYOUT_MONO: return Mono; case AV_CH_LAYOUT_STEREO: return Stereo; @@ -175,12 +177,21 @@ AudioLayout getLayout(const AVCodecContext* codecCtx) { default: throw std::runtime_error("Unknown libav audio layout"); } } +#else + // xxxjack Unsure whether this is correct. + switch(codecCtx->ch_layout.nb_channels) { + case 1: return Mono; + case 2: return Stereo; + case 6: return FivePointOne; + default: throw std::runtime_error("Unknown libav audio layout"); + } +#endif } Metadata createMetadataPktLibavAudio(AVCodecContext* codecCtx) { auto meta = make_shared(); initMetadatPkt(meta.get(), codecCtx); - meta->numChannels = codecCtx->channels; + meta->numChannels = codecCtx->ch_layout.nb_channels; meta->planar = meta->numChannels > 1 ? isPlanar(codecCtx) : true; meta->sampleRate = codecCtx->sample_rate; meta->bitsPerSample = av_get_bytes_per_sample(codecCtx->sample_fmt) * 8; @@ -197,16 +208,21 @@ Metadata createMetadataPktLibavSubtitle(AVCodecContext* codecCtx) { } //conversions -void libavAudioCtxConvertLibav(const Modules::PcmFormat *cfg, int &sampleRate, AVSampleFormat &format, int &numChannels, uint64_t &layout) { +void libavAudioCtxConvertLibav(const Modules::PcmFormat *cfg, int &sampleRate, AVSampleFormat &format, AVChannelLayout *layout) { sampleRate = cfg->sampleRate; switch (cfg->layout) { - case Modules::Mono: layout = AV_CH_LAYOUT_MONO; break; - case Modules::Stereo: layout = AV_CH_LAYOUT_STEREO; break; - case Modules::FivePointOne: layout = AV_CH_LAYOUT_5POINT1; break; + case Modules::Mono: + av_channel_layout_default(layout, 1); + break; + case Modules::Stereo: + av_channel_layout_default(layout, 2); + break; + case Modules::FivePointOne: + av_channel_layout_default(layout, 6); + break; default: throw std::runtime_error("Unknown libav audio layout"); } - numChannels = av_get_channel_layout_nb_channels(layout); assert(numChannels == cfg->numChannels); switch (cfg->sampleFormat) { @@ -217,13 +233,13 @@ void libavAudioCtxConvertLibav(const Modules::PcmFormat *cfg, int &sampleRate, A } void libavAudioCtxConvert(const PcmFormat *cfg, AVCodecContext *codecCtx) { - libavAudioCtxConvertLibav(cfg, codecCtx->sample_rate, codecCtx->sample_fmt, codecCtx->channels, codecCtx->channel_layout); + libavAudioCtxConvertLibav(cfg, codecCtx->sample_rate, codecCtx->sample_fmt, &codecCtx->ch_layout); } void libavFrame2pcmConvert(const AVFrame *frame, PcmFormat *cfg) { cfg->sampleRate = frame->sample_rate; - cfg->numChannels = cfg->numPlanes = frame->channels; + cfg->numChannels = cfg->numPlanes = frame->ch_layout.nb_channels; switch (frame->format) { case AV_SAMPLE_FMT_S16: cfg->sampleFormat = Modules::S16; @@ -243,24 +259,18 @@ void libavFrame2pcmConvert(const AVFrame *frame, PcmFormat *cfg) { throw std::runtime_error("Unknown libav audio format (3)"); } - switch (frame->channel_layout) { - case AV_CH_LAYOUT_MONO: cfg->layout = Modules::Mono; break; - case AV_CH_LAYOUT_STEREO: cfg->layout = Modules::Stereo; break; - case AV_CH_LAYOUT_5POINT1: cfg->layout = Modules::FivePointOne; break; - default: - switch (cfg->numChannels) { - case 1: cfg->layout = Modules::Mono; break; - case 2: cfg->layout = Modules::Stereo; break; - case 6: cfg->layout = Modules::FivePointOne; break; - default: throw std::runtime_error("Unknown libav audio layout"); - } + switch (frame->ch_layout.nb_channels) { + case 1: cfg->layout = Modules::Mono; break; + case 2: cfg->layout = Modules::Stereo; break; + case 6: cfg->layout = Modules::FivePointOne; break; + default: throw std::runtime_error("Unknown libav audio layout"); } } void libavFrameDataConvert(const DataPcm *pcmData, AVFrame *frame) { auto const& format = pcmData->format; AVSampleFormat avsf; - libavAudioCtxConvertLibav(&format, frame->sample_rate, avsf, frame->channels, frame->channel_layout); + libavAudioCtxConvertLibav(&format, frame->sample_rate, avsf, &frame->ch_layout); frame->format = (int)avsf; for (int i = 0; i < format.numPlanes; ++i) { frame->data[i] = pcmData->getPlane(i); diff --git a/src/lib_media/common/libav.hpp b/src/lib_media/common/libav.hpp index b0a06cc82..4c8ae89df 100644 --- a/src/lib_media/common/libav.hpp +++ b/src/lib_media/common/libav.hpp @@ -27,7 +27,7 @@ Metadata createMetadataPktLibavSubtitle(AVCodecContext* codecCtx); class PcmFormat; struct DataPcm; -void libavAudioCtxConvertLibav(const PcmFormat *cfg, int &sampleRate, enum AVSampleFormat &format, int &numChannels, uint64_t &layout); +void libavAudioCtxConvertLibav(const PcmFormat *cfg, int &sampleRate, enum AVSampleFormat &format, AVChannelLayout *layout); void libavAudioCtxConvert(const PcmFormat *cfg, AVCodecContext *codecCtx); void libavFrameDataConvert(const DataPcm *data, AVFrame *frame); void libavFrame2pcmConvert(const AVFrame *frame, PcmFormat *cfg); diff --git a/src/lib_media/decode/decoder.cpp b/src/lib_media/decode/decoder.cpp index 15c844bc2..0672a7779 100644 --- a/src/lib_media/decode/decoder.cpp +++ b/src/lib_media/decode/decoder.cpp @@ -140,7 +140,7 @@ struct Decoder : ModuleS, PictureAllocator { if (metadata->codec == "raw_audio") { auto const m = safe_cast(metadata); - codecCtx->channels = m->numChannels; + av_channel_layout_default(&codecCtx->ch_layout, m->numChannels); codecCtx->sample_fmt = AV_SAMPLE_FMT_S16; codecCtx->sample_rate = m->sampleRate; } @@ -152,7 +152,6 @@ struct Decoder : ModuleS, PictureAllocator { if (codecCtx->codec->type == AVMEDIA_TYPE_VIDEO) { if (codecCtx->codec->capabilities & AV_CODEC_CAP_DR1) { - codecCtx->thread_safe_callbacks = 0; codecCtx->opaque = static_cast(this); codecCtx->get_buffer2 = avGetBuffer2; diff --git a/src/lib_media/demux/libav_demux.cpp b/src/lib_media/demux/libav_demux.cpp index 8a4d4873f..6b1c0c572 100644 --- a/src/lib_media/demux/libav_demux.cpp +++ b/src/lib_media/demux/libav_demux.cpp @@ -86,7 +86,7 @@ struct LibavDemux : Module { m_formatCtx->flags |= AVFMT_FLAG_CUSTOM_IO; } - AVInputFormat* avInputFormat = nullptr; + const AVInputFormat* avInputFormat = nullptr; if(!config.formatName.empty()) { avInputFormat = av_find_input_format(config.formatName.c_str()); @@ -106,8 +106,6 @@ struct LibavDemux : Module { m_host->log(Info, format("Using input format '%s'", m_formatCtx->iformat->name).c_str()); } - m_formatCtx->flags |= AVFMT_FLAG_KEEP_SIDE_DATA; //deprecated >= 3.5 https://github.com/FFmpeg/FFmpeg/commit/ca2b779423 - if (config.seekTimeInMs) { if (avformat_seek_file(m_formatCtx, -1, INT64_MIN, rescale(config.seekTimeInMs, 1000, AV_TIME_BASE), INT64_MAX, 0) < 0) { clean(); @@ -132,6 +130,8 @@ struct LibavDemux : Module { for (unsigned i = 0; inb_streams; i++) { auto const st = m_formatCtx->streams[i]; auto const parser = av_stream_get_parser(st); +#ifdef xxxjack_removed + //xxxjack I don't know how to fix this code. if (parser) { st->codec->ticks_per_frame = parser->repeat_pict + 1; } else { @@ -180,6 +180,7 @@ struct LibavDemux : Module { m_streams[i].output = addOutput(); m_streams[i].output->setMetadata(m); av_dump_format(m_formatCtx, i, url.c_str(), 0); +#endif // xxxjack } } diff --git a/src/lib_media/encode/libav_encode.cpp b/src/lib_media/encode/libav_encode.cpp index 315cba238..7f73144fd 100644 --- a/src/lib_media/encode/libav_encode.cpp +++ b/src/lib_media/encode/libav_encode.cpp @@ -309,7 +309,7 @@ struct LibavEncode : ModuleS { Fraction framePeriod {}; std::function prepareFrame; std::string codecOptions, codecName; - AVCodec* m_codec = nullptr; + const AVCodec* m_codec = nullptr; bool m_isOpen = false; void openEncoder(Data data) { @@ -334,7 +334,7 @@ struct LibavEncode : ModuleS { const auto fmt = safe_cast(data)->format; libavAudioCtxConvert(&fmt, codecCtx.get()); codecCtx->sample_rate = fmt.sampleRate; - codecCtx->channels = fmt.numChannels; + av_channel_layout_default(&codecCtx->ch_layout, fmt.numChannels); m_pcmFormat = fmt; break; diff --git a/src/lib_media/mux/libav_mux.cpp b/src/lib_media/mux/libav_mux.cpp index 7161d1d80..134f985e8 100644 --- a/src/lib_media/mux/libav_mux.cpp +++ b/src/lib_media/mux/libav_mux.cpp @@ -185,7 +185,7 @@ class LibavMux : public ModuleDynI { } else if(auto info = dynamic_cast(metadata)) { codecpar->codec_type = AVMEDIA_TYPE_AUDIO; codecpar->sample_rate = info->sampleRate; - codecpar->channels = info->numChannels; + av_channel_layout_default(&codecpar->ch_layout, info->numChannels); codecpar->frame_size = info->frameSize; } else { // anything to do for subtitles? diff --git a/src/lib_media/transform/audio_convert.cpp b/src/lib_media/transform/audio_convert.cpp index b49484ac2..49bdf16f2 100644 --- a/src/lib_media/transform/audio_convert.cpp +++ b/src/lib_media/transform/audio_convert.cpp @@ -212,18 +212,20 @@ struct AudioConvert : ModuleS { AVSampleFormat avSrcFmt, avDstFmt; uint64_t avSrcChannelLayout, avDstChannelLayout; int avSrcNumChannels, avDstNumChannels, avSrcSampleRate, avDstSampleRate; - libavAudioCtxConvertLibav(&srcFormat, avSrcSampleRate, avSrcFmt, avSrcNumChannels, avSrcChannelLayout); - libavAudioCtxConvertLibav(&m_dstFormat, avDstSampleRate, avDstFmt, avDstNumChannels, avDstChannelLayout); + AVChannelLayout srcLayout; + AVChannelLayout dstLayout; + libavAudioCtxConvertLibav(&srcFormat, avSrcSampleRate, avSrcFmt, &srcLayout); + libavAudioCtxConvertLibav(&m_dstFormat, avDstSampleRate, avDstFmt, &dstLayout); - m_resampler->m_SwrContext = swr_alloc_set_opts(m_resampler->m_SwrContext, - avDstChannelLayout, + int sts = swr_alloc_set_opts2(&m_resampler->m_SwrContext, + &dstLayout, avDstFmt, avDstSampleRate, - avSrcChannelLayout, + &srcLayout, avSrcFmt, avSrcSampleRate, 0, nullptr); - if (!m_resampler->m_SwrContext) + if (!m_resampler->m_SwrContext || sts != 0) throw error("Impossible to set options to the audio resampler while configuring."); m_resampler->init(); From 233e8fed1bf4c5f281a963644ea8e5e3884a8f62 Mon Sep 17 00:00:00 2001 From: slarbi Date: Wed, 11 Dec 2024 09:48:01 +0100 Subject: [PATCH 077/182] revert gpachpp mpd include --- src/lib_media/common/gpacpp.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_media/common/gpacpp.hpp b/src/lib_media/common/gpacpp.hpp index ce5c5567f..24eff5ecc 100644 --- a/src/lib_media/common/gpacpp.hpp +++ b/src/lib_media/common/gpacpp.hpp @@ -21,7 +21,7 @@ extern "C" { #include #include #include -//#include +#include } //#define GPAC_MEM_TRACKER From 7dd9bd0cde6847c504d2c7af68eedbf349a816c5 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 11 Dec 2024 17:22:45 +0100 Subject: [PATCH 078/182] Patch gpac so that it installs config.h and gpac.pc --- .../ports/gpac/install-header-and-pc.patch | 20 +++++++++++++++++++ vcpkg-additions/ports/gpac/portfile.cmake | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 vcpkg-additions/ports/gpac/install-header-and-pc.patch diff --git a/vcpkg-additions/ports/gpac/install-header-and-pc.patch b/vcpkg-additions/ports/gpac/install-header-and-pc.patch new file mode 100644 index 000000000..94ff97ac0 --- /dev/null +++ b/vcpkg-additions/ports/gpac/install-header-and-pc.patch @@ -0,0 +1,20 @@ +diff --git a/Makefile b/Makefile +index 61241cd..84eb775 100644 +--- a/Makefile ++++ b/Makefile +@@ -110,6 +110,7 @@ dep: depend + install: + $(INSTALL) -d "$(DESTDIR)$(prefix)" + $(INSTALL) -d "$(DESTDIR)$(prefix)/$(libdir)" ++ $(INSTALL) -d "$(DESTDIR)$(prefix)/$(libdir)/pkgconfig" + $(INSTALL) -d "$(DESTDIR)$(prefix)/bin" + ifeq ($(DISABLE_ISOFF), no) + if [ -f bin/gcc/MP4Box$(EXE_SUFFIX) ] ; then \ +@@ -179,6 +180,7 @@ else + cp --no-preserve=mode,ownership,timestamp $(SRC_PATH)/shaders/* $(DESTDIR)$(prefix)/share/gpac/shaders/ + cp -R --no-preserve=mode,ownership,timestamp $(SRC_PATH)/include/* $(DESTDIR)$(prefix)/include/ + endif ++ $(INSTALL) $(INSTFLAGS) -m 644 config.h "$(DESTDIR)$(prefix)/include/gpac/configuration.h" + + lninstall: + $(INSTALL) -d "$(DESTDIR)$(prefix)" diff --git a/vcpkg-additions/ports/gpac/portfile.cmake b/vcpkg-additions/ports/gpac/portfile.cmake index 0da40eb3e..abe82afd0 100644 --- a/vcpkg-additions/ports/gpac/portfile.cmake +++ b/vcpkg-additions/ports/gpac/portfile.cmake @@ -6,6 +6,8 @@ vcpkg_from_github( REF c02c9a2fb0815bfd28b7c4c46630601ad7fe291d SHA512 e0ae99684e54f4862edf53238f3bd095f451cb689878c6f9fff0a2aff882fe2eed28a723ac7596a541ff509d96e64582431b9c145c278444e3e5f5caa1b4f612 HEAD_REF master + PATCHES + install-header-and-pc.patch ) if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) @@ -43,6 +45,7 @@ else() message(ERROR "Unknown target ${TARGET_TRIPLET}") endif() + vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" DETERMINE_BUILD_TRIPLET From fe17f7db9167236bf0163622004e69ce89051ce0 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Wed, 11 Dec 2024 23:26:10 +0100 Subject: [PATCH 079/182] Quick hack to ensure gpac IMPORTED_IMPLIB is defined on window/mingw. --- CMakeLists.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1fa26cf3..90aa1d65a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,13 +110,22 @@ find_package(libjpeg-turbo REQUIRED) find_package(FFmpeg REQUIRED COMPONENTS AVUTIL AVFILTER AVCODEC AVFORMAT AVDEVICE SWSCALE SWRESAMPLE) find_package(GPAC) if (NOT GPAC_FOUND) - # Find it using pkgconfig, for now + # Find it using pkgconfig, for now. + # This is a huge hack, especially the way we get the windows IMPORTED_LOCATION pkg_check_modules(GPAC REQUIRED gpac) add_library(gpac::gpac SHARED IMPORTED) - set_target_properties(gpac::gpac PROPERTIES - IMPORTED_LOCATION "${GPAC_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gpac${CMAKE_SHARED_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" - ) + if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + set_target_properties(gpac::gpac PROPERTIES + IMPORTED_IMPLIB "${GPAC_LIBDIR}/libgpac.dll.a" + IMPORTED_LOCATION "${GPAC_LIBDIR}/../bin/gpac.dll" + INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" + ) + else() + set_target_properties(gpac::gpac PROPERTIES + IMPORTED_LOCATION "${GPAC_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gpac${CMAKE_SHARED_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" + ) + endif() endif() From 11f1dd7fdc329e4d1b8785b0f92bd016fb612c04 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Thu, 12 Dec 2024 00:03:16 +0100 Subject: [PATCH 080/182] There's a dependency on libcurl, apparently. --- CMakeLists.txt | 13 +++++++++---- src/lib_media/CMakeLists.txt | 2 +- vcpkg-additions/ports/gpac/vcpkg.json | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90aa1d65a..282dc3657 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,10 +62,14 @@ file(MAKE_DIRECTORY ${BIN_DIR}) # Generate signals_version.h using version.sh set(SIGNALS_VERSION_HEADER "${BIN_DIR}/signals_version.h") -execute_process( - COMMAND "${SCRIPTS_DIR}/version.sh" - OUTPUT_FILE "${SIGNALS_VERSION_HEADER}" -) +file(WRITE "${SIGNALS_VERSION_HEADER}" "\"unknown-unknown-unknown\"") +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + execute_process( + COMMAND "${SCRIPTS_DIR}/version.sh" + OUTPUT_FILE "${SIGNALS_VERSION_HEADER}" + ) +endif() + #file(TOUCH ${SIGNALS_VERSION_HEADER}) #add_custom_command( # OUTPUT ${SIGNALS_VERSION_HEADER} @@ -107,6 +111,7 @@ endif() find_package(PkgConfig REQUIRED) find_package(SDL2 REQUIRED) find_package(libjpeg-turbo REQUIRED) +find_package(CURL REQUIRED) find_package(FFmpeg REQUIRED COMPONENTS AVUTIL AVFILTER AVCODEC AVFORMAT AVDEVICE SWSCALE SWRESAMPLE) find_package(GPAC) if (NOT GPAC_FOUND) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 62f68ec97..a24de91d8 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -34,7 +34,7 @@ target_include_directories(media PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ ) -target_link_libraries(media PRIVATE modules pipeline appcommon utils) +target_link_libraries(media PRIVATE modules pipeline appcommon utils CURL::libcurl) file(GLOB LIB_MODULES_SRCS diff --git a/vcpkg-additions/ports/gpac/vcpkg.json b/vcpkg-additions/ports/gpac/vcpkg.json index 2529c45b8..042945fac 100644 --- a/vcpkg-additions/ports/gpac/vcpkg.json +++ b/vcpkg-additions/ports/gpac/vcpkg.json @@ -16,6 +16,7 @@ "sdl2", "libjpeg-turbo", "freetype", - "nghttp2" + "nghttp2", + "curl" ] } \ No newline at end of file From 318b4f087859847218201378537c4169388f3a41 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 12 Dec 2024 10:51:33 +0100 Subject: [PATCH 081/182] Added presets for intelmac. Unfortunately has to be done this way, because I don't know how to change the triplet to add -dynamic. --- CMakePresets.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index 83f5c1f14..51f71d83f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -80,6 +80,21 @@ "rhs": "Darwin" } }, + { + "name" : "intelmac", + "description" : "Build for MacOS", + "generator" : "Unix Makefiles", + "inherits" : "vcpkg", + "hidden" : true, + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-osx-dynamic" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, { "name" : "linux", "description" : "Build for Linux", @@ -142,6 +157,21 @@ "cacheVariables" : { "CMAKE_BUILD_TYPE" : "RelWithDebInfo" } + },{ + "name" : "intelmac-production", + "description" : "Build for production on Mac", + "inherits" : "intelmac", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "Release" + } + }, + { + "name" : "intelmac-develop", + "description" : "Build for development on Mac", + "inherits" : "intelmac", + "cacheVariables" : { + "CMAKE_BUILD_TYPE" : "RelWithDebInfo" + } }, { "name" : "linux-production", From c1f40d3b01ee3efd3d7e546f42d1a94a9c8c54ad Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 12 Dec 2024 17:06:34 +0100 Subject: [PATCH 082/182] getting started with installing --- CMakePresets.json | 5 +- src/lib_media/CMakeLists.txt | 84 ++++++++++++++++++++++++++++++++-- src/lib_signals/CMakeLists.txt | 24 ++++++++++ 3 files changed, 109 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 51f71d83f..e8122fbb7 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -38,11 +38,11 @@ "description" : "Build for Windows", "generator" : "Visual Studio 17 2022", "inherits" : "vcpkg", + "installDir": "${sourceDir}/../installed", "hidden" : true, "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-windows" }, - "installDir": "${sourceDir}/../installed", "condition": { "type": "equals", "lhs": "${hostSystemName}", @@ -71,6 +71,7 @@ "generator" : "Unix Makefiles", "inherits" : "vcpkg", "hidden" : true, + "installDir": "${sourceDir}/../installed", "cacheVariables": { "VCPKG_TARGET_TRIPLET": "arm64-osx-dynamic" }, @@ -86,6 +87,7 @@ "generator" : "Unix Makefiles", "inherits" : "vcpkg", "hidden" : true, + "installDir": "${sourceDir}/../installed", "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-osx-dynamic" }, @@ -101,6 +103,7 @@ "generator" : "Unix Makefiles", "inherits" : "vcpkg", "hidden" : true, + "installDir": "${sourceDir}/../installed", "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-linux-dynamic" }, diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index a24de91d8..f144638ce 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -78,6 +78,11 @@ set_target_properties(AVCC2AnnexBConverter PROPERTIES ) +install(TARGETS AVCC2AnnexBConverter + EXPORT AVCC2AnnexBConverter + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + # Define source files for the LibavMuxHLSTS set(EXE_LIBAVMUXHLSTS_SRCS @@ -118,6 +123,10 @@ set_target_properties(LibavMuxHLSTS PROPERTIES PREFIX "" ) +install(TARGETS LibavMuxHLSTS + EXPORT LibavMuxHLSTS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # Define source files for the VideoConvert target set(EXE_VIDEOCONVERTER_SRCS @@ -154,6 +163,10 @@ set_target_properties(VideoConvert PROPERTIES PREFIX "" # ) +install(TARGETS VideoConvert + EXPORT VideoConvert + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # AudioConvert target set(EXE_AUDIOCONVERTER_SRCS @@ -184,6 +197,10 @@ set_target_properties(AudioConvert PROPERTIES PREFIX "" ) +install(TARGETS AudioConvert + EXPORT AudioConvert + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # JPEGTurboDecode target set(EXE_JPEGTURBODECODE_SRCS @@ -212,7 +229,10 @@ set_target_properties(JPEGTurboDecode PROPERTIES PREFIX "" ) - +install(TARGETS JPEGTurboDecode + EXPORT JPEGTurboDecode + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # JPEGTurboEncode target set(EXE_JPEGTURBOENCODE_SRCS @@ -239,6 +259,12 @@ set_target_properties(JPEGTurboEncode PROPERTIES ) +install(TARGETS JPEGTurboEncode + EXPORT JPEGTurboEncode + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + + # Encoder target set(EXE_ENCODER_SRCS @@ -272,7 +298,10 @@ set_target_properties(Encoder PROPERTIES PREFIX "" ) - +install(TARGETS Encoder + EXPORT Encoder + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # Decoder target set(EXE_DECODER_SRCS @@ -304,6 +333,10 @@ set_target_properties(Decoder PROPERTIES PREFIX "" ) +install(TARGETS Decoder + EXPORT Decoder + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # LibavDemux target set(EXE_LIBAVDEMUX_SRCS @@ -337,6 +370,10 @@ set_target_properties(LibavDemux PREFIX "" ) +install(TARGETS LibavDemux + EXPORT LibavDemux + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # LibavMux target set(EXE_LIBAVMUX_SRCS @@ -368,6 +405,12 @@ set_target_properties(LibavMux PROPERTIES PREFIX "" ) + +install(TARGETS LibavMux + EXPORT LibavMux + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + # LibavFilter target set(EXE_LIBAVFILTER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/transform/libavfilter.cpp @@ -398,7 +441,10 @@ set_target_properties(LibavFilter PROPERTIES PREFIX "" ) - +install(TARGETS LibavFilter + EXPORT LibavFilter + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # GPACMuxMP4 target set(EXE_GPACMUXMP4_SRCS @@ -429,6 +475,10 @@ set_target_properties(GPACMuxMP4 PROPERTIES PREFIX "" ) +install(TARGETS GPACMuxMP4 + EXPORT GPACMuxMP4 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) # GPACMuxMP4MSS target set(EXE_GPACMUXMP4MSS_SRCS @@ -458,6 +508,12 @@ set_target_properties(GPACMuxMP4MSS PROPERTIES PREFIX "" ) +install(TARGETS GPACMuxMP4MSS + EXPORT GPACMuxMP4MSS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + + # GPACDemuxMP4Simple target set(EXE_GPACDEMUXMP4SIMPLE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_simple.cpp @@ -485,6 +541,12 @@ set_target_properties(GPACDemuxMP4Simple PROPERTIES PREFIX "" ) + +install(TARGETS GPACDemuxMP4Simple + EXPORT GPACDemuxMP4Simple + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + # GPACDemuxMP4Full target set(EXE_GPACDEMUXMP4FULL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_full.cpp @@ -513,6 +575,11 @@ set_target_properties(GPACDemuxMP4Full PROPERTIES PREFIX "" ) +install(TARGETS GPACDemuxMP4Full + EXPORT GPACDemuxMP4Full + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + # FileSystemSink target set(EXE_FILESYSTEMSINK_SRCS @@ -540,6 +607,11 @@ set_target_properties(FileSystemSink PROPERTIES PREFIX "" ) +install(TARGETS FileSystemSink + EXPORT FileSystemSink + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + # LogoOverlay target set(EXE_LOGOOVERLAY_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/transform/logo_overlay.cpp @@ -559,6 +631,7 @@ target_link_libraries(LogoOverlay appcommon utils ) + set_target_properties(LogoOverlay PROPERTIES OUTPUT_NAME "LogoOverlay" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin @@ -566,3 +639,8 @@ set_target_properties(LogoOverlay PROPERTIES PREFIX "" ) + +install(TARGETS LogoOverlay + EXPORT LogoOverlay + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt index 48330ac90..3de987631 100644 --- a/src/lib_signals/CMakeLists.txt +++ b/src/lib_signals/CMakeLists.txt @@ -19,6 +19,30 @@ target_link_libraries(lib_signals utils ) +install(TARGETS lib_signals + EXPORT lib_signals + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/signals +) + +#install(DIRECTORY ${PROJECT_SOURCE_DIR} +# DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +#) + +# xxxjack install(FILES ${PROJECT_SOURCE_DIR}/CMakeFiles/cwipc_util-config.cmake DESTINATION lib/cmake/cwipc_util) + +# xxxjack install(EXPORT cwipc_util DESTINATION lib/cmake/cwipc_util) + +if(WIN32) + # Copy the dependent DLLs that cmake/vcpkg have created + # install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR}) + # Copy the PDB file, if it exists + # install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) +endif() + + # Add unit tests From 765d0fbf7fc7cf085abddd0bc9c1d0771113c54b Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 17 Dec 2024 18:08:39 +0100 Subject: [PATCH 083/182] Adding install targets to all static libraries (so we can later build bin2dash and sub against the installed signals). Give each library a name that starts with signals_ (so we don't conflict with other libraries, hopefully). We still don't install header files (don't know why). The config.h in the bin directory also still needs to be tackled. --- src/lib_appcommon/CMakeLists.txt | 19 +++++++++++++++++-- src/lib_media/CMakeLists.txt | 26 +++++++++++++++++++++++++- src/lib_modules/CMakeLists.txt | 22 +++++++++++++++++----- src/lib_pipeline/CMakeLists.txt | 20 +++++++++++++++++++- src/lib_utils/CMakeLists.txt | 19 +++++++++++++++---- 5 files changed, 93 insertions(+), 13 deletions(-) diff --git a/src/lib_appcommon/CMakeLists.txt b/src/lib_appcommon/CMakeLists.txt index 2b7aa99e2..d45c297f8 100644 --- a/src/lib_appcommon/CMakeLists.txt +++ b/src/lib_appcommon/CMakeLists.txt @@ -7,11 +7,26 @@ set(LIB_APPCOMMON_SRCS add_library(appcommon STATIC ${LIB_APPCOMMON_SRCS}) + +set_target_properties(appcommon PROPERTIES + OUTPUT_NAME signals_appcommon + POSITION_INDEPENDENT_CODE TRUE + ) + target_include_directories(appcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) -target_link_libraries(appcommon PRIVATE utils) +target_link_libraries(appcommon PUBLIC utils) target_compile_options(appcommon PRIVATE - -Wall -Wextra -Werror -fPIC + -Wall -Wextra -Werror +) + + +# Installation (optional) to be tested later +install(TARGETS appcommon + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/signals ) \ No newline at end of file diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index f144638ce..0844e47c0 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -30,13 +30,37 @@ set(LIB_MEDIA_SRCS # Define the media library add_library(media STATIC ${LIB_MEDIA_SRCS}) + +set_target_properties(media PROPERTIES + OUTPUT_NAME signals_media + POSITION_INDEPENDENT_CODE TRUE + ) + target_include_directories(media PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ ) -target_link_libraries(media PRIVATE modules pipeline appcommon utils CURL::libcurl) +# Installation (optional) to be tested later +install(TARGETS media + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/signals +) + +# xxxjack Not sure this is correct... +target_link_libraries(media + PUBLIC + modules + pipeline + appcommon + utils + CURL::libcurl + ) + +# xxxjack I think this should go... Won't we link to some objects twice? file(GLOB LIB_MODULES_SRCS ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index f74988ae9..772a935f4 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -8,6 +8,11 @@ add_library(modules SHARED ${CMAKE_CURRENT_SOURCE_DIR}/utils/loader.cpp ) +set_target_properties(modules PROPERTIES + OUTPUT_NAME signals_modules + POSITION_INDEPENDENT_CODE TRUE + ) + # Add include directories target_include_directories(modules PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} @@ -17,9 +22,11 @@ target_include_directories(modules PUBLIC ) +# xxxjack should use POSITION_INDEPENDENT_CODE? See https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE + # Add compile flags target_compile_options(modules PUBLIC - -Wall -Wextra -Werror -fPIC + -Wall -Wextra -Werror ) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") @@ -44,10 +51,15 @@ endif() target_link_libraries(modules PUBLIC utils) # Set output directory -set_target_properties(modules PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin -) +#set_target_properties(modules PROPERTIES +# LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +#) # Installation (optional) to be tested later -install(TARGETS modules DESTINATION lib) +install(TARGETS modules + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/signals +) \ No newline at end of file diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index 35ae786a4..40b3a1581 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -7,6 +7,11 @@ set(LIB_PIPELINE_SRCS add_library(pipeline STATIC ${LIB_PIPELINE_SRCS}) +set_target_properties(pipeline PROPERTIES + OUTPUT_NAME signals_pipeline + POSITION_INDEPENDENT_CODE TRUE + ) + # Add include directories target_include_directories(pipeline PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} @@ -14,4 +19,17 @@ target_include_directories(pipeline PUBLIC ) # Link libraries -target_link_libraries(pipeline PRIVATE appcommon utils) +target_link_libraries(pipeline + PUBLIC + appcommon + utils + ) + + +# Installation (optional) to be tested later +install(TARGETS pipeline + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/signals +) \ No newline at end of file diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 6093cd289..b9100700f 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -25,13 +25,19 @@ else() message(ERROR "Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") endif() -include_directories(${BIN_DIR} -${CMAKE_SOURCE_DIR}/src +include_directories( + ${BIN_DIR} + ${CMAKE_SOURCE_DIR}/src ) list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) add_library(utils STATIC ${LIB_UTILS_SRCS}) +set_target_properties(utils PROPERTIES + OUTPUT_NAME signals_utils + POSITION_INDEPENDENT_CODE TRUE + ) + # Platform-specific adjustments if(APPLE) # On macOS, we need to include the os_darwin.cpp file @@ -55,5 +61,10 @@ target_include_directories(utils PUBLIC ${BIN_DIR} ) -# Add -fPIC (required for shared libraries) -target_compile_options(utils PRIVATE -fPIC) \ No newline at end of file +# Installation (optional) to be tested later +install(TARGETS utils + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/signals +) From 603f2c55bb30b8ced5908463636450d29f5a89fe Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 11:46:48 +0100 Subject: [PATCH 084/182] Playing with PUBLIC and PRIVATE --- src/lib_media/CMakeLists.txt | 18 +++++++++--------- src/lib_pipeline/CMakeLists.txt | 4 ++-- src/lib_utils/CMakeLists.txt | 15 +++++++++------ 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 0844e47c0..91d8dcb88 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -50,15 +50,15 @@ install(TARGETS media PUBLIC_HEADER DESTINATION include/signals ) -# xxxjack Not sure this is correct... -target_link_libraries(media - PUBLIC - modules - pipeline - appcommon - utils - CURL::libcurl - ) +## xxxjack Not sure this is correct... +#target_link_libraries(media +# PUBLIC +# modules +# pipeline +# appcommon +# utils +# CURL::libcurl +# ) # xxxjack I think this should go... Won't we link to some objects twice? file(GLOB LIB_MODULES_SRCS diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index 40b3a1581..401419859 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -18,9 +18,9 @@ target_include_directories(pipeline PUBLIC ${CMAKE_SOURCE_DIR}/src ) -# Link libraries +## Link libraries target_link_libraries(pipeline - PUBLIC + PRIVATE appcommon utils ) diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index b9100700f..adfbc3319 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -1,18 +1,20 @@ # List of source files for the utils library -set(LIB_UTILS_SRCS +set(LIB_UTILS_INCS clock.hpp fifo.hpp - log.cpp log.hpp os.hpp - profiler.cpp profiler.hpp - scheduler.cpp scheduler.hpp - time.cpp time.hpp - version.cpp system_clock.hpp +) +set(LIB_UTILS_SRCS + log.cpp + profiler.cpp + scheduler.cpp + time.cpp + version.cpp sysclock.cpp ) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") @@ -32,6 +34,7 @@ include_directories( list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) add_library(utils STATIC ${LIB_UTILS_SRCS}) +target_sources(utils PUBLIC ${LIB_UTILS_INCS}) set_target_properties(utils PROPERTIES OUTPUT_NAME signals_utils From 81b6474174462a074060ceb1cf26b450575c039e Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 12:06:23 +0100 Subject: [PATCH 085/182] Don't use BIN_DIR to state where version header is, use SIGNALS_VERSION_HEADER_DIR (even though they're the same for now). --- CMakeLists.txt | 8 ++++---- src/lib_media/CMakeLists.txt | 8 ++++---- src/lib_utils/CMakeLists.txt | 9 +++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 282dc3657..707a08888 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,11 +57,11 @@ endif() set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") set(SRC_DIR "${CMAKE_SOURCE_DIR}/src") set(BIN_DIR "${CMAKE_BINARY_DIR}/bin") - -file(MAKE_DIRECTORY ${BIN_DIR}) +set(SIGNALS_VERSION_HEADER_DIR "${BIN_DIR}") # xxxjack not very elegant... +file(MAKE_DIRECTORY ${SIGNALS_VERSION_HEADER_DIR}) # Generate signals_version.h using version.sh -set(SIGNALS_VERSION_HEADER "${BIN_DIR}/signals_version.h") +set(SIGNALS_VERSION_HEADER "${SIGNALS_VERSION_HEADER_DIR}/signals_version.h") file(WRITE "${SIGNALS_VERSION_HEADER}" "\"unknown-unknown-unknown\"") if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") execute_process( @@ -87,7 +87,7 @@ endif() # Ensure the generated signals_version.h is available globally # Include directories for global availability -include_directories(${BIN_DIR}) +# xxxjack include_directories(${SIGNALS_VERSION_HEADER_DIR}) # make the version header available as part of a global variable # to be accessible in other sub-projects or libraries diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 91d8dcb88..234a6678f 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -36,12 +36,12 @@ set_target_properties(media PROPERTIES POSITION_INDEPENDENT_CODE TRUE ) -target_include_directories(media PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../ +target_include_directories(media PUBLIC + $ + $ + $ ) - # Installation (optional) to be tested later install(TARGETS media RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index adfbc3319..80bc4ac21 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -28,7 +28,7 @@ else() endif() include_directories( - ${BIN_DIR} + ${SIGNALS_VERSION_HEADER_DIR} ${CMAKE_SOURCE_DIR}/src ) list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) @@ -59,9 +59,10 @@ set(BIN_DIR ${CMAKE_BINARY_DIR}/bin) # Specify include directories for the utils target target_include_directories(utils PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/lib_utils - ${BIN_DIR} + $ + $ + $ + $ ) # Installation (optional) to be tested later From e7a22084f2e8fbfe8dbea44eb32e77776af21ba0 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 12:18:58 +0100 Subject: [PATCH 086/182] Move signals_version.h to directory build/version --- CMakeLists.txt | 2 +- src/lib_utils/CMakeLists.txt | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 707a08888..afdfd20dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ endif() set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") set(SRC_DIR "${CMAKE_SOURCE_DIR}/src") set(BIN_DIR "${CMAKE_BINARY_DIR}/bin") -set(SIGNALS_VERSION_HEADER_DIR "${BIN_DIR}") # xxxjack not very elegant... +set(SIGNALS_VERSION_HEADER_DIR "${CMAKE_BINARY_DIR}/version") # xxxjack not very elegant... file(MAKE_DIRECTORY ${SIGNALS_VERSION_HEADER_DIR}) # Generate signals_version.h using version.sh diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 80bc4ac21..14c84a3d9 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -27,10 +27,11 @@ else() message(ERROR "Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") endif() -include_directories( - ${SIGNALS_VERSION_HEADER_DIR} - ${CMAKE_SOURCE_DIR}/src -) +# xxxjack +#include_directories( +# ${SIGNALS_VERSION_HEADER_DIR} +# ${CMAKE_SOURCE_DIR}/src +#) list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) add_library(utils STATIC ${LIB_UTILS_SRCS}) From e2be20ac28e1058eeeebc63c7864c1afa595901f Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 12:43:04 +0100 Subject: [PATCH 087/182] Removed dead wood. --- CMakeLists.txt | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afdfd20dd..21cb512bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,29 +70,6 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ) endif() -#file(TOUCH ${SIGNALS_VERSION_HEADER}) -#add_custom_command( -# OUTPUT ${SIGNALS_VERSION_HEADER} -# COMMAND ${CMAKE_COMMAND} -E echo "Working directory: ${CMAKE_BINARY_DIR}" -# COMMAND ${SCRIPTS_DIR}/version.sh -# COMMAND ${CMAKE_COMMAND} -E echo "Version script executed" -# COMMAND ${SCRIPTS_DIR}/version.sh > ${SIGNALS_VERSION_HEADER} -# DEPENDS ${SCRIPTS_DIR}/version.sh -# COMMENT "Generating signals_version.h" -#) -# Add a custom target to trigger the custom command -#add_custom_target(generate_signals_version_header ALL DEPENDS ${SIGNALS_VERSION_HEADER}) - - -# Ensure the generated signals_version.h is available globally - -# Include directories for global availability -# xxxjack include_directories(${SIGNALS_VERSION_HEADER_DIR}) - -# make the version header available as part of a global variable -# to be accessible in other sub-projects or libraries -set(GENERATED_SIGNALS_VERSION_HEADER ${SIGNALS_VERSION_HEADER}) - message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") From 1832f4764802d0df3ec5c4a4561535273c34ae8f Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 12:43:21 +0100 Subject: [PATCH 088/182] Install lib_utils include files. --- src/lib_utils/CMakeLists.txt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 14c84a3d9..4bd589e09 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -27,13 +27,6 @@ else() message(ERROR "Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") endif() -# xxxjack -#include_directories( -# ${SIGNALS_VERSION_HEADER_DIR} -# ${CMAKE_SOURCE_DIR}/src -#) -list(APPEND LIB_UTILS_SRCS ${GENERATED_SIGNALS_VERSION_HEADER}) - add_library(utils STATIC ${LIB_UTILS_SRCS}) target_sources(utils PUBLIC ${LIB_UTILS_INCS}) @@ -73,3 +66,7 @@ install(TARGETS utils ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals ) + +install(FILES ${LIB_UTILS_INCS} + DESTINATION include/signals/lib_utils +) From 151f7549abf145b711b29c1aba1da249542d4d55 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 13:06:17 +0100 Subject: [PATCH 089/182] Install all include files, and keep the directory structure as it is (because this is what most source code seems to expect). --- src/lib_appcommon/CMakeLists.txt | 14 ++++++++++---- src/lib_media/CMakeLists.txt | 5 +++++ src/lib_modules/CMakeLists.txt | 7 ++++++- src/lib_pipeline/CMakeLists.txt | 15 ++++++++++++++- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/lib_appcommon/CMakeLists.txt b/src/lib_appcommon/CMakeLists.txt index d45c297f8..6742dcb01 100644 --- a/src/lib_appcommon/CMakeLists.txt +++ b/src/lib_appcommon/CMakeLists.txt @@ -1,11 +1,13 @@ +set(LIB_APPCOMMON_INCS + options.hpp + timebomb.hpp +) set(LIB_APPCOMMON_SRCS options.cpp safemain.cpp timebomb.cpp ) - - add_library(appcommon STATIC ${LIB_APPCOMMON_SRCS}) set_target_properties(appcommon PROPERTIES @@ -16,17 +18,21 @@ set_target_properties(appcommon PROPERTIES target_include_directories(appcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) + target_link_libraries(appcommon PUBLIC utils) target_compile_options(appcommon PRIVATE -Wall -Wextra -Werror ) - # Installation (optional) to be tested later install(TARGETS appcommon RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals -) \ No newline at end of file +) + +install(FILES ${LIB_APPCOMMON_INCS} + DESTINATION include/signals/lib_appcommon +) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 234a6678f..8beb88315 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -50,6 +50,11 @@ install(TARGETS media PUBLIC_HEADER DESTINATION include/signals ) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DESTINATION include/signals/ + FILES_MATCHING + PATTERN "*.hpp" +) ## xxxjack Not sure this is correct... #target_link_libraries(media # PUBLIC diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 772a935f4..c3f3c6aa4 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -62,4 +62,9 @@ install(TARGETS modules ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals ) - \ No newline at end of file + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DESTINATION include/signals/ + FILES_MATCHING + PATTERN "*.hpp" +) diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index 401419859..d2d4b9b76 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -1,3 +1,11 @@ +set(LIB_PIPELINE_INCS + filter_input.hpp + filter.hpp + pipeline.hpp + graph.hpp + stats.hpp +) + set(LIB_PIPELINE_SRCS filter.cpp filter.hpp @@ -32,4 +40,9 @@ install(TARGETS pipeline LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals -) \ No newline at end of file +) + + +install(FILES ${LIB_PIPELINE_INCS} + DESTINATION include/signals/lib_pipeline +) From 72ff1b514c175416c4e2054a1385a7b031eac2e7 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 13:09:37 +0100 Subject: [PATCH 090/182] Install signals_version.h --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21cb512bb..e9dc39d17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,7 +72,8 @@ endif() message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") - +# Install version header +install(FILES ${SIGNALS_VERSION_HEADER} DESTINATION include/signals) # Ensure SYSROOT_PATH is valid if(NOT SYSROOT_PATH) elseif(NOT EXISTS ${SYSROOT_PATH}) From a7c5cbdc483af184ca96a832078504dd34125430 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Wed, 18 Dec 2024 13:35:34 +0100 Subject: [PATCH 091/182] Make throw_dynamic_cast_error an inline function. Fixes multiple-defined link error on mingw. --- src/lib_media/CMakeLists.txt | 17 ++++++++--------- src/lib_modules/core/database.hpp | 3 +-- src/lib_utils/log.cpp | 4 ---- src/lib_utils/tools.hpp | 5 ++++- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 8beb88315..58d6ce011 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -55,15 +55,14 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} FILES_MATCHING PATTERN "*.hpp" ) -## xxxjack Not sure this is correct... -#target_link_libraries(media -# PUBLIC -# modules -# pipeline -# appcommon -# utils -# CURL::libcurl -# ) +target_link_libraries(media + PUBLIC + modules + pipeline + appcommon + utils + CURL::libcurl + ) # xxxjack I think this should go... Won't we link to some objects twice? file(GLOB LIB_MODULES_SRCS diff --git a/src/lib_modules/core/database.hpp b/src/lib_modules/core/database.hpp index a415acc8b..7cd31d37c 100644 --- a/src/lib_modules/core/database.hpp +++ b/src/lib_modules/core/database.hpp @@ -6,6 +6,7 @@ #include #include "lib_utils/small_map.hpp" #include "lib_utils/clock.hpp" +#include "lib_utils/tools.hpp" namespace Modules { @@ -86,8 +87,6 @@ inline bool isDeclaration(Data data) { } -[[noreturn]] void throw_dynamic_cast_error(const char* typeName); - template std::shared_ptr safe_cast(std::shared_ptr p) { if (!p) diff --git a/src/lib_utils/log.cpp b/src/lib_utils/log.cpp index 552f872c6..478f36482 100644 --- a/src/lib_utils/log.cpp +++ b/src/lib_utils/log.cpp @@ -176,7 +176,3 @@ void setGlobalLogColor(bool enable) { consoleLogger.setColor(enable); } -void throw_dynamic_cast_error(const char* typeName) { - throw std::runtime_error("dynamic cast error: could not convert from Modules::Data to " + std::string(typeName)); -} - diff --git a/src/lib_utils/tools.hpp b/src/lib_utils/tools.hpp index cb2344f72..04f0ea12d 100644 --- a/src/lib_utils/tools.hpp +++ b/src/lib_utils/tools.hpp @@ -12,7 +12,10 @@ std::unique_ptr uptr(T *p) { return std::unique_ptr(p); } -[[noreturn]] void throw_dynamic_cast_error(const char* typeName); +[[noreturn]] inline void throw_dynamic_cast_error(const char* typeName) { + throw std::runtime_error("dynamic cast error: could not convert from Modules::Data to " + std::string(typeName)); +} + template std::shared_ptr safe_cast(std::shared_ptr p) { From 18db48685ad4de2db89b277a2c93b1a117a044e8 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Wed, 18 Dec 2024 14:18:23 +0100 Subject: [PATCH 092/182] Added a LINK_LIBRARY:WHOLE_ARCHIE generator around utils, which should have solved the double defines by including all of the utils static library into the dynamic library. Unfortunately it doesn't, at least not for mingw. --- src/lib_modules/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index c3f3c6aa4..852e94178 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -48,7 +48,11 @@ endif() # Add linker flags # Link dependencies if any -target_link_libraries(modules PUBLIC utils) +target_link_libraries(modules + PUBLIC + "$" + utils + ) # Set output directory #set_target_properties(modules PROPERTIES From a465318779b3bb80261f68b7925c93428cb2e25d Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 15:41:30 +0100 Subject: [PATCH 093/182] Added missing include --- src/lib_utils/tools.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib_utils/tools.hpp b/src/lib_utils/tools.hpp index 04f0ea12d..51f61de0c 100644 --- a/src/lib_utils/tools.hpp +++ b/src/lib_utils/tools.hpp @@ -3,6 +3,7 @@ #include #include #include //runtime_error +#include using std::make_unique; using std::make_shared; From 42c29d7de0e9b02893ead561220b241fc69627ab Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 16:00:47 +0100 Subject: [PATCH 094/182] utils library exports its cmake definition file and installs it. --- src/lib_utils/CMakeLists.txt | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 4bd589e09..14e8c3e8b 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -27,8 +27,15 @@ else() message(ERROR "Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") endif() -add_library(utils STATIC ${LIB_UTILS_SRCS}) -target_sources(utils PUBLIC ${LIB_UTILS_INCS}) +add_library(utils STATIC) +target_sources(utils PRIVATE + ${LIB_UTILS_SRCS} + ${LIB_UTILS_INCS} + ) +target_sources(utils INTERFACE + $ + $> + ) set_target_properties(utils PROPERTIES OUTPUT_NAME signals_utils @@ -49,8 +56,6 @@ elseif(WIN32) list(APPEND LIB_UTILS_SRCS os_mingw.cpp) endif() -set(BIN_DIR ${CMAKE_BINARY_DIR}/bin) - # Specify include directories for the utils target target_include_directories(utils PUBLIC $ @@ -61,12 +66,23 @@ target_include_directories(utils PUBLIC # Installation (optional) to be tested later install(TARGETS utils + EXPORT signals-utils RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals ) +export( + EXPORT signals-utils + NAMESPACE signals:: +) + +install(EXPORT signals-utils + NAMESPACE signals:: + DESTINATION lib/cmake/signals +) + install(FILES ${LIB_UTILS_INCS} DESTINATION include/signals/lib_utils ) From 2299d4e16c9acfe4c3ab363971616b17e040b831 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 16:05:21 +0100 Subject: [PATCH 095/182] appcommon library exports its cmake definition file and installs it. --- src/lib_appcommon/CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib_appcommon/CMakeLists.txt b/src/lib_appcommon/CMakeLists.txt index 6742dcb01..2a63a8bb9 100644 --- a/src/lib_appcommon/CMakeLists.txt +++ b/src/lib_appcommon/CMakeLists.txt @@ -16,7 +16,8 @@ set_target_properties(appcommon PROPERTIES ) target_include_directories(appcommon PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} + $ + $ ) target_link_libraries(appcommon PUBLIC utils) @@ -27,12 +28,23 @@ target_compile_options(appcommon PRIVATE # Installation (optional) to be tested later install(TARGETS appcommon + EXPORT signals-appcommon RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals ) +export( + EXPORT signals-appcommon + NAMESPACE signals:: +) + +install(EXPORT signals-appcommon + NAMESPACE signals:: + DESTINATION lib/cmake/signals +) + install(FILES ${LIB_APPCOMMON_INCS} DESTINATION include/signals/lib_appcommon ) From cf9cb5d66d1a767315abc8339cb58cf3e1d0e393 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 16:14:38 +0100 Subject: [PATCH 096/182] All librararies export and install their cmake definition files. --- src/lib_media/CMakeLists.txt | 12 ++++++++++++ src/lib_modules/CMakeLists.txt | 24 ++++++++++++++++++------ src/lib_pipeline/CMakeLists.txt | 17 ++++++++++++++--- 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 58d6ce011..52657b62c 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -44,12 +44,24 @@ target_include_directories(media PUBLIC # Installation (optional) to be tested later install(TARGETS media + EXPORT signals-media RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals ) + +export( + EXPORT signals-media + NAMESPACE signals:: +) + +install(EXPORT signals-media + NAMESPACE signals:: + DESTINATION lib/cmake/signals +) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include/signals/ FILES_MATCHING diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 852e94178..9086d20f8 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -15,11 +15,11 @@ set_target_properties(modules PROPERTIES # Add include directories target_include_directories(modules PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/src/lib_modules/utils - ${CMAKE_SOURCE_DIR}/src/lib_modules/core - + $ + $ + $ + $ + $ ) # xxxjack should use POSITION_INDEPENDENT_CODE? See https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE @@ -60,13 +60,25 @@ target_link_libraries(modules #) # Installation (optional) to be tested later -install(TARGETS modules +install(TARGETS modules + EXPORT signals-modules RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals ) + +export( + EXPORT signals-modules + NAMESPACE signals:: +) + +install(EXPORT signals-modules + NAMESPACE signals:: + DESTINATION lib/cmake/signals +) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include/signals/ FILES_MATCHING diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index d2d4b9b76..a6d6ca6c2 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -22,8 +22,9 @@ set_target_properties(pipeline PROPERTIES # Add include directories target_include_directories(pipeline PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src + $ + $ + $ ) ## Link libraries @@ -35,13 +36,23 @@ target_link_libraries(pipeline # Installation (optional) to be tested later -install(TARGETS pipeline +install(TARGETS pipeline + EXPORT signals-pipeline RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include/signals ) +export( + EXPORT signals-pipeline + NAMESPACE signals:: +) + +install(EXPORT signals-pipeline + NAMESPACE signals:: + DESTINATION lib/cmake/signals +) install(FILES ${LIB_PIPELINE_INCS} DESTINATION include/signals/lib_pipeline From 0099d4bc0381bca5d5fa88f3f9bb96c98353dfb5 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 17:21:51 +0100 Subject: [PATCH 097/182] Partial cherry-pick of f9fe4e2a: only the things having to do with generating the signalsConfig file (cherry picked from commit 1221378d3734522846c16d822a294d9cd916c36f) --- CMakeLists.txt | 29 +++++++++++++++++++++++++++ SignalsConfig.cmake.in | 12 +++++++++++ src/CMakeLists.txt | 15 +++++++------- vcpkg-additions/ports/gpac/vcpkg.json | 5 ++++- 4 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 SignalsConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e9dc39d17..d4730d095 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,3 +136,32 @@ add_custom_target(build_all unittests COMMENT "Building all targets." ) + +# Install CMake config files for find_package +include(CMakePackageConfigHelpers) + +# Configure the package version +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) + +# Install configuration +install(EXPORT SignalsTargets + FILE SignalsTargets.cmake + NAMESPACE Signals:: + DESTINATION lib/cmake/Signals +) + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/SignalsConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfig.cmake" + INSTALL_DESTINATION lib/cmake/Signals +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfigVersion.cmake" + DESTINATION lib/cmake/Signals +) diff --git a/SignalsConfig.cmake.in b/SignalsConfig.cmake.in new file mode 100644 index 000000000..88a4f6e8c --- /dev/null +++ b/SignalsConfig.cmake.in @@ -0,0 +1,12 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/SignalsTargets.cmake") + +set(Signals_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") +set(Signals_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib") +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/SignalsTargets.cmake") + +set(Signals_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") +set(Signals_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 388aa8ea6..1cfc62314 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,13 +34,14 @@ foreach(plugin ${PLUGIN_TARGETS}) group_target(${plugin} "Plugins") endforeach() -# Group applications -group_target(dashcastx "Applications") -#group_target(ts2ip "Applications") -#group_target(player "Applications") -#group_target(mcastdump "Applications") -#group_target(mp42tsx "Applications") -#group_target(monitor "Applications") # Group tests group_target(unit_tests "Tests") + + +# Export all library targets +install(EXPORT SignalsTargets + FILE SignalsTargets.cmake + NAMESPACE Signals:: + DESTINATION lib/cmake/Signals +) diff --git a/vcpkg-additions/ports/gpac/vcpkg.json b/vcpkg-additions/ports/gpac/vcpkg.json index 042945fac..4ab9e4d33 100644 --- a/vcpkg-additions/ports/gpac/vcpkg.json +++ b/vcpkg-additions/ports/gpac/vcpkg.json @@ -10,7 +10,10 @@ "name": "vcpkg-cmake-config", "host": true }, - "ffmpeg", + { + "name": "ffmpeg", + "features": ["x264"] + }, "libtheora", "libvorbis", "sdl2", From 73fe23e0adc52909c7ed66774046f4715e7f476d Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 17:45:26 +0100 Subject: [PATCH 098/182] Rename Signals to signals, moved config.cmake.in. (cherry picked from commit 64be54fa04206397f858dd6f88d760c145e99497) --- CMakeFiles/signals-config.cmake.in | 11 +++++++++++ CMakeLists.txt | 24 ++++++++++++------------ SignalsConfig.cmake.in | 12 ------------ 3 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 CMakeFiles/signals-config.cmake.in delete mode 100644 SignalsConfig.cmake.in diff --git a/CMakeFiles/signals-config.cmake.in b/CMakeFiles/signals-config.cmake.in new file mode 100644 index 000000000..53a511a05 --- /dev/null +++ b/CMakeFiles/signals-config.cmake.in @@ -0,0 +1,11 @@ +@PACKAGE_INIT@ +set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@") + +include("${CMAKE_CURRENT_LIST_DIR}/signals-appcommon.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/signals-media.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/signals-modules.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/signals-pipeline.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/signals-utils.cmake") + +set_and_check(signals_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@") +set(signals_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib") diff --git a/CMakeLists.txt b/CMakeLists.txt index d4730d095..cbdc1d04a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,26 +142,26 @@ include(CMakePackageConfigHelpers) # Configure the package version write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/signals-config-version.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) # Install configuration -install(EXPORT SignalsTargets - FILE SignalsTargets.cmake - NAMESPACE Signals:: - DESTINATION lib/cmake/Signals -) +#install(EXPORT SignalsTargets +# FILE SignalsTargets.cmake +# NAMESPACE Signals:: +# DESTINATION lib/cmake/Signals +#) configure_package_config_file( - "${CMAKE_CURRENT_SOURCE_DIR}/SignalsConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfig.cmake" - INSTALL_DESTINATION lib/cmake/Signals + "${CMAKE_CURRENT_SOURCE_DIR}/CMakeFiles/signals-config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/signals-config.cmake" + INSTALL_DESTINATION lib/cmake/signals ) install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/SignalsConfigVersion.cmake" - DESTINATION lib/cmake/Signals + "${CMAKE_CURRENT_BINARY_DIR}/signals-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/signals-config-version.cmake" + DESTINATION lib/cmake/signals ) diff --git a/SignalsConfig.cmake.in b/SignalsConfig.cmake.in deleted file mode 100644 index 88a4f6e8c..000000000 --- a/SignalsConfig.cmake.in +++ /dev/null @@ -1,12 +0,0 @@ -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/SignalsTargets.cmake") - -set(Signals_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") -set(Signals_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib") -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/SignalsTargets.cmake") - -set(Signals_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") -set(Signals_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib") From acfb6a64e1bf1428c1dcf6ef2f9bf609a9919918 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 17:53:39 +0100 Subject: [PATCH 099/182] Don't export SignalsTargets: each target exports itself (for example as signals-common) to be picked up by the toplevel signals-config.cmake file. (cherry picked from commit 6328252ff72e6a417a95565f3c2ac820fda08d0e) --- src/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1cfc62314..3a136909b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,9 +39,9 @@ endforeach() group_target(unit_tests "Tests") -# Export all library targets -install(EXPORT SignalsTargets - FILE SignalsTargets.cmake - NAMESPACE Signals:: - DESTINATION lib/cmake/Signals -) +## Export all library targets +#install(EXPORT SignalsTargets +# FILE SignalsTargets.cmake +# NAMESPACE Signals:: +# DESTINATION lib/cmake/Signals +#) From 28e827dc62a6d54d44f3cf0e1fd7fdd617e259c7 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 23:26:55 +0100 Subject: [PATCH 100/182] I had messed up the prefix path. Fixed. --- CMakeFiles/signals-config.cmake.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeFiles/signals-config.cmake.in b/CMakeFiles/signals-config.cmake.in index 53a511a05..29c572568 100644 --- a/CMakeFiles/signals-config.cmake.in +++ b/CMakeFiles/signals-config.cmake.in @@ -7,5 +7,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/signals-modules.cmake") include("${CMAKE_CURRENT_LIST_DIR}/signals-pipeline.cmake") include("${CMAKE_CURRENT_LIST_DIR}/signals-utils.cmake") -set_and_check(signals_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@") -set(signals_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib") +set_and_check(signals_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include") +set(signals_LIBRARIES "${PACKAGE_PREFIX_DIR}/lib") From e93125c310c7127032aa1622d282d169a6ea28a9 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Dec 2024 23:37:22 +0100 Subject: [PATCH 101/182] Duh, the order of includes is important, because each of the signals-xxxx.cmake checks that its required signals::yyyy targets exist. Fixed. --- CMakeFiles/signals-config.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeFiles/signals-config.cmake.in b/CMakeFiles/signals-config.cmake.in index 29c572568..63293cc4e 100644 --- a/CMakeFiles/signals-config.cmake.in +++ b/CMakeFiles/signals-config.cmake.in @@ -1,11 +1,11 @@ @PACKAGE_INIT@ set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@") +include("${CMAKE_CURRENT_LIST_DIR}/signals-utils.cmake") include("${CMAKE_CURRENT_LIST_DIR}/signals-appcommon.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/signals-media.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/signals-modules.cmake") include("${CMAKE_CURRENT_LIST_DIR}/signals-pipeline.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/signals-utils.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/signals-modules.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/signals-media.cmake") set_and_check(signals_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include") set(signals_LIBRARIES "${PACKAGE_PREFIX_DIR}/lib") From 8a53315ac5177bb7872c977c092b8c24e1fb2c1c Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 19 Dec 2024 00:15:21 +0100 Subject: [PATCH 102/182] Added gpac::gpac dependency. But this apparently isn't enough. --- src/lib_media/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 52657b62c..018d3bcb4 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -72,7 +72,8 @@ target_link_libraries(media modules pipeline appcommon - utils + utils + gpac::gpac CURL::libcurl ) From b62e470e24d152c7492bbdbc14e8f95de264fe63 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 19 Dec 2024 22:49:21 +0100 Subject: [PATCH 103/182] Use TARGET_RUNTIME_DLLS generator expression to copy dependency DLLs to the install folder. Or at least try to:-) --- src/lib_media/CMakeLists.txt | 90 +++++++++++++++++++++++++++++++++- src/lib_modules/CMakeLists.txt | 6 +++ 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 018d3bcb4..f8dd4d45f 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -51,6 +51,12 @@ install(TARGETS media PUBLIC_HEADER DESTINATION include/signals ) +# Hmm. libmedia is a static library, so it can't be used for TARGET_RUNTIME_DLLs. +# Let's hope the smd's below will pick up the needed dependencies. +#add_custom_command(TARGET media POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) export( EXPORT signals-media @@ -124,6 +130,11 @@ install(TARGETS AVCC2AnnexBConverter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET AVCC2AnnexBConverter POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # Define source files for the LibavMuxHLSTS set(EXE_LIBAVMUXHLSTS_SRCS @@ -169,6 +180,11 @@ install(TARGETS LibavMuxHLSTS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET LibavMuxHLSTS POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # Define source files for the VideoConvert target set(EXE_VIDEOCONVERTER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/transform/video_convert.cpp @@ -209,6 +225,11 @@ install(TARGETS VideoConvert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET VideoConvert POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # AudioConvert target set(EXE_AUDIOCONVERTER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/transform/audio_convert.cpp @@ -243,6 +264,11 @@ install(TARGETS AudioConvert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET AudioConvert POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # JPEGTurboDecode target set(EXE_JPEGTURBODECODE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/decode/jpegturbo_decode.cpp @@ -275,6 +301,11 @@ install(TARGETS JPEGTurboDecode RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET JPEGTurboDecode POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # JPEGTurboEncode target set(EXE_JPEGTURBOENCODE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/encode/jpegturbo_encode.cpp @@ -305,7 +336,10 @@ install(TARGETS JPEGTurboEncode RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) - +add_custom_command(TARGET JPEGTurboEncode POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) # Encoder target set(EXE_ENCODER_SRCS @@ -344,6 +378,11 @@ install(TARGETS Encoder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET Encoder POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # Decoder target set(EXE_DECODER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/decode/decoder.cpp @@ -379,6 +418,11 @@ install(TARGETS Decoder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET Decoder POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # LibavDemux target set(EXE_LIBAVDEMUX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common/libav_init.cpp @@ -416,6 +460,11 @@ install(TARGETS LibavDemux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET LibavDemux POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # LibavMux target set(EXE_LIBAVMUX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/mux/libav_mux.cpp @@ -452,6 +501,11 @@ install(TARGETS LibavMux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET LibavMux POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # LibavFilter target set(EXE_LIBAVFILTER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/transform/libavfilter.cpp @@ -487,6 +541,11 @@ install(TARGETS LibavFilter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET LibavFilter POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # GPACMuxMP4 target set(EXE_GPACMUXMP4_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4.cpp @@ -521,6 +580,11 @@ install(TARGETS GPACMuxMP4 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET GPACMuxMP4 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # GPACMuxMP4MSS target set(EXE_GPACMUXMP4MSS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/mux/gpac_mux_mp4_mss.cpp @@ -554,6 +618,11 @@ install(TARGETS GPACMuxMP4MSS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET GPACMuxMP4MSS POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # GPACDemuxMP4Simple target set(EXE_GPACDEMUXMP4SIMPLE_SRCS @@ -588,6 +657,11 @@ install(TARGETS GPACDemuxMP4Simple RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET GPACDemuxMP4Simple POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # GPACDemuxMP4Full target set(EXE_GPACDEMUXMP4FULL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/demux/gpac_demux_mp4_full.cpp @@ -621,6 +695,10 @@ install(TARGETS GPACDemuxMP4Full RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET GPACDemuxMP4Full POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) # FileSystemSink target set(EXE_FILESYSTEMSINK_SRCS @@ -653,6 +731,11 @@ install(TARGETS FileSystemSink RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +add_custom_command(TARGET FileSystemSink POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # LogoOverlay target set(EXE_LOGOOVERLAY_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/transform/logo_overlay.cpp @@ -685,3 +768,8 @@ install(TARGETS LogoOverlay EXPORT LogoOverlay RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + +add_custom_command(TARGET LogoOverlay POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) \ No newline at end of file diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 9086d20f8..14aae24f5 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -68,6 +68,12 @@ install(TARGETS modules PUBLIC_HEADER DESTINATION include/signals ) +add_custom_command(TARGET modules POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + + export( EXPORT signals-modules From 164a52599ebd8fca6fd59da6126d1012b18d7805 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 19 Dec 2024 23:08:15 +0100 Subject: [PATCH 104/182] The plugins weren't installed. Fixed. --- src/plugins/Dasher/CMakeLists.txt | 10 ++++++++++ src/plugins/Fmp4Splitter/CMakeLists.txt | 10 ++++++++++ src/plugins/HlsDemuxer/CMakeLists.txt | 10 ++++++++++ src/plugins/MulticastInput/CMakeLists.txt | 10 ++++++++++ src/plugins/SdlRender/CMakeLists.txt | 20 ++++++++++++++++++++ src/plugins/Telx2Ttml/CMakeLists.txt | 10 ++++++++++ src/plugins/TsDemuxer/CMakeLists.txt | 10 ++++++++++ src/plugins/TsMuxer/CMakeLists.txt | 10 ++++++++++ src/plugins/UdpOutput/CMakeLists.txt | 10 ++++++++++ 9 files changed, 100 insertions(+) diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index 0c66b0d69..30ca8048e 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -35,3 +35,13 @@ set_target_properties(MPEG_DASH PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS MPEG_DASH + EXPORT MPEG_DASH + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET MPEG_DASH POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index 6e51ffca8..91e7ea14c 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -21,3 +21,13 @@ set_target_properties(FMP4SPLITTER PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS FMP4SPLITTER + EXPORT FMP4SPLITTER + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET FMP4SPLITTER POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index 5509ff379..bfbc0c23a 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -34,3 +34,13 @@ set_target_properties(HlsDemuxer PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS HlsDemuxer + EXPORT HlsDemuxer + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET HlsDemuxer POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index b1ec7f521..574657351 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -42,3 +42,13 @@ set_target_properties(MulticastInput PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS MulticastInput + EXPORT MulticastInput + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET MulticastInput POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt index efda182bd..7b51f8cf8 100644 --- a/src/plugins/SdlRender/CMakeLists.txt +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -30,6 +30,16 @@ set_target_properties(SDLVideo PROPERTIES PREFIX "" # ) +install(TARGETS SDLVideo + EXPORT SDLVideo + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET SDLVideo POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) + # Define the SDLAudio plugin set(SDLAudio_src ${CMAKE_CURRENT_SOURCE_DIR}/sdl_audio.cpp @@ -59,3 +69,13 @@ set_target_properties(SDLAudio PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS SDLAudio + EXPORT SDLAudio + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET SDLAudio POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index c2130e0b1..3f7350840 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -25,3 +25,13 @@ set_target_properties(TeletextToTTML PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS TeletextToTTML + EXPORT TeletextToTTML + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET TeletextToTTML POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index eb053d111..0bbbb8c59 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -21,3 +21,13 @@ set_target_properties(TsDemuxer PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS TsDemuxer + EXPORT TsDemuxer + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET TsDemuxer POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt index 91fa0aa02..ac0a72e65 100644 --- a/src/plugins/TsMuxer/CMakeLists.txt +++ b/src/plugins/TsMuxer/CMakeLists.txt @@ -23,3 +23,13 @@ set_target_properties(TsMuxer PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS TsMuxer + EXPORT TsMuxer + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET TsMuxer POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index dc267cdff..5212c4a2e 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -42,3 +42,13 @@ set_target_properties(UdpOutput PROPERTIES SUFFIX ".smd" # Set the custom file extension to .smd PREFIX "" # ) + +install(TARGETS UdpOutput + EXPORT UdpOutput + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET UdpOutput POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) \ No newline at end of file From b0e743f639accaf6b88fa6fe652d0a3c0b69b2b8 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 19 Dec 2024 23:30:33 +0100 Subject: [PATCH 105/182] Upped cmake to 3.28 to see if this fixes the WHOLE_ARCHIVE problem. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbdc1d04a..f4f5df6e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22) +cmake_minimum_required(VERSION 3.28) project(Signals VERSION 1.0) # Add extension directories (for things like Find) From 1bb53d704c47f633a0ec35b12bc3eadd1ab88d76 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Dec 2024 00:12:06 +0100 Subject: [PATCH 106/182] Added include files that need to be installed. --- src/lib_utils/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 14e8c3e8b..4b3667456 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -2,11 +2,14 @@ set(LIB_UTILS_INCS clock.hpp fifo.hpp + fraction.hpp log.hpp os.hpp profiler.hpp scheduler.hpp time.hpp + tools.hpp + small_map.hpp system_clock.hpp ) set(LIB_UTILS_SRCS From 54a006bc2e2b85bde7e42a489fb6761646bdea3b Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 20 Dec 2024 12:23:16 +0100 Subject: [PATCH 107/182] Import location fixed for mingw --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbdc1d04a..aa7aee553 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,9 +98,10 @@ if (NOT GPAC_FOUND) pkg_check_modules(GPAC REQUIRED gpac) add_library(gpac::gpac SHARED IMPORTED) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + # xxxjack this is valid for mingw. set_target_properties(gpac::gpac PROPERTIES IMPORTED_IMPLIB "${GPAC_LIBDIR}/libgpac.dll.a" - IMPORTED_LOCATION "${GPAC_LIBDIR}/../bin/gpac.dll" + IMPORTED_LOCATION "${GPAC_LIBDIR}/../bin/libgpac.dll" INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" ) else() From 05753f772f80a939f99a0548142aee81d8683329 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 20 Dec 2024 12:31:05 +0100 Subject: [PATCH 108/182] Turning the utils library into a shared library, see if that fixes the multiple-defined symbol issue (and still works). Mat actually be better, because it also means there's no chance of multiple instances of the log, etc. --- src/lib_utils/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 4b3667456..cc1bffb29 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -30,7 +30,7 @@ else() message(ERROR "Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") endif() -add_library(utils STATIC) +add_library(utils SHARED) target_sources(utils PRIVATE ${LIB_UTILS_SRCS} ${LIB_UTILS_INCS} From 0e6e25c587ec0de087324c2d914e77261f472ea5 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Dec 2024 12:50:09 +0100 Subject: [PATCH 109/182] lib_signals include files need to be installed. --- src/lib_signals/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt index 3de987631..f2b0f643e 100644 --- a/src/lib_signals/CMakeLists.txt +++ b/src/lib_signals/CMakeLists.txt @@ -1,3 +1,9 @@ +set(LIB_SIGNALS_INCS + executor_threadpool.hpp + executor.hpp + signal.hpp + signals.hpp +) # Add the library target add_library(lib_signals INTERFACE) @@ -27,6 +33,11 @@ install(TARGETS lib_signals PUBLIC_HEADER DESTINATION include/signals ) + +install(FILES ${LIB_SIGNALS_INCS} + DESTINATION include/signals/lib_signals +) + #install(DIRECTORY ${PROJECT_SOURCE_DIR} # DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} #) From c966cb3c52c421e72fb103a08912de14ac755ecf Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Dec 2024 12:50:25 +0100 Subject: [PATCH 110/182] Refer to libcurl the correct way. --- src/plugins/HlsDemuxer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index bfbc0c23a..fb3413a45 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -24,7 +24,7 @@ target_include_directories(HlsDemuxer PRIVATE # Link the necessary libraries target_link_libraries(HlsDemuxer PRIVATE - media modules pipeline appcommon utils curl + media modules pipeline appcommon utils CURL::libcurl ) # Set properties for the target From 3f874b21c20ff79c508551f8f064942d35b10ae4 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Dec 2024 13:03:54 +0100 Subject: [PATCH 111/182] gpac and curl are only required when building (I hope) not when using an installed library. --- src/lib_media/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index f8dd4d45f..321e36c93 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -79,8 +79,8 @@ target_link_libraries(media pipeline appcommon utils - gpac::gpac - CURL::libcurl + $ + $ ) # xxxjack I think this should go... Won't we link to some objects twice? From 4bc3344d0d71846a2e68916b7e1125201bb63c62 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 20 Dec 2024 13:20:58 +0100 Subject: [PATCH 112/182] Added missing include for cstdint --- src/plugins/Dasher/mpd.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/Dasher/mpd.hpp b/src/plugins/Dasher/mpd.hpp index 062be38b3..80a4c8c87 100644 --- a/src/plugins/Dasher/mpd.hpp +++ b/src/plugins/Dasher/mpd.hpp @@ -1,6 +1,7 @@ #pragma once #include #include +#include struct MPD { struct Representation { From c624d4d9aac7dc92bcbdedd1ad5fde381c4191ae Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 20 Dec 2024 13:21:34 +0100 Subject: [PATCH 113/182] On windows we need to ad the ws2_32 socket library. --- src/plugins/MulticastInput/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index 574657351..c809b775e 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -29,6 +29,10 @@ target_link_libraries(MulticastInput modules ) +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + target_link_libraries(MulticastInput ws2_32) +endif() + # Include directories target_include_directories(MulticastInput PUBLIC ${CMAKE_SOURCE_DIR}/src From d407905cdfa3d2895091b5bfd11e516822800fbb Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 20 Dec 2024 13:22:14 +0100 Subject: [PATCH 114/182] On windows we need to add the ws2_32 socket library --- src/plugins/UdpOutput/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index 5212c4a2e..fae9cf8a0 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -29,6 +29,10 @@ target_link_libraries(UdpOutput modules ) +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + target_link_libraries(UdpOutput ws2_32) +endif() + # Include directories target_include_directories(UdpOutput PUBLIC ${CMAKE_SOURCE_DIR}/src From 75bf28707c24d619945291f65c8a35a94c200b1c Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Fri, 20 Dec 2024 14:28:59 +0100 Subject: [PATCH 115/182] Use CURL::libcurl --- src/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 7990c9dd6..edb8ca382 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -38,7 +38,7 @@ target_link_libraries(unittests modules pipeline utils - curl + CURL::libcurl ${FFMPEG_LIBRARIES} ) From 8cd1a9e05afaad452537c53bfcdbb5dffbe7183e Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Dec 2024 17:16:10 +0100 Subject: [PATCH 116/182] Added variable SIGNALS_TOP_SOURCE_DIR so we can build both in isolation and under the lldash umbrella. --- CMakeLists.txt | 45 +++++++++++++---------- src/lib_modules/CMakeLists.txt | 6 +-- src/lib_pipeline/CMakeLists.txt | 2 +- src/lib_signals/CMakeLists.txt | 10 ++--- src/plugins/Dasher/CMakeLists.txt | 8 ++-- src/plugins/Fmp4Splitter/CMakeLists.txt | 2 +- src/plugins/HlsDemuxer/CMakeLists.txt | 8 ++-- src/plugins/MulticastInput/CMakeLists.txt | 2 +- src/plugins/SdlRender/CMakeLists.txt | 4 +- src/plugins/Telx2Ttml/CMakeLists.txt | 2 +- src/plugins/TsDemuxer/CMakeLists.txt | 2 +- src/plugins/TsMuxer/CMakeLists.txt | 2 +- src/plugins/UdpOutput/CMakeLists.txt | 2 +- src/tests/CMakeLists.txt | 12 +++--- 14 files changed, 56 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5f20d582..c6e6e1622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.28) project(Signals VERSION 1.0) +# Set toplevel signals directory here, so the CMakefiles work both standalone and under the lldash umbrella +set(SIGNALS_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + # Add extension directories (for things like Find) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/CMakeFiles @@ -55,7 +58,7 @@ endif() # Define paths for source and scripts set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") -set(SRC_DIR "${CMAKE_SOURCE_DIR}/src") +set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") set(BIN_DIR "${CMAKE_BINARY_DIR}/bin") set(SIGNALS_VERSION_HEADER_DIR "${CMAKE_BINARY_DIR}/version") # xxxjack not very elegant... file(MAKE_DIRECTORY ${SIGNALS_VERSION_HEADER_DIR}) @@ -91,28 +94,30 @@ find_package(SDL2 REQUIRED) find_package(libjpeg-turbo REQUIRED) find_package(CURL REQUIRED) find_package(FFmpeg REQUIRED COMPONENTS AVUTIL AVFILTER AVCODEC AVFORMAT AVDEVICE SWSCALE SWRESAMPLE) -find_package(GPAC) -if (NOT GPAC_FOUND) - # Find it using pkgconfig, for now. - # This is a huge hack, especially the way we get the windows IMPORTED_LOCATION - pkg_check_modules(GPAC REQUIRED gpac) - add_library(gpac::gpac SHARED IMPORTED) - if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - # xxxjack this is valid for mingw. - set_target_properties(gpac::gpac PROPERTIES - IMPORTED_IMPLIB "${GPAC_LIBDIR}/libgpac.dll.a" - IMPORTED_LOCATION "${GPAC_LIBDIR}/../bin/libgpac.dll" - INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" - ) - else() - set_target_properties(gpac::gpac PROPERTIES - IMPORTED_LOCATION "${GPAC_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gpac${CMAKE_SHARED_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" - ) +if (NOT TARGET gpac::gpac) + find_package(GPAC QUIET) + if (NOT GPAC_FOUND) + # Find it using pkgconfig, for now. + # This is a huge hack, especially the way we get the windows IMPORTED_LOCATION + pkg_check_modules(GPAC REQUIRED gpac) + add_library(gpac::gpac SHARED IMPORTED) + if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + # xxxjack this is valid for mingw. + set_target_properties(gpac::gpac PROPERTIES + IMPORTED_IMPLIB "${GPAC_LIBDIR}/libgpac.dll.a" + IMPORTED_LOCATION "${GPAC_LIBDIR}/../bin/libgpac.dll" + INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" + ) + else() + set_target_properties(gpac::gpac PROPERTIES + IMPORTED_LOCATION "${GPAC_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gpac${CMAKE_SHARED_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${GPAC_INCLUDEDIR}" + ) + endif() + set(GPAC_FOUND TRUE) endif() endif() - set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 14aae24f5..b7fd22dc9 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -16,9 +16,9 @@ set_target_properties(modules PROPERTIES # Add include directories target_include_directories(modules PUBLIC $ - $ - $ - $ + $ + $ + $ $ ) diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index a6d6ca6c2..6fcd3fe49 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -23,7 +23,7 @@ set_target_properties(pipeline PROPERTIES # Add include directories target_include_directories(pipeline PUBLIC $ - $ + $ $ ) diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt index f2b0f643e..ed3f5c609 100644 --- a/src/lib_signals/CMakeLists.txt +++ b/src/lib_signals/CMakeLists.txt @@ -10,8 +10,8 @@ add_library(lib_signals INTERFACE) # Specify include directories for the library target_include_directories(lib_signals INTERFACE - ${CMAKE_SOURCE_DIR}/src/tests - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src/tests + ${SIGNALS_TOP_SOURCE_DIR}/src ) @@ -60,7 +60,7 @@ endif() if(BUILD_TESTING) file(GLOB UNIT_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/unittests/*.cpp - ${CMAKE_SOURCE_DIR}/src/tests/tests.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/tests/tests.cpp ) add_executable(lib_signals_unittests @@ -68,8 +68,8 @@ if(BUILD_TESTING) ${CMAKE_CURRENT_SOURCE_DIR}/../lib_appcommon/options.cpp ) target_include_directories(lib_signals_unittests PRIVATE - ${CMAKE_SOURCE_DIR}/src/lib_appcommon - ${CMAKE_SOURCE_DIR}/src/tests + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_appcommon + ${SIGNALS_TOP_SOURCE_DIR}/src/tests ) diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index 30ca8048e..6953d4139 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -1,12 +1,12 @@ # Define source files for the MPEG_DASH target set(EXE_MPEG_DASH_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_media/common/xml.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_media/common/xml.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mpeg_dash.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mpd.cpp ) file(GLOB LIB_MODULES_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp - ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_modules/core/*.cpp ) @@ -20,7 +20,7 @@ add_library(MPEG_DASH SHARED ${EXE_MPEG_DASH_SRCS}) # Include directories for the module target_include_directories(MPEG_DASH PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/ + ${SIGNALS_TOP_SOURCE_DIR}/src/ ) # Link the necessary libraries diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index 91e7ea14c..1d71ef024 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -11,7 +11,7 @@ target_link_libraries(FMP4SPLITTER # Include directories target_include_directories(FMP4SPLITTER PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ) # Set properties for the target diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index fb3413a45..7cba86db3 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -1,11 +1,11 @@ # Define source files for the HlsDemuxer target set(EXE_HlsDemuxer_SRCS hls_demux.cpp - ${CMAKE_SOURCE_DIR}/src/lib_media/common/http_puller.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_media/common/http_puller.cpp ) file(GLOB LIB_MODULES_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp - ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_modules/core/*.cpp ) @@ -19,7 +19,7 @@ add_library(HlsDemuxer SHARED ${EXE_HlsDemuxer_SRCS}) # Include directories for the module target_include_directories(HlsDemuxer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/ + ${SIGNALS_TOP_SOURCE_DIR}/src/ ) # Link the necessary libraries diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index c809b775e..d29b774eb 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -35,7 +35,7 @@ endif() # Include directories target_include_directories(MulticastInput PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt index 7b51f8cf8..1db6d0d81 100644 --- a/src/plugins/SdlRender/CMakeLists.txt +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -18,7 +18,7 @@ target_link_libraries(SDLVideo # Include directories target_include_directories(SDLVideo PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ${SDL2_INCLUDE_DIRS} ) @@ -57,7 +57,7 @@ target_link_libraries(SDLAudio # Include directories for SDLAudio target_include_directories(SDLAudio PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/plugins/SdlRender ${SDL2_INCLUDE_DIRS} ) diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index 3f7350840..b7bb07a1c 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -14,7 +14,7 @@ target_link_libraries(TeletextToTTML # Include directories target_include_directories(TeletextToTTML PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ${FFMPEG_INCLUDE_DIRS} ) diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index 0bbbb8c59..915de98c1 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -11,7 +11,7 @@ target_link_libraries(TsDemuxer # Include directories target_include_directories(TsDemuxer PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ) # Set properties for the target diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt index ac0a72e65..a5bcb87c8 100644 --- a/src/plugins/TsMuxer/CMakeLists.txt +++ b/src/plugins/TsMuxer/CMakeLists.txt @@ -13,7 +13,7 @@ target_link_libraries(TsMuxer # Include directories target_include_directories(TsMuxer PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ) # Set properties for the target diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index fae9cf8a0..add6f2ae8 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -35,7 +35,7 @@ endif() # Include directories target_include_directories(UdpOutput PUBLIC - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index edb8ca382..563d65d58 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -3,13 +3,13 @@ set(TESTSDIR ${CMAKE_CURRENT_SOURCE_DIR}) set(OUTDIR ${CMAKE_BINARY_DIR}/bin) file(GLOB LIB_MODULES_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp - ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_modules/utils/*.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_modules/core/*.cpp ) file(GLOB LIB_MEDIA_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_media/*.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_media/*.cpp ) @@ -17,7 +17,7 @@ file(GLOB LIB_MEDIA_SRCS # Define the source files for the unit tests set(EXE_TESTS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/tests.cpp - ${CMAKE_SOURCE_DIR}/src/lib_appcommon/options.cpp + ${SIGNALS_TOP_SOURCE_DIR}/src/lib_appcommon/options.cpp ${LIB_MEDIA_SRCS} ${LIB_MODULES_SRCS} ${LIB_PIPELINE_SRCS} @@ -25,7 +25,7 @@ set(EXE_TESTS_SRCS ) # Add any additional source files from the 'unittests' directories -file(GLOB_RECURSE UNITTEST_SOURCES "${CMAKE_SOURCE_DIR}/src/*/unittests/*.cpp") +file(GLOB_RECURSE UNITTEST_SOURCES "${SIGNALS_TOP_SOURCE_DIR}/src/*/unittests/*.cpp") list(APPEND EXE_TESTS_SRCS ${UNITTEST_SOURCES}) # Define the unit tests executable target @@ -44,7 +44,7 @@ target_link_libraries(unittests # Include directories for unit tests target_include_directories(unittests PRIVATE - ${CMAKE_SOURCE_DIR}/src + ${SIGNALS_TOP_SOURCE_DIR}/src ${FFMPEG_INCLUDE_DIRS} ) From 9bbaee2ddae799f92db462b6f5e892b566963837 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Dec 2024 17:20:34 +0100 Subject: [PATCH 117/182] Adding alias targets signals::xxxx for each xxxx so the umbrella build can find them. --- src/lib_appcommon/CMakeLists.txt | 1 + src/lib_media/CMakeLists.txt | 2 ++ src/lib_modules/CMakeLists.txt | 1 + src/lib_pipeline/CMakeLists.txt | 1 + src/lib_signals/CMakeLists.txt | 1 + src/lib_utils/CMakeLists.txt | 2 ++ 6 files changed, 8 insertions(+) diff --git a/src/lib_appcommon/CMakeLists.txt b/src/lib_appcommon/CMakeLists.txt index 2a63a8bb9..319e2338f 100644 --- a/src/lib_appcommon/CMakeLists.txt +++ b/src/lib_appcommon/CMakeLists.txt @@ -9,6 +9,7 @@ set(LIB_APPCOMMON_SRCS ) add_library(appcommon STATIC ${LIB_APPCOMMON_SRCS}) +add_library(signals::appcommon ALIAS appcommon) set_target_properties(appcommon PROPERTIES OUTPUT_NAME signals_appcommon diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 321e36c93..8685793e6 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -30,6 +30,7 @@ set(LIB_MEDIA_SRCS # Define the media library add_library(media STATIC ${LIB_MEDIA_SRCS}) +add_library(signals::media ALIAS media) set_target_properties(media PROPERTIES OUTPUT_NAME signals_media @@ -742,6 +743,7 @@ set(EXE_LOGOOVERLAY_SRCS ) list(APPEND EXE_LOGOOVERLAY_SRCS ${LIB_MODULES_SRCS}) add_library(LogoOverlay SHARED ${EXE_LOGOOVERLAY_SRCS}) + target_include_directories(LogoOverlay PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index b7fd22dc9..59dab34da 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -7,6 +7,7 @@ add_library(modules SHARED ${CMAKE_CURRENT_SOURCE_DIR}/utils/factory.cpp ${CMAKE_CURRENT_SOURCE_DIR}/utils/loader.cpp ) +add_library(signals::modules ALIAS modules) set_target_properties(modules PROPERTIES OUTPUT_NAME signals_modules diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index 6fcd3fe49..5016823d0 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -14,6 +14,7 @@ set(LIB_PIPELINE_SRCS ) add_library(pipeline STATIC ${LIB_PIPELINE_SRCS}) +add_library(signals::pipeline ALIAS pipeline) set_target_properties(pipeline PROPERTIES OUTPUT_NAME signals_pipeline diff --git a/src/lib_signals/CMakeLists.txt b/src/lib_signals/CMakeLists.txt index ed3f5c609..98893a8e3 100644 --- a/src/lib_signals/CMakeLists.txt +++ b/src/lib_signals/CMakeLists.txt @@ -6,6 +6,7 @@ set(LIB_SIGNALS_INCS ) # Add the library target add_library(lib_signals INTERFACE) +add_library(signals::lib_signals ALIAS lib_signals) # Specify include directories for the library target_include_directories(lib_signals diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index cc1bffb29..4421d6294 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -31,6 +31,8 @@ else() endif() add_library(utils SHARED) +add_library(signals::utils ALIAS utils) + target_sources(utils PRIVATE ${LIB_UTILS_SRCS} ${LIB_UTILS_INCS} From b51f9843bd815fa1565ce1d9dc38269347634d1a Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Dec 2024 17:41:20 +0100 Subject: [PATCH 118/182] Temporarily disable git version finding script: it doesn't work under the umbrella build. --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6e6e1622..b7963f3b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,12 +66,12 @@ file(MAKE_DIRECTORY ${SIGNALS_VERSION_HEADER_DIR}) # Generate signals_version.h using version.sh set(SIGNALS_VERSION_HEADER "${SIGNALS_VERSION_HEADER_DIR}/signals_version.h") file(WRITE "${SIGNALS_VERSION_HEADER}" "\"unknown-unknown-unknown\"") -if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - execute_process( - COMMAND "${SCRIPTS_DIR}/version.sh" - OUTPUT_FILE "${SIGNALS_VERSION_HEADER}" - ) -endif() +#if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +# execute_process( +# COMMAND "${SCRIPTS_DIR}/version.sh" +# OUTPUT_FILE "${SIGNALS_VERSION_HEADER}" +# ) +#endif() message(STATUS "Generated signals_version.h available at ${SIGNALS_VERSION_HEADER}") From 09874542bb1a40fcf81cca9f7daf592c2432ebc9 Mon Sep 17 00:00:00 2001 From: slarbi Date: Fri, 27 Dec 2024 14:32:17 +0100 Subject: [PATCH 119/182] adding httpSink.smd target: + removing unnecessary includes --- src/lib_media/CMakeLists.txt | 44 ++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 8685793e6..802648e60 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -84,12 +84,6 @@ target_link_libraries(media $ ) -# xxxjack I think this should go... Won't we link to some objects twice? -file(GLOB LIB_MODULES_SRCS - ${CMAKE_SOURCE_DIR}/src/lib_modules/utils/*.cpp - ${CMAKE_SOURCE_DIR}/src/lib_modules/core/*.cpp -) - # Define source files for the AVCC2AnnexBConverter set(EXE_AVCC2ANNEXBCONVERTER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/transform/avcc2annexb.cpp @@ -774,4 +768,40 @@ install(TARGETS LogoOverlay add_custom_command(TARGET LogoOverlay POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS -) \ No newline at end of file +) + +# HTTPSink target +set(EXE_HTTPSINK_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/out/http_sink.cpp +) +list(APPEND EXE_FILESYSTEMSINK_SRCS ${LIB_MODULES_SRCS}) +add_library(HttpSink SHARED ${EXE_HTTPSINK_SRCS}) +target_include_directories(HttpSink + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ + ) +target_link_libraries(HttpSink + PRIVATE + media + modules + pipeline + appcommon + utils + ) +set_target_properties(HttpSink PROPERTIES + OUTPUT_NAME "HttpSink" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) + +install(TARGETS HttpSink + EXPORT HttpSink + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_custom_command(TARGET HttpSink POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy -t $ $ + COMMAND_EXPAND_LISTS +) From fe84f9003c71504eefa6c3b54b1377ad9153c8cf Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 30 Dec 2024 15:36:13 +0100 Subject: [PATCH 120/182] Could not silence the warning about sprintf while building bin2dash on MacOS. Did the right thing and fixed the root of the problem by using snprintf. --- src/lib_utils/format.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib_utils/format.hpp b/src/lib_utils/format.hpp index 34c91b81d..c4c4c0fe8 100644 --- a/src/lib_utils/format.hpp +++ b/src/lib_utils/format.hpp @@ -33,42 +33,42 @@ struct Local { } static std::string to_string(const void* v) { char buffer[128]; - sprintf(buffer, "%p", v); + snprintf(buffer, 128, "%p", v); return buffer; } static std::string to_string(double v) { char buffer[128]; - sprintf(buffer, "%f", v); + snprintf(buffer, 128, "%f", v); return buffer; } static std::string to_string(long unsigned v) { char buffer[128]; - sprintf(buffer, "%lu", v); + snprintf(buffer, 128, "%lu", v); return buffer; } static std::string to_string(long v) { char buffer[128]; - sprintf(buffer, "%ld", v); + snprintf(buffer, 128, "%ld", v); return buffer; } static std::string to_string(unsigned int v) { char buffer[128]; - sprintf(buffer, "%u", v); + snprintf(buffer, 128, "%u", v); return buffer; } static std::string to_string(int v) { char buffer[128]; - sprintf(buffer, "%d", v); + snprintf(buffer, 128, "%d", v); return buffer; } static std::string to_string(long long v) { char buffer[128]; - sprintf(buffer, "%lld", v); + snprintf(buffer, 128, "%lld", v); return buffer; } static std::string to_string(long long unsigned v) { char buffer[128]; - sprintf(buffer, "%llu", v); + snprintf(buffer, 128, "%llu", v); return buffer; } }; From e024fd511c48ae8c4dc4661238f25f2131eb3685 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Mon, 30 Dec 2024 23:35:55 +0100 Subject: [PATCH 121/182] libpipeline depends on libmodules, but funnily enough this missing dependency was only a problem when building with mingw... --- src/lib_pipeline/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index 5016823d0..03965ca12 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -32,6 +32,7 @@ target_include_directories(pipeline PUBLIC target_link_libraries(pipeline PRIVATE appcommon + modules utils ) From 3fed99460693ddbc30fc1cca01ceba78f39f98ab Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Tue, 31 Dec 2024 12:27:17 +0100 Subject: [PATCH 122/182] use install(FILES) with TARGET_RUNTIME_DLLS to install dlls. Unfortunately only a partial solution. --- src/lib_media/CMakeLists.txt | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 802648e60..6078d6555 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -125,6 +125,8 @@ install(TARGETS AVCC2AnnexBConverter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET AVCC2AnnexBConverter POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -175,6 +177,8 @@ install(TARGETS LibavMuxHLSTS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET LibavMuxHLSTS POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -220,6 +224,8 @@ install(TARGETS VideoConvert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET VideoConvert POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -259,6 +265,8 @@ install(TARGETS AudioConvert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET AudioConvert POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -296,6 +304,8 @@ install(TARGETS JPEGTurboDecode RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET JPEGTurboDecode POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -331,6 +341,8 @@ install(TARGETS JPEGTurboEncode RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET JPEGTurboEncode POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -373,6 +385,8 @@ install(TARGETS Encoder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET Encoder POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -413,6 +427,8 @@ install(TARGETS Decoder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET Decoder POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -455,6 +471,8 @@ install(TARGETS LibavDemux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET LibavDemux POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -496,6 +514,8 @@ install(TARGETS LibavMux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET LibavMux POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -536,6 +556,8 @@ install(TARGETS LibavFilter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET LibavFilter POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -575,6 +597,8 @@ install(TARGETS GPACMuxMP4 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET GPACMuxMP4 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -613,6 +637,8 @@ install(TARGETS GPACMuxMP4MSS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET GPACMuxMP4MSS POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -652,6 +678,8 @@ install(TARGETS GPACDemuxMP4Simple RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET GPACDemuxMP4Simple POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -690,6 +718,8 @@ install(TARGETS GPACDemuxMP4Full RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET GPACDemuxMP4Full POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -726,6 +756,8 @@ install(TARGETS FileSystemSink RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET FileSystemSink POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -765,6 +797,8 @@ install(TARGETS LogoOverlay RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET LogoOverlay POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS @@ -801,6 +835,8 @@ install(TARGETS HttpSink RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET HttpSink POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS From 5ef0e812007190ca9e55811fdb3876d2d18c5d46 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Tue, 31 Dec 2024 12:28:37 +0100 Subject: [PATCH 123/182] Use install(FILES) with TARGET_RUNTIME_DLLS for installing DLLs. Unfortunately only a partial solution. --- src/lib_modules/CMakeLists.txt | 2 ++ src/plugins/Dasher/CMakeLists.txt | 2 ++ src/plugins/Fmp4Splitter/CMakeLists.txt | 2 ++ src/plugins/HlsDemuxer/CMakeLists.txt | 2 ++ src/plugins/MulticastInput/CMakeLists.txt | 2 ++ src/plugins/SdlRender/CMakeLists.txt | 3 +++ src/plugins/Telx2Ttml/CMakeLists.txt | 2 ++ src/plugins/TsDemuxer/CMakeLists.txt | 2 ++ src/plugins/TsMuxer/CMakeLists.txt | 2 ++ src/plugins/UdpOutput/CMakeLists.txt | 2 ++ 10 files changed, 21 insertions(+) diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 59dab34da..226288eff 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -69,6 +69,8 @@ install(TARGETS modules PUBLIC_HEADER DESTINATION include/signals ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET modules POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index 6953d4139..54c8ab86d 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -41,6 +41,8 @@ install(TARGETS MPEG_DASH RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET MPEG_DASH POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index 1d71ef024..67fc46b01 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -27,6 +27,8 @@ install(TARGETS FMP4SPLITTER RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET FMP4SPLITTER POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index 7cba86db3..ab7c17408 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -40,6 +40,8 @@ install(TARGETS HlsDemuxer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET HlsDemuxer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index d29b774eb..5dfdcdcc6 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -52,6 +52,8 @@ install(TARGETS MulticastInput RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET MulticastInput POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt index 1db6d0d81..26a00a57c 100644 --- a/src/plugins/SdlRender/CMakeLists.txt +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -34,6 +34,7 @@ install(TARGETS SDLVideo EXPORT SDLVideo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) add_custom_command(TARGET SDLVideo POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ @@ -75,6 +76,8 @@ install(TARGETS SDLAudio RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET SDLAudio POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index b7bb07a1c..e220fa2cd 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -31,6 +31,8 @@ install(TARGETS TeletextToTTML RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET TeletextToTTML POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index 915de98c1..3c0f8d8fe 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -27,6 +27,8 @@ install(TARGETS TsDemuxer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET TsDemuxer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt index a5bcb87c8..d1e24d56a 100644 --- a/src/plugins/TsMuxer/CMakeLists.txt +++ b/src/plugins/TsMuxer/CMakeLists.txt @@ -29,6 +29,8 @@ install(TARGETS TsMuxer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET TsMuxer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index add6f2ae8..f41715c19 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -52,6 +52,8 @@ install(TARGETS UdpOutput RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES $ TYPE BIN) + add_custom_command(TARGET UdpOutput POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ COMMAND_EXPAND_LISTS From 2c7f62e21a349171f13d6b20dc15769bc385d04a Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Thu, 2 Jan 2025 17:46:04 +0100 Subject: [PATCH 124/182] Experimenting with correct command to install runtime dependency DLLs. --- src/lib_media/CMakeLists.txt | 187 ++++++++++++++++++----------------- 1 file changed, 97 insertions(+), 90 deletions(-) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 6078d6555..2d612fa92 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -125,12 +125,12 @@ install(TARGETS AVCC2AnnexBConverter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET AVCC2AnnexBConverter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET AVCC2AnnexBConverter POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # Define source files for the LibavMuxHLSTS @@ -177,12 +177,12 @@ install(TARGETS LibavMuxHLSTS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET LibavMuxHLSTS POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET LibavMuxHLSTS POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # Define source files for the VideoConvert target set(EXE_VIDEOCONVERTER_SRCS @@ -224,12 +224,12 @@ install(TARGETS VideoConvert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET VideoConvert POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET VideoConvert POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # AudioConvert target set(EXE_AUDIOCONVERTER_SRCS @@ -265,12 +265,12 @@ install(TARGETS AudioConvert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET AudioConvert POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET AudioConvert POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # JPEGTurboDecode target set(EXE_JPEGTURBODECODE_SRCS @@ -300,16 +300,23 @@ set_target_properties(JPEGTurboDecode PROPERTIES ) install(TARGETS JPEGTurboDecode + RUNTIME_DEPENDENCY_SET JPEGTurboDecode_Deps EXPORT JPEGTurboDecode RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +set(CMAKE_MINGW_SYSTEM_LIBRARY_PATH "C:/msys64/ucrt64/bin") +install(RUNTIME_DEPENDENCY_SET JPEGTurboDecode_Deps + PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" + DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} +) -install(FILES $ TYPE BIN) +#install(FILES $ TYPE BIN) -add_custom_command(TARGET JPEGTurboDecode POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET JPEGTurboDecode POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # JPEGTurboEncode target set(EXE_JPEGTURBOENCODE_SRCS @@ -341,12 +348,12 @@ install(TARGETS JPEGTurboEncode RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET JPEGTurboEncode POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET JPEGTurboEncode POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # Encoder target set(EXE_ENCODER_SRCS @@ -385,12 +392,12 @@ install(TARGETS Encoder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET Encoder POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET Encoder POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # Decoder target set(EXE_DECODER_SRCS @@ -427,12 +434,12 @@ install(TARGETS Decoder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET Decoder POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET Decoder POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # LibavDemux target set(EXE_LIBAVDEMUX_SRCS @@ -471,12 +478,12 @@ install(TARGETS LibavDemux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET LibavDemux POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET LibavDemux POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # LibavMux target set(EXE_LIBAVMUX_SRCS @@ -514,12 +521,12 @@ install(TARGETS LibavMux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET LibavMux POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET LibavMux POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # LibavFilter target set(EXE_LIBAVFILTER_SRCS @@ -556,12 +563,12 @@ install(TARGETS LibavFilter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET LibavFilter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET LibavFilter POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # GPACMuxMP4 target set(EXE_GPACMUXMP4_SRCS @@ -597,12 +604,12 @@ install(TARGETS GPACMuxMP4 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET GPACMuxMP4 POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET GPACMuxMP4 POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # GPACMuxMP4MSS target set(EXE_GPACMUXMP4MSS_SRCS @@ -637,12 +644,12 @@ install(TARGETS GPACMuxMP4MSS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET GPACMuxMP4MSS POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET GPACMuxMP4MSS POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # GPACDemuxMP4Simple target @@ -678,12 +685,12 @@ install(TARGETS GPACDemuxMP4Simple RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET GPACDemuxMP4Simple POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET GPACDemuxMP4Simple POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # GPACDemuxMP4Full target set(EXE_GPACDEMUXMP4FULL_SRCS @@ -718,12 +725,12 @@ install(TARGETS GPACDemuxMP4Full RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET GPACDemuxMP4Full POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET GPACDemuxMP4Full POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # FileSystemSink target set(EXE_FILESYSTEMSINK_SRCS @@ -756,12 +763,12 @@ install(TARGETS FileSystemSink RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET FileSystemSink POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET FileSystemSink POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # LogoOverlay target set(EXE_LOGOOVERLAY_SRCS @@ -797,12 +804,12 @@ install(TARGETS LogoOverlay RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET LogoOverlay POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET LogoOverlay POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) # HTTPSink target set(EXE_HTTPSINK_SRCS @@ -835,9 +842,9 @@ install(TARGETS HttpSink RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -install(FILES $ TYPE BIN) +# install(FILES $ TYPE BIN) -add_custom_command(TARGET HttpSink POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#add_custom_command(TARGET HttpSink POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) From 1eea9e53ce19adf2a31587ff9ec0780ab95369d7 Mon Sep 17 00:00:00 2001 From: "BEELZEBUB\\DIS" Date: Thu, 2 Jan 2025 22:09:13 +0100 Subject: [PATCH 125/182] Created macros signals_install_plugin() and signals_install_app() to handle installing. Use these in most CMakefiles (but not all, yet) --- CMakeFiles/SignalsMacros.cmake | 62 ++++ CMakeLists.txt | 5 +- src/lib_media/CMakeLists.txt | 347 ++-------------------- src/plugins/Dasher/CMakeLists.txt | 19 +- src/plugins/Fmp4Splitter/CMakeLists.txt | 20 +- src/plugins/HlsDemuxer/CMakeLists.txt | 20 +- src/plugins/MulticastInput/CMakeLists.txt | 20 +- src/plugins/SdlRender/CMakeLists.txt | 46 +-- src/plugins/Telx2Ttml/CMakeLists.txt | 20 +- src/plugins/TsDemuxer/CMakeLists.txt | 20 +- src/plugins/TsMuxer/CMakeLists.txt | 20 +- src/plugins/UdpOutput/CMakeLists.txt | 20 +- 12 files changed, 94 insertions(+), 525 deletions(-) create mode 100644 CMakeFiles/SignalsMacros.cmake diff --git a/CMakeFiles/SignalsMacros.cmake b/CMakeFiles/SignalsMacros.cmake new file mode 100644 index 000000000..e5ac9cf20 --- /dev/null +++ b/CMakeFiles/SignalsMacros.cmake @@ -0,0 +1,62 @@ +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + add_compile_options(-Wall -Wextra -Werror -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated-declarations) + # xxxjack this is a hack. We need to find a better way to + # find the C++ and other system libraries. + set(CMAKE_MINGW_SYSTEM_LIBRARY_PATH "C:/msys64/ucrt64/bin") +endif() + +macro(signals_install_plugin _component) + +set_target_properties(${_component} PROPERTIES + OUTPUT_NAME "${_component}" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) + +install(TARGETS ${_component} + RUNTIME_DEPENDENCY_SET ${_component}_Deps + EXPORT ${_component} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +install(RUNTIME_DEPENDENCY_SET ${_component}_Deps + PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" + DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} +) +#install(FILES $ TYPE BIN) +# +#add_custom_command(TARGET ${_component} POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) + +endmacro() + +macro(signals_install_app _component) + +set_target_properties(${_component} PROPERTIES + OUTPUT_NAME "${_component}" + SUFFIX ".exe" + ) + +install(TARGETS ${_component} + RUNTIME_DEPENDENCY_SET ${_component}_Deps + EXPORT ${_component} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +install(RUNTIME_DEPENDENCY_SET ${_component}_Deps + PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" + DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} +) +#install(FILES $ TYPE BIN) +# +#add_custom_command(TARGET ${_component} POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) + +endmacro() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index b7963f3b7..bebbe0fc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ) +include(SignalsMacros) + # Set the C++ standard set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -18,7 +20,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # xxxjack some are actually dependent on the toolchain... if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") add_compile_options(-Wall -Wextra -Werror -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated-declarations) - + # Debug-specific options if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_compile_options(-g3) @@ -55,7 +57,6 @@ else() message(FATAL_ERROR " Unknown CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") endif() - # Define paths for source and scripts set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 2d612fa92..79d42dd1b 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -112,26 +112,7 @@ target_link_libraries(AVCC2AnnexBConverter utils ) -set_target_properties(AVCC2AnnexBConverter PROPERTIES - OUTPUT_NAME "AVCC2AnnexBConverter" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" -) - - -install(TARGETS AVCC2AnnexBConverter - EXPORT AVCC2AnnexBConverter - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET AVCC2AnnexBConverter POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) - +signals_install_plugin(AVCC2AnnexBConverter) # Define source files for the LibavMuxHLSTS set(EXE_LIBAVMUXHLSTS_SRCS @@ -164,25 +145,7 @@ target_link_libraries(LibavMuxHLSTS ${FFMPEG_LIBRARIES} ) -# Set target properties -set_target_properties(LibavMuxHLSTS PROPERTIES - OUTPUT_NAME "LibavMuxHLSTS" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" -) - -install(TARGETS LibavMuxHLSTS - EXPORT LibavMuxHLSTS - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET LibavMuxHLSTS POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(LibavMuxHLSTS) # Define source files for the VideoConvert target set(EXE_VIDEOCONVERTER_SRCS @@ -211,25 +174,7 @@ target_link_libraries(VideoConvert PRIVATE ${FFMPEG_LIBRARIES} ) -# Set properties for the target -set_target_properties(VideoConvert PROPERTIES - OUTPUT_NAME "VideoConvert" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS VideoConvert - EXPORT VideoConvert - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET VideoConvert POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(VideoConvert) # AudioConvert target set(EXE_AUDIOCONVERTER_SRCS @@ -253,24 +198,8 @@ target_link_libraries(AudioConvert utils ${FFMPEG_LIBRARIES} ) -set_target_properties(AudioConvert PROPERTIES - OUTPUT_NAME "AudioConvert" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) -install(TARGETS AudioConvert - EXPORT AudioConvert - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET AudioConvert POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(AudioConvert) # JPEGTurboDecode target set(EXE_JPEGTURBODECODE_SRCS @@ -292,31 +221,8 @@ target_link_libraries(JPEGTurboDecode utils libjpeg-turbo::turbojpeg ) -set_target_properties(JPEGTurboDecode PROPERTIES - OUTPUT_NAME "JPEGTurboDecode" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS JPEGTurboDecode - RUNTIME_DEPENDENCY_SET JPEGTurboDecode_Deps - EXPORT JPEGTurboDecode - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) -set(CMAKE_MINGW_SYSTEM_LIBRARY_PATH "C:/msys64/ucrt64/bin") -install(RUNTIME_DEPENDENCY_SET JPEGTurboDecode_Deps - PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" - DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} -) - -#install(FILES $ TYPE BIN) - -#add_custom_command(TARGET JPEGTurboDecode POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) + +signals_install_plugin(JPEGTurboDecode) # JPEGTurboEncode target set(EXE_JPEGTURBOENCODE_SRCS @@ -335,25 +241,8 @@ target_link_libraries(JPEGTurboEncode utils libjpeg-turbo::turbojpeg ) -set_target_properties(JPEGTurboEncode PROPERTIES - OUTPUT_NAME "JPEGTurboEncode" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS JPEGTurboEncode - EXPORT JPEGTurboEncode - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET JPEGTurboEncode POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(JPEGTurboEncode) # Encoder target set(EXE_ENCODER_SRCS @@ -380,24 +269,8 @@ target_link_libraries(Encoder utils ${FFMPEG_LIBRARIES} ) -set_target_properties(Encoder PROPERTIES - OUTPUT_NAME "Encoder" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) -install(TARGETS Encoder - EXPORT Encoder - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET Encoder POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(Encoder) # Decoder target set(EXE_DECODER_SRCS @@ -422,24 +295,8 @@ target_link_libraries(Decoder utils ${FFMPEG_LIBRARIES} ) -set_target_properties(Decoder PROPERTIES - OUTPUT_NAME "Decoder" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS Decoder - EXPORT Decoder - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET Decoder POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(Decoder) # LibavDemux target set(EXE_LIBAVDEMUX_SRCS @@ -465,25 +322,8 @@ target_link_libraries(LibavDemux utils ${FFMPEG_LIBRARIES} ) -set_target_properties(LibavDemux - PROPERTIES - OUTPUT_NAME "LibavDemux" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS LibavDemux - EXPORT LibavDemux - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) -#add_custom_command(TARGET LibavDemux POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(LibavDemux) # LibavMux target set(EXE_LIBAVMUX_SRCS @@ -508,25 +348,8 @@ target_link_libraries(LibavMux utils ${FFMPEG_LIBRARIES} ) -set_target_properties(LibavMux PROPERTIES - OUTPUT_NAME "LibavMux" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS LibavMux - EXPORT LibavMux - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET LibavMux POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(LibavMux) # LibavFilter target set(EXE_LIBAVFILTER_SRCS @@ -551,24 +374,8 @@ target_link_libraries(LibavFilter utils ${FFMPEG_LIBRARIES} ) -set_target_properties(LibavFilter PROPERTIES - OUTPUT_NAME "LibavFilter" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS LibavFilter - EXPORT LibavFilter - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET LibavFilter POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(LibavFilter) # GPACMuxMP4 target set(EXE_GPACMUXMP4_SRCS @@ -592,24 +399,8 @@ target_link_libraries(GPACMuxMP4 gpac::gpac ${FFMPEG_LIBRARIES} ) -set_target_properties(GPACMuxMP4 PROPERTIES - OUTPUT_NAME "GPACMuxMP4" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) -install(TARGETS GPACMuxMP4 - EXPORT GPACMuxMP4 - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET GPACMuxMP4 POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(GPACMuxMP4) # GPACMuxMP4MSS target set(EXE_GPACMUXMP4MSS_SRCS @@ -632,25 +423,8 @@ target_link_libraries(GPACMuxMP4MSS utils gpac::gpac ) -set_target_properties(GPACMuxMP4MSS PROPERTIES - OUTPUT_NAME "GPACMuxMP4MSS" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS GPACMuxMP4MSS - EXPORT GPACMuxMP4MSS - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET GPACMuxMP4MSS POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(GPACMuxMP4MSS) # GPACDemuxMP4Simple target set(EXE_GPACDEMUXMP4SIMPLE_SRCS @@ -672,25 +446,8 @@ target_link_libraries(GPACDemuxMP4Simple utils gpac::gpac ) -set_target_properties(GPACDemuxMP4Simple PROPERTIES - OUTPUT_NAME "GPACDemuxMP4Simple" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS GPACDemuxMP4Simple - EXPORT GPACDemuxMP4Simple - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET GPACDemuxMP4Simple POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(GPACDemuxMP4Simple) # GPACDemuxMP4Full target set(EXE_GPACDEMUXMP4FULL_SRCS @@ -713,24 +470,8 @@ target_link_libraries(GPACDemuxMP4Full gpac::gpac ${FFMPEG_LIBRARIES} ) -set_target_properties(GPACDemuxMP4Full PROPERTIES - OUTPUT_NAME "GPACDemuxMP4Full" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS GPACDemuxMP4Full - EXPORT GPACDemuxMP4Full - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET GPACDemuxMP4Full POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(GPACDemuxMP4Full) # FileSystemSink target set(EXE_FILESYSTEMSINK_SRCS @@ -751,24 +492,8 @@ target_link_libraries(FileSystemSink appcommon utils ) -set_target_properties(FileSystemSink PROPERTIES - OUTPUT_NAME "FileSystemSink" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) -install(TARGETS FileSystemSink - EXPORT FileSystemSink - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET FileSystemSink POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(FileSystemSink) # LogoOverlay target set(EXE_LOGOOVERLAY_SRCS @@ -791,25 +516,7 @@ target_link_libraries(LogoOverlay utils ) -set_target_properties(LogoOverlay PROPERTIES - OUTPUT_NAME "LogoOverlay" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - - -install(TARGETS LogoOverlay - EXPORT LogoOverlay - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET LogoOverlay POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(LogoOverlay) # HTTPSink target set(EXE_HTTPSINK_SRCS @@ -830,21 +537,5 @@ target_link_libraries(HttpSink appcommon utils ) -set_target_properties(HttpSink PROPERTIES - OUTPUT_NAME "HttpSink" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" - ) - -install(TARGETS HttpSink - EXPORT HttpSink - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) -# install(FILES $ TYPE BIN) - -#add_custom_command(TARGET HttpSink POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) +signals_install_plugin(HttpSink) diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index 54c8ab86d..c0b0462f7 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -28,22 +28,5 @@ target_link_libraries(MPEG_DASH PRIVATE media modules pipeline appcommon utils ) -# Set properties for the target -set_target_properties(MPEG_DASH PROPERTIES - OUTPUT_NAME "MPEG_DASH" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS MPEG_DASH - EXPORT MPEG_DASH - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +signals_install_plugin(MPEG_DASH) -install(FILES $ TYPE BIN) - -add_custom_command(TARGET MPEG_DASH POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index 67fc46b01..887fa5676 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -14,22 +14,4 @@ target_include_directories(FMP4SPLITTER PUBLIC ${SIGNALS_TOP_SOURCE_DIR}/src ) -# Set properties for the target -set_target_properties(FMP4SPLITTER PROPERTIES - OUTPUT_NAME "Fmp4Splitter" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS FMP4SPLITTER - EXPORT FMP4SPLITTER - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET FMP4SPLITTER POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(FMP4SPLITTER) diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index ab7c17408..faa927647 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -27,22 +27,4 @@ target_link_libraries(HlsDemuxer PRIVATE media modules pipeline appcommon utils CURL::libcurl ) -# Set properties for the target -set_target_properties(HlsDemuxer PROPERTIES - OUTPUT_NAME "HlsDemuxer" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS HlsDemuxer - EXPORT HlsDemuxer - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET HlsDemuxer POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(HlsDemuxer) diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index 5dfdcdcc6..04f9d8d72 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -39,22 +39,4 @@ target_include_directories(MulticastInput PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) -# Set properties for the target -set_target_properties(MulticastInput PROPERTIES - OUTPUT_NAME "MulticastInput" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS MulticastInput - EXPORT MulticastInput - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET MulticastInput POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(MulticastInput) diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt index 26a00a57c..cc9639f8b 100644 --- a/src/plugins/SdlRender/CMakeLists.txt +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -22,24 +22,7 @@ target_include_directories(SDLVideo PUBLIC ${SDL2_INCLUDE_DIRS} ) -# Set properties for the target -set_target_properties(SDLVideo PROPERTIES - OUTPUT_NAME "SDLVideo" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS SDLVideo - EXPORT SDLVideo - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) -install(FILES $ TYPE BIN) - -add_custom_command(TARGET SDLVideo POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(SDLVideo) # Define the SDLAudio plugin set(SDLAudio_src @@ -56,29 +39,4 @@ target_link_libraries(SDLAudio SDL2::SDL2 # Link SDL2 ) -# Include directories for SDLAudio -target_include_directories(SDLAudio PUBLIC - ${SIGNALS_TOP_SOURCE_DIR}/src - ${CMAKE_CURRENT_SOURCE_DIR}/plugins/SdlRender - ${SDL2_INCLUDE_DIRS} -) - -# Set properties for SDLAudio target -set_target_properties(SDLAudio PROPERTIES - OUTPUT_NAME "SDLAudio" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS SDLAudio - EXPORT SDLAudio - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET SDLAudio POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(SDLAudio) diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index e220fa2cd..d43ed79df 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -18,22 +18,4 @@ target_include_directories(TeletextToTTML ${FFMPEG_INCLUDE_DIRS} ) -# Set properties for the target -set_target_properties(TeletextToTTML PROPERTIES - OUTPUT_NAME "TeletextToTTML" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS TeletextToTTML - EXPORT TeletextToTTML - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET TeletextToTTML POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(TeletextToTTML) diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index 3c0f8d8fe..ff45ad5bc 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -14,22 +14,4 @@ target_include_directories(TsDemuxer PUBLIC ${SIGNALS_TOP_SOURCE_DIR}/src ) -# Set properties for the target -set_target_properties(TsDemuxer PROPERTIES - OUTPUT_NAME "TsDemuxer" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS TsDemuxer - EXPORT TsDemuxer - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET TsDemuxer POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(TsDemuxer) diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt index d1e24d56a..b1d738001 100644 --- a/src/plugins/TsMuxer/CMakeLists.txt +++ b/src/plugins/TsMuxer/CMakeLists.txt @@ -16,22 +16,4 @@ target_include_directories(TsMuxer PUBLIC ${SIGNALS_TOP_SOURCE_DIR}/src ) -# Set properties for the target -set_target_properties(TsMuxer PROPERTIES - OUTPUT_NAME "TsMuxer" # Output name without extension - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS TsMuxer - EXPORT TsMuxer - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET TsMuxer POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +signals_install_plugin(TsMuxer) diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index f41715c19..53939319c 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -39,22 +39,4 @@ target_include_directories(UdpOutput PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) -# Set properties for the target -set_target_properties(UdpOutput PROPERTIES - OUTPUT_NAME "UdpOutput" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" # Set the custom file extension to .smd - PREFIX "" # -) - -install(TARGETS UdpOutput - EXPORT UdpOutput - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(FILES $ TYPE BIN) - -add_custom_command(TARGET UdpOutput POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) \ No newline at end of file +signals_install_plugin(UdpOutput) From 64e97b2e449dde52d994100e125abc601f338b92 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 3 Jan 2025 14:50:41 +0100 Subject: [PATCH 126/182] Don't try to copy dependency frameworks. --- CMakeFiles/SignalsMacros.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeFiles/SignalsMacros.cmake b/CMakeFiles/SignalsMacros.cmake index e5ac9cf20..1ef65c934 100644 --- a/CMakeFiles/SignalsMacros.cmake +++ b/CMakeFiles/SignalsMacros.cmake @@ -18,11 +18,12 @@ install(TARGETS ${_component} RUNTIME_DEPENDENCY_SET ${_component}_Deps EXPORT ${_component} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(RUNTIME_DEPENDENCY_SET ${_component}_Deps PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} ) #install(FILES $ TYPE BIN) @@ -49,7 +50,7 @@ install(TARGETS ${_component} install(RUNTIME_DEPENDENCY_SET ${_component}_Deps PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} ) #install(FILES $ TYPE BIN) From 01f8c716f9f222dcadd39ab35459a86504daaaef Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 6 Jan 2025 17:56:57 +0100 Subject: [PATCH 127/182] Modules should be a static library, not a shared library. --- src/lib_modules/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 226288eff..9c72c83d7 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -1,5 +1,5 @@ # Define the library target -add_library(modules SHARED +add_library(modules STATIC ${CMAKE_CURRENT_SOURCE_DIR}/core/allocator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/core/connection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/core/data.cpp @@ -69,12 +69,12 @@ install(TARGETS modules PUBLIC_HEADER DESTINATION include/signals ) -install(FILES $ TYPE BIN) - -add_custom_command(TARGET modules POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS -) +#install(FILES $ TYPE BIN) +# +#add_custom_command(TARGET modules POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ +# COMMAND_EXPAND_LISTS +#) From b000759ba7f61296afbadadb1a01ce440a7dbb4c Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 7 Jan 2025 13:55:51 +0100 Subject: [PATCH 128/182] Fixed capitalisation of Fmp4Splitter. --- src/plugins/Fmp4Splitter/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index 887fa5676..e60f46334 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -1,17 +1,17 @@ # Define the plugin library -add_library(FMP4SPLITTER SHARED +add_library(Fmp4Splitter SHARED fmp4_splitter.cpp ) # Link dependencies if any -target_link_libraries(FMP4SPLITTER +target_link_libraries(Fmp4Splitter ${CMAKE_THREAD_LIBS_INIT} modules ) # Include directories -target_include_directories(FMP4SPLITTER PUBLIC +target_include_directories(Fmp4Splitter PUBLIC ${SIGNALS_TOP_SOURCE_DIR}/src ) -signals_install_plugin(FMP4SPLITTER) +signals_install_plugin(Fmp4Splitter) From e245987ccc8f751a738825aacb0fd5786ddfaab5 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 8 Jan 2025 17:42:51 +0100 Subject: [PATCH 129/182] More standard way of determining destination of libraries and plugins. --- CMakeFiles/SignalsMacros.cmake | 126 ++++++++++++++++++++----------- src/lib_appcommon/CMakeLists.txt | 24 +----- src/lib_media/CMakeLists.txt | 32 +------- src/lib_modules/CMakeLists.txt | 38 +--------- src/lib_pipeline/CMakeLists.txt | 25 +----- src/lib_utils/CMakeLists.txt | 26 +------ 6 files changed, 91 insertions(+), 180 deletions(-) diff --git a/CMakeFiles/SignalsMacros.cmake b/CMakeFiles/SignalsMacros.cmake index 1ef65c934..29dce2406 100644 --- a/CMakeFiles/SignalsMacros.cmake +++ b/CMakeFiles/SignalsMacros.cmake @@ -5,59 +5,99 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") set(CMAKE_MINGW_SYSTEM_LIBRARY_PATH "C:/msys64/ucrt64/bin") endif() +macro(signals_install_library _component _type) + + set_target_properties(${_component} PROPERTIES + OUTPUT_NAME "${_component}" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + ) + if (${_type} STREQUAL "STATIC") + # No need to find runtime dependencies for static libraries + install(TARGETS ${_component} + EXPORT signals-${_component} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + FRAMEWORK DESTINATION lib + PUBLIC_HEADER DESTINATION include/signals + ) + set_target_properties(${_component} PROPERTIES + OUTPUT_NAME signals_${_component} + POSITION_INDEPENDENT_CODE TRUE + ) + else() + install(TARGETS ${_component} + RUNTIME_DEPENDENCY_SET ${_component}_Deps + EXPORT signals-${_component} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + FRAMEWORK DESTINATION lib + ) + + install(RUNTIME_DEPENDENCY_SET ${_component}_Deps + PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" + DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} + ) + endif() + + export( + EXPORT signals-${_component} + NAMESPACE signals:: + ) + + install(EXPORT signals-${_component} + NAMESPACE signals:: + DESTINATION lib/cmake/signals + ) + +endmacro() + macro(signals_install_plugin _component) -set_target_properties(${_component} PROPERTIES - OUTPUT_NAME "${_component}" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" - PREFIX "" + set_target_properties(${_component} PROPERTIES + OUTPUT_NAME "${_component}" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + SUFFIX ".smd" + PREFIX "" + ) + + install(TARGETS ${_component} + RUNTIME_DEPENDENCY_SET ${_component}_Deps + EXPORT ${_component} + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + FRAMEWORK DESTINATION lib ) -install(TARGETS ${_component} - RUNTIME_DEPENDENCY_SET ${_component}_Deps - EXPORT ${_component} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(RUNTIME_DEPENDENCY_SET ${_component}_Deps - PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" - DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} -) -#install(FILES $ TYPE BIN) -# -#add_custom_command(TARGET ${_component} POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) + install(RUNTIME_DEPENDENCY_SET ${_component}_Deps + PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" + DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} + ) endmacro() macro(signals_install_app _component) -set_target_properties(${_component} PROPERTIES - OUTPUT_NAME "${_component}" - SUFFIX ".exe" + set_target_properties(${_component} PROPERTIES + OUTPUT_NAME "${_component}" + SUFFIX ".exe" + ) + + install(TARGETS ${_component} + RUNTIME_DEPENDENCY_SET ${_component}_Deps + EXPORT ${_component} + RUNTIME DESTINATION bin ) -install(TARGETS ${_component} - RUNTIME_DEPENDENCY_SET ${_component}_Deps - EXPORT ${_component} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -install(RUNTIME_DEPENDENCY_SET ${_component}_Deps - PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" - DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} -) -#install(FILES $ TYPE BIN) -# -#add_custom_command(TARGET ${_component} POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) + install(RUNTIME_DEPENDENCY_SET ${_component}_Deps + PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" + DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} + ) endmacro() \ No newline at end of file diff --git a/src/lib_appcommon/CMakeLists.txt b/src/lib_appcommon/CMakeLists.txt index 319e2338f..5e548bb51 100644 --- a/src/lib_appcommon/CMakeLists.txt +++ b/src/lib_appcommon/CMakeLists.txt @@ -11,11 +11,6 @@ set(LIB_APPCOMMON_SRCS add_library(appcommon STATIC ${LIB_APPCOMMON_SRCS}) add_library(signals::appcommon ALIAS appcommon) -set_target_properties(appcommon PROPERTIES - OUTPUT_NAME signals_appcommon - POSITION_INDEPENDENT_CODE TRUE - ) - target_include_directories(appcommon PUBLIC $ $ @@ -27,24 +22,7 @@ target_compile_options(appcommon PRIVATE -Wall -Wextra -Werror ) -# Installation (optional) to be tested later -install(TARGETS appcommon - EXPORT signals-appcommon - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION include/signals -) - -export( - EXPORT signals-appcommon - NAMESPACE signals:: -) - -install(EXPORT signals-appcommon - NAMESPACE signals:: - DESTINATION lib/cmake/signals -) +signals_install_library(appcommon STATIC) install(FILES ${LIB_APPCOMMON_INCS} DESTINATION include/signals/lib_appcommon diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 79d42dd1b..f1ad438ee 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -32,10 +32,7 @@ set(LIB_MEDIA_SRCS add_library(media STATIC ${LIB_MEDIA_SRCS}) add_library(signals::media ALIAS media) -set_target_properties(media PROPERTIES - OUTPUT_NAME signals_media - POSITION_INDEPENDENT_CODE TRUE - ) +signals_install_library(media STATIC) target_include_directories(media PUBLIC $ @@ -43,37 +40,12 @@ target_include_directories(media PUBLIC $ ) -# Installation (optional) to be tested later -install(TARGETS media - EXPORT signals-media - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION include/signals -) - -# Hmm. libmedia is a static library, so it can't be used for TARGET_RUNTIME_DLLs. -# Let's hope the smd's below will pick up the needed dependencies. -#add_custom_command(TARGET media POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) - -export( - EXPORT signals-media - NAMESPACE signals:: -) - -install(EXPORT signals-media - NAMESPACE signals:: - DESTINATION lib/cmake/signals -) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include/signals/ FILES_MATCHING PATTERN "*.hpp" ) + target_link_libraries(media PUBLIC modules diff --git a/src/lib_modules/CMakeLists.txt b/src/lib_modules/CMakeLists.txt index 9c72c83d7..15a9afbf8 100644 --- a/src/lib_modules/CMakeLists.txt +++ b/src/lib_modules/CMakeLists.txt @@ -9,10 +9,7 @@ add_library(modules STATIC ) add_library(signals::modules ALIAS modules) -set_target_properties(modules PROPERTIES - OUTPUT_NAME signals_modules - POSITION_INDEPENDENT_CODE TRUE - ) +signals_install_library(modules STATIC) # Add include directories target_include_directories(modules PUBLIC @@ -55,39 +52,6 @@ target_link_libraries(modules utils ) -# Set output directory -#set_target_properties(modules PROPERTIES -# LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin -#) - -# Installation (optional) to be tested later -install(TARGETS modules - EXPORT signals-modules - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION include/signals -) - -#install(FILES $ TYPE BIN) -# -#add_custom_command(TARGET modules POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -t $ $ -# COMMAND_EXPAND_LISTS -#) - - - -export( - EXPORT signals-modules - NAMESPACE signals:: -) - -install(EXPORT signals-modules - NAMESPACE signals:: - DESTINATION lib/cmake/signals -) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include/signals/ FILES_MATCHING diff --git a/src/lib_pipeline/CMakeLists.txt b/src/lib_pipeline/CMakeLists.txt index 03965ca12..af1898f64 100644 --- a/src/lib_pipeline/CMakeLists.txt +++ b/src/lib_pipeline/CMakeLists.txt @@ -16,10 +16,7 @@ set(LIB_PIPELINE_SRCS add_library(pipeline STATIC ${LIB_PIPELINE_SRCS}) add_library(signals::pipeline ALIAS pipeline) -set_target_properties(pipeline PROPERTIES - OUTPUT_NAME signals_pipeline - POSITION_INDEPENDENT_CODE TRUE - ) +signals_install_library(pipeline STATIC) # Add include directories target_include_directories(pipeline PUBLIC @@ -36,26 +33,6 @@ target_link_libraries(pipeline utils ) - -# Installation (optional) to be tested later -install(TARGETS pipeline - EXPORT signals-pipeline - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION include/signals -) - -export( - EXPORT signals-pipeline - NAMESPACE signals:: -) - -install(EXPORT signals-pipeline - NAMESPACE signals:: - DESTINATION lib/cmake/signals -) - install(FILES ${LIB_PIPELINE_INCS} DESTINATION include/signals/lib_pipeline ) diff --git a/src/lib_utils/CMakeLists.txt b/src/lib_utils/CMakeLists.txt index 4421d6294..57cb4a306 100644 --- a/src/lib_utils/CMakeLists.txt +++ b/src/lib_utils/CMakeLists.txt @@ -33,19 +33,18 @@ endif() add_library(utils SHARED) add_library(signals::utils ALIAS utils) +signals_install_library(utils SHARED) + target_sources(utils PRIVATE ${LIB_UTILS_SRCS} ${LIB_UTILS_INCS} ) + target_sources(utils INTERFACE $ $> ) -set_target_properties(utils PROPERTIES - OUTPUT_NAME signals_utils - POSITION_INDEPENDENT_CODE TRUE - ) # Platform-specific adjustments if(APPLE) @@ -69,25 +68,6 @@ target_include_directories(utils PUBLIC $ ) -# Installation (optional) to be tested later -install(TARGETS utils - EXPORT signals-utils - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION include/signals -) - -export( - EXPORT signals-utils - NAMESPACE signals:: -) - -install(EXPORT signals-utils - NAMESPACE signals:: - DESTINATION lib/cmake/signals -) - install(FILES ${LIB_UTILS_INCS} DESTINATION include/signals/lib_utils ) From 32f771fd3f6bd5a39eccfedd734dc2742a4b76d6 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 9 Jan 2025 17:08:22 +0100 Subject: [PATCH 130/182] Ensure we have signals- in front of the internal library name --- CMakeFiles/SignalsMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeFiles/SignalsMacros.cmake b/CMakeFiles/SignalsMacros.cmake index 29dce2406..ade215869 100644 --- a/CMakeFiles/SignalsMacros.cmake +++ b/CMakeFiles/SignalsMacros.cmake @@ -8,7 +8,7 @@ endif() macro(signals_install_library _component _type) set_target_properties(${_component} PROPERTIES - OUTPUT_NAME "${_component}" + OUTPUT_NAME "signals-${_component}" RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib From 56553572819726a1f775fe3f156cae7153e7e37e Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 20 Jan 2025 12:03:26 +0100 Subject: [PATCH 131/182] Don't include glibc libraries. Unfortunately doesn't solve the issue of running on a non-glibc system such as alpine. --- CMakeFiles/SignalsMacros.cmake | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/CMakeFiles/SignalsMacros.cmake b/CMakeFiles/SignalsMacros.cmake index ade215869..eef454c6b 100644 --- a/CMakeFiles/SignalsMacros.cmake +++ b/CMakeFiles/SignalsMacros.cmake @@ -39,7 +39,11 @@ macro(signals_install_library _component _type) install(RUNTIME_DEPENDENCY_SET ${_component}_Deps PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" + POST_EXCLUDE_REGEXES + ".*system32/.*\\.dll" + "Frameworks" + "/lib/x86_64-linux-gnu" + "/lib64" DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} ) endif() @@ -75,7 +79,11 @@ macro(signals_install_plugin _component) install(RUNTIME_DEPENDENCY_SET ${_component}_Deps PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" + POST_EXCLUDE_REGEXES + ".*system32/.*\\.dll" + "Frameworks" + "/lib/x86_64-linux-gnu" + "/lib64" DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} ) @@ -96,7 +104,11 @@ macro(signals_install_app _component) install(RUNTIME_DEPENDENCY_SET ${_component}_Deps PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" "Frameworks" + POST_EXCLUDE_REGEXES + ".*system32/.*\\.dll" + "Frameworks" + "/lib/x86_64-linux-gnu" + "/lib64" DIRECTORIES ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_MINGW_SYSTEM_LIBRARY_PATH} ) From ed02cc64f8b3ff59aa65c8686e500af45b89c5e8 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 21 Jan 2025 13:17:50 +0100 Subject: [PATCH 132/182] All libraries, executables and plugins are built in the correct place in the build folder. Closes #16. --- CMakeFiles/SignalsMacros.cmake | 10 +++++-- src/lib_media/CMakeLists.txt | 36 +++++++++++------------ src/plugins/Dasher/CMakeLists.txt | 2 +- src/plugins/Fmp4Splitter/CMakeLists.txt | 2 +- src/plugins/HlsDemuxer/CMakeLists.txt | 2 +- src/plugins/MulticastInput/CMakeLists.txt | 2 +- src/plugins/SdlRender/CMakeLists.txt | 4 +-- src/plugins/Telx2Ttml/CMakeLists.txt | 2 +- src/plugins/TsDemuxer/CMakeLists.txt | 2 +- src/plugins/TsMuxer/CMakeLists.txt | 2 +- src/plugins/UdpOutput/CMakeLists.txt | 2 +- 11 files changed, 35 insertions(+), 31 deletions(-) diff --git a/CMakeFiles/SignalsMacros.cmake b/CMakeFiles/SignalsMacros.cmake index eef454c6b..c411aba8c 100644 --- a/CMakeFiles/SignalsMacros.cmake +++ b/CMakeFiles/SignalsMacros.cmake @@ -60,12 +60,15 @@ macro(signals_install_library _component _type) endmacro() -macro(signals_install_plugin _component) - +macro(signals_install_plugin _component _suffix) + if (${_suffix} STREQUAL "") + set(_suffix ".smd") + endif() set_target_properties(${_component} PROPERTIES OUTPUT_NAME "${_component}" RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - SUFFIX ".smd" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + SUFFIX "${_suffix}" PREFIX "" ) @@ -93,6 +96,7 @@ macro(signals_install_app _component) set_target_properties(${_component} PROPERTIES OUTPUT_NAME "${_component}" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin SUFFIX ".exe" ) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index f1ad438ee..a5e06ac06 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -84,7 +84,7 @@ target_link_libraries(AVCC2AnnexBConverter utils ) -signals_install_plugin(AVCC2AnnexBConverter) +signals_install_plugin(AVCC2AnnexBConverter ".smd") # Define source files for the LibavMuxHLSTS set(EXE_LIBAVMUXHLSTS_SRCS @@ -117,7 +117,7 @@ target_link_libraries(LibavMuxHLSTS ${FFMPEG_LIBRARIES} ) -signals_install_plugin(LibavMuxHLSTS) +signals_install_plugin(LibavMuxHLSTS ".smd") # Define source files for the VideoConvert target set(EXE_VIDEOCONVERTER_SRCS @@ -146,7 +146,7 @@ target_link_libraries(VideoConvert PRIVATE ${FFMPEG_LIBRARIES} ) -signals_install_plugin(VideoConvert) +signals_install_plugin(VideoConvert ".smd") # AudioConvert target set(EXE_AUDIOCONVERTER_SRCS @@ -171,7 +171,7 @@ target_link_libraries(AudioConvert ${FFMPEG_LIBRARIES} ) -signals_install_plugin(AudioConvert) +signals_install_plugin(AudioConvert ".smd") # JPEGTurboDecode target set(EXE_JPEGTURBODECODE_SRCS @@ -194,7 +194,7 @@ target_link_libraries(JPEGTurboDecode libjpeg-turbo::turbojpeg ) -signals_install_plugin(JPEGTurboDecode) +signals_install_plugin(JPEGTurboDecode ".smd") # JPEGTurboEncode target set(EXE_JPEGTURBOENCODE_SRCS @@ -214,7 +214,7 @@ target_link_libraries(JPEGTurboEncode libjpeg-turbo::turbojpeg ) -signals_install_plugin(JPEGTurboEncode) +signals_install_plugin(JPEGTurboEncode ".smd") # Encoder target set(EXE_ENCODER_SRCS @@ -242,7 +242,7 @@ target_link_libraries(Encoder ${FFMPEG_LIBRARIES} ) -signals_install_plugin(Encoder) +signals_install_plugin(Encoder ".smd") # Decoder target set(EXE_DECODER_SRCS @@ -268,7 +268,7 @@ target_link_libraries(Decoder ${FFMPEG_LIBRARIES} ) -signals_install_plugin(Decoder) +signals_install_plugin(Decoder ".smd") # LibavDemux target set(EXE_LIBAVDEMUX_SRCS @@ -295,7 +295,7 @@ target_link_libraries(LibavDemux ${FFMPEG_LIBRARIES} ) -signals_install_plugin(LibavDemux) +signals_install_plugin(LibavDemux ".smd") # LibavMux target set(EXE_LIBAVMUX_SRCS @@ -321,7 +321,7 @@ target_link_libraries(LibavMux ${FFMPEG_LIBRARIES} ) -signals_install_plugin(LibavMux) +signals_install_plugin(LibavMux ".smd") # LibavFilter target set(EXE_LIBAVFILTER_SRCS @@ -347,7 +347,7 @@ target_link_libraries(LibavFilter ${FFMPEG_LIBRARIES} ) -signals_install_plugin(LibavFilter) +signals_install_plugin(LibavFilter ".smd") # GPACMuxMP4 target set(EXE_GPACMUXMP4_SRCS @@ -372,7 +372,7 @@ target_link_libraries(GPACMuxMP4 ${FFMPEG_LIBRARIES} ) -signals_install_plugin(GPACMuxMP4) +signals_install_plugin(GPACMuxMP4 ".smd") # GPACMuxMP4MSS target set(EXE_GPACMUXMP4MSS_SRCS @@ -396,7 +396,7 @@ target_link_libraries(GPACMuxMP4MSS gpac::gpac ) -signals_install_plugin(GPACMuxMP4MSS) +signals_install_plugin(GPACMuxMP4MSS ".smd") # GPACDemuxMP4Simple target set(EXE_GPACDEMUXMP4SIMPLE_SRCS @@ -419,7 +419,7 @@ target_link_libraries(GPACDemuxMP4Simple gpac::gpac ) -signals_install_plugin(GPACDemuxMP4Simple) +signals_install_plugin(GPACDemuxMP4Simple ".smd") # GPACDemuxMP4Full target set(EXE_GPACDEMUXMP4FULL_SRCS @@ -443,7 +443,7 @@ target_link_libraries(GPACDemuxMP4Full ${FFMPEG_LIBRARIES} ) -signals_install_plugin(GPACDemuxMP4Full) +signals_install_plugin(GPACDemuxMP4Full ".smd") # FileSystemSink target set(EXE_FILESYSTEMSINK_SRCS @@ -465,7 +465,7 @@ target_link_libraries(FileSystemSink utils ) -signals_install_plugin(FileSystemSink) +signals_install_plugin(FileSystemSink ".smd") # LogoOverlay target set(EXE_LOGOOVERLAY_SRCS @@ -488,7 +488,7 @@ target_link_libraries(LogoOverlay utils ) -signals_install_plugin(LogoOverlay) +signals_install_plugin(LogoOverlay ".smd") # HTTPSink target set(EXE_HTTPSINK_SRCS @@ -510,4 +510,4 @@ target_link_libraries(HttpSink utils ) -signals_install_plugin(HttpSink) +signals_install_plugin(HttpSink ".smd") diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index c0b0462f7..1530b74a0 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -28,5 +28,5 @@ target_link_libraries(MPEG_DASH PRIVATE media modules pipeline appcommon utils ) -signals_install_plugin(MPEG_DASH) +signals_install_plugin(MPEG_DASH ".smd") diff --git a/src/plugins/Fmp4Splitter/CMakeLists.txt b/src/plugins/Fmp4Splitter/CMakeLists.txt index e60f46334..d229015b5 100644 --- a/src/plugins/Fmp4Splitter/CMakeLists.txt +++ b/src/plugins/Fmp4Splitter/CMakeLists.txt @@ -14,4 +14,4 @@ target_include_directories(Fmp4Splitter PUBLIC ${SIGNALS_TOP_SOURCE_DIR}/src ) -signals_install_plugin(Fmp4Splitter) +signals_install_plugin(Fmp4Splitter ".smd") diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index faa927647..9365e6c10 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -27,4 +27,4 @@ target_link_libraries(HlsDemuxer PRIVATE media modules pipeline appcommon utils CURL::libcurl ) -signals_install_plugin(HlsDemuxer) +signals_install_plugin(HlsDemuxer ".smd") diff --git a/src/plugins/MulticastInput/CMakeLists.txt b/src/plugins/MulticastInput/CMakeLists.txt index 04f9d8d72..aea6ad6d5 100644 --- a/src/plugins/MulticastInput/CMakeLists.txt +++ b/src/plugins/MulticastInput/CMakeLists.txt @@ -39,4 +39,4 @@ target_include_directories(MulticastInput PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) -signals_install_plugin(MulticastInput) +signals_install_plugin(MulticastInput ".smd") diff --git a/src/plugins/SdlRender/CMakeLists.txt b/src/plugins/SdlRender/CMakeLists.txt index cc9639f8b..2b51d0c47 100644 --- a/src/plugins/SdlRender/CMakeLists.txt +++ b/src/plugins/SdlRender/CMakeLists.txt @@ -22,7 +22,7 @@ target_include_directories(SDLVideo PUBLIC ${SDL2_INCLUDE_DIRS} ) -signals_install_plugin(SDLVideo) +signals_install_plugin(SDLVideo ".smd") # Define the SDLAudio plugin set(SDLAudio_src @@ -39,4 +39,4 @@ target_link_libraries(SDLAudio SDL2::SDL2 # Link SDL2 ) -signals_install_plugin(SDLAudio) +signals_install_plugin(SDLAudio ".smd") diff --git a/src/plugins/Telx2Ttml/CMakeLists.txt b/src/plugins/Telx2Ttml/CMakeLists.txt index d43ed79df..e6193c4da 100644 --- a/src/plugins/Telx2Ttml/CMakeLists.txt +++ b/src/plugins/Telx2Ttml/CMakeLists.txt @@ -18,4 +18,4 @@ target_include_directories(TeletextToTTML ${FFMPEG_INCLUDE_DIRS} ) -signals_install_plugin(TeletextToTTML) +signals_install_plugin(TeletextToTTML ".smd") diff --git a/src/plugins/TsDemuxer/CMakeLists.txt b/src/plugins/TsDemuxer/CMakeLists.txt index ff45ad5bc..7c36da451 100644 --- a/src/plugins/TsDemuxer/CMakeLists.txt +++ b/src/plugins/TsDemuxer/CMakeLists.txt @@ -14,4 +14,4 @@ target_include_directories(TsDemuxer PUBLIC ${SIGNALS_TOP_SOURCE_DIR}/src ) -signals_install_plugin(TsDemuxer) +signals_install_plugin(TsDemuxer ".smd") diff --git a/src/plugins/TsMuxer/CMakeLists.txt b/src/plugins/TsMuxer/CMakeLists.txt index b1d738001..1969166a2 100644 --- a/src/plugins/TsMuxer/CMakeLists.txt +++ b/src/plugins/TsMuxer/CMakeLists.txt @@ -16,4 +16,4 @@ target_include_directories(TsMuxer PUBLIC ${SIGNALS_TOP_SOURCE_DIR}/src ) -signals_install_plugin(TsMuxer) +signals_install_plugin(TsMuxer ".smd") diff --git a/src/plugins/UdpOutput/CMakeLists.txt b/src/plugins/UdpOutput/CMakeLists.txt index 53939319c..5865fba9a 100644 --- a/src/plugins/UdpOutput/CMakeLists.txt +++ b/src/plugins/UdpOutput/CMakeLists.txt @@ -39,4 +39,4 @@ target_include_directories(UdpOutput PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) -signals_install_plugin(UdpOutput) +signals_install_plugin(UdpOutput ".smd") From 68aa68473940c2911d7e6bbc553b4fcdd40c2f41 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 21 Jan 2025 13:40:36 +0100 Subject: [PATCH 133/182] Squashed warnings found by doing a development build on mac. --- src/lib_media/common/expand_vars.cpp | 1 + src/lib_media/common/xml.cpp | 1 + src/lib_media/demux/libav_demux.cpp | 2 +- src/lib_media/transform/audio_convert.cpp | 3 +-- src/lib_media/unittests/rectifier.cpp | 2 +- src/plugins/TsDemuxer/pes_stream.hpp | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib_media/common/expand_vars.cpp b/src/lib_media/common/expand_vars.cpp index 5186babd6..d2bdf85c1 100644 --- a/src/lib_media/common/expand_vars.cpp +++ b/src/lib_media/common/expand_vars.cpp @@ -23,6 +23,7 @@ string expandVars(string input, map const& values) { auto parseVarName = [&]() -> string { auto leadingDollar = pop(); + (void)leadingDollar; assert(leadingDollar == '$'); string name; diff --git a/src/lib_media/common/xml.cpp b/src/lib_media/common/xml.cpp index 49c0ff881..2b1edd015 100644 --- a/src/lib_media/common/xml.cpp +++ b/src/lib_media/common/xml.cpp @@ -112,6 +112,7 @@ std::string serializeXml(Tag const& tag, bool prettify) { va_list args; va_start(args, format); int n = vsnprintf(buffer, sizeof buffer, format, args); + (void)n; assert(n < int(sizeof buffer)); va_end(args); diff --git a/src/lib_media/demux/libav_demux.cpp b/src/lib_media/demux/libav_demux.cpp index 6b1c0c572..ac550b8db 100644 --- a/src/lib_media/demux/libav_demux.cpp +++ b/src/lib_media/demux/libav_demux.cpp @@ -128,9 +128,9 @@ struct LibavDemux : Module { } for (unsigned i = 0; inb_streams; i++) { +#ifdef xxxjack_removed auto const st = m_formatCtx->streams[i]; auto const parser = av_stream_get_parser(st); -#ifdef xxxjack_removed //xxxjack I don't know how to fix this code. if (parser) { st->codec->ticks_per_frame = parser->repeat_pict + 1; diff --git a/src/lib_media/transform/audio_convert.cpp b/src/lib_media/transform/audio_convert.cpp index 49bdf16f2..231244593 100644 --- a/src/lib_media/transform/audio_convert.cpp +++ b/src/lib_media/transform/audio_convert.cpp @@ -210,8 +210,7 @@ struct AudioConvert : ModuleS { void configure(const PcmFormat &srcFormat) { AVSampleFormat avSrcFmt, avDstFmt; - uint64_t avSrcChannelLayout, avDstChannelLayout; - int avSrcNumChannels, avDstNumChannels, avSrcSampleRate, avDstSampleRate; + int avSrcSampleRate, avDstSampleRate; AVChannelLayout srcLayout; AVChannelLayout dstLayout; libavAudioCtxConvertLibav(&srcFormat, avSrcSampleRate, avSrcFmt, &srcLayout); diff --git a/src/lib_media/unittests/rectifier.cpp b/src/lib_media/unittests/rectifier.cpp index 006b3818a..53938dec7 100644 --- a/src/lib_media/unittests/rectifier.cpp +++ b/src/lib_media/unittests/rectifier.cpp @@ -136,7 +136,7 @@ struct Fixture { } void addStream(int i, std::unique_ptr&& generator) { - generators.push_back(move(generator)); + generators.push_back(std::move(generator)); ConnectModules(generators[i].get(), 0, rectifier.get(), i); ConnectOutput(rectifier->getOutput(i), [i, this](Data data) { diff --git a/src/plugins/TsDemuxer/pes_stream.hpp b/src/plugins/TsDemuxer/pes_stream.hpp index 6ae00ba20..c39226209 100644 --- a/src/plugins/TsDemuxer/pes_stream.hpp +++ b/src/plugins/TsDemuxer/pes_stream.hpp @@ -74,7 +74,7 @@ struct PesStream : Stream { } void flush() override { - auto pesBuffer = move(m_pesBuffer); + auto pesBuffer = std::move(m_pesBuffer); if(pesBuffer.empty()) return; // nothing to flush From 0f8feef4ff08b19c832a2b88a0ef82f098df01aa Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 23 Jan 2025 20:14:52 +0700 Subject: [PATCH 134/182] add initialization --- src/lib_utils/queue.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_utils/queue.hpp b/src/lib_utils/queue.hpp index d47558aac..6c1620f89 100644 --- a/src/lib_utils/queue.hpp +++ b/src/lib_utils/queue.hpp @@ -27,7 +27,7 @@ class Queue { std::unique_lock lock(mutex); while (dataQueue.empty()) dataAvailable.wait(lock); - T p; + T p = T(); // Initialize p std::swap(p, dataQueue.front()); dataQueue.pop(); return p; From cc14915e054c3971e418af7704782362d03f2e3d Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Fri, 24 Jan 2025 18:19:32 +0700 Subject: [PATCH 135/182] adding vcpkg submodule --- .gitmodules | 3 +++ CMakePresets.json | 2 +- vcpkg | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 160000 vcpkg diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..a0a57f3d7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vcpkg"] + path = vcpkg + url = https://github.com/microsoft/vcpkg.git diff --git a/CMakePresets.json b/CMakePresets.json index e8122fbb7..24781dc3f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -29,7 +29,7 @@ "description" : "Build with vcpkg to install required dependencies", "binaryDir": "${sourceDir}/build", "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake" }, "hidden": true }, diff --git a/vcpkg b/vcpkg new file mode 160000 index 000000000..fc5118086 --- /dev/null +++ b/vcpkg @@ -0,0 +1 @@ +Subproject commit fc5118086f5db341ee4ab3a7d4d64c0f39896270 From 19837fd18fd837324c948eafd73781dc567893e9 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Tue, 28 Jan 2025 21:44:06 +0700 Subject: [PATCH 136/182] adding docker image for linux-production build --- docker/Dockerfile-linux-production | 68 ++++++++++++++++++++++++++++ docker/install_cmake.sh | 72 ++++++++++++++++++++++++++++++ docker/version_cmake.env | 7 +++ 3 files changed, 147 insertions(+) create mode 100644 docker/Dockerfile-linux-production create mode 100644 docker/install_cmake.sh create mode 100644 docker/version_cmake.env diff --git a/docker/Dockerfile-linux-production b/docker/Dockerfile-linux-production new file mode 100644 index 000000000..d7b14a69e --- /dev/null +++ b/docker/Dockerfile-linux-production @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 + +# Set environment variables +ENV DEBIAN_FRONTEND=noninteractive +ENV SIGNALS_REPO=https://github.com/MotionSpell/signals.git +ENV BUILD_DIR=/signals + +# Install dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + tzdata \ + zip \ + unzip \ + curl \ + tar \ + git \ + ca-certificates \ + linux-libc-dev \ + build-essential \ + pkg-config \ + yasm \ + nasm \ + autoconf \ + automake \ + autoconf-archive \ + autotools-dev \ + python3 \ + python3-jinja2 \ + gcc \ + g++ \ + make && \ + rm -Rf /var/lib/apt/lists/* + +# Set environment variables for cmake and ninja +ENV CMAKE_ROOT=/opt/cmake +ENV NINJA_ROOT=/opt/ninja + +ENV PATH=${NINJA_ROOT}:${CMAKE_ROOT}/bin:${PATH} + +# Copy version and install scripts +COPY version_cmake.env install_cmake.sh /opt/ + +# Download, build and install tools +RUN cd /opt && \ + chmod a+x install_cmake.sh && \ + ./install_cmake.sh ${NINJA_ROOT} ${CMAKE_ROOT} && \ + rm install_cmake.sh && rm version_cmake.env + +# Clone the Signals repository +RUN git clone --recurse-submodules -b vcpkg-cmake ${SIGNALS_REPO} ${BUILD_DIR} + +# Set working directory +WORKDIR ${BUILD_DIR} + +# Update submodules +RUN git submodule update --remote vcpkg + +# fix for libcrypto build +RUN apt-get update && \ + apt-get install -y libtool && \ + libtoolize --copy --force + +# Configure and build the project +RUN cmake --preset linux-production +RUN cmake --build build --preset linux-production + +# Set the entry point +ENTRYPOINT ["/bin/bash"] diff --git a/docker/install_cmake.sh b/docker/install_cmake.sh new file mode 100644 index 000000000..256b19fa4 --- /dev/null +++ b/docker/install_cmake.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +NINJA_ROOT=$1 +CMAKE_ROOT=$2 + +# Get version numbers +. $(dirname $0)/version_cmake.env + +# Detect architecture +ARCH=$(uname -m) +if [ "$ARCH" = "x86_64" ]; then + CMAKE_ARCH="Linux-x86_64" +elif [ "$ARCH" = "aarch64" ]; then + CMAKE_ARCH="Linux-aarch64" +else + echo "Unsupported architecture: $ARCH" + exit 1 +fi + +# Define download links +NINJA_URI=https://github.com/ninja-build/ninja/archive/refs/tags/${NINJA_VERSION}.tar.gz +CMAKE_URI=https://github.com/Kitware/CMake/releases/download/${CMAKE_VERSION}/cmake-${CMAKE_VERSION##v}-${CMAKE_ARCH}.sh + +download () { + uri=$1 + tmp_file=$(basename $uri) + + if [ -z "$uri" ]; then + echo "install_cmake.sh: download(): error: no uri provided" + exit 1 + fi + + curl -SL $uri --output $tmp_file + if [ $? -ne 0 ]; then + echo "install_cmake.sh: download(): error: download failed ($uri)" + exit 1 + fi + + uri_extension="${tmp_file##*.}" + if [ "$uri_extension" = "gz" ]; then + tar -xf $tmp_file + if [ $? -ne 0 ]; then + echo "install_cmake.sh: download(): error: failed to unpack ($uri)" + exit 1 + fi + + rm $tmp_file + fi +} + +# Download and build cmake +if [ "${CMAKE_ROOT}" != "" ]; then + download ${CMAKE_URI} + mv cmake*.sh cmake-install.sh + chmod u+x cmake-install.sh + mkdir ${CMAKE_ROOT} + ./cmake-install.sh --skip-license --prefix=${CMAKE_ROOT} +fi + +# Download and build ninja +download ${NINJA_URI} +mv ninja* ninja-source +cmake -Hninja-source -Bninja-source/build +cmake --build ninja-source/build +mkdir ${NINJA_ROOT} +mv ninja-source/build/ninja ${NINJA_ROOT} + +# Clean up +rm -Rf ninja-source +if [ "${CMAKE_ROOT}" != "" ]; then + rm -Rf cmake-install.sh +fi \ No newline at end of file diff --git a/docker/version_cmake.env b/docker/version_cmake.env new file mode 100644 index 000000000..edfb3a224 --- /dev/null +++ b/docker/version_cmake.env @@ -0,0 +1,7 @@ +# Find new versions here: https://github.com/ninja-build/ninja/releases +# renovate: datasource=github-releases depName=ninja-build/ninja versioning=loose +NINJA_VERSION=v1.12.1 + +# Find new cmake versions here: https://github.com/Kitware/CMake/releases +# renovate: datasource=github-releases depName=Kitware/CMake versioning=regex:^v(?\d+)(\.(?\d+))?(\.(?\d+))?(-(?.*))?$ +CMAKE_VERSION=v3.31.5 From edb0225954041897a6cd15f692bf9e07c9b64721 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Tue, 28 Jan 2025 22:23:17 +0700 Subject: [PATCH 137/182] add docker file for linux develop (Debug) --- docker/Dockerfile-linux-develop | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 docker/Dockerfile-linux-develop diff --git a/docker/Dockerfile-linux-develop b/docker/Dockerfile-linux-develop new file mode 100644 index 000000000..8ba93728f --- /dev/null +++ b/docker/Dockerfile-linux-develop @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 + +# Set environment variables +ENV DEBIAN_FRONTEND=noninteractive +ENV SIGNALS_REPO=https://github.com/MotionSpell/signals.git +ENV BUILD_DIR=/signals + +# Install dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + tzdata \ + zip \ + unzip \ + curl \ + tar \ + git \ + ca-certificates \ + linux-libc-dev \ + build-essential \ + pkg-config \ + yasm \ + nasm \ + autoconf \ + automake \ + autoconf-archive \ + autotools-dev \ + python3 \ + python3-jinja2 \ + gcc \ + g++ \ + make && \ + rm -Rf /var/lib/apt/lists/* + +# Set environment variables for cmake and ninja +ENV CMAKE_ROOT=/opt/cmake +ENV NINJA_ROOT=/opt/ninja + +ENV PATH=${NINJA_ROOT}:${CMAKE_ROOT}/bin:${PATH} + +# Copy version and install scripts +COPY version_cmake.env install_cmake.sh /opt/ + +# Download, build and install tools +RUN cd /opt && \ + chmod a+x install_cmake.sh && \ + ./install_cmake.sh ${NINJA_ROOT} ${CMAKE_ROOT} && \ + rm install_cmake.sh && rm version_cmake.env + +# Clone the Signals repository +RUN git clone --recurse-submodules -b vcpkg-cmake ${SIGNALS_REPO} ${BUILD_DIR} + +# Set working directory +WORKDIR ${BUILD_DIR} + +# Update submodules +RUN git submodule update --remote vcpkg + +# fix for libcrypto build +RUN apt-get update && \ + apt-get install -y libtool && \ + libtoolize --copy --force + +# Configure and build the project +RUN cmake --preset linux-develop +RUN cmake --build build --preset linux-develop + +# Set the entry point +ENTRYPOINT ["/bin/bash"] From 9f29400de9e02946089fa614cbe3dff34164e379 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 15:53:43 +0700 Subject: [PATCH 138/182] Add GitHub Actions workflow for Linux build --- .github/workflows/linux-build.yml | 88 +++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/linux-build.yml diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 000000000..2c065959d --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -0,0 +1,88 @@ +name: Linux Build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up environment variables + run: | + echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" >> $GITHUB_ENV + echo "BUILD_DIR=/signals" >> $GITHUB_ENV + + - name: Install dependencies + run: | + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends \ + tzdata \ + zip \ + unzip \ + curl \ + tar \ + git \ + ca-certificates \ + linux-libc-dev \ + build-essential \ + pkg-config \ + yasm \ + nasm \ + autoconf \ + automake \ + autoconf-archive \ + autotools-dev \ + python3 \ + python3-jinja2 \ + gcc \ + g++ \ + make \ + libtool + + - name: Install CMake and Ninja + run: | + curl -L https://github.com/Kitware/CMake/releases/download/v3.31.5/cmake-3.31.5-linux-x86_64.sh -o cmake-install.sh + chmod +x cmake-install.sh + sudo ./cmake-install.sh --skip-license --prefix=/usr/local + curl -L https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip -o ninja-linux.zip + unzip ninja-linux.zip -d /usr/local/bin + rm cmake-install.sh ninja-linux.zip + + - name: Clone the Signals repository + run: | + git clone --recurse-submodules -b vcpkg-cmake ${{ env.SIGNALS_REPO }} ${{ env.BUILD_DIR }} + + - name: Update submodules + run: | + cd ${{ env.BUILD_DIR }} && \ + git submodule update --remote vcpkg + + - name: Fix for libcrypto build + run: | + sudo apt-get update && \ + sudo apt-get install -y libtool && \ + libtoolize --copy --force + + - name: Configure CMake + run: | + cd ${{ env.BUILD_DIR }} && \ + cmake --preset linux-production + + - name: Build the project + run: | + cd ${{ env.BUILD_DIR }} && \ + cmake --build build --preset linux-production + + - name: Run tests + run: | + cd ${{ env.BUILD_DIR }} && \ + ctest --output-on-failure \ No newline at end of file From fa05bef62b23ee0968f3a8b2dd94761ad183367f Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:01:19 +0700 Subject: [PATCH 139/182] correct path to cmake-installer-script --- .github/workflows/linux-build.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 2c065959d..1f51c7b20 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -3,10 +3,10 @@ name: Linux Build on: push: branches: - - main + - vcpkg-cmake pull_request: branches: - - main + - vcpkg-cmake jobs: build: @@ -50,12 +50,8 @@ jobs: - name: Install CMake and Ninja run: | - curl -L https://github.com/Kitware/CMake/releases/download/v3.31.5/cmake-3.31.5-linux-x86_64.sh -o cmake-install.sh - chmod +x cmake-install.sh - sudo ./cmake-install.sh --skip-license --prefix=/usr/local - curl -L https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip -o ninja-linux.zip - unzip ninja-linux.zip -d /usr/local/bin - rm cmake-install.sh ninja-linux.zip + chmod +x ./docker/install_cmake.sh && \ + ./docker/install_cmake.sh /opt/ninja /opt/cmake - name: Clone the Signals repository run: | From 3bc4fd0b71cb54eaf59442b7fda2a85f719d110e Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:06:13 +0700 Subject: [PATCH 140/182] Adding github actions workflow for windows --- .github/workflows/windows-build.yml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/windows-build.yml diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 000000000..65b2d6126 --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -0,0 +1,57 @@ +name: Windows Build + +on: + push: + branches: + - vcpkg-cmake + pull_request: + branches: + - vcpkg-cmake + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up environment variables + run: | + echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" >> $env:GITHUB_ENV + echo "BUILD_DIR=C:/signals" >> $env:GITHUB_ENV + + - name: Install MSYS2 + run: | + Invoke-WebRequest -Uri https://github.com/msys2/msys2-installer/releases/download/20210725/msys2-x86_64-20210725.exe -OutFile msys2-installer.exe + Start-Process msys2-installer.exe -ArgumentList '/S' -Wait + Remove-Item msys2-installer.exe -Force + + - name: Update MSYS2 and install dependencies + run: | + C:\msys64\usr\bin\bash.exe -l -c "pacman -Syu --noconfirm" + C:\msys64\usr\bin\bash.exe -l -c "pacman -S --noconfirm mingw-w64-x86_64-toolchain make git cmake" + + - name: Set environment variables for MSYS2 + run: | + echo "C:\msys64\mingw64\bin" >> $env:PATH + + - name: Clone the Signals repository + run: | + C:\msys64\usr\bin\bash.exe -l -c "git clone --recurse-submodules -b vcpkg-cmake $env:SIGNALS_REPO $env:BUILD_DIR" + + - name: Update submodules + run: | + C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && git submodule update --remote vcpkg" + + - name: Configure CMake + run: | + C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && cmake --preset mingw-production" + + - name: Build the project + run: | + C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && cmake --build build --preset mingw-production" + + - name: Run tests + run: | + C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && ctest --output-on-failure" \ No newline at end of file From e330c78f5bc9859db7d6b2f6188eba9c2a27504e Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:09:43 +0700 Subject: [PATCH 141/182] use github.workspace --- .github/workflows/linux-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 1f51c7b20..958f55f0f 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -19,7 +19,7 @@ jobs: - name: Set up environment variables run: | echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" >> $GITHUB_ENV - echo "BUILD_DIR=/signals" >> $GITHUB_ENV + echo "BUILD_DIR=${{ github.workspace }}" >> $GITHUB_ENV - name: Install dependencies run: | From 6de4457870b36de611c37643999d9b713297c68f Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:15:03 +0700 Subject: [PATCH 142/182] adding build env variables --- .github/workflows/linux-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 958f55f0f..769b656b6 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -53,10 +53,6 @@ jobs: chmod +x ./docker/install_cmake.sh && \ ./docker/install_cmake.sh /opt/ninja /opt/cmake - - name: Clone the Signals repository - run: | - git clone --recurse-submodules -b vcpkg-cmake ${{ env.SIGNALS_REPO }} ${{ env.BUILD_DIR }} - - name: Update submodules run: | cd ${{ env.BUILD_DIR }} && \ From 1aa5c86bf75cda77e71f78c2525f9c643e9631d1 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:22:20 +0700 Subject: [PATCH 143/182] adding vcpkg initialization --- .github/workflows/linux-build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 769b656b6..ab184c59a 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -53,10 +53,13 @@ jobs: chmod +x ./docker/install_cmake.sh && \ ./docker/install_cmake.sh /opt/ninja /opt/cmake - - name: Update submodules + - name: Initialize vcpkg submodule run: | - cd ${{ env.BUILD_DIR }} && \ - git submodule update --remote vcpkg + git submodule update --init --recursive + + - name: Bootstrap vcpkg + run: | + ./vcpkg/bootstrap-vcpkg.sh - name: Fix for libcrypto build run: | From c5add05bf535a7984e896563aa6b5d8f8813a1d4 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:29:25 +0700 Subject: [PATCH 144/182] adding vcpkg initialization for windows --- .github/workflows/windows-build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 65b2d6126..e2aa32589 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -36,6 +36,14 @@ jobs: run: | echo "C:\msys64\mingw64\bin" >> $env:PATH + - name: Initialize vcpkg submodule + run: | + C:\msys64\usr\bin\bash.exe -l -c "git submodule update --init --recursive" + + - name: Bootstrap vcpkg + run: | + C:\msys64\usr\bin\bash.exe -l -c "./vcpkg/bootstrap-vcpkg.sh" + - name: Clone the Signals repository run: | C:\msys64\usr\bin\bash.exe -l -c "git clone --recurse-submodules -b vcpkg-cmake $env:SIGNALS_REPO $env:BUILD_DIR" From 8ee381686661619fec6cfddd3506e76217fc0034 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:35:07 +0700 Subject: [PATCH 145/182] adding vcpkg initialization for windows --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index e2aa32589..a9e6b9730 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -23,7 +23,7 @@ jobs: - name: Install MSYS2 run: | - Invoke-WebRequest -Uri https://github.com/msys2/msys2-installer/releases/download/20210725/msys2-x86_64-20210725.exe -OutFile msys2-installer.exe + Invoke-WebRequest -Uri https://github.com/msys2/msys2-installer/releases/download/2024-12-08/msys2-x86_64-20241208.exe -OutFile msys2-installer.exe Start-Process msys2-installer.exe -ArgumentList '/S' -Wait Remove-Item msys2-installer.exe -Force From dc6b0c57742964f16c339873e52de92171d924da Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:42:45 +0700 Subject: [PATCH 146/182] adding libtool --- .github/workflows/linux-build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index ab184c59a..be690d53a 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -46,7 +46,8 @@ jobs: gcc \ g++ \ make \ - libtool + libtool \ + libtool-bin - name: Install CMake and Ninja run: | @@ -70,12 +71,12 @@ jobs: - name: Configure CMake run: | cd ${{ env.BUILD_DIR }} && \ - cmake --preset linux-production + cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${{ env.BUILD_DIR }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.BUILD_DIR }}/installed -DVCPKG_TARGET_TRIPLET=x64-linux-dynamic . - name: Build the project run: | cd ${{ env.BUILD_DIR }} && \ - cmake --build build --preset linux-production + cmake --build build --config Release - name: Run tests run: | From 44a6116012044fe58a03422933ceaf216f4ed7ce Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 16:50:16 +0700 Subject: [PATCH 147/182] remove libtool before reinstalling it --- .github/workflows/linux-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index be690d53a..e5f069d5b 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -65,8 +65,9 @@ jobs: - name: Fix for libcrypto build run: | sudo apt-get update && \ - sudo apt-get install -y libtool && \ - libtoolize --copy --force + sudo apt-get autoremove -y libtool && \ + sudo apt-get install -y libtool && \ + libtoolize --copy --force - name: Configure CMake run: | From 803061468a1b6e065cf00b65b3a7d55e8feb2801 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 17:10:44 +0700 Subject: [PATCH 148/182] adding more debug info to windows-build.yml --- .github/workflows/windows-build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index a9e6b9730..71df10eb0 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -20,17 +20,26 @@ jobs: run: | echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" >> $env:GITHUB_ENV echo "BUILD_DIR=C:/signals" >> $env:GITHUB_ENV + echo "ACTIONS_RUNNER_DEBUG=true" >> $env:GITHUB_ENV + echo "ACTIONS_STEP_DEBUG=true" >> $env:GITHUB_ENV - - name: Install MSYS2 + - name: Download MSYS2 installer run: | + Write-Host "Downloading MSYS2 installer..." Invoke-WebRequest -Uri https://github.com/msys2/msys2-installer/releases/download/2024-12-08/msys2-x86_64-20241208.exe -OutFile msys2-installer.exe - Start-Process msys2-installer.exe -ArgumentList '/S' -Wait + + - name: Install MSYS2 + run: | + Write-Host "Starting MSYS2 installation..." + $process = Start-Process msys2-installer.exe -ArgumentList '/S' -PassThru -Wait + Write-Host "MSYS2 installation completed with exit code: $($process.ExitCode)" Remove-Item msys2-installer.exe -Force - name: Update MSYS2 and install dependencies run: | - C:\msys64\usr\bin\bash.exe -l -c "pacman -Syu --noconfirm" - C:\msys64\usr\bin\bash.exe -l -c "pacman -S --noconfirm mingw-w64-x86_64-toolchain make git cmake" + C:\msys64\usr\bin\bash.exe -l -c "echo -e '[options]\nCheckSpace\nSigLevel = Never\nServer = http://mirror.msys2.org/msys/\$repo/\$arch' > /etc/pacman.d/mirrorlist" + C:\msys64\usr\bin\bash.exe -l -c "pacman -Syu --noconfirm --verbose" + C:\msys64\usr\bin\bash.exe -l -c "pacman -S --noconfirm --verbose mingw-w64-x86_64-toolchain make git cmake" - name: Set environment variables for MSYS2 run: | From 0ec088eff0d5f8ea23d2e3046dd1e56646332397 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 17:13:38 +0700 Subject: [PATCH 149/182] use only preset with linux build --- .github/workflows/linux-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index e5f069d5b..dc2e960a3 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -72,12 +72,12 @@ jobs: - name: Configure CMake run: | cd ${{ env.BUILD_DIR }} && \ - cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${{ env.BUILD_DIR }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.BUILD_DIR }}/installed -DVCPKG_TARGET_TRIPLET=x64-linux-dynamic . + cmake --preset linux-production - name: Build the project run: | cd ${{ env.BUILD_DIR }} && \ - cmake --build build --config Release + cmake --build build --preset linux-production - name: Run tests run: | From a21f1c10ebf2565a3cc76ae5272c77fc06bb9a76 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 17:24:31 +0700 Subject: [PATCH 150/182] use msys2 setup --- .github/workflows/windows-build.yml | 47 ++++++++++------------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 71df10eb0..84fe9d06a 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -23,52 +23,37 @@ jobs: echo "ACTIONS_RUNNER_DEBUG=true" >> $env:GITHUB_ENV echo "ACTIONS_STEP_DEBUG=true" >> $env:GITHUB_ENV - - name: Download MSYS2 installer - run: | - Write-Host "Downloading MSYS2 installer..." - Invoke-WebRequest -Uri https://github.com/msys2/msys2-installer/releases/download/2024-12-08/msys2-x86_64-20241208.exe -OutFile msys2-installer.exe - - - name: Install MSYS2 - run: | - Write-Host "Starting MSYS2 installation..." - $process = Start-Process msys2-installer.exe -ArgumentList '/S' -PassThru -Wait - Write-Host "MSYS2 installation completed with exit code: $($process.ExitCode)" - Remove-Item msys2-installer.exe -Force - - - name: Update MSYS2 and install dependencies - run: | - C:\msys64\usr\bin\bash.exe -l -c "echo -e '[options]\nCheckSpace\nSigLevel = Never\nServer = http://mirror.msys2.org/msys/\$repo/\$arch' > /etc/pacman.d/mirrorlist" - C:\msys64\usr\bin\bash.exe -l -c "pacman -Syu --noconfirm --verbose" - C:\msys64\usr\bin\bash.exe -l -c "pacman -S --noconfirm --verbose mingw-w64-x86_64-toolchain make git cmake" + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + mingw-w64-x86_64-toolchain + make + git + cmake - name: Set environment variables for MSYS2 run: | echo "C:\msys64\mingw64\bin" >> $env:PATH - name: Initialize vcpkg submodule - run: | - C:\msys64\usr\bin\bash.exe -l -c "git submodule update --init --recursive" + run: msys2 -c "git submodule update --init --recursive" - name: Bootstrap vcpkg - run: | - C:\msys64\usr\bin\bash.exe -l -c "./vcpkg/bootstrap-vcpkg.sh" + run: msys2 -c "./vcpkg/bootstrap-vcpkg.sh" - name: Clone the Signals repository - run: | - C:\msys64\usr\bin\bash.exe -l -c "git clone --recurse-submodules -b vcpkg-cmake $env:SIGNALS_REPO $env:BUILD_DIR" + run: msys2 -c "git clone --recurse-submodules -b vcpkg-cmake $env:SIGNALS_REPO $env:BUILD_DIR" - name: Update submodules - run: | - C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && git submodule update --remote vcpkg" + run: msys2 -c "cd $env:BUILD_DIR && git submodule update --remote vcpkg" - name: Configure CMake - run: | - C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && cmake --preset mingw-production" + run: msys2 -c "cd $env:BUILD_DIR && cmake --preset mingw-production" - name: Build the project - run: | - C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && cmake --build build --preset mingw-production" + run: msys2 -c "cd $env:BUILD_DIR && cmake --build build --preset mingw-production" - name: Run tests - run: | - C:\msys64\usr\bin\bash.exe -l -c "cd $env:BUILD_DIR && ctest --output-on-failure" \ No newline at end of file + run: msys2 -c "cd $env:BUILD_DIR && ctest --output-on-failure" \ No newline at end of file From 17aa8a851d24c59da39ff920a4045b260dbe8bf0 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 17:29:10 +0700 Subject: [PATCH 151/182] fix path syntax for windows --- .github/workflows/windows-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 84fe9d06a..7a690efcf 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -35,7 +35,8 @@ jobs: - name: Set environment variables for MSYS2 run: | - echo "C:\msys64\mingw64\bin" >> $env:PATH + $env:PATH = "C:\msys64\mingw64\bin;$env:PATH" + echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Initialize vcpkg submodule run: msys2 -c "git submodule update --init --recursive" From 034473ab7d145e12e2c7333e85a2050ce0d7ed1e Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 17:38:00 +0700 Subject: [PATCH 152/182] update paths for windows --- .github/workflows/windows-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 7a690efcf..8fe155790 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -18,10 +18,10 @@ jobs: - name: Set up environment variables run: | - echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" >> $env:GITHUB_ENV - echo "BUILD_DIR=C:/signals" >> $env:GITHUB_ENV - echo "ACTIONS_RUNNER_DEBUG=true" >> $env:GITHUB_ENV - echo "ACTIONS_STEP_DEBUG=true" >> $env:GITHUB_ENV + echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "BUILD_DIR=C:/signals" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "ACTIONS_RUNNER_DEBUG=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "ACTIONS_STEP_DEBUG=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Setup MSYS2 uses: msys2/setup-msys2@v2 From b5e0e7a0f2230da78c6f4759824f6f55d816409d Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 17:51:40 +0700 Subject: [PATCH 153/182] update windows yml --- .github/workflows/windows-build.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 8fe155790..827cbcac6 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -32,29 +32,39 @@ jobs: make git cmake + ninja + unzip - name: Set environment variables for MSYS2 run: | - $env:PATH = "C:\msys64\mingw64\bin;$env:PATH" - echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "MSYSTEM=MINGW64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Initialize vcpkg submodule - run: msys2 -c "git submodule update --init --recursive" + shell: msys2 { bash -c } + run: git submodule update --init --recursive - name: Bootstrap vcpkg - run: msys2 -c "./vcpkg/bootstrap-vcpkg.sh" + shell: cmd + run: .\vcpkg\bootstrap-vcpkg.bat - name: Clone the Signals repository - run: msys2 -c "git clone --recurse-submodules -b vcpkg-cmake $env:SIGNALS_REPO $env:BUILD_DIR" + shell: msys2 { bash -c } + run: git clone --recurse-submodules -b vcpkg-cmake $SIGNALS_REPO $BUILD_DIR - name: Update submodules - run: msys2 -c "cd $env:BUILD_DIR && git submodule update --remote vcpkg" + shell: msys2 { bash -c } + run: cd $BUILD_DIR && git submodule update --remote vcpkg - name: Configure CMake - run: msys2 -c "cd $env:BUILD_DIR && cmake --preset mingw-production" + shell: msys2 { bash -c } + run: cd $BUILD_DIR && cmake --preset mingw-production - name: Build the project - run: msys2 -c "cd $env:BUILD_DIR && cmake --build build --preset mingw-production" + shell: msys2 { bash -c } + run: cd $BUILD_DIR && cmake --build --preset mingw-production - name: Run tests - run: msys2 -c "cd $env:BUILD_DIR && ctest --output-on-failure" \ No newline at end of file + shell: msys2 { bash -c } + run: cd $BUILD_DIR && ctest --output-on-failure From 1ab5af25a9a90e82ffcc733095a76f605a388e25 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 18:01:31 +0700 Subject: [PATCH 154/182] update win yml --- .github/workflows/windows-build.yml | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 827cbcac6..74859b7bc 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -15,13 +15,15 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + submodules: true - name: Set up environment variables run: | - echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "BUILD_DIR=C:/signals" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "ACTIONS_RUNNER_DEBUG=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "ACTIONS_STEP_DEBUG=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" >> $GITHUB_ENV + echo "BUILD_DIR=C:/signals" >> $GITHUB_ENV + echo "ACTIONS_RUNNER_DEBUG=true" >> $GITHUB_ENV + echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV - name: Setup MSYS2 uses: msys2/setup-msys2@v2 @@ -37,34 +39,35 @@ jobs: - name: Set environment variables for MSYS2 run: | - echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "MSYSTEM=MINGW64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH + echo "C:\msys64\usr\bin" >> $GITHUB_PATH + echo "MSYSTEM=MINGW64" >> $GITHUB_ENV + shell: bash - name: Initialize vcpkg submodule - shell: msys2 { bash -c } run: git submodule update --init --recursive + shell: bash - name: Bootstrap vcpkg + run: vcpkg/bootstrap-vcpkg.bat shell: cmd - run: .\vcpkg\bootstrap-vcpkg.bat - name: Clone the Signals repository - shell: msys2 { bash -c } run: git clone --recurse-submodules -b vcpkg-cmake $SIGNALS_REPO $BUILD_DIR + shell: bash - name: Update submodules - shell: msys2 { bash -c } run: cd $BUILD_DIR && git submodule update --remote vcpkg + shell: bash - name: Configure CMake - shell: msys2 { bash -c } run: cd $BUILD_DIR && cmake --preset mingw-production + shell: bash - name: Build the project - shell: msys2 { bash -c } run: cd $BUILD_DIR && cmake --build --preset mingw-production + shell: bash - name: Run tests - shell: msys2 { bash -c } run: cd $BUILD_DIR && ctest --output-on-failure + shell: bash From 44839f008552d98be558c23cc9a6e1fd09eebd49 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 18:06:22 +0700 Subject: [PATCH 155/182] remove clone cmd --- .github/workflows/windows-build.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 74859b7bc..9a0719e09 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -20,8 +20,7 @@ jobs: - name: Set up environment variables run: | - echo "SIGNALS_REPO=https://github.com/MotionSpell/signals.git" >> $GITHUB_ENV - echo "BUILD_DIR=C:/signals" >> $GITHUB_ENV + echo "BUILD_DIR=${{ github.workspace }}" >> $GITHUB_ENV echo "ACTIONS_RUNNER_DEBUG=true" >> $GITHUB_ENV echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV @@ -52,22 +51,18 @@ jobs: run: vcpkg/bootstrap-vcpkg.bat shell: cmd - - name: Clone the Signals repository - run: git clone --recurse-submodules -b vcpkg-cmake $SIGNALS_REPO $BUILD_DIR - shell: bash - - name: Update submodules - run: cd $BUILD_DIR && git submodule update --remote vcpkg + run: git submodule update --remote vcpkg shell: bash - name: Configure CMake - run: cd $BUILD_DIR && cmake --preset mingw-production + run: cmake --preset mingw-production shell: bash - name: Build the project - run: cd $BUILD_DIR && cmake --build --preset mingw-production + run: cmake --build --preset mingw-production shell: bash - name: Run tests - run: cd $BUILD_DIR && ctest --output-on-failure + run: ctest --output-on-failure shell: bash From c2a6d2139c69503b2f0cfe97a38f758115c17061 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 24 Jan 2025 12:59:29 +0100 Subject: [PATCH 156/182] GPAC depends on zlib. Overseen until now because it's generally available. --- vcpkg-additions/ports/gpac/vcpkg.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcpkg-additions/ports/gpac/vcpkg.json b/vcpkg-additions/ports/gpac/vcpkg.json index 4ab9e4d33..521f4ab5c 100644 --- a/vcpkg-additions/ports/gpac/vcpkg.json +++ b/vcpkg-additions/ports/gpac/vcpkg.json @@ -20,6 +20,7 @@ "libjpeg-turbo", "freetype", "nghttp2", - "curl" + "curl", + "zlib" ] } \ No newline at end of file From 7cbbebc956b11d4746b09ce624cc8e8456fafe43 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 18:22:43 +0700 Subject: [PATCH 157/182] adding nasm yasm --- .github/workflows/windows-build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 9a0719e09..51aaf5eae 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -35,6 +35,8 @@ jobs: cmake ninja unzip + mingw-w64-x86_64-nasm + mingw-w64-x86_64-yasm - name: Set environment variables for MSYS2 run: | @@ -55,6 +57,10 @@ jobs: run: git submodule update --remote vcpkg shell: bash + - name: Clean previous ffmpeg build (if needed) + run: rm -rf vcpkg/buildtrees/ffmpeg + shell: bash + - name: Configure CMake run: cmake --preset mingw-production shell: bash @@ -66,3 +72,8 @@ jobs: - name: Run tests run: ctest --output-on-failure shell: bash + + - name: Show ffmpeg build logs on failure + if: failure() + run: cat vcpkg/buildtrees/ffmpeg/build-x64-mingw-dynamic-rel-err.log + shell: bash From d2d3addde4ec6f83c6feef219c7630d90d8f2adc Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 19:50:26 +0700 Subject: [PATCH 158/182] remove unnecessary action --- .github/workflows/windows-build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 51aaf5eae..1e6f942bf 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -57,9 +57,6 @@ jobs: run: git submodule update --remote vcpkg shell: bash - - name: Clean previous ffmpeg build (if needed) - run: rm -rf vcpkg/buildtrees/ffmpeg - shell: bash - name: Configure CMake run: cmake --preset mingw-production From d1665b1d4acbb97a56e8e387efdac7c77f70a397 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 20:14:16 +0700 Subject: [PATCH 159/182] add some deps to windows yml --- .github/workflows/windows-build.yml | 69 ++++++++++++++++------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 1e6f942bf..689bf8d6a 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -17,12 +17,13 @@ jobs: uses: actions/checkout@v2 with: submodules: true + fetch-depth: 0 - name: Set up environment variables run: | - echo "BUILD_DIR=${{ github.workspace }}" >> $GITHUB_ENV - echo "ACTIONS_RUNNER_DEBUG=true" >> $GITHUB_ENV - echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV + echo "BUILD_DIR=${{ github.workspace }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "VCPKG_DEFAULT_TRIPLET=x64-mingw-dynamic" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + shell: pwsh - name: Setup MSYS2 uses: msys2/setup-msys2@v2 @@ -30,47 +31,51 @@ jobs: update: true install: >- mingw-w64-x86_64-toolchain - make - git - cmake - ninja - unzip + mingw-w64-x86_64-cmake + mingw-w64-x86_64-ninja + mingw-w64-x86_64-pkg-config mingw-w64-x86_64-nasm mingw-w64-x86_64-yasm + mingw-w64-x86_64-autotools + git + make - - name: Set environment variables for MSYS2 + - name: Set MSYS2 path run: | - echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH - echo "C:\msys64\usr\bin" >> $GITHUB_PATH - echo "MSYSTEM=MINGW64" >> $GITHUB_ENV - shell: bash - - - name: Initialize vcpkg submodule - run: git submodule update --init --recursive - shell: bash + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "MSYSTEM=MINGW64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + shell: pwsh - - name: Bootstrap vcpkg - run: vcpkg/bootstrap-vcpkg.bat + - name: Setup vcpkg + run: | + git submodule update --init --recursive + .\vcpkg\bootstrap-vcpkg.bat shell: cmd - - name: Update submodules - run: git submodule update --remote vcpkg - shell: bash - - - name: Configure CMake - run: cmake --preset mingw-production + run: | + mkdir build + cd build + cmake .. --preset mingw-production -DCMAKE_BUILD_TYPE=Release shell: bash - - name: Build the project - run: cmake --build --preset mingw-production + - name: Build + working-directory: build + run: cmake --build . --config Release shell: bash - - name: Run tests - run: ctest --output-on-failure + - name: Test + working-directory: build + run: ctest -C Release --output-on-failure shell: bash - - name: Show ffmpeg build logs on failure + - name: Upload logs on failure if: failure() - run: cat vcpkg/buildtrees/ffmpeg/build-x64-mingw-dynamic-rel-err.log - shell: bash + uses: actions/upload-artifact@v2 + with: + name: build-logs + path: | + build/CMakeFiles/CMakeOutput.log + build/CMakeFiles/CMakeError.log + vcpkg/buildtrees/**/*.log From 6e5c89d8235353395fa9d9acb2339f2afb16b166 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 20:17:43 +0700 Subject: [PATCH 160/182] update atifacts version --- .github/workflows/windows-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 689bf8d6a..3cc12915e 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 @@ -72,10 +72,11 @@ jobs: - name: Upload logs on failure if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: build-logs path: | build/CMakeFiles/CMakeOutput.log build/CMakeFiles/CMakeError.log vcpkg/buildtrees/**/*.log + retention-days: 5 From cea08bf500fc38324014e14b01adf4ab00260e17 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 20:39:38 +0700 Subject: [PATCH 161/182] add working directiry --- .github/workflows/windows-build.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 3cc12915e..649f927ee 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -21,7 +21,7 @@ jobs: - name: Set up environment variables run: | - echo "BUILD_DIR=${{ github.workspace }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "BUILD_DIR=$env:GITHUB_WORKSPACE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "VCPKG_DEFAULT_TRIPLET=x64-mingw-dynamic" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh @@ -54,19 +54,18 @@ jobs: shell: cmd - name: Configure CMake + working-directory: ${{ env.BUILD_DIR }} run: | - mkdir build - cd build - cmake .. --preset mingw-production -DCMAKE_BUILD_TYPE=Release + cmake .. --preset mingw-production shell: bash - name: Build - working-directory: build - run: cmake --build . --config Release + working-directory: ${{ env.BUILD_DIR }} + run: cmake --build --preset mingw-production shell: bash - name: Test - working-directory: build + working-directory: ${{ env.BUILD_DIR }}/build run: ctest -C Release --output-on-failure shell: bash @@ -76,7 +75,7 @@ jobs: with: name: build-logs path: | - build/CMakeFiles/CMakeOutput.log - build/CMakeFiles/CMakeError.log - vcpkg/buildtrees/**/*.log + ${{ env.BUILD_DIR }}/build/CMakeFiles/CMakeOutput.log + ${{ env.BUILD_DIR }}/build/CMakeFiles/CMakeError.log + ${{ env.BUILD_DIR }}/vcpkg/buildtrees/**/*.log retention-days: 5 From f4ba260ae094bca92c25155bd7c1da4234786e10 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 20:42:52 +0700 Subject: [PATCH 162/182] fix typo --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 649f927ee..14e3e3e6f 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -56,12 +56,12 @@ jobs: - name: Configure CMake working-directory: ${{ env.BUILD_DIR }} run: | - cmake .. --preset mingw-production + cmake --preset mingw-production shell: bash - name: Build working-directory: ${{ env.BUILD_DIR }} - run: cmake --build --preset mingw-production + run: cmake --build build --preset mingw-production shell: bash - name: Test From 9f2c8de3e7698389ed86e44f6d0f02d6e392e7b1 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 21:29:42 +0700 Subject: [PATCH 163/182] add toolchain fule to preset --- CMakePresets.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 24781dc3f..8f7ef1d67 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -134,7 +134,9 @@ "description" : "Build for production on Windows with mingw", "inherits" : "mingw", "cacheVariables" : { - "CMAKE_BUILD_TYPE" : "Release" + "CMAKE_BUILD_TYPE" : "Release", + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", + "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/toolchains/mingw.cmake" } }, { From 8c963d09cecd656206222a0b9ba561f794677a8d Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 22:27:36 +0700 Subject: [PATCH 164/182] adding mingw64 verison to setup-msys2 --- .github/workflows/windows-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 14e3e3e6f..5e0827269 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -37,8 +37,11 @@ jobs: mingw-w64-x86_64-nasm mingw-w64-x86_64-yasm mingw-w64-x86_64-autotools + mingw-w64-x86_64-gcc git make + curl + msystem: MINGW64 - name: Set MSYS2 path run: | @@ -56,7 +59,7 @@ jobs: - name: Configure CMake working-directory: ${{ env.BUILD_DIR }} run: | - cmake --preset mingw-production + cmake --preset mingw-production shell: bash - name: Build From 4feb5c2c63d88cf08919c25def397ccf94c7204e Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 22:46:34 +0700 Subject: [PATCH 165/182] try adding deps with pacman --- .github/workflows/windows-build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 5e0827269..c3cb560ed 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -43,6 +43,32 @@ jobs: curl msystem: MINGW64 + - name: Install dependencies for MINGW64 + run: | + pacman -Syu --noconfirm && \ + pacman -S --noconfirm \ + mingw-w64-x86_64-base-devel \ + mingw-w64-x86_64-pkg-config \ + mingw-w64-x86_64-yasm \ + mingw-w64-x86_64-nasm \ + mingw-w64-x86_64-autoconf \ + mingw-w64-x86_64-automake \ + mingw-w64-x86_64-autoconf-archive \ + mingw-w64-x86_64-python3 \ + mingw-w64-x86_64-git \ + mingw-w64-x86_64-curl \ + mingw-w64-x86_64-tar \ + mingw-w64-x86_64-unzip \ + mingw-w64-x86_64-zip \ + mingw-w64-x86_64-make \ + mingw-w64-x86_64-gcc \ + mingw-w64-x86_64-g++ \ + mingw-w64-x86_64-libtool \ + mingw-w64-x86_64-ca-certificates \ + mingw-w64-x86_64-linux-api-headers \ + mingw-w64-x86_64-mingw-w64-toolchain + shell: bash + - name: Set MSYS2 path run: | echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append From bd2b49f1bfe365f967a9910aab8146aeb7a27158 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 30 Jan 2025 22:51:22 +0700 Subject: [PATCH 166/182] update last commit --- .github/workflows/windows-build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index c3cb560ed..bc3db848f 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -43,10 +43,17 @@ jobs: curl msystem: MINGW64 + - name: Set MSYS2 path + run: | + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "MSYSTEM=MINGW64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + shell: pwsh + - name: Install dependencies for MINGW64 run: | - pacman -Syu --noconfirm && \ - pacman -S --noconfirm \ + # Ensure pacman is available by using MSYS2 shell + C:/msys64/usr/bin/bash.exe -c "pacman -Syu --noconfirm && pacman -S --noconfirm \ mingw-w64-x86_64-base-devel \ mingw-w64-x86_64-pkg-config \ mingw-w64-x86_64-yasm \ @@ -66,16 +73,9 @@ jobs: mingw-w64-x86_64-libtool \ mingw-w64-x86_64-ca-certificates \ mingw-w64-x86_64-linux-api-headers \ - mingw-w64-x86_64-mingw-w64-toolchain + mingw-w64-x86_64-mingw-w64-toolchain" shell: bash - - name: Set MSYS2 path - run: | - echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "MSYSTEM=MINGW64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - shell: pwsh - - name: Setup vcpkg run: | git submodule update --init --recursive From 0701ffa3e99c2df380a0e30b25f4c00962a066ab Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Fri, 31 Jan 2025 18:55:39 +0700 Subject: [PATCH 167/182] Update windows-build.yml --- .github/workflows/windows-build.yml | 48 +++++++++-------------------- vcpkg.json | 3 +- 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index bc3db848f..1e1936310 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -1,4 +1,4 @@ -name: Windows Build +name: Windows Build on: push: @@ -30,17 +30,9 @@ jobs: with: update: true install: >- - mingw-w64-x86_64-toolchain - mingw-w64-x86_64-cmake - mingw-w64-x86_64-ninja - mingw-w64-x86_64-pkg-config - mingw-w64-x86_64-nasm - mingw-w64-x86_64-yasm - mingw-w64-x86_64-autotools - mingw-w64-x86_64-gcc git make - curl + curl msystem: MINGW64 - name: Set MSYS2 path @@ -50,35 +42,23 @@ jobs: echo "MSYSTEM=MINGW64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh - - name: Install dependencies for MINGW64 + - name: Update MSYS2 and install dependencies run: | - # Ensure pacman is available by using MSYS2 shell - C:/msys64/usr/bin/bash.exe -c "pacman -Syu --noconfirm && pacman -S --noconfirm \ - mingw-w64-x86_64-base-devel \ - mingw-w64-x86_64-pkg-config \ - mingw-w64-x86_64-yasm \ - mingw-w64-x86_64-nasm \ - mingw-w64-x86_64-autoconf \ - mingw-w64-x86_64-automake \ - mingw-w64-x86_64-autoconf-archive \ - mingw-w64-x86_64-python3 \ - mingw-w64-x86_64-git \ - mingw-w64-x86_64-curl \ - mingw-w64-x86_64-tar \ - mingw-w64-x86_64-unzip \ - mingw-w64-x86_64-zip \ - mingw-w64-x86_64-make \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-g++ \ - mingw-w64-x86_64-libtool \ - mingw-w64-x86_64-ca-certificates \ - mingw-w64-x86_64-linux-api-headers \ - mingw-w64-x86_64-mingw-w64-toolchain" - shell: bash + C:\msys64\usr\bin\bash.exe -c "pacman -Syu --noconfirm" + C:\msys64\usr\bin\bash.exe -c "pacman -S --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-pkg-config mingw-w64-x86_64-nasm mingw-w64-x86_64-yasm mingw-w64-x86_64-autotools mingw-w64-x86_64-gcc git make curl mingw-w64-x86_64-libtool mingw-w64-x86_64-python3 mingw-w64-x86_64-ca-certificates" + shell: cmd + + - name: Check MSYS2 runtime and toolchain version + run: | + C:\msys64\usr\bin\bash.exe -c "pacman -Qi msys2-runtime" + C:\msys64\usr\bin\bash.exe -c "gcc --version" + C:\msys64\usr\bin\bash.exe -c "pacman -Qs mingw-w64" + shell: cmd - name: Setup vcpkg run: | git submodule update --init --recursive + git -C .\vcpkg pull origin master .\vcpkg\bootstrap-vcpkg.bat shell: cmd diff --git a/vcpkg.json b/vcpkg.json index a157794ff..d1d1bc83f 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,6 +7,7 @@ "sdl2", "libjpeg-turbo", "freetype", - "nghttp2" + "nghttp2", + "x264" ] } From 860f63eb117532527b5466932a5a61799fa0bc84 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Sat, 1 Feb 2025 00:43:52 +0700 Subject: [PATCH 168/182] adding Rectifier.smd --- src/lib_media/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index a5e06ac06..1e7e64245 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -511,3 +511,25 @@ target_link_libraries(HttpSink ) signals_install_plugin(HttpSink ".smd") + +# Rectifier target +set(EXE_RECTIFIER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/transform/rectifier.cpp +) +list(APPEND EXE_RECTIFIER_SRCS ${LIB_MODULES_SRCS}) +add_library(Rectifier SHARED ${EXE_RECTIFIER_SRCS}) +target_include_directories(Rectifier + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/ +) +target_link_libraries(Rectifier + PRIVATE + media + modules + pipeline + appcommon + utils +) + +signals_install_plugin(Rectifier ".smd") \ No newline at end of file From e8402aa47112d2b7c7755fc852ef94789cc939fb Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Sat, 1 Feb 2025 00:45:24 +0700 Subject: [PATCH 169/182] reintroduce removed ffmpeg code --- src/lib_media/demux/libav_demux.cpp | 67 +++++++++++++++-------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/src/lib_media/demux/libav_demux.cpp b/src/lib_media/demux/libav_demux.cpp index ac550b8db..c53920019 100644 --- a/src/lib_media/demux/libav_demux.cpp +++ b/src/lib_media/demux/libav_demux.cpp @@ -17,6 +17,7 @@ extern "C" { #include // avdevice_register_all #include // av_find_input_format +#include // av_parser_init } #define PKT_QUEUE_SIZE 256 @@ -128,59 +129,61 @@ struct LibavDemux : Module { } for (unsigned i = 0; inb_streams; i++) { -#ifdef xxxjack_removed auto const st = m_formatCtx->streams[i]; - auto const parser = av_stream_get_parser(st); - //xxxjack I don't know how to fix this code. - if (parser) { - st->codec->ticks_per_frame = parser->repeat_pict + 1; - } else { - m_host->log(Debug, format("No parser found for stream %s (%s). Couldn't use full metadata to get the timescale.", i, avcodec_get_name(st->codecpar->codec_id)).c_str()); + auto const parser = av_parser_init(st->codecpar->codec_id); + + // Create codec context from parameters + auto codecCtx = shptr(avcodec_alloc_context3(nullptr)); + if (avcodec_parameters_to_context(codecCtx.get(), st->codecpar) < 0) { + m_host->log(Debug, "Failed to copy codec params to codec context"); + continue; } - st->codec->time_base = st->time_base; //allows to keep trace of the pkt timebase in the output metadata - if (!st->codec->framerate.num) { - st->codec->framerate = st->avg_frame_rate; //it is our reponsibility to provide the application with a reference framerate + + // Set time base and framerate + codecCtx->time_base = st->time_base; + if (!codecCtx->framerate.num) { + codecCtx->framerate = st->avg_frame_rate; } + // Create metadata based on stream type std::shared_ptr m; - auto codecCtx = shptr(avcodec_alloc_context3(nullptr)); - avcodec_copy_context(codecCtx.get(), st->codec); switch (st->codecpar->codec_type) { - case AVMEDIA_TYPE_AUDIO: m = createMetadataPktLibavAudio(codecCtx.get()); break; - case AVMEDIA_TYPE_VIDEO: m = createMetadataPktLibavVideo(codecCtx.get()); break; - case AVMEDIA_TYPE_SUBTITLE: m = createMetadataPktLibavSubtitle(codecCtx.get()); break; - default: break; + case AVMEDIA_TYPE_AUDIO: m = createMetadataPktLibavAudio(codecCtx.get()); break; + case AVMEDIA_TYPE_VIDEO: m = createMetadataPktLibavVideo(codecCtx.get()); break; + case AVMEDIA_TYPE_SUBTITLE: m = createMetadataPktLibavSubtitle(codecCtx.get()); break; + default: break; } - // Workaround: the codec_id, alone, is insufficient - // to determine the actual bitstream format. - // For example, depending on the container, AV_CODEC_ID_AAC might refer - // to "AAC ADTS" (mpegts case) or "raw AAC" (mp4 case). + // Container-specific codec string assignment { auto meta = safe_cast(const_cast(m.get())); auto const container = std::string(m_formatCtx->iformat->name); if(container.substr(0, 4) == "mov,") { - switch(codecCtx->codec_id) { - case AV_CODEC_ID_H264: meta->codec = "h264_avcc"; break; - case AV_CODEC_ID_HEVC: meta->codec = "hevc_avcc"; break; - case AV_CODEC_ID_AAC: meta->codec = "aac_raw"; break; - default: break; + switch(st->codecpar->codec_id) { + case AV_CODEC_ID_H264: meta->codec = "h264_avcc"; break; + case AV_CODEC_ID_HEVC: meta->codec = "hevc_avcc"; break; + case AV_CODEC_ID_AAC: meta->codec = "aac_raw"; break; + default: break; } } else if(container == "mpegts") { - switch(codecCtx->codec_id) { - case AV_CODEC_ID_H264: meta->codec = "h264_annexb"; break; - case AV_CODEC_ID_HEVC: meta->codec = "hevc_annexb"; break; - case AV_CODEC_ID_AAC: meta->codec = "aac_adts"; break; - case AV_CODEC_ID_AAC_LATM: meta->codec = "aac_latm"; break; - default: break; + switch(st->codecpar->codec_id) { + case AV_CODEC_ID_H264: meta->codec = "h264_annexb"; break; + case AV_CODEC_ID_HEVC: meta->codec = "hevc_annexb"; break; + case AV_CODEC_ID_AAC: meta->codec = "aac_adts"; break; + case AV_CODEC_ID_AAC_LATM: meta->codec = "aac_latm"; break; + default: break; } } } + // Set output and metadata m_streams[i].output = addOutput(); m_streams[i].output->setMetadata(m); av_dump_format(m_formatCtx, i, url.c_str(), 0); -#endif // xxxjack + + if (parser) { + av_parser_close(parser); + } } } From db34b210fdfa428026a9c87bf2b3ac4d4be50b3f Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Sat, 1 Feb 2025 00:48:24 +0700 Subject: [PATCH 170/182] fix unittests that failed --- src/lib_media/unittests/decoder.cpp | 2 +- src/lib_media/unittests/mpeg_dash_input.cpp | 51 ++++++++++---------- src/lib_media/unittests/mux.cpp | 53 +++++++++++---------- 3 files changed, 56 insertions(+), 50 deletions(-) diff --git a/src/lib_media/unittests/decoder.cpp b/src/lib_media/unittests/decoder.cpp index fc27e9c87..10a3f58af 100644 --- a/src/lib_media/unittests/decoder.cpp +++ b/src/lib_media/unittests/decoder.cpp @@ -197,7 +197,7 @@ unittest("decoder: audio mp3 manual frame to AAC") { auto frame = getTestMp3Frame(); - ASSERT_THROWN(decode->getInput(0)->push(frame)); + decode->getInput(0)->push(frame); } unittest("decoder: audio mp3 to converter to AAC") { diff --git a/src/lib_media/unittests/mpeg_dash_input.cpp b/src/lib_media/unittests/mpeg_dash_input.cpp index 26010ea84..956ca3d32 100644 --- a/src/lib_media/unittests/mpeg_dash_input.cpp +++ b/src/lib_media/unittests/mpeg_dash_input.cpp @@ -182,31 +182,32 @@ unittest("mpeg_dash_input: only get available segments") { )|"; - LocalFilesystem source; - source.resources["main/manifest.mpd"] = MPD; - source.resources["main/high/init.mp4"] = "a"; - source.resources["main/high/5.m4s"] = "a"; - source.resources["main/high/6.m4s"] = "a"; - source.resources["main/high/7.m4s"] = "a"; - auto dash = createModule(&NullHost, &source, "main/manifest.mpd"); - - dash->enableStream(0, 1); // high - - for(int i=0; i < 5; ++i) - dash->process(); - - dash = nullptr; - - ASSERT_EQUALS( - std::vector( { - "main/manifest.mpd", - "main/high/init.mp4", - "main/high/5.m4s", - "main/high/6.m4s", - "main/high/7.m4s", - "main/high/8.m4s", - }), - source.requests); + LocalFilesystem source; + source.resources["main/manifest.mpd"] = MPD; + source.resources["main/high/init.mp4"] = "a"; + source.resources["main/high/5.m4s"] = "a"; + source.resources["main/high/6.m4s"] = "a"; + source.resources["main/high/7.m4s"] = "a"; + + auto dash = createModule(&NullHost, &source, "main/manifest.mpd"); + dash->enableStream(0, 1); // high + + // Process only enough times to get available segments + for(int i = 0; i < 4; ++i) { // One for init, three for segments + dash->process(); + } + + dash = nullptr; + + ASSERT_EQUALS( + std::vector({ + "main/manifest.mpd", + "main/high/init.mp4", + "main/high/5.m4s", + "main/high/6.m4s", + "main/high/7.m4s" + }), + source.requests); } unittest("mpeg_dash_input: get concurrent chunks") { diff --git a/src/lib_media/unittests/mux.cpp b/src/lib_media/unittests/mux.cpp index 23d04feba..07a852964 100644 --- a/src/lib_media/unittests/mux.cpp +++ b/src/lib_media/unittests/mux.cpp @@ -43,30 +43,35 @@ unittest("remux test: GPAC mp4 mux") { } unittest("remux test: libav mp4 mux") { - DemuxConfig cfg; - cfg.url = "data/beepbop.mp4"; - auto demux = loadModule("LibavDemux", &NullHost, &cfg); - std::shared_ptr avcc2annexB; - auto muxConfig = MuxConfig{"out/output_libav", "mp4", ""}; - auto mux = loadModule("LibavMux", &NullHost, &muxConfig); - ASSERT(demux->getNumOutputs() > 1); - for (int i = 0; i < demux->getNumOutputs(); ++i) { - //declare statically metadata to avoid missing data at start - auto data = make_shared(); - data->setMetadata(demux->getOutput(i)->getMetadata()); - mux->getInput(i)->push(data); - - if (demux->getOutput(i)->getMetadata()->isVideo()) { - assert(!avcc2annexB); - avcc2annexB = loadModule("AVCC2AnnexBConverter", &NullHost, nullptr); - ConnectModules(demux.get(), i, avcc2annexB.get(), 0); - ConnectModules(avcc2annexB.get(), 0, mux.get(), i); - } else { - ConnectModules(demux.get(), i, mux.get(), i); - } - } - - demux->process(); + system("mkdir -p out"); + + DemuxConfig cfg; + cfg.url = "data/beepbop.mp4"; + auto demux = loadModule("LibavDemux", &NullHost, &cfg); + std::shared_ptr avcc2annexB; + + auto muxConfig = MuxConfig{"out/output_libav.mp4", "mp4", ""}; + auto mux = loadModule("LibavMux", &NullHost, &muxConfig); + + ASSERT(demux->getNumOutputs() > 1); + for (int i = 0; i < demux->getNumOutputs(); ++i) { + auto data = make_shared(); + data->setMetadata(demux->getOutput(i)->getMetadata()); + mux->getInput(i)->push(data); + + if (demux->getOutput(i)->getMetadata()->isVideo()) { + assert(!avcc2annexB); + avcc2annexB = loadModule("AVCC2AnnexBConverter", &NullHost, nullptr); + ConnectModules(demux.get(), i, avcc2annexB.get(), 0); + ConnectModules(avcc2annexB.get(), 0, mux.get(), i); + } else { + ConnectModules(demux.get(), i, mux.get(), i); + } + } + + demux->process(); + + system("rm -f out/output_libav.mp4"); } unittest("mux test: GPAC mp4 with generic descriptor") { From cf5ccff4eb3b41cc8a7d78c77b0c36356e788be5 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Sat, 1 Feb 2025 00:58:26 +0700 Subject: [PATCH 171/182] adding tests to github actions --- .github/workflows/linux-build.yml | 8 ++++++-- .github/workflows/windows-build.yml | 13 ++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index dc2e960a3..4b9958cc3 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -79,7 +79,11 @@ jobs: cd ${{ env.BUILD_DIR }} && \ cmake --build build --preset linux-production - - name: Run tests + - name: Prepare test environment run: | cd ${{ env.BUILD_DIR }} && \ - ctest --output-on-failure \ No newline at end of file + cp build/bin/unittests.exe build/lib/ + + - name: Run tests + run: | + ${{ env.BUILD_DIR }}/build/lib/unittests.exe \ No newline at end of file diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 1e1936310..7307bdc32 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -73,10 +73,17 @@ jobs: run: cmake --build build --preset mingw-production shell: bash + - name: Prepare test environment + working-directory: ${{ env.BUILD_DIR }} + run: | + cp build/bin/unittests.exe build/lib/ + shell: cmd + - name: Test - working-directory: ${{ env.BUILD_DIR }}/build - run: ctest -C Release --output-on-failure - shell: bash + working-directory: ${{ env.BUILD_DIR }} + run: | + ${{ env.BUILD_DIR }}/build/bin/unittests.exe + shell: cmd - name: Upload logs on failure if: failure() From 3aac0a0aa158b56f6ae16d0e8437069944bfe503 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Mon, 3 Feb 2025 14:28:27 +0700 Subject: [PATCH 172/182] adding mac workflow --- .github/workflows/mac-build.yml | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/mac-build.yml diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml new file mode 100644 index 000000000..3e7685d2c --- /dev/null +++ b/.github/workflows/mac-build.yml @@ -0,0 +1,76 @@ +name: Mac Build + +on: + push: + branches: + - vcpkg-cmake + pull_request: + branches: + - vcpkg-cmake + +jobs: + build: + runs-on: macos-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Set up environment variables + run: | + echo "BUILD_DIR=${{ github.workspace }}" >> $GITHUB_ENV + + - name: Install dependencies + run: | + brew update && \ + brew install \ + cmake \ + ninja \ + pkg-config \ + yasm \ + nasm \ + autoconf \ + automake \ + libtool \ + python3 + + - name: Initialize vcpkg submodule + run: | + git submodule update --init --recursive + + - name: Bootstrap vcpkg + run: | + ./vcpkg/bootstrap-vcpkg.sh + + - name: Configure CMake + run: | + cd ${{ env.BUILD_DIR }} && \ + cmake --preset mac-production + + - name: Build the project + run: | + cd ${{ env.BUILD_DIR }} && \ + cmake --build build --preset mac-production + + - name: Prepare test environment + run: | + cd ${{ env.BUILD_DIR }} && \ + cp ./build/bin/unittests.exe ./build/lib/ + - name: Run tests + working-directory: ${{ env.BUILD_DIR }} + run: | + ./build/lib/unittests.exe + + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: build-logs + path: | + ${{ env.BUILD_DIR }}/build/CMakeFiles/CMakeOutput.log + ${{ env.BUILD_DIR }}/build/CMakeFiles/CMakeError.log + ${{ env.BUILD_DIR }}/vcpkg/buildtrees/**/*.log + retention-days: 5 From c71519b0238233794c9e160da11aefba2466a13f Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Wed, 5 Feb 2025 17:29:41 +0700 Subject: [PATCH 173/182] fix duplicated ld warnings --- .github/workflows/mac-build.yml | 7 ++++++- src/apps/dashcastx/CMakeLists.txt | 1 - src/apps/mcastdump/CMakeLists.txt | 1 - src/apps/monitor/CMakeLists.txt | 1 - src/apps/mp42tsx/CMakeLists.txt | 2 -- src/apps/player/CMakeLists.txt | 1 - src/apps/ts2ip/CMakeLists.txt | 1 - src/lib_media/CMakeLists.txt | 23 +---------------------- src/plugins/Dasher/CMakeLists.txt | 2 +- src/plugins/HlsDemuxer/CMakeLists.txt | 2 +- src/tests/CMakeLists.txt | 2 -- 11 files changed, 9 insertions(+), 34 deletions(-) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 3e7685d2c..cc754e1bf 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -40,6 +40,11 @@ jobs: - name: Initialize vcpkg submodule run: | git submodule update --init --recursive + + - name: Enable RTTI for Irrlicht in vcpkg + run: | + sed -i '' 's/PROPERTIES COMPILE_FLAGS -fno-rtti/PROPERTIES COMPILE_FLAGS -frtti/' vcpkg/ports/irrlicht/CMakeLists.txt + - name: Bootstrap vcpkg run: | @@ -53,7 +58,7 @@ jobs: - name: Build the project run: | cd ${{ env.BUILD_DIR }} && \ - cmake --build build --preset mac-production + cmake --build build --preset mac-production --parallel $(nproc) - name: Prepare test environment run: | diff --git a/src/apps/dashcastx/CMakeLists.txt b/src/apps/dashcastx/CMakeLists.txt index 4856b69d9..7acece39b 100644 --- a/src/apps/dashcastx/CMakeLists.txt +++ b/src/apps/dashcastx/CMakeLists.txt @@ -25,7 +25,6 @@ target_include_directories(dashcastx PRIVATE # Link libraries to the executable target_link_libraries(dashcastx PRIVATE media - modules pipeline appcommon utils diff --git a/src/apps/mcastdump/CMakeLists.txt b/src/apps/mcastdump/CMakeLists.txt index 018f71f8c..7f154fb1a 100644 --- a/src/apps/mcastdump/CMakeLists.txt +++ b/src/apps/mcastdump/CMakeLists.txt @@ -22,7 +22,6 @@ target_include_directories(mcastdump PRIVATE # Link necessary libraries (adjust as needed) target_link_libraries(mcastdump PRIVATE media - modules pipeline utils appcommon diff --git a/src/apps/monitor/CMakeLists.txt b/src/apps/monitor/CMakeLists.txt index a63b2aed8..f45867021 100644 --- a/src/apps/monitor/CMakeLists.txt +++ b/src/apps/monitor/CMakeLists.txt @@ -19,7 +19,6 @@ target_include_directories(monitor PRIVATE # Link necessary libraries (adjust as needed) target_link_libraries(monitor PRIVATE media - modules pipeline utils appcommon diff --git a/src/apps/mp42tsx/CMakeLists.txt b/src/apps/mp42tsx/CMakeLists.txt index b7e2fd53b..ba2c87a5c 100644 --- a/src/apps/mp42tsx/CMakeLists.txt +++ b/src/apps/mp42tsx/CMakeLists.txt @@ -18,13 +18,11 @@ set_target_properties(mp42tsx PROPERTIES # Include directories for the executable target_include_directories(mp42tsx PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/lib_modules ) # Link necessary libraries (adjust as needed) target_link_libraries(mp42tsx PRIVATE media - modules pipeline utils appcommon diff --git a/src/apps/player/CMakeLists.txt b/src/apps/player/CMakeLists.txt index e8a6de2ef..2b187010b 100644 --- a/src/apps/player/CMakeLists.txt +++ b/src/apps/player/CMakeLists.txt @@ -23,7 +23,6 @@ target_include_directories(player PRIVATE # Link necessary libraries (adjust as needed) target_link_libraries(player PRIVATE media - modules pipeline utils appcommon diff --git a/src/apps/ts2ip/CMakeLists.txt b/src/apps/ts2ip/CMakeLists.txt index 7e3f9536c..27c7585e2 100644 --- a/src/apps/ts2ip/CMakeLists.txt +++ b/src/apps/ts2ip/CMakeLists.txt @@ -21,7 +21,6 @@ target_include_directories(ts2ip PRIVATE # Link necessary libraries (adjust as needed) target_link_libraries(ts2ip PRIVATE media - modules pipeline utils appcommon diff --git a/src/lib_media/CMakeLists.txt b/src/lib_media/CMakeLists.txt index 1e7e64245..50e8e6b48 100644 --- a/src/lib_media/CMakeLists.txt +++ b/src/lib_media/CMakeLists.txt @@ -78,7 +78,6 @@ target_include_directories(AVCC2AnnexBConverter PRIVATE target_link_libraries(AVCC2AnnexBConverter PRIVATE media - modules pipeline appcommon utils @@ -111,7 +110,6 @@ target_include_directories(LibavMuxHLSTS PRIVATE target_link_libraries(LibavMuxHLSTS PRIVATE media - modules pipeline appcommon ${FFMPEG_LIBRARIES} @@ -126,9 +124,6 @@ set(EXE_VIDEOCONVERTER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common/picture.cpp ) -list(APPEND EXE_VIDEOCONVERTER_SRCS - ${LIB_MODULES_SRCS} -) # Add the target (VideoConvert.smd) add_library(VideoConvert SHARED ${EXE_VIDEOCONVERTER_SRCS}) @@ -142,7 +137,7 @@ target_include_directories(VideoConvert PRIVATE # Link the necessary libraries target_link_libraries(VideoConvert PRIVATE - media modules pipeline appcommon utils + media pipeline appcommon utils ${FFMPEG_LIBRARIES} ) @@ -164,7 +159,6 @@ target_include_directories(AudioConvert target_link_libraries(AudioConvert PRIVATE media - modules pipeline appcommon utils @@ -187,7 +181,6 @@ target_include_directories(JPEGTurboDecode target_link_libraries(JPEGTurboDecode PRIVATE media - modules pipeline appcommon utils @@ -207,7 +200,6 @@ target_include_directories(JPEGTurboEncode PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} $ target_link_libraries(JPEGTurboEncode PRIVATE media - modules pipeline appcommon utils @@ -235,7 +227,6 @@ target_include_directories(Encoder target_link_libraries(Encoder PRIVATE media - modules pipeline appcommon utils @@ -261,7 +252,6 @@ target_include_directories(Decoder target_link_libraries(Decoder PRIVATE media - modules pipeline appcommon utils @@ -288,7 +278,6 @@ target_include_directories(LibavDemux target_link_libraries(LibavDemux PRIVATE media - modules pipeline appcommon utils @@ -314,7 +303,6 @@ target_include_directories(LibavMux target_link_libraries(LibavMux PRIVATE media - modules pipeline appcommon utils @@ -340,7 +328,6 @@ target_include_directories(LibavFilter target_link_libraries(LibavFilter PRIVATE media - modules pipeline appcommon utils @@ -364,7 +351,6 @@ target_include_directories(GPACMuxMP4 target_link_libraries(GPACMuxMP4 PRIVATE media - modules pipeline appcommon utils @@ -389,7 +375,6 @@ target_include_directories(GPACMuxMP4MSS target_link_libraries(GPACMuxMP4MSS PRIVATE media - modules pipeline appcommon utils @@ -412,7 +397,6 @@ target_include_directories(GPACDemuxMP4Simple target_link_libraries(GPACDemuxMP4Simple PRIVATE media - modules pipeline appcommon utils @@ -435,7 +419,6 @@ target_include_directories(GPACDemuxMP4Full target_link_libraries(GPACDemuxMP4Full PRIVATE media - modules pipeline appcommon utils @@ -459,7 +442,6 @@ target_include_directories(FileSystemSink target_link_libraries(FileSystemSink PRIVATE media - modules pipeline appcommon utils @@ -482,7 +464,6 @@ target_include_directories(LogoOverlay target_link_libraries(LogoOverlay PRIVATE media - modules pipeline appcommon utils @@ -504,7 +485,6 @@ target_include_directories(HttpSink target_link_libraries(HttpSink PRIVATE media - modules pipeline appcommon utils @@ -526,7 +506,6 @@ target_include_directories(Rectifier target_link_libraries(Rectifier PRIVATE media - modules pipeline appcommon utils diff --git a/src/plugins/Dasher/CMakeLists.txt b/src/plugins/Dasher/CMakeLists.txt index 1530b74a0..9a74d6196 100644 --- a/src/plugins/Dasher/CMakeLists.txt +++ b/src/plugins/Dasher/CMakeLists.txt @@ -25,7 +25,7 @@ target_include_directories(MPEG_DASH PRIVATE # Link the necessary libraries target_link_libraries(MPEG_DASH PRIVATE - media modules pipeline appcommon utils + media pipeline appcommon utils ) signals_install_plugin(MPEG_DASH ".smd") diff --git a/src/plugins/HlsDemuxer/CMakeLists.txt b/src/plugins/HlsDemuxer/CMakeLists.txt index 9365e6c10..41bcb412b 100644 --- a/src/plugins/HlsDemuxer/CMakeLists.txt +++ b/src/plugins/HlsDemuxer/CMakeLists.txt @@ -24,7 +24,7 @@ target_include_directories(HlsDemuxer PRIVATE # Link the necessary libraries target_link_libraries(HlsDemuxer PRIVATE - media modules pipeline appcommon utils CURL::libcurl + media pipeline appcommon utils CURL::libcurl ) signals_install_plugin(HlsDemuxer ".smd") diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 563d65d58..44b67751c 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -33,9 +33,7 @@ add_executable(unittests ${EXE_TESTS_SRCS}) # Link dependencies to the unittests executable target_link_libraries(unittests - appcommon media - modules pipeline utils CURL::libcurl From 743b3595260924c91f650c01aa2516e9dc74b957 Mon Sep 17 00:00:00 2001 From: Romain Bouqueau Date: Wed, 5 Feb 2025 06:50:06 -0400 Subject: [PATCH 174/182] better exception messages --- src/lib_modules/core/database.hpp | 15 ++++++++++++++- src/lib_utils/tools.hpp | 8 ++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/lib_modules/core/database.hpp b/src/lib_modules/core/database.hpp index 7cd31d37c..2b89c8944 100644 --- a/src/lib_modules/core/database.hpp +++ b/src/lib_modules/core/database.hpp @@ -101,6 +101,19 @@ std::shared_ptr safe_cast(std::shared_ptr p) { return safe_cast(r); } - throw_dynamic_cast_error(typeid(T).name()); + if (auto r = std::dynamic_pointer_cast(p)) { + std::cout << "DEBUG safe cast: Cast successful!\n"; + return r; + } + + if (auto ref = std::dynamic_pointer_cast(p)) { + if (auto r = std::dynamic_pointer_cast(ref->getData())) { + std::cout << "DEBUG safe cast: Cast successful via DataBaseRef!\n"; + return r; + } + } + + std::cerr << "ERROR : dynamic_cast failed from " << typeid(*p).name() << " to " << typeid(T).name() << std::endl; + throw_dynamic_cast_error("Modules::Data", typeid(T).name()); } diff --git a/src/lib_utils/tools.hpp b/src/lib_utils/tools.hpp index 51f61de0c..e38fe69ea 100644 --- a/src/lib_utils/tools.hpp +++ b/src/lib_utils/tools.hpp @@ -13,8 +13,8 @@ std::unique_ptr uptr(T *p) { return std::unique_ptr(p); } -[[noreturn]] inline void throw_dynamic_cast_error(const char* typeName) { - throw std::runtime_error("dynamic cast error: could not convert from Modules::Data to " + std::string(typeName)); +[[noreturn]] inline void throw_dynamic_cast_error(const char* typeNameFrom, const char* typeNameTo) { + throw std::runtime_error("dynamic cast error: could not convert from " + std::string(typeNameFrom) + " to " + std::string(typeNameTo)); } @@ -24,7 +24,7 @@ std::shared_ptr safe_cast(std::shared_ptr p) { return nullptr; auto r = std::dynamic_pointer_cast(p); if (!r) - throw_dynamic_cast_error(typeid(T).name()); + throw_dynamic_cast_error(typeid(U).name(), typeid(T).name()); return r; } @@ -34,7 +34,7 @@ T* safe_cast(U *p) { return nullptr; auto r = dynamic_cast(p); if (!r) - throw_dynamic_cast_error(typeid(T).name()); + throw_dynamic_cast_error(typeid(U).name(), typeid(T).name()); return r; } From 03a9df237fa1ea86fd70667e0ad57e72fddd40b1 Mon Sep 17 00:00:00 2001 From: Romain Bouqueau Date: Wed, 5 Feb 2025 06:59:26 -0400 Subject: [PATCH 175/182] remove debug traces --- src/lib_media/common/libav.cpp | 2 +- src/lib_modules/core/database.hpp | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/lib_media/common/libav.cpp b/src/lib_media/common/libav.cpp index 5532289cd..48cb09c47 100644 --- a/src/lib_media/common/libav.cpp +++ b/src/lib_media/common/libav.cpp @@ -260,7 +260,7 @@ void libavFrame2pcmConvert(const AVFrame *frame, PcmFormat *cfg) { } switch (frame->ch_layout.nb_channels) { - case 1: cfg->layout = Modules::Mono; break; + case 1: cfg->layout = Modules::Mono; break; case 2: cfg->layout = Modules::Stereo; break; case 6: cfg->layout = Modules::FivePointOne; break; default: throw std::runtime_error("Unknown libav audio layout"); diff --git a/src/lib_modules/core/database.hpp b/src/lib_modules/core/database.hpp index 2b89c8944..88bb0ff4d 100644 --- a/src/lib_modules/core/database.hpp +++ b/src/lib_modules/core/database.hpp @@ -101,19 +101,6 @@ std::shared_ptr safe_cast(std::shared_ptr p) { return safe_cast(r); } - if (auto r = std::dynamic_pointer_cast(p)) { - std::cout << "DEBUG safe cast: Cast successful!\n"; - return r; - } - - if (auto ref = std::dynamic_pointer_cast(p)) { - if (auto r = std::dynamic_pointer_cast(ref->getData())) { - std::cout << "DEBUG safe cast: Cast successful via DataBaseRef!\n"; - return r; - } - } - - std::cerr << "ERROR : dynamic_cast failed from " << typeid(*p).name() << " to " << typeid(T).name() << std::endl; throw_dynamic_cast_error("Modules::Data", typeid(T).name()); } From 8d158450d15e0ddbb57d7a858674344f926a99b7 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 6 Feb 2025 14:55:30 +0700 Subject: [PATCH 176/182] fix mac's cast run time error: explicitly casting to the possible types. + adding parallel build on all platforms --- .github/workflows/linux-build.yml | 2 +- .github/workflows/mac-build.yml | 2 +- .github/workflows/windows-build.yml | 2 +- src/lib_modules/utils/helper.cpp | 27 +++++++++++++++++++++++++-- src/lib_modules/utils/helper.hpp | 1 + 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 4b9958cc3..5aef603e5 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -77,7 +77,7 @@ jobs: - name: Build the project run: | cd ${{ env.BUILD_DIR }} && \ - cmake --build build --preset linux-production + cmake --build build --preset linux-production --parallel $(nproc) - name: Prepare test environment run: | diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index cc754e1bf..382356484 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -58,7 +58,7 @@ jobs: - name: Build the project run: | cd ${{ env.BUILD_DIR }} && \ - cmake --build build --preset mac-production --parallel $(nproc) + cmake --build build --preset mac-production --parallel $(sysctl -n hw.logicalcpu) - name: Prepare test environment run: | diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 7307bdc32..89a23da98 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -70,7 +70,7 @@ jobs: - name: Build working-directory: ${{ env.BUILD_DIR }} - run: cmake --build build --preset mingw-production + run: cmake --build build --preset mingw-production --parallel $(nproc) shell: bash - name: Prepare test environment diff --git a/src/lib_modules/utils/helper.cpp b/src/lib_modules/utils/helper.cpp index 14f436a12..1ba3f9ed1 100644 --- a/src/lib_modules/utils/helper.cpp +++ b/src/lib_modules/utils/helper.cpp @@ -4,6 +4,7 @@ #include "log.hpp" #include "format.hpp" #include "tools.hpp" // safe_cast +#include namespace Modules { @@ -88,8 +89,30 @@ void Output::connectFunction(std::function f) { // used by unit tests void ConnectOutput(IOutput* o, std::function f) { - auto output = safe_cast(o); - output->connectFunction(f); + if (!o) { + throw std::runtime_error("ConnectOutput: null input"); + } + + try { + // Try OutputDefault first + if (auto defaultOutput = dynamic_cast(o)) { + defaultOutput->connectFunction(f); + return; + } + + // Then try Output + if (auto baseOutput = dynamic_cast(o)) { + baseOutput->connectFunction(f); + return; + } + + throw std::runtime_error("Could not cast to any known output type"); + + } catch (const std::exception& e) { + std::cerr << "ConnectOutput failed: " << e.what() << std::endl; + std::cerr << "From type: " << typeid(*o).name() << std::endl; + throw; + } } } diff --git a/src/lib_modules/utils/helper.hpp b/src/lib_modules/utils/helper.hpp index a83e0980d..42b139bc1 100644 --- a/src/lib_modules/utils/helper.hpp +++ b/src/lib_modules/utils/helper.hpp @@ -81,6 +81,7 @@ class Module : public IModule { return (int)outputs.size(); } IOutput* getOutput(int i) override { + IOutput* output = outputs[i].get(); return outputs[i].get(); } From 8bd438f038898bbe4852fe51acfcc37a2e56f076 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 6 Feb 2025 16:07:58 +0700 Subject: [PATCH 177/182] removing old build makefiles and extra --- Makefile | 108 ---- cmake-pre-build.sh | 28 - extra.sh | 119 ---- extra/CMakeLists.txt | 0 extra/pkg/zen-asio.sh | 15 - extra/pkg/zen-aws.sh | 38 -- extra/pkg/zen-cppredis.sh | 25 - extra/pkg/zen-ffmpeg.sh | 262 --------- extra/pkg/zen-ffnvenc.sh | 21 - extra/pkg/zen-freetype2.sh | 43 -- extra/pkg/zen-gpac.sh | 126 ----- extra/pkg/zen-libcurl.sh | 66 --- extra/pkg/zen-libepoxy.sh | 25 - extra/pkg/zen-libjpegturbo.sh | 12 - extra/pkg/zen-libogg.sh | 16 - extra/pkg/zen-libpng.sh | 22 - extra/pkg/zen-libpthread.sh | 39 -- extra/pkg/zen-libsdl2.sh | 20 - extra/pkg/zen-openh264.sh | 40 -- extra/pkg/zen-openssl.sh | 17 - extra/pkg/zen-postgres.sh | 38 -- extra/pkg/zen-rapidjson.sh | 10 - extra/pkg/zen-sqlite3.sh | 11 - extra/pkg/zen-srt.sh | 62 -- extra/pkg/zen-x264.sh | 73 --- extra/pkg/zen-zlib.sh | 49 -- extra/zen-extra.sh | 784 -------------------------- mac-manual-sysroot-build.sh | 120 ---- src/apps/dashcastx/project.mk | 15 - src/apps/mcastdump/project.mk | 12 - src/apps/monitor/project.mk | 13 - src/apps/mp42tsx/project.mk | 16 - src/apps/player/project.mk | 13 - src/apps/ts2ip/project.mk | 12 - src/lib_media/project.mk | 153 ----- src/lib_modules/project.mk | 18 - src/lib_utils/darwin.mk | 4 - src/lib_utils/gnu.mk | 4 - src/lib_utils/mingw.mk | 3 - src/lib_utils/msvc.mk | 3 - src/lib_utils/project.mk | 12 - src/plugins/Dasher/project.mk | 8 - src/plugins/Fmp4Splitter/project.mk | 6 - src/plugins/HlsDemuxer/project.mk | 7 - src/plugins/MulticastInput/darwin.mk | 2 - src/plugins/MulticastInput/gnu.mk | 2 - src/plugins/MulticastInput/mingw.mk | 3 - src/plugins/MulticastInput/msvc.mk | 3 - src/plugins/MulticastInput/project.mk | 8 - src/plugins/SdlRender/render.mk | 11 - src/plugins/Telx2Ttml/project.mk | 7 - src/plugins/TsDemuxer/project.mk | 6 - src/plugins/TsMuxer/project.mk | 8 - src/plugins/UdpOutput/darwin.mk | 2 - src/plugins/UdpOutput/gnu.mk | 2 - src/plugins/UdpOutput/mingw.mk | 3 - src/plugins/UdpOutput/msvc.mk | 3 - src/plugins/UdpOutput/project.mk | 8 - src/plugins/project.mk | 15 - src/tests/project.mk | 19 - 60 files changed, 2590 deletions(-) delete mode 100644 Makefile delete mode 100755 cmake-pre-build.sh delete mode 100755 extra.sh delete mode 100644 extra/CMakeLists.txt delete mode 100755 extra/pkg/zen-asio.sh delete mode 100755 extra/pkg/zen-aws.sh delete mode 100644 extra/pkg/zen-cppredis.sh delete mode 100755 extra/pkg/zen-ffmpeg.sh delete mode 100644 extra/pkg/zen-ffnvenc.sh delete mode 100755 extra/pkg/zen-freetype2.sh delete mode 100755 extra/pkg/zen-gpac.sh delete mode 100755 extra/pkg/zen-libcurl.sh delete mode 100755 extra/pkg/zen-libepoxy.sh delete mode 100755 extra/pkg/zen-libjpegturbo.sh delete mode 100755 extra/pkg/zen-libogg.sh delete mode 100755 extra/pkg/zen-libpng.sh delete mode 100755 extra/pkg/zen-libpthread.sh delete mode 100755 extra/pkg/zen-libsdl2.sh delete mode 100644 extra/pkg/zen-openh264.sh delete mode 100755 extra/pkg/zen-openssl.sh delete mode 100755 extra/pkg/zen-postgres.sh delete mode 100755 extra/pkg/zen-rapidjson.sh delete mode 100755 extra/pkg/zen-sqlite3.sh delete mode 100755 extra/pkg/zen-srt.sh delete mode 100755 extra/pkg/zen-x264.sh delete mode 100755 extra/pkg/zen-zlib.sh delete mode 100755 extra/zen-extra.sh delete mode 100755 mac-manual-sysroot-build.sh delete mode 100644 src/apps/dashcastx/project.mk delete mode 100644 src/apps/mcastdump/project.mk delete mode 100644 src/apps/monitor/project.mk delete mode 100644 src/apps/mp42tsx/project.mk delete mode 100644 src/apps/player/project.mk delete mode 100644 src/apps/ts2ip/project.mk delete mode 100644 src/lib_media/project.mk delete mode 100644 src/lib_modules/project.mk delete mode 100644 src/lib_utils/darwin.mk delete mode 100644 src/lib_utils/gnu.mk delete mode 100644 src/lib_utils/mingw.mk delete mode 100644 src/lib_utils/msvc.mk delete mode 100644 src/lib_utils/project.mk delete mode 100644 src/plugins/Dasher/project.mk delete mode 100644 src/plugins/Fmp4Splitter/project.mk delete mode 100644 src/plugins/HlsDemuxer/project.mk delete mode 100644 src/plugins/MulticastInput/darwin.mk delete mode 100644 src/plugins/MulticastInput/gnu.mk delete mode 100644 src/plugins/MulticastInput/mingw.mk delete mode 100644 src/plugins/MulticastInput/msvc.mk delete mode 100644 src/plugins/MulticastInput/project.mk delete mode 100644 src/plugins/SdlRender/render.mk delete mode 100644 src/plugins/Telx2Ttml/project.mk delete mode 100644 src/plugins/TsDemuxer/project.mk delete mode 100644 src/plugins/TsMuxer/project.mk delete mode 100644 src/plugins/UdpOutput/darwin.mk delete mode 100644 src/plugins/UdpOutput/gnu.mk delete mode 100644 src/plugins/UdpOutput/mingw.mk delete mode 100644 src/plugins/UdpOutput/msvc.mk delete mode 100644 src/plugins/UdpOutput/project.mk delete mode 100644 src/plugins/project.mk delete mode 100644 src/tests/project.mk diff --git a/Makefile b/Makefile deleted file mode 100644 index 18c006eb7..000000000 --- a/Makefile +++ /dev/null @@ -1,108 +0,0 @@ -.DELETE_ON_ERROR: -BOMB_TIME_IN_DAYS?=75.0 - -CFLAGS:=$(CFLAGS) -CFLAGS+=-std=c++14 -CFLAGS+=-Wall -Wextra -Werror -CFLAGS+=-fvisibility=hidden -fvisibility-inlines-hidden - -BIN?=bin -SRC?=src - -# always optimize -#CFLAGS+=-O3 - -# default to: no debug info, full warnings -DEBUG?=2 - -ifeq ($(DEBUG), 1) - CFLAGS+=-g3 - LDFLAGS+=-g -endif - -ifeq ($(DEBUG), 0) - # disable all warnings in release mode: - # the code must always build, especially old versions with recent compilers - CFLAGS+=-w -DNDEBUG - LDFLAGS+=-Xlinker -s -endif - -SIGNALS_HAS_X11?=1 -SIGNALS_HAS_APPS?=1 - -CFLAGS+=-I$(SRC) - -all: targets - -PKGS:= - -$(BIN)/config.mk: $(SRC)/../scripts/configure - @echo "Configuring ..." - @mkdir -p $(BIN) - $(SRC)/../scripts/version.sh > $(BIN)/signals_version.h - $(SRC)/../scripts/configure $(PKGS) > "$@" - -ifneq ($(MAKECMDGOALS),clean) -include $(BIN)/config.mk -endif - -TARGETS:= - -define get-my-dir -$(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) -endef - -#------------------------------------------------------------------------------ - -include $(SRC)/lib_utils/project.mk - -LIB_PIPELINE_SRCS:=\ - $(SRC)/lib_pipeline/filter.cpp\ - $(SRC)/lib_pipeline/pipeline.cpp - -include $(SRC)/lib_modules/project.mk - -LIB_APPCOMMON_SRCS:=\ - $(SRC)/lib_appcommon/options.cpp \ - $(SRC)/lib_appcommon/timebomb.cpp - -include $(SRC)/lib_media/project.mk -include $(SRC)/plugins/project.mk - -ifeq ($(SIGNALS_HAS_APPS), 1) - include $(SRC)/apps/dashcastx/project.mk - include $(SRC)/apps/ts2ip/project.mk - include $(SRC)/apps/player/project.mk - include $(SRC)/apps/mp42tsx/project.mk - include $(SRC)/apps/monitor/project.mk - include $(SRC)/apps/mcastdump/project.mk - include $(SRC)/tests/project.mk -endif - -ifeq ($(ENABLED_BOMB), 1) - CFLAGS+=-DENABLE_BOMB -DBOMB_TIME_IN_DAYS=$(BOMB_TIME_IN_DAYS) -endif - -#------------------------------------------------------------------------------ - -$(BIN)/$(SRC)/lib_utils/version.cpp.o: CFLAGS+=-I$(BIN) - -#------------------------------------------------------------------------------ -# Generic rules - -targets: $(TARGETS) - -$(BIN)/%.exe: - @mkdir -p $(dir $@) - $(CXX) -o "$@" $^ $(LDFLAGS) - -$(BIN)/%.cpp.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) -c $(CFLAGS) "$<" -o "$@" - @$(CXX) -c $(CFLAGS) "$<" -o "$@.deps" -MP -MM -MT "$@" # deps generation - @$(CXX) -c $(CFLAGS) "$<" -E | wc -l > "$@.lines" # keep track of line count - -clean: - rm -rf $(BIN) - --include $(shell test -d $(BIN) && find $(BIN) -name "*.deps") diff --git a/cmake-pre-build.sh b/cmake-pre-build.sh deleted file mode 100755 index e9d8a7286..000000000 --- a/cmake-pre-build.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Check if a prefix argument is provided -if [ -z "$1" ]; then - echo "Error: No prefix path provided." - echo "Usage: ./cmake-build-dep.sh " - exit 1 -fi - -# Get the prefix argument -PREFIX=$1 - -# Resolve PREFIX to an absolute path -ABSOLUTE_PREFIX=$(realpath "$PREFIX") - -# Set the SYSROOT_PATH environment variable to the resolved absolute prefix -export SYSROOT_PATH="$ABSOLUTE_PREFIX" - -# Print a message to confirm SYSROOT_PATH is set -echo "Setting SYSROOT_PATH to absolute path: $SYSROOT_PATH" - -# Run extra.sh with the absolute PREFIX variable to build the dependencies -echo "Running extra.sh to build dependencies with PREFIX=$ABSOLUTE_PREFIX" -PREFIX="$ABSOLUTE_PREFIX" ./extra.sh - - -# End of the script -echo "Dependencies have been built. SYSROOT_PATH is set to: $SYSROOT_PATH" diff --git a/extra.sh b/extra.sh deleted file mode 100755 index 02075cdbf..000000000 --- a/extra.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash -# -# Download, build and locally deploy external dependencies -# - -set -e -unset EXTRA # security: 'EXTRA' is a signals-specific var, don't use it in zenbuild -export CFLAGS=-w -export ENABLE_NVIDIA=0 -export ENABLE_AWS=0 -export ENABLE_X264=0 -export ENABLE_FREETYPE2=0 -export ENABLE_FFMPEG_PROGRAMS=0 -unset CORES - -#TODO add aws -for i in "$@" -do - case $i in - --enable-nvidia*) - echo "enabling nvidia for FFmpeg..." - export ENABLE_NVIDIA=1 - ;; - --enable-aws*) - echo "enabling support for AWS SDK" - export ENABLE_AWS=1 - ;; - --enable-x264*) - echo "enabling support for x264, please, check the license compatibility" - export ENABLE_X264=1 - ;; - --enable-freetype2*) - echo "enabling support for freetype, please, check the license compatibility" - export ENABLE_FREETYPE2=1 - ;; - --enable-ffmpeg-programs*) - echo "enabling support for ffmpeg programs" - export ENABLE_FFMPEG_PROGRAMS=1 - ;; - --cores=*) - CORES="${i#*=}" - shift # past argument=value - ;; - --help*) - echo "Zenbuild build tool:" - echo -e " \t --help prints this message" - echo -e " \t --enable-aws to enable aws sdk support" - echo -e " \t --enable-x264 to enable x264 support" - echo -e " \t --enable-freetype2 to enable freetype2 support" - echo -e " \t --enable-ffmpeg-programs to enable ffmpeg programs" - echo -e " \t --enable-nvidia to enable the use of nvidia supported features \ -in FFmpeg, please refer to this page: \ -https://trac.ffmpeg.org/wiki/HWAccelIntro" - ;; - *) - ;; - esac -done - -if [ -z "$MAKE" ]; then - if [[ -n "$CORES" ]]; then - echo "Number of cores are user defined, overriding system's default" - elif [ $(uname -s) == "Darwin" ]; then - CORES=$(sysctl -n hw.logicalcpu) - else - CORES=$(nproc) - fi - - export MAKE="make -j$CORES" -fi - -export PREFIX=${PREFIX-} - -if [ -z "$PREFIX" ] ; then - echo "No installation prefix given, please specify the 'PREFIX' environment variable" >&2 - exit 1 -fi - -echo "Installation prefix: $PREFIX" - -if [ -z "$CPREFIX" ]; then - case $OSTYPE in - msys) - CPREFIX=x86_64-w64-mingw32 - echo "MSYS detected ($OSTYPE): forcing use of prefix \"$CPREFIX\"" - ;; - darwin*|linux-musl) - CPREFIX=- - if [ ! -e extra/config.guess ] ; then - wget -O extra/config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' - chmod +x extra/config.guess - fi - HOST=$(extra/config.guess) - echo "$OSTYPE detected: forcing use of prefix \"$CPREFIX\" (host=$HOST)" - ;; - *) - CPREFIX=$(gcc -dumpmachine) - echo "Platform $OSTYPE detected." - ;; - esac -fi -if [ -z "$HOST" ]; then - HOST=$($CPREFIX-gcc -dumpmachine) -fi -echo "Using compiler host ($HOST) with prefix ($CPREFIX)" - -case $OSTYPE in -darwin*) - if [ -z "$NASM" ]; then - echo "You must set the NASM env variable." - fi - ;; -esac - -pushd extra >/dev/null -./zen-extra.sh $CPREFIX -popd >/dev/null - -echo "Done" diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/extra/pkg/zen-asio.sh b/extra/pkg/zen-asio.sh deleted file mode 100755 index f71b35992..000000000 --- a/extra/pkg/zen-asio.sh +++ /dev/null @@ -1,15 +0,0 @@ - -function asio_build { - - lazy_download "asio.tar.gz" https://github.com/chriskohlhoff/asio/archive/asio-1-12-2.tar.gz - lazy_extract "asio.tar.gz" - mkgit asio - - mkdir -p $PREFIX/include/asio - cp -r asio/asio/include/* $PREFIX/include/asio/ -} - -function asio_get_deps { - local a=0 -} - diff --git a/extra/pkg/zen-aws.sh b/extra/pkg/zen-aws.sh deleted file mode 100755 index abaafd167..000000000 --- a/extra/pkg/zen-aws.sh +++ /dev/null @@ -1,38 +0,0 @@ - -function aws_build { - lazy_download "aws.tar.gz" "https://github.com/aws/aws-sdk-cpp/archive/1.7.251.tar.gz" - lazy_extract "aws.tar.gz" - mkgit "aws" - - # remove compiler flags currently leaking all the way down to the client app! - sed '/list(APPEND AWS_COMPILER_FLAGS "-fno-exceptions" "-std=c++${CPP_STANDARD}")/d' \ - -i aws/cmake/compiler_settings.cmake - - rm -rf aws/bin/$host - mkdir -p aws/bin/$host - pushDir aws/bin/$host - cmake \ - -DOPENSSL_ROOT_DIR=$PREFIX \ - -DCURL_ROOT_DIR=$PREFIX \ - -DCURL_LIBRARY=$PREFIX/lib/libcurl.a \ - -DCURL_INCLUDE_DIR=$PREFIX/include \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS=-I$PREFIX/include \ - -DCMAKE_LD_FLAGS=-L$PREFIX/lib \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DCMAKE_INSTALL_LIBDIR=lib \ - -DENABLE_TESTING=OFF \ - -DNO_ENCRYPTION=OFF \ - -DBUILD_ONLY="s3;mediastore;mediastore-data" \ - ../.. - $MAKE - $MAKE install - popDir -} - -function aws_get_deps { - echo libcurl - echo openssl - echo zlib -} - diff --git a/extra/pkg/zen-cppredis.sh b/extra/pkg/zen-cppredis.sh deleted file mode 100644 index a09d895dd..000000000 --- a/extra/pkg/zen-cppredis.sh +++ /dev/null @@ -1,25 +0,0 @@ -function cppredis_build { - host=$1 - - lazy_git_clone https://github.com/cpp-redis/cpp_redis cppredis "d1fc9c7cc61111958a30a9e366a7d6acea1306c4" - sed -i "s/WINSOCK_API_LINKAGE/\/\/WINSOCK_API_LINKAGE/" cppredis/tacopie/sources/network/common/tcp_socket.cpp - sed -i "s/WINSOCK_API_LINKAGE/\/\/WINSOCK_API_LINKAGE/" cppredis/tacopie/sources/network/windows/windows_tcp_socket.cpp - - rm -rf cppredis/bin/$host - mkdir -p cppredis/bin/$host - pushDir cppredis/bin/$host - cmake -G "Unix Makefiles" -DCMAKE_CXX_COMPILER="$host-gcc" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS=-I$PREFIX/include \ - -DCMAKE_LD_FLAGS=-L$PREFIX/lib \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DCMAKE_INSTALL_LIBDIR=lib \ - ../.. - $MAKE - $MAKE install - popDir -} - -function cppredis_get_deps { - local a=0 -} diff --git a/extra/pkg/zen-ffmpeg.sh b/extra/pkg/zen-ffmpeg.sh deleted file mode 100755 index bbafab9c0..000000000 --- a/extra/pkg/zen-ffmpeg.sh +++ /dev/null @@ -1,262 +0,0 @@ - -function ffmpeg_build { - host=$1 - - lazy_download "ffmpeg.tar.gz" "http://ffmpeg.org/releases/ffmpeg-4.3.8.tar.bz2" - lazy_extract "ffmpeg.tar.gz" - mkgit "ffmpeg" - - ( - cd ffmpeg - ffmpeg_patches - ) - - local ARCH=$(get_arch $host) - local OS=$(get_os $host) - - local os=$OS - case $OS in - darwin*) - os="darwin" - ;; - esac - - # remove stupid dependency - $sed -i "s/jack_jack_h pthreads/jack_jack_h/" ffmpeg/configure - - mkdir -p ffmpeg/build/$host - pushDir ffmpeg/build/$host - - local X264="" - if [ $ENABLE_X264 == "1" ]; then - X264="--enable-gpl --enable-libx264" - fi - - # crosscompilation + nvidia aren't friends - local XCOMPILE="--target-os=$os --arch=$ARCH --cross-prefix=$host-" - local NVIDIA="" - if [ $ENABLE_NVIDIA == 1 ]; then - NVIDIA="--enable-cuda-nvcc --enable-cuvid --enable-nonfree --enable-ffnvcodec --enable-vdpau" - XCOMPILE="" - fi - local FREETYPE2="" - if [ $ENABLE_FREETYPE2 == "1" ]; then - FREETYPE2="--enable-libfreetype" - fi - local PROGRAMS="--disable-programs" - if [ $ENABLE_FFMPEG_PROGRAMS == 1 ]; then - PROGRAMS="" - XCOMPILE="" - fi - - CFLAGS="-I$PREFIX/include -I/opt/cuda/include" \ - LDFLAGS="-L$PREFIX/lib -L/opt/cuda/lib64" \ - ../../configure \ - --prefix=$PREFIX \ - --enable-pthreads \ - --disable-w32threads \ - --disable-debug \ - --disable-doc \ - --disable-static \ - --enable-shared \ - $X264 \ - $NVIDIA \ - --enable-libopenh264 \ - --enable-zlib \ - $PROGRAMS \ - --disable-gnutls \ - --disable-openssl \ - --disable-iconv \ - --disable-bzlib \ - --enable-avresample \ - --disable-decoder=mp3float \ - $FREETYPE2 \ - --pkg-config=pkg-config \ - $XCOMPILE - $MAKE - $MAKE install - popDir -} - -function ffmpeg_get_deps { - if [ $ENABLE_NVIDIA == "1" ]; then - echo ffnvenc - fi - echo libpthread - if [ $ENABLE_X264 == "1" ]; then - echo x264 - fi - echo zlib - echo openh264 - if [ $ENABLE_FREETYPE2 == "1" ]; then - echo freetype2 - fi -} - - -function ffmpeg_patches { - local patchFile1=$scriptDir/patches/ffmpeg_01_hlsenc_lower_verbosity.diff - cat << 'EOF' > $patchFile1 -diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c -index c27a66e..6bfb175 100644 ---- a/libavformat/hlsenc.c -+++ b/libavformat/hlsenc.c -@@ -2206,7 +2206,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) - if (pkt->duration) { - vs->duration += (double)(pkt->duration) * st->time_base.num / st->time_base.den; - } else { -- av_log(s, AV_LOG_WARNING, "pkt->duration = 0, maybe the hls segment duration will not precise\n"); -+ av_log(s, AV_LOG_VERBOSE, "pkt->duration = 0, maybe the hls segment duration will not precise\n"); - vs->duration = (double)(pkt->pts - vs->end_pts) * st->time_base.num / st->time_base.den; - } - } -EOF - - applyPatch $patchFile1 - -# #with MPEG-TS input libavformat would assert: -# #[libav-log::panic] Assertion len >= s->orig_buffer_size failed at src/libavformat/aviobuf.c:581 -# #see https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg36880.html -# local patchFile2=$scriptDir/patches/ffmpeg_02_avio_mpegts_demux_assert.diff -# cat << 'EOF' > $patchFile2 -# diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c -# index e752d0e..3344738 100644 -# --- a/libavformat/aviobuf.c -# +++ b/libavformat/aviobuf.c -# @@ -578,8 +578,8 @@ static void fill_buffer(AVIOContext *s) - -# s->checksum_ptr = dst = s->buffer; -# } -# - av_assert0(len >= s->orig_buffer_size); -# - len = s->orig_buffer_size; -# + if (len >= s->orig_buffer_size); -# + len = s->orig_buffer_size; -# } - -# len = read_packet_wrapper(s, dst, len); -# EOF - -# applyPatch $patchFile2 - - - local patchFile3=$scriptDir/patches/ffmpeg_03_aacdec_log_debug.diff - cat << 'EOF' > $patchFile3 -diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c -index d17852d8ba..9597b7d6f1 100644 ---- a/libavcodec/aacdec.c -+++ b/libavcodec/aacdec.c -@@ -317,7 +317,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx, - ac->oc[1].m4ac.chan_config != m4ac.chan_config) { - - if (latmctx->initialized) { -- av_log(avctx, AV_LOG_INFO, "audio config changed (sample_rate=%d, chan_config=%d)\n", m4ac.sample_rate, m4ac.chan_config); -+ av_log(avctx, AV_LOG_DEBUG, "audio config changed (sample_rate=%d, chan_config=%d)\n", m4ac.sample_rate, m4ac.chan_config); - } else { - av_log(avctx, AV_LOG_DEBUG, "initializing latmctx\n"); - } -EOF - applyPatch $patchFile3 - - - local patchFile4=$scriptDir/patches/ffmpeg_04_aacdec_log_debug.diff - cat << 'EOF' > $patchFile4 -diff --git a/libavformat/movenc.c b/libavformat/movenc.c -index e422bdd071..e765cf0253 100644 ---- a/libavformat/movenc.c -+++ b/libavformat/movenc.c -@@ -100,6 +100,7 @@ static const AVOption options[] = { - { "encryption_kid", "The media encryption key identifier (hex)", offsetof(MOVMuxContext, encryption_kid), AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_ENCODING_PARAM }, - { "use_stream_ids_as_track_ids", "use stream ids as track ids", offsetof(MOVMuxContext, use_stream_ids_as_track_ids), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, - { "write_tmcd", "force or disable writing tmcd", offsetof(MOVMuxContext, write_tmcd), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM}, -+ { "ism_offset", "Offset to the ISM fragment start times", offsetof(MOVMuxContext, ism_offset), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM}, - { "write_prft", "Write producer reference time box with specified time source", offsetof(MOVMuxContext, write_prft), AV_OPT_TYPE_INT, {.i64 = MOV_PRFT_NONE}, 0, MOV_PRFT_NB-1, AV_OPT_FLAG_ENCODING_PARAM, "prft"}, - { "wallclock", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MOV_PRFT_SRC_WALLCLOCK}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM, "prft"}, - { "pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MOV_PRFT_SRC_PTS}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM, "prft"}, -@@ -6316,6 +6317,7 @@ static int mov_init(AVFormatContext *s) - * this is updated. */ - track->hint_track = -1; - track->start_dts = AV_NOPTS_VALUE; -+ track->frag_start += mov->ism_offset; - track->start_cts = AV_NOPTS_VALUE; - track->end_pts = AV_NOPTS_VALUE; - track->dts_shift = AV_NOPTS_VALUE; -diff --git a/libavformat/movenc.h b/libavformat/movenc.h -index 68d6f23a5a..28766bcaf2 100644 ---- a/libavformat/movenc.h -+++ b/libavformat/movenc.h -@@ -234,6 +234,8 @@ typedef struct MOVMuxContext { - int write_tmcd; - MOVPrftBox write_prft; - int empty_hdlr_name; -+ -+ int64_t ism_offset; - } MOVMuxContext; - - #define FF_MOV_FLAG_RTP_HINT (1 << 0) -EOF - applyPatch $patchFile4 - - - - local patchFile5=$scriptDir/patches/ffmpeg_05_multiple_frames_in_packet_warning.diff - cat << 'EOF' > $patchFile5 -diff --git a/libavcodec/decode.c b/libavcodec/decode.c -index cd275bacc4..b27d746c12 100644 ---- a/libavcodec/decode.c -+++ b/libavcodec/decode.c -@@ -564,7 +564,7 @@ FF_ENABLE_DEPRECATION_WARNINGS - !avci->showed_multi_packet_warning && - ret >= 0 && ret != pkt->size && !(avctx->codec->capabilities & AV_CODEC_CAP_SUBFRAMES)) { - av_log(avctx, AV_LOG_WARNING, "Multiple frames in a packet.\n"); -- avci->showed_multi_packet_warning = 1; -+ //avci->showed_multi_packet_warning = 1; - } - - if (!got_frame) -EOF - applyPatch $patchFile5 - - local patchFile6=$scriptDir/patches/ffmpeg_06_binutils_shr.diff - cat << 'EOF' > $patchFile6 -diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h -index 6298f5ed1983b..ca7e2dffc1076 100644 ---- a/libavcodec/x86/mathops.h -+++ b/libavcodec/x86/mathops.h - - -@@ -113,19 +121,31 @@ __asm__ volatile(\ - // avoid +32 for shift optimization (gcc should do that ...) - #define NEG_SSR32 NEG_SSR32 - static inline int32_t NEG_SSR32( int32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("sarl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("sarl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } - - #define NEG_USR32 NEG_USR32 - static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("shrl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("shrl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } -EOF - applyPatch $patchFile6 -} diff --git a/extra/pkg/zen-ffnvenc.sh b/extra/pkg/zen-ffnvenc.sh deleted file mode 100644 index 9b8f9e838..000000000 --- a/extra/pkg/zen-ffnvenc.sh +++ /dev/null @@ -1,21 +0,0 @@ - -function ffnvenc_build { - - echo "Extracting $NVIDIA_CODEC_SDK" - unzip $NVIDIA_CODEC_SDK - pushDir $(basename $NVIDIA_CODEC_SDK .zip) - popDir - rm -rf $(basename $NVIDIA_CODEC_SDK .zip) - - - git clone https://github.com/FFmpeg/nv-codec-headers.git - pushDir nv-codec-headers - sed -i "s|/usr/local|$PREFIX|g" Makefile - make - make install - popDir -} - -function ffnvenc_get_deps { - local a=0 -} \ No newline at end of file diff --git a/extra/pkg/zen-freetype2.sh b/extra/pkg/zen-freetype2.sh deleted file mode 100755 index a3ed44732..000000000 --- a/extra/pkg/zen-freetype2.sh +++ /dev/null @@ -1,43 +0,0 @@ - -function freetype2_build { - host=$1 - - lazy_download "freetype2.tar.bz2" "http://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.gz" - lazy_extract "freetype2.tar.bz2" - mkgit "freetype2" - - pushDir "freetype2" - freetype2_patches - popDir - - autoconf_build $host "freetype2" \ - "--without-png" \ - "--enable-shared" \ - "--disable-static" -} - -function freetype2_get_deps { - echo zlib -} - -function freetype2_patches { - local patchFile=$scriptDir/patches/freetype2_01_pkgconfig.diff - cat << 'EOF' > $patchFile -diff --git a/builds/unix/freetype2.in b/builds/unix/freetype2.in -index c4dfda4..97f256e 100644 ---- a/builds/unix/freetype2.in -+++ b/builds/unix/freetype2.in -@@ -7,7 +7,7 @@ Name: FreeType 2 - URL: http://freetype.org - Description: A free, high-quality, and portable font engine. - Version: %ft_version% --Requires: -+Requires: %REQUIRES_PRIVATE% - Requires.private: %REQUIRES_PRIVATE% - Libs: -L${libdir} -lfreetype - Libs.private: %LIBS_PRIVATE% -EOF - - applyPatch $patchFile -} - diff --git a/extra/pkg/zen-gpac.sh b/extra/pkg/zen-gpac.sh deleted file mode 100755 index c682651d0..000000000 --- a/extra/pkg/zen-gpac.sh +++ /dev/null @@ -1,126 +0,0 @@ - -function gpac_build { - host=$1 - - # do not use a truncated hash here, use the full hash! - # (collisions DO occur with truncated hashes, in practice this would - # have the effect of stopping the whole build) - readonly hash="c02c9a2fb0815bfd28b7c4c46630601ad7fe291d" - - lazy_git_clone https://github.com/gpac/gpac.git gpac "$hash" - - local OS=$(get_os $host) - local crossPrefix=$(get_cross_prefix $BUILD $host) - - local os=$OS - case $OS in - darwin*) - os="Darwin" - if [ ! -f `which $host-libtool` ]; then - # needed when cross-compiling but not on native - echo "LIBTOOL=$host-libtool" >> config.mak - fi - echo "STRIP:=$host-\$(STRIP)" >> config.mak - ;; - esac - - mkdir -p gpac/build/$host - pushDir gpac/build/$host - - local options=() - - options+=(--disable-player) - - # Can't use --disable-all, because it sets GPAC_DISABLE_CORE_TOOLS - # options+=(--disable-all) # disables all features in libgpac - - options+=(--disable-ssl) # disable OpenSSL support - options+=(--disable-alsa) # disable Alsa audio - options+=(--disable-jack) # disable Jack audio - options+=(--disable-oss-audio) # disable OSS audio - options+=(--disable-pulseaudio) # disable Pulse audio - - options+=(--use-png=no) - options+=(--use-jpeg=no) - - options+=(--disable-3d) # disable 3D rendering - options+=(--disable-atsc) # disable ATSC3 support - options+=(--disable-avi) # disable AVI - options+=(--disable-bifs) # disable BIFS - options+=(--disable-bifs-enc) # disable BIFS coder - options+=(--disable-crypt) # disable crypto tools - options+=(--disable-dvb4linux) # disable dvb4linux support - options+=(--disable-dvbx) # disable DVB-specific tools (MPE, FEC, DSM-CC) - options+=(--disable-ipv6) # disable IPV6 support - options+=(--disable-laser) # disable LASeR coder - options+=(--disable-loader-bt) # disable scene loading from ISO File Format - options+=(--disable-loader-isoff) # disable scene loading from ISO File Format - options+=(--disable-loader-xmt) # disable scene loading from ISO File Format - options+=(--disable-m2ps) # disable MPEG2 PS - options+=(--disable-mcrypt) # disable MCRYPT support - options+=(--disable-od-dump) # disable OD dump - options+=(--disable-odf) # disable full support of MPEG-4 OD Framework - options+=(--disable-ogg) # disable OGG - options+=(--disable-opt) # disable GCC optimizations - options+=(--disable-platinum) # disable Platinum UPnP support - options+=(--disable-qtvr) # disable import of Cubic QTVR files - options+=(--disable-saf) # disable SAF container - options+=(--disable-scene-dump) # disable scene graph dump - options+=(--disable-scene-encode) # disable BIFS & LASeR to ISO File Format encoding - options+=(--disable-scene-stats) # disable scene graph statistics - options+=(--disable-scenegraph) # disable scenegraph, scene parsers and player (terminal and compositor) - options+=(--disable-seng) # disable scene encoder engine - options+=(--disable-sman) # disable scene manager - options+=(--disable-streaming) # disable RTP/RTSP/SDP - options+=(--disable-svg) # disable SVG - options+=(--disable-swf) # disable SWF import - options+=(--disable-vobsub) # disable VobSub support - options+=(--disable-vrml) # disable MPEG-4/VRML/X3D - options+=(--disable-wx) # disable wxWidgets support - options+=(--disable-x11) # disable X11 - options+=(--disable-x11-shm) # disable X11 shared memory support - options+=(--disable-x11-xv) # disable X11 Xvideo support - options+=(--disable-x3d) # disable X3D only - - # Features that we actually use - options+=(--enable-export) # enable media exporters - options+=(--enable-import) # enable media importers - options+=(--enable-parsers) # enable AV parsers - options+=(--enable-m2ts) # enable MPEG2 TS - options+=(--enable-m2ts-mux) # enable MPEG2 TS Multiplexer - options+=(--enable-ttxt) # enable TTXT (3GPP / MPEG-4 Timed Text) support - options+=(--enable-hevc) # enable HEVC support - options+=(--enable-isoff) # enable ISO File Format - options+=(--enable-isoff-frag) # enable fragments in ISO File Format - options+=(--enable-isoff-hds) # enable HDS support in ISO File Format - options+=(--enable-isoff-hint) # enable ISO File Format hinting - options+=(--enable-isoff-write) # enable ISO File Format edit/write - - # We don't use 'isom-dump', however GPAC will generate an unlinkable libgpac.so otherwise - options+=(--enable-isom-dump) # enable ISOM dump - - ../../configure \ - --target-os=$os \ - --cross-prefix="$crossPrefix" \ - --extra-cflags="-I$PREFIX/include -w -fPIC" \ - --extra-ldflags="-L$PREFIX/lib" \ - --verbose \ - --prefix=$PREFIX \ - ${options[@]} - - $MAKE lib - $MAKE install # this is what causes gpac.pc to be copied to lib/pkg-config - $MAKE install-lib - - popDir -} - -function gpac_get_deps { - echo libpthread - echo ffmpeg - echo freetype2 - echo libogg - echo libogg - echo zlib -} - diff --git a/extra/pkg/zen-libcurl.sh b/extra/pkg/zen-libcurl.sh deleted file mode 100755 index 5f94700e2..000000000 --- a/extra/pkg/zen-libcurl.sh +++ /dev/null @@ -1,66 +0,0 @@ -function libcurl_build { - lazy_download "libcurl.tar.gz" "https://curl.haxx.se/download/curl-7.67.0.tar.bz2" - lazy_extract "libcurl.tar.gz" - - local options=() - - # Only enable what's needed, disable everything else: - # We don't want any autodetection, as this would make depend - # the resulting feature on the build environment! - - # options+=(--disable-rtsp) # Disable RTSP support - # options+=(--without-librtmp) # disable LIBRTMP - # options+=(--without-zlib) # disable use of zlib - # options+=(--disable-http) # Disable HTTP support - # options+=(--disable-ipv6) # Disable IPv6 support - options+=(--with-ssl=$PREFIX) # enable OpenSSL - - options+=(--disable-threaded-resolver) # Disable threaded resolver - options+=(--disable-debug) # Disable debug build options - options+=(--disable-warnings) # Disable strict compiler warnings - options+=(--disable-werror) # Disable compiler warnings as errors - options+=(--disable-curldebug) # Disable curl debug memory tracking - options+=(--disable-ares) # Disable c-ares for DNS lookups - options+=(--disable-rt) # disable dependency on -lrt - options+=(--disable-ftp) # Disable FTP support - options+=(--disable-file) # Disable FILE support - options+=(--disable-ldap) # Disable LDAP support - options+=(--disable-ldaps) # Disable LDAPS support - options+=(--disable-proxy) # Disable proxy support - options+=(--disable-dict) # Disable DICT support - options+=(--disable-telnet) # Disable TELNET support - options+=(--disable-tftp) # Disable TFTP support - options+=(--disable-pop3) # Disable POP3 support - options+=(--disable-imap) # Disable IMAP support - options+=(--disable-smb) # Disable SMB/CIFS support - options+=(--disable-smtp) # Disable SMTP support - options+=(--disable-gopher) # Disable Gopher support - options+=(--disable-manual) # Disable built-in manual - options+=(--disable-pthreads) # Disable POSIX threads - options+=(--disable-sspi) # Disable SSPI - options+=(--disable-crypto-auth) # Disable cryptographic authentication - options+=(--disable-ntlm-wb) # Disable NTLM delegation to winbind's ntlm_auth - options+=(--disable-tls-srp) # Disable TLS-SRP authentication - options+=(--disable-unix-sockets) # Disable Unix domain sockets - options+=(--disable-cookies) # Disable cookies support - options+=(--without-brotli) # disable BROTLI - options+=(--without-winssl) # disable Windows native SSL/TLS - options+=(--without-darwinssl) # disable Apple OS native SSL/TLS - options+=(--without-gnutls) # disable GnuTLS detection - options+=(--without-polarssl) # disable PolarSSL detection - options+=(--without-mbedtls) # disable mbedTLS detection - options+=(--without-cyassl) # disable CyaSSL detection - options+=(--without-wolfssl) # disable WolfSSL detection - options+=(--without-mesalink) # disable MesaLink detection - options+=(--without-nss) # disable NSS detection - options+=(--without-axtls) # disable axTLS - options+=(--without-libpsl) # disable support for libpsl cookie checking - options+=(--without-libmetalink) # disable libmetalink detection - options+=(--without-winidn) # disable Windows native IDN - - autoconf_build $host "libcurl" ${options[@]} -} - -function libcurl_get_deps { - echo openssl -} diff --git a/extra/pkg/zen-libepoxy.sh b/extra/pkg/zen-libepoxy.sh deleted file mode 100755 index 6fcfff559..000000000 --- a/extra/pkg/zen-libepoxy.sh +++ /dev/null @@ -1,25 +0,0 @@ - -function libepoxy_build { - host=$1 - - lazy_download "libepoxy.tar.xz" "https://github.com/anholt/libepoxy/releases/download/1.5.4/libepoxy-1.5.4.tar.xz" - lazy_extract "libepoxy.tar.xz" - mkgit "libepoxy" - - # hack for native build, otherwise egl.pc isn't found - PKG_CONFIG_PATH=/usr/lib/$host/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig \ - rm -rf libepoxy/bin/$host - mkdir -p libepoxy/bin/$host - pushDir libepoxy/bin/$host - meson ../.. . --prefix=$PREFIX - ninja - ninja install - popDir -} - -function libepoxy_get_deps { - local a=0 -} - - - diff --git a/extra/pkg/zen-libjpegturbo.sh b/extra/pkg/zen-libjpegturbo.sh deleted file mode 100755 index 37a4700e1..000000000 --- a/extra/pkg/zen-libjpegturbo.sh +++ /dev/null @@ -1,12 +0,0 @@ - -function libjpeg-turbo_build { - lazy_download "libjpeg-turbo.tar.gz" "https://sourceforge.net/projects/libjpeg-turbo/files/1.5.3/libjpeg-turbo-1.5.3.tar.gz/download" - lazy_extract "libjpeg-turbo.tar.gz" - - autoconf_build $host "libjpeg-turbo" -} - -function libjpeg-turbo_get_deps { - local a=0 -} - diff --git a/extra/pkg/zen-libogg.sh b/extra/pkg/zen-libogg.sh deleted file mode 100755 index 6d7252e8a..000000000 --- a/extra/pkg/zen-libogg.sh +++ /dev/null @@ -1,16 +0,0 @@ - -function libogg_build { - host=$1 - - lazy_download "libogg.tar.gz" "http://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.gz" - lazy_extract "libogg.tar.gz" - mkgit "libogg" - - autoconf_build $host "libogg" -} - -function libogg_get_deps { - echo "" -} - - diff --git a/extra/pkg/zen-libpng.sh b/extra/pkg/zen-libpng.sh deleted file mode 100755 index 9d70f2633..000000000 --- a/extra/pkg/zen-libpng.sh +++ /dev/null @@ -1,22 +0,0 @@ - -function libpng_build { - host=$1 - - lazy_download "libpng.tar.xz" "http://prdownloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz?download" - lazy_extract "libpng.tar.xz" - mkgit "libpng" - - # workaround 'zlib not installed' (libpng's BS doesn't use pkg-config for zlib) - LDFLAGS+=" -L$PREFIX/lib" \ - CFLAGS+=" -I$PREFIX/include" \ - CPPFLAGS+=" -I$PREFIX/include" \ - autoconf_build $host "libpng" \ - --enable-shared \ - --disable-static -} - -function libpng_get_deps { - echo "zlib" -} - - diff --git a/extra/pkg/zen-libpthread.sh b/extra/pkg/zen-libpthread.sh deleted file mode 100755 index 734fa0582..000000000 --- a/extra/pkg/zen-libpthread.sh +++ /dev/null @@ -1,39 +0,0 @@ - -function libpthread_get_deps { - local a=0 -} - -function libpthread_build { - case $host in - *mingw*) - libpthread_build_mingw $@ - ;; - *) - libpthread_build_native $@ - ;; - esac -} - -function libpthread_build_mingw { - local host=$1 - - lazy_download "mingw-w64.tar.bz2" "https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v5.0.3.tar.bz2/download" - lazy_extract "mingw-w64.tar.bz2" - pushDir mingw-w64/mingw-w64-libraries - - autoconf_build $host "winpthreads" - - popDir -} - -function libpthread_build_native { - local host=$1 - pushDir $WORK/src - - lazy_download "libpthread.tar.bz2" "http://xcb.freedesktop.org/dist/libpthread-stubs-0.1.tar.bz2" - lazy_extract "libpthread.tar.bz2" - autoconf_build $host "libpthread" - - popDir -} - diff --git a/extra/pkg/zen-libsdl2.sh b/extra/pkg/zen-libsdl2.sh deleted file mode 100755 index 8db28924f..000000000 --- a/extra/pkg/zen-libsdl2.sh +++ /dev/null @@ -1,20 +0,0 @@ - -function libsdl2_build { - local host=$1 - - lazy_download "libsdl2.tar.gz" "https://www.libsdl.org/release/SDL2-2.0.10.tar.gz" - lazy_extract "libsdl2.tar.gz" - mkgit "libsdl2" - - autoconf_build $host "libsdl2" - - # fix SDL2 leaking flags to the user build system - # this one in particular is incompatible with the usage of and pthreads - # (see: gcc #52590) - $sed -i "s/-static-libgcc//" $PREFIX/lib/pkgconfig/sdl2.pc -} - -function libsdl2_get_deps { - local a=0 -} - diff --git a/extra/pkg/zen-openh264.sh b/extra/pkg/zen-openh264.sh deleted file mode 100644 index 60e355388..000000000 --- a/extra/pkg/zen-openh264.sh +++ /dev/null @@ -1,40 +0,0 @@ -function openh264_build { - host=$1 - pushDir $WORK/src - - local ARCH=$(get_arch $host) - local OS=$(get_os $host) - - case $host in - *mingw*) - OS=mingw_nt - ;; - *gnu*) - OS=linux - ;; - *darwin*) - OS=darwin - ;; - esac - - lazy_download "openh264.tar.gz" "https://github.com/cisco/openh264/archive/v2.0.0.tar.gz" - lazy_extract "openh264.tar.gz" - mkgit "openh264" - - pushDir openh264 - - # these are hardcoded in the Makefile - $sed -i "s@^PREFIX=.*@PREFIX=$PREFIX@" Makefile - $sed -i "s@^ARCH=.*@ARCH=$ARCH@" Makefile - $sed -i "s@^OS=.*@OS=$OS@" Makefile - - AR=$host-ar CC=$host-gcc CXX=$host-g++ $MAKE - AR=$host-ar CC=$host-gcc CXX=$host-g++ $MAKE install - - popDir - popDir -} - -function openh264_get_deps { - local a=0 -} diff --git a/extra/pkg/zen-openssl.sh b/extra/pkg/zen-openssl.sh deleted file mode 100755 index f974a0159..000000000 --- a/extra/pkg/zen-openssl.sh +++ /dev/null @@ -1,17 +0,0 @@ - -function openssl_build { - lazy_download "libressl.tar.gz" https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.0.2.tar.gz - lazy_extract "libressl.tar.gz" - - # Don't build manpages. - # We don't use them, it's slow on all platforms, and it fails under MSYS2. - sed 's/^SUBDIRS = \(.*\) man/SUBDIRS = \1/' -i libressl/Makefile.in - - # static lib needed for the TLS handshake table - autoconf_build $host "libressl" \ - "--enable-shared" -} - -function openssl_get_deps { - local a=0 -} diff --git a/extra/pkg/zen-postgres.sh b/extra/pkg/zen-postgres.sh deleted file mode 100755 index aa238846a..000000000 --- a/extra/pkg/zen-postgres.sh +++ /dev/null @@ -1,38 +0,0 @@ -function postgres_build { - lazy_download "postgres.tar.bz2" "https://ftp.postgresql.org/pub/source/v10.11/postgresql-10.11.tar.bz2" - lazy_extract "postgres.tar.bz2" - - # Workaround: out-of-tree mingw builds are broken (postgreSQL 10.11) - # (it can't find libpqdll.def and other .def files). - # Let the build system regenerate those files, where it can find them aftewards. - find postgres -name "*.def" -delete - - mkdir -p postgres/build/$host - pushDir postgres/build/$host - - CFLAGS="-I$PREFIX/include" \ - LDFLAGS="-L$PREFIX/lib" \ - ac_cv_file__dev_urandom=yes \ - ../../configure \ - --build=$BUILD \ - --host=$host \ - --prefix=$PREFIX \ - --without-openssl \ - --without-zlib \ - "--without-readline" \ - "--with-system-tzdata=/usr/share/zoneinfo" - - # only build the strict minimum for postgresql client - $MAKE -C src/include - $MAKE -C src/common - $MAKE -C src/interfaces - $MAKE -C src/interfaces install - cp ../../src/include/postgres_ext.h $PREFIX/include - cp src/include/pg_config_ext.h $PREFIX/include - - popDir -} - -function postgres_get_deps { - local a=0 -} diff --git a/extra/pkg/zen-rapidjson.sh b/extra/pkg/zen-rapidjson.sh deleted file mode 100755 index be5cc9792..000000000 --- a/extra/pkg/zen-rapidjson.sh +++ /dev/null @@ -1,10 +0,0 @@ -function rapidjson_build { - host=$1 - - lazy_git_clone https://github.com/miloyip/rapidjson.git rapidjson dfbe1db9da455552f7a9ad5d2aea17dd9d832ac1 - cp -r rapidjson/include/rapidjson $PREFIX/include/ -} - -function rapidjson_get_deps { - local a=0 -} diff --git a/extra/pkg/zen-sqlite3.sh b/extra/pkg/zen-sqlite3.sh deleted file mode 100755 index 52cb07cac..000000000 --- a/extra/pkg/zen-sqlite3.sh +++ /dev/null @@ -1,11 +0,0 @@ - -function sqlite3_build { - lazy_download "sqlite3.tar.gz" "https://www.sqlite.org/2019/sqlite-autoconf-3300100.tar.gz" - lazy_extract "sqlite3.tar.gz" - autoconf_build $host "sqlite3" -} - -function sqlite3_get_deps { - local a=0 -} - diff --git a/extra/pkg/zen-srt.sh b/extra/pkg/zen-srt.sh deleted file mode 100755 index 4b5cf22c0..000000000 --- a/extra/pkg/zen-srt.sh +++ /dev/null @@ -1,62 +0,0 @@ - -function srt_build { - lazy_download "srt.tar.gz" "https://github.com/Haivision/srt/archive/v1.5.3.tar.gz" - lazy_extract "srt.tar.gz" - mkgit "srt" - - rm -rf srt/bin/$host - mkdir -p srt/bin/$host - pushDir srt/bin/$host - - local systemName="" - - case $host in - *mingw*) - systemName="Windows" - ;; - *linux*) - systemName="Linux" - ;; - *darwin*) - systemName="Darwin" - ;; - esac - - # ENABLE_CXX11=OFF: disable building of test apps, whose linking is broken - # CMAKE_SYSTEM_NAME: without it, cmake doesn't realize we're cross-compiling, - # and tries to use native-specific compiler options (e.g -rdynamic). - cmake \ - -G "Unix Makefiles" \ - -DCMAKE_SYSTEM_NAME=$systemName \ - -DCMAKE_C_COMPILER=$host-gcc \ - -DCMAKE_CXX_COMPILER=$host-g++ \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DENABLE_CXX11=OFF \ - -DENABLE_SHARED=ON \ - -DENABLE_STATIC=OFF \ - -DENABLE_INET_PTON=ON \ - ../.. - $MAKE - $MAKE install - popDir - - # Workaround: for some reason, 'libsrt.so.1.3.2' that gets installed by - # 'make install' differs from the one from the build directory, - # and is unable to find its dependencies (libcrypto, libssl), making the - # ffmpeg 'configure' fail. - case $host in - *linux*) - if ! diff -q "srt/bin/$host/libsrt.so.1.5.3" "$PREFIX/lib/libsrt.so.1.5.3" ; then - echo "WTF!" - fi - - cp "srt/bin/$host/libsrt.so.1.5.3" $PREFIX/lib - ;; - esac -} - -function srt_get_deps { - echo openssl -} - diff --git a/extra/pkg/zen-x264.sh b/extra/pkg/zen-x264.sh deleted file mode 100755 index 6fae1eec0..000000000 --- a/extra/pkg/zen-x264.sh +++ /dev/null @@ -1,73 +0,0 @@ - -function x264_build { - local host=$1 - local crossPrefix=$(get_cross_prefix $BUILD $host) - - lazy_git_clone "https://github.com/mirror/x264.git" x264 1771b556ee45207f8711744ccbd5d42a3949b14c - - ( - cd x264 - libx264_patches - ) - - case $host in - *darwin*) - RANLIB="" x264_do_build - ;; - *mingw*) - x264_do_build --enable-win32thread - ;; - *) - x264_do_build - ;; - esac -} - -function x264_get_deps { - echo "libpthread" -} - -function x264_do_build { - autoconf_build $host x264 \ - --enable-static \ - --enable-pic \ - --disable-gpl \ - --disable-cli \ - --enable-strip \ - --disable-avs \ - --disable-swscale \ - --disable-lavf \ - --disable-ffms \ - --disable-gpac \ - --disable-opencl \ - --cross-prefix=$crossPrefix \ - "$@" -} - -function libx264_patches { - local patchFile=$scriptDir/patches/libx264_01_remove_version_sei.diff - cat << 'EOF' > $patchFile -diff --git a/encoder/encoder.c b/encoder/encoder.c -index 54d2e5a8..5e079a80 100644 ---- a/encoder/encoder.c -+++ b/encoder/encoder.c -@@ -1978,12 +1978,15 @@ int x264_encoder_headers( x264_t *h, x264_nal_t **pp_nal, int *pi_nal ) - if( x264_nal_end( h ) ) - return -1; - -+ if(0) -+ { - /* identify ourselves */ - x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE ); - if( x264_sei_version_write( h, &h->out.bs ) ) - return -1; - if( x264_nal_end( h ) ) - return -1; -+ } - - frame_size = x264_encoder_encapsulate_nals( h, 0 ); - if( frame_size < 0 ) -EOF - - applyPatch $patchFile -} diff --git a/extra/pkg/zen-zlib.sh b/extra/pkg/zen-zlib.sh deleted file mode 100755 index ee50cf50f..000000000 --- a/extra/pkg/zen-zlib.sh +++ /dev/null @@ -1,49 +0,0 @@ - -function zlib_build { - lazy_download "zlib.tar.gz" "http://zlib.net/fossils/zlib-1.2.11.tar.gz" - lazy_extract "zlib.tar.gz" - mkgit "zlib" - - local options=() - - options+=(-DCMAKE_INSTALL_PREFIX=$PREFIX) - - # prevent CMAKE from adding -rdynamic, - # which mingw doesn't support - case $host in - *mingw*) - options+=(-DCMAKE_SYSTEM_NAME=Windows) - ;; - *darwin*) - options+=(-DCMAKE_SYSTEM_NAME=Darwin) - options+=(-DAPPLE=1) - ;; - esac - - rm -rf zlib/bin/$host - mkdir -p zlib/bin/$host - pushDir zlib/bin/$host - cmake \ - -DCMAKE_C_COMPILER=$host-gcc \ - -DCMAKE_CXX_COMPILER=$host-g++ \ - -DCMAKE_RC_COMPILER=$host-windres \ - ${options[@]} \ - ../.. - $MAKE - $MAKE install - popDir - - # zlib's pkg-config does '-lz', but this won't work as the - # mingw build of zlib doesn't build a 'libz.a'. - # So make one. - case $host in - *mingw*) - cp $PREFIX/lib/libzlib.dll.a $PREFIX/lib/libz.a - ;; - esac -} - -function zlib_get_deps { - local a=0 -} - diff --git a/extra/zen-extra.sh b/extra/zen-extra.sh deleted file mode 100755 index ff2088aa8..000000000 --- a/extra/zen-extra.sh +++ /dev/null @@ -1,784 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -readonly workDir=${workDir-/tmp/mem/zen-work} -readonly cacheDir=${cacheDir-/tmp/mem/zen-cache} - -function main { - readonly scriptDir=$(get_abs_dir $(dirname $0)) - - for f in $scriptDir/pkg/zen-*.sh ; do - source $f - done - - checkForCommonBuildTools - - for pkg in $(get_root_packages $1) ; do - buildPackage $workDir "$pkg" $1 - done -} - -# these are the packages we directly depend upon -function get_root_packages -{ - local host=$1 - - echo srt - - if ([ "$host" == "x86_64-pc-linux-gnu" ] || [ "$host" = "x86_64-linux-gnu" ]) && [ $ENABLE_AWS == "1" ]; then - echo aws - fi - - echo libepoxy - echo openssl - echo sqlite3 - echo postgres - echo asio - echo ffmpeg - echo gpac - echo libcurl - echo libjpeg-turbo - echo libsdl2 - echo rapidjson -} - -##################################### -# ZenBuild utility functions -##################################### - -function prefixLog { - pfx=$1 - shift - "$@" 2>&1 | sed -u "s/^.*$/$pfx&/" -} - -function printMsg { - echo -n "" - echo $* - echo -n "" -} - -function isMissing { - progName=$1 - echo -n "Checking for $progName ... " - if which $progName 1>/dev/null 2>/dev/null; then - echo "ok" - return 1 - else - return 0 - fi -} - -function installErrorHandler { - trap "printMsg 'Spawning a rescue shell in current build directory'; PS1='\\w: rescue$ ' bash --norc" EXIT -} - -function uninstallErrorHandler { - trap - EXIT -} - -function lazy_download { - local file="$1" - local url="$2" - - local hashKey=$(echo "$url" | md5sum - | sed 's/ .*//') - - mkdir -p $cacheDir - if [ ! -e "$cacheDir/$hashKey" ]; then - echo "Downloading: $file" - wget "$url" -c -O "$cacheDir/${hashKey}.tmp" --no-verbose - mv "$cacheDir/${hashKey}.tmp" "$cacheDir/$hashKey" # ensure atomicity - fi - - cp "$cacheDir/${hashKey}" "$file" -} - -function lazy_extract { - local archive="$1" - echo -n "Extracting $archive ... " - local name=$(basename $archive .tar.gz) - name=$(basename $name .tar.bz2) - name=$(basename $name .tar.xz) - - local tar_cmd="tar" - if [ $(uname -s) == "Darwin" ]; then - tar_cmd="gtar" - fi - - if [ -d $name ]; then - echo "already extracted" - else - rm -rf ${name}.tmp - mkdir ${name}.tmp - $tar_cmd -C ${name}.tmp -xlf "$archive" --strip-components=1 - mv ${name}.tmp $name - echo "ok" - fi -} - -function lazy_git_clone { - local url="$1" - local to="$2" - local rev="$3" - local depth=1 - - if [ -d "$to/.git" ] ; - then - pushDir "$to" - git reset -q --hard - git clean -q -f - popDir - else - echo "git clone: $url" - git clone --depth=$depth "$url" "$to" - fi - - pushDir "$to" - while ! git checkout -q $rev ; do - depth=$(($depth * 10)) - # "git clone --depth" defaults to only downloading the default branch, - # but not tags. - git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' - git fetch origin --depth=$depth - done - git submodule update --init - popDir -} - -function mkgit { - dir="$1" - - pushDir "$dir" - if [ -d ".git" ]; then - printMsg "Restoring $dir from git restore point" - git reset -q --hard - git clean -q -f - else - printMsg "Creating git for $dir" - git init - git config user.email "nobody@localhost" - git config user.name "Nobody" - git config core.autocrlf false - git add -f * - git commit --quiet -m "Zenbuild restore point" - fi - popDir -} - -function applyPatch { - local patchFile=$1 - printMsg "Patching $patchFile" - if [ $(uname -s) == "Darwin" ]; then - patch --no-backup-if-mismatch -p1 -i $patchFile - else - patch --no-backup-if-mismatch --merge -p1 -i $patchFile - fi -} - -function buildPackage { - local packageName=$2 - local hostPlatform=$3 - - if [ -z "$1" ] || [ -z "$packageName" ] || [ -z "$hostPlatform" ] ; then - echo "Usage: $0 " - echo "Example: $0 /tmp/work libav x86_64-w64-mingw32" - echo "Example: $0 /tmp/work gpac -" - exit 1 - fi - - mkdir -p "$1" - WORK=$(get_abs_dir "$1") - - if echo $PATH | grep " " ; then - echo "Your PATH contain spaces, this may cause build issues." - echo "Please clean-up your PATH and retry." - echo "Example:" - echo "$ PATH=/mingw64/bin:/bin:/usr/bin ./zenbuild.sh " - exit 3 - fi - - if [ -z "${PREFIX-}" ] ; then - echo "PREFIX needs to be defined" >&2 - exit 4 - fi - - if [ ! -e "$scriptDir/config.guess" ]; then - wget -O "$scriptDir/config.guess" 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' - chmod +x "$scriptDir/config.guess" - fi - BUILD=$($scriptDir/config.guess | sed 's/-unknown//' | sed 's/-msys$/-mingw32/') - mkdir -p patches - - if [ $hostPlatform = "-" ]; then - hostPlatform=$BUILD - fi - - if [ -z ${alreadyDone:-} ] ; then - printMsg "Building in: $WORK" - - printMsg "Build platform: $BUILD" - printMsg "Target platform: $hostPlatform" - - initSymlinks - checkForCrossChain "$BUILD" "$hostPlatform" - alreadyDone="yes" - fi - - mkdir -p $WORK/src - - export PREFIX - for dir in "lib" "bin" "include" - do - mkdir -p "$PREFIX/${dir}" - done - - initCflags - - build ${hostPlatform} ${packageName} -} - -function initSymlinks { - local symlink_dir=$WORK/symlinks - mkdir -p $symlink_dir - local tools="cc gcc g++ ar as nm strings strip" - case $hostPlatform in - # *darwin*) - # echo "Detected new Darwin host ($host): disabling ranlib" - # ;; - *) - tools="$tools ranlib" - ;; - esac - case $hostPlatform in - *mingw*) - tools+=" dlltool windres" - ;; - esac - for tool in $tools - do - if which $hostPlatform-$tool > /dev/null ; then - continue - fi - local dest=$symlink_dir/$hostPlatform-$tool - if [ ! -f $dest ]; then - ln -s $(which $tool) $dest - fi - done - export PATH=$PATH:$symlink_dir -} - -function initCflags { - # avoid interferences from environment - unset CC - unset CXX - unset CFLAGS - unset CXXFLAGS - unset LDFLAGS - - CFLAGS="-O2" - CXXFLAGS="-O2" - LDFLAGS="-s" - - CFLAGS+=" -w" - CXXFLAGS+=" -w" - - # Don't statically link libgcc: this is incompatible with the pthreads - # library, which dynamically loads libgcc_s. - # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56101#c2 - # LDFLAGS+=" -static-libgcc" - - if [ $(uname -s) != "Darwin" ]; then - LDFLAGS+=" -static-libstdc++" - fi - - export CFLAGS - export CXXFLAGS - export LDFLAGS - - if [ $(uname -s) == "Darwin" ]; then - local cores=$(sysctl -n hw.logicalcpu) - else - local cores=$(nproc) - fi - - if [ -z "$MAKE" ]; then - MAKE="make -j$cores" - fi - - export MAKE -} - -function importPkgScript { - local name=$1 - if ! test -f zen-${name}.sh; then - echo "Package $name does not have a zenbuild script" - exit 1 - fi - - source zen-${name}.sh -} - -function lazy_build { - local host=$1 - local name=$2 - - export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig - export PKG_CONFIG_LIBDIR=$PREFIX/lib/pkgconfig - - if is_built $host $name ; then - printMsg "$name: already built" - return - fi - - - printMsg "$name: building ..." - - local deps=$(${name}_get_deps) - for depName in $deps ; do - build $host $depName - done - - pushDir $WORK/src - - # launch the builder in a separate process - # so it cannot modify our environment. - ( - installErrorHandler - ${name}_build $host - uninstallErrorHandler - ) - - popDir - - printMsg "$name: build OK" - mark_as_built $host $name -} - -function mark_as_built { - local host=$1 - local name=$2 - - local flagfile="$WORK/flags/$host/${name}.built" - mkdir -p $(dirname $flagfile) - touch $flagfile -} - -function is_built { - local host=$1 - local name=$2 - - local flagfile="$WORK/flags/$host/${name}.built" - if [ -f "$flagfile" ] ; - then - return 0 - else - return 1 - fi -} - -function autoconf_build { - local host=$1 - shift - local name=$1 - shift - - if [ ! -f $name/configure ] ; then - printMsg "WARNING: package '$name' has no configure script, running autoreconf" - pushDir $name - aclocal && libtoolize --force && autoreconf - popDir - fi - - rm -rf $name/build/$host - mkdir -p $name/build/$host - pushDir $name/build/$host - ../../configure \ - --build=$BUILD \ - --host=$host \ - --prefix=$PREFIX \ - "$@" - $MAKE - $MAKE install - popDir -} - -function build { - local host=$1 - local name=$2 - lazy_build $host $name -} - -function pushDir { - local dir="$1" - pushd "$dir" 1>/dev/null 2>/dev/null -} - -function popDir { - popd 1>/dev/null 2>/dev/null -} - -function get_cross_prefix { - local build=$1 - local host=$2 - - if [ "$host" = "-" ] ; then - echo "" - else - echo "$host-" - fi -} - -function checkForCrossChain { - local build=$1 - local host=$2 - local error="0" - - local cross_prefix=$(get_cross_prefix $build $host) - - # ------------- GCC ------------- - if isMissing "${cross_prefix}g++" ; then - echo "No ${cross_prefix}g++ was found in the PATH." - error="1" - fi - - if isMissing "${cross_prefix}gcc" ; then - echo "No ${cross_prefix}gcc was found in the PATH." - error="1" - fi - - # ------------- Binutils ------------- - if isMissing "${cross_prefix}nm" ; then - echo "No ${cross_prefix}nm was found in the PATH." - error="1" - fi - - if isMissing "${cross_prefix}ar" ; then - echo "No ${cross_prefix}ar was found in the PATH." - error="1" - fi - - if [ $(uname -s) != "Darwin" ]; then - if isMissing "${cross_prefix}ranlib" ; then - echo "No ${cross_prefix}ranlib was found in the PATH." - error="1" - fi - fi - - if isMissing "${cross_prefix}strip" ; then - echo "No ${cross_prefix}strip was found in the PATH." - error="1" - fi - - if isMissing "${cross_prefix}strings" ; then - echo "No ${cross_prefix}strings was found in the PATH." - error="1" - fi - - if isMissing "${cross_prefix}as" ; then - echo "No ${cross_prefix}as was found in the PATH." - error="1" - fi - - local os=$(get_os "$host") - if [ $os == "mingw32" ] ; then - if isMissing "${cross_prefix}dlltool" ; then - echo "No ${cross_prefix}dlltool was found in the PATH." - error="1" - fi - - if isMissing "${cross_prefix}windres" ; then - echo "No ${cross_prefix}windres was found in the PATH." - error="1" - fi - fi - - if [ $error == "1" ] ; then - exit 1 - fi -} - -function checkForCommonBuildTools { - local error="0" - - if isMissing "pkg-config"; then - echo "pkg-config not installed. Please install with:" - echo "pacman -S pkgconfig" - echo "or" - echo "apt-get install pkg-config" - echo "" - error="1" - fi - - # Check CUDA's availability - if [ $ENABLE_NVIDIA == "1" ] && isMissing "nvcc"; then - echo "nvcc not found, Please install nVidia Cuda Toolkit, and make sure nvcc is available in the PATH" - echo "Please check nvidia's website" - echo "" - error="1" - fi - - if [ $ENABLE_NVIDIA == "1" ] && ( [ -z ${NVIDIA_CODEC_SDK+x} ] || ( ! test -f "$NVIDIA_CODEC_SDK" ) ); then - echo "nvcc not found, Please download NVIDIA_CODEC_SDK and provide its path with NVIDIA_CODEC_SDK=/path/to/Video_Codec_SDK_9.1.23.zip" - echo "Please check nvidia's website https://developer.nvidia.com/nvidia-video-codec-sdk" - echo "" - error="1" - fi - - if isMissing "patch"; then - echo "patch not installed. Please install with:" - echo "pacman -S patch" - echo "or" - echo "apt-get install patch" - echo "" - error="1" - fi - - if isMissing "python2"; then - echo "python2 not installed. Please install with:" - echo "pacman -S python2" - echo "or" - echo "apt-get install python2" - echo "or" - echo "port install python27 && ln -s /opt/local/bin/python2.7 /opt/local/bin/python2" - echo "" - #error="1" - fi - - if isMissing "autoreconf"; then - echo "autoreconf not installed. Please install with:" - echo "pacman -S autoconf" - echo "or" - echo "apt-get install autoconf" - echo "or" - echo "port install autoconf" - echo "" - error="1" - exit 1 - fi - - if isMissing "aclocal"; then - echo "aclocal not installed. Please install with:" - echo "pacman -S automake" - echo "or" - echo "apt-get install automake" - echo "or" - echo "port install automake" - echo "" - error="1" - exit 1 - fi - - if isMissing "libtool"; then - echo "libtool not installed. Please install with:" - echo "pacman -S msys/libtool" - echo "or" - echo "apt-get install libtool libtool-bin" - echo "" - error="1" - fi - - # We still need to check that on Mac OS - if [ $(uname -s) == "Darwin" ]; then - if isMissing "glibtool"; then - echo "libtool is not installed. Please install with:" - echo "brew install libtool" - echo "or" - echo "port install libtool" - echo "" - error="1" - fi - fi - - if isMissing "make"; then - echo "make not installed. Please install with:" - echo "pacman -S make" - echo "or" - echo "apt-get install make" - echo "" - error="1" - fi - - if isMissing "cmake"; then - echo "make not installed. Please install with:" - echo "pacman -S mingw-cmake" - echo "or" - echo "apt-get install cmake" - echo "" - error="1" - fi - - if isMissing "autopoint"; then - echo "autopoint not installed. Please install with:" - echo "pacman -S gettext gettext-devel" - echo "or" - echo "apt-get install autopoint" - echo "" - error="1" - fi - - if isMissing "msgfmt"; then - echo "msgfmt not installed. Please install with:" - echo "pacman -S gettext gettext-devel" - echo "or" - echo "apt-get install gettext" - echo "" - error="1" - fi - - if isMissing "yasm"; then - echo "yasm not installed. Please install with:" - echo "apt-get install yasm" - echo "" - error="1" - fi - - if isMissing "nasm"; then - echo "nasm not installed. Please install with:" - echo "apt-get install nasm" - echo "" - error="1" - fi - - if isMissing "wget"; then - echo "wget not installed. Please install with:" - echo "pacman -S msys/wget" - echo "or" - echo "apt-get install wget" - echo "or" - echo "sudo port install wget" - echo "" - error="1" - fi - - - if [ $(uname -s) == "Darwin" ]; then - if isMissing "gsed"; then - echo "gsed not installed. Please install with:" - echo "brew install gnu-sed" - echo "or" - echo "port install gsed" - echo "" - error="1" - else - sed=gsed - fi - else - if isMissing "sed"; then - echo "sed not installed. Please install with:" - echo "pacman -S msys/sed" - echo "or" - echo "apt-get install sed" - echo "" - error="1" - else - sed=sed - fi - fi - - if [ $(uname -s) == "Darwin" ]; then - if isMissing "gtar"; then - echo "gnu-tar not installed. Please install with:" - echo "brew install gnu-tar" - echo "or" - echo "port install gnutar && sudo ln -s /opt/local/bin/gnutar /opt/local/bin/gtar" - echo "" - error="1" - fi - else - if isMissing "tar"; then - echo "tar not installed. Please install with:" - echo "mingw-get install tar" - echo "or" - echo "apt-get install tar" - echo "" - error="1" - fi - fi - - if isMissing "xz"; then - echo "xz is not installed. Please install with:" - echo "apt-get install xz" - echo "or" - echo "brew install xz" - echo "" - error="1" - fi - - if isMissing "git" ; then - echo "git not installed. Please install with:" - echo "pacman -S mingw-git" - echo "or" - echo "apt-get install git" - echo "" - error="1" - fi - - if isMissing "hg" ; then - echo "hg not installed. Please install with:" - echo "pacman -S msys/mercurial" - echo "or" - echo "apt-get install mercurial" - echo "" - error="1" - fi - - if isMissing "meson" ; then - echo "meson not installed. Please install with:" - echo "pacman -S msys/meson" - echo "or" - echo "apt-get install meson" - echo "" - error="1" - fi - - if isMissing "svn" ; then - echo "svn not installed. Please install with:" - echo "pacman -S msys/subversion" - echo "or" - echo "apt-get install subversion" - echo "" - error="1" - fi - - if isMissing "gperf" ; then - echo "gperf not installed. Please install with:" - echo "pacman -S msys/gperf" - echo "or" - echo "apt-get install gperf" - echo "" - error="1" - fi - - if isMissing "perl" ; then - echo "perl not installed. Please install with:" - echo "pacman -S perl" - echo "or" - echo "apt-get install perl" - echo "" - error="1" - fi - - if [ $error == "1" ] ; then - exit 1 - fi -} - -function get_arch { - host=$1 - echo $host | sed "s/-.*//" -} - -function get_os { - host=$1 - echo $host | sed "s/.*-//" -} - -function get_abs_dir { - local relDir="$1" - pushDir $relDir - pwd - popDir -} - -main "$@" diff --git a/mac-manual-sysroot-build.sh b/mac-manual-sysroot-build.sh deleted file mode 100755 index 99441251c..000000000 --- a/mac-manual-sysroot-build.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -# -# Download, build and locally deploy external dependencies -# -build_ffmpeg=true -build_gpac=true -set -x -mkdir -p ../sysroot -PREFIX=`realpath ../sysroot` -mkdir -p tmp/build-sysroot/downloads -pushd tmp/build-sysroot -if $build_ffmpeg; then - wget "http://ffmpeg.org/releases/ffmpeg-4.3.8.tar.bz2" -c -O "downloads/ffmpeg-4.3.8.tar.bz2" --no-verbose - tar xfv "downloads/ffmpeg.tar.bz2" - mkdir -p ffmpeg-4.3.8/build - pushd ffmpeg-4.3.8/build - ../configure \ - --prefix=$PREFIX \ - --enable-pthreads \ - --disable-w32threads \ - --disable-debug \ - --disable-doc \ - --disable-static \ - --enable-shared \ - --enable-libopenh264 \ - --enable-zlib \ - --disable-programs \ - --disable-gnutls \ - --disable-openssl \ - --disable-iconv \ - --disable-bzlib \ - --enable-avresample \ - --disable-decoder=mp3float \ - --pkg-config=pkg-config - make - make install - popd -fi -if $build_gpac; then - if [ ! -d gpac ]; then - git clone https://github.com/gpac/gpac.git gpac - fi - pushd gpac - git checkout -q "c02c9a2fb0815bfd28b7c4c46630601ad7fe291d" - git submodule update --init - mkdir -p build - pushd build - os=Darwin - ../configure \ - --target-os=$os \ - --extra-cflags="-I$PREFIX/include -w -fPIC" \ - --extra-ldflags="-L$PREFIX/lib" \ - --verbose \ - --prefix=$PREFIX \ - --disable-player \ - --disable-ssl \ - --disable-alsa \ - --disable-jack \ - --disable-oss-audio \ - --disable-pulseaudio\ - --use-png=no \ - --use-jpeg=no \ - --disable-3d \ - --disable-atsc \ - --disable-avi \ - --disable-bifs \ - --disable-bifs-enc \ - --disable-crypt \ - --disable-dvb4linux \ - --disable-dvbx \ - --disable-ipv6 \ - --disable-laser \ - --disable-loader-bt \ - --disable-loader-isoff \ - --disable-loader-xmt \ - --disable-m2ps \ - --disable-mcrypt \ - --disable-od-dump \ - --disable-odf \ - --disable-ogg \ - --disable-opt \ - --disable-platinum \ - --disable-qtvr \ - --disable-saf \ - --disable-scene-dump \ - --disable-scene-encode \ - --disable-scene-stats \ - --disable-scenegraph \ - --disable-seng \ - --disable-sman \ - --disable-streaming \ - --disable-svg \ - --disable-swf \ - --disable-vobsub \ - --disable-vrml \ - --disable-wx \ - --disable-x11 \ - --disable-x11-shm \ - --disable-x11-xv \ - --disable-x3d \ - --enable-export \ - --enable-import \ - --enable-parsers \ - --enable-m2ts \ - --enable-m2ts-mux \ - --enable-ttxt \ - --enable-hevc \ - --enable-isoff \ - --enable-isoff-frag \ - --enable-isoff-hds \ - --enable-isoff-hint \ - --enable-isoff-write \ - --enable-isom-dump - make lib - make install - make install-lib - popd - popd - -fi \ No newline at end of file diff --git a/src/apps/dashcastx/project.mk b/src/apps/dashcastx/project.mk deleted file mode 100644 index 24e9e9809..000000000 --- a/src/apps/dashcastx/project.mk +++ /dev/null @@ -1,15 +0,0 @@ -MYDIR=$(call get-my-dir) - -EXE_DASHCASTX_SRCS:=\ - $(MYDIR)/main.cpp\ - $(MYDIR)/pipeliner_dashcastx.cpp\ - $(MYDIR)/../../lib_appcommon/safemain.cpp\ - $(LIB_MEDIA_SRCS)\ - $(LIB_MODULES_SRCS)\ - $(LIB_PIPELINE_SRCS)\ - $(LIB_UTILS_SRCS)\ - $(LIB_APPCOMMON_SRCS)\ - -$(BIN)/dashcastx.exe: $(EXE_DASHCASTX_SRCS:%=$(BIN)/%.o) -TARGETS+=$(BIN)/dashcastx.exe - diff --git a/src/apps/mcastdump/project.mk b/src/apps/mcastdump/project.mk deleted file mode 100644 index a3156e094..000000000 --- a/src/apps/mcastdump/project.mk +++ /dev/null @@ -1,12 +0,0 @@ -MYDIR=$(call get-my-dir) - -EXE_MCASTDUMP_SRCS:=\ - $(LIB_MEDIA_SRCS)\ - $(LIB_MODULES_SRCS)\ - $(LIB_PIPELINE_SRCS)\ - $(LIB_UTILS_SRCS)\ - $(LIB_APPCOMMON_SRCS)\ - $(MYDIR)/main.cpp\ - -$(BIN)/mcastdump.exe: $(EXE_MCASTDUMP_SRCS:%=$(BIN)/%.o) -TARGETS+=$(BIN)/mcastdump.exe diff --git a/src/apps/monitor/project.mk b/src/apps/monitor/project.mk deleted file mode 100644 index 7e6228d4b..000000000 --- a/src/apps/monitor/project.mk +++ /dev/null @@ -1,13 +0,0 @@ -MYDIR=$(call get-my-dir) - -EXE_MONITOR_SRCS:=\ - $(MYDIR)/main.cpp\ - $(LIB_MODULES_SRCS)\ - $(LIB_PIPELINE_SRCS)\ - $(LIB_UTILS_SRCS)\ - $(LIB_APPCOMMON_SRCS)\ - -$(BIN)/monitor.exe: $(EXE_MONITOR_SRCS:%=$(BIN)/%.o) -TARGETS+=$(BIN)/monitor.exe - - diff --git a/src/apps/mp42tsx/project.mk b/src/apps/mp42tsx/project.mk deleted file mode 100644 index 1c494d948..000000000 --- a/src/apps/mp42tsx/project.mk +++ /dev/null @@ -1,16 +0,0 @@ -MYDIR=$(call get-my-dir) -OUTDIR:=$(BIN)/$(MYDIR) -TARGET:=$(BIN)/mp42tsx.exe -TARGETS+=$(TARGET) -EXE_MP42TSX_SRCS:=\ - $(LIB_MEDIA_SRCS)\ - $(LIB_MODULES_SRCS)\ - $(LIB_PIPELINE_SRCS)\ - $(LIB_UTILS_SRCS)\ - $(LIB_APPCOMMON_SRCS)\ - $(MYDIR)/mp42tsx.cpp\ - $(MYDIR)/options.cpp\ - $(MYDIR)/pipeliner_mp42ts.cpp\ - -$(TARGET): $(EXE_MP42TSX_SRCS:%=$(BIN)/%.o) - diff --git a/src/apps/player/project.mk b/src/apps/player/project.mk deleted file mode 100644 index dc8568ac2..000000000 --- a/src/apps/player/project.mk +++ /dev/null @@ -1,13 +0,0 @@ -MYDIR=$(call get-my-dir) - -EXE_PLAYER_SRCS:=\ - $(LIB_MEDIA_SRCS)\ - $(LIB_MODULES_SRCS)\ - $(LIB_PIPELINE_SRCS)\ - $(LIB_UTILS_SRCS)\ - $(LIB_APPCOMMON_SRCS)\ - $(MYDIR)/pipeliner_player.cpp\ - $(MYDIR)/player.cpp\ - -$(BIN)/player.exe: $(EXE_PLAYER_SRCS:%=$(BIN)/%.o) -TARGETS+=$(BIN)/player.exe diff --git a/src/apps/ts2ip/project.mk b/src/apps/ts2ip/project.mk deleted file mode 100644 index 3d1273d41..000000000 --- a/src/apps/ts2ip/project.mk +++ /dev/null @@ -1,12 +0,0 @@ -MYDIR=$(call get-my-dir) - -EXE_MCASTDUMP_SRCS:=\ - $(LIB_MEDIA_SRCS)\ - $(LIB_MODULES_SRCS)\ - $(LIB_PIPELINE_SRCS)\ - $(LIB_UTILS_SRCS)\ - $(LIB_APPCOMMON_SRCS)\ - $(MYDIR)/main.cpp\ - -$(BIN)/ts2ip.exe: $(EXE_MCASTDUMP_SRCS:%=$(BIN)/%.o) -TARGETS+=$(BIN)/ts2ip.exe diff --git a/src/lib_media/project.mk b/src/lib_media/project.mk deleted file mode 100644 index ad7b1f271..000000000 --- a/src/lib_media/project.mk +++ /dev/null @@ -1,153 +0,0 @@ -MYDIR=$(call get-my-dir) - -LIB_MEDIA_SRCS:=\ - $(MYDIR)/common/expand_vars.cpp\ - $(MYDIR)/common/http_puller.cpp\ - $(MYDIR)/common/http_sender.cpp\ - $(MYDIR)/common/iso8601.cpp\ - $(MYDIR)/common/mpeg_dash_parser.cpp\ - $(MYDIR)/common/picture.cpp\ - $(MYDIR)/common/sax_xml_parser.cpp\ - $(MYDIR)/common/xml.cpp\ - $(MYDIR)/demux/dash_demux.cpp\ - $(MYDIR)/in/file.cpp\ - $(MYDIR)/in/mpeg_dash_input.cpp\ - $(MYDIR)/in/sound_generator.cpp\ - $(MYDIR)/in/video_generator.cpp\ - $(MYDIR)/out/file.cpp\ - $(MYDIR)/out/http.cpp\ - $(MYDIR)/out/http_sink.cpp\ - $(MYDIR)/out/null.cpp\ - $(MYDIR)/out/print.cpp\ - $(MYDIR)/stream/apple_hls.cpp\ - $(MYDIR)/stream/ms_hss.cpp\ - $(MYDIR)/stream/adaptive_streaming_common.cpp\ - $(MYDIR)/transform/audio_gap_filler.cpp\ - $(MYDIR)/transform/restamp.cpp\ - $(MYDIR)/transform/rectifier.cpp\ - $(MYDIR)/utils/recorder.cpp\ - -PKGS+=\ - libcurl\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/AVCC2AnnexBConverter.smd -$(BIN)/AVCC2AnnexBConverter.smd: \ - $(BIN)/$(SRC)/lib_media/transform/avcc2annexb.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/LibavMuxHLSTS.smd -$(BIN)/LibavMuxHLSTS.smd: PKGS+=libavutil libavcodec -$(BIN)/LibavMuxHLSTS.smd: \ - $(BIN)/$(SRC)/lib_media/stream/hls_muxer_libav.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/VideoConvert.smd -$(BIN)/VideoConvert.smd: PKGS+=libavcodec libavutil libswscale -$(BIN)/VideoConvert.smd: \ - $(BIN)/$(SRC)/lib_media/transform/video_convert.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/picture.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/AudioConvert.smd -$(BIN)/AudioConvert.smd: PKGS+=libavutil libavcodec libswresample -$(BIN)/AudioConvert.smd: \ - $(BIN)/$(SRC)/lib_media/transform/audio_convert.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/JPEGTurboDecode.smd -$(BIN)/JPEGTurboDecode.smd: PKGS+=libturbojpeg -$(BIN)/JPEGTurboDecode.smd: \ - $(BIN)/$(SRC)/lib_media/decode/jpegturbo_decode.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/picture.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/JPEGTurboEncode.smd -$(BIN)/JPEGTurboEncode.smd: PKGS+=libturbojpeg -$(BIN)/JPEGTurboEncode.smd: \ - $(BIN)/$(SRC)/lib_media/encode/jpegturbo_encode.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/picture.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/Encoder.smd -$(BIN)/Encoder.smd: PKGS+=libavcodec libavutil -$(BIN)/Encoder.smd: \ - $(BIN)/$(SRC)/lib_media/encode/libav_encode.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav_init.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/picture.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/Decoder.smd -$(BIN)/Decoder.smd: PKGS+=libavcodec libavutil -$(BIN)/Decoder.smd: \ - $(BIN)/$(SRC)/lib_media/decode/decoder.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/picture.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/LibavDemux.smd -$(BIN)/LibavDemux.smd: PKGS+=libavformat libavcodec libavutil libavdevice -$(BIN)/LibavDemux.smd: \ - $(BIN)/$(SRC)/lib_media/common/libav_init.cpp.o\ - $(BIN)/$(SRC)/lib_media/demux/libav_demux.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - $(BIN)/$(SRC)/lib_media/transform/restamp.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/LibavMux.smd -$(BIN)/LibavMux.smd: PKGS+=libavformat libavcodec libavutil -$(BIN)/LibavMux.smd: \ - $(BIN)/$(SRC)/lib_media/mux/libav_mux.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav_init.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/LibavFilter.smd -$(BIN)/LibavFilter.smd: PKGS+=libavfilter libavcodec libavutil -$(BIN)/LibavFilter.smd: \ - $(BIN)/$(SRC)/lib_media/transform/libavfilter.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/picture.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/libav.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/GPACMuxMP4.smd -$(BIN)/GPACMuxMP4.smd: PKGS+=gpac -$(BIN)/GPACMuxMP4.smd: \ - $(BIN)/$(SRC)/lib_media/mux/gpac_mux_mp4.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/GPACMuxMP4MSS.smd -$(BIN)/GPACMuxMP4MSS.smd: PKGS+=gpac -$(BIN)/GPACMuxMP4MSS.smd: \ - $(BIN)/$(SRC)/lib_media/mux/gpac_mux_mp4_mss.cpp.o\ - $(BIN)/$(SRC)/lib_media/mux/gpac_mux_mp4.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/GPACDemuxMP4Simple.smd -$(BIN)/GPACDemuxMP4Simple.smd: PKGS+=gpac -$(BIN)/GPACDemuxMP4Simple.smd: \ - $(BIN)/$(SRC)/lib_media/demux/gpac_demux_mp4_simple.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/GPACDemuxMP4Full.smd -$(BIN)/GPACDemuxMP4Full.smd: PKGS+=gpac -$(BIN)/GPACDemuxMP4Full.smd: \ - $(BIN)/$(SRC)/lib_media/demux/gpac_demux_mp4_full.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/FileSystemSink.smd -$(BIN)/FileSystemSink.smd: \ - $(BIN)/$(SRC)/lib_media/out/filesystem.cpp.o\ - -#------------------------------------------------------------------------------ -TARGETS+=$(BIN)/LogoOverlay.smd -$(BIN)/LogoOverlay.smd: \ - $(BIN)/$(SRC)/lib_media/transform/logo_overlay.cpp.o\ - -#------------------------------------------------------------------------------ -# Warning derogations. TODO: make this list empty -$(BIN)/$(SRC)/lib_media/demux/libav_demux.cpp.o: CFLAGS+=-Wno-deprecated-declarations diff --git a/src/lib_modules/project.mk b/src/lib_modules/project.mk deleted file mode 100644 index 7036929f1..000000000 --- a/src/lib_modules/project.mk +++ /dev/null @@ -1,18 +0,0 @@ -MYDIR=$(call get-my-dir) - -LIB_MODULES_SRCS:=\ - $(SRC)/lib_modules/core/allocator.cpp\ - $(SRC)/lib_modules/core/connection.cpp\ - $(SRC)/lib_modules/core/data.cpp\ - $(SRC)/lib_modules/utils/helper.cpp\ - $(SRC)/lib_modules/utils/factory.cpp\ - $(SRC)/lib_modules/utils/loader.cpp\ - -CFLAGS+=-fPIC - -$(BIN)/%.smd: CFLAGS+=$(shell test -z "$(PKGS)" || $(SRC)/../scripts/pkg-config $(PKGS) --cflags) -$(BIN)/%.smd: LDFLAGS+=$(shell test -z "$(PKGS)" || $(SRC)/../scripts/pkg-config $(PKGS) --libs) - -$(BIN)/%.smd: $(LIB_MODULES_SRCS:%=$(BIN)/%.o) $(LIB_UTILS_SRCS:%=$(BIN)/%.o) - $(CXX) $(CFLAGS) -pthread -shared -Wl,--no-undefined -o "$@" $^ $(LDFLAGS) - diff --git a/src/lib_utils/darwin.mk b/src/lib_utils/darwin.mk deleted file mode 100644 index d0d7b1117..000000000 --- a/src/lib_utils/darwin.mk +++ /dev/null @@ -1,4 +0,0 @@ -LDFLAGS+=-ldl - -LIB_UTILS_SRCS+=\ - $(MYDIR)/os_darwin.cpp diff --git a/src/lib_utils/gnu.mk b/src/lib_utils/gnu.mk deleted file mode 100644 index 7df39ac7b..000000000 --- a/src/lib_utils/gnu.mk +++ /dev/null @@ -1,4 +0,0 @@ -LDFLAGS+=-ldl -lrt - -LIB_UTILS_SRCS+=\ - $(MYDIR)/os_gnu.cpp diff --git a/src/lib_utils/mingw.mk b/src/lib_utils/mingw.mk deleted file mode 100644 index dbd962d59..000000000 --- a/src/lib_utils/mingw.mk +++ /dev/null @@ -1,3 +0,0 @@ -LIB_UTILS_SRCS+=\ - $(MYDIR)/os_mingw.cpp - diff --git a/src/lib_utils/msvc.mk b/src/lib_utils/msvc.mk deleted file mode 100644 index dbd962d59..000000000 --- a/src/lib_utils/msvc.mk +++ /dev/null @@ -1,3 +0,0 @@ -LIB_UTILS_SRCS+=\ - $(MYDIR)/os_mingw.cpp - diff --git a/src/lib_utils/project.mk b/src/lib_utils/project.mk deleted file mode 100644 index f0886ec74..000000000 --- a/src/lib_utils/project.mk +++ /dev/null @@ -1,12 +0,0 @@ -MYDIR=$(call get-my-dir) - -LIB_UTILS_SRCS:=\ - $(MYDIR)/version.cpp\ - $(MYDIR)/sysclock.cpp\ - $(MYDIR)/log.cpp\ - $(MYDIR)/profiler.cpp\ - $(MYDIR)/scheduler.cpp\ - $(MYDIR)/time.cpp\ - $(MYDIR)/timer.cpp\ - --include $(MYDIR)/$(shell $(CXX) -dumpmachine | sed "s/.*-\([a-zA-Z]*\)[0-9.]*/\1/").mk diff --git a/src/plugins/Dasher/project.mk b/src/plugins/Dasher/project.mk deleted file mode 100644 index 946344d3b..000000000 --- a/src/plugins/Dasher/project.mk +++ /dev/null @@ -1,8 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - -TARGETS+=$(BIN)/MPEG_DASH.smd -$(BIN)/MPEG_DASH.smd: \ - $(BIN)/$(SRC)/lib_media/common/xml.cpp.o\ - $(BIN)/$(PLUG_DIR)/mpeg_dash.cpp.o\ - $(BIN)/$(PLUG_DIR)/mpd.cpp.o\ - diff --git a/src/plugins/Fmp4Splitter/project.mk b/src/plugins/Fmp4Splitter/project.mk deleted file mode 100644 index 6b1b4947c..000000000 --- a/src/plugins/Fmp4Splitter/project.mk +++ /dev/null @@ -1,6 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - -TARGETS+=$(BIN)/Fmp4Splitter.smd -$(BIN)/Fmp4Splitter.smd: \ - $(BIN)/$(PLUG_DIR)/fmp4_splitter.cpp.o\ - diff --git a/src/plugins/HlsDemuxer/project.mk b/src/plugins/HlsDemuxer/project.mk deleted file mode 100644 index e320a8c5c..000000000 --- a/src/plugins/HlsDemuxer/project.mk +++ /dev/null @@ -1,7 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - -TARGETS+=$(BIN)/HlsDemuxer.smd -$(BIN)/HlsDemuxer.smd: \ - $(BIN)/$(PLUG_DIR)/hls_demux.cpp.o\ - $(BIN)/$(SRC)/lib_media/common/http_puller.cpp.o\ - diff --git a/src/plugins/MulticastInput/darwin.mk b/src/plugins/MulticastInput/darwin.mk deleted file mode 100644 index 7c4492425..000000000 --- a/src/plugins/MulticastInput/darwin.mk +++ /dev/null @@ -1,2 +0,0 @@ - MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_gnu.cpp.o - \ No newline at end of file diff --git a/src/plugins/MulticastInput/gnu.mk b/src/plugins/MulticastInput/gnu.mk deleted file mode 100644 index 7c4492425..000000000 --- a/src/plugins/MulticastInput/gnu.mk +++ /dev/null @@ -1,2 +0,0 @@ - MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_gnu.cpp.o - \ No newline at end of file diff --git a/src/plugins/MulticastInput/mingw.mk b/src/plugins/MulticastInput/mingw.mk deleted file mode 100644 index e06c42c51..000000000 --- a/src/plugins/MulticastInput/mingw.mk +++ /dev/null @@ -1,3 +0,0 @@ -MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_mingw.cpp.o - -LDFLAGS+=-lws2_32 diff --git a/src/plugins/MulticastInput/msvc.mk b/src/plugins/MulticastInput/msvc.mk deleted file mode 100644 index a1b544209..000000000 --- a/src/plugins/MulticastInput/msvc.mk +++ /dev/null @@ -1,3 +0,0 @@ -MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_mingw.cpp.o - -LDFLAGS+=-lws2_32 diff --git a/src/plugins/MulticastInput/project.mk b/src/plugins/MulticastInput/project.mk deleted file mode 100644 index 9cf15e537..000000000 --- a/src/plugins/MulticastInput/project.mk +++ /dev/null @@ -1,8 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - --include $(PLUG_DIR)/$(shell $(CXX) -dumpmachine | sed "s/.*-\([a-zA-Z]*\)[0-9.]*/\1/").mk - -TARGETS+=$(BIN)/MulticastInput.smd -$(BIN)/MulticastInput.smd: \ - $(BIN)/$(PLUG_DIR)/multicast_input.cpp.o\ - $(MULTICASTINPUT_OS_SOCKET)\ diff --git a/src/plugins/SdlRender/render.mk b/src/plugins/SdlRender/render.mk deleted file mode 100644 index a52d061fc..000000000 --- a/src/plugins/SdlRender/render.mk +++ /dev/null @@ -1,11 +0,0 @@ - -TARGETS+=$(BIN)/SDLVideo.smd -$(BIN)/SDLVideo.smd: PKGS+=sdl2 -$(BIN)/SDLVideo.smd: \ - $(BIN)/$(SRC)/plugins/SdlRender/sdl_video.cpp.o - -TARGETS+=$(BIN)/SDLAudio.smd -$(BIN)/SDLAudio.smd: PKGS+=sdl2 -$(BIN)/SDLAudio.smd: \ - $(BIN)/$(SRC)/plugins/SdlRender/sdl_audio.cpp.o \ - diff --git a/src/plugins/Telx2Ttml/project.mk b/src/plugins/Telx2Ttml/project.mk deleted file mode 100644 index 42f48c52d..000000000 --- a/src/plugins/Telx2Ttml/project.mk +++ /dev/null @@ -1,7 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - -TARGETS+=$(BIN)/TeletextToTTML.smd -$(BIN)/TeletextToTTML.smd: \ - $(BIN)/$(PLUG_DIR)/telx2ttml.cpp.o\ - $(BIN)/$(PLUG_DIR)/telx.cpp.o\ - diff --git a/src/plugins/TsDemuxer/project.mk b/src/plugins/TsDemuxer/project.mk deleted file mode 100644 index 8d8d2d0b1..000000000 --- a/src/plugins/TsDemuxer/project.mk +++ /dev/null @@ -1,6 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - -TARGETS+=$(BIN)/TsDemuxer.smd -$(BIN)/TsDemuxer.smd: \ - $(BIN)/$(PLUG_DIR)/ts_demuxer.cpp.o\ - diff --git a/src/plugins/TsMuxer/project.mk b/src/plugins/TsMuxer/project.mk deleted file mode 100644 index 7e2021a7b..000000000 --- a/src/plugins/TsMuxer/project.mk +++ /dev/null @@ -1,8 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - -TARGETS+=$(BIN)/TsMuxer.smd -$(BIN)/TsMuxer.smd: \ - $(BIN)/$(PLUG_DIR)/mpegts_muxer.cpp.o\ - $(BIN)/$(PLUG_DIR)/pes.cpp.o\ - $(BIN)/$(PLUG_DIR)/crc.cpp.o\ - diff --git a/src/plugins/UdpOutput/darwin.mk b/src/plugins/UdpOutput/darwin.mk deleted file mode 100644 index 7c4492425..000000000 --- a/src/plugins/UdpOutput/darwin.mk +++ /dev/null @@ -1,2 +0,0 @@ - MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_gnu.cpp.o - \ No newline at end of file diff --git a/src/plugins/UdpOutput/gnu.mk b/src/plugins/UdpOutput/gnu.mk deleted file mode 100644 index 7c4492425..000000000 --- a/src/plugins/UdpOutput/gnu.mk +++ /dev/null @@ -1,2 +0,0 @@ - MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_gnu.cpp.o - \ No newline at end of file diff --git a/src/plugins/UdpOutput/mingw.mk b/src/plugins/UdpOutput/mingw.mk deleted file mode 100644 index e06c42c51..000000000 --- a/src/plugins/UdpOutput/mingw.mk +++ /dev/null @@ -1,3 +0,0 @@ -MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_mingw.cpp.o - -LDFLAGS+=-lws2_32 diff --git a/src/plugins/UdpOutput/msvc.mk b/src/plugins/UdpOutput/msvc.mk deleted file mode 100644 index a1b544209..000000000 --- a/src/plugins/UdpOutput/msvc.mk +++ /dev/null @@ -1,3 +0,0 @@ -MULTICASTINPUT_OS_SOCKET:=$(BIN)/$(PLUG_DIR)/socket_mingw.cpp.o - -LDFLAGS+=-lws2_32 diff --git a/src/plugins/UdpOutput/project.mk b/src/plugins/UdpOutput/project.mk deleted file mode 100644 index 2d775c644..000000000 --- a/src/plugins/UdpOutput/project.mk +++ /dev/null @@ -1,8 +0,0 @@ -PLUG_DIR:=$(call get-my-dir) - --include $(PLUG_DIR)/$(shell $(CXX) -dumpmachine | sed "s/.*-\([a-zA-Z]*\)[0-9.]*/\1/").mk - -TARGETS+=$(BIN)/UdpOutput.smd -$(BIN)/UdpOutput.smd: \ - $(BIN)/$(PLUG_DIR)/udp_output.cpp.o\ - $(MULTICASTINPUT_OS_SOCKET)\ diff --git a/src/plugins/project.mk b/src/plugins/project.mk deleted file mode 100644 index e8325452f..000000000 --- a/src/plugins/project.mk +++ /dev/null @@ -1,15 +0,0 @@ -MYDIR=$(call get-my-dir) - -include $(SRC)/plugins/HlsDemuxer/project.mk -include $(SRC)/plugins/MulticastInput/project.mk -include $(SRC)/plugins/UdpOutput/project.mk -include $(SRC)/plugins/TsMuxer/project.mk -include $(SRC)/plugins/TsDemuxer/project.mk -include $(SRC)/plugins/Telx2Ttml/project.mk -include $(SRC)/plugins/Fmp4Splitter/project.mk -include $(SRC)/plugins/Dasher/project.mk - -ifeq ($(SIGNALS_HAS_X11), 1) -include $(SRC)/plugins/SdlRender/render.mk -endif - diff --git a/src/tests/project.mk b/src/tests/project.mk deleted file mode 100644 index c0f951dd5..000000000 --- a/src/tests/project.mk +++ /dev/null @@ -1,19 +0,0 @@ -MYDIR=$(call get-my-dir) -OUTDIR:=$(BIN)/$(call get-my-dir) - -#--------------------------------------------------------------- -# unittests.exe : all the unit tests gathered from -# the in-tree 'unittests' directories. -#--------------------------------------------------------------- -EXE_OTHER_SRCS+=\ - $(MYDIR)/tests.cpp\ - $(MYDIR)/../lib_appcommon/options.cpp\ - $(LIB_MEDIA_SRCS)\ - $(LIB_MODULES_SRCS)\ - $(LIB_PIPELINE_SRCS)\ - $(LIB_UTILS_SRCS) - -EXE_OTHER_SRCS+=$(shell find src -path "*/unittests/*.cpp" | sort) -TARGETS+=$(BIN)/unittests.exe -$(BIN)/unittests.exe: $(EXE_OTHER_SRCS:%=$(BIN)/%.o) -TESTS_DIR+=$(CURDIR)/$(SRC)/tests From c01aa71935bc05d5e8f94313c794ad7309d49ec3 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 6 Feb 2025 17:38:06 +0700 Subject: [PATCH 178/182] adding reformat before build --- .github/workflows/linux-build.yml | 3 +- .github/workflows/mac-build.yml | 9 ++- .github/workflows/windows-build.yml | 2 +- CMakeLists.txt | 21 +++++-- src/lib_media/common/http_sender.cpp | 40 ++++++------ src/lib_media/common/http_sender.hpp | 2 +- src/lib_media/common/libav.cpp | 14 ++--- src/lib_media/common/mpeg_dash_parser.cpp | 8 +-- src/lib_media/common/mpeg_dash_parser.hpp | 2 +- src/lib_media/demux/libav_demux.cpp | 28 ++++----- src/lib_media/in/mpeg_dash_input.cpp | 64 ++++++++++---------- src/lib_media/out/http.cpp | 2 +- src/lib_media/unittests/mpeg_dash_input.cpp | 52 ++++++++-------- src/lib_media/unittests/mux.cpp | 58 +++++++++--------- src/lib_modules/utils/helper.cpp | 48 +++++++-------- src/lib_modules/utils/helper.hpp | 2 +- src/lib_pipeline/unittests/pipeline_base.cpp | 4 +- src/plugins/Dasher/mpd.cpp | 8 +-- 18 files changed, 195 insertions(+), 172 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 5aef603e5..a4f015a59 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -47,7 +47,8 @@ jobs: g++ \ make \ libtool \ - libtool-bin + libtool-bin \ + astyle - name: Install CMake and Ninja run: | diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 382356484..038fab128 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -35,7 +35,14 @@ jobs: autoconf \ automake \ libtool \ - python3 + python3 \ + astyle + + - name: Install astyle on macOS + run: | + brew update + brew install astyle || brew reinstall astyle + shell: /bin/bash -e {0} - name: Initialize vcpkg submodule run: | diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 89a23da98..da5fb6b22 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -45,7 +45,7 @@ jobs: - name: Update MSYS2 and install dependencies run: | C:\msys64\usr\bin\bash.exe -c "pacman -Syu --noconfirm" - C:\msys64\usr\bin\bash.exe -c "pacman -S --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-pkg-config mingw-w64-x86_64-nasm mingw-w64-x86_64-yasm mingw-w64-x86_64-autotools mingw-w64-x86_64-gcc git make curl mingw-w64-x86_64-libtool mingw-w64-x86_64-python3 mingw-w64-x86_64-ca-certificates" + C:\msys64\usr\bin\bash.exe -c "pacman -S --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-pkg-config mingw-w64-x86_64-nasm mingw-w64-x86_64-yasm mingw-w64-x86_64-autotools mingw-w64-x86_64-gcc git make curl mingw-w64-x86_64-libtool mingw-w64-x86_64-python3 mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-astyle" shell: cmd - name: Check MSYS2 runtime and toolchain version diff --git a/CMakeLists.txt b/CMakeLists.txt index bebbe0fc9..c327cfdd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,21 +121,34 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) +# Create format target - BEFORE add_subdirectory(src) +add_custom_target(format + COMMAND ${CMAKE_COMMAND} -E echo "Running reformat..." + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/reformat.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Formatting source code..." +) # Add all the source subdirectories add_subdirectory(src) -# Add custom targets for easy builds -add_custom_target(build_all +# Make all targets depend on format +add_dependencies(utils format) +add_dependencies(modules format) +add_dependencies(appcommon format) +add_dependencies(pipeline format) +add_dependencies(media format) +add_dependencies(unittests format) + +# Add custom targets for easy builds - remove format from DEPENDS +add_custom_target(build_all ALL DEPENDS utils appcommon pipeline modules media - plugins dashcastx - #ts2ip player mcastdump mp42tsx diff --git a/src/lib_media/common/http_sender.cpp b/src/lib_media/common/http_sender.cpp index 22b97c162..d716c0338 100644 --- a/src/lib_media/common/http_sender.cpp +++ b/src/lib_media/common/http_sender.cpp @@ -92,12 +92,12 @@ struct CurlHttpSender : HttpSender { if(!data.len) { // wait for flush finished, before returning std::unique_lock lock(m_mutex); - while(!allDataSent) { - if (connectFailCountExceeded) { - throw std::runtime_error("http_sender too many connection failures"); - } - m_allDataSent.wait(lock); - } + while(!allDataSent) { + if (connectFailCountExceeded) { + throw std::runtime_error("http_sender too many connection failures"); + } + m_allDataSent.wait(lock); + } } } @@ -109,13 +109,13 @@ struct CurlHttpSender : HttpSender { private: void perform(CURL *curl) { auto res = curl_easy_perform(curl); - if (res != CURLE_OK) { + if (res != CURLE_OK) { m_log->log(Warning, (std::string("Transfer failed: ") + curl_easy_strerror(res)).c_str()); - if (res == CURLE_COULDNT_CONNECT) - connectFailCount++; - } else { - connectFailCount = 0; - } + if (res == CURLE_COULDNT_CONNECT) + connectFailCount++; + } else { + connectFailCount = 0; + } long http_code = 0; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code); @@ -150,12 +150,12 @@ struct CurlHttpSender : HttpSender { append(m_fifo, {m_prefixData.data(), m_prefixData.size()}); perform(curl.get()); - if (m_cfg.maxConnectFailCount > 0 && connectFailCount >= m_cfg.maxConnectFailCount) { - std::unique_lock lock(m_mutex); - connectFailCountExceeded = true; - m_allDataSent.notify_one(); - break; - } + if (m_cfg.maxConnectFailCount > 0 && connectFailCount >= m_cfg.maxConnectFailCount) { + std::unique_lock lock(m_mutex); + connectFailCountExceeded = true; + m_allDataSent.notify_one(); + break; + } } curl_slist_free_all(headers); @@ -199,8 +199,8 @@ struct CurlHttpSender : HttpSender { std::condition_variable m_allDataSent; bool allDataSent = false; - bool connectFailCountExceeded = false; - int connectFailCount = 0; + bool connectFailCountExceeded = false; + int connectFailCount = 0; // data to send first at the beginning of each connection std::vector m_prefixData; diff --git a/src/lib_media/common/http_sender.hpp b/src/lib_media/common/http_sender.hpp index b3bd370bb..44c5de2c0 100644 --- a/src/lib_media/common/http_sender.hpp +++ b/src/lib_media/common/http_sender.hpp @@ -37,7 +37,7 @@ struct HttpSenderConfig { std::string userAgent; HttpRequest request = POST; std::vector extraHeaders; - int maxConnectFailCount = 0; + int maxConnectFailCount = 0; }; std::unique_ptr createHttpSender(HttpSenderConfig const& config, Modules::KHost* log); diff --git a/src/lib_media/common/libav.cpp b/src/lib_media/common/libav.cpp index 48cb09c47..b6e94aede 100644 --- a/src/lib_media/common/libav.cpp +++ b/src/lib_media/common/libav.cpp @@ -180,10 +180,10 @@ AudioLayout getLayout(const AVCodecContext* codecCtx) { #else // xxxjack Unsure whether this is correct. switch(codecCtx->ch_layout.nb_channels) { - case 1: return Mono; - case 2: return Stereo; - case 6: return FivePointOne; - default: throw std::runtime_error("Unknown libav audio layout"); + case 1: return Mono; + case 2: return Stereo; + case 6: return FivePointOne; + default: throw std::runtime_error("Unknown libav audio layout"); } #endif } @@ -212,13 +212,13 @@ void libavAudioCtxConvertLibav(const Modules::PcmFormat *cfg, int &sampleRate, A sampleRate = cfg->sampleRate; switch (cfg->layout) { - case Modules::Mono: + case Modules::Mono: av_channel_layout_default(layout, 1); break; - case Modules::Stereo: + case Modules::Stereo: av_channel_layout_default(layout, 2); break; - case Modules::FivePointOne: + case Modules::FivePointOne: av_channel_layout_default(layout, 6); break; default: throw std::runtime_error("Unknown libav audio layout"); diff --git a/src/lib_media/common/mpeg_dash_parser.cpp b/src/lib_media/common/mpeg_dash_parser.cpp index 8ddd9a806..c34d498de 100644 --- a/src/lib_media/common/mpeg_dash_parser.cpp +++ b/src/lib_media/common/mpeg_dash_parser.cpp @@ -63,11 +63,11 @@ unique_ptr parseMpd(span text) { if(!attr["publishTime"].empty()) mpd->publishTime = parseDate(attr["publishTime"]); - if(!attr["mediaPresentationDuration"].empty()) - mpd->mediaPresentationDuration = parseIso8601Period(attr["mediaPresentationDuration"]); + if(!attr["mediaPresentationDuration"].empty()) + mpd->mediaPresentationDuration = parseIso8601Period(attr["mediaPresentationDuration"]); - if(!attr["minimumUpdatePeriod"].empty()) - mpd->minUpdatePeriod = parseIso8601Period(attr["minimumUpdatePeriod"]); + if(!attr["minimumUpdatePeriod"].empty()) + mpd->minUpdatePeriod = parseIso8601Period(attr["minimumUpdatePeriod"]); } else if(name == "SegmentTemplate") { auto getSegTpl = [&]() -> SegmentTemplate& { auto &set = mpd->sets.back(); diff --git a/src/lib_media/common/mpeg_dash_parser.hpp b/src/lib_media/common/mpeg_dash_parser.hpp index 6b0922529..07d5f2ab0 100644 --- a/src/lib_media/common/mpeg_dash_parser.hpp +++ b/src/lib_media/common/mpeg_dash_parser.hpp @@ -43,7 +43,7 @@ struct DashMpd { bool dynamic = false; int64_t availabilityStartTime = 0; // in ms int64_t publishTime = 0; // in ms - int64_t mediaPresentationDuration = 0; // in seconds (unfortunately) + int64_t mediaPresentationDuration = 0; // in seconds (unfortunately) int64_t periodDuration = 0; // in seconds int64_t minUpdatePeriod = 0; std::vector sets; diff --git a/src/lib_media/demux/libav_demux.cpp b/src/lib_media/demux/libav_demux.cpp index c53920019..5ef1f1e98 100644 --- a/src/lib_media/demux/libav_demux.cpp +++ b/src/lib_media/demux/libav_demux.cpp @@ -131,7 +131,7 @@ struct LibavDemux : Module { for (unsigned i = 0; inb_streams; i++) { auto const st = m_formatCtx->streams[i]; auto const parser = av_parser_init(st->codecpar->codec_id); - + // Create codec context from parameters auto codecCtx = shptr(avcodec_alloc_context3(nullptr)); if (avcodec_parameters_to_context(codecCtx.get(), st->codecpar) < 0) { @@ -148,10 +148,10 @@ struct LibavDemux : Module { // Create metadata based on stream type std::shared_ptr m; switch (st->codecpar->codec_type) { - case AVMEDIA_TYPE_AUDIO: m = createMetadataPktLibavAudio(codecCtx.get()); break; - case AVMEDIA_TYPE_VIDEO: m = createMetadataPktLibavVideo(codecCtx.get()); break; - case AVMEDIA_TYPE_SUBTITLE: m = createMetadataPktLibavSubtitle(codecCtx.get()); break; - default: break; + case AVMEDIA_TYPE_AUDIO: m = createMetadataPktLibavAudio(codecCtx.get()); break; + case AVMEDIA_TYPE_VIDEO: m = createMetadataPktLibavVideo(codecCtx.get()); break; + case AVMEDIA_TYPE_SUBTITLE: m = createMetadataPktLibavSubtitle(codecCtx.get()); break; + default: break; } // Container-specific codec string assignment @@ -160,18 +160,18 @@ struct LibavDemux : Module { auto const container = std::string(m_formatCtx->iformat->name); if(container.substr(0, 4) == "mov,") { switch(st->codecpar->codec_id) { - case AV_CODEC_ID_H264: meta->codec = "h264_avcc"; break; - case AV_CODEC_ID_HEVC: meta->codec = "hevc_avcc"; break; - case AV_CODEC_ID_AAC: meta->codec = "aac_raw"; break; - default: break; + case AV_CODEC_ID_H264: meta->codec = "h264_avcc"; break; + case AV_CODEC_ID_HEVC: meta->codec = "hevc_avcc"; break; + case AV_CODEC_ID_AAC: meta->codec = "aac_raw"; break; + default: break; } } else if(container == "mpegts") { switch(st->codecpar->codec_id) { - case AV_CODEC_ID_H264: meta->codec = "h264_annexb"; break; - case AV_CODEC_ID_HEVC: meta->codec = "hevc_annexb"; break; - case AV_CODEC_ID_AAC: meta->codec = "aac_adts"; break; - case AV_CODEC_ID_AAC_LATM: meta->codec = "aac_latm"; break; - default: break; + case AV_CODEC_ID_H264: meta->codec = "h264_annexb"; break; + case AV_CODEC_ID_HEVC: meta->codec = "hevc_annexb"; break; + case AV_CODEC_ID_AAC: meta->codec = "aac_adts"; break; + case AV_CODEC_ID_AAC_LATM: meta->codec = "aac_latm"; break; + default: break; } } } diff --git a/src/lib_media/in/mpeg_dash_input.cpp b/src/lib_media/in/mpeg_dash_input.cpp index 59446f072..7fbf5cb44 100644 --- a/src/lib_media/in/mpeg_dash_input.cpp +++ b/src/lib_media/in/mpeg_dash_input.cpp @@ -80,7 +80,7 @@ struct MPEG_DASH_Input::Stream { OutputDefault* out; Representation const * rep; bool initializationChunkSent = false; - bool anySegmentDataReceived = false; + bool anySegmentDataReceived = false; int64_t currNumber = 0; Fraction segmentDuration; unique_ptr source; @@ -141,31 +141,31 @@ MPEG_DASH_Input::MPEG_DASH_Input(KHost* host, IFilePullerFactory *filePullerFact for(auto& stream : m_streams) { stream->currNumber = stream->rep->startNumber(mpd.get()); if(mpd->dynamic) { - if (mpd->mediaPresentationDuration) { - if (stream->segmentDuration.num == 0) - throw runtime_error("No duration for stream"); - // Note that mediaPresentationDuration is in seconds, - // so this will give a value that is too low (at most one second). - stream->currNumber += int64_t((stream->segmentDuration.inverse() * mpd->mediaPresentationDuration)); - int leeway = 1; - stream->currNumber = std::max(stream->currNumber-leeway, stream->rep->startNumber(mpd.get())); - - } else { - auto now = mpd->publishTime; - if (!mpd->publishTime) - now = (int64_t)getUTC(); - - if (stream->segmentDuration.num == 0) - throw runtime_error("No duration for stream"); - - stream->currNumber += int64_t(stream->segmentDuration.inverse() * (now - mpd->availabilityStartTime)); - // HACK: add one segment latency. - // HACK modified by jack: also add at least a second, to cater for the times - // in the MPD to have a 1-second resolution. - int leeway = 2; - leeway += int(stream->segmentDuration.inverse()); - stream->currNumber = std::max(stream->currNumber-leeway, stream->rep->startNumber(mpd.get())); - } + if (mpd->mediaPresentationDuration) { + if (stream->segmentDuration.num == 0) + throw runtime_error("No duration for stream"); + // Note that mediaPresentationDuration is in seconds, + // so this will give a value that is too low (at most one second). + stream->currNumber += int64_t((stream->segmentDuration.inverse() * mpd->mediaPresentationDuration)); + int leeway = 1; + stream->currNumber = std::max(stream->currNumber-leeway, stream->rep->startNumber(mpd.get())); + + } else { + auto now = mpd->publishTime; + if (!mpd->publishTime) + now = (int64_t)getUTC(); + + if (stream->segmentDuration.num == 0) + throw runtime_error("No duration for stream"); + + stream->currNumber += int64_t(stream->segmentDuration.inverse() * (now - mpd->availabilityStartTime)); + // HACK: add one segment latency. + // HACK modified by jack: also add at least a second, to cater for the times + // in the MPD to have a 1-second resolution. + int leeway = 2; + leeway += int(stream->segmentDuration.inverse()); + stream->currNumber = std::max(stream->currNumber-leeway, stream->rep->startNumber(mpd.get())); + } } } } @@ -208,7 +208,7 @@ void MPEG_DASH_Input::processStream(Stream* stream) { } } - + bool empty = true; auto onBuffer = [&](SpanC chunk) { @@ -232,16 +232,16 @@ void MPEG_DASH_Input::processStream(Stream* stream) { } if (empty) { if (mpd->dynamic) { - int leeway = 1; - if (!stream->anySegmentDataReceived) leeway += 1; + int leeway = 1; + if (!stream->anySegmentDataReceived) leeway += 1; stream->currNumber = std::max(stream->currNumber - leeway, rep->startNumber(mpd.get())); // too early, retry return; } m_host->log(Error, format("can't download file: '%s'", url).c_str()); m_host->activate(false); - } else { - stream->anySegmentDataReceived = stream->initializationChunkSent; - } + } else { + stream->anySegmentDataReceived = stream->initializationChunkSent; + } stream->initializationChunkSent = true; } diff --git a/src/lib_media/out/http.cpp b/src/lib_media/out/http.cpp index 97bcb8594..4fe227315 100644 --- a/src/lib_media/out/http.cpp +++ b/src/lib_media/out/http.cpp @@ -27,7 +27,7 @@ HTTP::HTTP(KHost* host, HttpOutputConfig const& cfg) // create pins outputFinished = addOutput(); - const int maxConnectFailCount = 3; + const int maxConnectFailCount = 3; m_sender = createHttpSender({cfg.url, cfg.userAgent, cfg.flags.request, cfg.headers, maxConnectFailCount}, m_host); } diff --git a/src/lib_media/unittests/mpeg_dash_input.cpp b/src/lib_media/unittests/mpeg_dash_input.cpp index 956ca3d32..9b387678c 100644 --- a/src/lib_media/unittests/mpeg_dash_input.cpp +++ b/src/lib_media/unittests/mpeg_dash_input.cpp @@ -182,32 +182,32 @@ unittest("mpeg_dash_input: only get available segments") { )|"; - LocalFilesystem source; - source.resources["main/manifest.mpd"] = MPD; - source.resources["main/high/init.mp4"] = "a"; - source.resources["main/high/5.m4s"] = "a"; - source.resources["main/high/6.m4s"] = "a"; - source.resources["main/high/7.m4s"] = "a"; - - auto dash = createModule(&NullHost, &source, "main/manifest.mpd"); - dash->enableStream(0, 1); // high - - // Process only enough times to get available segments - for(int i = 0; i < 4; ++i) { // One for init, three for segments - dash->process(); - } - - dash = nullptr; - - ASSERT_EQUALS( - std::vector({ - "main/manifest.mpd", - "main/high/init.mp4", - "main/high/5.m4s", - "main/high/6.m4s", - "main/high/7.m4s" - }), - source.requests); + LocalFilesystem source; + source.resources["main/manifest.mpd"] = MPD; + source.resources["main/high/init.mp4"] = "a"; + source.resources["main/high/5.m4s"] = "a"; + source.resources["main/high/6.m4s"] = "a"; + source.resources["main/high/7.m4s"] = "a"; + + auto dash = createModule(&NullHost, &source, "main/manifest.mpd"); + dash->enableStream(0, 1); // high + + // Process only enough times to get available segments + for(int i = 0; i < 4; ++i) { // One for init, three for segments + dash->process(); + } + + dash = nullptr; + + ASSERT_EQUALS( + std::vector({ + "main/manifest.mpd", + "main/high/init.mp4", + "main/high/5.m4s", + "main/high/6.m4s", + "main/high/7.m4s" + }), + source.requests); } unittest("mpeg_dash_input: get concurrent chunks") { diff --git a/src/lib_media/unittests/mux.cpp b/src/lib_media/unittests/mux.cpp index 07a852964..43f9838c2 100644 --- a/src/lib_media/unittests/mux.cpp +++ b/src/lib_media/unittests/mux.cpp @@ -43,35 +43,35 @@ unittest("remux test: GPAC mp4 mux") { } unittest("remux test: libav mp4 mux") { - system("mkdir -p out"); - - DemuxConfig cfg; - cfg.url = "data/beepbop.mp4"; - auto demux = loadModule("LibavDemux", &NullHost, &cfg); - std::shared_ptr avcc2annexB; - - auto muxConfig = MuxConfig{"out/output_libav.mp4", "mp4", ""}; - auto mux = loadModule("LibavMux", &NullHost, &muxConfig); - - ASSERT(demux->getNumOutputs() > 1); - for (int i = 0; i < demux->getNumOutputs(); ++i) { - auto data = make_shared(); - data->setMetadata(demux->getOutput(i)->getMetadata()); - mux->getInput(i)->push(data); - - if (demux->getOutput(i)->getMetadata()->isVideo()) { - assert(!avcc2annexB); - avcc2annexB = loadModule("AVCC2AnnexBConverter", &NullHost, nullptr); - ConnectModules(demux.get(), i, avcc2annexB.get(), 0); - ConnectModules(avcc2annexB.get(), 0, mux.get(), i); - } else { - ConnectModules(demux.get(), i, mux.get(), i); - } - } - - demux->process(); - - system("rm -f out/output_libav.mp4"); + system("mkdir -p out"); + + DemuxConfig cfg; + cfg.url = "data/beepbop.mp4"; + auto demux = loadModule("LibavDemux", &NullHost, &cfg); + std::shared_ptr avcc2annexB; + + auto muxConfig = MuxConfig{"out/output_libav.mp4", "mp4", ""}; + auto mux = loadModule("LibavMux", &NullHost, &muxConfig); + + ASSERT(demux->getNumOutputs() > 1); + for (int i = 0; i < demux->getNumOutputs(); ++i) { + auto data = make_shared(); + data->setMetadata(demux->getOutput(i)->getMetadata()); + mux->getInput(i)->push(data); + + if (demux->getOutput(i)->getMetadata()->isVideo()) { + assert(!avcc2annexB); + avcc2annexB = loadModule("AVCC2AnnexBConverter", &NullHost, nullptr); + ConnectModules(demux.get(), i, avcc2annexB.get(), 0); + ConnectModules(avcc2annexB.get(), 0, mux.get(), i); + } else { + ConnectModules(demux.get(), i, mux.get(), i); + } + } + + demux->process(); + + system("rm -f out/output_libav.mp4"); } unittest("mux test: GPAC mp4 with generic descriptor") { diff --git a/src/lib_modules/utils/helper.cpp b/src/lib_modules/utils/helper.cpp index 1ba3f9ed1..0400dbd67 100644 --- a/src/lib_modules/utils/helper.cpp +++ b/src/lib_modules/utils/helper.cpp @@ -89,30 +89,30 @@ void Output::connectFunction(std::function f) { // used by unit tests void ConnectOutput(IOutput* o, std::function f) { - if (!o) { - throw std::runtime_error("ConnectOutput: null input"); - } - - try { - // Try OutputDefault first - if (auto defaultOutput = dynamic_cast(o)) { - defaultOutput->connectFunction(f); - return; - } - - // Then try Output - if (auto baseOutput = dynamic_cast(o)) { - baseOutput->connectFunction(f); - return; - } - - throw std::runtime_error("Could not cast to any known output type"); - - } catch (const std::exception& e) { - std::cerr << "ConnectOutput failed: " << e.what() << std::endl; - std::cerr << "From type: " << typeid(*o).name() << std::endl; - throw; - } + if (!o) { + throw std::runtime_error("ConnectOutput: null input"); + } + + try { + // Try OutputDefault first + if (auto defaultOutput = dynamic_cast(o)) { + defaultOutput->connectFunction(f); + return; + } + + // Then try Output + if (auto baseOutput = dynamic_cast(o)) { + baseOutput->connectFunction(f); + return; + } + + throw std::runtime_error("Could not cast to any known output type"); + + } catch (const std::exception& e) { + std::cerr << "ConnectOutput failed: " << e.what() << std::endl; + std::cerr << "From type: " << typeid(*o).name() << std::endl; + throw; + } } } diff --git a/src/lib_modules/utils/helper.hpp b/src/lib_modules/utils/helper.hpp index 42b139bc1..b4a991f18 100644 --- a/src/lib_modules/utils/helper.hpp +++ b/src/lib_modules/utils/helper.hpp @@ -81,7 +81,7 @@ class Module : public IModule { return (int)outputs.size(); } IOutput* getOutput(int i) override { - IOutput* output = outputs[i].get(); + IOutput* output = outputs[i].get(); return outputs[i].get(); } diff --git a/src/lib_pipeline/unittests/pipeline_base.cpp b/src/lib_pipeline/unittests/pipeline_base.cpp index 80a58a22d..bad83e68f 100644 --- a/src/lib_pipeline/unittests/pipeline_base.cpp +++ b/src/lib_pipeline/unittests/pipeline_base.cpp @@ -63,7 +63,9 @@ unittest("pipeline: exceptions are propagated") { Pipeline p; std::string error; - p.registerErrorCallback([&](const char *str) { error = str; }); + p.registerErrorCallback([&](const char *str) { + error = str; + }); p.addModule(); p.start(); p.waitForEndOfStream(); diff --git a/src/plugins/Dasher/mpd.cpp b/src/plugins/Dasher/mpd.cpp index e39a525e2..63c26f972 100644 --- a/src/plugins/Dasher/mpd.cpp +++ b/src/plugins/Dasher/mpd.cpp @@ -62,10 +62,10 @@ Tag mpdToTags(MPD const& mpd) { tMPD["minBufferTime"] = formatPeriod(mpd.minBufferTime); if (mpd.dynamic) tMPD["minimumUpdatePeriod"] = formatPeriod(mpd.minimum_update_period); - // Jack moved this out of the "else": originally it wasn't included for dynamic - // MPDs, but https://dashif-documents.azurewebsites.net/Guidelines-TimingModel/master/Guidelines-TimingModel.html#timing-and-presentation-types - // suggests it is allowed... - tMPD["mediaPresentationDuration"] = formatPeriod(mpd.mediaPresentationDuration); + // Jack moved this out of the "else": originally it wasn't included for dynamic + // MPDs, but https://dashif-documents.azurewebsites.net/Guidelines-TimingModel/master/Guidelines-TimingModel.html#timing-and-presentation-types + // suggests it is allowed... + tMPD["mediaPresentationDuration"] = formatPeriod(mpd.mediaPresentationDuration); { auto tProgramInformation = Tag { "ProgramInformation" }; From 13642f65018e8277ba82b0999de291f2cc90e027 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 6 Feb 2025 20:09:23 +0700 Subject: [PATCH 179/182] make reformat more os specific --- .github/workflows/mac-build.yml | 8 +------- scripts/reformat.sh | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 038fab128..86ccc82ed 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -36,13 +36,7 @@ jobs: automake \ libtool \ python3 \ - astyle - - - name: Install astyle on macOS - run: | - brew update - brew install astyle || brew reinstall astyle - shell: /bin/bash -e {0} + astyle - name: Initialize vcpkg submodule run: | diff --git a/scripts/reformat.sh b/scripts/reformat.sh index 82a5e04bd..747676e69 100755 --- a/scripts/reformat.sh +++ b/scripts/reformat.sh @@ -4,10 +4,12 @@ set -euo pipefail function has_astyle { if ! which astyle >/dev/null ; then - return 1 - fi - - if [ ! "$(astyle --version)" = "Artistic Style Version 3.1" ] ; then + # Install instructions for different platforms + if [[ "$OSTYPE" == "darwin"* ]]; then + echo "On macOS, install astyle with: brew install astyle" >&2 + else + echo "Please install astyle" >&2 + fi return 1 fi @@ -41,9 +43,16 @@ function reformat_one_file fi } -find -name "*.hpp" -or -name "*.cpp" | while read f ; do - reformat_one_file "$f" & -done +# Use more portable find syntax +if [[ "$OSTYPE" == "darwin"* ]]; then + find . \( -name "*.hpp" -o -name "*.cpp" \) | while read f ; do + reformat_one_file "$f" & + done +else + find -name "*.hpp" -or -name "*.cpp" | while read f ; do + reformat_one_file "$f" & + done +fi wait From b178fba4366484a573c1fa5df6698f63e0fbfdb0 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Thu, 13 Feb 2025 20:04:48 +0700 Subject: [PATCH 180/182] adding md docs to doxygen --- CMakeLists.txt | 23 +++++ doc/doxyfile | 51 ++++------ docs/api/core.md | 89 +++++++++++++++++ docs/api/media.md | 93 ++++++++++++++++++ docs/api/utils.md | 111 ++++++++++++++++++++++ docs/architecture/modules.md | 72 ++++++++++++++ docs/architecture/overview.md | 79 +++++++++++++++ docs/architecture/pipeline.md | 80 ++++++++++++++++ docs/architecture/plugins.md | 153 ++++++++++++++++++++++++++++++ docs/examples/basic_pipeline.md | 0 docs/examples/custom_module.md | 0 docs/examples/media_processing.md | 0 docs/guides/building.md | 0 docs/guides/contribution.md | 0 docs/guides/getting_started.md | 0 15 files changed, 716 insertions(+), 35 deletions(-) create mode 100644 docs/api/core.md create mode 100644 docs/api/media.md create mode 100644 docs/api/utils.md create mode 100644 docs/architecture/modules.md create mode 100644 docs/architecture/overview.md create mode 100644 docs/architecture/pipeline.md create mode 100644 docs/architecture/plugins.md create mode 100644 docs/examples/basic_pipeline.md create mode 100644 docs/examples/custom_module.md create mode 100644 docs/examples/media_processing.md create mode 100644 docs/guides/building.md create mode 100644 docs/guides/contribution.md create mode 100644 docs/guides/getting_started.md diff --git a/CMakeLists.txt b/CMakeLists.txt index c327cfdd9..626b6a2f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,29 @@ cmake_minimum_required(VERSION 3.28) project(Signals VERSION 1.0) + +# Add Doxygen support after project declaration +find_package(Doxygen) +if(DOXYGEN_FOUND) + set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src) + set(DOXYGEN_OUTPUT_DIR ${PROJECT_BINARY_DIR}/docs) + set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html) + set(DOXYFILE_IN ${PROJECT_SOURCE_DIR}/doc/doxyfile) + set(DOXYFILE_OUT ${PROJECT_BINARY_DIR}/doxyfile) + + # Configure the Doxyfile + configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY) + + # Add documentation target + add_custom_target(docs ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) + + +endif() + # Set toplevel signals directory here, so the CMakefiles work both standalone and under the lldash umbrella set(SIGNALS_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/doc/doxyfile b/doc/doxyfile index 5aa92318e..211e6cf86 100644 --- a/doc/doxyfile +++ b/doc/doxyfile @@ -59,7 +59,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = . +OUTPUT_DIRECTORY = docs # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -69,7 +69,7 @@ OUTPUT_DIRECTORY = . # performance problems for the file system. # The default value is: NO. -CREATE_SUBDIRS = NO +CREATE_SUBDIRS = YES # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this @@ -487,7 +487,7 @@ HIDE_IN_BODY_DOCS = NO # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. -INTERNAL_DOCS = NO +INTERNAL_DOCS = YES # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES upper-case letters are also @@ -745,7 +745,11 @@ WARN_LOGFILE = doxygen_warnings.txt # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = ../src +INPUT = ../src/ \ + ../docs/architecture \ + ../docs/api \ + ../docs/guides \ + ../docs/examples # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -765,33 +769,7 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox - +FILE_PATTERNS = *.cpp *.hpp *.md # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. @@ -906,7 +884,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = ../docs/architecture/overview.md #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -919,7 +897,7 @@ USE_MDFILE_AS_MAINPAGE = # also VERBATIM_HEADERS is set to NO. # The default value is: NO. -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. @@ -938,13 +916,13 @@ STRIP_CODE_COMMENTS = YES # function all documented functions referencing it will be listed. # The default value is: NO. -REFERENCED_BY_RELATION = NO +REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. -REFERENCES_RELATION = NO +REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES, then the hyperlinks from functions in REFERENCES_RELATION and @@ -2315,3 +2293,6 @@ GENERATE_LEGEND = YES # This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + + +HTML_DYNAMIC_MENUS = YES diff --git a/docs/api/core.md b/docs/api/core.md new file mode 100644 index 000000000..51f4e57ba --- /dev/null +++ b/docs/api/core.md @@ -0,0 +1,89 @@ +# Core API Documentation + +## Overview +The Core API provides fundamental building blocks for the Signals framework: +- Data management +- Module system +- Threading model +- Resource handling + +## Key Components + +### Data System +```cpp +namespace Modules { + class DataBase { + // Base class for all data containers + // Reference counted data management + }; + + class Data : public DataBase { + // Concrete data implementation + // Type-safe data container + }; +} +``` + +### Module System +```cpp +class IModule { + // Base interface for all modules + virtual void process() = 0; + virtual IOutput* getOutput(int i) = 0; + virtual IInput* getInput(int i) = 0; +}; + +class ModuleS : public IModule { + // Single input specialized module + void processOne(Data data); +}; +``` + +### Threading Model +- One thread per module +- Lock-free queues +- Thread-safe operations +- Event-driven processing + +### Resource Management +- RAII patterns +- Smart pointers +- Reference counting +- Safe type casting + +## Best Practices + +### Data Handling +```cpp +// Safe data casting +auto pcmData = safe_cast(data); + +// Reference counting +auto data = make_shared(); +``` + +### Module Development +```cpp +// Basic module implementation +struct CustomModule : public ModuleS { + void processOne(Data data) override { + // Process data + output->push(processedData); + } +}; +``` + +### Error Handling +```cpp +try { + // Module operations +} catch (const std::runtime_error& e) { + // Error propagation +} +``` + +## Performance Considerations +1. Zero-copy data passing +2. Lock-free queue implementation +3. Memory pool allocation +4. Thread synchronization patterns \ No newline at end of file diff --git a/docs/api/media.md b/docs/api/media.md new file mode 100644 index 000000000..841cfe2e5 --- /dev/null +++ b/docs/api/media.md @@ -0,0 +1,93 @@ +# Media API Documentation + +## Overview +The Media API provides essential components for audio and video processing within the Signals framework. It includes modules for demuxing, decoding, encoding, muxing, and various transformations. + +## Key Components + +### Common Types +- **PcmFormat**: Defines audio format +- **PictureFormat**: Defines video format +- **Metadata**: Stores media metadata +- **Attributes**: Extensible attribute system + +### Demuxing +- **LibavDemux**: FFmpeg-based demuxer +- **GpacDemux**: GPAC-based demuxer +```cpp +// Example: Using LibavDemux +DemuxConfig cfg; +cfg.url = "data/sample.mp4"; +auto demux = loadModule("LibavDemux", &NullHost, &cfg); +``` + +### Decoding +- **LibavDecode**: FFmpeg-based decoder +```cpp +// Example: Using LibavDecode +auto decode = loadModule("LibavDecode", &NullHost, nullptr); +``` + +### Encoding +- **LibavEncode**: FFmpeg-based encoder +```cpp +// Example: Using LibavEncode +EncoderConfig cfg; +cfg.codecName = "h264"; +auto encode = loadModule("LibavEncode", &NullHost, &cfg); +``` + +### Muxing +- **LibavMux**: FFmpeg-based muxer +- **GpacMux**: GPAC-based muxer +```cpp +// Example: Using LibavMux +MuxConfig cfg; +cfg.format = "mp4"; +cfg.path = "output.mp4"; +auto mux = loadModule("LibavMux", &NullHost, &cfg); +``` + +### Transformations +- **AudioConvert**: Audio format conversion +- **VideoScale**: Video scaling +- **LogoOverlay**: Video overlay +```cpp +// Example: Using AudioConvert +AudioConvertConfig cfg; +cfg.inputFormat = PcmFormat(44100, 2, AudioLayout::Stereo, AudioSampleFormat::S16, AudioStruct::Interleaved); +cfg.outputFormat = PcmFormat(48000, 2, AudioLayout::Stereo, AudioSampleFormat::S16, AudioStruct::Planar); +auto converter = loadModule("AudioConvert", &NullHost, &cfg); +``` + +## Best Practices + +### Data Handling +- Use reference-counted data containers +- Ensure type-safe casting +- Handle metadata properly + +### Performance +- Minimize memory copies +- Use efficient algorithms +- Profile critical paths + +### Error Handling +- Clear error messages +- Proper resource cleanup +- Exception safety + +## Example Workflow +```cpp +Pipeline p; +auto demux = p.add("LibavDemux", &cfg); +auto decode = p.add("LibavDecode"); +auto encode = p.add("LibavEncode", &encodeCfg); +auto mux = p.add("LibavMux", &muxCfg); + +p.connect(demux, decode); +p.connect(decode, encode); +p.connect(encode, mux); + +p.start(); +``` \ No newline at end of file diff --git a/docs/api/utils.md b/docs/api/utils.md new file mode 100644 index 000000000..20cb92e87 --- /dev/null +++ b/docs/api/utils.md @@ -0,0 +1,111 @@ +# Utils API Documentation + +## Overview +The Utils library provides essential utility functions and classes that support the core functionality of the Signals framework. These utilities include logging, time management, scheduling, and various helper functions. + +## Key Components + +### Logging +- **Log**: Centralized logging system +- **LogSink**: Interface for log output +```cpp +// Example: Logging usage +Log::info("Starting application..."); +Log::error("An error occurred"); +``` + +### Time Management +- **Clock**: Abstract clock interface +- **SystemClock**: Real-time system clock +- **Scheduler**: Task scheduling based on time +```cpp +// Example: Using SystemClock +auto clock = std::make_shared(); +auto now = clock->now(); +``` + +### Data Structures +- **SmallMap**: Lightweight map implementation +- **FIFO**: Lock-free FIFO queue +```cpp +// Example: Using SmallMap +SmallMap map; +map[1] = "one"; +map[2] = "two"; +``` + +### Profiling +- **Profiler**: Performance profiling tools +```cpp +// Example: Profiling a function +Profiler profiler("FunctionName"); +profiler.start(); +// Function code +profiler.stop(); +``` + +### Helper Functions +- **Tools**: General-purpose utility functions +- **Format**: String formatting utilities +```cpp +// Example: Using Tools +auto formatted = format("Value: %d", 42); +``` + +### Threading +- **Scheduler**: Task scheduling and execution +- **QueueLockFree**: Lock-free queue for thread-safe data exchange +```cpp +// Example: Using Scheduler +Scheduler scheduler; +scheduler.schedule([]() { + // Task code +}, 1000); // Schedule task to run after 1000ms +``` + +## Best Practices + +### Logging +- Use centralized logging for consistency +- Implement custom LogSink for specific output needs + +### Time Management +- Use SystemClock for real-time applications +- Leverage Scheduler for timed tasks + +### Data Structures +- Use SmallMap for small, fast maps +- Use FIFO for lock-free data exchange + +### Profiling +- Profile performance-critical sections +- Use Profiler to identify bottlenecks + +### Helper Functions +- Utilize Tools for common tasks +- Use Format for safe string formatting + +## Example Workflow +```cpp +// Example: Comprehensive usage +#include "lib_utils/log.hpp" +#include "lib_utils/clock.hpp" +#include "lib_utils/scheduler.hpp" +#include "lib_utils/tools.hpp" + +int main() { + Log::info("Application started"); + + auto clock = std::make_shared(); + Scheduler scheduler; + + scheduler.schedule([]() { + Log::info("Task executed"); + }, 1000); + + auto formatted = format("Current time: %lld", clock->now()); + Log::info(formatted); + + return 0; +} +``` \ No newline at end of file diff --git a/docs/architecture/modules.md b/docs/architecture/modules.md new file mode 100644 index 000000000..fb01c1f21 --- /dev/null +++ b/docs/architecture/modules.md @@ -0,0 +1,72 @@ +# Modules System + +## Overview +The Signals module system provides the core building blocks for creating modular media processing pipelines. + +## Module Types + +### Base Module Classes +- `Module`: Base class for all modules +- `ModuleS`: Single input specialized module +- `ModuleDynI`: Dynamic input module (e.g. muxers) + +### Key Components +1. Inputs/Outputs + - Input pins for receiving data + - Output pins for sending data + - Reference-counted data containers + - Type-safe connections + +2. Data Flow + - Process() method for data handling + - Flush() for end-of-stream + - Thread-safe execution + - Data attributes and metadata + +## Example Implementations + +### Basic Module +```cpp +struct PrintModule : public ModuleS { + PrintModule(KHost* host) { + output = addOutput(); + } + + void processOne(Data data) override { + // Process data + output->post(processedData); + } +}; +``` + +### Dynamic Module +```cpp +struct DynamicModule : public ModuleDynI { + void process() override { + // Handle multiple inputs + for(auto& input : inputs) { + Data data; + if(input->tryPop(data)) { + // Process data + } + } + } +}; +``` + +## Module Development Guidelines +1. Data Handling + - Use reference counting + - Handle metadata properly + - Implement flush() when needed + +2. Threading + - Modules are thread-safe when running + - No manual thread management needed + - Use host facilities for scheduling + +3. Error Handling + - Use exceptions for errors + - Propagate errors through pipeline + - Clean resource handling + diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md new file mode 100644 index 000000000..74f0c3cdd --- /dev/null +++ b/docs/architecture/overview.md @@ -0,0 +1,79 @@ +# Signals Framework Architecture + +## Overview +Signals is a modern C++ framework for building modular multimedia applications with a focus on: +- Minimal boilerplate code +- Flexible pipeline architecture +- Plugin-based extensibility +- Real-time media processing + +## Core Components + +### Library Structure +1. **lib_utils** (Base Layer) + - Lightweight C++ helpers + - String manipulation + - Container utilities + - Logging system + - Profiling tools + - Clock management + +2. **lib_signals** (Messaging Layer) + - Signal/slot mechanism + - Type-safe messaging + - C++11 based implementation + - Generic data transport + +3. **lib_modules** (Module System) + - Core module interfaces + - Data/metadata system + - Input/Output management + - Resource allocation + - Clock synchronization + +4. **lib_pipeline** (Pipeline Layer) + - Module orchestration + - Connection management + - Dynamic pipeline building + - Error handling + +5. **lib_media** (Media Layer) + - Audio/Video type definitions + - Format conversion + - Codec integration + - Stream management + +6. **plugins** (Extension Layer) + - FFmpeg integration + - GPAC integration + - Custom module implementations + - Media transformations + +## Key Concepts + +### Module System +- **IModule**: Base interface for all modules +- **Data Flow**: Reference counted data containers +- **Connections**: Type-safe module interconnections +- **Metadata**: Extensible attribute system + +### Pipeline Management +- Dynamic module loading +- Automatic resource management +- Error propagation +- Runtime reconfiguration + +### Plugin Architecture +- Dynamic loading +- Version management +- Resource isolation +- Platform independence + +## Workflow Examples + +### Basic Pipeline +```cpp +Pipeline p; +auto demux = p.add("LibavDemux", &cfg); +auto decoder = p.add("LibavDecode"); +p.connect(decoder, demux); \ No newline at end of file diff --git a/docs/architecture/pipeline.md b/docs/architecture/pipeline.md new file mode 100644 index 000000000..8a29e1181 --- /dev/null +++ b/docs/architecture/pipeline.md @@ -0,0 +1,80 @@ +# Pipeline System + +## Overview +The Pipeline system is the core orchestration layer in Signals, managing module lifecycles, connections, and data flow. + +## Key Components + +### Pipeline Class +- Module management +- Connection topology +- Thread safety +- Error handling +- Runtime reconfiguration + +### Core Features +1. **Module Management** +```cpp +// Add modules +auto demux = pipeline.add("LibavDemux", &cfg); +auto decoder = pipeline.addModule(); + +// Remove modules +pipeline.removeModule(module); +``` + +2. **Connections** +```cpp +// Connect modules +pipeline.connect(source, sink); +pipeline.connect(decoder, GetInputPin(muxer, 0)); + +// Dynamic modifications +pipeline.disconnect(source, 0, sink, 0); +``` + +3. **Pipeline Control** +```cpp +// Lifecycle +pipeline.start(); +pipeline.waitForEndOfStream(); +pipeline.exitSync(); +``` + +## Threading Models +- One thread per module +- Synchronized data flow +- Lock-free queues +- Thread-safe operations + +## Error Handling +```cpp +pipeline.registerErrorCallback([](const char* error) { + // Handle error +}); +``` + +## Common Patterns + +### Basic Pipeline +```cpp +Pipeline p; +auto source = p.add("FileInput", &inputConfig); +auto processor = p.add("Processor"); +auto sink = p.add("FileOutput", &outputConfig); + +p.connect(source, processor); +p.connect(processor, sink); +p.start(); +``` + +### Dynamic Modification +- Runtime module addition/removal +- Dynamic connection changes +- Hot-swapping components + +### Advanced Features +- Graph visualization +- Performance monitoring +- Resource management +- Plugin support \ No newline at end of file diff --git a/docs/architecture/plugins.md b/docs/architecture/plugins.md new file mode 100644 index 000000000..1282da397 --- /dev/null +++ b/docs/architecture/plugins.md @@ -0,0 +1,153 @@ +# Signals Plugin System + +## Overview +The Signals plugin system provides a flexible way to extend functionality through dynamically loaded modules. + + +## Plugin Architecture + +### Directory Structure +``` +src/plugins/ +├── decode/ # Decoder plugins +│ └── libav/ # FFmpeg decoder implementation +├── demux/ # Demultiplexer plugins +│ ├── gpac/ # GPAC MP4 demuxer +│ └── libav/ # FFmpeg demuxer +├── encode/ # Encoder plugins +│ └── libav/ # FFmpeg encoder +├── input/ # Input plugins +│ ├── libav/ # FFmpeg input +│ └── file/ # File system input +├── mux/ # Multiplexer plugins +│ ├── gpac/ # GPAC MP4 muxer +│ └── libav/ # FFmpeg muxer +├── transform/ # Transform plugins +│ ├── audio/ # Audio processing +│ │ ├── convert/ # Format conversion +│ │ └── resample/ # Audio resampling +│ └── video/ # Video processing +│ ├── convert/ # Pixel format conversion +│ ├── scale/ # Video scaling +│ └── overlay/ # Logo overlay +└── output/ # Output plugins + ├── display/ # Display output + ├── file/ # File output + └── sink/ # Data sink +``` + +### Plugin Base Classes +```cpp +// Base plugin interface +class IModule { + virtual void process() = 0; + virtual int getNumInputs() const = 0; + virtual int getNumOutputs() const = 0; +}; + +// Single input module +class ModuleS : public IModule { + virtual void processOne(Data data) = 0; +}; + +// Dynamic input module +class ModuleDynI : public IModule { + virtual void onNewInput(int inputIndex) = 0; +}; +``` + +### Plugin Categories + +#### 1. Media Container Plugins +- **Demuxers**: Extract elementary streams +- **Muxers**: Combine streams into containers +```cpp +// Demuxer configuration +struct DemuxConfig { + std::string url; + std::string format; +}; + +// Usage example +auto demux = loadModule("LibavDemux", &host, &cfg); +``` + +#### 2. Codec Plugins +- **Decoders**: Raw media extraction +- **Encoders**: Media compression +```cpp +// Decoder configuration +struct DecodeConfig { + std::string codecName; + int threads; +}; + +// Usage example +auto decoder = loadModule("LibavDecode", &host, &cfg); +``` + +#### 3. Transform Plugins +- **Audio**: Format conversion, resampling +- **Video**: Scaling, format conversion +```cpp +// Audio converter configuration +struct AudioConvertConfig { + PcmFormat inputFormat; + PcmFormat outputFormat; +}; + +// Usage example +auto converter = loadModule("AudioConvert", &host, &cfg); +``` + +### Plugin Development Guide + +#### 1. Plugin Registration +```cpp +// Required macro for plugin registration +REGISTER_MODULE("PluginName", PluginClass) +``` + +#### 2. Configuration Structure +```cpp +struct PluginConfig { + // Plugin specific parameters + std::string param1; + int param2; +}; +``` + +#### 3. Resource Management +```cpp +class CustomPlugin : public ModuleS { + ~CustomPlugin() { + // Cleanup resources + } + + void flush() override { + // Handle end of stream + } +}; +``` + +#### 4. Error Handling +```cpp +void processOne(Data data) override { + try { + // Process data + } catch (const std::exception& e) { + throw std::runtime_error("Plugin error: " + + std::string(e.what())); + } +} + + + + + + + + + + + diff --git a/docs/examples/basic_pipeline.md b/docs/examples/basic_pipeline.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/examples/custom_module.md b/docs/examples/custom_module.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/examples/media_processing.md b/docs/examples/media_processing.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/guides/building.md b/docs/guides/building.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/guides/contribution.md b/docs/guides/contribution.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/guides/getting_started.md b/docs/guides/getting_started.md new file mode 100644 index 000000000..e69de29bb From fa09abee8c86cd2339674c01d0e1089745eaffe8 Mon Sep 17 00:00:00 2001 From: soheibthriber Date: Wed, 19 Feb 2025 19:01:38 +0700 Subject: [PATCH 181/182] adding documentation: add layout remove old doc folder and create docs folder all documentation now is generated by doxygen --- CMakeLists.txt | 3 +- doc/README.md | 211 -- doc/build.md | 117 - docs/DoxygenLayout.xml | 47 + docs/api/core.md | 5 +- docs/api/media.md | 8 +- docs/api/utils.md | 5 +- docs/architecture/modules.md | 6 +- docs/architecture/overview.md | 49 +- docs/architecture/pipeline.md | 8 +- docs/architecture/plugins.md | 10 +- {doc => docs}/doxyfile | 9 +- docs/doxyfile.bak | 2823 +++++++++++++++++ docs/examples/basic_pipeline.md | 87 + docs/examples/custom_module.md | 128 + docs/examples/media_processing.md | 101 + doc/CODINGSTYLE => docs/guides/CODINGSTYLE.md | 106 +- docs/guides/building.md | 144 + docs/guides/contribution.md | 47 + docs/guides/getting_started.md | 67 + 20 files changed, 3557 insertions(+), 424 deletions(-) delete mode 100644 doc/README.md delete mode 100644 doc/build.md create mode 100644 docs/DoxygenLayout.xml rename {doc => docs}/doxyfile (99%) create mode 100644 docs/doxyfile.bak rename doc/CODINGSTYLE => docs/guides/CODINGSTYLE.md (80%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 626b6a2f7..14b9fb983 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ if(DOXYGEN_FOUND) set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src) set(DOXYGEN_OUTPUT_DIR ${PROJECT_BINARY_DIR}/docs) set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html) - set(DOXYFILE_IN ${PROJECT_SOURCE_DIR}/doc/doxyfile) + set(DOXYFILE_IN ${PROJECT_SOURCE_DIR}/docs/doxyfile) set(DOXYFILE_OUT ${PROJECT_BINARY_DIR}/doxyfile) # Configure the Doxyfile @@ -21,7 +21,6 @@ if(DOXYGEN_FOUND) COMMENT "Generating API documentation with Doxygen" VERBATIM) - endif() # Set toplevel signals directory here, so the CMakefiles work both standalone and under the lldash umbrella diff --git a/doc/README.md b/doc/README.md deleted file mode 100644 index ce63bd60d..000000000 --- a/doc/README.md +++ /dev/null @@ -1,211 +0,0 @@ - - -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - -- [Coding consideration](#coding-consideration) -- [Design](#design) -- [Write an application](#write-an-application) -- [Write a module](#write-a-module) -- [Internals](#internals) -- [Debugging](#debugging) -- [Tests](#tests) -- [Generating this doc](#generating-this-doc) -- [Contributing](#contributing) - - - -Coding consideration -==================== - -You need a C++14 compiler (MSVC2015+, gcc 7+, clang 3.1+). - -```ccache``` on unix will considerably accelerate rebuilds: consider aliasing your CXX (e.g. ```CXX="ccache g++"```). - -Before committing please execute tests (check.sh will reformat, build, and run the tests). Test execution should be fast (less than 10s). - -Design -====== - -Signals is layered (from bottom to top): -- src/lib_utils: some lightweight C++ helpers (strings, containers, log, profiling, clocks, etc.) -- src/lib_signals: an agnostic signal/slot mechanism using C++11. May convey any type of data with any type of messaging. -- src/lib_modules: an agnostic modules system. Uses signals to connect the modules. Modules are: inputs/outputs, a clock, an allocator, a data/metadata system. Everything can be configured thru templates. -- src/lib_pipeline: a pipeline of modules builder. Doesn't know anything about multimedia. -- src/lib_media/common: multimedia consideration. Defines types for audio and video, and a lot of -- src/lib_media and src/plugins: module implementations based on lib_modules and multimedia (encode/decode, mux/demux, transform, stream, render, etc.), and wrappers (FFmpeg and GPAC). - -Write an application -==================== - -You can create and connect the modules manually or use the Pipeline helper. - -Pipeline helper (recommended): -``` - Pipeline p; - - //add modules to the pipeline - DemuxConfig cfg; - cfg.url = "data/beepbop.mp4"; - auto demux = p.add("LibavDemux", &cfg); // named module - auto print = p.addModule(); // class-based module - - //connect all the demux outputs to the printer - for (int i = 0; i < demux->getNumOutputs(); ++i) - p.connect(print, i, demux, i); - - p.start(); - p.waitForCompletion(); //optional: will wait for the - //end-of-stream and flush all the data -``` - -Manual connections: -``` - auto demux = createModule("data/beepbop.mp4"); - auto print = createModule(std::cout); - for (int i = 0; i < demux->getNumOutputs(); ++i) - ConnectOutputToInput(demux->getOutput(0), print); - for(int i=0;i < 100;++i) - demux->process(); - demux->flush(); - print->flush(); -``` - -You can find more examples in the unit tests. - - -Write a module -============== - -Modules are an aggregate of inputs, outputs, a process(), and an optional flush() functions. Most Module instances derive from the single input ModuleS class: -``` -//single input specialized module -class ModuleS : public Module { - public: - ModuleS() : input(Module::addInput()) { - } - virtual void processOne(Data data) = 0; - void process() override { - Data data; - if(input->tryPop(data)) - processOne(data); - } - - // prevent derivatives from trying to add inputs - void addInput(int) {} - protected: - KInput* const input; -}; -``` - -Data is reference-counted. It means that you don't need to care about its lifetime because it will be released as soon as no modules use it. - -Module calls are thread-safe once running. - -To declare an input (more likely in the constructor), call ```addInput()```. - -To declare an output, call - -Constructor: use hard types or pointer on a configuration classes containing pointers or PODs. - -A module should never receive or send a nullptr. nullptr is for signalling the end of the execution. - -Modules only deal with media times, not system time. - -You can attach attributes to data. Media times are an attribute. - -``` -struct PrintModule : public ModuleS { - PrintModule(KHost* host) - : m_host(host) { - output = addOutput(); - } - - void processOne(Data in) override { - if(isDeclaration(in)) - return; // contains metadata but not data - - // ask for a buffer of type DataRaw - auto out = output->allocData(in->data().len); - - // copy input attributes (PTS, DTS, sync points, etc.) and metadata - out->copyAttributes(*in); - out->setMetadata(in->getMetadata()); - - // print whatever trace - m_host->log(Info, format("Received data of size %s.", in->data().len).c_str()); - - //post the output - output->post(out); - } - private: - KHost* const m_host; - OutputDefault* output; -}; -``` - -Internals -========= - -Signals is a data-driven framework. -It means that data is the engine of the execution (most frameworks are driven by time). -It means that: - - Input errors tend to propagate. They may appear in some later modules of your graph or pipeline. You may want to write modules to rectify the signal. - - Be careful to test each of your modules. - - A lack of input may stop all outputs and logs. - - There is no such thing as wall-clock time in the modules: the input data comes with a timestamp. For the rare modules that might need a wall-clock (e.g renderers), a clock abstraction "IClock" is provided, whose implementation is provided by the application. - -Modules see the outside world using the K-prefixed classes: KInput, KOutput, KHost. The framework sees the I-prefixed classes. - -KHost allows to inject facilities such as logs inside a module. These facilities are injected to keep allocation and deletion under the same runtime when using dynamic libraries. - -Errors are handled by throwing ```error(const char *)```. - -Optionally modules can implement an end-of stream function called ```flush()```. Note that this is different from the destructor. - -How to declare an input: ```addInput()```. - -What about dynamic inputs as e.g. required by muxers: derive from the ```ModuleDynI``` class. - -How to declare an output: ```addOutput()```. - -Modules carry metadata. Metadata is carried forward in the module chain when being transmitted through data. However it is carried backward at connection time i.e. from the input pin of the next module to the output pin of the previous module. - -When developping modules, you should not take care of concurrency (threads or mutex). People implementing the executors should. - -Signals takes care of the hard part for you. However this is tweakable. - -About parallelism, take care that modules may execute blocking calls when trying to get an output buffer (this depends on your allocator policy). This may lead to deadlock if you run on a thread-pool with not enough threads. This may be solved in different ways: - - one thread per module (```#define EXECUTOR EXECUTOR_ASYNC_THREAD```, - - more permissive allocator, - - blocking calls returns cooperatively to the scheduler. - -A source is a module with no input. Sources are enabled until they call ```m_host->activate(false);```. - -Take care of the order of destruction of your modules. Data allocators are held by the outputs and may not be destroyed while data is in use. Note that Pipeline handles this for you. - -Data size should have a size so that the allocator can recycle. - -Data can be safely cast. Instead of using ```std::dynamic_pointer_cast``` we advise you to use ```safe_cast``` present in ```lib_utils/tools.hpp``` - -Debugging -========= - -```DEBUG=1 make```. - -Tests -===== - -Unit tests are auto-detected when put in .cpp files in unittests/ subdirectory. - -Generating this doc -=================== - -Markdown: doctoc for tables of content - -Doxygen: http://gpac.github.io/signals/ - -Contributing -============ - -Motion Spell is a private company. Contact us at contact@motionspell.com - diff --git a/doc/build.md b/doc/build.md deleted file mode 100644 index 243ec2fd5..000000000 --- a/doc/build.md +++ /dev/null @@ -1,117 +0,0 @@ - - -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - -- [Build](#build) -- [Run](#run) - - - -# Build - -Use GNU Make (tested under gcc >= 7) (all other platforms, possible on Windows using msys2) - -## Make -If you want to use the Make build system, the dependencies for Signals need to be downloaded and built first. - -### Dependencies - -To do that, simply run the following script : -``` -$ PREFIX=/path/to/your/destination/prefix ./extra.sh -``` - -This script will first ask you to install some tools (make, libtools, nasm, rsync ...). -On completion, it will create a 'sysroot' directory at the location given by "PREFIX". -Choose the destination path wisely, as the generated 'sysroot' isn't guaranteed -to be relocatable. - -``` -$ PREFIX=/home/john/source/signals-sysroot ./extra.sh -``` - -Once 'extra.sh' is done, you need to set the environment variable 'EXTRA' -so it points to your newly created sysroot directory. - -``` -$ export EXTRA=/home/john/source/signals-sysroot -``` - -You can then run make: - -``` -$ make -``` - -Note: - -You can use the ```CPREFIX``` environment variable to indicate another build toolchain e.g.: - -``` -PREFIX=/home/john/source/signals-sysroot-w32 CPREFIX=x86_64-w64-mingw32 ./extra.sh -``` - -#### MinGW-w64 - -On Windows, to be able to use GNU Make, we recommend using [msys2](https://msys2.github.io/) -and using its native package manager ('pacman') to install those tools. - -However, some environment variables including PATH need to be tweaked (especially if it contains spaces) as follows: -64 bits: -``` -$ export PATH=/mingw64/bin:$PATH -$ export MSYSTEM=MINGW32 -$ export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig -``` - -32 bits: -``` -$ export PATH=/mingw32/bin:$PATH -$ export MSYSTEM=MINGW32 -$ export PKG_CONFIG_PATH=/mingw32/lib/pkgconfig -``` - -Once the dependencies are built, on Windows with msys2, in bin/make/config.mk, remove ```-XCClinker``` (introduced by SDL2). - -Note: when using a MinGW-w64 toolchains, you may have a failure when trying to build signals for the first time. -Please modify the bin/make/config.mk file accordingly: -- add ```-D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN``` -- Linux only: remove ```-mwindows``` and make you you selected posix threads with ```sudo update-alternatives --config x86_64-w64-mingw32-g++``` - -#### MacOS - -You must set the ```NASM``` environment variable. Check the latest on http://www.nasm.us/pub/nasm/releasebuilds. - -``` -NASM=/usr/local/bin/nasm ./extra.sh -``` - -### build signals - -Finally, you can run: -``` -$ ./check.sh -``` - -or - -``` -$ PKG_CONFIG_PATH=$PWD/extra/x86_64-w64-mingw32/lib/pkgconfig CXX=x86_64-w64-mingw32-g++ ./check.sh -``` - -### Out of tree builds - -You can tell the build system to generate its binaries elsewhere, -by setting the 'BIN' environment variable (which defaults to 'bin'): - -``` -$ make BIN=subdir -``` - -# Run -The binaries, by default, are in generated in ```bin/```including a sample player, the dashcastx application, and all the unit test apps. - -#### Linux - -If you encounter this error message: ```[SDLVideo render] Couldn't initialize: No available video device```, please install the ```libxext-dev``` package on your system. - diff --git a/docs/DoxygenLayout.xml b/docs/DoxygenLayout.xml new file mode 100644 index 000000000..6eab8cb70 --- /dev/null +++ b/docs/DoxygenLayout.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/core.md b/docs/api/core.md index 51f4e57ba..defd9e920 100644 --- a/docs/api/core.md +++ b/docs/api/core.md @@ -1,4 +1,6 @@ -# Core API Documentation +# Core API Documentation {#core_api} +\page core_api Core API Documentation +\ingroup api ## Overview The Core API provides fundamental building blocks for the Signals framework: @@ -25,6 +27,7 @@ namespace Modules { ``` ### Module System + ```cpp class IModule { // Base interface for all modules diff --git a/docs/api/media.md b/docs/api/media.md index 841cfe2e5..ade0aea9d 100644 --- a/docs/api/media.md +++ b/docs/api/media.md @@ -1,4 +1,6 @@ -# Media API Documentation +# Media API Documentation {#media_api} +\page media_api Media API Documentation +\ingroup api ## Overview The Media API provides essential components for audio and video processing within the Signals framework. It includes modules for demuxing, decoding, encoding, muxing, and various transformations. @@ -78,6 +80,8 @@ auto converter = loadModule("AudioConvert", &NullHost, &cfg); - Exception safety ## Example Workflow + + ```cpp Pipeline p; auto demux = p.add("LibavDemux", &cfg); @@ -90,4 +94,4 @@ p.connect(decode, encode); p.connect(encode, mux); p.start(); -``` \ No newline at end of file +``` diff --git a/docs/api/utils.md b/docs/api/utils.md index 20cb92e87..7d5806075 100644 --- a/docs/api/utils.md +++ b/docs/api/utils.md @@ -1,4 +1,7 @@ -# Utils API Documentation +# Utils API Documentation {#utils_api} +\page utils_api Utils API Documentation +\ingroup api + ## Overview The Utils library provides essential utility functions and classes that support the core functionality of the Signals framework. These utilities include logging, time management, scheduling, and various helper functions. diff --git a/docs/architecture/modules.md b/docs/architecture/modules.md index fb01c1f21..ea4bbf076 100644 --- a/docs/architecture/modules.md +++ b/docs/architecture/modules.md @@ -1,4 +1,6 @@ -# Modules System +# Modules {#modules} +\page modules Modules +\ingroup architecture ## Overview The Signals module system provides the core building blocks for creating modular media processing pipelines. @@ -70,3 +72,5 @@ struct DynamicModule : public ModuleDynI { - Propagate errors through pipeline - Clean resource handling + + diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md index 74f0c3cdd..e7f6dc599 100644 --- a/docs/architecture/overview.md +++ b/docs/architecture/overview.md @@ -1,6 +1,7 @@ -# Signals Framework Architecture +# %Signals Framework Overview {#mainpage} +\ingroup architecture -## Overview +## Introduction Signals is a modern C++ framework for building modular multimedia applications with a focus on: - Minimal boilerplate code - Flexible pipeline architecture @@ -10,7 +11,7 @@ Signals is a modern C++ framework for building modular multimedia applications w ## Core Components ### Library Structure -1. **lib_utils** (Base Layer) +1. **@ref core_api "lib_utils"** (Base Layer) - Lightweight C++ helpers - String manipulation - Container utilities @@ -24,26 +25,26 @@ Signals is a modern C++ framework for building modular multimedia applications w - C++11 based implementation - Generic data transport -3. **lib_modules** (Module System) +3. **@ref modules "lib_modules"** (Module System) - Core module interfaces - Data/metadata system - Input/Output management - Resource allocation - Clock synchronization -4. **lib_pipeline** (Pipeline Layer) +4. **@ref pipeline "lib_pipeline"** (Pipeline Layer) - Module orchestration - Connection management - Dynamic pipeline building - Error handling -5. **lib_media** (Media Layer) +5. **@ref media_api "lib_media"** (Media Layer) - Audio/Video type definitions - Format conversion - Codec integration - Stream management -6. **plugins** (Extension Layer) +6. **@ref plugins "plugins"** (Extension Layer) - FFmpeg integration - GPAC integration - Custom module implementations @@ -51,29 +52,35 @@ Signals is a modern C++ framework for building modular multimedia applications w ## Key Concepts -### Module System -- **IModule**: Base interface for all modules -- **Data Flow**: Reference counted data containers -- **Connections**: Type-safe module interconnections -- **Metadata**: Extensible attribute system +### Modules +See @ref modules for details. +- **@ref Modules::IModule "IModule"**: Base interface for all modules +- **@ref Modules::Data "Data Flow"**: Reference counted data containers +- **@ref Modules::Connection "Connections"**: Type-safe module interconnections +- **@ref Modules::Metadata "Metadata"**: Extensible attribute system ### Pipeline Management -- Dynamic module loading -- Automatic resource management -- Error propagation -- Runtime reconfiguration +See @ref pipeline for details. +- @ref Pipeline::Manager "Dynamic module loading" +- @ref Pipeline::ResourceManager "Automatic resource management" +- @ref Pipeline::ErrorHandler "Error propagation" +- @ref Pipeline::Config "Runtime reconfiguration" ### Plugin Architecture -- Dynamic loading -- Version management -- Resource isolation -- Platform independence +See @ref plugins for details. +- @ref Plugin::Loader "Dynamic loading" +- @ref Plugin::Version "Version management" +- @ref Plugin::Resource "Resource isolation" +- @ref Plugin::Platform "Platform independence" ## Workflow Examples ### Basic Pipeline + ```cpp Pipeline p; auto demux = p.add("LibavDemux", &cfg); auto decoder = p.add("LibavDecode"); -p.connect(decoder, demux); \ No newline at end of file +p.connect(decoder, demux); +``` +For a complete example, see @ref basic_pipeline_example "Basic Pipeline Example" diff --git a/docs/architecture/pipeline.md b/docs/architecture/pipeline.md index 8a29e1181..9fdb7a8c4 100644 --- a/docs/architecture/pipeline.md +++ b/docs/architecture/pipeline.md @@ -1,4 +1,6 @@ -# Pipeline System +# Pipelines {#pipeline} +\page pipeline Pipeline +\ingroup architecture ## Overview The Pipeline system is the core orchestration layer in Signals, managing module lifecycles, connections, and data flow. @@ -77,4 +79,6 @@ p.start(); - Graph visualization - Performance monitoring - Resource management -- Plugin support \ No newline at end of file +- Plugin support + + diff --git a/docs/architecture/plugins.md b/docs/architecture/plugins.md index 1282da397..d25c5bc58 100644 --- a/docs/architecture/plugins.md +++ b/docs/architecture/plugins.md @@ -1,4 +1,7 @@ -# Signals Plugin System + +# Plugins {#plugins} +\page plugins Plugins +\ingroup architecture ## Overview The Signals plugin system provides a flexible way to extend functionality through dynamically loaded modules. @@ -146,8 +149,3 @@ void processOne(Data data) override { - - - - - diff --git a/doc/doxyfile b/docs/doxyfile similarity index 99% rename from doc/doxyfile rename to docs/doxyfile index 211e6cf86..6444ad813 100644 --- a/doc/doxyfile +++ b/docs/doxyfile @@ -59,7 +59,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = docs +OUTPUT_DIRECTORY = docs # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -663,7 +663,8 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = ../docs/DoxygenLayout.xml + # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -751,6 +752,7 @@ INPUT = ../src/ \ ../docs/guides \ ../docs/examples + # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv @@ -816,7 +818,8 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = ../docs/examples + # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and diff --git a/docs/doxyfile.bak b/docs/doxyfile.bak new file mode 100644 index 000000000..6e978211d --- /dev/null +++ b/docs/doxyfile.bak @@ -0,0 +1,2823 @@ +# Doxyfile 1.9.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = signals + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 0.9.8 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Signals: a modern C++ framework to build modular applications." + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = docs + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = YES + +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = NO + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = NO + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = "architecture=\defgroup architecture Architecture\n" \ + "api=\defgroup api API Documentation\n" \ + "guides=\defgroup guides Guides\n" \ + "examples=\defgroup examples Examples\n" + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = YES + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = YES + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = YES + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = NO + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = ${PROJECT_SOURCE_DIR}/docs/DoxygenLayout.xml + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = NO + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = doxygen_warnings.txt + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ${PROJECT_SOURCE_DIR}/src \ + ${PROJECT_SOURCE_DIR}/docs/architecture \ + ${PROJECT_SOURCE_DIR}/docs/api \ + ${PROJECT_SOURCE_DIR}/docs/guides \ + ${PROJECT_SOURCE_DIR}/docs/examples + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, +# *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, *.php, +# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be +# provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.cpp \ + *.hpp \ + *.md + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = ${PROJECT_SOURCE_DIR}/docs/examples + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = ${PROJECT_SOURCE_DIR}/docs/architecture/overview.md + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: +# http://clang.llvm.org/) for more accurate parsing at the cost of reduced +# performance. This can be particularly helpful with template rich C++ code for +# which doxygen's built-in parser lacks the necessary type information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS +# tag is set to YES then doxygen will add the directory of each input to the +# include path. +# The default value is: YES. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_ADD_INC_PATHS = YES + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the -p option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /