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

Abstraction around the output bitstream buffer that is used as the output of the encoding.

The buffer is automatically destroyed when dropped.

Implementations§

source§

impl<'a> Bitstream<'a>

source

pub fn lock(&mut self) -> Result<BitstreamLock<'_, '_>, EncodeError>

Lock the output bitstream.

On a successful lock you get a BitstreamLock which can be used to access the bitstream data as well as any other information the encoder provides when locking a bitstream.

This function will block until a lock is acquired. For the non-blocking version see Bitstream::try_lock.

See NVIDIA docs.

Errors

Could error if we run out of memory.

source

pub fn try_lock(&mut self) -> Result<BitstreamLock<'_, '_>, EncodeError>

Non-blocking version of Bitstream::lock. See it for more info.

This function will return an error with ErrorKind::LockBusy if the lock is currently busy.

Errors

Could error if we run out of memory.

An error with ErrorKind::LockBusy could be returned if the lock is currently busy. This is a recoverable error and the client should retry in a few milliseconds.

Trait Implementations§

source§

impl<'a> Debug for Bitstream<'a>

source§

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

Formats the value using the given formatter. Read more
source§

impl Drop for Bitstream<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl EncoderOutput for Bitstream<'_>

source§

fn handle(&mut self) -> *mut c_void

Get the handle of the output resource.
source§

impl Send for Bitstream<'_>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Bitstream<'a>

§

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

§

impl<'a> Unpin for Bitstream<'a>

§

impl<'a> UnwindSafe for Bitstream<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.