feat: align GVFG output with YUY2

- expose YUY2 across the public API, preview helper, backend, and GPU conversion paths while translating the legacy FPGA format value internally
- correct YUY2 chroma byte interpretation and update customer/internal documentation
- centralize the Standalone SDK version and expose it through gvfg_get_version
- show the SDK version in the sample and enable preview-window controls only after the first valid frame
- close and disable external preview windows when capture stops
This commit is contained in:
Mark.lin
2026-08-13 16:14:16 +08:00
parent a5b86e5872
commit 17fb9bfabd
20 changed files with 302 additions and 63 deletions
+15 -6
View File
@@ -18,6 +18,10 @@
#include <type_traits>
#include <vector>
#ifndef GVFG_VERSION_STRING
#define GVFG_VERSION_STRING "0.0.0"
#endif
using namespace gvfg::internal;
namespace
@@ -137,8 +141,8 @@ namespace
{
switch (fmt)
{
case PCIES2MM_PIXFMT_YVYU:
return GVFG_PIXFMT_YVYU;
case PCIES2MM_PIXFMT_YUY2:
return GVFG_PIXFMT_YUY2;
case PCIES2MM_PIXFMT_Y210:
return GVFG_PIXFMT_Y210;
default:
@@ -150,8 +154,8 @@ namespace
{
switch (fmt)
{
case GVFG_PIXFMT_YVYU:
return "YVYU";
case GVFG_PIXFMT_YUY2:
return "YUY2";
case GVFG_PIXFMT_Y210:
return "Y210";
default:
@@ -172,7 +176,7 @@ namespace
int &outStride)
{
uint64_t bytesPerPixel = 0;
if (pixelFormat == PCIES2MM_PIXFMT_YVYU)
if (pixelFormat == PCIES2MM_PIXFMT_YUY2)
bytesPerPixel = 2;
else if (pixelFormat == PCIES2MM_PIXFMT_Y210)
bytesPerPixel = 4;
@@ -386,7 +390,7 @@ struct gvfg_handle_t
const uint32_t configureWidth = waitingForSignal ? 2 : width;
const uint32_t configureHeight = waitingForSignal ? 1 : height;
const pcies2mm_pixel_format_t configureFormat =
waitingForSignal || pixelFormat == PCIES2MM_PIXFMT_UNKNOWN ? PCIES2MM_PIXFMT_YVYU : pixelFormat;
waitingForSignal || pixelFormat == PCIES2MM_PIXFMT_UNKNOWN ? PCIES2MM_PIXFMT_YUY2 : pixelFormat;
pcies2mm_stream_desc_t desc{};
desc.width = configureWidth;
@@ -849,6 +853,11 @@ extern "C"
return GVFG_OK;
}
const char *gvfg_get_version(void)
{
return GVFG_VERSION_STRING;
}
const char *gvfg_pixel_format_name(int pixel_format)
{
return pixel_format_name(pixel_format);