Separate public runtime data from debug diagnostics

Compared with 90af75c:

- keep only application-facing capture FPS and delivered-frame count in gvfg_runtime_info_t

- move GigabyteLib frame-acquire timing exclusively to the internal debug statistics

- remove duplicated runtime, zero-copy, and last-frame fields from the debug structure

- remove synthetic backend DMA, interrupt, sequence, and capture counters not supplied by GigabyteLib

- retain uniquely useful wait, event, audio, frame-hold, and timing diagnostics plus register access

- update the Qt sample and documentation for the clarified ownership boundary
This commit is contained in:
Mark.lin
2026-09-14 14:31:13 +08:00
parent 90af75cdd1
commit 13aad44361
8 changed files with 34 additions and 120 deletions
+3 -5
View File
@@ -77,11 +77,9 @@ register 與 DMA 實作不屬於本文件。
| ------------------ | ---------- | ------------------------------------------------------- |
| `capture_fps` | `double` | 依 `gvfg_read_channel_frame()` 成功交付時間估算並平滑化的 FPS;尚無足夠 frame 時為 0 |
| `delivered_frames` | `uint64_t` | 此次 running session 中成功交付給 caller 的 frame 數 |
| `zero_copy_enabled` | `int` | 非零表示目前使用 driver zero-copy frame delivery |
| `driver_read_samples` | `uint64_t` | 排除前 30 張 warmup 後的 driver read/acquire timing 樣本數 |
| `driver_read_average_us` | `double` | `GET_FRAME` 或 zero-copy acquire 平均時間,單位為微秒 |
| `driver_read_max300_us` | `double` | 最近完成的 300-sample window 最大值,單位為微秒 |
| `driver_read_max_us` | `double` | 本次 capture lifetime 最大值,單位為微秒 |
Zero-copy 模式另由 `gvfg_get_channel_zero_copy_enabled()` 查詢;driver read/acquire
timing 屬於內部診斷資訊,不放入客戶 runtime 結構。
### 1.8 `gvfg_frame_t`
+9 -5
View File
@@ -146,9 +146,8 @@ Backend event 映射:
| `GIGABYTE_EVENT_STREAM_READY` | `GVFG_EVENT_STREAM_READY` |
| `GIGABYTE_EVENT_FORMAT_CHANGE_BEGIN` | `GVFG_EVENT_FORMAT_CHANGE_BEGIN` |
每個 channel 的 public event mask 在 open 前設定。Video DMA event 永遠註冊;
format-change、plug-in、unplug driver event 依 mask 選擇性註冊。關閉 driver event
同時代表 backend 不執行該事件所驅動的自動 recovery。
依 GigabyteLib 行為,video、format-change、plug-in 與 unplug events 在 open channel
時固定註冊;使用者只選擇是否啟用 audio,SDK 不再提供重複的 event mask 層。
Facade queue 上限為 64;滿時丟棄最舊事件。`pollEvent()` 只允許 running 狀態,支援
non-blocking、有限 timeout 與 infinite wait;stop 透過 `eventCv` 喚醒 waiter。
@@ -161,8 +160,13 @@ non-blocking、有限 timeout 與 infinite wait;stop 透過 `eventCv` 喚醒 w
`gvfg_debug.h` 僅供內部工具,包含:
- `gvfg_debug_get_channel_backend_stats()`:指定 channel 的 facade/backend state、
captured/delivered frame、DMA error、IRQ、timeout、sequence 與 GetFrame timing。
- `gvfg_debug_get_channel_backend_stats()`:指定 channel 的 running/frame-held 狀態、
event queue depth、frame wait timeout、video/audio event wake、audio 讀取量與
GigabyteLib GetFrame/acquire timing。
公開的 `gvfg_runtime_info_t` 只保留 application-facing capture FPS 與 delivered frame
數;zero-copy 用公開 getter 查詢。Debug 結構不重複這些公開資訊,也不偽造
GigabyteLib 未提供的 DMA error、IRQ 或 driver sequence counter。
客戶診斷使用 `gvfg_get_channel_signal_status()`、`gvfg_get_channel_runtime_info()`、event、
`gvfg_strerror()` 與 `gvfg_get_channel_last_error_detail()`。每個 channel 的 `ChannelErrorState`