Streamline GigabyteLib capture control and diagnostics

Compared with d652f15:

- set the SDK release version to 1.0.0 for the new GigabyteLib backend and its required matching driver

- preserve GigabyteLib result codes and event names through the public SDK instead of translating vendor semantics

- expose cached Lib signal, SDI string fields, ErrorCount, and separate video/audio event counters for direct diagnostics

- serialize GigabyteLib capture calls and recover an active stream internally after a video input plugin event

- keep the SDK frame lifetime fence while following the current zero-copy contract without a vendor release call

- separate Sample logging and presentation counters from capture control, and report Lib-owned fields with explicit source names

- remove the manual Open Device control so Start lazily opens the selected device and revalidates VideoSignalLock once per request

- keep format selection side-effect free until Start opens the channel, then apply the selected output depth through GigabyteLib

- update the public API, diagnostics, architecture, error-handling, and build documentation for the simplified ownership model
This commit is contained in:
Mark.lin
2026-09-15 16:52:19 +08:00
parent d652f15369
commit 350e8e519c
27 changed files with 693 additions and 549 deletions
+17 -15
View File
@@ -78,16 +78,20 @@ extern "C"
GVFG_MAX_DEVICES = 16,
};
typedef enum
typedef int32_t gvfg_status_t;
enum
{
GVFG_OK = 0,
GVFG_EINVAL = -1, /* Invalid argument, such as NULL handle/output pointer. */
GVFG_ENODEV = -2, /* No GVFG capture device, or the device cannot be opened. */
GVFG_ESTATE = -3, /* API was called in the wrong state. */
GVFG_EIO = -4, /* Driver/backend I/O failure. */
GVFG_EIO = -4, /* SDK-owned I/O, GPU, or internal extension failure. */
GVFG_ENOTSUP = -5, /* Requested feature or format is not supported. */
GVFG_ETIMEOUT = -6 /* Timed out waiting for driver/backend work. */
} gvfg_status_t;
};
/* Positive return values are unmodified GigabyteLib GVFG_HRESULT values. */
typedef enum
{
@@ -169,6 +173,7 @@ extern "C"
int level_b;
uint32_t st352_payload;
uint32_t error_count;
char signal_lock_name[32];
char mode_name[16];
char resolution_name[64];
char fps_name[24];
@@ -243,12 +248,9 @@ extern "C"
typedef enum
{
GVFG_EVENT_UNKNOWN = 0,
GVFG_EVENT_SIGNAL_CONNECTED = 1,
GVFG_EVENT_SIGNAL_DISCONNECTED = 2,
/* First complete frame after stream start, plug-in, or format recovery is ready. */
GVFG_EVENT_STREAM_READY = 3,
/* Input format is changing; pause use of resources created for the old format. */
GVFG_EVENT_FORMAT_CHANGE_BEGIN = 4
GVFG_EVENT_VIDEO_FORMAT_CHANGED = 1,
GVFG_EVENT_VIDEO_INPUT_PLUGIN = 2,
GVFG_EVENT_VIDEO_INPUT_UNPLUG = 3
} gvfg_event_type_t;
typedef struct
@@ -324,7 +326,7 @@ extern "C"
* - GVFG_OK on success.
* - GVFG_EINVAL if handle is NULL or channel_index is invalid.
* - GVFG_ENODEV if the device cannot be opened.
* - GVFG_EIO for driver/backend failures.
* - A positive, unmodified GVFG_HRESULT for GigabyteLib failures.
*/
GVFG_API gvfg_status_t gvfg_open_channel(
GVFG_PARAM_IN gvfg_handle handle,
@@ -413,7 +415,7 @@ extern "C"
* - GVFG_ESTATE if capture is not running or a previous frame has not been
* released.
* - GVFG_ETIMEOUT if no frame is ready before timeout_ms expires.
* - GVFG_EIO for driver/backend failures.
* - A positive, unmodified GVFG_HRESULT for GigabyteLib failures.
*
* In copy mode the returned data pointer is owned by the SDK. In zero-copy
* mode it points to driver-owned memory. In both modes it remains valid
@@ -604,7 +606,7 @@ extern "C"
GVFG_PARAM_IN int channel_index,
GVFG_PARAM_OUT gvfg_runtime_info_t *out_info);
/* Return the loaded GVFG runtime DLL version, for example "0.3.0". */
/* Return the loaded GVFG runtime DLL version, for example "1.0.0". */
GVFG_API const char *gvfg_get_version(void);
/* Convert a gvfg_pixel_format_t value to a static English format name. */
@@ -624,11 +626,11 @@ extern "C"
GVFG_PARAM_IN gvfg_status_t status);
/*
* Copy the most recent detailed fault or rejected API call for one
* channel. Normal frame-read and event-poll timeouts are not stored.
* Copy the most recent SDK-owned detailed fault or rejected API call for
* one channel. Positive GigabyteLib results and normal timeouts are not stored.
* A successful gvfg_start_channel() begins a new diagnostic lifetime.
*/
GVFG_API gvfg_status_t gvfg_get_channel_last_error_detail(
GVFG_API gvfg_status_t gvfg_get_channel_last_sdk_error_detail(
GVFG_PARAM_IN gvfg_handle handle,
GVFG_PARAM_IN int channel_index,
GVFG_PARAM_OUT char *out_message,