Consolidate playback APIs and add standalone OSD bitmap rendering
- move public PCM, image and presentation types into gvfg_playback.h and remove the separate backend headers from source and installation - keep WASAPI and D3D backends private while preserving the existing public type names, fields and static backend integration - move detailed preview delivery counters into a private header and expose their playback query only through the Debug diagnostics API - retain public preview information and basic presentation statistics, mark EQUEUE_FULL as reserved, and document capacity limits as advanced settings with recommended defaults - refresh customer guides, API reference and error handling for the single-header interface, presentation counter limits and EAUDIO handle-recreation policy - add SDK-owned standalone premultiplied BGRA text rendering with transparent backgrounds, measured dimensions, thread-local snapshot lifetime and validated output bounds Validation: git diff --cached --check passed. Release gvfg_playback and Customer Sample builds, standalone C/C++ header checks, Debug playback syntax checks and Release export inspection passed earlier in this session. Final follow-up changes affect comments and documentation only. No runtime or hardware playback validation was performed. The existing Release gvfg target was also checked and was up to date. OSD rendering changes were source-reviewed; no new bitmap or hardware test was run in this commit pass. Capture debug exports are unchanged.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
SDK 3.0.0。Capture 與 Playback 使用各自的 API 與狀態碼。
|
||||
|
||||
本版含不相容的 OSD 介面更新,並移除公開的 Playback 核心詳細統計查詢。
|
||||
本版含不相容的 OSD 介面更新,並移除公開的 Playback 核心與 Preview delivery 詳細統計查詢。
|
||||
使用本版 header、import library 與 DLL 重新編譯;不可混用 SDK 2.x 二進位檔案。
|
||||
|
||||
- [擷取型別與常數](#1-gvfg-api-結構與常數)
|
||||
@@ -703,8 +703,8 @@ gvfg_status_t gvfg_clear_channel_osd(
|
||||
|
||||
## 3. Playback 使用的影像型別
|
||||
|
||||
以下型別定義於 `gvfg_preview.h`,由 `gvfg_playback.h` 引入。
|
||||
此標頭只提供 Playback 使用的影像與統計型別;播放操作見第 4 節。
|
||||
以下型別直接定義於 `gvfg_playback.h`,使用端不需額外的後端標頭。
|
||||
此標頭包含 Playback 的公開型別與操作函式;本節介紹影像型別,播放操作見第 4 節。
|
||||
|
||||
### 3.1 Preview 型別
|
||||
|
||||
@@ -749,29 +749,6 @@ gvfg_status_t gvfg_clear_channel_osd(
|
||||
| `presented_frames` | 成功 Present 的累積 frame 數 |
|
||||
| `skipped_presents` | 預覽端略過呈現的累積數;不是 Capture 或錄影掉格總數 |
|
||||
|
||||
`gvfg_preview_delivery_stats_t`:以下 counter 從 create 或前一次 shutdown 開始累積;
|
||||
configure 與 clear 不會重設。`presented` 表示 DXGI 接受 Present,不代表已實際 scanout。
|
||||
|
||||
| 欄位 | 說明 |
|
||||
| ------------------- | ---------------------------------------------- |
|
||||
| `submitted` | Preview 接收到並納入 delivery 統計的 render request 數 |
|
||||
| `presented` | 已被 DXGI Present 接受的 frame 數 |
|
||||
| `replaced` | 預覽端因資料過時而捨棄的待播影格數 |
|
||||
| `busy` | 遇到 upload slot busy 或 Present busy 的 request 數 |
|
||||
| `failed` | 已提交但後續處理失敗的 frame 數 |
|
||||
| `cancelled` | Shutdown 等流程取消的 frame 數 |
|
||||
| `in_flight` | 目前仍在 pipeline 中的 frame 數 |
|
||||
| `last_presented_id` | 最近成功 Present 的 `frame_id` |
|
||||
| `present_busy` | 因 Present busy 而略過的累積次數 |
|
||||
| `slots_busy` | 因內部 upload slot busy 而略過的累積次數 |
|
||||
| `last_busy_id` | 最近一次 busy frame 的 `frame_id` |
|
||||
|
||||
正常情況下:
|
||||
|
||||
```text
|
||||
submitted = presented + replaced + busy + failed + cancelled + in_flight
|
||||
```
|
||||
|
||||
## 4. 統一 Playback API
|
||||
|
||||
公開標頭為 `gvfg_playback.h`,連結 `gvfg_playback.lib`、部署 `gvfg_playback.dll`。
|
||||
@@ -799,7 +776,6 @@ MinGW 使用 `libgvfg_playback.dll.a`。
|
||||
| `gvfg_playback_get_preview_info(p, info)` | 影像輸出資訊 |
|
||||
| `gvfg_playback_get_preview_stats(p, stats)` | GPU/呈現統計 |
|
||||
| `gvfg_playback_set_signal_connected(p, connected)` | UI 執行緒轉交訊號狀態:0 顯示 helper 內建 NO SIGNAL 圖卡,1 隱藏 |
|
||||
| `gvfg_playback_get_delivery_stats(p, stats)` | 影像呈現與略過等計數 |
|
||||
| `gvfg_playback_strerror(status)` | 靜態英文錯誤字串,不可 free |
|
||||
|
||||
狀態碼為 OK、EINVAL、ESTATE、EOUTPUT、EQUEUE_FULL、EDISCONTINUITY、EAUDIO;
|
||||
@@ -817,6 +793,7 @@ stop/reset 是取消,不是無損 EOS drain。
|
||||
|
||||
先呼叫 `gvfg_playback_default_config(&config)`,不需要自行填 struct_size。
|
||||
start 會複製設定;只接受停止狀態的 handle,不會代替 caller 停掉既有播放。
|
||||
一般使用者保留 `max_video_frames`、`max_audio_ms`、`max_video_bytes` 的預設值即可;這三項是進階容量上限,僅在有明確記憶體或待播容量需求時調整,不代表固定播放延遲。
|
||||
|
||||
| 欄位 | 預設值 | 限制與語意 |
|
||||
|---|---|---|
|
||||
@@ -870,7 +847,7 @@ submit 會複製實際影像列範圍,frame ID 僅作身分/統計資訊,
|
||||
| -1 | `GVFG_PLAYBACK_EINVAL` | 修正 NULL、格式、尺寸、對齊、struct_size 或 config 範圍 |
|
||||
| -2 | `GVFG_PLAYBACK_ESTATE` | 檢查是否 start、模式是否啟用該路、單張操作是否在停止且已綁窗狀態 |
|
||||
| -3 | `GVFG_PLAYBACK_EOUTPUT` | 檢查 WASAPI/GPU/視窗/記憶體及重啟流程;不能假設會自動恢復 |
|
||||
| -4 | `GVFG_PLAYBACK_EQUEUE_FULL` | 保留的未接受狀態;先 release SDK frame,不可持有擷取資源等待 |
|
||||
| -4 | `GVFG_PLAYBACK_EQUEUE_FULL` | 保留值,目前 API 不回傳;queue 壓力由核心自動處理,單筆資料超出容量回傳 EINVAL |
|
||||
| -5 | `GVFG_PLAYBACK_EDISCONTINUITY` | 協調 producer,重設時間軸;新音訊格式須以新 config stop/start |
|
||||
| -6 | `GVFG_PLAYBACK_EAUDIO` | 影音模式的監聽音效已因輸出故障停用,影像繼續;提示一次,繼續獨立擷取/錄影。此 handle 不再接受音訊,重建 handle 才重試音效 |
|
||||
|
||||
@@ -901,7 +878,6 @@ submit 會複製實際影像列範圍,frame ID 僅作身分/統計資訊,
|
||||
| `get_preview_info(p, info)` | 回傳影像資訊;尚未建立 Preview 時為零值 |
|
||||
| `get_preview_stats(p, stats)` | 回傳呈現 FPS/計數;尚未建立 Preview 時為零值 |
|
||||
| `set_signal_connected(p, connected)` | 僅接受 0/1,預設 1。0 顯示 helper 內建圖卡、1 隱藏。可在 attach 前設定,跨 stop/start/reset/reattach 保留;與 attach/destroy 在 HWND 執行緒序列化。圖卡隨視窗縮放,detach/destroy 釋放。此 API 不查詢 Capture、不更動影格或同步、不依 FPS 判斷訊號 |
|
||||
| `get_delivery_stats(p, stats)` | 回傳底層 Preview delivery 計數;不包含共用核心提前退休的所有過期影格 |
|
||||
| `strerror(status)` | 靜態字串,不可 free;未知值回傳 unknown error 文字 |
|
||||
|
||||
函式完整名稱皆為 `gvfg_playback_` 加上表中名稱。getters 的輸出指標不可 NULL。
|
||||
|
||||
Reference in New Issue
Block a user