pub struct NvdecDecoder { /* private fields */ }Available on 64-bit and crate feature
nvidia and (Linux or Windows) only.Expand description
A hardware decoder on an NVIDIA GPU’s NVDEC engine, with the interface of
NativeDecoder: open it from a demuxed
track, push samples in decode order, take pictures by presentation time.
H.264, HEVC (8- and 10-bit), VP9 and AV1, in 4:2:0, as far as the GPU’s generation decodes them (AV1 from Ampere on).
Implementations§
Source§impl NvdecDecoder
impl NvdecDecoder
Sourcepub fn new(track: &VideoTrack) -> Result<Self, String>
pub fn new(track: &VideoTrack) -> Result<Self, String>
Open a session for track’s codec and configuration.
Sourcepub fn push(
&mut self,
sample: &[u8],
pts: i64,
_dts: i64,
_duration: i64,
) -> Result<(), String>
pub fn push( &mut self, sample: &[u8], pts: i64, _dts: i64, _duration: i64, ) -> Result<(), String>
Hand one coded frame to the decoder, in decode order: an MP4 sample (length-prefixed NAL units), a VP9 frame or superframe, or an AV1 temporal unit. Its picture is copied to the host before this returns.
Sourcepub fn take(&mut self, pts: i64) -> Option<Vec<u8>>
pub fn take(&mut self, pts: i64) -> Option<Vec<u8>>
The picture for presentation time pts as tightly packed BGRA, if it
has been decoded. Frames before pts are dropped on the way past.
Sourcepub fn take_frame(&mut self, pts: i64) -> Option<DecodedFrame>
pub fn take_frame(&mut self, pts: i64) -> Option<DecodedFrame>
take, but the planes at the stream’s bit depth.
pub fn take_packed(&mut self, pts: i64) -> Option<PackedFrame>
Trait Implementations§
Source§impl Drop for NvdecDecoder
impl Drop for NvdecDecoder
Auto Trait Implementations§
impl !Send for NvdecDecoder
impl !Sync for NvdecDecoder
impl Forget for NvdecDecoder
impl Freeze for NvdecDecoder
impl Move for NvdecDecoder
impl RefUnwindSafe for NvdecDecoder
impl Unpin for NvdecDecoder
impl UnsafeUnpin for NvdecDecoder
impl UnwindSafe for NvdecDecoder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more