feat(gvfg): add event-driven signal and format control

Expose gvfg_set_video_format() so applications select YUY2 or Y210 through the SDK while the backend temporarily writes absolute register 0x80 (0=YUY2, 1=Y210).

Define RX mode/timing lock registers and treat the input as connected only when both lock values equal one. Keep plug/unplug/format monitoring active for the complete open-channel lifetime, cache signal metadata, and avoid unnecessary resolution/format register queries.

Keep the driver-compatible GET_VIDEO_DONE_INDEX then GET_FRAME sequence, reject repeated consecutive DMA done indexes, and calculate capture FPS over a one-second delivery window instead of adjacent-frame timing.

Update the standalone Qt sample with YUY2/Y210 selection, event-driven signal state, no-signal Start blocking, streamlined diagnostics, and monitoring that remains active while capture is stopped.

Validation: Release builds completed for the Visual Studio and Qt Creator build trees; the Qt Creator DLL relink requires the consuming viewer to be closed when it is running.
This commit is contained in:
Mark.lin
2026-08-14 16:36:38 +08:00
parent 17fb9bfabd
commit d7500ed9fd
8 changed files with 396 additions and 114 deletions
+6 -2
View File
@@ -40,13 +40,15 @@ private:
void showPreviewWindow();
void showFullscreenPreviewWindow();
bool openDevice();
bool applyOutputFormat();
void closeDevice();
void startCapture();
void stopCapture();
bool applyPreview();
void updatePreviewSourceSize(const gvfg_signal_status_t &signal);
void updatePreviewSourceSize();
void updateSignalStatus();
void processPendingEvents();
void updateSignalStatus(bool queryHardware = true);
void updateUiState();
void showError(const QString &apiName, gvfg_status_t status);
void openLogFile();
@@ -76,7 +78,9 @@ private:
std::atomic<double> previewCallAverageMs_{0.0};
std::atomic<double> previewCallMaximumMs_{0.0};
std::atomic<uint64_t> previewCallSamples_{0};
QTimer *signalStatusTimer_ = nullptr;
QTimer *runtimeStatusTimer_ = nullptr;
gvfg_signal_status_t cachedSignalStatus_{};
bool haveCachedSignalStatus_ = false;
QString lastSignalStatusText_;
QString lastLoggedInputStatus_;
#if GVFG_INTERNAL_DIAGNOSTICS