diff --git a/CMakeLists.txt b/CMakeLists.txt index bcecbab..106f8e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,19 +112,19 @@ target_include_directories( set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name}) -if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - if(NOT buildspec) - file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec) - endif() - string( - JSON - qtversion - GET - ${buildspec} - dependencies - qt6 - version) +if(NOT buildspec) + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec) +endif() +string( + JSON + qtversion + GET + ${buildspec} + dependencies + qt6 + version) +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") install( FILES "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-x64/bin/Qt6WebSockets.dll" CONFIGURATIONS RelWithDebInfo Debug Release @@ -135,4 +135,15 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") CONFIGURATIONS RelWithDebInfo Debug Release DESTINATION bin/64bit OPTIONAL) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + install( + DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/lib/QtWebSockets.framework" + CONFIGURATIONS RelWithDebInfo Debug Release + DESTINATION "${CMAKE_PROJECT_NAME}.plugin/Contents/Frameworks" + OPTIONAL) + install( + DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/plugins/tls" + CONFIGURATIONS RelWithDebInfo Debug Release + DESTINATION "${CMAKE_PROJECT_NAME}.plugin/Contents/Frameworks" + OPTIONAL) endif() diff --git a/cmake/macos/xcode.cmake b/cmake/macos/xcode.cmake index 3b4184c..20673cc 100644 --- a/cmake/macos/xcode.cmake +++ b/cmake/macos/xcode.cmake @@ -171,4 +171,4 @@ set(CMAKE_COLOR_DIAGNOSTICS TRUE) # Disable usage of RPATH in build or install configurations set(CMAKE_SKIP_RPATH TRUE) # Have Xcode set default RPATH entries -set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks") +set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @loader_path/../Frameworks") diff --git a/src/outputs/egress-link-output.cpp b/src/outputs/egress-link-output.cpp index 9791d53..de3cc32 100644 --- a/src/outputs/egress-link-output.cpp +++ b/src/outputs/egress-link-output.cpp @@ -313,9 +313,10 @@ obs_properties_t *EgressLinkOutput::getProperties() _videoEncoderGroup, "video_encoder_settings_group", obs_encoder_get_display_name(_encoderId), OBS_GROUP_NORMAL, encoderProps ); - } - obs_properties_apply_settings(_videoEncoderGroup, _settings); + // Do not apply to _videoEncoderGroup because it will cause memoryleak. + obs_properties_apply_settings(encoderProps, _settings); + } obs_log(LOG_DEBUG, "%s: Video encoder changed", qUtf8Printable(_output->getName())); return true; diff --git a/src/plugin-main.cpp b/src/plugin-main.cpp index 4baff3e..9f5e8dc 100644 --- a/src/plugin-main.cpp +++ b/src/plugin-main.cpp @@ -22,6 +22,7 @@ with this program. If not, see #include #include #include +#include #include #include @@ -79,6 +80,12 @@ void frontendEventCallback(enum obs_frontend_event event, void *) bool obs_module_load(void) { +#ifdef __APPLE__ + QFileInfo moduleFile(obs_get_module_binary_path(obs_current_module())); + auto libraryPath = QString("%1/../Frameworks").arg(moduleFile.dir().path()); + QCoreApplication::addLibraryPath(libraryPath); +#endif + apiClient = new SRCLinkApiClient(); obs_frontend_add_event_callback(frontendEventCallback, nullptr);