Harden GVFG signal recovery and preview lifecycle

Compared with d03f064:

- Pause the sample video and audio readers after signal disconnect events and resume them only after reconnect or stream-ready notification.

- Serialize plug, unplug, and format transitions against active reads and held zero-copy frames while keeping stop and close able to interrupt lifecycle waits.

- Treat ERROR_BAD_COMMAND as unplug-revoked zero-copy ownership only after the backend has confirmed signal loss, while preserving all other release failures for retry and diagnosis.

- Stop submitting frames when the user closes an independent preview window, account those frames as intentionally skipped, and resume submission when preview is reopened.

- Emit UTF-16 Windows debug output so localized Win32 error messages remain readable in Qt and debugger output.

- Add startup and first-frame timing diagnostics, reduce routine stream-ready logging, and update public and internal documentation for the new disconnect and ownership behavior.

Validation: git diff --check and focused symbol/document consistency searches passed; no build or hardware validation was run.
This commit is contained in:
Mark.lin
2026-09-08 12:20:39 +08:00
parent d03f064b4f
commit 8cde31feaf
11 changed files with 244 additions and 29 deletions
+6 -1
View File
@@ -270,7 +270,12 @@ Release 不是只看 `data` pointer。程式會比對:
這可避免 caller 把 CH0 token 用於 CH1、使用舊 frame、修改 descriptor,或重複 release。
重要規則:驗證失敗或 zero-copy release IOCTL 失敗時,不可先清除 held state。
重要規則:token 驗證失敗或一般 zero-copy release IOCTL 失敗時,不可先清除
held state。唯一例外是 backend 已經收到 plug-out、確認 signal disconnected,且
driver 對該 outstanding frame 回傳 `ERROR_BAD_COMMAND (22)`;此時 driver 已因拔線
撤銷 ownership,SDK 會清除相符的本地 held token,避免 unplug handler 與後續
replug 永久卡住。Application 仍必須對每次成功 read 呼叫一次 release,不應自行
特判 error 22。
## 11. Signal 與 format-change 狀態