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:
Mark.lin
2026-11-04 16:53:41 +08:00
parent d6935df9ae
commit 5ebe03a2bb
23 changed files with 262 additions and 156 deletions
+5 -4
View File
@@ -48,12 +48,12 @@ if (st == GVFG_OK) {
## 3. Playback status 與非同步錯誤
Playback 的錯誤型別是 gvfg_playback_status_t:OK=0、EINVAL=-1、ESTATE=-2、
EOUTPUT=-3、EQUEUE_FULL=-4、EDISCONTINUITY=-5。
例如 Capture 的 -4 是 EIO,Playback 的 -4 是 queue full;這正是不能混用 strerror 的原因。
EOUTPUT=-3、EQUEUE_FULL=-4(保留值,目前 API 不回傳)、EDISCONTINUITY=-5、EAUDIO=-6。
例如 Capture 的 -4 是 EIO,Playback 的 -4 則是保留的 EQUEUE_FULL;兩套狀態碼不能混用 strerror。
submit 是接受/複製,不是實體輸出完成。其他非同步輸出失敗會由後續 submit 回報;
start 或 submit 成功不保證後續輸出一定正常。
目前輸出錯誤沒有自動重建裝置的保證,由 caller 協調停止與重啟。
影音模式遇到音訊輸出故障時,停用該 handle 的監聽音效,影像繼續播放;後續音訊 submit 回傳 EAUDIO。影音 start 也可能在音效開啟失敗時成功,應檢查後續音訊 submit。此停用狀態跨 stop/start/reset 保留,需先協調 producer,再銷毀並重建 Playback handle 才會重試音效;獨立擷取與錄音可繼續。純音訊模式的輸出故障回報 EOUTPUT。
| 情況 | ownership 與後續處理 |
|---|---|
@@ -62,7 +62,8 @@ start 或 submit 成功不保證後續輸出一定正常。
| read 成功,submit 拒收/失敗 | 仍 release 原始 token;若要重試,先保存應用程式自有副本 |
| Playback queue 壓力 | 自動進入獨立播放並略過過時資料;不因 queue 滿而停止擷取,單筆超出配置容量則是 EINVAL |
| Playback timestamp 不連續 | 協調 producer 後 reset;音訊格式改變用新 config stop/start |
| 過期預覽或 GPU busy 略過 | 計入 video_dropped,不當成 Capture failure |
| 過期預覽或 GPU busy 略過 | 不當成 Capture failure;公開 skipped_presents 僅涵蓋預覽端略過數,不包含同步核心提前捨棄的所有影格 |
| Playback EAUDIO | 提示一次監聽音效停用;繼續影像與獨立擷取/錄音,需重建 Playback handle 才重試音效 |
| Playback EOUTPUT | 檢查裝置/視窗與輸出路徑,明確決定重啟,不無限重試 |
## 4. 生命週期與 Demo