Skip to content

Commit

Permalink
Merge pull request #44 from Off-World-Live/feature/upgrade-for-28
Browse files Browse the repository at this point in the history
Upgrade Plugin for OBS 28 release candidate
  • Loading branch information
campbellwmorgan authored Aug 22, 2022
2 parents 51c8411 + ca63955 commit a8f3e2a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@
*.app

deps
manual-install-*
manual-install-*
*.zip
win-spout-installer.versioned.nsi
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ set(OBS_FRONTEND_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/UI/obs-frontend-api")
set(OBS_FRONTEND_LIB "${CMAKE_BINARY_DIR}/UI/obs-frontend-api/$<CONFIGURATION>/obs-frontend-api.lib")
set(PTHREAD_LIB "${CMAKE_BINARY_DIR}/deps/w32-pthreads/$<CONFIGURATION>/w32-pthreads.lib")

find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_qt(COMPONENTS Core Widgets)

if(MSVC)
include_directories(deps/Spout2/SPOUTSDK/SpoutLibrary)
Expand All @@ -43,6 +42,7 @@ add_library(win-spout MODULE
${win-spout_SOURCES}
${win-spout_HEADERS})


include_directories(
${OBS_FRONTEND_INCLUDE_DIR}
${LIBOBS_INCLUDE_DIR}
Expand All @@ -56,9 +56,10 @@ target_link_libraries(win-spout
${OBS_FRONTEND_LIB}
${PTHREAD_LIB}
${LIBOBS_LIB}
Qt5::Core
Qt5::Widgets
${SPOUTDX_LIB})
${SPOUTDX_LIB}
Qt::Core
Qt::Widgets
)

function(copy_spout_file)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand Down Expand Up @@ -103,6 +104,6 @@ function(copy_spout_file)
)
endfunction()

install_obs_plugin_with_data(win-spout data)
setup_plugin_target(win-spout)
copy_spout_file()

17 changes: 14 additions & 3 deletions scripts/Release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ echo ""
echo "*** Build Plugin for Release -- Root Dir $OBS_ROOT_DIR ***"
echo ""

MSBUILD_PATH="c:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe"
MSBUILD_PATH="C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe"
SEVENZIP_PATH="C:/Program Files/7-Zip/7z.exe"
SOLUTION="$OBS_ROOT_DIR/build64/plugins/win-spout/win-spout.sln"
BUILD_ARGS="/target:Rebuild /property:Configuration=Release /maxcpucount:8 /verbosity:quiet /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly"

Expand Down Expand Up @@ -57,11 +58,21 @@ echo ""

NSI_FILE="$SCRIPTS_DIR/../win-spout-installer.nsi"

sed -i 's/^!define APPVERSION .*$/!define APPVERSION "'$VERSION'"/' $NSI_FILE
NSI_COPIED="$SCRIPTS_DIR/../win-spout-installer.versioned.nsi"
cp $NSI_FILE $NSI_COPIED
sed -i 's/^!define APPVERSION .*$/!define APPVERSION "'$VERSION'"/' $NSI_COPIED

MAKENSIS_PATH="c:/Program Files (x86)/NSIS/makensis.exe"

"$MAKENSIS_PATH" $NSI_FILE
"$MAKENSIS_PATH" $NSI_COPIED

echo ""
echo "*** Generating Manual Install Zip file ***"

ZIPFILE="$SCRIPTS_DIR/../OBS_Spout2_Plugin_ManualInstall_v$VERSION.zip"
cd "$MANUAL_INSTALL_PLUGIN_DIR"
"$SEVENZIP_PATH" a -tZIP "$ZIPFILE" "./*"
cd -

echo ""
echo "*** Release Finished ***"
Expand Down
2 changes: 1 addition & 1 deletion source/win-spout-source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void win_spout_source_init(void *data, bool forced = false)

obs_enter_graphics();
gs_texture_destroy(context->texture);
context->texture = gs_texture_open_shared((uint32_t)context->dxHandle);
context->texture = gs_texture_open_shared((uint32_t)(uintptr_t)context->dxHandle);
obs_leave_graphics();

context->initialized = true;
Expand Down
2 changes: 1 addition & 1 deletion win-spout-installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Unicode True

; Define your application name
!define APPNAME "Spout 2 OBS Plugin"
!define APPVERSION "1.3"
!define APPVERSION "DebugVersion"
!define APPNAMEANDVERSION "Spout 2 OBS Plugin ${APPVERSION}"

; Main Install settings
Expand Down

0 comments on commit a8f3e2a

Please sign in to comment.