Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 4 additions & 88 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:

macos-build:
name: macOS 🍏
runs-on: macos-15
runs-on: macos-14
needs: check-event
strategy:
fail-fast: false
Expand All @@ -80,8 +80,8 @@ jobs:
: Set Up Environment 🔧
if (( ${+RUNNER_DEBUG} )) setopt XTRACE

print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::group::Enable Xcode 15.4'
sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer
print '::endgroup::'

print '::group::Clean Homebrew Environment'
Expand Down Expand Up @@ -168,6 +168,7 @@ jobs:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-ccache-${{ matrix.target }}-${{ needs.check-event.outputs.config }}


ubuntu-build:
name: Ubuntu 🐧
strategy:
Expand All @@ -191,7 +192,6 @@ jobs:
key: ${{ runner.os }}-${{ matrix.os }}-ccache-x86_64-${{ needs.check-event.outputs.config }}
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-ccache-x86_64-

- name: Build OBS Studio 🧱
uses: ./.github/actions/build-obs
env:
Expand Down Expand Up @@ -239,90 +239,6 @@ jobs:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-${{ matrix.os }}-ccache-x86_64-${{ needs.check-event.outputs.config }}

flatpak-build:
name: Flatpak 📦
runs-on: ubuntu-24.04
needs: check-event
defaults:
run:
shell: bash
env:
FLATPAK_BUILD_SHARE_PATH: flatpak_app/files/share
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
set-safe-directory: ${{ env.GITHUB_WORKSPACE }}

- name: Set Up Environment 🔧
id: setup
env:
GH_TOKEN: ${{ github.token }}
run: |
: Set Up Environment 🔧
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi

git config --global --add safe.directory "${GITHUB_WORKSPACE}"

cache_key='flatpak-builder-${{ hashFiles('build-aux/**/*.json') }}'
cache_ref='master'
read -r id key size unit created accessed <<< \
"$(gh cache list --ref "refs/heads/${cache_ref}" --key "${cache_key}-x86_64" | head -1)"

if [[ "${key}" ]]; then
echo "cacheHit=true" >> $GITHUB_OUTPUT
else
echo "cacheHit=false" >> $GITHUB_OUTPUT
fi

echo "cacheKey=${cache_key}" >> $GITHUB_OUTPUT

- name: Validate Flatpak manifest
uses: ./.github/actions/flatpak-builder-lint
with:
artifact: manifest
path: build-aux/com.obsproject.Studio.json

- name: Build Flatpak Manifest 🧾
uses: flatpak/flatpak-github-actions/flatpak-builder@10a3c29f0162516f0f68006be14c92f34bd4fa6c
with:
build-bundle: ${{ fromJSON(needs.check-event.outputs.package) }}
bundle: obs-studio-flatpak-${{ needs.check-event.outputs.commitHash }}.flatpak
manifest-path: ${{ github.workspace }}/build-aux/com.obsproject.Studio.json
cache: ${{ fromJSON(steps.setup.outputs.cacheHit) || (github.event_name == 'push' && github.ref_name == 'master')}}
restore-cache: ${{ fromJSON(steps.setup.outputs.cacheHit) }}
cache-key: ${{ steps.setup.outputs.cacheKey }}
mirror-screenshots-url: https://dl.flathub.org/media

- name: Validate AppStream
uses: ./.github/actions/flatpak-builder-lint
with:
artifact: appstream
path: ${{ env.FLATPAK_BUILD_SHARE_PATH }}/metainfo/com.obsproject.Studio.metainfo.xml

- name: Verify Icon and Metadata in app-info
working-directory: ${{ env.FLATPAK_BUILD_SHARE_PATH }}
run: |
: Verify Icon and Metadata in app-info
test -f app-info/icons/flatpak/128x128/com.obsproject.Studio.png || { echo "::error::Missing 128x128 icon in app-info"; exit 1; }
test -f app-info/xmls/com.obsproject.Studio.xml.gz || { echo "::error::Missing com.obsproject.Studio.xml.gz in app-info"; exit 1; }

- name: Validate build directory
uses: ./.github/actions/flatpak-builder-lint
with:
artifact: builddir
path: flatpak_app

- name: Validate repository
uses: ./.github/actions/flatpak-builder-lint
with:
artifact: repo
path: repo

windows-build:
name: Windows 🪟
strategy:
Expand Down
4 changes: 2 additions & 2 deletions cmake/macos/compilerconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ set_property(CACHE CMAKE_OSX_ARCHITECTURES PROPERTY STRINGS arm64 x86_64)

# Ensure recent enough Xcode and platform SDK
function(check_sdk_requirements)
set(obs_macos_minimum_sdk 15.0) # Keep in sync with Xcode
set(obs_macos_minimum_xcode 16.0) # Keep in sync with SDK
set(obs_macos_minimum_sdk 14.2) # Keep in sync with Xcode
set(obs_macos_minimum_xcode 15.1) # Keep in sync with SDK
execute_process(
COMMAND xcrun --sdk macosx --show-sdk-platform-version
OUTPUT_VARIABLE obs_macos_current_sdk
Expand Down
39 changes: 24 additions & 15 deletions cmake/macos/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function(set_target_properties_obs target)
set(multiValueArgs PROPERTIES)
cmake_parse_arguments(PARSE_ARGV 0 _STPO "${options}" "${oneValueArgs}" "${multiValueArgs}")

message(DEBUG "Setting additional properties for target ${target}...")
message(STATUS "Setting additional properties for target ${target}...")

while(_STPO_PROPERTIES)
list(POP_FRONT _STPO_PROPERTIES key value)
Expand Down Expand Up @@ -86,21 +86,30 @@ function(set_target_properties_obs target)
endif()

get_property(obs_executables GLOBAL PROPERTY _OBS_EXECUTABLES)
add_dependencies(${target} ${obs_executables})
foreach(executable IN LISTS obs_executables)
set_target_xcode_properties(${executable} PROPERTIES INSTALL_PATH
"$(LOCAL_APPS_DIR)/$<TARGET_BUNDLE_DIR_NAME:${target}>/Contents/MacOS"
)

if ("${obs_executables}")
message(STATUS "Add dependencies (${target}) (${obs_executables})")
add_dependencies(${target} ${obs_executables})

foreach(executable IN LISTS obs_executables)
message(STATUS "Set target xcode properties (${executable}) ($(LOCAL_APPS_DIR)/$<TARGET_BUNDLE_DIR_NAME:${target}>/Contents/MacOS)")
set_target_xcode_properties(${executable} PROPERTIES INSTALL_PATH
"$(LOCAL_APPS_DIR)/$<TARGET_BUNDLE_DIR_NAME:${target}>/Contents/MacOS"
)

add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${executable}>"
"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/MacOS/"
COMMENT "Copy ${executable} to application bundle"
)
endforeach()
message(STATUS "Add custom command (${target}) (${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${executable}>) ($<TARGET_BUNDLE_CONTENT_DIR:${target}>/MacOS/)")
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${executable}>"
"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/MacOS/"
COMMENT "Copy ${executable} to application bundle"
)
endforeach()
else()
message(STATUS "No dependencies (${target})")
endif()

if(VIRTUALCAM_DEVICE_UUID AND VIRTUALCAM_SOURCE_UUID AND VIRTUALCAM_SINK_UUID)
set(has_virtualcam_uuids TRUE)
Expand Down
12 changes: 7 additions & 5 deletions cmake/windows/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function(set_target_properties_obs target)
set(multiValueArgs PROPERTIES)
cmake_parse_arguments(PARSE_ARGV 0 _STPO "${options}" "${oneValueArgs}" "${multiValueArgs}")

message(DEBUG "Setting additional properties for target ${target}...")
message(STATUS "Setting additional properties for target ${target}...")

while(_STPO_PROPERTIES)
list(POP_FRONT _STPO_PROPERTIES key value)
Expand All @@ -20,6 +20,8 @@ function(set_target_properties_obs target)

get_target_property(target_type ${target} TYPE)

message(STATUS "Windows target_type: ${target_type}")

if(target_type STREQUAL EXECUTABLE)
if(target STREQUAL obs-browser-helper)
set(OBS_EXECUTABLE_DESTINATION "${OBS_PLUGIN_DESTINATION}")
Expand Down Expand Up @@ -107,7 +109,7 @@ function(set_target_properties_obs target)
COMPONENT Runtime
)
elseif(${target} STREQUAL obs-browser)
message(DEBUG "Add Chromium Embedded Framework to project for obs-browser plugin...")
message(STATUS "Add Chromium Embedded Framework to project for obs-browser plugin...")
if(TARGET CEF::Library)
get_target_property(imported_location CEF::Library IMPORTED_LOCATION_RELEASE)

Expand Down Expand Up @@ -300,7 +302,7 @@ endfunction()

# Helper function to add resources into bundle
function(target_install_resources target)
message(DEBUG "Installing resources for target ${target}...")
message(STATUS "Installing resources for target ${target}...")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
foreach(data_file IN LISTS data_files)
Expand Down Expand Up @@ -358,7 +360,7 @@ function(target_add_resource target resource)
set(target_destination "${OBS_DATA_DESTINATION}/${target}")
endif()

message(DEBUG "Add resource '${resource}' to target ${target} at destination '${target_destination}'...")
message(STATUS "Add resource '${resource}' to target ${target} at destination '${target_destination}'...")

install(FILES "${resource}" DESTINATION "${target_destination}" COMPONENT Runtime)

Expand All @@ -377,7 +379,7 @@ endfunction()

# _bundle_dependencies: Resolve third party dependencies and add them to Windows binary directory
function(_bundle_dependencies target)
message(DEBUG "Discover dependencies of target ${target}...")
message(STATUS "Discover dependencies of target ${target}...")
set(found_dependencies)
find_dependencies(TARGET ${target} FOUND_VAR found_dependencies)

Expand Down
26 changes: 13 additions & 13 deletions plugins/mac-videotoolbox/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,19 +576,19 @@ static OSStatus create_encoder(struct vt_encoder *enc)
return code;
}

if (__builtin_available(macOS 15.0, *)) {
int spatial_aq = enc->spatial_aq ? kVTQPModulationLevel_Default : kVTQPModulationLevel_Disable;
CFNumberRef spatialAQ = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &spatial_aq);

code = VTSessionSetProperty(s, kVTCompressionPropertyKey_SpatialAdaptiveQPLevel, spatialAQ);

if (code != noErr) {
log_osstatus(LOG_WARNING, enc,
"setting kVTCompressionPropertyKey_SpatialAdaptiveQPLevel failed", code);
}

CFRelease(spatialAQ);
}
// if (__builtin_available(macOS 15.0, *)) {
// int spatial_aq = enc->spatial_aq ? kVTQPModulationLevel_Default : kVTQPModulationLevel_Disable;
// CFNumberRef spatialAQ = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &spatial_aq);
//
// code = VTSessionSetProperty(s, kVTCompressionPropertyKey_SpatialAdaptiveQPLevel, spatialAQ);
//
// if (code != noErr) {
// log_osstatus(LOG_WARNING, enc,
// "setting kVTCompressionPropertyKey_SpatialAdaptiveQPLevel failed", code);
// }
//
// CFRelease(spatialAQ);
// }
}

// This can fail depending on hardware configuration
Expand Down
Loading