Files
GVFG_Standalone/GVFG_SDK/sdk/giga_ioctl/README.md
T
Mark.lin cae4a04612 Separate the SDK and Qt sample build projects
Compared with f612cfd:

- Move the capture SDK, private IOCTL wrapper, and optional preview helper under GVFG_SDK with an independent top-level CMake project and version source.

- Move the Qt preview application into GVFG_Qt_Sample and consume prebuilt SDK DLLs and compiler-specific import libraries through imported CMake targets instead of compiling SDK sources as subdirectories.

- Resolve Qt Creator configuration-specific SDK build directories automatically, copy the three runtime DLLs beside the sample executable, and keep missing MSVC or MinGW artifacts as explicit configure errors.

- Update Release and Debug packaging scripts to read SDK and sample outputs separately, and update the repository build instructions for the two-project workflow.

- Preserve the pre-existing uncommitted device display-name suffix change outside this commit.

Validation: independent MSVC SDK configure/build and independent Qt MSVC sample configure/build passed; the sample build graph contains no SDK implementation sources; git diff --check passed. No MinGW link, runtime launch, capture, audio playback, or hardware validation was run.
2026-09-11 13:28:56 +08:00

1.9 KiB

giga_ioctl

giga_ioctl is the private DLL boundary between GVFG and the Windows driver. It owns only the driver IOCTL codes, request layouts, and thin DeviceIoControl wrappers. Device discovery, capture state, threads, buffers, and frame lifetime remain in gvfg.

When adding a driver operation:

  1. Add its private IOCTL code and request layout to src/giga_ioctl_private.h.
  2. Add a small C function to include/giga_ioctl.h.
  3. Implement that function in src/giga_ioctl.cpp with no capture state.
  4. Preserve GetLastError() on driver failures; use ERROR_INVALID_PARAMETER for invalid caller output pointers.

The header is an internal dependency of gvfg; it is not a customer SDK API.

Current audio ABI

At this private driver boundary the implemented audio path is copy-out, not zero-copy:

  • Register GIGA_IOCTL_EVENT_AUDIO_DMA and GIGA_IOCTL_EVENT_EXTRA_AUDIO_FRAME as wake-up notifications.
  • Start and stop capture with giga_ioctl_start_video_audio() and giga_ioctl_stop_video_audio().
  • Query the PCM layout and driver frame size with giga_ioctl_get_audio_info().
  • Read the next available driver frame with giga_ioctl_get_audio_frame() and frame_index == UINT32_MAX. The returned byte count is the valid copy size.

The extra-frame events mean that more frames are ready and the consumer should drain promptly. They do not transfer ownership of a frame. Audio zero-copy is a future driver capability and is intentionally not exposed here until its acquire/release ABI is complete.

This does not define the customer-facing ownership contract. gvfg copies the driver result into its SDK-owned delivery buffer and exposes it as gvfg_audio_frame_t; applications acquire it with gvfg_read_channel_audio_frame() and return the unchanged token with gvfg_release_channel_audio_frame(). Driver frame size, destination capacity, and valid-byte output parameters remain private below that public API.