Skip to content

Commit

Permalink
Add pipewire support and fix Linux build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nhielost committed Apr 28, 2024
1 parent 0d1d8fd commit d8886f4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
25 changes: 6 additions & 19 deletions .github/scripts/utils.zsh/setup_linux
Expand Up @@ -12,8 +12,6 @@ if (( ! ${+target} )) {

pushd ${project_root}

typeset -g QT_VERSION

local -a apt_args=(
${CI:+-y}
--no-install-recommends
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Expand Up @@ -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(
Expand Down
13 changes: 13 additions & 0 deletions cmake/linux/defaults.cmake
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/actions/mmg-action-video-sources.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit d8886f4

Please sign in to comment.