Files
GVFG_Standalone/GVFG_SDK/helpers/gvfg_preview/include/gvfg_preview.h
T
Mark.lin bfa9397f6b Unify playback and harden preview/audio recovery for SDK 2.1.1
- expose one gvfg_playback DLL backed by static audio and preview libraries, retain public backend data types, and remove obsolete standalone backend exports and unused wrappers

- centralize playback clocks, timestamp scheduling, optional synchronization, audio rate correction, bounded queues and fallback while preserving legacy statistics buffer sizes

- provide still-image presentation and a helper-owned NO SIGNAL card with explicit SDK connection state, native window ownership and UI-thread checks

- report monitoring failures through EAUDIO without stopping video, retain the failed output state across timeline resets, and reject audio-only startup when output is unavailable

- make clearing an unconfigured preview a successful no-op so resetting before the first frame cannot leave playback stopped

- trace actual format-change events before event resets in Debug builds and refresh video metadata after plugin stream recovery while retaining the existing temporary HDMI lock bypass

- update SDK 2.1.1 public documentation, the playback guide and rendered API reference to describe the unified lifecycle, error handling and delivery boundaries

Validation: Full SDK Release build and git diff --cached --check passed. Native tests passed for video/reset lifecycle with synchronization enabled and disabled, signal-card lifecycle, bounded queue pressure and legacy statistics guards. Process-local WASAPI failure injection verified continued video, persistent monitoring failure and audio-only rejection; real WASAPI silence playback advanced the output clock in both synchronization modes. Public exports and rendered PDF pages/portable links were checked. No hardware capture, unplug/replug or long-running acoustic A/V synchronization test was performed.
2026-10-22 14:02:43 +08:00

76 lines
2.0 KiB
C

#pragma once
/* Public image and presentation types used by gvfg_playback.h. */
#include <stdint.h>
typedef enum
{
GVFG_PREVIEW_PIXFMT_YUY2 = 1,
GVFG_PREVIEW_PIXFMT_Y210 = 2,
GVFG_PREVIEW_PIXFMT_GRAY16 = 4,
/* Four interleaved 16-bit UNORM components per pixel: R, G, B, A. */
GVFG_PREVIEW_PIXFMT_RGBA16 = 5,
/* DICOM native YBR_FULL_422: four 16-bit words per pixel pair,
* ordered Y0, Y1, Cb, Cr. Values are right-aligned to bit_depth. */
GVFG_PREVIEW_PIXFMT_DICOM_YBR_FULL_422 = 6
} gvfg_preview_pixel_format_t;
typedef struct
{
const void *data;
uint64_t data_size;
int width;
int height;
int pixel_format; /* gvfg_preview_pixel_format_t */
int bit_depth;
int row_bytes;
uint64_t frame_id;
} gvfg_preview_frame_t;
typedef struct
{
int active;
int width;
int height;
int bit_depth;
char pixel_format[32];
char adapter_name[160];
int adapter_index;
} gvfg_preview_info_t;
/*
* Preview presentation statistics.
*
* present_fps counts only frames accepted by DXGI Present, not physical
* scanout. The rate uses successful presents from the most recent five
* seconds. Pending preview replacements are excluded from this rate.
*/
typedef struct
{
double present_fps;
uint64_t presented_frames;
uint64_t skipped_presents;
} gvfg_preview_stats_t;
/* Lifetime counters (until shutdown); configure/clear do not reset them.
* submitted = presented + replaced + busy + failed + cancelled + in_flight.
* Presented means DXGI accepted Present, not proof of physical scanout.
* Failed render API calls are counted by the caller, not in submitted.
*/
typedef struct
{
uint64_t submitted;
uint64_t presented;
uint64_t replaced; /* Queued frames discarded after the 50 ms age limit. */
uint64_t busy;
uint64_t failed;
uint64_t cancelled;
uint64_t in_flight;
uint64_t last_presented_id;
uint64_t present_busy;
uint64_t slots_busy;
uint64_t last_busy_id;
} gvfg_preview_delivery_stats_t;