diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 972519c..ec37378 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,56 +2,66 @@ name: CI on: push: + branches: + - main + - master + tags: + - '*' pull_request: +env: + VLC_VERSION: 3.0.17 + UWP_LIBVLC_BUILD_FLAGS: -z -r -u -w + jobs: - LibVLC_iOS_NuGet: - if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id - runs-on: macos-latest + libvlc: + runs-on: ubuntu-latest + container: + image: registry.videolan.org/vlc-debian-llvm-uwp:20211020111246 + options: -u root + strategy: + matrix: + arch: [x86, x64, arm] + include: + - arch: x86 + short-arch: win32 + host-arch: i686 + - arch: x64 + short-arch: win64 + host-arch: x86_64 + - arch: arm + short-arch: winarm + host-arch: armv7 + env: + SHORTARCH: ${{ matrix.short-arch }} + HOST_ARCH: ${{ matrix.host-arch }} + TRIPLET: ${{ matrix.host-arch }}-w64-mingw32 steps: - name: Checkout - uses: actions/checkout@v2 - - name: LibVLC iOS build - shell: bash - run: | - git clone https://github.com/videolan/vlckit - cd vlckit && git checkout 3.0 - ./buildMobileVLCKit.sh -f - - patchBinary () { - install_name_tool -id @rpath/DynamicMobileVLCKit.framework/DynamicMobileVLCKit MobileVLCKit - defaults write $(pwd)/Info.plist CFBundleExecutable -string DynamicMobileVLCKit - defaults write $(pwd)/Info.plist CFBundleName -string DynamicMobileVLCKit - defaults write $(pwd)/Info.plist CFBundleIdentifier -string org.videolan.DynamicMobileVLCKit - mv MobileVLCKit DynamicMobileVLCKit - cd .. - mv MobileVLCKit.framework DynamicMobileVLCKit.framework - cd .. - } - - cd build/MobileVLCKit.xcframework/ios-arm64_armv7_armv7s/MobileVLCKit.framework - patchBinary - cd ios-arm64_i386_x86_64-simulator/MobileVLCKit.framework - patchBinary - mkdir -p $GITHUB_WORKSPACE/build/ios-device - mkdir -p $GITHUB_WORKSPACE/build/ios-simulator - mv ios-arm64_armv7_armv7s/DynamicMobileVLCKit.framework $GITHUB_WORKSPACE/build/ios-device - mv ios-arm64_i386_x86_64-simulator/DynamicMobileVLCKit.framework $GITHUB_WORKSPACE/build/ios-simulator - - name: Setup NuGet - uses: nuget/setup-nuget@v1 + uses: actions/checkout@v3 with: - nuget-version: '5.x' - - name: Create LibVLC iOS NuGet package + submodules: true + - name: Apply patches run: | - nuget pack VideoLAN.LibVLC.iOS.nuspec - - name: Upload build - uses: actions/upload-artifact@v2 + cd vlc + git config --global user.email "cone@example.com" + git config --global user.name "Cony Cone" + git am -3 ../patches/*.patch + if [ $? -ne 0 ]; then + git am --abort + echo "Applying the patches failed, aborting git-am" + exit 1 + fi + - name: Build + run: vlc/extras/package/win32/build.sh -c -a ${{ matrix.host-arch }} $UWP_LIBVLC_BUILD_FLAGS + - name: Upload artifact + uses: actions/upload-artifact@v3 with: - name: libvlc-ios-build - path: ./*.nupkg + name: libvlc-${{ matrix.arch }} + path: ${{ matrix.short-arch }}-uwp/vlc-${{ env.VLC_VERSION }}-*.7z + if-no-files-found: error UWP_access_v3: - if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id strategy: matrix: arch: [x64, x86, arm] @@ -63,18 +73,14 @@ jobs: git clone https://code.videolan.org/mfkl/vlc-winrt && cd vlc-winrt && git checkout uwp-access-v3 mkdir -p libvlc/Universal/vlc-${{ matrix.arch }}/Release - name: Download VLC headers - uses: azure/powershell@v1 - with: - inlineScript: | - Invoke-WebRequest -Uri "https://code.videolan.org/videolan/vlc/-/archive/3.0.x/vlc-3.0.x.zip" -OutFile "vlc-3.0.x.zip" - azPSVersion : '3.1.0' + run: Invoke-WebRequest -Uri "https://code.videolan.org/videolan/vlc/-/archive/3.0.x/vlc-3.0.x.zip" -OutFile "vlc-3.0.x.zip" - name: Extract LibVLC shell: bash run: | 7z x vlc-3.0.x.zip -ovlc mv vlc/vlc-3.0.x/include vlc-winrt/libvlc/Universal/vlc-${{ matrix.arch }}/Release - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.0.3 + uses: microsoft/setup-msbuild@v1.3 - name: MSBuild x64/ARM if: matrix.arch != 'x86' working-directory: vlc-winrt/modules/libaccess_winrt_plugin.UWP @@ -84,21 +90,25 @@ jobs: working-directory: vlc-winrt/modules/libaccess_winrt_plugin.UWP run: msbuild libaccess_winrt_plugin.UWP.vcxproj /p:Configuration=Release /p:Platform=Win32 - name: Upload build - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: libvlc-uwp-access-build-${{ matrix.arch }} path: vlc-winrt/modules/libaccess_winrt_plugin.UWP/Release/libaccess_winrt_plugin.UWP + if-no-files-found: error UWP_NuGet: - if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id runs-on: ubuntu-latest - needs: UWP_access_v3 + needs: + - UWP_access_v3 + - libvlc steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 - uses: NuGet/setup-nuget@v1.2.0 with: nuget-version: '5.x' + - name: Authenticate to GitHub Packages + run: nuget sources add -Username ${{ github.actor }} -Password ${{ secrets.GITHUB_TOKEN }} -StorePasswordInClearText -Name github -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Create NuGet folders shell: bash run: | @@ -106,22 +116,13 @@ jobs: mkdir -p build/win10-x64/native mkdir -p build/win10-x86/native - name: Download and extract UWP builds - env: - VLC_VERSION: 3.0.20 shell: bash run: | - wget -O arm.zip https://code.videolan.org/videolan/libvlc-nuget/-/jobs/artifacts/master/download?job=uwp-arm - wget -O x86.zip https://code.videolan.org/videolan/libvlc-nuget/-/jobs/artifacts/master/download?job=uwp-x86 - wget -O x64.zip https://code.videolan.org/videolan/libvlc-nuget/-/jobs/artifacts/master/download?job=uwp-x64 - - 7z x arm.zip -oarm -y - 7z x arm/vlc/winarm-uwp/vlc-$VLC_VERSION-win32.7z -oarm/vlc/winarm-uwp -y + 7z x libvlc-arm/vlc-$VLC_VERSION-win32.7z -oarm/vlc/winarm-uwp -y - 7z x x86.zip -ox86 -y - 7z x x86/vlc/win32-uwp/vlc-$VLC_VERSION-win32.7z -ox86/vlc/win32-uwp -y + 7z x libvlc-x86/vlc-$VLC_VERSION-win32.7z -ox86/vlc/win32-uwp -y - 7z x x64.zip -ox64 -y - 7z x x64/vlc/win64-uwp/vlc-$VLC_VERSION-win64.7z -ox64/vlc/win64-uwp -y + 7z x libvlc-x64/vlc-$VLC_VERSION-win64.7z -ox64/vlc/win64-uwp -y mv arm/vlc/winarm-uwp/vlc-$VLC_VERSION/lua build/win10-arm/native mv arm/vlc/winarm-uwp/vlc-$VLC_VERSION/plugins build/win10-arm/native @@ -146,9 +147,16 @@ jobs: - name: Package NuGet shell: bash run: | - nuget pack VideoLAN.LibVLC.UWP.nuspec + if "${{ github.ref_type }}" == "tag"; then + nuget pack VideoLAN.LibVLC.UWP.nuspec + else + nuget pack VideoLAN.LibVLC.UWP.nuspec -Version $VLC_VERSION-${{ github.sha }} + fi - name: Upload NuGet package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: libvlc-uwp path: '*.nupkg' + - name: Push to GitHub Packages + if: github.ref_type == 'tag' + run: nuget push *.nupkg -Source github -ApiKey ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..12804f4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "vlc"] + path = vlc + url = https://code.videolan.org/videolan/vlc.git + branch = 3.0.x diff --git a/VideoLAN.LibVLC.UWP.nuspec b/VideoLAN.LibVLC.UWP.nuspec index eb1c465..774e9cc 100644 --- a/VideoLAN.LibVLC.UWP.nuspec +++ b/VideoLAN.LibVLC.UWP.nuspec @@ -3,9 +3,8 @@ VideoLAN.LibVLC.UWP VideoLAN.LibVLC.UWP - 3.3.2 - VideoLAN - VideoLAN + 3.3.3-alpha + huynhsontung false LibVLC is a modular multimedia framework LibVLC is a modular multimedia framework that can render video and output audio as well as encode and stream. As it is native code, you will need to use a wrapper library such as LibVLCSharp to use it from .NET. @@ -13,7 +12,7 @@ Use this LibVLC build for Windows Universal projects (UAP) on Windows 10 Desktop, Mobile and Xbox. libvlc;vlc;videolan;native;c/c++;video;audio;player;media;mediaplayer;codec;ffmpeg;xamarin;graphics;ios;android;linux;windows;macos;cross-platform - https://code.videolan.org/videolan/libvlc-nuget + https://github.com/huynhsontung/libvlc-nuget LGPL-2.1-or-later https://code.videolan.org/videolan/vlc/blob/master/NEWS icon.png diff --git a/patches/0001-direct3d11-fix-uninitialized-src_fmt-when-render-wit.patch b/patches/0001-direct3d11-fix-uninitialized-src_fmt-when-render-wit.patch new file mode 100644 index 0000000..b73903c --- /dev/null +++ b/patches/0001-direct3d11-fix-uninitialized-src_fmt-when-render-wit.patch @@ -0,0 +1,35 @@ +From 198233943f4d0a2ed873692ffea2e19a8d89c05a Mon Sep 17 00:00:00 2001 +From: Tung Huynh +Date: Wed, 6 Dec 2023 23:10:21 -0800 +Subject: [PATCH] direct3d11: fix uninitialized src_fmt when render with + external device + +--- + modules/video_output/win32/common.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c +index 83812826cc..4ee90a4b91 100644 +--- a/modules/video_output/win32/common.c ++++ b/modules/video_output/win32/common.c +@@ -119,8 +119,6 @@ int CommonInit(vout_display_t *vd) + cfg.width = vd->cfg->display.width; + cfg.height = vd->cfg->display.height; + +- sys->src_fmt = &vd->source; +- + event_hwnd_t hwnd; + if (EventThreadStart(sys->event, &hwnd, &cfg)) + return VLC_EGENERIC; +@@ -163,6 +161,8 @@ void UpdateRects(vout_display_t *vd, + bool is_forced) + { + vout_display_sys_t *sys = vd->sys; ++ if (!sys->src_fmt) ++ sys->src_fmt = &vd->source; + const video_format_t *source = sys->src_fmt; + #define rect_src sys->rect_src + #define rect_src_clipped sys->rect_src_clipped +-- +2.42.0.windows.2 + diff --git a/patches/0001-lua-discard-basedir-and-DIR_SEP-on-UWP.patch b/patches/0001-lua-discard-basedir-and-DIR_SEP-on-UWP.patch new file mode 100644 index 0000000..8648c88 --- /dev/null +++ b/patches/0001-lua-discard-basedir-and-DIR_SEP-on-UWP.patch @@ -0,0 +1,34 @@ +From 7d9e7f13fc7147b1d7cd4718c2df4328b578a23a Mon Sep 17 00:00:00 2001 +From: Johannes Kauffmann +Date: Sun, 31 Oct 2021 11:13:25 +0100 +Subject: [PATCH] lua: discard basedir and DIR_SEP on UWP + +On UWP, the lua folder is deployed right next to the executable in the +app installation folder, but the path returned by config_GetUserDir +(which is basedir) points to the local packages folder, located in the +current user AppData folder. Therefore, discard basedir and the +directory separator, to allow VLC to find the lua folder. +--- + modules/lua/vlc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c +index f20f931f189..ab0e5a4f334 100644 +--- a/modules/lua/vlc.c ++++ b/modules/lua/vlc.c +@@ -183,8 +183,12 @@ static char **vlclua_dir_list_append( char **restrict list, char *basedir, + if (unlikely(basedir == NULL)) + return list; + ++#ifndef VLC_WINSTORE_APP + if (likely(asprintf(list, "%s"DIR_SEP"lua"DIR_SEP"%s", + basedir, luadirname) != -1)) ++#else ++ if (likely(asprintf(list, "lua"DIR_SEP"%s", luadirname) != -1)) ++#endif + list++; + + free(basedir); +-- +GitLab + diff --git a/vlc b/vlc new file mode 160000 index 0000000..758b718 --- /dev/null +++ b/vlc @@ -0,0 +1 @@ +Subproject commit 758b718347094af7e7e35ec18359d32f8928766e