Struct nvidia_video_codec_sdk::safe::Bitstream
source · 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>
impl<'a> Bitstream<'a>
sourcepub fn lock(&mut self) -> Result<BitstreamLock<'_, '_>, EncodeError>
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.
sourcepub fn try_lock(&mut self) -> Result<BitstreamLock<'_, '_>, EncodeError>
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.