Skip to content

Commit aa86f23

Browse files
authored
Merge branch 'main' into mh-watermark
2 parents cdd5e9e + 74e4f54 commit aa86f23

File tree

11 files changed

+198
-84
lines changed

11 files changed

+198
-84
lines changed

.github/workflows/dls-build-and-test-deb_pkgs-and-deb_imgs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ jobs:
7373
7474
# ======================================================== BUILDING PART ========================================================
7575
- name: Set up Docker Buildx
76-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
76+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #4.0.0
7777

7878
- name: Log in to GitHub Container Registry
79-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #3.6.0
79+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 #4.0.0
8080
with:
8181
registry: ghcr.io
8282
username: ${{ github.actor }}

.github/workflows/dls-build-and-test-windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
DLS_BUILD_DIRECTORY: '$env:TEMP\dlstreamer_tmp\build'
2222
DLS_DLL_TARGET_DIRECTORY: 'C:\dlstreamer'
2323
OPENVINO_RUNTIME_DIRECTORY: '$env:LOCALAPPDATA\Programs\openvino\runtime'
24-
GSTREAMER_DIRECTORY: 'C:\gstreamer'
24+
GSTREAMER_DIRECTORY: 'C:\Program Files\gstreamer'
2525
MODELS_PATH: 'C:\models\models'
2626
VIDEO_INPUTS_PATH: 'C:\videos\videos'
2727
TESTS_RESULTS_DIRECTORY: 'C:\dlstreamer_test_results'

.github/workflows/dls-build-dev-docker-images-and-run-unit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
git submodule update --init thirdparty/spdlog
4040
git submodule update --init thirdparty/googletest
4141
- name: Set up Docker Buildx
42-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
42+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #4.0.0
4343

4444
- name: Log in to GitHub Container Registry
45-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #3.6.0
45+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 #4.0.0
4646
with:
4747
registry: ghcr.io
4848
username: ${{ github.actor }}

.github/workflows/dls-test-optimizer.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ jobs:
6666
cp -r dl-streamer-tests-repo/functional_tests $OPTIMIZER_TESTS_PATH
6767
# ======================================================== BUILDING PART ========================================================
6868
- name: Set up Docker Buildx
69-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
69+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #4.0.0
7070

7171
- name: Log in to GitHub Container Registry
72-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #3.6.0
72+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 #4.0.0
7373
with:
7474
registry: ghcr.io
7575
username: ${{ github.actor }}
@@ -174,7 +174,7 @@ jobs:
174174
if: always()
175175
with:
176176
name: DLS_optimzier_host_${{ matrix.runner_print_label }}_${{ matrix.ubuntu_version }}_results
177-
path: ${{ env.OPTIMIZER_TESTS_PATH }}/optimizer_results/host/FINAL_TEST_REPORT.txt
177+
path: ${{ env.OPTIMIZER_TESTS_PATH }}/optimizer_results/host/*
178178

179179
# ======================================================== TEST RESULTS SUMMARY ========================================================
180180
- name: Add optimizer test results to summary
@@ -188,14 +188,14 @@ jobs:
188188
echo "" >> $GITHUB_STEP_SUMMARY
189189
echo "| Test Environment | Status |" >> $GITHUB_STEP_SUMMARY
190190
echo "|------------------|--------|" >> $GITHUB_STEP_SUMMARY
191-
191+
192192
# Docker test status
193193
if [ "$DOCKER_OUTCOME" == "success" ]; then
194194
echo "| Optimizer in Docker | ✅ **PASSED** |" >> $GITHUB_STEP_SUMMARY
195195
else
196196
echo "| Optimizer in Docker | ❌ **FAILED** |" >> $GITHUB_STEP_SUMMARY
197197
fi
198-
198+
199199
# Host test status
200200
if [ "$HOST_OUTCOME" == "success" ]; then
201201
echo "| Optimizer on Host | ✅ **PASSED** |" >> $GITHUB_STEP_SUMMARY

.github/workflows/dls-weekly-cached-images.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ jobs:
6565
cd dlstreamer-repo
6666
git submodule update --init thirdparty/spdlog
6767
- name: Set up Docker Buildx
68-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
68+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #4.0.0
6969

7070
- name: Log in to GitHub Container Registry
71-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #3.6.0
71+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 #4.0.0
7272
with:
7373
registry: ghcr.io
7474
username: ${{ github.actor }}
@@ -208,10 +208,10 @@ jobs:
208208
cd dlstreamer-repo
209209
git submodule update --init thirdparty/spdlog
210210
- name: Set up Docker Buildx
211-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
211+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #4.0.0
212212

213213
- name: Log in to GitHub Container Registry
214-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #3.6.0
214+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 #4.0.0
215215
with:
216216
registry: ghcr.io
217217
username: ${{ github.actor }}
@@ -329,7 +329,7 @@ jobs:
329329
path: edge-ai-libraries-repo
330330

331331
- name: Log in to GitHub Container Registry
332-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #3.6.0
332+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 #4.0.0
333333
with:
334334
registry: ghcr.io
335335
username: ${{ github.actor }}

.github/workflows/zizmor-scan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
persist-credentials: false
3535
- name: "Run Zizmor scan"
36-
uses: open-edge-platform/geti-ci/actions/zizmor@4d46c7fb444d8fae6390348e76d96bb0749c5632 # zizmor/v0.1.0
36+
uses: open-edge-platform/geti-ci/actions/zizmor@e80098b3d180db37914f11ff6021f9fa34d0bb9f # zizmor/v0.1.1
3737
with:
3838
scan-scope: all
3939
severity-level: LOW

scripts/build_dlstreamer_dlls.ps1

Lines changed: 131 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $OPENVINO_VERSION = "2026.0.0"
1313
$OPENVINO_VERSION_SHORT = "2026.0"
1414
$PYTHON_VERSION = "3.12.7"
1515
$OPENVINO_DEST_FOLDER = "$env:LOCALAPPDATA\Programs\openvino"
16-
$GSTREAMER_DEST_FOLDER = "$env:ProgramFiles\gstreamer"
16+
$GSTREAMER_DEST_FOLDER = "$env:ProgramFiles\gstreamer\1.0\msvc_x86_64"
1717
$DLSTREAMER_TMP = "$env:TEMP\dlstreamer_tmp"
1818

1919
if ($useInternalProxy) {
@@ -81,6 +81,51 @@ function Invoke-DownloadFile {
8181
}
8282
}
8383

84+
function Uninstall-GStreamer {
85+
# Check if this is an Inno installation (GStreamer 1.28+)
86+
$innoUninstallKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\c20a66dc-b249-4e6d-a68a-d0f836b2b3cf_is1"
87+
$quietUninstall = (Get-ItemProperty -Path $innoUninstallKey -Name "QuietUninstallString" -ErrorAction SilentlyContinue).QuietUninstallString
88+
89+
if ($quietUninstall) {
90+
Write-Host "Uninstalling GStreamer (Inno)..."
91+
if ($quietUninstall -match '^"([^"]+)"\s*(.*)$') {
92+
$process = Start-Process -Wait -PassThru -FilePath $Matches[1] -ArgumentList $Matches[2]
93+
if ($process.ExitCode -ne 0) {
94+
Write-Host "GStreamer uninstall returned exit code: $($process.ExitCode)"
95+
}
96+
}
97+
else {
98+
Write-Host "Could not parse QuietUninstallString: $quietUninstall"
99+
}
100+
# Workaround: GStreamer 1.28.1 uninstaller does not remove registry entries
101+
if (Test-Path "HKLM:\SOFTWARE\GStreamer1.0\x86_64") {
102+
Remove-Item -Path "HKLM:\SOFTWARE\GStreamer1.0\x86_64" -Recurse -Force
103+
Write-Host "Removed GStreamer registry entries"
104+
}
105+
}
106+
else {
107+
Write-Host "Uninstalling GStreamer (MSI)..."
108+
try {
109+
$installer = New-Object -ComObject "WindowsInstaller.Installer"
110+
foreach ($upgradeCode in @("{c20a66dc-b249-4e6d-a68a-d0f836b2b3cf}", "{49c4a3aa-249f-453c-b82e-ecd05fac0693}")) {
111+
$products = $installer.RelatedProducts($upgradeCode)
112+
if ($products) {
113+
foreach ($productCode in $products) {
114+
$result = Start-Process -Wait -PassThru -FilePath "msiexec" -ArgumentList "/x", $productCode, "/qn", "/norestart"
115+
if ($result.ExitCode -ne 0 -and $result.ExitCode -ne 1605) {
116+
Write-Host "MSI uninstall returned exit code: $($result.ExitCode)"
117+
}
118+
}
119+
}
120+
}
121+
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($installer) | Out-Null
122+
}
123+
catch {
124+
Write-Host "Error during MSI uninstall: $_"
125+
}
126+
}
127+
}
128+
84129
# ============================================================================
85130
# WinGet
86131
# ============================================================================
@@ -138,7 +183,6 @@ Write-Section "Done"
138183
# GStreamer
139184
# ============================================================================
140185
$GSTREAMER_NEEDS_INSTALL = $false
141-
$GSTREAMER_INSTALL_MODE = "none" # values: none | fresh | upgrade
142186

143187
try {
144188
$regPath = "HKLM:\SOFTWARE\GStreamer1.0\x86_64"
@@ -148,11 +192,14 @@ try {
148192
if ($regInstallDir -and $regVersion) {
149193
Write-Host "GStreamer found in registry - InstallDir: $regInstallDir, Version: $regVersion"
150194
$GSTREAMER_DEST_FOLDER = $regInstallDir.TrimEnd('\')
151-
# Check for conflicting architectures first
152-
$expectedPath = "$GSTREAMER_DEST_FOLDER\1.0\msvc_x86_64"
195+
# Backward compatibility with 1.26
196+
if (-Not $GSTREAMER_DEST_FOLDER.EndsWith('\1.0\msvc_x86_64')) {
197+
$GSTREAMER_DEST_FOLDER = "$GSTREAMER_DEST_FOLDER\1.0\msvc_x86_64"
198+
}
199+
# Check for conflicting architectures
153200
$envMsvcX64 = [Environment]::GetEnvironmentVariable('GSTREAMER_1_0_ROOT_MSVC_X86_64', 'Machine')
154201

155-
if ($envMsvcX64 -and ($envMsvcX64.TrimEnd('\') -ne $expectedPath)) {
202+
if ($envMsvcX64 -and ($envMsvcX64.TrimEnd('\') -ne $GSTREAMER_DEST_FOLDER)) {
156203
Write-Host "Warning: GSTREAMER_1_0_ROOT_MSVC_X86_64 points to unexpected location: $envMsvcX64"
157204
}
158205
$conflictingArchs = @()
@@ -170,86 +217,102 @@ try {
170217
Write-Host "Multiple GStreamer architectures may cause conflicts. Only msvc_x86_64 is supported."
171218
}
172219

173-
# Parse and compare versions
174-
$installedParts = $regVersion.Split('.') | ForEach-Object { [int]$_ }
175-
$requiredParts = $GSTREAMER_VERSION.Split('.') | ForEach-Object { [int]$_ }
176-
$needsUpgrade = $false
177-
for ($i = 0; $i -lt [Math]::Max($installedParts.Length, $requiredParts.Length); $i++) {
178-
$installedPart = if ($i -lt $installedParts.Length) { $installedParts[$i] } else { 0 }
179-
$requiredPart = if ($i -lt $requiredParts.Length) { $requiredParts[$i] } else { 0 }
180-
if ($installedPart -lt $requiredPart) {
181-
$needsUpgrade = $true
182-
break
183-
}
184-
elseif ($installedPart -gt $requiredPart) {
185-
# Installed version is newer, no upgrade needed
186-
break
187-
}
188-
}
189-
190-
if ($needsUpgrade) {
191-
Write-Host "GStreamer upgrade available - installed: $regVersion, required: $GSTREAMER_VERSION - upgrading"
220+
if ($regVersion -ne $GSTREAMER_VERSION) {
221+
Write-Host "GStreamer version mismatch - installed: $regVersion, required: $GSTREAMER_VERSION"
222+
Uninstall-GStreamer
192223
$GSTREAMER_NEEDS_INSTALL = $true
193-
$GSTREAMER_INSTALL_MODE = "upgrade"
224+
$GSTREAMER_DEST_FOLDER = "$env:ProgramFiles\gstreamer\1.0\msvc_x86_64"
194225
}
195226
else {
196227
# Verify installation directory structure exists
197-
$VERSION_SPECIFIC_PATH = "$GSTREAMER_DEST_FOLDER\1.0\msvc_x86_64"
198-
if (-Not (Test-Path $VERSION_SPECIFIC_PATH)) {
199-
Write-Host "GStreamer installation incomplete - msvc_x86_64 directory not found - reinstallation needed"
228+
if (-Not (Test-Path $GSTREAMER_DEST_FOLDER)) {
229+
Write-Host "GStreamer installation incomplete - $GSTREAMER_DEST_FOLDER not found - reinstallation needed"
200230
$GSTREAMER_NEEDS_INSTALL = $true
201-
$GSTREAMER_INSTALL_MODE = "fresh"
202231
}
203232
else {
204-
Write-Host "GStreamer version $regVersion verified (compatible with $GSTREAMER_VERSION)"
233+
Write-Host "GStreamer version $regVersion verified (matches required $GSTREAMER_VERSION)"
205234
$GSTREAMER_NEEDS_INSTALL = $false
206235
}
207236
}
208237
}
209-
else {
238+
else {
210239
Write-Host "GStreamer not found in registry - installation needed"
211240
$GSTREAMER_NEEDS_INSTALL = $true
212-
$GSTREAMER_INSTALL_MODE = "fresh"
213-
$GSTREAMER_DEST_FOLDER = "$env:ProgramFiles\gstreamer"
241+
$GSTREAMER_DEST_FOLDER = "$env:ProgramFiles\gstreamer\1.0\msvc_x86_64"
214242
}
215243
}
216244
catch {
217245
Write-Host "GStreamer registry check failed - assuming not installed"
218246
$GSTREAMER_NEEDS_INSTALL = $true
219-
$GSTREAMER_INSTALL_MODE = "fresh"
220-
$GSTREAMER_DEST_FOLDER = "$env:ProgramFiles\gstreamer"
247+
$GSTREAMER_DEST_FOLDER = "$env:ProgramFiles\gstreamer\1.0\msvc_x86_64"
221248
}
222249

223250
if ($GSTREAMER_NEEDS_INSTALL) {
224-
Write-Section "Preparing GStreamer ${GSTREAMER_VERSION}"
251+
# Determine installer type based on target version
252+
$vParts = $GSTREAMER_VERSION.Split('.') | ForEach-Object { [int]$_ }
253+
$useExeInstaller = ($vParts[0] -gt 1) -or ($vParts[0] -eq 1 -and $vParts[1] -ge 28)
254+
255+
if ($useExeInstaller) {
256+
Write-Section "Installing GStreamer ${GSTREAMER_VERSION} (Inno)"
257+
$GSTREAMER_INSTALLER = "${DLSTREAMER_TMP}\gstreamer-1.0-msvc-x86_64-${GSTREAMER_VERSION}.exe"
258+
Write-Host "Downloading GStreamer installer..."
259+
Invoke-DownloadFile -UserAgent "curl/8.5.0" -OutFile $GSTREAMER_INSTALLER -Uri "https://gstreamer.freedesktop.org/data/pkg/windows/${GSTREAMER_VERSION}/msvc/gstreamer-1.0-msvc-x86_64-${GSTREAMER_VERSION}.exe"
260+
261+
Write-Host "Installing GStreamer..."
262+
$process = Start-Process -Wait -PassThru -FilePath $GSTREAMER_INSTALLER -ArgumentList "/SILENT", "/LOG", "/TYPE=full", "/ALLUSERS"
263+
if ($process.ExitCode -ne 0) {
264+
Write-Error "GStreamer installation failed with exit code: $($process.ExitCode)"
265+
}
225266

226-
$GSTREAMER_RUNTIME_INSTALLER = "${DLSTREAMER_TMP}\gstreamer-1.0-msvc-x86_64-${GSTREAMER_VERSION}.msi"
227-
$GSTREAMER_DEVEL_INSTALLER = "${DLSTREAMER_TMP}\gstreamer-1.0-devel-msvc-x86_64-${GSTREAMER_VERSION}.msi"
267+
# Workaround: GStreamer 1.28.1 writes GSTREAMER_1_0_ROOT_MSVC_X86_64 to wrong registry location, fixed in 1.28.2 https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/574
268+
$wrongRegKey = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"
269+
$rightRegKey = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
270+
$envVarName = "GSTREAMER_1_0_ROOT_MSVC_X86_64"
271+
$wrongValue = (Get-ItemProperty -Path $wrongRegKey -Name $envVarName -ErrorAction SilentlyContinue).$envVarName
272+
if ($wrongValue) {
273+
Write-Host "Fixing $envVarName registry location..."
274+
Set-ItemProperty -Path $rightRegKey -Name $envVarName -Value $wrongValue
275+
Remove-ItemProperty -Path $wrongRegKey -Name $envVarName
276+
}
277+
}
278+
else {
279+
Write-Section "Installing GStreamer ${GSTREAMER_VERSION} (MSI)"
280+
$GSTREAMER_RUNTIME_INSTALLER = "${DLSTREAMER_TMP}\gstreamer-1.0-msvc-x86_64-${GSTREAMER_VERSION}.msi"
281+
$GSTREAMER_DEVEL_INSTALLER = "${DLSTREAMER_TMP}\gstreamer-1.0-devel-msvc-x86_64-${GSTREAMER_VERSION}.msi"
228282

229-
Write-Host "Downloading GStreamer runtime installer..."
230-
Invoke-DownloadFile -UserAgent "curl/8.5.0" -OutFile $GSTREAMER_RUNTIME_INSTALLER -Uri "https://gstreamer.freedesktop.org/data/pkg/windows/${GSTREAMER_VERSION}/msvc/gstreamer-1.0-msvc-x86_64-${GSTREAMER_VERSION}.msi"
283+
Write-Host "Downloading GStreamer runtime installer..."
284+
Invoke-DownloadFile -UserAgent "curl/8.5.0" -OutFile $GSTREAMER_RUNTIME_INSTALLER -Uri "https://gstreamer.freedesktop.org/data/pkg/windows/${GSTREAMER_VERSION}/msvc/gstreamer-1.0-msvc-x86_64-${GSTREAMER_VERSION}.msi"
231285

232-
Write-Host "Downloading GStreamer development installer..."
233-
Invoke-DownloadFile -UserAgent "curl/8.5.0" -OutFile $GSTREAMER_DEVEL_INSTALLER -Uri "https://gstreamer.freedesktop.org/data/pkg/windows/${GSTREAMER_VERSION}/msvc/gstreamer-1.0-devel-msvc-x86_64-${GSTREAMER_VERSION}.msi"
286+
Write-Host "Downloading GStreamer development installer..."
287+
Invoke-DownloadFile -UserAgent "curl/8.5.0" -OutFile $GSTREAMER_DEVEL_INSTALLER -Uri "https://gstreamer.freedesktop.org/data/pkg/windows/${GSTREAMER_VERSION}/msvc/gstreamer-1.0-devel-msvc-x86_64-${GSTREAMER_VERSION}.msi"
234288

235-
if ($GSTREAMER_INSTALL_MODE -eq "fresh" -or $GSTREAMER_INSTALL_MODE -eq "upgrade") {
236289
Write-Host "Installing GStreamer runtime package..."
237-
$process = Start-Process -Wait -PassThru -FilePath "msiexec" -ArgumentList "/passive", "/i", $GSTREAMER_RUNTIME_INSTALLER, "/qn"
290+
$process = Start-Process -Wait -PassThru -FilePath "msiexec" -ArgumentList "/passive", "/i", $GSTREAMER_RUNTIME_INSTALLER, "/qn", "ADDLOCAL=ALL"
238291
if ($process.ExitCode -ne 0) {
239292
Write-Error "GStreamer runtime installation failed with exit code: $($process.ExitCode)"
240293
}
241294
Write-Host "Installing GStreamer development package..."
242-
$process = Start-Process -Wait -PassThru -FilePath "msiexec" -ArgumentList "/passive", "/i", $GSTREAMER_DEVEL_INSTALLER, "/qn"
295+
$process = Start-Process -Wait -PassThru -FilePath "msiexec" -ArgumentList "/passive", "/i", $GSTREAMER_DEVEL_INSTALLER, "/qn", "ADDLOCAL=ALL"
243296
if ($process.ExitCode -ne 0) {
244297
Write-Error "GStreamer development installation failed with exit code: $($process.ExitCode)"
245298
}
246299
# FIXME: Remove this section after GStreamer 1.28
247-
$pkgConfigFile = "$GSTREAMER_DEST_FOLDER\1.0\msvc_x86_64\lib\pkgconfig\gstreamer-analytics-1.0.pc"
300+
$pkgConfigFile = "$GSTREAMER_DEST_FOLDER\lib\pkgconfig\gstreamer-analytics-1.0.pc"
248301
if (Test-Path $pkgConfigFile) {
249302
(Get-Content $pkgConfigFile).Replace('-lm', '') | Set-Content $pkgConfigFile
250303
}
251-
Write-Section "GStreamer installation completed"
252304
}
305+
306+
# Re-read registry to get actual install location
307+
$regInstallDir = (Get-ItemProperty -Path "HKLM:\SOFTWARE\GStreamer1.0\x86_64" -Name "InstallDir" -ErrorAction SilentlyContinue).InstallDir
308+
if ($regInstallDir) {
309+
$GSTREAMER_DEST_FOLDER = $regInstallDir.TrimEnd('\')
310+
# Backward compatibility with 1.26
311+
if (-Not $GSTREAMER_DEST_FOLDER.EndsWith('\1.0\msvc_x86_64')) {
312+
$GSTREAMER_DEST_FOLDER = "$GSTREAMER_DEST_FOLDER\1.0\msvc_x86_64"
313+
}
314+
}
315+
Write-Section "GStreamer installation completed"
253316
}
254317
else {
255318
Write-Section "GStreamer ${GSTREAMER_VERSION} already installed"
@@ -383,10 +446,29 @@ else {
383446
# Final environment setup
384447
# ============================================================================
385448
Write-Section "Setting paths"
449+
# Ensure GStreamer bin is in user PATH for GStreamer 1.28+
450+
$GSTREAMER_BIN = "$GSTREAMER_DEST_FOLDER\bin"
451+
$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
452+
$vParts = $GSTREAMER_VERSION.Split('.') | ForEach-Object { [int]$_ }
453+
if ($vParts[0] -eq 1 -and $vParts[1] -ge 28) {
454+
if ($userPath -split ';' -notcontains $GSTREAMER_BIN) {
455+
[Environment]::SetEnvironmentVariable('Path', "$userPath;$GSTREAMER_BIN", [System.EnvironmentVariableTarget]::User)
456+
Write-Host "Added to user PATH: $GSTREAMER_BIN"
457+
}
458+
}
459+
else {
460+
$pathEntries = $userPath -split ';' | Where-Object { $_ -ne $GSTREAMER_BIN }
461+
$newPath = $pathEntries -join ';'
462+
if ($newPath -ne $userPath) {
463+
[Environment]::SetEnvironmentVariable('Path', $newPath, [System.EnvironmentVariableTarget]::User)
464+
Write-Host "Removed from user PATH: $GSTREAMER_BIN"
465+
}
466+
}
467+
386468
Update-Path
387469
$DLSTREAMER_SRC_LOCATION = $PWD.Path
388-
setx PKG_CONFIG_PATH "$GSTREAMER_DEST_FOLDER\1.0\msvc_x86_64\lib\pkgconfig"
389-
$env:PKG_CONFIG_PATH = "$GSTREAMER_DEST_FOLDER\1.0\msvc_x86_64\lib\pkgconfig"
470+
setx PKG_CONFIG_PATH "$GSTREAMER_DEST_FOLDER\lib\pkgconfig"
471+
$env:PKG_CONFIG_PATH = "$GSTREAMER_DEST_FOLDER\lib\pkgconfig"
390472
# Setup OpenVINO environment variables
391473
. "$OPENVINO_DEST_FOLDER\setupvars.ps1"
392474
# Setup VS environment variables

0 commit comments

Comments
 (0)