EncoderInitParams

Struct EncoderInitParams 

Source
pub struct EncoderInitParams<'a> { /* private fields */ }
Expand description

A safe wrapper for NV_ENC_INITIALIZE_PARAMS, which is the encoder initialize parameter.

Implementations§

Source§

impl<'a> EncoderInitParams<'a>

Source

pub fn new(encode_guid: GUID, width: u32, height: u32) -> Self

Create a new builder for EncoderInitParams, which is a wrapper for NV_ENC_INITIALIZE_PARAMS.

Source

pub fn preset_guid(&mut self, preset_guid: GUID) -> &mut Self

Specifies the preset for encoding. If the preset GUID is set then the preset configuration will be applied before any other parameter.

Source

pub fn tuning_info(&mut self, tuning_info: NV_ENC_TUNING_INFO) -> &mut Self

Tuning Info of NVENC encoding(tuning_info is not applicable to H264 and HEVC meonly mode).

Source

pub fn encode_config( &mut self, encode_config: &'a mut NV_ENC_CONFIG, ) -> &mut Self

Specifies the advanced codec specific structure. If client has sent a valid codec config structure, it will override parameters set by the EncoderInitParams::preset_guid.

The client can query the interface for codec-specific parameters using Encoder::get_preset_config. It can then modify (if required) some of the codec config parameters and send down a custom config structure using this method. Even in this case the client is recommended to pass the same preset GUID it has used to get the config.

Source

pub fn display_aspect_ratio(&mut self, width: u32, height: u32) -> &mut Self

Specifies the display aspect ratio (H264/HEVC) or the render width/height (AV1).

Source

pub fn framerate(&mut self, numerator: u32, denominator: u32) -> &mut Self

Specifies the framerate in frames per second as a fraction numerator / denominator.

Source

pub fn enable_picture_type_decision(&mut self) -> &mut Self

Enable the Picture Type Decision to be taken by the NvEncodeAPI interface.

Trait Implementations§

Source§

impl<'a> Debug for EncoderInitParams<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for EncoderInitParams<'a>

§

impl<'a> RefUnwindSafe for EncoderInitParams<'a>

§

impl<'a> !Send for EncoderInitParams<'a>

§

impl<'a> !Sync for EncoderInitParams<'a>

§

impl<'a> Unpin for EncoderInitParams<'a>

§

impl<'a> !UnwindSafe for EncoderInitParams<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.