@@ -32,58 +32,29 @@ jobs:
3232 arch : ' win64_mingw'
3333 modules : ' qtmultimedia'
3434
35- - name : Download GStreamer
35+ - name : Install GStreamer (MinGW) via Chocolatey
3636 shell : pwsh
3737 run : |
38- # Define URLs for MinGW 64-bit GStreamer
39- $url_runtime = "https://gstreamer.freedesktop.org/data/pkg/windows/1.22.8/mingw/gstreamer-1.0-mingw-x86_64-1.22.8.msi"
40- $url_devel = "https://gstreamer.freedesktop.org/data/pkg/windows/1.22.8/mingw/gstreamer-1.0-devel-mingw-x86_64-1.22.8.msi"
41-
42- # Use curl.exe explicitly (not PowerShell Invoke-WebRequest) with browser headers
43- # to attempt to pass the WAF/Anti-bot checks.
44- $userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
45-
46- Write-Host "Downloading Runtime..."
47- & curl.exe -L --retry 5 --retry-delay 3 `
48- -H "User-Agent: $userAgent" `
49- -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" `
50- -H "Accept-Language: en-US,en;q=0.9" `
51- -H "Referer: https://gstreamer.freedesktop.org/download/" `
52- -o "gstreamer.msi" "$url_runtime"
53-
54- Write-Host "Downloading Devel..."
55- & curl.exe -L --retry 5 --retry-delay 3 `
56- -H "User-Agent: $userAgent" `
57- -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" `
58- -H "Accept-Language: en-US,en;q=0.9" `
59- -H "Referer: https://gstreamer.freedesktop.org/download/" `
60- -o "gstreamer-devel.msi" "$url_devel"
61-
62- # Verify downloads
63- if ((Get-Item "gstreamer.msi").Length -lt 10MB) {
64- Write-Error "gstreamer.msi is too small or invalid. Likely blocked by anti-bot."; exit 1
65- }
66- if ((Get-Item "gstreamer-devel.msi").Length -lt 10MB) {
67- Write-Error "gstreamer-devel.msi is too small or invalid. Likely blocked by anti-bot."; exit 1
68- }
69-
70- - name : Install GStreamer
71- shell : pwsh
72- run : |
73- Start-Process msiexec.exe -ArgumentList '/i', 'gstreamer.msi', '/quiet', '/norestart' -NoNewWindow -Wait
74- Start-Process msiexec.exe -ArgumentList '/i', 'gstreamer-devel.msi', '/quiet', '/norestart' -NoNewWindow -Wait
75-
76- echo "GSTREAMER_1_0_ROOT_MINGW_X86_64=C:\gstreamer\1.0\mingw_x86_64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
77- echo "C:\gstreamer\1.0\mingw_x86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
78- echo "PKG_CONFIG_PATH=C:\gstreamer\1.0\mingw_x86_64\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
79-
80- echo "Debug: Listing GStreamer Includes"
81- Get-ChildItem -Recurse "C:\gstreamer\1.0\mingw_x86_64\include" | Select-Object FullName -First 20
82- if (Test-Path "C:\gstreamer\1.0\mingw_x86_64\include\gstreamer-1.0\gst\gst.h") {
83- echo "Found gst.h"
84- } else {
85- echo "ERROR: gst.h NOT FOUND at expected path"
86- }
38+ # Chocolatey installs to C:\gstreamer by default for this package
39+ choco install gstreamer --version 1.22.8 -y
40+ choco install gstreamer-devel --version 1.22.8 -y
41+
42+ # Verify installation path (Chocolatey gstreamer package usually installs to C:\gstreamer\1.0\mingw_x86_64 or msvc)
43+ # We need to detect where it put it exactly.
44+ $gstRoot = "C:\gstreamer\1.0\mingw_x86_64"
45+ if (-not (Test-Path $gstRoot)) {
46+ $gstRoot = "C:\gstreamer\1.0\msvc_x86_64"
47+ }
48+ Write-Host "Detected GStreamer Root: $gstRoot"
49+
50+ if (-not (Test-Path "$gstRoot\bin")) {
51+ Write-Error "Could not find GStreamer bin folder"
52+ exit 1
53+ }
54+
55+ echo "GSTREAMER_1_0_ROOT_MINGW_X86_64=$gstRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
56+ echo "$gstRoot\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
57+ echo "PKG_CONFIG_PATH=$gstRoot\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
8758
8859 - name : Configure CMake
8960 run : |
0 commit comments