From d8886f4a2edaf892a7330fbc010793dddae8c9b4 Mon Sep 17 00:00:00 2001 From: nhielost Date: Sun, 28 Apr 2024 14:59:40 -0400 Subject: [PATCH] Add pipewire support and fix Linux build issues --- .github/scripts/utils.zsh/setup_linux | 25 ++++++------------------ CMakeLists.txt | 3 +-- cmake/linux/defaults.cmake | 13 ++++++++++++ src/actions/mmg-action-video-sources.cpp | 2 +- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/scripts/utils.zsh/setup_linux b/.github/scripts/utils.zsh/setup_linux index d7fe829..ba019d5 100644 --- a/.github/scripts/utils.zsh/setup_linux +++ b/.github/scripts/utils.zsh/setup_linux @@ -12,8 +12,6 @@ if (( ! ${+target} )) { pushd ${project_root} -typeset -g QT_VERSION - local -a apt_args=( ${CI:+-y} --no-install-recommends @@ -42,25 +40,14 @@ if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) { build-essential \ libgles2-mesa-dev \ libasound2-dev \ - libobs-dev \ + libpipewire-0.3-dev \ obs-studio - local -a _qt_packages=() - - if (( QT_VERSION == 5 )) { - _qt_packages+=( - qtbase5-dev${suffix} - libqt5svg5-dev${suffix} - qtbase5-private-dev${suffix} - libqt5x11extras5-dev${suffix} - ) - } else { - _qt_packages+=( - qt6-base-dev${suffix} - libqt6svg6-dev${suffix} - qt6-base-private-dev${suffix} - ) - } + local -a _qt_packages=( + qt6-base-dev${suffix} + libqt6svg6-dev${suffix} + qt6-base-private-dev${suffix} + ) sudo apt-get install ${apt_args} ${_qt_packages} log_group diff --git a/CMakeLists.txt b/CMakeLists.txt index a5c036f..40ad83f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,9 @@ if(ENABLE_QT) endif() # Include libremidi library +set(CMAKE_CXX_STANDARD 20) add_subdirectory(libremidi EXCLUDE_FROM_ALL) target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PRIVATE libremidi/include) -# Prevent libremidi from causing MIDI 2 and C++20 errors when compiling -set_target_properties(libremidi PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS ON) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libremidi) target_sources( diff --git a/cmake/linux/defaults.cmake b/cmake/linux/defaults.cmake index 72437a1..1d99bba 100644 --- a/cmake/linux/defaults.cmake +++ b/cmake/linux/defaults.cmake @@ -7,8 +7,21 @@ include_guard(GLOBAL) +include(FetchContent) include(GNUInstallDirs) +# libremidi dependency for pipewire support +# cmake-format: off +if (NOT TARGET readerwriterqueue) + FetchContent_Declare( + readerwriterqueue + GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue + GIT_TAG master + ) + FetchContent_MakeAvailable(readerwriterqueue) +endif() +# cmake-format: on + # Enable find_package targets to become globally available targets set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE) diff --git a/src/actions/mmg-action-video-sources.cpp b/src/actions/mmg-action-video-sources.cpp index 3f7a272..a86abaf 100644 --- a/src/actions/mmg-action-video-sources.cpp +++ b/src/actions/mmg-action-video-sources.cpp @@ -429,7 +429,7 @@ void MMGActionVideoSources::updateTransform() const obs_sceneitem_t *obs_sceneitem = obs_scene_find_source_recursive(obs_scene, obs_source_get_name(obs_source)); if (!obs_sceneitem) return; - obs_sceneitem_get_info(obs_sceneitem, &at->ti); + obs_sceneitem_get_info2(obs_sceneitem, &at->ti); obs_sceneitem_get_crop(obs_sceneitem, &at->crop); at->scale_type = obs_sceneitem_get_scale_filter(obs_sceneitem); at->blend_type = obs_sceneitem_get_blending_mode(obs_sceneitem);