From 0e08c15675afadcf21a5922108ec40a05a1a96c0 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Wed, 4 Sep 2024 13:38:38 -0700 Subject: [PATCH 1/5] update browser fix excessive logging ffmpeg binaries install ffmpeg binaries install ffmpeg binaries install ffmpeg binaries install fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix lib path fix paths script update fix ndi update ndi plugin update ndi plugin obs ndi update update obs-ndi obs ndi update fix sentry debug upload some debug output for sentry upload script some debug output for sentry upload script some debug output for sentry upload script some debug output for sentry upload script fix source fail to create crash capture source crash capture source crash capture source crash more logging for capture error more logging for capture error more logging for capture error more logging for capture error --- .github/workflows/main.yml | 6 + CI/macos/fix_deps_paths.sh | 72 ++++++ cmake/macos/helpers.cmake | 155 +++++++++---- dependencies/obs-ndi.dll.txt | 1 - libobs/obs.c | 15 +- plugins/CMakeLists.txt | 1 + plugins/coreaudio-encoder/encoder.cpp | 8 +- plugins/mac-capture/mac-screen-capture.m | 274 ++++++++++++++--------- plugins/obs-browser | 2 +- plugins/obs-ndi | 2 +- slobs_CI/sentry-osx.py | 55 ++++- 11 files changed, 422 insertions(+), 169 deletions(-) create mode 100755 CI/macos/fix_deps_paths.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7809d34fa1ef09..0576b00aa097c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -243,6 +243,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/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/cmake/macos/helpers.cmake b/cmake/macos/helpers.cmake index 2faac1d7f5b69f..a8bdb1a8839494 100644 --- a/cmake/macos/helpers.cmake +++ b/cmake/macos/helpers.cmake @@ -11,7 +11,7 @@ include(helpers_common) # 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}...") + message(STATUS "[set_target_properties_obs] Setting target properties for ${target}...") set(options "") set(oneValueArgs "") set(multiValueArgs PROPERTIES) @@ -23,6 +23,7 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ list(POP_FRONT _STPO_PROPERTIES key value) set_property(TARGET ${target} PROPERTY ${key} "${value}") endwhile() + get_target_property(target_type ${target} TYPE) # Target is a GUI or CLI application @@ -32,19 +33,19 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ set_target_properties( ${target} PROPERTIES OUTPUT_NAME OBS - MACOSX_BUNDLE TRUE - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Info.plist.in" - XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.obs-studio - XCODE_ATTRIBUTE_PRODUCT_NAME OBS - XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon - XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY YES - XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY YES - XCODE_EMBED_PLUGINS_REMOVE_HEADERS_ON_COPY YES - XCODE_EMBED_PLUGINS_CODE_SIGN_ON_COPY YES - XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO - XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES - XCODE_ATTRIBUTE_SKIP_INSTALL NO - XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)") + MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Info.plist.in" + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.obs-studio + XCODE_ATTRIBUTE_PRODUCT_NAME OBS + XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon + XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY YES + XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY YES + XCODE_EMBED_PLUGINS_REMOVE_HEADERS_ON_COPY YES + XCODE_EMBED_PLUGINS_CODE_SIGN_ON_COPY YES + XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO + XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES + XCODE_ATTRIBUTE_SKIP_INSTALL NO + XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)") get_property(obs_dependencies GLOBAL PROPERTY _OBS_DEPENDENCIES) add_dependencies(${target} ${obs_dependencies}) @@ -68,15 +69,16 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ get_property(obs_executables GLOBAL PROPERTY _OBS_EXECUTABLES) add_dependencies(${target} ${obs_executables}) + foreach(executable IN LISTS obs_executables) set_property( TARGET ${executable} PROPERTY XCODE_ATTRIBUTE_INSTALL_PATH - "$(LOCAL_APPS_DIR)/$/Contents/MacOS") + "$(LOCAL_APPS_DIR)/$/Contents/MacOS") add_custom_command( TARGET ${target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$" - "$/MacOS/" + "$/MacOS/" COMMENT "Copy ${executable} to application bundle") endforeach() @@ -87,12 +89,12 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ TARGET ${target} POST_BUILD COMMAND - /usr/bin/sed -i '' 's/font-size: 10pt\;/font-size: 12pt\;/' - "$/Resources/themes/Acri.qss" - "$/Resources/themes/Grey.qss" - "$/Resources/themes/Light.qss" - "$/Resources/themes/Rachni.qss" - "$/Resources/themes/Yami.qss" + /usr/bin/sed -i '' 's/font-size: 10pt\;/font-size: 12pt\;/' + "$/Resources/themes/Acri.qss" + "$/Resources/themes/Grey.qss" + "$/Resources/themes/Light.qss" + "$/Resources/themes/Rachni.qss" + "$/Resources/themes/Yami.qss" COMMENT "Patch Qt stylesheets to use larger default font size on macOS") add_custom_command( @@ -114,7 +116,7 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ TARGET ${target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_directory "$" - "$/Resources/$" + "$/Resources/$" COMMENT "Add OBS DAL plugin to application bundle") endif() @@ -123,7 +125,7 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ TARGET ${target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$/obspython.py" - "$/Resources" + "$/Resources" COMMENT "Add OBS::python import module") endif() @@ -141,25 +143,26 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ set_target_properties( ${target} PROPERTIES NO_SONAME TRUE - MACHO_COMPATIBILITY_VERSION 1.0 - MACHO_CURRENT_VERSION ${OBS_VERSION_MAJOR} - SOVERSION 0 - VERSION 0 - XCODE_ATTRIBUTE_DYLIB_COMPATIBILITY_VERSION 1.0 - XCODE_ATTRIBUTE_DYLIB_CURRENT_VERSION ${OBS_VERSION_MAJOR} - XCODE_ATTRIBUTE_PRODUCT_NAME ${target} - XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target} - XCODE_ATTRIBUTE_SKIP_INSTALL YES) + MACHO_COMPATIBILITY_VERSION 1.0 + MACHO_CURRENT_VERSION ${OBS_VERSION_MAJOR} + SOVERSION 0 + VERSION 0 + XCODE_ATTRIBUTE_DYLIB_COMPATIBILITY_VERSION 1.0 + XCODE_ATTRIBUTE_DYLIB_CURRENT_VERSION ${OBS_VERSION_MAJOR} + XCODE_ATTRIBUTE_PRODUCT_NAME ${target} + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target} + XCODE_ATTRIBUTE_SKIP_INSTALL YES) get_target_property(is_framework ${target} FRAMEWORK) + if(is_framework) _check_info_plist() set_target_properties( ${target} PROPERTIES FRAMEWORK_VERSION A - MACOSX_FRAMEWORK_IDENTIFIER com.obsproject.${target} - MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Info.plist.in" - XCODE_ATTRIBUTE_SKIP_INSTALL YES) + MACOSX_FRAMEWORK_IDENTIFIER com.obsproject.${target} + MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Info.plist.in" + XCODE_ATTRIBUTE_SKIP_INSTALL YES) endif() _add_entitlements() @@ -169,10 +172,10 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ elseif(target_type STREQUAL MODULE_LIBRARY) if(target STREQUAL obspython) set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_NAME ${target} - XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target}) + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target}) elseif(target STREQUAL obslua) set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_NAME ${target} - XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target}) + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target}) elseif(target STREQUAL obs-dal-plugin) set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) set_property(GLOBAL APPEND PROPERTY _OBS_DEPENDENCIES ${target}) @@ -182,15 +185,16 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ set_target_properties( ${target} PROPERTIES BUNDLE TRUE - BUNDLE_EXTENSION plugin - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Info.plist.in" - XCODE_ATTRIBUTE_PRODUCT_NAME ${target} - XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target}) + BUNDLE_EXTENSION plugin + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Info.plist.in" + XCODE_ATTRIBUTE_PRODUCT_NAME ${target} + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.obsproject.${target}) if(target STREQUAL obs-browser) # 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() @@ -211,6 +215,7 @@ message(STATUS "[set_target_properties_obs] Setting target properties for ${targ endif() target_install_resources(${target}) + target_install_ffmpeg_and_ffprobe(${target}) get_target_property(target_sources ${target} SOURCES) set(target_ui_files ${target_sources}) @@ -255,14 +260,14 @@ endmacro() macro(_add_entitlements) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist") set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist") + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist") endif() 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() @@ -270,11 +275,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}") @@ -282,6 +289,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) @@ -299,12 +355,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() @@ -324,6 +382,7 @@ function(_bundle_dependencies target) if(is_imported) get_target_property(imported_location ${library} LOCATION) + if(NOT imported_location) continue() endif() @@ -335,8 +394,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) @@ -356,6 +417,7 @@ function(_bundle_dependencies target) if(library MATCHES "Qt[56]?::.+") find_qt_plugins(COMPONENT ${library} TARGET ${target} FOUND_VAR plugins_list) endif() + list(APPEND library_paths ${library_location}) elseif(NOT imported AND library_type STREQUAL "SHARED_LIBRARY") message(TRACE "${library} is a project target") @@ -364,6 +426,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}/../") @@ -371,7 +434,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/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/obs.c b/libobs/obs.c index 626c69d6387b55..d2ad0bd48e7848 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -3267,6 +3267,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; } @@ -3433,8 +3434,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); } @@ -3448,8 +3453,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 924171496193ea..d563d8cf1fd38b 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -86,6 +86,7 @@ if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0) OR OS_MACOS OR OS_LINUX) add_subdirectory(vlc-video) + add_subdirectory(obs-ndi) endif() if(OS_WINDOWS) add_subdirectory(win-capture) diff --git a/plugins/coreaudio-encoder/encoder.cpp b/plugins/coreaudio-encoder/encoder.cpp index 689be6a0dcac97..fdb401531056cf 100644 --- a/plugins/coreaudio-encoder/encoder.cpp +++ b/plugins/coreaudio-encoder/encoder.cpp @@ -1255,11 +1255,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)); } }; @@ -1270,7 +1270,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_)); @@ -1281,7 +1281,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/mac-capture/mac-screen-capture.m b/plugins/mac-capture/mac-screen-capture.m index c92bfa79980394..7d9159b7ff5e14 100644 --- a/plugins/mac-capture/mac-screen-capture.m +++ b/plugins/mac-capture/mac-screen-capture.m @@ -23,6 +23,7 @@ bool is_screen_capture_available(void) #include #include #include +#include #define MACCAP_LOG(level, msg, ...) \ blog(level, "[ mac-screencapture ]: " msg, ##__VA_ARGS__) @@ -337,28 +338,65 @@ static inline void screen_stream_audio_update(struct screen_capture *sc, obs_source_output_audio(sc->source, &audio_data); } +static bool hasScreenRecordingPermission() +{ + if (@available(macOS 10.15, *)) { + return CGPreflightScreenCaptureAccess(); + } else { + return YES; // On earlier versions, no permission is required + } +} + +static void requestScreenRecordingPermission() +{ + if (@available(macOS 10.15, *)) { + dispatch_semaphore_t sema = dispatch_semaphore_create(0); + CGRequestScreenCaptureAccess(); + dispatch_semaphore_signal(sema); + } +} + static bool init_screen_stream(struct screen_capture *sc) { - SCContentFilter *content_filter; + MACCAP_LOG(LOG_WARNING, "Entering init_screen_stream"); + + if (!hasScreenRecordingPermission()) { + MACCAP_ERR("Screen recording permission not granted"); + dispatch_async(dispatch_get_main_queue(), ^{ + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:@"Screen Recording Permission Required"]; + [alert setInformativeText:@"Please grant Screen Recording permission in System Preferences > Security & Privacy > Privacy > Screen Recording, then restart the application."]; + [alert addButtonWithTitle:@"OK"]; + [alert runModal]; + [alert release]; + + NSURL *url = [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Security.prefPane"]; + [[NSWorkspace sharedWorkspace] openURL:url]; + }); + + return false; + } + MACCAP_LOG(LOG_WARNING, "Initializing stream configuration"); + SCContentFilter *content_filter = nil; sc->frame = CGRectZero; sc->stream_properties = [[SCStreamConfiguration alloc] init]; + MACCAP_LOG(LOG_WARNING, "Waiting for shareable content"); os_sem_wait(sc->shareable_content_available); SCDisplay * (^get_target_display)() = ^SCDisplay *() { __block SCDisplay *target_display = nil; - [sc->shareable_content.displays - indexOfObjectPassingTest:^BOOL( - SCDisplay *_Nonnull display, NSUInteger idx, - BOOL *_Nonnull stop) { - if (display.displayID == sc->display) { - target_display = sc->shareable_content - .displays[idx]; - *stop = TRUE; - } - return *stop; - }]; + [sc->shareable_content.displays indexOfObjectPassingTest:^BOOL(SCDisplay *_Nonnull display, NSUInteger idx, BOOL *_Nonnull stop) { + if (display.displayID == sc->display) { + target_display = sc->shareable_content.displays[idx]; + *stop = TRUE; + } + return *stop; + }]; + if (!target_display) { + MACCAP_LOG(LOG_WARNING, "Target display not found. Display ID: %d", sc->display); + } return target_display; }; @@ -374,173 +412,193 @@ static bool init_screen_stream(struct screen_capture *sc) CGDisplayModeRelease(display_mode); }; + MACCAP_LOG(LOG_WARNING, "Capture type: %d", sc->capture_type); switch (sc->capture_type) { case ScreenCaptureDisplayStream: { + MACCAP_LOG(LOG_WARNING, "Initializing display stream capture"); SCDisplay *target_display = get_target_display(); + if (!target_display) { + MACCAP_ERR("Target display not found"); + os_sem_post(sc->shareable_content_available); + return false; + } + MACCAP_LOG(LOG_WARNING, "Creating content filter for display ID: %d", target_display.displayID); NSArray *empty = [[NSArray alloc] init]; - content_filter = [[SCContentFilter alloc] - initWithDisplay:target_display - excludingWindows:empty]; + content_filter = [[SCContentFilter alloc] initWithDisplay:target_display excludingWindows:empty]; [empty release]; set_display_mode(sc, target_display); } break; + case ScreenCaptureWindowStream: { + MACCAP_LOG(LOG_WARNING, "Initializing window stream capture"); __block SCWindow *target_window = nil; - if (sc->window != 0) { - [sc->shareable_content.windows - indexOfObjectPassingTest:^BOOL( - SCWindow *_Nonnull window, - NSUInteger idx, BOOL *_Nonnull stop) { - if (window.windowID == sc->window) { - target_window = - sc->shareable_content - .windows[idx]; - *stop = TRUE; - } - return *stop; - }]; - } else { - target_window = - [sc->shareable_content.windows objectAtIndex:0]; + [sc->shareable_content.windows indexOfObjectPassingTest:^BOOL(SCWindow *_Nonnull window, NSUInteger idx, BOOL *_Nonnull stop) { + if (window.windowID == sc->window) { + target_window = sc->shareable_content.windows[idx]; + *stop = TRUE; + } + return *stop; + }]; + + MACCAP_LOG(LOG_WARNING, "Window count: %lu", (unsigned long)[sc->shareable_content.windows count]); + if (!target_window && [sc->shareable_content.windows count] > 0) { + target_window = [sc->shareable_content.windows objectAtIndex:0]; sc->window = target_window.windowID; + MACCAP_LOG(LOG_WARNING, "Using fallback window. Window ID: %d", sc->window); } - content_filter = [[SCContentFilter alloc] - initWithDesktopIndependentWindow:target_window]; - if (target_window) { - [sc->stream_properties - setWidth:(size_t)target_window.frame.size.width]; - [sc->stream_properties - setHeight:(size_t)target_window.frame.size - .height]; + if (!target_window) { + MACCAP_ERR("Target window not found. Window ID: %d", sc->window); + os_sem_post(sc->shareable_content_available); + return false; } + MACCAP_LOG(LOG_WARNING, "Creating content filter for window ID: %d", target_window.windowID); + content_filter = [[SCContentFilter alloc] initWithDesktopIndependentWindow:target_window]; + + [sc->stream_properties setWidth:(size_t)target_window.frame.size.width]; + [sc->stream_properties setHeight:(size_t)target_window.frame.size.height]; + MACCAP_LOG(LOG_WARNING, "Window dimensions set to: %zux%zu", (size_t)target_window.frame.size.width, (size_t)target_window.frame.size.height); } break; + case ScreenCaptureApplicationStream: { + MACCAP_LOG(LOG_WARNING, "Initializing application stream capture"); SCDisplay *target_display = get_target_display(); + if (!target_display) { + MACCAP_ERR("Target display not found for application capture"); + os_sem_post(sc->shareable_content_available); + return false; + } + + MACCAP_LOG(LOG_WARNING, "Searching for application with bundle ID: %s", [sc->application_id UTF8String]); __block SCRunningApplication *target_application = nil; - { - [sc->shareable_content.applications - indexOfObjectPassingTest:^BOOL( - SCRunningApplication - *_Nonnull application, - NSUInteger idx, BOOL *_Nonnull stop) { - if ([application.bundleIdentifier - isEqualToString: - sc-> - application_id]) { - target_application = - sc->shareable_content - .applications - [idx]; - *stop = TRUE; - } - return *stop; - }]; + [sc->shareable_content.applications indexOfObjectPassingTest:^BOOL(SCRunningApplication *_Nonnull application, NSUInteger idx, BOOL *_Nonnull stop) { + if ([application.bundleIdentifier isEqualToString:sc->application_id]) { + target_application = sc->shareable_content.applications[idx]; + *stop = TRUE; + } + return *stop; + }]; + + if (!target_application) { + MACCAP_ERR("Target application not found with bundle ID: %s", [sc->application_id UTF8String]); + os_sem_post(sc->shareable_content_available); + return false; } - NSArray *target_application_array = [[NSArray alloc] - initWithObjects:target_application, nil]; + MACCAP_LOG(LOG_WARNING, "Creating content filter for application"); + NSArray *target_application_array = [[NSArray alloc] initWithObjects:target_application, nil]; NSArray *empty_array = [[NSArray alloc] init]; - content_filter = [[SCContentFilter alloc] - initWithDisplay:target_display - includingApplications:target_application_array - exceptingWindows:empty_array]; + + content_filter = [[SCContentFilter alloc] initWithDisplay:target_display includingApplications:target_application_array exceptingWindows:empty_array]; + [target_application_array release]; [empty_array release]; set_display_mode(sc, target_display); } break; } + os_sem_post(sc->shareable_content_available); + MACCAP_LOG(LOG_WARNING, "Configuring stream properties"); CGColorRef background = CGColorGetConstantColor(kCGColorClear); [sc->stream_properties setQueueDepth:8]; [sc->stream_properties setShowsCursor:!sc->hide_cursor]; [sc->stream_properties setColorSpaceName:kCGColorSpaceDisplayP3]; [sc->stream_properties setBackgroundColor:background]; - FourCharCode l10r_type = 0; - l10r_type = ('l' << 24) | ('1' << 16) | ('0' << 8) | 'r'; + + FourCharCode l10r_type = ('l' << 24) | ('1' << 16) | ('0' << 8) | 'r'; [sc->stream_properties setPixelFormat:l10r_type]; if (@available(macOS 13.0, *)) { + MACCAP_LOG(LOG_WARNING, "Configuring audio properties for macOS 13+"); #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000 [sc->stream_properties setCapturesAudio:TRUE]; [sc->stream_properties setExcludesCurrentProcessAudio:TRUE]; [sc->stream_properties setChannelCount:2]; #endif - } else { - if (sc->capture_type != ScreenCaptureWindowStream) { - sc->disp = NULL; - [content_filter release]; - os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); - os_event_init(&sc->stream_start_completed, - OS_EVENT_TYPE_MANUAL); - return true; - } + } else if (sc->capture_type != ScreenCaptureWindowStream) { + MACCAP_LOG(LOG_WARNING, "Legacy OS path: initializing without audio"); + sc->disp = NULL; + [content_filter release]; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } - sc->disp = [[SCStream alloc] initWithFilter:content_filter - configuration:sc->stream_properties - delegate:nil]; - + MACCAP_LOG(LOG_WARNING, "Initializing SCStream"); + sc->disp = [[SCStream alloc] initWithFilter:content_filter configuration:sc->stream_properties delegate:nil]; [content_filter release]; NSError *addStreamOutputError = nil; - BOOL did_add_output = [sc->disp addStreamOutput:sc->capture_delegate - type:SCStreamOutputTypeScreen - sampleHandlerQueue:nil - error:&addStreamOutputError]; + MACCAP_LOG(LOG_WARNING, "Adding stream output"); + BOOL did_add_output = [sc->disp addStreamOutput:sc->capture_delegate type:SCStreamOutputTypeScreen sampleHandlerQueue:nil error:&addStreamOutputError]; + if (!did_add_output) { - MACCAP_ERR( - "init_screen_stream: Failed to add stream output with error %s\n", - [[addStreamOutputError localizedFailureReason] - cStringUsingEncoding:NSUTF8StringEncoding]); + NSString *errorDescription = addStreamOutputError ? [addStreamOutputError localizedDescription] : @"Unknown error"; + MACCAP_ERR("Failed to add stream output with error: %s", [errorDescription cStringUsingEncoding:NSUTF8StringEncoding]); [addStreamOutputError release]; - return !did_add_output; + return false; } #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000 if (@available(macOS 13.0, *)) { - did_add_output = [sc->disp - addStreamOutput:sc->capture_delegate - type:SCStreamOutputTypeAudio - sampleHandlerQueue:nil - error:&addStreamOutputError]; + MACCAP_LOG(LOG_WARNING, "Adding audio stream output"); + did_add_output = [sc->disp addStreamOutput:sc->capture_delegate type:SCStreamOutputTypeAudio sampleHandlerQueue:nil error:&addStreamOutputError]; + if (!did_add_output) { - MACCAP_ERR( - "init_screen_stream: Failed to add audio stream output with error %s\n", - [[addStreamOutputError localizedFailureReason] - cStringUsingEncoding: - NSUTF8StringEncoding]); + NSString *errorDescription = addStreamOutputError ? [addStreamOutputError localizedDescription] : @"Unknown error"; + MACCAP_ERR("Failed to add audio stream output with error: %s", [errorDescription cStringUsingEncoding:NSUTF8StringEncoding]); [addStreamOutputError release]; - return !did_add_output; + return false; } } #endif + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + MACCAP_LOG(LOG_WARNING, "Starting capture"); __block BOOL did_stream_start = false; - [sc->disp startCaptureWithCompletionHandler:^( - NSError *_Nullable error) { - did_stream_start = (BOOL)(error == nil); + [sc->disp startCaptureWithCompletionHandler:^(NSError *_Nullable error) { + did_stream_start = (error == nil); if (!did_stream_start) { - MACCAP_ERR( - "init_screen_stream: Failed to start capture with error %s\n", - [[error localizedFailureReason] - cStringUsingEncoding: - NSUTF8StringEncoding]); - // Clean up disp so it isn't stopped + NSString *errorDescription = error ? [error localizedDescription] : @"Unknown error"; + MACCAP_ERR("Failed to start capture with error: %s", [errorDescription cStringUsingEncoding:NSUTF8StringEncoding]); + + if ([error.domain isEqualToString:@"com.apple.ScreenCaptureKit.ErrorDomain"]) { + MACCAP_LOG(LOG_WARNING, "ScreenCaptureKit error domain detected, code: %ld", (long)error.code); + NSInteger permissionDeniedErrorCode = -3801; + if (error.code == permissionDeniedErrorCode) { + MACCAP_ERR("Permission denied error detected"); + dispatch_async(dispatch_get_main_queue(), ^{ + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:@"Screen Recording Permission Denied"]; + [alert setInformativeText:@"Please grant Screen Recording permission in System Preferences > Security & Privacy > Privacy > Screen Recording, then restart the application."]; + [alert addButtonWithTitle:@"OK"]; + [alert runModal]; + [alert release]; + + NSURL *url = [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Security.prefPane"]; + [[NSWorkspace sharedWorkspace] openURL:url]; + }); + } + } + [sc->disp release]; sc->disp = NULL; + } else { + MACCAP_LOG(LOG_WARNING, "Capture started successfully"); } os_event_signal(sc->stream_start_completed); }]; - os_event_wait(sc->stream_start_completed); + MACCAP_LOG(LOG_WARNING, "Waiting for stream start completion"); + os_event_wait(sc->stream_start_completed); + MACCAP_LOG(LOG_WARNING, "Stream initialization %s", did_stream_start ? "succeeded" : "failed"); return did_stream_start; } diff --git a/plugins/obs-browser b/plugins/obs-browser index 630848ac1f484f..33ec6b80fcb387 160000 --- a/plugins/obs-browser +++ b/plugins/obs-browser @@ -1 +1 @@ -Subproject commit 630848ac1f484fcdab1160f00be11cbc7fd8227d +Subproject commit 33ec6b80fcb38754276bd3e8b84d0e6e42bdd03c diff --git a/plugins/obs-ndi b/plugins/obs-ndi index c9cb15ec683769..4c05702128c6b5 160000 --- a/plugins/obs-ndi +++ b/plugins/obs-ndi @@ -1 +1 @@ -Subproject commit c9cb15ec6837690ea94fcbe275c8323ad1652899 +Subproject commit 4c05702128c6b5d2f25096edc578e63e1b8ef600 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', ''))) From 6237859dbffade4c5ccdff1bc43160fbae6e9dd8 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Thu, 31 Oct 2024 15:41:06 -0700 Subject: [PATCH 2/5] handle failure to create display --- plugins/mac-capture/mac-screen-capture.m | 140 ++++++++++++++++------- 1 file changed, 99 insertions(+), 41 deletions(-) diff --git a/plugins/mac-capture/mac-screen-capture.m b/plugins/mac-capture/mac-screen-capture.m index 7d9159b7ff5e14..8facf71f2fc1e8 100644 --- a/plugins/mac-capture/mac-screen-capture.m +++ b/plugins/mac-capture/mac-screen-capture.m @@ -374,7 +374,11 @@ static bool init_screen_stream(struct screen_capture *sc) [[NSWorkspace sharedWorkspace] openURL:url]; }); - return false; + // Initialize sc even if permission is not granted + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } MACCAP_LOG(LOG_WARNING, "Initializing stream configuration"); @@ -420,7 +424,12 @@ static bool init_screen_stream(struct screen_capture *sc) if (!target_display) { MACCAP_ERR("Target display not found"); os_sem_post(sc->shareable_content_available); - return false; + + // Initialize sc even if target display is not found + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } MACCAP_LOG(LOG_WARNING, "Creating content filter for display ID: %d", target_display.displayID); @@ -452,7 +461,12 @@ static bool init_screen_stream(struct screen_capture *sc) if (!target_window) { MACCAP_ERR("Target window not found. Window ID: %d", sc->window); os_sem_post(sc->shareable_content_available); - return false; + + // Initialize sc even if target window is not found + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } MACCAP_LOG(LOG_WARNING, "Creating content filter for window ID: %d", target_window.windowID); @@ -469,7 +483,12 @@ static bool init_screen_stream(struct screen_capture *sc) if (!target_display) { MACCAP_ERR("Target display not found for application capture"); os_sem_post(sc->shareable_content_available); - return false; + + // Initialize sc even if target display is not found + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } MACCAP_LOG(LOG_WARNING, "Searching for application with bundle ID: %s", [sc->application_id UTF8String]); @@ -485,7 +504,12 @@ static bool init_screen_stream(struct screen_capture *sc) if (!target_application) { MACCAP_ERR("Target application not found with bundle ID: %s", [sc->application_id UTF8String]); os_sem_post(sc->shareable_content_available); - return false; + + // Initialize sc even if target application is not found + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } MACCAP_LOG(LOG_WARNING, "Creating content filter for application"); @@ -529,10 +553,26 @@ static bool init_screen_stream(struct screen_capture *sc) return true; } + // Check if content_filter is initialized + if (!content_filter) { + MACCAP_ERR("Content filter is not initialized"); + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; + } + MACCAP_LOG(LOG_WARNING, "Initializing SCStream"); sc->disp = [[SCStream alloc] initWithFilter:content_filter configuration:sc->stream_properties delegate:nil]; [content_filter release]; + if (!sc->disp) { + MACCAP_ERR("Failed to initialize SCStream"); + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; + } + NSError *addStreamOutputError = nil; MACCAP_LOG(LOG_WARNING, "Adding stream output"); BOOL did_add_output = [sc->disp addStreamOutput:sc->capture_delegate type:SCStreamOutputTypeScreen sampleHandlerQueue:nil error:&addStreamOutputError]; @@ -541,7 +581,13 @@ static bool init_screen_stream(struct screen_capture *sc) NSString *errorDescription = addStreamOutputError ? [addStreamOutputError localizedDescription] : @"Unknown error"; MACCAP_ERR("Failed to add stream output with error: %s", [errorDescription cStringUsingEncoding:NSUTF8StringEncoding]); [addStreamOutputError release]; - return false; + + // Release sc->disp and set to NULL + [sc->disp release]; + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000 @@ -553,7 +599,13 @@ static bool init_screen_stream(struct screen_capture *sc) NSString *errorDescription = addStreamOutputError ? [addStreamOutputError localizedDescription] : @"Unknown error"; MACCAP_ERR("Failed to add audio stream output with error: %s", [errorDescription cStringUsingEncoding:NSUTF8StringEncoding]); [addStreamOutputError release]; - return false; + + // Release sc->disp and set to NULL + [sc->disp release]; + sc->disp = NULL; + os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); + os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); + return true; } } #endif @@ -561,45 +613,51 @@ static bool init_screen_stream(struct screen_capture *sc) os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL); os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL); - MACCAP_LOG(LOG_WARNING, "Starting capture"); - __block BOOL did_stream_start = false; - [sc->disp startCaptureWithCompletionHandler:^(NSError *_Nullable error) { - did_stream_start = (error == nil); - if (!did_stream_start) { - NSString *errorDescription = error ? [error localizedDescription] : @"Unknown error"; - MACCAP_ERR("Failed to start capture with error: %s", [errorDescription cStringUsingEncoding:NSUTF8StringEncoding]); - - if ([error.domain isEqualToString:@"com.apple.ScreenCaptureKit.ErrorDomain"]) { - MACCAP_LOG(LOG_WARNING, "ScreenCaptureKit error domain detected, code: %ld", (long)error.code); - NSInteger permissionDeniedErrorCode = -3801; - if (error.code == permissionDeniedErrorCode) { - MACCAP_ERR("Permission denied error detected"); - dispatch_async(dispatch_get_main_queue(), ^{ - NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText:@"Screen Recording Permission Denied"]; - [alert setInformativeText:@"Please grant Screen Recording permission in System Preferences > Security & Privacy > Privacy > Screen Recording, then restart the application."]; - [alert addButtonWithTitle:@"OK"]; - [alert runModal]; - [alert release]; - - NSURL *url = [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Security.prefPane"]; - [[NSWorkspace sharedWorkspace] openURL:url]; - }); + if (sc->disp) { + MACCAP_LOG(LOG_WARNING, "Starting capture"); + __block BOOL did_stream_start = false; + [sc->disp startCaptureWithCompletionHandler:^(NSError *_Nullable error) { + did_stream_start = (error == nil); + if (!did_stream_start) { + NSString *errorDescription = error ? [error localizedDescription] : @"Unknown error"; + MACCAP_ERR("Failed to start capture with error: %s", [errorDescription cStringUsingEncoding:NSUTF8StringEncoding]); + + if ([error.domain isEqualToString:@"com.apple.ScreenCaptureKit.ErrorDomain"]) { + MACCAP_LOG(LOG_WARNING, "ScreenCaptureKit error domain detected, code: %ld", (long)error.code); + NSInteger permissionDeniedErrorCode = -3801; + if (error.code == permissionDeniedErrorCode) { + MACCAP_ERR("Permission denied error detected"); + dispatch_async(dispatch_get_main_queue(), ^{ + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:@"Screen Recording Permission Denied"]; + [alert setInformativeText:@"Please grant Screen Recording permission in System Preferences > Security & Privacy > Privacy > Screen Recording, then restart the application."]; + [alert addButtonWithTitle:@"OK"]; + [alert runModal]; + [alert release]; + + NSURL *url = [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Security.prefPane"]; + [[NSWorkspace sharedWorkspace] openURL:url]; + }); + } } + + [sc->disp release]; + sc->disp = NULL; + } else { + MACCAP_LOG(LOG_WARNING, "Capture started successfully"); } + os_event_signal(sc->stream_start_completed); + }]; - [sc->disp release]; - sc->disp = NULL; - } else { - MACCAP_LOG(LOG_WARNING, "Capture started successfully"); - } + MACCAP_LOG(LOG_WARNING, "Waiting for stream start completion"); + os_event_wait(sc->stream_start_completed); + MACCAP_LOG(LOG_WARNING, "Stream initialization %s", did_stream_start ? "succeeded" : "failed"); + } else { + MACCAP_ERR("SCStream is not initialized, skipping capture start"); os_event_signal(sc->stream_start_completed); - }]; + } - MACCAP_LOG(LOG_WARNING, "Waiting for stream start completion"); - os_event_wait(sc->stream_start_completed); - MACCAP_LOG(LOG_WARNING, "Stream initialization %s", did_stream_start ? "succeeded" : "failed"); - return did_stream_start; + return true; } static void screen_capture_build_content_list(struct screen_capture *sc, From 6bc34d8e0b05c91c2cbc5a86f1862f04a1eb4ab6 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Mon, 16 Dec 2024 20:07:26 -0800 Subject: [PATCH 3/5] merge fixes --- CMakeLists.txt | 4 +- CMakePresets.json | 106 ++++++++++++++---- buildspec.json | 34 ++++-- cmake/common/buildspec_common.cmake | 96 ++++++++++++++-- cmake/macos/buildspec.cmake | 5 +- cmake/windows/buildspec.cmake | 14 ++- cmake/windows/defaults.cmake | 2 + cmake/windows/helpers.cmake | 6 + libobs/CMakeLists.txt | 18 +-- libobs/cmake/legacy.cmake | 6 +- libobs/cmake/os-windows.cmake | 13 +-- libobs/obs-scene.c | 4 +- libobs/obs-view.c | 2 +- plugins/image-source/obs-slideshow.c | 2 +- plugins/mediasoup-connector | 2 +- plugins/motion-effect | 2 +- plugins/obs-browser | 2 +- plugins/obs-ndi | 2 +- plugins/obs-openvr | 2 +- plugins/obs-outputs/mp4-output.c | 2 +- plugins/obs-websocket | 2 +- plugins/sl-vst | 2 +- plugins/vlc-video/vlc-video-plugin.h | 16 +-- .../win-capture/duplicator-monitor-capture.c | 6 +- plugins/win-capture/game-capture.c | 4 +- .../get-graphics-offsets/CMakeLists.txt | 2 + .../win-capture/graphics-hook/CMakeLists.txt | 2 + .../win-capture/inject-helper/CMakeLists.txt | 2 + plugins/win-capture/screen-capture.c | 4 +- plugins/win-dshow/cmake/libdshowcapture.cmake | 2 + plugins/win-dshow/libdshowcapture | 2 +- .../virtualcam-module/CMakeLists.txt | 4 + plugins/win-spout | 2 +- plugins/win-wasapi/CMakeLists.txt | 2 +- 34 files changed, 284 insertions(+), 92 deletions(-) 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/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/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/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/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 76ae57a3c3056b..5e83933a2454ed 160000 --- a/plugins/motion-effect +++ b/plugins/motion-effect @@ -1 +1 @@ -Subproject commit 76ae57a3c3056b20291ae826f9efe99d4d826356 +Subproject commit 5e83933a2454ed74b601c03575f5edc2e9938f10 diff --git a/plugins/obs-browser b/plugins/obs-browser index 33ec6b80fcb387..9a307be457ed42 160000 --- a/plugins/obs-browser +++ b/plugins/obs-browser @@ -1 +1 @@ -Subproject commit 33ec6b80fcb38754276bd3e8b84d0e6e42bdd03c +Subproject commit 9a307be457ed429c0ad8535f9234f47cf928f098 diff --git a/plugins/obs-ndi b/plugins/obs-ndi index 4c05702128c6b5..cb4d3776f81f58 160000 --- a/plugins/obs-ndi +++ b/plugins/obs-ndi @@ -1 +1 @@ -Subproject commit 4c05702128c6b5d2f25096edc578e63e1b8ef600 +Subproject commit cb4d3776f81f58a99fc327f56261e2813b2ee902 diff --git a/plugins/obs-openvr b/plugins/obs-openvr index 51f9704e7404b2..d14a35ab694f05 160000 --- a/plugins/obs-openvr +++ b/plugins/obs-openvr @@ -1 +1 @@ -Subproject commit 51f9704e7404b265a4eb03c3a18bb7ef0e9c8f6b +Subproject commit d14a35ab694f05aeb5bf37763e309f64b9b1d630 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/obs-websocket b/plugins/obs-websocket index 6fd18a7ef1ecb1..56865bb928f92d 160000 --- a/plugins/obs-websocket +++ b/plugins/obs-websocket @@ -1 +1 @@ -Subproject commit 6fd18a7ef1ecb149e8444154af1daab61d4241a9 +Subproject commit 56865bb928f92dc7c85dee9772b06e03f5e38bec 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 ae9e4f4b553f47..7d3f7873d9b6e8 160000 --- a/plugins/win-dshow/libdshowcapture +++ b/plugins/win-dshow/libdshowcapture @@ -1 +1 @@ -Subproject commit ae9e4f4b553f47a1d47d37cc7f5aab0b10c955bf +Subproject commit 7d3f7873d9b6e8c9fe72ed9d5a1f0ee529b3e93d 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 "") From 8f4935ab577ac52cbbb05fb8fe961011541b060b Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Tue, 17 Dec 2024 20:29:53 -0800 Subject: [PATCH 4/5] update scripts --- .github/actions/package-obs/action.yaml | 10 ++- .github/actions/run-clang-format/action.yaml | 9 ++- .../actions/upload-debug-symbols/action.yaml | 53 ++++++++++++++++ .github/scripts/Build-Windows.ps1 | 10 +++ .github/workflows/build-project.yaml | 57 +++++++++++++++++- .github/workflows/clang-format.yml | 4 +- .github/workflows/main-streamlabs.yml | 4 +- .github/workflows/main.yml | 8 +-- .github/workflows/pr-pull.yaml | 6 +- .github/workflows/push.yaml | 1 + CMakeLists.txt | 16 +++++ buildspec.json | 4 +- cmake/Modules/ObsHelpers_Windows.cmake | 4 +- cmake/common/buildspec_common.cmake | 17 +++++- cmake/macos/buildspec.cmake | 7 +-- dependencies/obs-websocket.dll.txt | Bin 0 -> 1470 bytes dependencies/win-openvr.dll.txt | Bin 730 -> 674 bytes libobs/util/c99defs.h | 2 +- plugins/obs-browser | 2 +- plugins/obs-openvr | 2 +- plugins/win-dshow/libdshowcapture | 2 +- 21 files changed, 188 insertions(+), 30 deletions(-) create mode 100644 .github/actions/upload-debug-symbols/action.yaml create mode 100644 dependencies/obs-websocket.dll.txt diff --git a/.github/actions/package-obs/action.yaml b/.github/actions/package-obs/action.yaml index 7247e469716d4c..0db8de1b040133 100644 --- a/.github/actions/package-obs/action.yaml +++ b/.github/actions/package-obs/action.yaml @@ -91,7 +91,7 @@ runs: ${{ inputs.workingDirectory }}/.github/scripts/package-ubuntu ${package_args} - name: Run Windows packaging - if: runner.os == 'Windows' + if: runner.os == 'Windows' && github.repository == 'obsproject/obs-studio' shell: pwsh working-directory: ${{ inputs.workingDirectory }} run: | @@ -112,3 +112,11 @@ runs: } .github/scripts/Package-windows.ps1 @PackageArgs + + - name: Run Windows lib packaging + if: runner.os == 'Windows' + shell: pwsh + working-directory: ${{ inputs.workingDirectory }} + run: 7z a -r ${{env.TARGET_ARTIFACT}}.7z ${{env.InstallPath}} + env: + TARGET_ARTIFACT: ${{env.PACKAGE_NAME}}-${{env.OS_TAG}}-${{matrix.ReleaseName}}-${{ steps.get_version.outputs.VERSION }} \ No newline at end of file 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/actions/upload-debug-symbols/action.yaml b/.github/actions/upload-debug-symbols/action.yaml new file mode 100644 index 00000000000000..26b03bc856a672 --- /dev/null +++ b/.github/actions/upload-debug-symbols/action.yaml @@ -0,0 +1,53 @@ +inputs: + githubWorkspace: + description: "GitHub workspace path." + required: true + repoUserId: + description: "Repository user ID." + required: true + repoName: + description: "Repository name." + required: true + repoBranch: + description: "Repository branch." + required: true + buildConfig: + description: "Build configuration for Sentry upload (macOS only)." + required: false + default: "RelWithDebInfo" + awsSymbAccessKeyId: + description: "AWS Access Key ID used for symbol uploads." + required: false + awsSymbSecretAccessKey: + description: "AWS Secret Access Key used for symbol uploads." + required: false + sentryAuthToken: + description: "Auth token used for Sentry symbol uploads." + required: false + +runs: + using: "composite" + steps: + - name: Fetch symsrv-scripts + if: runner.os != 'macOS' + uses: actions/checkout@v3 + with: + fetch-depth: 2 + repository: ${{ inputs.repoUserId }}/symsrv-scripts + path: symsrv-scripts + + - name: Run symbol server scripts + if: runner.os != 'macOS' + shell: powershell + run: ./symsrv-scripts/main.bat "${{ inputs.githubWorkspace }}/symsrv-scripts" ".\main.ps1 -localSourceDir '${{ inputs.githubWorkspace }}' -repo_userId '${{ inputs.repoUserId }}' -repo_name '${{ inputs.repoName }}' -repo_branch '${{ inputs.repoBranch }}' -subModules 'plugins/mediasoup-connector,stream-labs,mediasoup-connector,streamlabs;plugins/enc-amf,stream-labs,obs-amd-encoder,streamlabs;plugins/motion-effect,stream-labs,motion-effect,master;plugins/obs-browser,stream-labs,obs-browser,streamlabs;plugins/obs-ndi,stream-labs,obs-ndi,streamlabs;plugins/obs-ndi,stream-labs,obs-amd-encoder,streamlabs;plugins/obs-openvr,stream-labs,OBS-OpenVR-Input-Plugin,master;plugins/sl-vst,stream-labs,sl-vst,streamlabs;plugins/slobs-virtual-cam,stream-labs,slobs-virtual-cam,streamlabs;plugins/win-dshow/libdshowcapture,stream-labs,libdshowcapture,streamlabs'" + env: + AWS_SYMB_ACCESS_KEY_ID: ${{ inputs.awsSymbAccessKeyId }} + AWS_SYMB_SECRET_ACCESS_KEY: ${{ inputs.awsSymbSecretAccessKey }} + + - name: Upload debug files to Sentry (macOS only) + if: runner.os == 'macOS' + shell: python + run: python ./slobs_CI/sentry-osx.py + env: + SENTRY_AUTH_TOKEN: ${{ inputs.sentryAuthToken }} + BUILDCONFIG: ${{ inputs.buildConfig }} diff --git a/.github/scripts/Build-Windows.ps1 b/.github/scripts/Build-Windows.ps1 index 425265f6ba630c..34376665604475 100644 --- a/.github/scripts/Build-Windows.ps1 +++ b/.github/scripts/Build-Windows.ps1 @@ -55,13 +55,21 @@ function Build { $CmakeArgs = @('--preset', "windows-ci-${Target}") $CmakeBuildArgs = @('--build') $CmakeInstallArgs = @() + $CmakeCheckArgs = @('--build') if ( $DebugPreference -eq 'Continue' ) { $CmakeArgs += ('--debug-output') $CmakeBuildArgs += ('--verbose') $CmakeInstallArgs += ('--verbose') + $CmakeCheckArgs += ('--verbose') } + $CmakeCheckArgs += @( + "build_${Target}" + '--target', 'check_dependencies', + '--config', $Configuration + ) + $CmakeBuildArgs += @( '--preset', "windows-${Target}" '--config', $Configuration @@ -81,6 +89,8 @@ function Build { Log-Group "Building obs-studio..." Invoke-External cmake @CmakeBuildArgs + Invoke-External cmake @CmakeCheckArgs + Log-Group "Installing obs-studio..." Invoke-External cmake @CmakeInstallArgs diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 2ccb337e0d91f6..83b30ad0b5de77 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -162,6 +162,15 @@ jobs: name: obs-studio-macos-${{ matrix.target }}-${{ needs.check-event.outputs.commitHash }}-dSYMs path: ${{ github.workspace }}/build_macos/obs-studio-*-macos-${{ steps.setup.outputs.cpuName }}-dSYMs.tar.xz + - name: Symbol Server and Sentry Integration + uses: ./.github/actions/upload-debug-symbols + with: + githubWorkspace: ${{ github.workspace }} + repoUserId: stream-labs + repoName: obs-studio + repoBranch: ${{ github.sha }} + buildConfig: RelWithDebInfo + - uses: actions/cache/save@v4 if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true' with: @@ -170,6 +179,7 @@ jobs: ubuntu-build: name: Ubuntu 🐧 + if: github.repository == 'obsproject/obs-studio' strategy: matrix: os: [ubuntu-22.04, ubuntu-24.04] @@ -228,7 +238,7 @@ jobs: - name: Upload Debug Symbol Artifacts 🪲 uses: actions/upload-artifact@v4 - if: ${{ fromJSON(needs.check-event.outputs.package) }} + if: github.repository == 'obsproject/obs-studio' && fromJSON(needs.check-event.outputs.package) with: name: obs-studio-${{ matrix.os }}-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym path: ${{ github.workspace }}/build_ubuntu/obs-studio-*-x86_64-ubuntu-gnu-dbgsym.ddeb @@ -241,6 +251,7 @@ jobs: flatpak-build: name: Flatpak 📦 + if: github.repository == 'obsproject/obs-studio' runs-on: ubuntu-22.04 needs: check-event defaults: @@ -331,6 +342,12 @@ jobs: name: Windows 🪟 runs-on: windows-2022 needs: check-event + env: + PACKAGE_NAME: libobs + OS_TAG: windows-x64 + InstallPath: "build_x64/install" + RELEASE_BUCKET: "obsstudios3.streamlabs.com" + ReleaseName: release defaults: run: shell: pwsh @@ -365,7 +382,20 @@ jobs: target: x64 config: ${{ needs.check-event.outputs.config }} + - name: Symbol Server and Sentry Integration 🪲 + uses: ./.github/actions/upload-debug-symbols + with: + githubWorkspace: ${{ github.workspace }} + repoUserId: stream-labs + repoName: obs-studio + repoBranch: ${{ github.sha }} + buildConfig: RelWithDebInfo + awsSymbAccessKeyId: ${{ secrets.AWS_SYMB_ACCESS_KEY_ID }} + awsSymbSecretAccessKey: ${{ secrets.AWS_SYMB_SECRET_ACCESS_KEY }} + sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: Package OBS Studio 📀 + if: github.repository == 'obsproject/obs-studio' uses: ./.github/actions/package-obs with: target: x64 @@ -373,7 +403,32 @@ jobs: package: ${{ fromJSON(needs.check-event.outputs.package) }} - name: Upload Artifacts 📡 + if: github.repository == 'obsproject/obs-studio' uses: actions/upload-artifact@v4 with: name: obs-studio-windows-x64-${{ needs.check-event.outputs.commitHash }} path: ${{ github.workspace }}/build_x64/obs-studio-*-windows-x64.zip + + - name: Get the version + id: get_version + run: | + $version = "${{ github.ref }}".Replace("refs/tags/", "") + echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + - name: Package OBS lib 🗜️ + run: 7z a -r ${{env.TARGET_ARTIFACT}}.7z ${{env.InstallPath}} + env: + TARGET_ARTIFACT: ${{ env.PACKAGE_NAME }}-${{ env.OS_TAG }}-${{ env.ReleaseName }}-${{ steps.get_version.outputs.VERSION }} + + - name: Configure AWS credentials + if: startsWith(github.ref, 'refs/tags/') + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}} + aws-secret-access-key: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}} + aws-region: us-west-2 + - name: Deploy + if: startsWith(github.ref, 'refs/tags/') + run: aws s3 cp ${{env.TARGET_ARTIFACT}}.7z s3://${{env.RELEASE_BUCKET}} --acl public-read + env: + TARGET_ARTIFACT: ${{ env.PACKAGE_NAME }}-${{ env.OS_TAG }}-${{ env.ReleaseName }}-${{ steps.get_version.outputs.VERSION }} + \ No newline at end of file diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 98474fd7d789de..00b59fa9f0b957 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -3,10 +3,10 @@ name: Clang Format Check 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 4743a48d39c1bb..9e64fdaae6b285 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,14 +4,12 @@ on: push: paths-ignore: ['**.md'] branches: - - "streamlabs" - - 'release/**' - tags: ['*'] + - "skippy" pull_request: paths-ignore: ['**.md'] - branches: ['streamlabs'] + branches: ['skippy'] merge_group: - branches: ['streamlabs'] + branches: ['skippy'] env: InstallPath: "packed_build" 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/.github/workflows/push.yaml b/.github/workflows/push.yaml index 4f2fb4d53fa759..7dea99be3934d8 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -6,6 +6,7 @@ on: - '**.md' branches: - master + - streamlabs - 'release/**' tags: - '*' diff --git a/CMakeLists.txt b/CMakeLists.txt index e1f62ff4fee1e5..6a79e3f74b031a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,22 @@ if(CMAKE_HOST_SYSTEM_NAME MATCHES "(Darwin)" OR OBS_CMAKE_VERSION VERSION_GREATE add_subdirectory(test/test-input) add_subdirectory(UI) + + if(WIN32) + include(FetchContent) + + # Compare current linked libs with prev + FetchContent_Declare(deps_checker URL "https://raw.githubusercontent.com/stream-labs/obs-studio-node/staging/dependency_checker/check_dependencies.cmd" DOWNLOAD_NO_EXTRACT true) + FetchContent_MakeAvailable(deps_checker) + + add_custom_target(check_dependencies COMMAND ${CMAKE_COMMAND} + "-Ddeps_checker_SOURCE_DIR=${deps_checker_SOURCE_DIR}" + "-Ddeps_CONFIGURATION=$" + "-Ddeps_CONFIG=$" + "-Ddeps_CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}" + + -P "${CMAKE_SOURCE_DIR}/slobs_CI/check_libraries.cmake" ) + endif() message_configuration() return() diff --git a/buildspec.json b/buildspec.json index 3af28c8ccf018e..623aad78795ecc 100644 --- a/buildspec.json +++ b/buildspec.json @@ -30,8 +30,8 @@ "baseUrl": "https://streamlabs-cef-dist.s3.us-west-2.amazonaws.com", "label": "Chromium Embedded Framework", "hashes": { - "macos-x86_64": "7ef71717ff2e4ff4212274c33f0993729f47c109c464e499544fd3f63586a069", - "macos-arm64": "a9da8909202aefc8f35509d03eff9a7c837b5d3b2ed3afb39b67121cb16d457b", + "macos-x86_64": "4B3AC2FF135C2858FE8ECAB19D936A0DD95D9374373946CB5528CB2FD8E0A89F", + "macos-arm64": "B554146651D8E3823A2708FC738F720CA9D373263D6896CF4B4A51E2DA82C439", "linux-x86_64": "bf4aa9388bab7e94fa945cc3bba16b6da63b6a30f9c0342d42235468b39d84bf", "linux-aarch64": "68d915c9ba2639cba762a54cd3430fce2527aa6355d831d3cfcb6157664206b0", "windows-x64": "7480e9ed5688e09919db67237d130eef9a4c24df32ba2a7b8a5587de45ff8e69" 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 39dd50616d3436..f754badf0a2cc3 100644 --- a/cmake/common/buildspec_common.cmake +++ b/cmake/common/buildspec_common.cmake @@ -221,8 +221,13 @@ function(_check_dependencies) "${dependencies_dir}/${destination}" CACHE PATH "CEF root directory" FORCE) elseif(dependency STREQUAL libmediasoupclient) - set(libmediasoupclient_subdir "libmediasoupclient_dist") - + if(WIN32) + set(libmediasoupclient_subdir "libmediasoupclient_dist") + else() + set(libmediasoupclient_subdir "libmediasoupclient-VERSION-osx-ARCH") + string(REPLACE "VERSION" "${version}" libmediasoupclient_subdir "${libmediasoupclient_subdir}") + string(REPLACE "ARCH" "${arch}" libmediasoupclient_subdir "${libmediasoupclient_subdir}") + endif() set(LIBMEDIASOUPCLIENT_PATH "${dependencies_dir}/${libmediasoupclient_subdir}" CACHE PATH "libmediasoupclient directory" FORCE) @@ -234,7 +239,13 @@ function(_check_dependencies) 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_dist") + if(WIN32) + set(webrtc_subdir "webrtc_dist") + elseif(APPLE) + set(webrtc_subdir "webrtc-VERSION-osx-ARCH") + string(REPLACE "VERSION" "${version}" webrtc_subdir "${webrtc_subdir}") + string(REPLACE "ARCH" "${arch}" webrtc_subdir "${webrtc_subdir}") + endif() set(WEBRTC_PATH "${dependencies_dir}/${webrtc_subdir}" diff --git a/cmake/macos/buildspec.cmake b/cmake/macos/buildspec.cmake index e11ac3920ecba2..e9ad0acb1c5465 100644 --- a/cmake/macos/buildspec.cmake +++ b/cmake/macos/buildspec.cmake @@ -18,15 +18,14 @@ function(_check_dependencies_macos) set(qt6_destination "obs-deps-qt6-VERSION-ARCH") set(cef_filename "cef_binary_VERSION_macos_ARCH_REVISION.tar.xz") set(cef_destination "cef_binary_VERSION_macos_ARCH") + set(libmediasoupclient_filename "libmediasoupclient-VERSION-osx-ARCH.zip") set(libmediasoupclient_destination "libmediasoupclient-VERSION-osx-ARCH") 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/dependencies/obs-websocket.dll.txt b/dependencies/obs-websocket.dll.txt new file mode 100644 index 0000000000000000000000000000000000000000..51814df4e796c5014cd6063d088a117a926f82fb GIT binary patch literal 1470 zcmb`HPfr3d5XIlw#P6_Qphnbq@Zg0QV-QqOITD0LiLgr+)bQoi-?Uldg)WDt>A&>N zn>X!re!dTNpo~_}mwuP&MoW$Ls+|2Bt2Oh6mF;ILwV;*y(p&|oOjAx)^un(SO*qN1 zy7*)M@5R=2EA;}-!CJvs;3cp)yslt5g3-Ly3Tr!?gKZ4)0N=TW@JxL)8+$-y5SZ|w7>7c+xEyjiX3X76ODAr7*pEOmHO&2-Zo;pa6YT8d$n|?<0!9TO~W1d zP84a3eLbP!k$mZ*B(RT|W6F2g#cV<@II_}mCFGqW%PQ{Q`MflQBTrh4*5gse`6}Mu zGI5T-JQ=I~DEmXHR8IVV`9xv3g*36-zn-9UkudT#aZkC;GFj}Y-^LVHD70#p>V0PL i*)6WMrCVKF?!j$!uCBsX;|Ap7k~T)))>lD8SpNm9mBPXR literal 0 HcmV?d00001 diff --git a/dependencies/win-openvr.dll.txt b/dependencies/win-openvr.dll.txt index 8044cb3e4acfbb584be3b453d1aa9d85d7e040c6..d23ea175d6877b64cb14e84588f5a75e0245042b 100644 GIT binary patch delta 23 fcmcb`x`=f{2jk=ejB=Arn1UwXV+@ #include #include -#include \ No newline at end of file +#include diff --git a/plugins/obs-browser b/plugins/obs-browser index 9a307be457ed42..800a9830601cbc 160000 --- a/plugins/obs-browser +++ b/plugins/obs-browser @@ -1 +1 @@ -Subproject commit 9a307be457ed429c0ad8535f9234f47cf928f098 +Subproject commit 800a9830601cbcd0f90493f3d876eaf1e0117f7a diff --git a/plugins/obs-openvr b/plugins/obs-openvr index d14a35ab694f05..830a9f003db04e 160000 --- a/plugins/obs-openvr +++ b/plugins/obs-openvr @@ -1 +1 @@ -Subproject commit d14a35ab694f05aeb5bf37763e309f64b9b1d630 +Subproject commit 830a9f003db04eeb8d8459613ee748f15320691a diff --git a/plugins/win-dshow/libdshowcapture b/plugins/win-dshow/libdshowcapture index 7d3f7873d9b6e8..792892659bdc55 160000 --- a/plugins/win-dshow/libdshowcapture +++ b/plugins/win-dshow/libdshowcapture @@ -1 +1 @@ -Subproject commit 7d3f7873d9b6e8c9fe72ed9d5a1f0ee529b3e93d +Subproject commit 792892659bdc55eaca85aad1c87ef484d737e7af From ddb87ba0b75cdae3c17d8f6efcdb0bb555ba7e6c Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Tue, 7 Jan 2025 21:07:26 -0800 Subject: [PATCH 5/5] fix install dev component --- .github/scripts/Build-Windows.ps1 | 5 ++ .github/workflows/build-project.yaml | 29 +++++++++-- cmake/Modules/CopyMSVCBins.cmake | 50 +++++++++--------- cmake/common/helpers_common.cmake | 76 +++++++++++++--------------- cmake/finders/FindFFmpeg.cmake | 56 +++++++++++++++++++- libobs/CMakeLists.txt | 18 +++---- libobs/cmake/os-windows.cmake | 47 ++++++++++++++++- plugins/CMakeLists.txt | 2 +- 8 files changed, 200 insertions(+), 83 deletions(-) diff --git a/.github/scripts/Build-Windows.ps1 b/.github/scripts/Build-Windows.ps1 index 34376665604475..df58dcfad8d4a3 100644 --- a/.github/scripts/Build-Windows.ps1 +++ b/.github/scripts/Build-Windows.ps1 @@ -89,11 +89,16 @@ function Build { Log-Group "Building obs-studio..." Invoke-External cmake @CmakeBuildArgs + Log-Group "Chech for changes in dependencies..." Invoke-External cmake @CmakeCheckArgs Log-Group "Installing obs-studio..." Invoke-External cmake @CmakeInstallArgs + Log-Group "Installing Development component..." + $CmakeInstallDevArgs = $CmakeInstallArgs + @('--component', 'Development') + Invoke-External cmake @CmakeInstallDevArgs + Pop-Location -Stack BuildTemp Log-Group } diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 83b30ad0b5de77..038923f4d74fb9 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -344,8 +344,9 @@ jobs: needs: check-event env: PACKAGE_NAME: libobs - OS_TAG: windows-x64 - InstallPath: "build_x64/install" + OS_TAG: windows64 + InstallDir: "install" + BuildDir: "build_x64" RELEASE_BUCKET: "obsstudios3.streamlabs.com" ReleaseName: release defaults: @@ -356,7 +357,24 @@ jobs: with: submodules: recursive fetch-depth: 0 - + - name: 'Add msbuild to PATH' + uses: microsoft/setup-msbuild@v1 + - name: Install build components + run: | + # For versions update see here: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022 + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + $componentsToInstall= @( + "Microsoft.VisualStudio.Component.VC.v141.x86.x64" + "Microsoft.VisualStudio.Component.VC.14.39.17.9.x86.x64" + "Microsoft.VisualStudio.Component.VC.14.39.17.9.ATL" + ) + [string]$workloadArgs = $componentsToInstall | ForEach-Object {" --add " + $_} + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') + # should be run twice + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + shell: powershell - uses: actions/cache@v4 id: ccache-cache if: github.event_name == 'pull_request' @@ -415,7 +433,10 @@ jobs: $version = "${{ github.ref }}".Replace("refs/tags/", "") echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - name: Package OBS lib 🗜️ - run: 7z a -r ${{env.TARGET_ARTIFACT}}.7z ${{env.InstallPath}} + run: | + cd ${{env.BuildDir}} + 7z a -r ../${{env.TARGET_ARTIFACT}}.7z ${{env.InstallDir}} + cd .. env: TARGET_ARTIFACT: ${{ env.PACKAGE_NAME }}-${{ env.OS_TAG }}-${{ env.ReleaseName }}-${{ steps.get_version.outputs.VERSION }} diff --git a/cmake/Modules/CopyMSVCBins.cmake b/cmake/Modules/CopyMSVCBins.cmake index 93c413cfe853ec..0d991739f16f31 100644 --- a/cmake/Modules/CopyMSVCBins.cmake +++ b/cmake/Modules/CopyMSVCBins.cmake @@ -172,8 +172,8 @@ set(QtCore_DIR "${Qt6Core_DIR}") cmake_path(SET QtCore_DIR_NORM NORMALIZE "${QtCore_DIR}/../../..") set(QtCore_BIN_DIR "${QtCore_DIR_NORM}bin") set(QtCore_PLUGIN_DIR "${QtCore_DIR_NORM}plugins") -obs_status(STATUS "QtCore_BIN_DIR: ${QtCore_BIN_DIR}") -obs_status(STATUS "QtCore_PLUGIN_DIR: ${QtCore_PLUGIN_DIR}") +message(STATUS "QtCore_BIN_DIR: ${QtCore_BIN_DIR}") +message(STATUS "QtCore_PLUGIN_DIR: ${QtCore_PLUGIN_DIR}") file( GLOB @@ -265,39 +265,39 @@ foreach( endif() endforeach() -obs_status(STATUS "FFmpeg files: ${FFMPEG_BIN_FILES}") -obs_status(STATUS "x264 files: ${X264_BIN_FILES}") -obs_status(STATUS "Libfdk files: ${LIBFDK_BIN_FILES}") -obs_status(STATUS "Freetype files: ${FREETYPE_BIN_FILES}") -obs_status(STATUS "rnnoise files: ${RNNOISE_BIN_FILES}") -obs_status(STATUS "curl files: ${CURL_BIN_FILES}") -obs_status(STATUS "lua files: ${LUA_BIN_FILES}") -obs_status(STATUS "ssl files: ${SSL_BIN_FILES}") -obs_status(STATUS "zlib files: ${ZLIB_BIN_FILES}") -obs_status(STATUS "Qt Debug files: ${QT_DEBUG_BIN_FILES}") -obs_status(STATUS "Qt Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}") -obs_status(STATUS "Qt Debug Styles files: ${QT_DEBUG_STYLES_BIN_FILES}") -obs_status(STATUS "Qt Debug Iconengine files: ${QT_DEBUG_ICONENGINE_BIN_FILES}") -obs_status(STATUS "Qt Debug Imageformat files: ${QT_DEBUG_IMAGEFORMATS_BIN_FILES}") -obs_status(STATUS "Qt Release files: ${QT_BIN_FILES}") -obs_status(STATUS "Qt Release Platform files: ${QT_PLAT_BIN_FILES}") -obs_status(STATUS "Qt Release Styles files: ${QT_STYLES_BIN_FILES}") -obs_status(STATUS "Qt Release Iconengine files: ${QT_ICONENGINE_BIN_FILES}") -obs_status(STATUS "Qt Release Imageformat files: ${QT_IMAGEFORMATS_BIN_FILES}") -obs_status(STATUS "Qt ICU files: ${QT_ICU_BIN_FILES}") +message(STATUS "FFmpeg files: ${FFMPEG_BIN_FILES}") +message(STATUS "x264 files: ${X264_BIN_FILES}") +message(STATUS "Libfdk files: ${LIBFDK_BIN_FILES}") +message(STATUS "Freetype files: ${FREETYPE_BIN_FILES}") +message(STATUS "rnnoise files: ${RNNOISE_BIN_FILES}") +message(STATUS "curl files: ${CURL_BIN_FILES}") +message(STATUS "lua files: ${LUA_BIN_FILES}") +message(STATUS "ssl files: ${SSL_BIN_FILES}") +message(STATUS "zlib files: ${ZLIB_BIN_FILES}") +message(STATUS "Qt Debug files: ${QT_DEBUG_BIN_FILES}") +message(STATUS "Qt Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}") +message(STATUS "Qt Debug Styles files: ${QT_DEBUG_STYLES_BIN_FILES}") +message(STATUS "Qt Debug Iconengine files: ${QT_DEBUG_ICONENGINE_BIN_FILES}") +message(STATUS "Qt Debug Imageformat files: ${QT_DEBUG_IMAGEFORMATS_BIN_FILES}") +message(STATUS "Qt Release files: ${QT_BIN_FILES}") +message(STATUS "Qt Release Platform files: ${QT_PLAT_BIN_FILES}") +message(STATUS "Qt Release Styles files: ${QT_STYLES_BIN_FILES}") +message(STATUS "Qt Release Iconengine files: ${QT_ICONENGINE_BIN_FILES}") +message(STATUS "Qt Release Imageformat files: ${QT_IMAGEFORMATS_BIN_FILES}") +message(STATUS "Qt ICU files: ${QT_ICU_BIN_FILES}") foreach(BinFile ${ALL_BASE_BIN_FILES}) - obs_status(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}") + message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}") file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/") endforeach() foreach(BinFile ${ALL_REL_BIN_FILES}) - obs_status(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r") + message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r") file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/") endforeach() foreach(BinFile ${ALL_DBG_BIN_FILES}) - obs_status(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d") + message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d") file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/") endforeach() diff --git a/cmake/common/helpers_common.cmake b/cmake/common/helpers_common.cmake index 035c4ea025b0a5..8ceb64cd9b8c7e 100644 --- a/cmake/common/helpers_common.cmake +++ b/cmake/common/helpers_common.cmake @@ -304,8 +304,7 @@ endfunction() # target_export: Helper function to export target as CMake package function(target_export target) if(NOT DEFINED exclude_variant) - #set(exclude_variant EXCLUDE_FROM_ALL ) - set(exclude_variant "") + set(exclude_variant EXCLUDE_FROM_ALL) endif() get_target_property(is_framework ${target} FRAMEWORK) @@ -313,31 +312,24 @@ function(target_export target) set(package_destination "Frameworks/${target}.framework/Resources/cmake") set(include_destination "Frameworks/${target}.framework/Headers") else() - set(package_destination "${OBS_CMAKE_DESTINATION}/${target}") + if(OS_WINDOWS) + set(package_destination "${OBS_CMAKE_DESTINATION}") + else() + set(package_destination "${OBS_CMAKE_DESTINATION}/${target}") + endif() set(include_destination "${OBS_INCLUDE_DESTINATION}") endif() install( TARGETS ${target} EXPORT ${target}Targets - RUNTIME DESTINATION "${OBS_EXECUTABLE_DESTINATION}" - COMPONENT Development - ${exclude_variant} - LIBRARY DESTINATION "${OBS_LIBRARY_DESTINATION}" - COMPONENT Development - ${exclude_variant} - ARCHIVE DESTINATION "${OBS_LIBRARY_DESTINATION}" - COMPONENT Development - ${exclude_variant} - FRAMEWORK DESTINATION Frameworks - COMPONENT Development - ${exclude_variant} - INCLUDES - DESTINATION "${include_destination}" - PUBLIC_HEADER - DESTINATION "${include_destination}" - COMPONENT Development - ${exclude_variant}) + RUNTIME DESTINATION "${OBS_EXECUTABLE_DESTINATION}" COMPONENT Development ${exclude_variant} + LIBRARY DESTINATION "${OBS_LIBRARY_DESTINATION}" COMPONENT Development ${exclude_variant} + ARCHIVE DESTINATION "${OBS_LIBRARY_DESTINATION}" COMPONENT Development ${exclude_variant} + FRAMEWORK DESTINATION Frameworks COMPONENT Development ${exclude_variant} + INCLUDES DESTINATION "${include_destination}" + PUBLIC_HEADER DESTINATION "${include_destination}" COMPONENT Development ${exclude_variant} + ) get_target_property(obs_public_headers ${target} OBS_PUBLIC_HEADERS) @@ -355,19 +347,17 @@ function(target_export target) endforeach() foreach(header_dir IN LISTS header_dirs) + message(STATUS "Exporting public headers dir ${header_dir}") install( FILES ${headers_${header_dir}} DESTINATION "${include_destination}/${header_dir}" COMPONENT Development - ${exclude_variant}) + ${exclude_variant} + ) endforeach() if(headers) - install( - FILES ${headers} - DESTINATION "${include_destination}" - COMPONENT Development - ${exclude_variant}) + install(FILES ${headers} DESTINATION "${include_destination}" COMPONENT Development ${exclude_variant}) endif() endif() @@ -376,7 +366,8 @@ function(target_export target) FILES "${CMAKE_BINARY_DIR}/config/obsconfig.h" DESTINATION "${include_destination}" COMPONENT Development - ${exclude_variant}) + ${exclude_variant} + ) endif() get_target_property(target_type ${target} TYPE) @@ -387,30 +378,29 @@ function(target_export target) generate_export_header(${target} EXPORT_FILE_NAME "${target}_EXPORT.h") target_sources(${target} PUBLIC $) - set_property( - TARGET ${target} - APPEND - PROPERTY PUBLIC_HEADER "${target}_EXPORT.h") + set_property(TARGET ${target} APPEND PROPERTY PUBLIC_HEADER "${target}_EXPORT.h") endif() set(TARGETS_EXPORT_NAME ${target}Targets) message( DEBUG - "Generating CMake package configuration file ${target}Config.cmake with targets file ${TARGETS_EXPORT_NAME}...") + "Generating CMake package configuration file ${target}Config.cmake with targets file ${TARGETS_EXPORT_NAME}..." + ) include(CMakePackageConfigHelpers) - configure_package_config_file(cmake/${target}Config.cmake.in ${target}Config.cmake - INSTALL_DESTINATION "${package_destination}") + configure_package_config_file( + cmake/${target}Config.cmake.in + ${target}Config.cmake + INSTALL_DESTINATION "${package_destination}" + ) message(DEBUG "Generating CMake package version configuration file ${target}ConfigVersion.cmake...") write_basic_package_version_file( "${target}ConfigVersion.cmake" VERSION ${OBS_VERSION_CANONICAL} - COMPATIBILITY SameMajorVersion) + COMPATIBILITY SameMajorVersion + ) - export( - EXPORT ${target}Targets - FILE "${TARGETS_EXPORT_NAME}.cmake" - NAMESPACE OBS::) + export(EXPORT ${target}Targets FILE "${TARGETS_EXPORT_NAME}.cmake" NAMESPACE OBS::) export(PACKAGE ${target}) @@ -420,13 +410,15 @@ function(target_export target) NAMESPACE OBS:: DESTINATION "${package_destination}" COMPONENT Development - ${exclude_variant}) + ${exclude_variant} + ) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake" DESTINATION "${package_destination}" COMPONENT Development - ${exclude_variant}) + ${exclude_variant} + ) endfunction() # check_uuid: Helper function to check for valid UUID diff --git a/cmake/finders/FindFFmpeg.cmake b/cmake/finders/FindFFmpeg.cmake index e4e746915971f9..97df59ad70c226 100644 --- a/cmake/finders/FindFFmpeg.cmake +++ b/cmake/finders/FindFFmpeg.cmake @@ -189,6 +189,24 @@ macro(FFmpeg_find_dll) set(FFmpeg_${component}_LIBRARY "${FFmpeg_${component}_IMPLIB}") endif() + if(NOT FFmpeg_FFMPEG_EXECUTABLE) + find_program( + FFmpeg_FFMPEG_EXECUTABLE + NAMES ffmpeg.exe + HINTS ${_implib_path} ${_bin_path} + DOC "Path to ffmpeg.exe" + ) + endif() + + if(NOT FFmpeg_FFPROBE_EXECUTABLE) + find_program( + FFmpeg_FFPROBE_EXECUTABLE + NAMES ffprobe.exe + HINTS ${_implib_path} ${_bin_path} + DOC "Path to ffprobe.exe" + ) + endif() + unset(_implib_path) unset(_bin_path) unset(_dll_version) @@ -275,6 +293,42 @@ if(NOT FFmpeg_avutil_FOUND) ffmpeg_find_component(avutil) endif() +if(NOT WIN32) + if(NOT FFmpeg_FFMPEG_EXECUTABLE) + find_program( + FFmpeg_FFMPEG_EXECUTABLE + NAMES ffmpeg + DOC "Path to ffmpeg (non-Windows fallback)" + ) + endif() + + if(NOT FFmpeg_FFPROBE_EXECUTABLE) + find_program( + FFmpeg_FFPROBE_EXECUTABLE + NAMES ffprobe + DOC "Path to ffprobe (non-Windows fallback)" + ) + endif() +endif() + +if(FFmpeg_FFMPEG_EXECUTABLE AND NOT TARGET FFmpeg::ffmpegexe) + add_executable(FFmpeg::ffmpegexe IMPORTED) + set_target_properties(FFmpeg::ffmpegexe + PROPERTIES + IMPORTED_LOCATION "${FFmpeg_FFMPEG_EXECUTABLE}" + ) +endif() + +if(FFmpeg_FFPROBE_EXECUTABLE AND NOT TARGET FFmpeg::ffprobeexe) + add_executable(FFmpeg::ffprobeexe IMPORTED) + set_target_properties(FFmpeg::ffprobeexe + PROPERTIES + IMPORTED_LOCATION "${FFmpeg_FFPROBE_EXECUTABLE}" + ) +endif() + +mark_as_advanced(FFmpeg_FFMPEG_EXECUTABLE FFmpeg_FFPROBE_EXECUTABLE) + if(EXISTS "${FFmpeg_avutil_INCLUDE_DIR}/libavutil/ffversion.h") file(STRINGS "${FFmpeg_avutil_INCLUDE_DIR}/libavutil/ffversion.h" _version_string REGEX "^.*FFMPEG_VERSION[ \t]+\"n?[0-9a-z\\~.-]+\"[ \t]*$") @@ -342,4 +396,4 @@ include(FeatureSummary) set_package_properties( FFmpeg PROPERTIES URL "https://www.ffmpeg.org" - DESCRIPTION "A complete, cross-platform solution to record, convert and stream audio and video.") + DESCRIPTION "A complete, cross-platform solution to record, convert, and stream audio/video.") diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index f24aff8a5ad8f7..fe9445f0f7670a 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -382,15 +382,15 @@ if(OS_WINDOWS) list( APPEND public_headers - ${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) + 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) elseif(OS_MACOS) list(APPEND public_headers util/apple/cfstring-utils.h) endif() diff --git a/libobs/cmake/os-windows.cmake b/libobs/cmake/os-windows.cmake index 362d935a4ad694..9961956c1f9c46 100644 --- a/libobs/cmake/os-windows.cmake +++ b/libobs/cmake/os-windows.cmake @@ -47,7 +47,7 @@ target_include_directories( libobs PUBLIC $ - $ +# $ ) target_compile_options(libobs PRIVATE $<$:/EHc->) @@ -70,3 +70,48 @@ target_link_libraries( target_link_options(libobs PRIVATE /IGNORE:4098 /SAFESEH:NO) set_target_properties(libobs PROPERTIES PREFIX "" OUTPUT_NAME "obs") + +find_package(LibDataChannel 0.20 REQUIRED) + +if(NOT ENABLE_UI) + set(DEPENDENCY_DLLS + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + + "$/../bin/zlib.dll" + "$/../bin/librist.dll" + "$/../bin/srt.dll" + + "$/../bin/libcurl.dll" + "$/../bin/datachannel.dll" + ) + + set(DEPENDENCY_LIBS + $ + $ + $ + $ + $ + ) + + # foreach(DEP_BINARY ${DEPENDENCY_DLLS}) + # message(STATUS "Adding custom command to copy ${DEP_BINARY} to ${OBS_EXECUTABLE_DESTINATION}") + + # add_custom_command(TARGET libobs POST_BUILD + # COMMAND "${CMAKE_COMMAND}" -E echo "Copying dependencies binaries ${DEP_BINARY} to ${OBS_EXECUTABLE_DESTINATION}" + # COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DEP_BINARY}" "${OBS_EXECUTABLE_DESTINATION}" + # COMMENT "." + # VERBATIM COMMAND_EXPAND_LISTS + # ) + # endforeach() + install(FILES ${DEPENDENCY_DLLS} DESTINATION ${OBS_EXECUTABLE_DESTINATION}) + install(FILES ${DEPENDENCY_LIBS} DESTINATION ${OBS_LIBRARY_DESTINATION}) +endif() diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 9fa2738011b3ec..f8a3de4aea2361 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -64,7 +64,7 @@ if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0) add_obs_plugin(sl-vst PLATFORMS WINDOWS WITH_MESSAGE) add_obs_plugin(obs-webrtc) - check_obs_websocket() + #check_obs_websocket() add_obs_plugin(obs-x264) add_obs_plugin(oss-audio PLATFORMS FREEBSD OPENBSD)