diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 67b4a02..c93b540 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -60,6 +60,11 @@ set_target_properties(SDL2 PROPERTIES IMPORTED_LOCATION_RELEASE ${sdl2_install_d set_target_properties(SDL2 PROPERTIES IMPORTED_LOCATION_DEBUG ${sdl2_install_dir}/lib/SDL2d${CMAKE_STATIC_LIBRARY_SUFFIX}) add_dependencies(SDL2 sdl2) +add_library(SDL2main STATIC IMPORTED) +set_target_properties(SDL2main PROPERTIES IMPORTED_LOCATION_RELEASE ${sdl2_install_dir}/lib/SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}) +set_target_properties(SDL2main PROPERTIES IMPORTED_LOCATION_DEBUG ${sdl2_install_dir}/lib/SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}) +add_dependencies(SDL2main sdl2) + ExternalProject_Get_Property(project_portaudio install_dir) set(portaudio_install_dir ${install_dir}) @@ -74,14 +79,21 @@ add_library(Portaudio STATIC IMPORTED) set_target_properties(Portaudio PROPERTIES IMPORTED_LOCATION ${portaudio_install_dir}/lib/${portaudio_libName}) add_dependencies(Portaudio project_portaudio) -set(ADD_LIBS SDL2 Portaudio) -set(ADD_INCLUDES_PATHS - ${sdl2_install_dir}/include - ${portaudio_install_dir}/include -) +#set(ADD_LIBS SDL2 Portaudio) +#set(ADD_INCLUDES_PATHS +# ${sdl2_install_dir}/include +# ${portaudio_install_dir}/include +#) + +set(PORTAUDIO_INCLUDE_DIRS ${portaudio_install_dir}/include) +set(PORTAUDIO_LIBRARIES Portaudio) set(SDL2_FOUND TRUE) set(PORTAUDIO_FOUND TRUE) +set(PORTAUDIO_VERSION 19) + +add_library(SDL2::SDL2main ALIAS SDL2main) +add_library(SDL2::SDL2 ALIAS SDL2) else() @@ -92,6 +104,7 @@ endif() set(PlayerWriter_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pcm_utils/PlayerWriter) + if ((SDL2_FOUND) AND (PORTAUDIO_FOUND) AND (PORTAUDIO_VERSION EQUAL 19)) set(ADD_LIBS ${PORTAUDIO_LIBRARIES}) set(ADD_INCLUDES_PATHS ${PORTAUDIO_INCLUDE_DIRS}) @@ -102,8 +115,6 @@ if ((SDL2_FOUND) AND (PORTAUDIO_FOUND) AND (PORTAUDIO_VERSION EQUAL 19)) list(APPEND ADD_LIBS SDL2::SDL2main SDL2::SDL2) endif() - message(STATUS "Include: " ${ADD_INCLUDES_PATHS}) - set(PlayerWriter_SRC ${PlayerWriter_DIR}/player.cpp ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8d3d96..425eaa5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -150,6 +150,11 @@ if (NOT WIN32) ) endif() + +#if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") +#set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:playlib /NODEFAULTLIB:common") +#endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_SIZEOF_VOID_P EQUAL 4) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/SAFESEH:NO") endif() diff --git a/src/argparser.cpp b/src/argparser.cpp index d723073..4fd7176 100644 --- a/src/argparser.cpp +++ b/src/argparser.cpp @@ -125,7 +125,7 @@ void Options::dump(std::ostream &os) const { } os << "\tUse dither: " << printBool(width14 ? use_dither : false) << endl; - if ((crop_top || crop_bot) && !rpiMode) { + if ((crop_top || crop_bot)) { os << "\tCrop video top=" << crop_top << ", bot=" << crop_bot << endl; } if (codec != uncompresed) { diff --git a/src/ctrlc_listener.cpp b/src/ctrlc_listener.cpp index 357afb8..d15684e 100644 --- a/src/ctrlc_listener.cpp +++ b/src/ctrlc_listener.cpp @@ -1,3 +1,4 @@ +#include #ifdef _MSC_VER #include diff --git a/src/ffmpegvideocoder.h b/src/ffmpegvideocoder.h index cc20c72..ceb26c6 100644 --- a/src/ffmpegvideocoder.h +++ b/src/ffmpegvideocoder.h @@ -2,6 +2,7 @@ #define FFMPEGVIDEOCODER_H #include +#include #include "ipcmframeprocessingpolicy.h" diff --git a/src/main-st.cpp b/src/main-st.cpp index f6f91e7..26a65f7 100644 --- a/src/main-st.cpp +++ b/src/main-st.cpp @@ -108,7 +108,11 @@ static int play(Options &options) { // --- working pipeline --- Splitter *splitter = nullptr; - if (options.Play() && !options.rpiMode) { + if (options.Play() +#if RPI + && !options.rpiMode +#endif + ) { #if PLAYER splitter = new Splitter(); splitter->AddConsumer(new PlayerConsumer(0, 2)); @@ -119,7 +123,11 @@ static int play(Options &options) { new BitWidthConverter{options.width14, options.use_dither}; auto &preparedSamples = - (options.Play() && !options.rpiMode) + (options.Play() +#if RPI + && !options.rpiMode +#endif + ) ? audioprodusser.NextStage(splitter).NextStage(bitWidthConverter) : audioprodusser.NextStage(bitWidthConverter);