Remove obsolete capture pause events

This commit is contained in:
Mark.lin
2026-07-29 15:52:51 +08:00
parent d9f194c1ab
commit 9124930e98
8 changed files with 12 additions and 55 deletions
-2
View File
@@ -225,8 +225,6 @@ Customer event 保持 driver-neutral:
- `GVFG_EVENT_SIGNAL_CONNECTED` - `GVFG_EVENT_SIGNAL_CONNECTED`
- `GVFG_EVENT_SIGNAL_DISCONNECTED` - `GVFG_EVENT_SIGNAL_DISCONNECTED`
- `GVFG_EVENT_CAPTURE_PAUSED`
- `GVFG_EVENT_CAPTURE_RESUMED`
Frame interrupts、IRQ bit numbers、IRQ masks 都是 internal details,不應出現在 Frame interrupts、IRQ bit numbers、IRQ masks 都是 internal details,不應出現在
`gvfg_capture.h`。 `gvfg_capture.h`。
-2
View File
@@ -174,8 +174,6 @@ Customer event 保持 driver-neutral:
```text ```text
GVFG_EVENT_SIGNAL_CONNECTED GVFG_EVENT_SIGNAL_CONNECTED
GVFG_EVENT_SIGNAL_DISCONNECTED GVFG_EVENT_SIGNAL_DISCONNECTED
GVFG_EVENT_CAPTURE_PAUSED
GVFG_EVENT_CAPTURE_RESUMED
``` ```
Video IRQ handling 是 `sdk/gvfg/src/backend/pcies2mm` 內部細節。IRQ bit numbers、 Video IRQ handling 是 `sdk/gvfg/src/backend/pcies2mm` 內部細節。IRQ bit numbers、
-6
View File
@@ -46,7 +46,6 @@ namespace
void highlightBlock(const QString &text) override void highlightBlock(const QString &text) override
{ {
if (text.contains(QStringLiteral("SIGNAL_DISCONNECTED")) || if (text.contains(QStringLiteral("SIGNAL_DISCONNECTED")) ||
text.contains(QStringLiteral("CAPTURE_PAUSED")) ||
text.contains(QStringLiteral("failed"), Qt::CaseInsensitive) || text.contains(QStringLiteral("failed"), Qt::CaseInsensitive) ||
text.contains(QStringLiteral("error"), Qt::CaseInsensitive)) text.contains(QStringLiteral("error"), Qt::CaseInsensitive))
{ {
@@ -61,7 +60,6 @@ namespace
} }
if (text.contains(QStringLiteral("SIGNAL_CONNECTED")) || if (text.contains(QStringLiteral("SIGNAL_CONNECTED")) ||
text.contains(QStringLiteral("CAPTURE_RESUMED")) ||
text.contains(QStringLiteral("recovered"), Qt::CaseInsensitive)) text.contains(QStringLiteral("recovered"), Qt::CaseInsensitive))
setFormat(0, text.size(), recoveryFormat_); setFormat(0, text.size(), recoveryFormat_);
} }
@@ -145,10 +143,6 @@ namespace
return QStringLiteral("SIGNAL_CONNECTED"); return QStringLiteral("SIGNAL_CONNECTED");
case GVFG_EVENT_SIGNAL_DISCONNECTED: case GVFG_EVENT_SIGNAL_DISCONNECTED:
return QStringLiteral("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: default:
return QStringLiteral("UNKNOWN"); return QStringLiteral("UNKNOWN");
} }
+1 -3
View File
@@ -168,9 +168,7 @@ extern "C"
{ {
GVFG_EVENT_UNKNOWN = 0, GVFG_EVENT_UNKNOWN = 0,
GVFG_EVENT_SIGNAL_CONNECTED = 1, GVFG_EVENT_SIGNAL_CONNECTED = 1,
GVFG_EVENT_SIGNAL_DISCONNECTED = 2, GVFG_EVENT_SIGNAL_DISCONNECTED = 2
GVFG_EVENT_CAPTURE_PAUSED = 3,
GVFG_EVENT_CAPTURE_RESUMED = 4
} gvfg_event_type_t; } gvfg_event_type_t;
typedef struct typedef struct
@@ -83,33 +83,21 @@ typedef struct pcies2mm_debug_state_t
typedef enum pcies2mm_event_type_t typedef enum pcies2mm_event_type_t
{ {
PCIES2MM_EVENT_VIDEO_IRQ = 1, PCIES2MM_EVENT_PLUG_IN = 1,
PCIES2MM_EVENT_PLUG_IN = 2, PCIES2MM_EVENT_PLUG_OUT = 2
PCIES2MM_EVENT_PLUG_OUT = 3,
PCIES2MM_EVENT_CAPTURE_PAUSED = 4,
PCIES2MM_EVENT_CAPTURE_RESUMED = 5
} pcies2mm_event_type_t; } pcies2mm_event_type_t;
enum enum
{ {
PCIES2MM_EVENT_MASK_VIDEO_IRQ = 1u << 0, PCIES2MM_EVENT_MASK_PLUG_IN = 1u << 0,
PCIES2MM_EVENT_MASK_PLUG_IN = 1u << 1, PCIES2MM_EVENT_MASK_PLUG_OUT = 1u << 1,
PCIES2MM_EVENT_MASK_PLUG_OUT = 1u << 2, PCIES2MM_EVENT_MASK_DEFAULT = PCIES2MM_EVENT_MASK_PLUG_IN |
PCIES2MM_EVENT_MASK_CAPTURE_PAUSED = 1u << 3, PCIES2MM_EVENT_MASK_PLUG_OUT
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
}; };
typedef struct pcies2mm_event_t typedef struct pcies2mm_event_t
{ {
pcies2mm_event_type_t type; pcies2mm_event_type_t type;
uint32_t irq_bit;
uint32_t irq_mask;
uint64_t timestamp_ns; uint64_t timestamp_ns;
} pcies2mm_event_t; } pcies2mm_event_t;
@@ -105,16 +105,10 @@ namespace
{ {
switch (type) switch (type)
{ {
case PCIES2MM_EVENT_VIDEO_IRQ:
return PCIES2MM_EVENT_MASK_VIDEO_IRQ;
case PCIES2MM_EVENT_PLUG_IN: case PCIES2MM_EVENT_PLUG_IN:
return PCIES2MM_EVENT_MASK_PLUG_IN; return PCIES2MM_EVENT_MASK_PLUG_IN;
case PCIES2MM_EVENT_PLUG_OUT: case PCIES2MM_EVENT_PLUG_OUT:
return PCIES2MM_EVENT_MASK_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: default:
return 0; return 0;
} }
@@ -795,8 +789,6 @@ namespace gvfg::internal
return; return;
} }
emit_event(PCIES2MM_EVENT_VIDEO_IRQ, channel == 0 ? 0 : 4, video_irq_mask_bit());
const DWORD bytes = static_cast<DWORD>(frame_size_bytes()); const DWORD bytes = static_cast<DWORD>(frame_size_bytes());
size_t slotIndex = frame_ring_.size(); size_t slotIndex = frame_ring_.size();
uint8_t *slotData = nullptr; uint8_t *slotData = nullptr;
@@ -869,8 +861,7 @@ namespace gvfg::internal
{ {
signal_present_.store(true, std::memory_order_release); signal_present_.store(true, std::memory_order_release);
signal_presence_known_.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);
emit_event(PCIES2MM_EVENT_CAPTURE_RESUMED, channel == 0 ? 0 : 4, video_irq_mask_bit());
} }
{ {
@@ -886,8 +877,6 @@ namespace gvfg::internal
write_reg(video_base() + VIDEO_DMA_EN_OFFSET, 0); write_reg(video_base() + VIDEO_DMA_EN_OFFSET, 0);
write_reg(video_base() + VIDEO_EN_OFFSET, 0); write_reg(video_base() + VIDEO_EN_OFFSET, 0);
capture_active_ = false; capture_active_ = false;
emit_event(PCIES2MM_EVENT_CAPTURE_PAUSED, channel == 0 ? 0 : 4, video_irq_mask_bit());
resume_capture_from_signal(channel); resume_capture_from_signal(channel);
frame_cv_.notify_all(); frame_cv_.notify_all();
@@ -908,7 +897,7 @@ namespace gvfg::internal
signal_probe_active_.store(false, std::memory_order_release); signal_probe_active_.store(false, std::memory_order_release);
signal_present_.store(true, std::memory_order_release); signal_present_.store(true, std::memory_order_release);
signal_presence_known_.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); resume_capture_from_signal(channel);
frame_cv_.notify_all(); frame_cv_.notify_all();
data_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_DMA_EN_OFFSET, 0);
write_reg(video_base() + VIDEO_EN_OFFSET, 0); write_reg(video_base() + VIDEO_EN_OFFSET, 0);
capture_active_ = false; capture_active_ = false;
emit_event(PCIES2MM_EVENT_PLUG_OUT, channel == 0 ? 0 : 4, video_irq_mask_bit()); emit_event(PCIES2MM_EVENT_PLUG_OUT);
emit_event(PCIES2MM_EVENT_CAPTURE_PAUSED, channel == 0 ? 0 : 4, video_irq_mask_bit());
{ {
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
@@ -973,7 +961,6 @@ namespace gvfg::internal
stream_error_ = false; stream_error_ = false;
stats_.state = PCIES2MM_STREAM_RUNNING; stats_.state = PCIES2MM_STREAM_RUNNING;
} }
emit_event(PCIES2MM_EVENT_CAPTURE_RESUMED, channel == 0 ? 0 : 4, video_irq_mask_bit());
frame_cv_.notify_all(); frame_cv_.notify_all();
data_cv_.notify_all(); data_cv_.notify_all();
return true; return true;
@@ -1055,7 +1042,7 @@ namespace gvfg::internal
data_cv_.notify_all(); 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; pcies2mm_event_callback_t callback = nullptr;
void *user = nullptr; void *user = nullptr;
@@ -1070,8 +1057,6 @@ namespace gvfg::internal
pcies2mm_event_t event{}; pcies2mm_event_t event{};
event.type = type; event.type = type;
event.irq_bit = irqBit;
event.irq_mask = irqMask;
event.timestamp_ns = steady_now_ns(); event.timestamp_ns = steady_now_ns();
callback(&event, user); callback(&event, user);
} }
@@ -64,7 +64,7 @@ namespace gvfg::internal
bool resume_capture_from_signal(uint32_t channel); bool resume_capture_from_signal(uint32_t channel);
bool refresh_stream_from_registers(bool resizeRing); bool refresh_stream_from_registers(bool resizeRing);
void publish_frame(size_t slotIndex, size_t bytes); 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; pcies2mm_status_t fail(pcies2mm_status_t status, const char *where, DWORD winerr = GetLastError()) const;
void set_last_error(const std::string &message) const; void set_last_error(const std::string &message) const;
-4
View File
@@ -131,10 +131,6 @@ namespace
return GVFG_EVENT_SIGNAL_CONNECTED; return GVFG_EVENT_SIGNAL_CONNECTED;
case PCIES2MM_EVENT_PLUG_OUT: case PCIES2MM_EVENT_PLUG_OUT:
return GVFG_EVENT_SIGNAL_DISCONNECTED; 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: default:
return GVFG_EVENT_UNKNOWN; return GVFG_EVENT_UNKNOWN;
} }