Refactor SDK to pure pull-based capture API

- Remove customer-facing SDK preview APIs and preview structs
- Strip D3D preview/render pipeline from gvfg.dll
- Keep gvfg.dll focused on capture, frame ownership, runtime status, and events
- Move Qt preview rendering into sample-owned private renderer
- Update Qt preview sample to render frames after gvfg_read_frame()
- Refresh customer API docs around read_frame/release_frame/poll_event flow
- Update architecture notes to mark preview as app/internal-tool code
This commit is contained in:
Mark.lin
2026-06-15 14:03:21 +08:00
parent c21f6981ea
commit 97971e6242
14 changed files with 947 additions and 1286 deletions
+8 -4
View File
@@ -2,12 +2,15 @@
#include <gvfg_capture.h>
#include "sample_preview_renderer.h"
#include <QString>
#include <QWidget>
#include <array>
#include <atomic>
#include <cstdint>
#include <thread>
class QCloseEvent;
class PreviewWindow;
@@ -46,17 +49,18 @@ private:
void updateUiState();
void showError(const QString &apiName, gvfg_status_t status);
void appendLog(const QString &message);
static void onFrame(const gvfg_frame_t *frame, void *user);
static void onEvent(const gvfg_event_t *event, void *user);
static void onError(gvfg_status_t status, const char *message, void *user);
void captureReadLoop();
void joinCaptureThread();
Ui::MainWindow *ui_ = nullptr;
PreviewWindow *previewWindow_ = nullptr;
std::array<gvfg_device_info_t, GVFG_MAX_DEVICES> devices_{};
int deviceCount_ = 0;
gvfg_handle handle_ = nullptr;
SamplePreviewRenderer previewRenderer_;
bool captureRunning_ = false;
std::atomic<bool> captureStop_{false};
std::thread captureThread_;
std::atomic<uint64_t> frameCount_{0};
QTimer *signalStatusTimer_ = nullptr;
QString lastSignalStatusText_;