Expose the remaining GigabyteLib queries

Compared with aac4edd:

- expose optional device capability and SDI detail queries through the public GVFG API

- use GvfgGetDevInfo only when an application requests device capabilities

- use GvfgGetSdiVideoInputInfo and GvfgStringifySdiVideoInputInfo only when an application requests SDI details

- return both native SDI values and the vendor-formatted mode, resolution, frame-rate, and scan strings

- source the device interface GUID directly from the supervisor-provided gvfgsdkapi.h

- preserve the existing capture path and all previous public exports
This commit is contained in:
Mark.lin
2026-09-14 10:59:37 +08:00
parent aac4eddaf7
commit 82933f8967
6 changed files with 115 additions and 2 deletions
@@ -238,6 +238,54 @@ gvfg_status_t GigabyteCaptureSession::get_signal_status(gvfg_signal_status_t &ou
return status;
}
gvfg_status_t GigabyteCaptureSession::get_device_capabilities(
gvfg_device_capabilities_t &out) const
{
const gvfg_status_t openStatus = ensure_vendor_channel_open();
if (openStatus != GVFG_OK)
return openStatus;
GVFG_DEV_INFO info{};
const gvfg_status_t status = from_vendor(GvfgGetDevInfo(context_, &info), "GvfgGetDevInfo");
if (status != GVFG_OK)
return status;
out = {};
out.video_channel_count = info.NumVideoChn;
out.has_audio = info.HasAudio ? 1 : 0;
return GVFG_OK;
}
gvfg_status_t GigabyteCaptureSession::get_sdi_info(gvfg_sdi_info_t &out) const
{
const gvfg_status_t openStatus = ensure_vendor_channel_open();
if (openStatus != GVFG_OK)
return openStatus;
GVFG_SDI_VIDEO_INFO info{};
gvfg_status_t status = from_vendor(
GvfgGetSdiVideoInputInfo(context_, channel_, &info), "GvfgGetSdiVideoInputInfo");
if (status != GVFG_OK)
return status;
GVFG_SDI_VIDEO_INFO_STR text{};
status = from_vendor(
GvfgStringifySdiVideoInputInfo(context_, &info, &text),
"GvfgStringifySdiVideoInputInfo");
if (status != GVFG_OK)
return status;
out = {};
out.connected = info.VideoSignalLock ? 1 : 0;
out.mode = info.Mode;
out.resolution = info.Resol;
out.fps = info.Fps;
out.progressive = info.Progressive ? 1 : 0;
out.level_b = info.LevelB ? 1 : 0;
out.st352_payload = info.St352Payload;
out.error_count = info.ErrorCount;
strncpy_s(out.mode_name, text.Mode, _TRUNCATE);
strncpy_s(out.resolution_name, text.Resol, _TRUNCATE);
strncpy_s(out.fps_name, text.Fps, _TRUNCATE);
strncpy_s(out.scan_name, text.Progressive, _TRUNCATE);
return GVFG_OK;
}
gvfg_status_t GigabyteCaptureSession::get_audio_format(GigabyteAudioInfo &out) const
{
const gvfg_status_t openStatus = ensure_vendor_channel_open();
@@ -47,6 +47,8 @@ namespace gvfg::internal
gvfg_status_t set_audio_enabled(bool enabled);
gvfg_status_t set_video_format(gvfg_pixel_format_t format);
gvfg_status_t get_signal_status(gvfg_signal_status_t &out) const;
gvfg_status_t get_device_capabilities(gvfg_device_capabilities_t &out) const;
gvfg_status_t get_sdi_info(gvfg_sdi_info_t &out) const;
gvfg_status_t get_audio_format(GigabyteAudioInfo &out) const;
gvfg_status_t set_event_callback(GigabyteEventCallback callback, void *user, uint32_t eventMask);
gvfg_status_t configure_stream();
@@ -1,4 +1,5 @@
#include "gigabyte_device.h"
#include "gvfgsdkapi.h"
#include <windows.h>
#include <setupapi.h>
@@ -10,8 +11,7 @@
namespace
{
// Device interface exported by pcie_s2mm_driver.
const GUID kGigabyteDeviceInterfaceGuid =
{0x8c47b9c3, 0x1faa, 0x4557, {0xbc, 0x1d, 0xf2, 0x25, 0xd2, 0x6c, 0x9e, 0x91}};
const GUID kGigabyteDeviceInterfaceGuid = GUID_DEVINTERFACE_GVFG100;
std::wstring device_property(HDEVINFO info, SP_DEVINFO_DATA &deviceInfo, DWORD property)
{