Skip to main content

nvenc_struct_ver

Function nvenc_struct_ver 

Source
fn nvenc_struct_ver(s: NvStruct, maj: u32, min: u32) -> u32
Expand description

Assemble the NVENCAPI_STRUCT_VERSION word for struct s at API version (maj, min).

The 32-bit word packs, from NvStruct::rev and the API version:

  1. API major in bits 0-7, API minor in bits 24-27.
  2. Struct revision (rev) in bits 16-23.
  3. Magic 0x7 in bits 28-30.
  4. The 1<<31 flag in bit 31, when this struct sets it at this version.

For the pinned nvcodec-sys headers this reproduces the compile-time NV_ENC_*_VER constants exactly, so a current driver is stamped byte-for-byte identically to its own SDK’s constant; the version_tests module asserts that identity.