From aeef7860dd7a22c3cd2b1dd9d7eb354e18f6c2cf Mon Sep 17 00:00:00 2001 From: "Mark.lin" Date: Tue, 9 Jun 2026 14:19:06 +0800 Subject: [PATCH] Remove legacy signal status fields --- docs/GVFG_CUSTOMER_API.md | 14 +++----------- sdk/gvfg/include/gvfg_capture.h | 9 +++------ sdk/gvfg/src/gvfg_capture.cpp | 24 ------------------------ 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/docs/GVFG_CUSTOMER_API.md b/docs/GVFG_CUSTOMER_API.md index d80b80b..92bdb9b 100644 --- a/docs/GVFG_CUSTOMER_API.md +++ b/docs/GVFG_CUSTOMER_API.md @@ -269,9 +269,7 @@ typedef struct { int width; int height; - double fps; - int bit_depth; - char pixel_format[32]; + gvfg_fpga_signal_status_t fpga; } gvfg_signal_status_t; ``` @@ -279,9 +277,7 @@ typedef struct | --- | --- | | `width` | input 寬度 | | `height` | input 高度 | -| `fps` | Legacy field;GVFG 固定回 `0`,請使用 `fpga.frame_rate_*` | -| `bit_depth` | Legacy SDK source-buffer bit depth;FPGA bit depth 請使用 `fpga.bit_depth` | -| `pixel_format` | Legacy SDK source-buffer format;callback buffer format 請使用 `gvfg_runtime_info_t::delivered_frame` | +| `fpga` | FPGA raw/decoded signal metadata | ### Customer buffer vs FPGA signal @@ -324,9 +320,6 @@ typedef struct { int width; /* Signal width in pixels, from FPGA when available. */ int height; /* Signal height in pixels, from FPGA when available. */ - double fps; /* Legacy field; GVFG leaves this 0. Use fpga.frame_rate_* instead. */ - int bit_depth; /* Legacy SDK source-buffer field. Prefer fpga.* and runtime delivered_frame. */ - char pixel_format[32]; /* Legacy SDK source-buffer field. Prefer fpga.* and runtime delivered_frame. */ gvfg_fpga_signal_status_t fpga; /* Raw/decoded FPGA signal metadata. */ } gvfg_signal_status_t; ``` @@ -900,7 +893,7 @@ gvfg_signal_status_t sig = {0}; gvfg_status_t st = gvfg_get_signal_status(handle, &sig); if (st == GVFG_OK) { - printf("Signal legacy: %dx%d\n", + printf("Signal: %dx%d\n", sig.width, sig.height); @@ -1265,7 +1258,6 @@ wait_frame: deliver ## Current XDMA Notes - The current XDMA path exposes decoded FPGA signal metadata through `sig.fpga`. -- `sig.pixel_format` and `sig.bit_depth` are legacy SDK source-buffer fields. - The delivered customer callback buffer is reported by `gvfg_runtime_info_t::delivered_frame`. - `sig.fpga.bit_depth=10` does not by itself mean the delivered callback buffer is `Y210`; the current callback path reports BGRA8. - `sig.fpga.frame_rate_bits=0001` is not in the supported table, so the UI/API reports it as `--`. diff --git a/sdk/gvfg/include/gvfg_capture.h b/sdk/gvfg/include/gvfg_capture.h index 6dabe72..2d57a3e 100644 --- a/sdk/gvfg/include/gvfg_capture.h +++ b/sdk/gvfg/include/gvfg_capture.h @@ -127,9 +127,6 @@ typedef struct { int width; /* Signal width in pixels, from FPGA when available. */ int height; /* Signal height in pixels, from FPGA when available. */ - double fps; /* Legacy field; GVFG leaves this 0. Use fpga.frame_rate_* instead. */ - int bit_depth; /* Legacy SDK source-buffer bit depth. Prefer fpga.* and runtime delivered_frame. */ - char pixel_format[32]; /* Legacy SDK source-buffer format. Prefer fpga.* and runtime delivered_frame. */ gvfg_fpga_signal_status_t fpga; /* Raw/decoded FPGA signal metadata. */ } gvfg_signal_status_t; @@ -144,7 +141,7 @@ typedef struct typedef struct { - gvfg_signal_status_t input_signal; /* FPGA-reported signal metadata plus legacy buffer fields. */ + gvfg_signal_status_t input_signal; /* FPGA-reported signal metadata. */ gvfg_delivered_frame_info_t delivered_frame; /* Frame buffer delivered by gvfg.dll to the app. */ double capture_fps; /* Runtime FPS measured from backend frames seen by the SDK worker. */ uint64_t delivered_frames; /* Number of frames delivered to the app callback. */ @@ -406,8 +403,8 @@ GVFG_API gvfg_status_t gvfg_stop(gvfg_handle handle); * - GVFG_EINVAL if handle or out_status is NULL. * - GVFG_ENODEV if no valid signal information is available. * - * The FPGA metadata describes the hardware signal. The pixel_format and - * bit_depth fields describe the buffer format delivered by the customer API. + * The FPGA metadata describes the hardware signal. Use + * gvfg_runtime_info_t::delivered_frame for the callback buffer format. */ GVFG_API gvfg_status_t gvfg_get_signal_status(gvfg_handle handle, gvfg_signal_status_t *out_status); diff --git a/sdk/gvfg/src/gvfg_capture.cpp b/sdk/gvfg/src/gvfg_capture.cpp index 83e85d9..f1b78eb 100644 --- a/sdk/gvfg/src/gvfg_capture.cpp +++ b/sdk/gvfg/src/gvfg_capture.cpp @@ -158,27 +158,6 @@ namespace } } - const char *gdriver_pixel_format_name(gdriver_pixel_format_t fmt) - { - switch (fmt) - { - case GDRIVER_PIXFMT_YUY2: - return "YUY2"; - case GDRIVER_PIXFMT_Y210: - return "Y210"; - case GDRIVER_PIXFMT_RGB24: - return "RGB24"; - case GDRIVER_PIXFMT_NV12: - return "NV12"; - case GDRIVER_PIXFMT_P010: - return "P010"; - case GDRIVER_PIXFMT_YUV444: - return "YUV444"; - default: - return "UNKNOWN"; - } - } - bool fpga_field_valid(uint32_t mask, int bit) { return (mask & (1u << bit)) != 0; @@ -380,9 +359,6 @@ struct gvfg_handle_t haveSignalSize = fpgaWidthValid && fpgaHeightValid && fpgaWidthRaw != 0 && fpgaHeightRaw != 0; out.width = haveSignalSize ? static_cast(fpgaWidthRaw) : 0; out.height = haveSignalSize ? static_cast(fpgaHeightRaw) : 0; - out.fps = 0.0; - out.bit_depth = static_cast(bitDepth ? bitDepth : 8); - copy_cstr(out.pixel_format, sizeof(out.pixel_format), gdriver_pixel_format_name(pixelFormat)); out.fpga.valid_mask = fpgaValidMask; out.fpga.width_valid = fpgaWidthValid ? 1 : 0; out.fpga.height_valid = fpgaHeightValid ? 1 : 0;