Skip to content

Commit

Permalink
Windows ARM64: Initial support
Browse files Browse the repository at this point in the history
CI: Add GitHub Action Windows ARM64 CI

This mega commit also includes the changes from the following PR:

cmake: Add DISABLE_QSV11 option to disable QSV encoder #4748

libobs: Restrict emmintrin.h to x86(_64) platform #4746

Resolve potential symbol clash on MSVC #4743

obs-filters: Add preprocessor guard to method #4730

Windows ARM64: Initial support

CI: Add GitHub Action Windows ARM64 CI

This mega commit also includes the changes from the following PR:

cmake: Add DISABLE_QSV11 option to disable QSV encoder #4748

libobs: Restrict emmintrin.h to x86(_64) platform #4746

Resolve potential symbol clash on MSVC #4743

obs-filters: Add preprocessor guard to method #4730

obs-qsv11: Add ENABLE_QSV11 option

obs-qsv11: Add ENABLE_QSV11 option
  • Loading branch information
tommyvct committed Oct 5, 2021
1 parent 3c14e4e commit 4b4710e
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 4 deletions.
66 changes: 64 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ on:
paths-ignore:
- '**.md'
branches:
- master
- '**'
- '*'
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'
branches:
- master
- '**'
- '*'

env:
MACOS_CEF_BUILD_VERSION: '4183'
Expand Down Expand Up @@ -690,3 +692,63 @@ jobs:
with:
name: '${{ env.FILE_NAME }}'
path: build/*
winarm64:
name: 'Windows on ARM64'
runs-on: [windows-latest]
env:
QT_VERSION: '5.15.2'
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_SYSTEM_VERSION: "10.0.18363.657"
VIRTUALCAM-GUID: "A3FCE0F5-3493-419F-958A-ABA1250EC20B"
steps:
- name: 'Add msbuild to PATH'
uses: microsoft/[email protected]
- name: 'Checkout'
uses: actions/[email protected]
with:
submodules: 'recursive'
- name: 'Fetch Git Tags'
shell: bash
run: |
git fetch --prune --unshallow
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Check for Github Labels'
if: github.event_name == 'pull_request'
shell: bash
run: |
LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')"
LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)"
if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then
echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
else
echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
fi
- name: 'Install prerequisite: Pre-built dependencies'
run: |
curl -kL https://github.com/tommyvct/obs-deps/releases/latest/download/DepsARM64.zip -f --retry 5 -o DepsARM64.zip
7z x DepsARM64.zip -o"${{ github.workspace }}/cmbuild/"
- name: "Configure"
run: |
mkdir ./build64
cd ./build64
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"ARM64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=true -DCOMPILE_D3D12_HOOK=true -DDepsPath="${{ github.workspace }}/cmbuild/DepsARM64" -DQTDIR="${{ github.workspace }}/cmbuild/DepsARM64/qt/" -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/DepsARM64/cef" -DPYTHON_LIB="${{ github.workspace }}/cmbuild/DepsARM64/bin/python39.lib" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE -DVIRTUALCAM_GUID=${{ env.VIRTUALCAM-GUID }} -DBUILD_AMD_ENCODER=OFF -DENABLE_SCRIPTING=ON -DCOMPILE_PYTHON=ON -DDISABLE_QSV11=ON -DVULKAN_INCLUDE_DIR="${{ github.workspace }}/cmbuild/DepsARM64/VulkanSDK/include" -DVULKAN_LIB="${{ github.workspace }}/cmbuild/DepsARM64/VulkanSDK/vulkan-1.lib" ..
- name: 'Build'
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-studio.sln
- name: 'Package'
if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1')
run: |
$env:FILE_DATE=(Get-Date -UFormat "%F")
$env:FILE_NAME="${env:FILE_DATE}-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-windows_arm64"
echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV}
robocopy .\build64\rundir\RelWithDebInfo .\build\ /E /XF .gitignore
7z
- name: 'Publish'
if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1')
uses: actions/[email protected]
with:
name: '${{ env.FILE_NAME }}'
path: build/*


4 changes: 4 additions & 0 deletions cmake/Modules/CopyMSVCBins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ file(GLOB FFMPEG_BIN_FILES
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avresample-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avresample-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avresample-*.dll"


"${FFMPEG_postproc_INCLUDE_DIR}/../bin/postproc-*.dll"
"${FFMPEG_postproc_INCLUDE_DIR}/../bin${_bin_suffix}/postproc-*.dll"
Expand Down
2 changes: 1 addition & 1 deletion deps/w32-pthreads/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define PTW32_PROGCTR(Context) ((Context).Rip)
#endif

#if defined(_ARM_) || defined(ARM)
#if defined(_ARM_) || defined(ARM) || defined(_M_ARM) || defined(_M_ARM64)
#define PTW32_PROGCTR(Context) ((Context).Pc)
#endif

Expand Down
8 changes: 7 additions & 1 deletion libobs/obs-win-crash-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ static inline bool get_dbghelp_imports(struct exception_handler_data *data)

static inline void init_instruction_data(struct stack_trace *trace)
{
#ifdef _WIN64
#if defined(_M_ARM64)
trace->instruction_ptr = trace->context.Pc;
trace->frame.AddrPC.Offset = trace->instruction_ptr;
trace->frame.AddrFrame.Offset = trace->context.Fp;
trace->frame.AddrStack.Offset = trace->context.Sp;
trace->image_type = IMAGE_FILE_MACHINE_ARM64;
#elif defined(_WIN64)
trace->instruction_ptr = trace->context.Rip;
trace->frame.AddrPC.Offset = trace->instruction_ptr;
trace->frame.AddrFrame.Offset = trace->context.Rbp;
Expand Down
2 changes: 2 additions & 0 deletions plugins/obs-filters/noise-suppress-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,9 +1022,11 @@ static obs_properties_t *noise_suppress_properties(void *data)
TEXT_NVAFX_INTENSITY, 0.0f, 1.0f,
0.01f);

#if defined(LIBRNNOISE_ENABLED) && defined(LIBSPEEXDSP_ENABLED)
if (!nvafx_loaded) {
obs_property_list_item_disable(method, 2, true);
}
#endif

#endif
return ppts;
Expand Down
7 changes: 7 additions & 0 deletions plugins/obs-qsv11/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
option(ENABLE_QSV11 "Build Intel QSV11 hardware encoder." TRUE)

if(NOT ENABLE_QSV11)
message(STATUS "NOT building Intel QSV Encoder.")
return()
endif()

project(obs-qsv11)

include_directories(libmfx/include/msdk/include)
Expand Down

0 comments on commit 4b4710e

Please sign in to comment.