pub struct VaapiDecoder { /* private fields */ }vaapi only.Expand description
A hardware decoder on a VA driver, with the interface of
NativeDecoder: open it from a demuxed
track, push samples in decode order, take pictures by presentation time.
H.264 (progressive, MBAFF and field-coded, 8-bit 4:2:0), HEVC (Main
and Main 10), VP9 (profiles 0 and 2) and AV1 (Main, 8- and 10-bit 4:2:0). Other streams are refused at new, and
Decoder then decodes them natively.
Implementations§
Source§impl VaapiDecoder
impl VaapiDecoder
Sourcepub fn new(track: &VideoTrack) -> Result<Self, String>
pub fn new(track: &VideoTrack) -> Result<Self, String>
Open a session for track.
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 (length-prefixed NAL units) to the decoder, in decode order. Its picture is read back before this returns.
Sourcepub fn set_pool(&mut self, pool: FramePool)
pub fn set_pool(&mut self, pool: FramePool)
Copy pictures into buffers from pool (see
FramePool), to be given back there.
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.
Sourcepub fn take_frame(&mut self, pts: i64) -> Option<DecodedFrame>
pub fn take_frame(&mut self, pts: i64) -> Option<DecodedFrame>
take, but the planes.
Sourcepub fn take_picture(&mut self, pts: i64) -> Option<Picture>
pub fn take_picture(&mut self, pts: i64) -> Option<Picture>
take, as the hardware left the picture where it can:
NV12, or P010 above 8 bits, rows copied out of the surface and
nothing converted, for a caller converting on the GPU. AV1 with film
grain comes as planes, the grain added by the CPU.
Auto Trait Implementations§
impl !RefUnwindSafe for VaapiDecoder
impl !Send for VaapiDecoder
impl !Sync for VaapiDecoder
impl !UnwindSafe for VaapiDecoder
impl Forget for VaapiDecoder
impl Freeze for VaapiDecoder
impl Move for VaapiDecoder
impl Unpin for VaapiDecoder
impl UnsafeUnpin for VaapiDecoder
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
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> ⓘ
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> ⓘ
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