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>

source

pub fn get_encode_guid_count(&self) -> Result<u32, NvencError>

source

pub fn get_encode_preset_config( &self, encode: GUID, preset: GUID ) -> Result<EncodeConfig, NvencError>

source

pub fn initialize(&self, init_params: &InitParams) -> Result<(), NvencError>

source

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

source

pub fn alloc_output_buffer( self_: &Rc<Self> ) -> Result<OutputBuffer<'lib>, NvencError>

source

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.

source

pub fn end_stream(&self) -> Result<(), NvencError>

End the encoder stream

According to the nvenc docs, this can be called multiple times.

source

pub fn get_sequence_parameter_sets(&self) -> Result<Vec<u8>, NvencError>

Trait Implementations§

source§

impl<'lib> Drop for Encoder<'lib>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> 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>,

§

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>,

§

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.