From f3e5db0823d57d1cc7fe78e0eacfb51b9c428c56 Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Thu, 30 Nov 2023 23:46:07 -0800 Subject: [PATCH 1/9] update ci to use my fork of libvlc-nuget --- .github/workflows/ci.yml | 51 +++----------------------------------- VideoLAN.LibVLC.UWP.nuspec | 2 +- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 972519c..c1de093 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,51 +5,6 @@ on: pull_request: 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 - 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 - with: - nuget-version: '5.x' - - name: Create LibVLC iOS NuGet package - run: | - nuget pack VideoLAN.LibVLC.iOS.nuspec - - name: Upload build - uses: actions/upload-artifact@v2 - with: - name: libvlc-ios-build - path: ./*.nupkg - UWP_access_v3: if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id strategy: @@ -110,9 +65,9 @@ jobs: 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 + wget -O arm.zip https://code.videolan.org/huynhsontung/libvlc-nuget/-/jobs/artifacts/master/download?job=uwp-arm + wget -O x86.zip https://code.videolan.org/huynhsontung/libvlc-nuget/-/jobs/artifacts/master/download?job=uwp-x86 + wget -O x64.zip https://code.videolan.org/huynhsontung/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 diff --git a/VideoLAN.LibVLC.UWP.nuspec b/VideoLAN.LibVLC.UWP.nuspec index eb1c465..14badf7 100644 --- a/VideoLAN.LibVLC.UWP.nuspec +++ b/VideoLAN.LibVLC.UWP.nuspec @@ -3,7 +3,7 @@ VideoLAN.LibVLC.UWP VideoLAN.LibVLC.UWP - 3.3.2 + 3.3.2-open VideoLAN VideoLAN false From 4fc936728980caeb1d434795e442e70d239868d3 Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Sun, 3 Dec 2023 23:03:07 -0800 Subject: [PATCH 2/9] add vlc submodule --- .gitmodules | 4 ++++ vlc | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 vlc 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/vlc b/vlc new file mode 160000 index 0000000..5d46581 --- /dev/null +++ b/vlc @@ -0,0 +1 @@ +Subproject commit 5d465814936c29a935bacb29810e6355d444d4b7 From 2c9c1dacee99fbd7d110bba3442f471749627e76 Mon Sep 17 00:00:00 2001 From: Tung Huynh <31434093+huynhsontung@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:39:19 -0800 Subject: [PATCH 3/9] ci: build libvlc using github actions (#1) --- .github/workflows/ci.yml | 99 ++++++++++++++++++++++++++++---------- VideoLAN.LibVLC.UWP.nuspec | 7 ++- 2 files changed, 77 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1de093..0d2edde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,11 +2,66 @@ name: CI on: push: + branches: + - main + - master + tags: + - '*' pull_request: +env: + VLC_VERSION: 3.0.20 + UWP_LIBVLC_BUILD_FLAGS: -z -r -u -w + jobs: + 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@v3 + with: + submodules: true + - name: Apply patches + run: | + 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-${{ 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] @@ -18,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 @@ -39,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: | @@ -61,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/huynhsontung/libvlc-nuget/-/jobs/artifacts/master/download?job=uwp-arm - wget -O x86.zip https://code.videolan.org/huynhsontung/libvlc-nuget/-/jobs/artifacts/master/download?job=uwp-x86 - wget -O x64.zip https://code.videolan.org/huynhsontung/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 @@ -103,7 +149,10 @@ jobs: run: | nuget pack VideoLAN.LibVLC.UWP.nuspec - 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/VideoLAN.LibVLC.UWP.nuspec b/VideoLAN.LibVLC.UWP.nuspec index 14badf7..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-open - 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 From 719185a293ac1b377bc7e5f7695eb6a94f73b6bf Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Tue, 5 Dec 2023 00:06:12 -0800 Subject: [PATCH 4/9] patch(lua): discard basedir and DIR_SEP on UWP --- ...a-discard-basedir-and-DIR_SEP-on-UWP.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 patches/0001-lua-discard-basedir-and-DIR_SEP-on-UWP.patch 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 + From 5d4d497b0331ad2ab02c76668f1ac694172f4a7c Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Tue, 5 Dec 2023 01:23:47 -0800 Subject: [PATCH 5/9] ci: build test nupkg --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d2edde..8c53a01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,7 +147,11 @@ 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 1.0.0-${{ github.sha }} + fi - name: Upload NuGet package uses: actions/upload-artifact@v3 with: From 44d22383760fb8ff98d7044212650553c57078e1 Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Tue, 5 Dec 2023 21:09:06 -0800 Subject: [PATCH 6/9] ci: test build use vlc version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c53a01..f310c66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,7 @@ jobs: if "${{ github.ref_type }}" == "tag"; then nuget pack VideoLAN.LibVLC.UWP.nuspec else - nuget pack VideoLAN.LibVLC.UWP.nuspec -Version 1.0.0-${{ github.sha }} + nuget pack VideoLAN.LibVLC.UWP.nuspec -Version $VLC_VERSION-${{ github.sha }} fi - name: Upload NuGet package uses: actions/upload-artifact@v3 From 4206bfeeda2ad678806bf95658b51d62bb0aef0f Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Wed, 6 Dec 2023 23:11:01 -0800 Subject: [PATCH 7/9] direct3d11: fix uninitialized src_fmt when render with external device --- ...ninitialized-src_fmt-when-render-wit.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 patches/0001-direct3d11-fix-uninitialized-src_fmt-when-render-wit.patch 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 + From a94969d3448bf58cad9027ee804ebda3883ca07a Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Wed, 6 Dec 2023 23:11:54 -0800 Subject: [PATCH 8/9] pin libvlc to v3.0.20 --- vlc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlc b/vlc index 5d46581..6f0d0ab 160000 --- a/vlc +++ b/vlc @@ -1 +1 @@ -Subproject commit 5d465814936c29a935bacb29810e6355d444d4b7 +Subproject commit 6f0d0ab126b1bed52897598867d0e19ca2cc6202 From 81a4ddb950b1b08316d0fd587a49d70abe98298a Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Fri, 8 Dec 2023 03:17:12 -0800 Subject: [PATCH 9/9] pin vlc to 3.0.17 --- .github/workflows/ci.yml | 2 +- vlc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f310c66..ec37378 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: pull_request: env: - VLC_VERSION: 3.0.20 + VLC_VERSION: 3.0.17 UWP_LIBVLC_BUILD_FLAGS: -z -r -u -w jobs: diff --git a/vlc b/vlc index 6f0d0ab..758b718 160000 --- a/vlc +++ b/vlc @@ -1 +1 @@ -Subproject commit 6f0d0ab126b1bed52897598867d0e19ca2cc6202 +Subproject commit 758b718347094af7e7e35ec18359d32f8928766e