Match the GigabyteLib event model

Compared with 82933f8:

- remove the public event-mask setter, getter, mask type, exports, and per-channel mask state

- always register and forward the complete event set created by GvfgCreateEvents

- keep audio enablement as the only event-creation choice exposed to applications

- preserve event polling, signal recovery, format notifications, capture, format switching, zero-copy, and register access

- update customer and architecture documentation to remove the obsolete event-mask controls
This commit is contained in:
Mark.lin
2026-09-14 12:16:53 +08:00
parent 82933f8967
commit 2a3ad7aa6d
9 changed files with 7 additions and 115 deletions
-3
View File
@@ -201,9 +201,6 @@ audio API 不是 zero-copy,但上層仍使用和 video 相同的 read/release
channel 選擇的模式。
- `gvfg_open_channel(handle, device_index, channel)`:開啟列舉所得裝置,channel
必須為 `GVFG_CHANNEL_0` 或 `GVFG_CHANNEL_1`。
- `gvfg_set_channel_event_mask(handle, channel, mask)`:在 open 前設定指定 channel
要註冊及通知的事件;預設 `GVFG_EVENT_MASK_ALL`。DMA event 為擷取必要項目,
不受 mask 控制。
- `gvfg_start_channel(handle, channel)`:開始指定 channel 擷取。若目前無訊號,成功進入訊號監看模式;此時
frame read 會 timeout,訊號接上後 SDK 會自動開始擷取。
- `gvfg_stop(handle)`:停止擷取;重複呼叫仍回傳成功。
+2 -19
View File
@@ -168,9 +168,8 @@ delivery timing,不是 driver 或硬體 capture timestamp。
`gvfg_event_t` 是 `gvfg_poll_channel_event()` 的輸出。呼叫前將結構清零並把
`struct_size` 設為 `sizeof(gvfg_event_t)`。`type` 是上述事件型別。
`gvfg_event_mask_t` 提供對應的 `GVFG_EVENT_MASK_*` bit,可在 channel open 前用
`gvfg_set_channel_event_mask()` 組合。預設為 `GVFG_EVENT_MASK_ALL`;mask 為 0
表示不註冊選用的 plug/unplug/format-change driver event,也不送出 SDK 衍生事件。
GigabyteLib 會建立並註冊完整的 channel event 集合;使用者直接透過
`gvfg_poll_channel_event()` 接收,不另外設定 event mask。
### 1.12 `gvfg_handle`
@@ -232,22 +231,6 @@ gvfg_status_t gvfg_open_channel(gvfg_handle handle,
對同一 handle 可分別 open CH0、CH1;第二個 channel 共用同一個 Windows device
handle,但擁有獨立 backend stream 狀態。已開啟 channel 時不可切換 device index。
### 1.17 `gvfg_set_channel_event_mask`/`gvfg_get_channel_event_mask`
```c
gvfg_status_t gvfg_set_channel_event_mask(gvfg_handle handle,
int channel_index,
uint32_t event_mask);
gvfg_status_t gvfg_get_channel_event_mask(gvfg_handle handle,
int channel_index,
uint32_t *out_event_mask);
```
- `set` 必須在指定 channel open 前呼叫。
- `event_mask` 只能包含 `GVFG_EVENT_MASK_*`;預設為 `GVFG_EVENT_MASK_ALL`。
- VIDEO_DMA 是擷取必要事件,不受此 mask 控制。
- 關閉 plug/unplug/format-change event 也會停用對應的自動 recovery。
### 1.18 Zero-copy mode selection
```c
-1
View File
@@ -41,7 +41,6 @@ frame ownership 與 timeout 契約,不再直接操作 driver IOCTL 或 FPGA re
| `deviceConnection` | CH0、CH1 共用的 Windows device connection |
| `channels[2]` | CH0、CH1 facade session;未 open 時為 null |
| `channelErrors[2]` | 每條 channel 最近一次詳細錯誤 |
| `eventMasks[2]` | open 前設定的 channel event mask |
| `currentIndex` | 此 handle 已綁定的 device index;`-1` 表示尚未綁定 |
| `zeroCopyRequested[2]` | 各 channel open 前獨立選擇的 delivery mode |
-7
View File
@@ -120,11 +120,6 @@ struct gvfg_handle_t
2
> channels;
std::array<uint32_t, 2> eventMasks{
GVFG_EVENT_MASK_ALL,
GVFG_EVENT_MASK_ALL
};
int currentIndex = -1;
std::array<bool, 2> zeroCopyRequested{false, false};
};
@@ -212,8 +207,6 @@ struct gvfg_channel_session_t
int currentIndex;
uint32_t selectedChannel;
bool zeroCopyRequested;
uint32_t eventMask;
std::atomic<bool> running;
bool readInProgress;
bool frameHeld;