diff --git a/docs/GVFG_CUSTOMER_API.md b/docs/GVFG_CUSTOMER_API.md index 796ab45..20a8c63 100644 --- a/docs/GVFG_CUSTOMER_API.md +++ b/docs/GVFG_CUSTOMER_API.md @@ -225,8 +225,6 @@ Customer event 保持 driver-neutral: - `GVFG_EVENT_SIGNAL_CONNECTED` - `GVFG_EVENT_SIGNAL_DISCONNECTED` -- `GVFG_EVENT_CAPTURE_PAUSED` -- `GVFG_EVENT_CAPTURE_RESUMED` Frame interrupts、IRQ bit numbers、IRQ masks 都是 internal details,不應出現在 `gvfg_capture.h`。 diff --git a/docs/GVFG_INTERNAL_NOTES.md b/docs/GVFG_INTERNAL_NOTES.md index 0584792..353ac90 100644 --- a/docs/GVFG_INTERNAL_NOTES.md +++ b/docs/GVFG_INTERNAL_NOTES.md @@ -174,8 +174,6 @@ Customer event 保持 driver-neutral: ```text GVFG_EVENT_SIGNAL_CONNECTED GVFG_EVENT_SIGNAL_DISCONNECTED -GVFG_EVENT_CAPTURE_PAUSED -GVFG_EVENT_CAPTURE_RESUMED ``` Video IRQ handling 是 `sdk/gvfg/src/backend/pcies2mm` 內部細節。IRQ bit numbers、 diff --git a/samples/gvfg_qt_preview/mainwindow.cpp b/samples/gvfg_qt_preview/mainwindow.cpp index 5f8f40c..cfbca2e 100644 --- a/samples/gvfg_qt_preview/mainwindow.cpp +++ b/samples/gvfg_qt_preview/mainwindow.cpp @@ -46,7 +46,6 @@ namespace void highlightBlock(const QString &text) override { if (text.contains(QStringLiteral("SIGNAL_DISCONNECTED")) || - text.contains(QStringLiteral("CAPTURE_PAUSED")) || text.contains(QStringLiteral("failed"), Qt::CaseInsensitive) || text.contains(QStringLiteral("error"), Qt::CaseInsensitive)) { @@ -61,7 +60,6 @@ namespace } if (text.contains(QStringLiteral("SIGNAL_CONNECTED")) || - text.contains(QStringLiteral("CAPTURE_RESUMED")) || text.contains(QStringLiteral("recovered"), Qt::CaseInsensitive)) setFormat(0, text.size(), recoveryFormat_); } @@ -145,10 +143,6 @@ namespace return QStringLiteral("SIGNAL_CONNECTED"); case GVFG_EVENT_SIGNAL_DISCONNECTED: return QStringLiteral("SIGNAL_DISCONNECTED"); - case GVFG_EVENT_CAPTURE_PAUSED: - return QStringLiteral("CAPTURE_PAUSED"); - case GVFG_EVENT_CAPTURE_RESUMED: - return QStringLiteral("CAPTURE_RESUMED"); default: return QStringLiteral("UNKNOWN"); } diff --git a/sdk/gvfg/include/gvfg_capture.h b/sdk/gvfg/include/gvfg_capture.h index a4447c5..3d88ed5 100644 --- a/sdk/gvfg/include/gvfg_capture.h +++ b/sdk/gvfg/include/gvfg_capture.h @@ -168,9 +168,7 @@ extern "C" { GVFG_EVENT_UNKNOWN = 0, GVFG_EVENT_SIGNAL_CONNECTED = 1, - GVFG_EVENT_SIGNAL_DISCONNECTED = 2, - GVFG_EVENT_CAPTURE_PAUSED = 3, - GVFG_EVENT_CAPTURE_RESUMED = 4 + GVFG_EVENT_SIGNAL_DISCONNECTED = 2 } gvfg_event_type_t; typedef struct diff --git a/sdk/gvfg/src/backend/pcies2mm/pcies2mm_backend_types.h b/sdk/gvfg/src/backend/pcies2mm/pcies2mm_backend_types.h index 3d1a840..fe2ecd2 100644 --- a/sdk/gvfg/src/backend/pcies2mm/pcies2mm_backend_types.h +++ b/sdk/gvfg/src/backend/pcies2mm/pcies2mm_backend_types.h @@ -83,33 +83,21 @@ typedef struct pcies2mm_debug_state_t typedef enum pcies2mm_event_type_t { - PCIES2MM_EVENT_VIDEO_IRQ = 1, - PCIES2MM_EVENT_PLUG_IN = 2, - PCIES2MM_EVENT_PLUG_OUT = 3, - PCIES2MM_EVENT_CAPTURE_PAUSED = 4, - PCIES2MM_EVENT_CAPTURE_RESUMED = 5 + PCIES2MM_EVENT_PLUG_IN = 1, + PCIES2MM_EVENT_PLUG_OUT = 2 } pcies2mm_event_type_t; enum { - PCIES2MM_EVENT_MASK_VIDEO_IRQ = 1u << 0, - PCIES2MM_EVENT_MASK_PLUG_IN = 1u << 1, - PCIES2MM_EVENT_MASK_PLUG_OUT = 1u << 2, - PCIES2MM_EVENT_MASK_CAPTURE_PAUSED = 1u << 3, - PCIES2MM_EVENT_MASK_CAPTURE_RESUMED = 1u << 4, - PCIES2MM_EVENT_MASK_HOTPLUG = PCIES2MM_EVENT_MASK_PLUG_IN | - PCIES2MM_EVENT_MASK_PLUG_OUT | - PCIES2MM_EVENT_MASK_CAPTURE_PAUSED | - PCIES2MM_EVENT_MASK_CAPTURE_RESUMED, - PCIES2MM_EVENT_MASK_DEFAULT = PCIES2MM_EVENT_MASK_HOTPLUG, - PCIES2MM_EVENT_MASK_ALL = PCIES2MM_EVENT_MASK_VIDEO_IRQ | PCIES2MM_EVENT_MASK_HOTPLUG + PCIES2MM_EVENT_MASK_PLUG_IN = 1u << 0, + PCIES2MM_EVENT_MASK_PLUG_OUT = 1u << 1, + PCIES2MM_EVENT_MASK_DEFAULT = PCIES2MM_EVENT_MASK_PLUG_IN | + PCIES2MM_EVENT_MASK_PLUG_OUT }; typedef struct pcies2mm_event_t { pcies2mm_event_type_t type; - uint32_t irq_bit; - uint32_t irq_mask; uint64_t timestamp_ns; } pcies2mm_event_t; diff --git a/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.cpp b/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.cpp index 25a5641..697f6f8 100644 --- a/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.cpp +++ b/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.cpp @@ -105,16 +105,10 @@ namespace { switch (type) { - case PCIES2MM_EVENT_VIDEO_IRQ: - return PCIES2MM_EVENT_MASK_VIDEO_IRQ; case PCIES2MM_EVENT_PLUG_IN: return PCIES2MM_EVENT_MASK_PLUG_IN; case PCIES2MM_EVENT_PLUG_OUT: return PCIES2MM_EVENT_MASK_PLUG_OUT; - case PCIES2MM_EVENT_CAPTURE_PAUSED: - return PCIES2MM_EVENT_MASK_CAPTURE_PAUSED; - case PCIES2MM_EVENT_CAPTURE_RESUMED: - return PCIES2MM_EVENT_MASK_CAPTURE_RESUMED; default: return 0; } @@ -795,8 +789,6 @@ namespace gvfg::internal return; } - emit_event(PCIES2MM_EVENT_VIDEO_IRQ, channel == 0 ? 0 : 4, video_irq_mask_bit()); - const DWORD bytes = static_cast(frame_size_bytes()); size_t slotIndex = frame_ring_.size(); uint8_t *slotData = nullptr; @@ -869,8 +861,7 @@ namespace gvfg::internal { signal_present_.store(true, std::memory_order_release); signal_presence_known_.store(true, std::memory_order_release); - emit_event(PCIES2MM_EVENT_PLUG_IN, channel == 0 ? 0 : 4, video_irq_mask_bit()); - emit_event(PCIES2MM_EVENT_CAPTURE_RESUMED, channel == 0 ? 0 : 4, video_irq_mask_bit()); + emit_event(PCIES2MM_EVENT_PLUG_IN); } { @@ -886,8 +877,6 @@ namespace gvfg::internal write_reg(video_base() + VIDEO_DMA_EN_OFFSET, 0); write_reg(video_base() + VIDEO_EN_OFFSET, 0); capture_active_ = false; - emit_event(PCIES2MM_EVENT_CAPTURE_PAUSED, channel == 0 ? 0 : 4, video_irq_mask_bit()); - resume_capture_from_signal(channel); frame_cv_.notify_all(); @@ -908,7 +897,7 @@ namespace gvfg::internal signal_probe_active_.store(false, std::memory_order_release); signal_present_.store(true, std::memory_order_release); signal_presence_known_.store(true, std::memory_order_release); - emit_event(PCIES2MM_EVENT_PLUG_IN, channel == 0 ? 0 : 4, video_irq_mask_bit()); + emit_event(PCIES2MM_EVENT_PLUG_IN); resume_capture_from_signal(channel); frame_cv_.notify_all(); data_cv_.notify_all(); @@ -922,8 +911,7 @@ namespace gvfg::internal write_reg(video_base() + VIDEO_DMA_EN_OFFSET, 0); write_reg(video_base() + VIDEO_EN_OFFSET, 0); capture_active_ = false; - emit_event(PCIES2MM_EVENT_PLUG_OUT, channel == 0 ? 0 : 4, video_irq_mask_bit()); - emit_event(PCIES2MM_EVENT_CAPTURE_PAUSED, channel == 0 ? 0 : 4, video_irq_mask_bit()); + emit_event(PCIES2MM_EVENT_PLUG_OUT); { std::lock_guard lock(mutex_); @@ -973,7 +961,6 @@ namespace gvfg::internal stream_error_ = false; stats_.state = PCIES2MM_STREAM_RUNNING; } - emit_event(PCIES2MM_EVENT_CAPTURE_RESUMED, channel == 0 ? 0 : 4, video_irq_mask_bit()); frame_cv_.notify_all(); data_cv_.notify_all(); return true; @@ -1055,7 +1042,7 @@ namespace gvfg::internal data_cv_.notify_all(); } - void PcieS2mmCaptureSession::emit_event(pcies2mm_event_type_t type, uint32_t irqBit, uint32_t irqMask) const + void PcieS2mmCaptureSession::emit_event(pcies2mm_event_type_t type) const { pcies2mm_event_callback_t callback = nullptr; void *user = nullptr; @@ -1070,8 +1057,6 @@ namespace gvfg::internal pcies2mm_event_t event{}; event.type = type; - event.irq_bit = irqBit; - event.irq_mask = irqMask; event.timestamp_ns = steady_now_ns(); callback(&event, user); } diff --git a/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.h b/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.h index 0462a6c..898d01b 100644 --- a/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.h +++ b/sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.h @@ -64,7 +64,7 @@ namespace gvfg::internal bool resume_capture_from_signal(uint32_t channel); bool refresh_stream_from_registers(bool resizeRing); void publish_frame(size_t slotIndex, size_t bytes); - void emit_event(pcies2mm_event_type_t type, uint32_t irqBit, uint32_t irqMask) const; + void emit_event(pcies2mm_event_type_t type) const; pcies2mm_status_t fail(pcies2mm_status_t status, const char *where, DWORD winerr = GetLastError()) const; void set_last_error(const std::string &message) const; diff --git a/sdk/gvfg/src/gvfg_capture.cpp b/sdk/gvfg/src/gvfg_capture.cpp index 0a4db87..ee410a8 100644 --- a/sdk/gvfg/src/gvfg_capture.cpp +++ b/sdk/gvfg/src/gvfg_capture.cpp @@ -131,10 +131,6 @@ namespace return GVFG_EVENT_SIGNAL_CONNECTED; case PCIES2MM_EVENT_PLUG_OUT: return GVFG_EVENT_SIGNAL_DISCONNECTED; - case PCIES2MM_EVENT_CAPTURE_PAUSED: - return GVFG_EVENT_CAPTURE_PAUSED; - case PCIES2MM_EVENT_CAPTURE_RESUMED: - return GVFG_EVENT_CAPTURE_RESUMED; default: return GVFG_EVENT_UNKNOWN; }