Struct dynlink_nvidia_encode::api::Encoder
source · pub struct Encoder<'lib> { /* private fields */ }
Expand description
The lifetime ’lib refers to the shared library.
Implementations§
source§impl<'lib> Encoder<'lib>
impl<'lib> Encoder<'lib>
pub fn get_encode_guid_count(&self) -> Result<u32, NvencError>
pub fn get_encode_preset_config( &self, encode: GUID, preset: GUID ) -> Result<EncodeConfig, NvencError>
pub fn initialize(&self, init_params: &InitParams) -> Result<(), NvencError>
sourcepub fn alloc_input_buffer(
self_: &Rc<Self>,
width: u32,
height: u32,
format: BufferFormat
) -> Result<InputBuffer<'lib>, NvencError>
pub fn alloc_input_buffer( self_: &Rc<Self>, width: u32, height: u32, format: BufferFormat ) -> Result<InputBuffer<'lib>, NvencError>
Allocate a new buffer managed by NVIDIA Video SDK
pub fn alloc_output_buffer( self_: &Rc<Self> ) -> Result<OutputBuffer<'lib>, NvencError>
sourcepub fn encode_picture(
&self,
input: &InputBuffer<'_>,
output: &OutputBuffer<'_>,
pitch: usize,
pts: Duration
) -> Result<(), NvencError>
pub fn encode_picture( &self, input: &InputBuffer<'_>, output: &OutputBuffer<'_>, pitch: usize, pts: Duration ) -> Result<(), NvencError>
Main entry to encode a video frame with a given presentation time stamp.
Note that since enablePTD is true, this may return NV_ENC_ERR_NEED_MORE_INPUT which should not be treated as a fatal error.
sourcepub fn end_stream(&self) -> Result<(), NvencError>
pub fn end_stream(&self) -> Result<(), NvencError>
End the encoder stream
According to the nvenc docs, this can be called multiple times.
pub fn get_sequence_parameter_sets(&self) -> Result<Vec<u8>, NvencError>
Trait Implementations§
Auto Trait Implementations§
impl<'lib> Freeze for Encoder<'lib>
impl<'lib> RefUnwindSafe for Encoder<'lib>
impl<'lib> !Send for Encoder<'lib>
impl<'lib> !Sync for Encoder<'lib>
impl<'lib> Unpin for Encoder<'lib>
impl<'lib> UnwindSafe for Encoder<'lib>
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
Mutably borrows from an owned value. Read more