enum NvStruct {
Show 13 variants
FunctionList,
OpenSessionExParams,
Config,
RcParams,
PresetConfig,
InitializeParams,
ReconfigureParams,
RegisterResource,
MapInputResource,
CreateBitstreamBuffer,
PicParams,
LockBitstream,
CapsParam,
}Expand description
The NVENCAPI structs this encoder must stamp with a per-SDK version word — enumerated here precisely because getting that word exactly right is the whole mechanism that lets one compiled binary satisfy every driver’s version check.
Each NVENCAPI struct carries a version field that the driver validates against the exact word
its own SDK defined for that struct, rejecting anything else outright with
NV_ENC_ERR_INVALID_VERSION. Only two parts of that packed word move between SDKs — the struct
revision (bits 16-23) and the 1<<31 flag — so a session that has down-negotiated to an
older API cannot send the compiled 13.0 words; it must stamp each struct with precisely the word
that older SDK defined, while a current driver still receives its own native word. Naming the
structs here is what lets NvStruct::rev supply the per-version (revision, flag) and
nvenc_struct_ver assemble the word.
Variants§
FunctionList
OpenSessionExParams
Config
RcParams
PresetConfig
InitializeParams
ReconfigureParams
RegisterResource
MapInputResource
CreateBitstreamBuffer
PicParams
LockBitstream
CapsParam
Implementations§
Source§impl NvStruct
impl NvStruct
Sourcefn rev(self, api: u32) -> (u32, bool)
fn rev(self, api: u32) -> (u32, bool)
The (struct revision, 1<<31 flag) this struct uses under the SDK identified by the
packed API version api ((major<<4)|minor) — the only two sub-fields that move between
SDKs, and thus the entire per-version knowledge stamping a struct actually needs.
The revision lands in bits 16-23 of the version word and the flag in bit 31; every other bit
is fixed, which is exactly why matching just these two on api reproduces each SDK’s word.
The values are transcribed verbatim from nvEncodeAPI.h at the FFmpeg nv-codec-headers tags
n10.0.26.2, n11.0.10.3, n11.1.5.3, n12.0.16.1, n12.1.14.0, n12.2.72.0, and n13.0.19.0, so they
are ground truth rather than anything derived that could drift. Structs whose layout is stable
across those SDKs return a constant pair; the rest match on api. 10.0 is the negotiation
floor, so the oldest match arm also covers anything below it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NvStruct
impl RefUnwindSafe for NvStruct
impl Send for NvStruct
impl Sync for NvStruct
impl Unpin for NvStruct
impl UnsafeUnpin for NvStruct
impl UnwindSafe for NvStruct
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more