Files
GVFG_Standalone/package_customer_release.bat
T
Mark.lin 0af70a59ca Replace the legacy backend with GigabyteLib
Compared with 5f74655:

- Preserve the public gvfg C API while replacing the direct PCIE S2MM register, IOCTL, and giga_ioctl.dll implementation with a per-channel adapter around the supervisor-provided GvfgSdk.lib API.

- Route device open, event creation, video/audio capture, copy and zero-copy frame delivery, zero-copy release, signal metadata, and stream teardown through GigabyteLib while retaining the existing facade ownership and timeout contracts.

- Remove the obsolete giga_ioctl target and legacy register/video-format backend files, and stop requiring or packaging giga_ioctl.dll in the Qt sample and customer archives.

- Vendor the matched GigabyteLib 1.0.0 headers and static library with provenance and checksum documentation, and update build, architecture, frame-flow, and customer deployment documentation for the new boundary.

- Keep gvfg_set_channel_video_format source-compatible, but report GVFG_ENOTSUP when the connected native input format differs because the supplied GigabyteLib API does not expose output-format conversion. Direct debug register reads and writes are likewise unsupported by this backend.

Validation: git diff --cached --check passed. MSVC x64 Release and Debug gvfg.dll builds passed, the Release Qt sample linked successfully, dumpbin confirmed gvfg.dll has no giga_ioctl.dll dependency and retains all 32 public exports, and the Release package script produced an archive without giga_ioctl.dll or private GigabyteLib files. No runtime capture, audio, zero-copy, hot-plug, dual-channel, device shutdown, MinGW, or hardware validation was run.
2026-09-14 09:46:37 +08:00

109 lines
3.7 KiB
Batchfile

@echo off
setlocal EnableExtensions
set "PROJECT_DIR=%~dp0"
set "PROJECT_DIR=%PROJECT_DIR:~0,-1%"
if not defined SDK_SOURCE_BIN set "SDK_SOURCE_BIN=%PROJECT_DIR%\GVFG_SDK\build\Desktop_Qt_6_10_2_MSVC2022_64bit-Release\bin"
if not defined SAMPLE_SOURCE_BIN set "SAMPLE_SOURCE_BIN=%PROJECT_DIR%\GVFG_Qt_Sample\build\Desktop_Qt_6_10_2_MSVC2022_64bit-Release\bin"
if not defined QT_BIN set "QT_BIN=C:\Qt\6.10.2\msvc2022_64\bin"
if not defined VSDEVCMD set "VSDEVCMD=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\VsDevCmd.bat"
if "%~1"=="" (
set "OUTPUT_DIR=%PROJECT_DIR%\packages"
) else (
set "OUTPUT_DIR=%~1"
)
for /f %%I in ('powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-Date -Format yyyyMMdd_HHmm"') do set "STAMP=%%I"
for /f "tokens=3" %%I in ('findstr /C:"project(gvfg_sdk VERSION" "%PROJECT_DIR%\GVFG_SDK\CMakeLists.txt"') do set "PACKAGE_VERSION=%%I"
if not defined PACKAGE_VERSION (
echo [package] ERROR: Project version not found in CMakeLists.txt.
goto fail
)
set "PACKAGE_NAME=GVFG_Sample_Release_%STAMP%_%PACKAGE_VERSION%"
set "ZIP_PATH=%OUTPUT_DIR%\%PACKAGE_NAME%.zip"
set "STAGE_ROOT=%TEMP%\%PACKAGE_NAME%_%RANDOM%"
set "STAGE_DIR=%STAGE_ROOT%\%PACKAGE_NAME%"
set "WINDEPLOYQT=%QT_BIN%\windeployqt.exe"
echo [package] SDK source: "%SDK_SOURCE_BIN%"
echo [package] Sample source: "%SAMPLE_SOURCE_BIN%"
echo [package] Output: "%ZIP_PATH%"
if not exist "%SAMPLE_SOURCE_BIN%\gvfg_qt_preview.exe" (
echo [package] ERROR: gvfg_qt_preview.exe not found.
goto fail
)
if not exist "%SDK_SOURCE_BIN%\gvfg.dll" (
echo [package] ERROR: gvfg.dll not found.
goto fail
)
if not exist "%SDK_SOURCE_BIN%\gvfg_preview.dll" (
echo [package] ERROR: gvfg_preview.dll not found.
goto fail
)
if not exist "%WINDEPLOYQT%" (
echo [package] ERROR: "%WINDEPLOYQT%" not found.
goto fail
)
if not exist "%OUTPUT_DIR%" mkdir "%OUTPUT_DIR%" || goto fail
if exist "%STAGE_ROOT%" rmdir /S /Q "%STAGE_ROOT%" || goto fail
mkdir "%STAGE_DIR%" || goto fail
echo [package] Copy application files...
copy /Y "%SAMPLE_SOURCE_BIN%\gvfg_qt_preview.exe" "%STAGE_DIR%\" >nul || goto fail
copy /Y "%SDK_SOURCE_BIN%\gvfg.dll" "%STAGE_DIR%\" >nul || goto fail
copy /Y "%SDK_SOURCE_BIN%\gvfg_preview.dll" "%STAGE_DIR%\" >nul || goto fail
echo [package] Deploy Qt runtime...
if exist "%VSDEVCMD%" call "%VSDEVCMD%" -arch=x64 >nul || goto fail
"%WINDEPLOYQT%" --release --compiler-runtime --force --dir "%STAGE_DIR%" "%STAGE_DIR%\gvfg_qt_preview.exe"
if errorlevel 1 goto fail
echo [package] Deploy MSVC runtime...
if not defined VCToolsRedistDir (
echo [package] ERROR: VCToolsRedistDir was not set by VsDevCmd.bat.
goto fail
)
set "VC_RUNTIME_DIR=%VCToolsRedistDir%x64\Microsoft.VC143.CRT"
if not exist "%VC_RUNTIME_DIR%\msvcp140.dll" (
echo [package] ERROR: MSVC runtime not found in "%VC_RUNTIME_DIR%".
goto fail
)
copy /Y "%VC_RUNTIME_DIR%\*.dll" "%STAGE_DIR%\" >nul || goto fail
if not exist "%STAGE_DIR%\msvcp140.dll" (
echo [package] ERROR: msvcp140.dll was not deployed.
goto fail
)
if not exist "%STAGE_DIR%\vcruntime140.dll" (
echo [package] ERROR: vcruntime140.dll was not deployed.
goto fail
)
if not exist "%STAGE_DIR%\vcruntime140_1.dll" (
echo [package] ERROR: vcruntime140_1.dll was not deployed.
goto fail
)
echo [package] Create zip...
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"Compress-Archive -Path '%STAGE_DIR%' -DestinationPath '%ZIP_PATH%' -Force"
if errorlevel 1 goto fail
rmdir /S /Q "%STAGE_ROOT%"
echo [package] Done.
echo [package] Zip: "%ZIP_PATH%"
if "%NO_PAUSE%"=="" pause
exit /b 0
:fail
echo [package] FAILED.
if exist "%STAGE_ROOT%" rmdir /S /Q "%STAGE_ROOT%" >nul 2>nul
if "%NO_PAUSE%"=="" pause
exit /b 1