diff --git a/.github/actions/run-clang-format/action.yaml b/.github/actions/run-clang-format/action.yaml index 94dea0840a6478..bf14c3f772e62c 100644 --- a/.github/actions/run-clang-format/action.yaml +++ b/.github/actions/run-clang-format/action.yaml @@ -56,5 +56,12 @@ runs: print ::group::Run clang-format-17 local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/}) - ./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes} + local issues + issues=$(./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes} || true) + + if [[ -n "$issues" ]]; then + echo "::error::clang-format issues found:\n$issues" + else + echo "No formatting issues detected." + fi print ::endgroup:: diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 2ccb337e0d91f6..e8f818b2897e31 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -170,6 +170,7 @@ jobs: ubuntu-build: name: Ubuntu 🐧 + if: github.repository == 'obsproject/obs-studio' strategy: matrix: os: [ubuntu-22.04, ubuntu-24.04] @@ -241,6 +242,7 @@ jobs: flatpak-build: name: Flatpak 📦 + if: github.repository == 'obsproject/obs-studio' runs-on: ubuntu-22.04 needs: check-event defaults: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 98474fd7d789de..cfd9b8d036a272 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -4,9 +4,11 @@ on: push: paths-ignore: ['**.md'] branches-ignore: [streamlabs] + branches: [skippy] pull_request: paths-ignore: ['**.md'] branches-ignore: [streamlabs] + branches: [skippy] jobs: clang-format-check: diff --git a/.github/workflows/main-streamlabs.yml b/.github/workflows/main-streamlabs.yml index ccb1163e858e25..17ecc9359f381b 100644 --- a/.github/workflows/main-streamlabs.yml +++ b/.github/workflows/main-streamlabs.yml @@ -4,13 +4,13 @@ on: push: paths-ignore: - '**.md' - branches: [ "streamlabs" ] + branches: [ "skippy" ] tags: - '*' pull_request: paths-ignore: - '**.md' - branches: [ "streamlabs" ] + branches: [ "skippy" ] env: InstallPath: "packed_build" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fdf78116a1e89a..febdcb6f16579e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,14 +4,13 @@ on: push: paths-ignore: ['**.md'] branches: - - "streamlabs" - - 'release/**' + - "skippy" tags: ['*'] pull_request: paths-ignore: ['**.md'] - branches: ['streamlabs'] + branches: ['skippy'] merge_group: - branches: ['streamlabs'] + branches: ['skippy'] env: InstallPath: "packed_build" @@ -243,6 +242,12 @@ jobs: # name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}' # path: ${{env.PACKAGE_NAME}}-macos-release-${{ steps.setup.outputs.commitHash }}-${{ matrix.arch }}.tar.gz + - name: 'Upload debug files to Sentry' + if: startsWith(github.ref, 'refs/tags/') + run: 'python ./slobs_CI/sentry-osx.py' + env: + SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} + BUILDCONFIG: RelWithDebInfo linux_build: name: '02 - Linux' diff --git a/.github/workflows/pr-pull.yaml b/.github/workflows/pr-pull.yaml index 854d24cdfdb8db..539149d89efb86 100644 --- a/.github/workflows/pr-pull.yaml +++ b/.github/workflows/pr-pull.yaml @@ -5,7 +5,7 @@ on: pull_request: paths-ignore: - '**.md' - branches: [master] + branches: [streamlabs] types: [ opened, synchronize, reopened ] permissions: contents: read @@ -28,7 +28,7 @@ jobs: compatibility-validation: name: Validate Compatibility 🕵️ - if: github.base_ref == 'master' + if: github.base_ref == 'streamlabs' runs-on: ubuntu-22.04 permissions: checks: write @@ -50,7 +50,7 @@ jobs: services-validation: name: Validate Services 🕵️ - if: github.base_ref == 'master' + if: github.base_ref == 'streamlabs' runs-on: ubuntu-22.04 permissions: checks: write diff --git a/CI/macos/fix_deps_paths.sh b/CI/macos/fix_deps_paths.sh new file mode 100755 index 00000000000000..28a5036aeea53d --- /dev/null +++ b/CI/macos/fix_deps_paths.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# Check if a file path is passed as an argument +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +BINARY_PATH=$1 + +# Use otool to get the list of linked libraries +LIB_PATHS=$(otool -L "$BINARY_PATH" | grep "obs-deps" | awk '{print $1}') + +# Check if any obs-deps libraries were found +if [ -z "$LIB_PATHS" ]; then + echo "No obs-deps libraries found in $BINARY_PATH." +else + # Loop through each library path and change it to @loader_path, removing version from the name + for OLD_PATH in $LIB_PATHS; do + # Extract the base library name without version + LIB_NAME=$(basename "$OLD_PATH" | sed -E 's/\.[0-9]+\.dylib$/.dylib/') + + # Construct the new path using @loader_path + NEW_PATH="@loader_path/$LIB_NAME" + + # Print what we are changing for logging + echo "Changing $OLD_PATH to $NEW_PATH" + + # Run the install_name_tool command to make the change + install_name_tool -change "$OLD_PATH" "$NEW_PATH" "$BINARY_PATH" + done + + echo "All obs-deps libraries have been updated to use @loader_path and version-less names in $BINARY_PATH." +fi + +# Additional libraries that use @rpath should be converted to @loader_path +OTHER_LIBS=$(otool -L "$BINARY_PATH" | grep "@rpath" | awk '{print $1}') + +if [ -n "$OTHER_LIBS" ]; then + for OLD_PATH in $OTHER_LIBS; do + # Extract the base library name without version + LIB_NAME=$(basename "$OLD_PATH" | sed -E 's/\.[0-9]+\.dylib$/.dylib/') + + # Construct the new path using @loader_path + NEW_PATH="@loader_path/$LIB_NAME" + + # Print what we are changing for logging + echo "Changing $OLD_PATH to $NEW_PATH" + + # Run the install_name_tool command to make the change + install_name_tool -change "$OLD_PATH" "$NEW_PATH" "$BINARY_PATH" + done + + echo "All @rpath libraries have been updated to use @loader_path in $BINARY_PATH." +else + echo "No @rpath libraries found." +fi + +# Add @executable_path/../Frameworks to rpath as a fallback +echo "Adding @executable_path/../Frameworks as an rpath fallback" +install_name_tool -add_rpath "@executable_path/../Frameworks" "$BINARY_PATH" + +# Check if the binary is signed (for macOS app distribution) +CODESIGN_STATUS=$(codesign -vv "$BINARY_PATH" 2>&1) + +if [[ "$CODESIGN_STATUS" == *"not signed"* ]]; then + echo "Binary is not signed. Please sign it for distribution if necessary." +else + echo "Binary is already signed." +fi + +echo "All modifications are done." diff --git a/CMakeLists.txt b/CMakeLists.txt index 20bf61cdf114c9..e1f62ff4fee1e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,7 +158,8 @@ if(WIN32) -P "${CMAKE_SOURCE_DIR}/slobs_CI/check_libraries.cmake" ) endif() -#Configure 32-bit projects +if(ENABLE_32_TARGETS) + #Configure 32-bit projects if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") #message(FATAL_ERROR "CURL_INCLUDE_DIR: ${CURL_INCLUDE_DIR}, CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}, PREFIX_PATH_X86: ${PREFIX_PATH_X86}, OBS_VERSION: ${OBS_VERSION}, OBS_VERSION_OVERRIDE: ${OBS_VERSION_OVERRIDE}") if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -193,3 +194,4 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY) endif() endif() +endif() diff --git a/CMakePresets.json b/CMakePresets.json index 7a2a47cbdb84f6..0f0b5b840bcc09 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,5 +1,5 @@ { - "version": 3, + "version": 5, "cmakeMinimumRequired": { "major": 3, "minor": 22, @@ -10,10 +10,10 @@ "name": "environmentVars", "hidden": true, "cacheVariables": { - "RESTREAM_CLIENTID": {"type": "STRING", "value": "$penv{RESTREAM_CLIENTID}"}, - "RESTREAM_HASH": {"type": "STRING", "value": "$penv{RESTREAM_HASH}"}, "TWITCH_CLIENTID": {"type": "STRING", "value": "$penv{TWITCH_CLIENTID}"}, "TWITCH_HASH": {"type": "STRING", "value": "$penv{TWITCH_HASH}"}, + "RESTREAM_CLIENTID": {"type": "STRING", "value": "$penv{RESTREAM_CLIENTID}"}, + "RESTREAM_HASH": {"type": "STRING", "value": "$penv{RESTREAM_HASH}"}, "YOUTUBE_CLIENTID": {"type": "STRING", "value": "$penv{YOUTUBE_CLIENTID}"}, "YOUTUBE_CLIENTID_HASH": {"type": "STRING", "value": "$penv{YOUTUBE_CLIENTID_HASH}"}, "YOUTUBE_SECRET": {"type": "STRING", "value": "$penv{YOUTUBE_SECRET}"}, @@ -33,8 +33,16 @@ "generator": "Xcode", "binaryDir": "${sourceDir}/build_macos", "cacheVariables": { + "ENABLE_BROWSER": true, "CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "11.0"}, - "ENABLE_BROWSER": true + "OBS_CODESIGN_TEAM": {"type": "STRING", "value": "$penv{CODESIGN_TEAM}"}, + "OBS_CODESIGN_IDENTITY": {"type": "STRING", "value": "$penv{CODESIGN_IDENT}"}, + "OBS_PROVISIONING_PROFILE": {"type": "STRING", "value": "$penv{PROVISIONING_PROFILE}"}, + "VIRTUALCAM_DEVICE_UUID": {"type": "STRING", "value": ""}, + "VIRTUALCAM_SOURCE_UUID": {"type": "STRING", "value": ""}, + "VIRTUALCAM_SINK_UUID": {"type": "STRING", "value": ""}, + "SPARKLE_APPCAST_URL": {"type": "STRING", "value": ""}, + "SPARKLE_PUBLIC_KEY": {"type": "STRING", "value": ""} } }, { @@ -48,35 +56,75 @@ } }, { - "name": "ubuntu", - "displayName": "Ubuntu", - "description": "obs-studio for Ubuntu", + "name": "linux-aarch64", + "displayName": "Linux aarch64", + "description": "obs-studio for Linux (aarch64)", "inherits": ["environmentVars"], "condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" }, - "binaryDir": "${sourceDir}/build_ubuntu", + "binaryDir": "${sourceDir}/build_aarch64", "generator": "Ninja", "warnings": {"dev": true, "deprecated": true}, "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_INSTALL_LIBDIR": "lib/CMAKE_SYSTEM_PROCESSOR-linux-gnu", - "OBS_CMAKE_VERSION": {"type": "STRING", "value": "3.0.0"}, - "ENABLE_AJA": false, - "ENABLE_NATIVE_NVENC": false, + "ENABLE_WAYLAND": true, "ENABLE_VLC": true, + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "linux-ci-aarch64", + "inherits": ["linux-aarch64"], + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "linux-release-aarch64", + "displayName": "Linux aarch64 (Release)", + "description": "obs-studio for Linux (aarch64) - Release Configuration", + "inherits": "linux-aarch64", + "cacheVariables": { + "ENABLE_RELEASE_BUILD": true + } + }, + { + "name": "linux-x86_64", + "displayName": "Linux x86_64", + "description": "obs-studio for Linux (x86_64)", + "inherits": ["environmentVars"], + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "binaryDir": "${sourceDir}/build_x86_64", + "generator": "Ninja", + "warnings": {"dev": true, "deprecated": true}, + "cacheVariables": { "ENABLE_WAYLAND": true, - "ENABLE_WEBRTC": false + "ENABLE_VLC": true, + "CMAKE_BUILD_TYPE": {"type": "STRING", "value": "Debug"} } }, { - "name": "ubuntu-ci", - "inherits": ["ubuntu"], + "name": "linux-ci-x86_64", + "inherits": ["linux-x86_64"], "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "CMAKE_COMPILE_WARNING_AS_ERROR": true + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "linux-release-x86_64", + "displayName": "Linux x86_64 (Release)", + "description": "obs-studio for Linux (x86_64) - Release Configuration", + "inherits": "linux-x86_64", + "cacheVariables": { + "ENABLE_RELEASE_BUILD": true, + "ENABLE_BROWSER": true } }, { @@ -94,10 +142,12 @@ "generator": "Visual Studio 17 2022", "cacheVariables": { "OBS_CMAKE_VERSION": {"type": "STRING", "value": "3.0.0"}, - "GPU_PRIORITY_VAL": {"type": "STRING", "value": "$penv{GPU_PRIORITY_VAL}"}, - "VIRTUALCAM_GUID": {"type": "STRING", "value": "A3FCE0F5-3493-419F-958A-ABA1250EC20B"}, "ENABLE_BROWSER": true, - "ENABLE_CCACHE": false + "VIRTUALCAM_GUID": {"type": "STRING", "value": "A3FCE0F5-3493-419F-958A-ABA1250EC20B"}, + "GPU_PRIORITY_VAL": {"type": "STRING", "value": "$penv{GPU_PRIORITY_VAL}"}, + "ENABLE_CCACHE": false, + "ENABLE_32_TARGETS": false, + "ENABLE_UI": false } }, { @@ -113,6 +163,20 @@ } ], "buildPresets": [ + { + "name": "linux-aarch64", + "configurePreset": "linux-aarch64", + "displayName": "Linux aarch64", + "description": "Linux build for aarch64 (aka arm64)", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-x86_64", + "configurePreset": "linux-x86_64", + "displayName": "Linux x86_64", + "description": "Linux build for x86_64 (aka amd64)", + "configuration": "RelWithDebInfo" + }, { "name": "windows-x64", "configurePreset": "windows-x64", diff --git a/buildspec.json b/buildspec.json index e7299f609f0ea2..3af28c8ccf018e 100644 --- a/buildspec.json +++ b/buildspec.json @@ -12,7 +12,7 @@ } }, "qt6": { - "version": "2023-08-31sl1", + "version": "2024-09-10v4", "baseUrl": "https://obs-studio-deployment.s3-us-west-2.amazonaws.com", "label": "Pre-Built Qt6", "hashes": { @@ -27,18 +27,19 @@ }, "cef": { "version": "5060", - "baseUrl": "https://cdn-fastly.obsproject.com/downloads", + "baseUrl": "https://streamlabs-cef-dist.s3.us-west-2.amazonaws.com", "label": "Chromium Embedded Framework", "hashes": { "macos-x86_64": "7ef71717ff2e4ff4212274c33f0993729f47c109c464e499544fd3f63586a069", "macos-arm64": "a9da8909202aefc8f35509d03eff9a7c837b5d3b2ed3afb39b67121cb16d457b", "linux-x86_64": "bf4aa9388bab7e94fa945cc3bba16b6da63b6a30f9c0342d42235468b39d84bf", "linux-aarch64": "68d915c9ba2639cba762a54cd3430fce2527aa6355d831d3cfcb6157664206b0", - "windows-x64": "c1b47beb7ee42e98f1a41b6d694c26842a4a3d452e44bdf6f758c9785696533d" + "windows-x64": "7480e9ed5688e09919db67237d130eef9a4c24df32ba2a7b8a5587de45ff8e69" }, "revision": { - "macos-x86_64": 2, - "macos-arm64": 2 + "macos-x86_64": 3, + "macos-arm64": 3, + "windows-x64": 3 } }, "vlc": { @@ -49,13 +50,22 @@ "windows-x64": "91f589ef69fce51645a3ecbb215b405c98db7b891479474ec3b5ed3b63c25e4a" } }, + "openssl": { + "version": "1.1.1c", + "baseUrl": "https://streamlabs-obs-updater-deps.s3.us-west-2.amazonaws.com", + "label": "openssl", + "hashes": { + "windows-x64": "801CE178E86CB13A1485878DE053B6089C32941800CFD2440F33158117A58860" + } + }, "libmediasoupclient": { "version": "3.4.3", "baseUrl": "https://obs-studio-deployment.s3-us-west-2.amazonaws.com", "label": "libmediasoupclient", "hashes": { "macos-x86_64": "D06CF8593EBFA2DAE3AB6A59EA889A931C1EE77586D76EB890AF93DB936D18C5", - "macos-arm64": "DC4424D32A86306172C57E9D8D7EDD2CB3897C364A56F46318DEE5395B68474B" + "macos-arm64": "DC4424D32A86306172C57E9D8D7EDD2CB3897C364A56F46318DEE5395B68474B", + "windows-x64": "03E25130EDF6B49009404B6FE4B75D5DDC92885F1DAD2DF3ED0FB3068D98C682" } }, "webrtc": { @@ -64,8 +74,18 @@ "label": "webrtc", "hashes": { "macos-x86_64": "5FAD4805BC81256BD3B7E06EE75FFF9BD2A8983DCCD5F31C1F500A214A3B08B2", - "macos-arm64": "5D9FA128386DA4ADA0FF0AD2D092C2F9DD2B93A93FD85A50EE04358855680473" + "macos-arm64": "5D9FA128386DA4ADA0FF0AD2D092C2F9DD2B93A93FD85A50EE04358855680473", + "windows-x64": "0FCE7305A5C1D2A026157B2BEFFFABA25A4202CE403614F6A98965CECA15E2B0" } + }, + "grpc": { + "version": "v1.47.0", + "baseUrl": "https://obs-studio-deployment.s3-us-west-2.amazonaws.com", + "label": "gRPC", + "hashes": { + "windows-x64": "C83815ACCCAE80F07E545B569582E548EE6E4575B2E329B7B739509BD49D811C" + }, + "distPath": "grpc_dist" } }, "platformConfig": { diff --git a/cmake/Modules/ObsHelpers_Windows.cmake b/cmake/Modules/ObsHelpers_Windows.cmake index 77d4fb0804384c..821459f70bb0d4 100644 --- a/cmake/Modules/ObsHelpers_Windows.cmake +++ b/cmake/Modules/ObsHelpers_Windows.cmake @@ -189,12 +189,12 @@ function(setup_obs_app target) if(MSVC) target_compile_options(obs-browser PRIVATE $,/MTd,/MT>) - target_compile_options(obs-browser-page PRIVATE $,/MTd,/MT>) + target_compile_options(obs-browser-helper PRIVATE $,/MTd,/MT>) endif() target_link_options(obs-browser PRIVATE "LINKER:/IGNORE:4099") - target_link_options(obs-browser-page PRIVATE "LINKER:/IGNORE:4099" "LINKER:/SUBSYSTEM:WINDOWS") + target_link_options(obs-browser-helper PRIVATE "LINKER:/IGNORE:4099" "LINKER:/SUBSYSTEM:WINDOWS") endif() _setup_obs_app(${ARGV}) diff --git a/cmake/common/buildspec_common.cmake b/cmake/common/buildspec_common.cmake index 5b4c34d4c45490..39dd50616d3436 100644 --- a/cmake/common/buildspec_common.cmake +++ b/cmake/common/buildspec_common.cmake @@ -9,6 +9,36 @@ include_guard(GLOBAL) +function(extract_archive file destination) + # Check if the file exists + if(NOT EXISTS "${file}") + message(FATAL_ERROR "File not found: ${file}") + endif() + + # Determine the file extension + get_filename_component(extension "${file}" EXT) + + # If it's a .7z file, use 7z to extract + if("${extension}" STREQUAL ".7z") + message(STATUS "Extracting .7z archive: ${file}") + execute_process( + COMMAND 7z x "${file}" -o"${destination}" -y + RESULT_VARIABLE _result + OUTPUT_QUIET + ERROR_QUIET + ) + if(NOT _result EQUAL 0) + message(FATAL_ERROR "Failed to extract .7z archive: ${file}") + endif() + else() + # For other archive types, use file(ARCHIVE_EXTRACT) + message(STATUS "Extracting archive using CMake: ${file}") + file(ARCHIVE_EXTRACT INPUT "${file}" DESTINATION "${destination}") + endif() + + message(STATUS "Extraction complete: ${file} -> ${destination}") +endfunction() + # _check_deps_version: Checks for obs-deps VERSION file in prefix paths function(_check_deps_version version) set(found @@ -102,7 +132,7 @@ function(_check_dependencies) endif() set(skip FALSE) - message(STATUS "Version var before _check_deps_version ${version}") + message(STATUS "Working on dependency and version ${dependency} ${version}") if(dependency STREQUAL prebuilt OR dependency STREQUAL qt6) if(OBS_DEPENDENCY_${dependency}_${arch}_HASH STREQUAL ${hash}) _check_deps_version(${version}) @@ -118,7 +148,7 @@ function(_check_dependencies) set(skip TRUE) endif() endif() - message(STATUS "Version var after _check_deps_version ${version}") + if(skip) message(STATUS "Setting up ${label} (${arch}) - skipped") continue() @@ -130,9 +160,17 @@ function(_check_dependencies) set(url ${url}/${file}) elseif(dependency STREQUAL webrtc) set(url ${url}/${file}) + elseif(dependency STREQUAL grpc) + set(file "grpc-release-${version}.7z") + set(url ${url}/${file}) + elseif(dependency STREQUAL openssl) + set(file "${dependency}-${version}-${arch}.7z") + set(url ${url}/${file}) else() set(url ${url}/${version}/${file}) endif() + + message(STATUS "Working on url ${url}, file ${file}") if(NOT EXISTS "${dependencies_dir}/${file}") message(STATUS "Downloading ${url}") @@ -183,30 +221,64 @@ function(_check_dependencies) "${dependencies_dir}/${destination}" CACHE PATH "CEF root directory" FORCE) elseif(dependency STREQUAL libmediasoupclient) - set(libmediasoupclient_subdir "libmediasoupclient-VERSION-osx-ARCH") - string(REPLACE "VERSION" "${version}" libmediasoupclient_subdir "${libmediasoupclient_subdir}") - string(REPLACE "ARCH" "${arch}" libmediasoupclient_subdir "${libmediasoupclient_subdir}") + set(libmediasoupclient_subdir "libmediasoupclient_dist") set(LIBMEDIASOUPCLIENT_PATH "${dependencies_dir}/${libmediasoupclient_subdir}" CACHE PATH "libmediasoupclient directory" FORCE) - set(MEDIASOUP_INCLUDE_PATH "${dependencies_dir}/${libmediasoupclient_subdir}/include/mediasoupclient/" CACHE PATH "libmediasoupclient include directory" FORCE) - set(MEDIASOUP_LIB_PATH "${dependencies_dir}/${libmediasoupclient_subdir}/lib/libmediasoupclient.a" CACHE PATH "libmediasoupclient lib directory" FORCE) - set(MEDIASOUP_SDP_LIB_PATH "${dependencies_dir}/${libmediasoupclient_subdir}/lib/libsdptransform.a" CACHE PATH "libmediasoupclient sdp lib directory" FORCE) + + set(MEDIASOUP_INCLUDE_PATH "${dependencies_dir}/${libmediasoupclient_subdir}/include/mediasoupclient/" CACHE PATH "libmediasoupclient include directory" FORCE) + set(MEDIASOUP_LIB_PATH "${dependencies_dir}/${libmediasoupclient_subdir}/lib/mediasoupclient.lib" CACHE PATH "libmediasoupclient lib directory" FORCE) + set(MEDIASOUP_SDP_INCLUDE_PATH "${dependencies_dir}/${libmediasoupclient_subdir}/include/sdptransform" CACHE PATH "libmediasoupclient sdp include directory" FORCE) + set(MEDIASOUP_SDP_LIB_PATH "${dependencies_dir}/${libmediasoupclient_subdir}/lib/sdptransform.lib" CACHE PATH "libmediasoupclient sdp lib directory" FORCE) list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}/${libmediasoupclient_subdir}") elseif(dependency STREQUAL webrtc) - set(webrtc_subdir "webrtc-VERSION-osx-ARCH") - string(REPLACE "VERSION" "${version}" webrtc_subdir "${webrtc_subdir}") - string(REPLACE "ARCH" "${arch}" webrtc_subdir "${webrtc_subdir}") + set(webrtc_subdir "webrtc_dist") set(WEBRTC_PATH "${dependencies_dir}/${webrtc_subdir}" CACHE PATH "webrtc directory" FORCE) set(WEBRTC_INCLUDE_PATH "${dependencies_dir}/${webrtc_subdir}" CACHE PATH "webrtc include directory" FORCE) - set(WEBRTC_LIB_PATH "${dependencies_dir}/${webrtc_subdir}/libwebrtc.a" CACHE PATH "webrtc lib path" FORCE) + set(WEBRTC_LIB_PATH "${dependencies_dir}/${webrtc_subdir}/webrtc.lib" CACHE PATH "webrtc lib path" FORCE) list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}/${webrtc_subdir}") + elseif(dependency STREQUAL grpc) + set(grpc_subdir "grpc-release-${version}") + set(Protobuf_DIR "${dependencies_dir}/${grpc_subdir}/cmake" CACHE PATH "Protobuf directory" FORCE) + set(GRPC_PATH "${dependencies_dir}/${grpc_subdir}" CACHE PATH "GRPC directory" FORCE) + + list(APPEND CMAKE_PREFIX_PATH "${GRPC_PATH}") + + message(STATUS "Setting up GRPC_PATH ${GRPC_PATH}") + message(STATUS "Setting up Protobuf_DIR ${Protobuf_DIR}") + message(STATUS "Setting up CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}") + elseif(dependency STREQUAL openssl) + set(openssl_subdir "openssl-VERSION-ARCH") + string(REPLACE "VERSION" "${version}" openssl_subdir "${openssl_subdir}") + string(REPLACE "ARCH" "${arch}" openssl_subdir "${openssl_subdir}") + + set(OPENSSL_PATH + "${dependencies_dir}/${openssl_subdir}" + CACHE PATH "openssl directory" FORCE) + + set(OPENSSL_INCLUDE_PATH "${OPENSSL_PATH}/include" CACHE PATH "openssl include directory" FORCE) + set(OPENSSL_LIB_PATH "${OPENSSL_PATH}/lib/libssl.a" CACHE PATH "openssl SSL library path" FORCE) + set(OPENSSL_CRYPTO_LIB_PATH "${OPENSSL_PATH}/lib/libcrypto.a" CACHE PATH "openssl Crypto library path" FORCE) + + # Explicitly set CMake variables for OpenSSL + set(OPENSSL_ROOT_DIR "${OPENSSL_PATH}" CACHE PATH "OpenSSL root directory" FORCE) + set(OPENSSL_INCLUDE_DIR "${OPENSSL_INCLUDE_PATH}" CACHE PATH "OpenSSL include directory" FORCE) + set(OPENSSL_LIBRARIES "${OPENSSL_LIB_PATH};${OPENSSL_CRYPTO_LIB_PATH}" CACHE PATH "OpenSSL libraries" FORCE) + + list(APPEND CMAKE_PREFIX_PATH "${OPENSSL_PATH}") + + message(STATUS "Setting up OPENSSL_PATH ${OPENSSL_PATH}") + message(STATUS "Setting up OPENSSL_INCLUDE_PATH ${OPENSSL_INCLUDE_PATH}") + message(STATUS "Setting up OPENSSL_LIB_PATH ${OPENSSL_LIB_PATH}") + message(STATUS "Setting up OPENSSL_CRYPTO_LIB_PATH ${OPENSSL_CRYPTO_LIB_PATH}") + message(STATUS "Setting up OPENSSL_ROOT_DIR ${OPENSSL_ROOT_DIR}") + message(STATUS "Setting up OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES}") endif() message(STATUS "Finished with file and destination ${file} ${destination}") diff --git a/cmake/macos/buildspec.cmake b/cmake/macos/buildspec.cmake index 698c908dd7f506..e11ac3920ecba2 100644 --- a/cmake/macos/buildspec.cmake +++ b/cmake/macos/buildspec.cmake @@ -23,7 +23,10 @@ function(_check_dependencies_macos) set(webrtc_filename "webrtc-VERSION-osx-ARCH.zip") set(webrtc_destination "webrtc-VERSION-osx-ARCH") set(dependencies_list prebuilt qt6 cef libmediasoupclient webrtc) - +# add critical error message for debug + + message(FATAL_ERROR "need to make similar changes to the windows buildspec.cmake file") + _check_dependencies() execute_process(COMMAND "xattr" -r -d com.apple.quarantine "${dependencies_dir}/${destination}" diff --git a/cmake/macos/helpers.cmake b/cmake/macos/helpers.cmake index d09d1c23f6fc36..dd14b517fd04b4 100644 --- a/cmake/macos/helpers.cmake +++ b/cmake/macos/helpers.cmake @@ -30,6 +30,7 @@ endfunction() # set_target_properties_obs: Set target properties for use in obs-studio function(set_target_properties_obs target) + message(STATUS "[set_target_properties_obs] Setting target properties for ${target}...") set(options "") set(oneValueArgs "") set(multiValueArgs PROPERTIES) @@ -103,6 +104,7 @@ function(set_target_properties_obs target) 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)/$/Contents/MacOS") @@ -111,7 +113,7 @@ function(set_target_properties_obs target) TARGET ${target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$" - "$/MacOS/" + "$/MacOS/" COMMENT "Copy ${executable} to application bundle") endforeach() @@ -166,7 +168,7 @@ function(set_target_properties_obs target) TARGET ${target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_directory "$" - "$/Resources/$" + "$/Resources/$" COMMENT "Add OBS DAL plugin to application bundle") endif() @@ -175,7 +177,7 @@ function(set_target_properties_obs target) TARGET ${target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$/obspython.py" - "$/Resources" + "$/Resources" COMMENT "Add OBS::python import module") endif() @@ -233,6 +235,7 @@ function(set_target_properties_obs target) # cmake-format: on get_target_property(is_framework ${target} FRAMEWORK) + if(is_framework) set_target_properties(${target} PROPERTIES FRAMEWORK_VERSION A MACOSX_FRAMEWORK_IDENTIFIER com.obsproject.${target}) @@ -294,6 +297,7 @@ function(set_target_properties_obs target) # Good-enough for now as there are no other variants - in _theory_ we should only add the appropriate variant, # but that is only known at project generation and not build system configuration. get_target_property(imported_location CEF::Library IMPORTED_LOCATION_RELEASE) + if(imported_location) list(APPEND cef_items "${imported_location}") endif() @@ -314,6 +318,7 @@ function(set_target_properties_obs target) endif() target_install_resources(${target}) + target_install_ffmpeg_and_ffprobe(${target}) get_target_property(target_sources ${target} SOURCES) set(target_ui_files ${target_sources}) @@ -361,7 +366,7 @@ endmacro() # target_export: Helper function to export target as CMake package function(target_export target) # Exclude CMake package from 'ALL' target - #set(exclude_variant EXCLUDE_FROM_ALL) + # set(exclude_variant EXCLUDE_FROM_ALL) set(exclude_variant "") _target_export(${target}) endfunction() @@ -369,11 +374,13 @@ endfunction() # target_install_resources: Helper function to add resources into bundle function(target_install_resources target) message(DEBUG "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) cmake_path(RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE - relative_path) + relative_path) cmake_path(GET relative_path PARENT_PATH relative_path) target_sources(${target} PRIVATE "${data_file}") set_property(SOURCE "${data_file}" PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${relative_path}") @@ -381,6 +388,55 @@ function(target_install_resources target) endforeach() endif() endfunction() +# Function to install ffmpeg and ffprobe binaries +function(target_install_ffmpeg_and_ffprobe target) + if(TARGET OBS::ffmpeg) + # Adjust the path relative to FFmpeg_INCLUDE_DIRS + get_filename_component(ffmpeg_bin_dir "${FFmpeg_INCLUDE_DIRS}/../bin" REALPATH) + set(ffmpeg_path "${ffmpeg_bin_dir}/ffmpeg") + set(ffprobe_path "${ffmpeg_bin_dir}/ffprobe") + set(destination "${CMAKE_INSTALL_PREFIX}/OBS.app/Contents/Frameworks") + set(FINAL_FFMPEG_PATH "${destination}/ffmpeg") + set(FINAL_FFPROBE_PATH "${destination}/ffprobe") + + # Install ffmpeg + if(EXISTS "${ffmpeg_path}") + message(STATUS "Found ffmpeg at ${ffmpeg_path}") + install( + FILES "${ffmpeg_path}" + DESTINATION "${destination}" + PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + + # Run the fix_deps_paths.sh script at install time with the full absolute path + install(CODE " + message(\"Running fix_deps_paths.sh on ${FINAL_FFMPEG_PATH}\") + execute_process(COMMAND bash \"${CMAKE_SOURCE_DIR}/CI/macos/fix_deps_paths.sh\" \"${FINAL_FFMPEG_PATH}\") + ") + else() + message(WARNING "ffmpeg not found at ${ffmpeg_path}") + endif() + + # Install ffprobe + if(EXISTS "${ffprobe_path}") + message(STATUS "Found ffprobe at ${ffprobe_path}") + install( + FILES "${ffprobe_path}" + DESTINATION "${destination}" + PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + + # Run the fix_deps_paths.sh script for ffprobe with the full absolute path + install(CODE " + message(\"Running fix_deps_paths.sh on ${FINAL_FFPROBE_PATH}\") + execute_process(COMMAND bash \"${CMAKE_SOURCE_DIR}/CI/macos/fix_deps_paths.sh\" \"${FINAL_FFPROBE_PATH}\") + ") + else() + message(WARNING "ffprobe not found at ${ffprobe_path}") + endif() + endif() +endfunction() + # target_add_resource: Helper function to add a specific resource to a bundle function(target_add_resource target resource) @@ -398,12 +454,14 @@ function(_bundle_dependencies target) get_property(obs_module_list GLOBAL PROPERTY OBS_MODULES_ENABLED) list(LENGTH obs_module_list num_modules) + if(num_modules GREATER 0) add_dependencies(${target} ${obs_module_list}) set_property( TARGET ${target} APPEND PROPERTY XCODE_EMBED_PLUGINS ${obs_module_list}) + foreach(module IN LISTS obs_module_list) find_dependencies(TARGET ${module} FOUND_VAR found_dependencies) endforeach() @@ -423,6 +481,7 @@ function(_bundle_dependencies target) if(is_imported) get_target_property(imported_location ${library} LOCATION) + if(NOT imported_location) continue() endif() @@ -434,8 +493,10 @@ function(_bundle_dependencies target) if(is_xcode_framework) break() endif() + cmake_path(IS_PREFIX sdk_library_path "${imported_location}" is_xcode_framework) endforeach() + cmake_path(IS_PREFIX system_library_path "${imported_location}" is_system_framework) if(is_system_framework OR is_xcode_framework) @@ -455,6 +516,7 @@ function(_bundle_dependencies target) if(library MATCHES "Qt6?::.+") find_qt_plugins(COMPONENT ${library} TARGET ${target} FOUND_VAR plugins_list) endif() + list(APPEND library_paths ${library_location}) elseif(NOT is_imported AND library_type STREQUAL "SHARED_LIBRARY") list(APPEND library_paths ${library}) @@ -462,6 +524,7 @@ function(_bundle_dependencies target) endforeach() list(REMOVE_DUPLICATES plugins_list) + foreach(plugin IN LISTS plugins_list) cmake_path(GET plugin PARENT_PATH plugin_path) set(plugin_base_dir "${plugin_path}/../") @@ -469,7 +532,7 @@ function(_bundle_dependencies target) cmake_path(RELATIVE_PATH plugin_path BASE_DIRECTORY "${plugin_stem_dir}" OUTPUT_VARIABLE plugin_file_name) target_sources(${target} PRIVATE "${plugin}") set_source_files_properties("${plugin}" PROPERTIES MACOSX_PACKAGE_LOCATION "plugins/${plugin_file_name}" - XCODE_FILE_ATTRIBUTES "CodeSignOnCopy") + XCODE_FILE_ATTRIBUTES "CodeSignOnCopy") source_group("Qt plugins" FILES "${plugin}") endforeach() diff --git a/cmake/windows/buildspec.cmake b/cmake/windows/buildspec.cmake index 72a2e0c6d614f7..76992e4c099717 100644 --- a/cmake/windows/buildspec.cmake +++ b/cmake/windows/buildspec.cmake @@ -14,12 +14,24 @@ function(_check_dependencies_windows) set(cef_filename "cef_binary_VERSION_windows_ARCH_REVISION.zip") set(cef_destination "cef_binary_VERSION_windows_ARCH") + set(webrtc_filename "webrtc-VERSION-win-ARCH.7z") + set(webrtc_destination "webrtc_dist") + + set(libmediasoupclient_filename "libmediasoupclient-VERSION-win-ARCH.7z") + set(libmediasoupclient_destination "libmediasoupclient_dist") + + set(grpc_filename "grpc-release-VERSION.7z") + set(grpc_destination "grpc-release-VERSION") + + set(openssl_filename "openssl-VERSION-ARCH.7z") + set(openssl_destination "openssl-VERSION-ARCH") + if(CMAKE_GENERATOR_PLATFORM STREQUAL Win32) set(arch x86) set(dependencies_list prebuilt) else() set(arch ${CMAKE_GENERATOR_PLATFORM}) - set(dependencies_list prebuilt qt6 cef) + set(dependencies_list prebuilt qt6 cef webrtc libmediasoupclient grpc openssl) endif() set(platform windows-${arch}) diff --git a/cmake/windows/defaults.cmake b/cmake/windows/defaults.cmake index ff0dae7b310867..34a484ee174c7f 100644 --- a/cmake/windows/defaults.cmake +++ b/cmake/windows/defaults.cmake @@ -24,6 +24,7 @@ set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE) include(buildspec) include(cpackconfig) +if(ENABLE_32_TARGETS) if(CMAKE_SIZEOF_VOID_P EQUAL 8) execute_process( COMMAND @@ -33,3 +34,4 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8) -DENABLE_CCACHE=${ENABLE_CCACHE} RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY) endif() +endif() diff --git a/cmake/windows/helpers.cmake b/cmake/windows/helpers.cmake index a8cb6b41c3383f..7d0944313e87d6 100644 --- a/cmake/windows/helpers.cmake +++ b/cmake/windows/helpers.cmake @@ -33,7 +33,9 @@ function(set_target_properties_obs target) set(OBS_EXECUTABLE_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture") # cmake-format: off + if(ENABLE_32_TARGETS) _target_install_obs(${target} DESTINATION ${OBS_EXECUTABLE_DESTINATION} 32BIT) + endif() # cmake-format: on endif() @@ -79,13 +81,17 @@ function(set_target_properties_obs target) target_add_resource(graphics-hook "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan32.json" "${target_destination}") # cmake-format: off + if(ENABLE_32_TARGETS) _target_install_obs(${target} DESTINATION ${target_destination} 32BIT) + endif() # cmake-format: on elseif(target STREQUAL obs-virtualcam-module) set(target_destination "${OBS_DATA_DESTINATION}/obs-plugins/win-dshow") # cmake-format: off + if(ENABLE_32_TARGETS) _target_install_obs(${target} DESTINATION ${target_destination} 32BIT) + endif() # cmake-format: on else() set(target_destination "${OBS_PLUGIN_DESTINATION}") diff --git a/dependencies/obs-ndi.dll.txt b/dependencies/obs-ndi.dll.txt index c5d817e9f6c958..915672f21d3d78 100644 --- a/dependencies/obs-ndi.dll.txt +++ b/dependencies/obs-ndi.dll.txt @@ -10,7 +10,6 @@ VCRUNTIME140.dll VCRUNTIME140_1.dll api-ms-win-crt-runtime-l1-1-0.dll - api-ms-win-crt-convert-l1-1-0.dll api-ms-win-crt-heap-l1-1-0.dll > Summary diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index fe9445f0f7670a..f24aff8a5ad8f7 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -382,15 +382,15 @@ if(OS_WINDOWS) list( APPEND public_headers - util/threading-windows.h - util/windows/ComPtr.hpp - util/windows/CoTaskMemPtr.hpp - util/windows/device-enum.h - util/windows/HRError.hpp - util/windows/win-registry.h - util/windows/win-version.h - util/windows/window-helpers.h - util/windows/WinHandle.hpp) + ${CMAKE_CURRENT_SOURCE_DIR}/util/threading-windows.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/ComPtr.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/CoTaskMemPtr.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/device-enum.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/HRError.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/win-registry.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/win-version.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/window-helpers.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/WinHandle.hpp) elseif(OS_MACOS) list(APPEND public_headers util/apple/cfstring-utils.h) endif() diff --git a/libobs/cmake/legacy.cmake b/libobs/cmake/legacy.cmake index 9ecaf7a843ac03..850777d93dfa2f 100644 --- a/libobs/cmake/legacy.cmake +++ b/libobs/cmake/legacy.cmake @@ -305,9 +305,9 @@ if(OS_WINDOWS) util/windows/window-helpers.c util/windows/window-helpers.h util/windows/ComPtr.hpp - util/windows/CoTaskMemPtr.hpp - util/windows/HRError.hpp - util/windows/WinHandle.hpp + # util/windows/CoTaskMemPtr.hpp + # util/windows/HRError.hpp + # util/windows/WinHandle.hpp libobs.rc audio-monitoring/win32/wasapi-output.c audio-monitoring/win32/wasapi-enum-devices.c diff --git a/libobs/cmake/os-windows.cmake b/libobs/cmake/os-windows.cmake index 2edbb304e000a5..362d935a4ad694 100644 --- a/libobs/cmake/os-windows.cmake +++ b/libobs/cmake/os-windows.cmake @@ -11,12 +11,12 @@ target_include_directories(obs-obfuscate INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}" add_library(obs-comutils INTERFACE) add_library(OBS::COMutils ALIAS obs-comutils) -target_sources(obs-comutils INTERFACE util/windows/ComPtr.hpp) +target_sources(obs-comutils INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/ComPtr.hpp) target_include_directories(obs-comutils INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") add_library(obs-winhandle INTERFACE) add_library(OBS::winhandle ALIAS obs-winhandle) -target_sources(obs-winhandle INTERFACE util/windows/WinHandle.hpp) +target_sources(obs-winhandle INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/util/windows/WinHandle.hpp) target_include_directories(obs-winhandle INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources( @@ -33,7 +33,6 @@ target_sources( util/platform-windows.c util/threading-windows.c util/threading-windows.h - util/windows/CoTaskMemPtr.hpp util/windows/device-enum.c util/windows/device-enum.h util/windows/HRError.hpp @@ -44,11 +43,11 @@ target_sources( util/windows/window-helpers.c util/windows/window-helpers.h) -target_sources( +target_include_directories( libobs - PUBLIC util/windows/CoTaskMemPtr.hpp - util/windows/HRError.hpp - util/windows/WinHandle.hpp + PUBLIC + $ + $ ) target_compile_options(libobs PRIVATE $<$:/EHc->) diff --git a/libobs/obs-scene.c b/libobs/obs-scene.c index 86ca413f347c99..236d602887291d 100644 --- a/libobs/obs-scene.c +++ b/libobs/obs-scene.c @@ -3261,8 +3261,8 @@ void obs_sceneitem_get_pos(const obs_sceneitem_t *item, struct vec2 *pos) void obs_sceneitem_get_size(const obs_sceneitem_t *item, struct vec2 *size) { if (item) { - size->x = item->last_width; - size->y = item->last_height; + size->x = (float)item->last_width; + size->y = (float)item->last_height; } } diff --git a/libobs/obs-view.c b/libobs/obs-view.c index 8c6968edabc95c..c3a35abbc511d4 100644 --- a/libobs/obs-view.c +++ b/libobs/obs-view.c @@ -252,7 +252,7 @@ void obs_view_enum_video_info(obs_view_t *view, struct obs_core_video_mix *mix = obs->video.mixes.array[i]; if (mix->view != view) continue; - if (!enum_proc(param, &mix->ovi)) + if (!enum_proc(param, mix->ovi)) break; } diff --git a/libobs/obs.c b/libobs/obs.c index e3f9e4c260db65..a3bbab6b5f2137 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -3208,6 +3208,7 @@ obs_context_data_init_wrap(struct obs_context_data *context, context->name = dup_name(name, private); context->settings = obs_data_newref(settings); context->hotkey_data = obs_data_newref(hotkey_data); + context->mutex = &obs->data.sources_mutex; return true; } @@ -3374,8 +3375,12 @@ void obs_context_data_remove_name(struct obs_context_data *context, void *phead) if (!context) return; + struct obs_context_data *item = NULL; pthread_mutex_lock(context->mutex); - HASH_DELETE(hh, *head, context); + HASH_FIND_STR(*head, context->name, item); + if (item) { + HASH_DELETE(hh, *head, context); + } pthread_mutex_unlock(context->mutex); } @@ -3389,8 +3394,14 @@ void obs_context_data_remove_uuid(struct obs_context_data *context, if (!context || !context->uuid || !uuid_head) return; + struct obs_context_data *item = NULL; + pthread_mutex_lock(context->mutex); - HASH_DELETE(hh_uuid, *uuid_head, context); + HASH_FIND_UUID(*uuid_head, context->uuid, item); + if (item) { + HASH_DELETE(hh_uuid, *uuid_head, context); + } + pthread_mutex_unlock(context->mutex); } diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 9045d909441823..5083f8e7778002 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -56,6 +56,7 @@ if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0) add_obs_plugin(obs-ffmpeg) add_obs_plugin(obs-filters) add_obs_plugin(obs-libfdk) + add_obs_plugin(obs-ndi) add_obs_plugin(obs-outputs) add_obs_plugin(obs-qsv11 PLATFORMS WINDOWS LINUX) add_obs_plugin(obs-text PLATFORMS WINDOWS) diff --git a/plugins/coreaudio-encoder/encoder.cpp b/plugins/coreaudio-encoder/encoder.cpp index 84ed8524503b4f..946bd63f08c685 100644 --- a/plugins/coreaudio-encoder/encoder.cpp +++ b/plugins/coreaudio-encoder/encoder.cpp @@ -1263,11 +1263,11 @@ static vector get_bitrates(DStr &log, ca_encoder *ca, auto handle_bitrate = [&](UInt32 bitrate) { if (find(begin(bitrates), end(bitrates), bitrate) == end(bitrates)) { - log_to_dstr(log, ca, "Adding bitrate %u\n", + log_to_dstr(log, ca, "Add %u, ", static_cast(bitrate)); bitrates.push_back(bitrate); } else { - log_to_dstr(log, ca, "Bitrate %u already added\n", + log_to_dstr(log, ca, "Has %u, ", static_cast(bitrate)); } }; @@ -1278,7 +1278,7 @@ static vector get_bitrates(DStr &log, ca_encoder *ca, if (min_ == max_) return; - log_to_dstr(log, ca, "Got actual bitrate range: %u<->%u\n", + log_to_dstr(log, ca, "Range %u<->%u, ", static_cast(min_), static_cast(max_)); @@ -1289,7 +1289,7 @@ static vector get_bitrates(DStr &log, ca_encoder *ca, return bitrates; for (UInt32 format_id : (ca ? *ca->allowed_formats : aac_formats)) { - log_to_dstr(log, ca, "Trying %s (0x%x) at %g" NBSP "hz\n", + log_to_dstr(log, ca, "Try %s (0x%x) at %g" NBSP "hz, ", format_id_to_str(format_id), static_cast(format_id), samplerate); diff --git a/plugins/image-source/obs-slideshow.c b/plugins/image-source/obs-slideshow.c index 1c20182c4dc7e1..6860f970b1624a 100644 --- a/plugins/image-source/obs-slideshow.c +++ b/plugins/image-source/obs-slideshow.c @@ -669,7 +669,7 @@ static void ss_destroy(void *data) obs_source_release(ss->transition); } - free_files(&ss->files.da); + free_files(&ss->files); pthread_mutex_destroy(&ss->mutex); calldata_free(&ss->cd); bfree(ss); diff --git a/plugins/mediasoup-connector b/plugins/mediasoup-connector index 73628284204aeb..6f9688cf61bb1e 160000 --- a/plugins/mediasoup-connector +++ b/plugins/mediasoup-connector @@ -1 +1 @@ -Subproject commit 73628284204aeb07fdad0bbae51b301acbd4f86e +Subproject commit 6f9688cf61bb1efbf75e18d99f7d76ddb2190f4b diff --git a/plugins/motion-effect b/plugins/motion-effect index cbe84ebd6c063d..5e83933a2454ed 160000 --- a/plugins/motion-effect +++ b/plugins/motion-effect @@ -1 +1 @@ -Subproject commit cbe84ebd6c063d1b9d909c4e3ea867d583f41c50 +Subproject commit 5e83933a2454ed74b601c03575f5edc2e9938f10 diff --git a/plugins/obs-browser b/plugins/obs-browser index 83c81e8bd08a55..800a9830601cbc 160000 --- a/plugins/obs-browser +++ b/plugins/obs-browser @@ -1 +1 @@ -Subproject commit 83c81e8bd08a55d9a8069a85114428a6fd13fb4b +Subproject commit 800a9830601cbcd0f90493f3d876eaf1e0117f7a diff --git a/plugins/obs-ndi b/plugins/obs-ndi index c9cb15ec683769..cb4d3776f81f58 160000 --- a/plugins/obs-ndi +++ b/plugins/obs-ndi @@ -1 +1 @@ -Subproject commit c9cb15ec6837690ea94fcbe275c8323ad1652899 +Subproject commit cb4d3776f81f58a99fc327f56261e2813b2ee902 diff --git a/plugins/obs-openvr b/plugins/obs-openvr index 51f9704e7404b2..830a9f003db04e 160000 --- a/plugins/obs-openvr +++ b/plugins/obs-openvr @@ -1 +1 @@ -Subproject commit 51f9704e7404b265a4eb03c3a18bb7ef0e9c8f6b +Subproject commit 830a9f003db04eeb8d8459613ee748f15320691a diff --git a/plugins/obs-outputs/mp4-output.c b/plugins/obs-outputs/mp4-output.c index 8ccb45a5077a31..7ad52c8b18172f 100644 --- a/plugins/obs-outputs/mp4-output.c +++ b/plugins/obs-outputs/mp4-output.c @@ -355,7 +355,7 @@ static void generate_filename(struct mp4_output *out, struct dstr *dst, bool space = obs_data_get_bool(settings, "allow_spaces"); struct obs_video_info ovi; - obs_get_video_info_for_output(out, &ovi, 0); + obs_get_video_info_for_output(out->output, &ovi, 0); char *filename = os_generate_formatted_filename(ext, space, fmt, &ovi); dstr_copy(dst, dir); diff --git a/plugins/sl-vst b/plugins/sl-vst index 962b4f658d110b..8824c9ab839f5b 160000 --- a/plugins/sl-vst +++ b/plugins/sl-vst @@ -1 +1 @@ -Subproject commit 962b4f658d110b55298057d91c413e7a1015d20b +Subproject commit 8824c9ab839f5b6dc96f625161b1f21789251864 diff --git a/plugins/vlc-video/vlc-video-plugin.h b/plugins/vlc-video/vlc-video-plugin.h index cf5ac40f254b01..256e640644098d 100644 --- a/plugins/vlc-video/vlc-video-plugin.h +++ b/plugins/vlc-video/vlc-video-plugin.h @@ -1,19 +1,19 @@ #include -// TODO: Here in below in OBS 30 includes were modified to be like this: vlc/libvlc.h -#include + +#include #ifdef _MSC_VER #include typedef SSIZE_T ssize_t; #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -extern libvlc_instance_t *libvlc; +extern libvlc_instance_t *libvlc; extern uint64_t time_start; extern bool load_libvlc(void); diff --git a/plugins/win-capture/duplicator-monitor-capture.c b/plugins/win-capture/duplicator-monitor-capture.c index ee09a3a9b137f8..7d926803186b46 100644 --- a/plugins/win-capture/duplicator-monitor-capture.c +++ b/plugins/win-capture/duplicator-monitor-capture.c @@ -106,7 +106,7 @@ struct duplicator_monitor_info { char id[128]; char alt_id[128]; char name[128]; - int idx; + long long idx; RECT rect; HMONITOR handle; }; @@ -356,7 +356,7 @@ static struct duplicator_monitor_info find_monitor(const char *monitor_id) return monitor; } -static struct duplicator_monitor_info find_monitor_by_idx(int monitor_idx) +static struct duplicator_monitor_info find_monitor_by_idx(long long monitor_idx) { struct duplicator_monitor_info monitor = {0}; monitor.idx = monitor_idx; @@ -375,7 +375,7 @@ static inline void update_settings(struct duplicator_capture *capture, pthread_mutex_lock(&capture->update_mutex); struct duplicator_monitor_info monitor; - int monitor_idx = obs_data_get_int(settings, "monitor_idx"); + long long monitor_idx = obs_data_get_int(settings, "monitor_idx"); if (monitor_idx < 0) monitor = find_monitor( obs_data_get_string(settings, "monitor_id")); diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index b491cc2a21d5bf..fb637c222d8bfb 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -609,9 +609,9 @@ static inline void get_config(struct game_capture_config *cfg, "2100pq") == 0; cfg->capture_audio = obs_data_get_bool(settings, SETTING_CAPTURE_AUDIO); - cfg->base_width = + cfg->base_width = (int) obs_data_get_int(settings, SETTING_WINDOW_DEFAULT_WIDTH); - cfg->base_height = + cfg->base_height = (int) obs_data_get_int(settings, SETTING_WINDOW_DEFAULT_HEIGHT); if (cfg->base_width < 1 || cfg->base_height < 1) { struct obs_video_info ovi; diff --git a/plugins/win-capture/get-graphics-offsets/CMakeLists.txt b/plugins/win-capture/get-graphics-offsets/CMakeLists.txt index 1e4ee466817929..2b978665334f28 100644 --- a/plugins/win-capture/get-graphics-offsets/CMakeLists.txt +++ b/plugins/win-capture/get-graphics-offsets/CMakeLists.txt @@ -11,7 +11,9 @@ legacy_check() add_executable(get-graphics-offsets) target_link_libraries(get-graphics-offsets PRIVATE _get-graphics-offsets) +if(ENABLE_32_TARGETS) include(cmake/32bit.cmake) +endif() # cmake-format: off set_target_properties_obs(get-graphics-offsets PROPERTIES FOLDER plugins/win-capture OUTPUT_NAME get-graphics-offsets64 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/plugins/win-capture/graphics-hook/CMakeLists.txt b/plugins/win-capture/graphics-hook/CMakeLists.txt index 91378ba9cbe68f..ce12a5b11b2096 100644 --- a/plugins/win-capture/graphics-hook/CMakeLists.txt +++ b/plugins/win-capture/graphics-hook/CMakeLists.txt @@ -49,7 +49,9 @@ add_library(OBS::graphics-hook ALIAS graphics-hook) target_link_libraries(graphics-hook PRIVATE _graphics-hook) +if(ENABLE_32_TARGETS) include(cmake/32bit.cmake) +endif() # cmake-format: off set_target_properties_obs(graphics-hook PROPERTIES FOLDER "plugins/win-capture" OUTPUT_NAME graphics-hook64 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/plugins/win-capture/inject-helper/CMakeLists.txt b/plugins/win-capture/inject-helper/CMakeLists.txt index 6f1c9417b66316..4f9d6cbf23568a 100644 --- a/plugins/win-capture/inject-helper/CMakeLists.txt +++ b/plugins/win-capture/inject-helper/CMakeLists.txt @@ -15,7 +15,9 @@ legacy_check() add_executable(inject-helper) target_link_libraries(inject-helper PRIVATE _inject-helper) +if(ENABLE_32_TARGETS) include(cmake/32bit.cmake) +endif() # cmake-format: off set_target_properties_obs(inject-helper PROPERTIES FOLDER plugins/win-capture OUTPUT_NAME inject-helper64 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/plugins/win-capture/screen-capture.c b/plugins/win-capture/screen-capture.c index 3c410680efd962..c9cd7ab6cb5359 100644 --- a/plugins/win-capture/screen-capture.c +++ b/plugins/win-capture/screen-capture.c @@ -459,9 +459,9 @@ static bool capture_source_update(struct screen_capture *context, return false; } - context->base_width = + context->base_width = (int) obs_data_get_int(settings, SETTING_WINDOW_DEFAULT_WIDTH); - context->base_height = + context->base_height = (int) obs_data_get_int(settings, SETTING_WINDOW_DEFAULT_HEIGHT); if (dstr_cmp(&context->prev_line, capture_source_string) == 0) { diff --git a/plugins/win-dshow/cmake/libdshowcapture.cmake b/plugins/win-dshow/cmake/libdshowcapture.cmake index 2cc78e64089f90..2e7ac47e1e9493 100644 --- a/plugins/win-dshow/cmake/libdshowcapture.cmake +++ b/plugins/win-dshow/cmake/libdshowcapture.cmake @@ -23,6 +23,8 @@ target_sources( libdshowcapture/source/dshow-media-type.hpp libdshowcapture/source/dshowcapture.cpp libdshowcapture/source/dshowencode.cpp + libdshowcapture/source/dshow-dialogbox.cpp + libdshowcapture/source/dshow-dialogbox.hpp libdshowcapture/source/encoder.cpp libdshowcapture/source/encoder.hpp libdshowcapture/source/external/IVideoCaptureFilter.h diff --git a/plugins/win-dshow/libdshowcapture b/plugins/win-dshow/libdshowcapture index 9d7bcfc0d88765..792892659bdc55 160000 --- a/plugins/win-dshow/libdshowcapture +++ b/plugins/win-dshow/libdshowcapture @@ -1 +1 @@ -Subproject commit 9d7bcfc0d8876577af6989239c96ffc5a6cd5b2f +Subproject commit 792892659bdc55eaca85aad1c87ef484d737e7af diff --git a/plugins/win-dshow/virtualcam-module/CMakeLists.txt b/plugins/win-dshow/virtualcam-module/CMakeLists.txt index 1273a235b66455..e5612042dc21a4 100644 --- a/plugins/win-dshow/virtualcam-module/CMakeLists.txt +++ b/plugins/win-dshow/virtualcam-module/CMakeLists.txt @@ -99,12 +99,15 @@ configure_file(virtualcam-uninstall.bat.in virtualcam-uninstall.bat) target_add_resource(obs-virtualcam-module "${CMAKE_CURRENT_BINARY_DIR}/virtualcam-uninstall.bat" "${OBS_DATA_DESTINATION}/obs-plugins/win-dshow") +if(ENABLE_32_TARGETS) include(cmake/32bit.cmake) +endif() # cmake-format: off set_target_properties_obs(obs-virtualcam-module PROPERTIES FOLDER plugins/win-dshow OUTPUT_NAME obs-virtualcam-module64) # cmake-format: on +if(ENABLE_32_TARGETS) if(CMAKE_SIZEOF_VOID_P EQUAL 8) add_custom_command( TARGET obs-virtualcam-module @@ -112,3 +115,4 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8) COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $ -t obs-virtualcam-module COMMENT "Build 32-bit obs-virtualcam") endif() +endif() \ No newline at end of file diff --git a/plugins/win-spout b/plugins/win-spout index 8f0615857d461a..09c4f7fea9194e 160000 --- a/plugins/win-spout +++ b/plugins/win-spout @@ -1 +1 @@ -Subproject commit 8f0615857d461ac34f2c47e79bd8592d13131b58 +Subproject commit 09c4f7fea9194eae51cc64eac3a2eecc4bf97a22 diff --git a/plugins/win-wasapi/CMakeLists.txt b/plugins/win-wasapi/CMakeLists.txt index 72a2696e66ab3d..b32ea551575e18 100644 --- a/plugins/win-wasapi/CMakeLists.txt +++ b/plugins/win-wasapi/CMakeLists.txt @@ -11,7 +11,7 @@ target_sources(win-wasapi PRIVATE win-wasapi.cpp wasapi-notify.cpp wasapi-notify configure_file(cmake/windows/obs-module.rc.in win-wasapi.rc) target_sources(win-wasapi PRIVATE win-wasapi.rc) -target_link_libraries(win-wasapi PRIVATE OBS::libobs Avrt Jansson::Jansson) +target_link_libraries(win-wasapi PRIVATE OBS::libobs Avrt jansson::jansson) # cmake-format: off set_target_properties_obs(win-wasapi PROPERTIES FOLDER plugins PREFIX "") diff --git a/slobs_CI/sentry-osx.py b/slobs_CI/sentry-osx.py index 1861a25417cbe5..c86630dfe0317a 100644 --- a/slobs_CI/sentry-osx.py +++ b/slobs_CI/sentry-osx.py @@ -1,15 +1,58 @@ import os -os.system('curl -sL https://sentry.io/get-cli/ | bash') +import subprocess + +def run_command(command): + print(f"Running command: {command}") + result = subprocess.run(command, shell=True, capture_output=True, text=True) + if result.stdout: + print(f"Output: {result.stdout}") + if result.stderr: + print(f"Error: {result.stderr}") + return result + +# Print all environment variables +print("Environment Variables:") +for key, value in os.environ.items(): + print(f"{key}={value}") + +# Run the command to install the Sentry CLI +run_command('curl -sL https://sentry.io/get-cli/ | bash') def process_sentry(directory): + print(f"Processing directory: {directory}") + if not os.path.exists(directory): + print(f"Error: Directory {directory} does not exist!") + return + + # List the contents of the directory + print(f"Listing contents of directory: {directory}") + run_command(f'ls -la {directory}') + for root, dirs, files in os.walk(directory): + print(f"Current directory: {root}") + print(f"Subdirectories: {dirs}") + print(f"Files: {files}") for file in files: if '.so' in file or '.dylib' in file or '.' not in file: path = os.path.join(root, file) - os.system("dsymutil " + path) - os.system("sentry-cli --auth-token ${SENTRY_AUTH_TOKEN} upload-dif --org streamlabs-desktop --project obs-server " + path + ".dSYM/Contents/Resources/DWARF/" + file) - os.system("dsymutil " + path) - os.system("sentry-cli --auth-token ${SENTRY_AUTH_TOKEN} upload-dif --org streamlabs-desktop --project obs-server-preview " + path + ".dSYM/Contents/Resources/DWARF/" + file) + print(f"Processing file: {path}") + + # Run dsymutil on the file + run_command(f"dsymutil {path}") + + # Upload the debug file to Sentry + sentry_command = f"sentry-cli --auth-token {os.environ.get('SENTRY_AUTH_TOKEN', '')} upload-dif --org streamlabs-desktop --project obs-server {path}.dSYM/Contents/Resources/DWARF/{file}" + run_command(sentry_command) + + # Repeat the upload for the second project + sentry_command_preview = f"sentry-cli --auth-token {os.environ.get('SENTRY_AUTH_TOKEN', '')} upload-dif --org streamlabs-desktop --project obs-server-preview {path}.dSYM/Contents/Resources/DWARF/{file}" + run_command(sentry_command_preview) + +# Check if the required environment variables are set +required_env_vars = ['PWD', 'InstallPath', 'SENTRY_AUTH_TOKEN'] +for var in required_env_vars: + if var not in os.environ: + print(f"Warning: Environment variable {var} is not set!") # Upload obs debug files -process_sentry(os.path.join(os.environ['PWD'], os.environ['InstallPath'])) \ No newline at end of file +process_sentry(os.path.join(os.environ.get('PWD', ''), "build" , os.environ.get('InstallPath', '')))