Add GPU text overlays and streamline SDK conversion paths

- add an internal DirectWrite/Direct2D OSD core for YUY2 and Y210 with configurable position, font size, RGB color, and up to 32 printable ASCII characters

- expose per-channel OSD set/clear APIs and blend only the visible overlay rectangle on the GPU while preserving the frame read/release contract and tracking native versus processed buffer ownership

- convert native YUY2/Y210 directly to BGRA8, RGB10A2, or NV12 with reusable output resources, avoiding unnecessary FP16 intermediates and scene copies

- draw native-size and reduced previews directly to the swapchain and allocate an FP16 intermediate only for enlarged previews while retaining the existing upload queue and format support

- bump the SDK version to 1.0.2, fix the installed customer API reference path, update conversion and OSD documentation, and remove the old 0922 SDK archive

Validation: git diff --cached --check passed before commit. No SDK rebuild or hardware runtime validation was performed in this commit pass.
This commit is contained in:
Mark.lin
2026-10-15 16:18:30 +08:00
parent b3aecf4c6d
commit f0beaff35f
18 changed files with 1565 additions and 1129 deletions
@@ -0,0 +1,79 @@
#ifndef GVFG_OSD_H
#define GVFG_OSD_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GVFG_OSD_MAX_TEXT_CHARACTERS 32u
typedef void *gvfg_osd_handle;
typedef enum gvfg_osd_status_t
{
GVFG_OSD_OK = 0,
GVFG_OSD_EINVAL = -1,
GVFG_OSD_ENOMEM = -2,
GVFG_OSD_ERENDER = -3
} gvfg_osd_status_t;
typedef enum gvfg_osd_pixel_format_t
{
GVFG_OSD_PIXFMT_YUY2 = 1,
GVFG_OSD_PIXFMT_Y210 = 2
} gvfg_osd_pixel_format_t;
/*
* Generates an off-line OSD surface using the Arial system font. Text is
* restricted to printable ASCII and at most GVFG_OSD_MAX_TEXT_CHARACTERS
* characters. color_rgb is 0xRRGGBB.
* Output YUV uses BT.709 limited range. The mask is one coverage byte per
* pixel: 0 is transparent and 255 is fully covered.
*/
typedef struct gvfg_osd_config_t
{
uint32_t struct_size;
uint32_t width;
uint32_t height;
uint32_t pixel_format;
const char *text;
uint32_t text_length;
int32_t x;
int32_t y;
uint32_t font_size_px;
uint32_t color_rgb;
} gvfg_osd_config_t;
/* All buffers are caller-owned and are used only for the duration of render. */
typedef struct gvfg_osd_output_t
{
uint32_t struct_size;
void *yuv_data;
uint64_t yuv_size;
uint32_t yuv_stride;
void *mask_data;
uint64_t mask_size;
uint32_t mask_stride;
} gvfg_osd_output_t;
gvfg_osd_status_t gvfg_osd_create(
gvfg_osd_handle *out_handle);
void gvfg_osd_destroy(
gvfg_osd_handle handle);
gvfg_osd_status_t gvfg_osd_render(
gvfg_osd_handle handle,
const gvfg_osd_config_t *config,
const gvfg_osd_output_t *output);
const char *gvfg_osd_strerror(
gvfg_osd_status_t status);
#ifdef __cplusplus
}
#endif
#endif