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>
impl<'a> EncoderInitParams<'a>
Sourcepub fn new(encode_guid: GUID, width: u32, height: u32) -> Self
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
.
Sourcepub fn preset_guid(&mut self, preset_guid: GUID) -> &mut Self
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.
Sourcepub fn tuning_info(&mut self, tuning_info: NV_ENC_TUNING_INFO) -> &mut Self
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).
Sourcepub fn encode_config(
&mut self,
encode_config: &'a mut NV_ENC_CONFIG,
) -> &mut Self
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.
Sourcepub fn display_aspect_ratio(&mut self, width: u32, height: u32) -> &mut Self
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).
Sourcepub fn framerate(&mut self, numerator: u32, denominator: u32) -> &mut Self
pub fn framerate(&mut self, numerator: u32, denominator: u32) -> &mut Self
Specifies the framerate in frames per second as a fraction
numerator / denominator
.
Sourcepub fn enable_picture_type_decision(&mut self) -> &mut Self
pub fn enable_picture_type_decision(&mut self) -> &mut Self
Enable the Picture Type Decision to be taken by the
NvEncodeAPI
interface.