pub struct Nv12Planes {
buf: Vec<u8>,
start: [usize; 2],
pub stride: [usize; 2],
pub width: usize,
pub height: usize,
in_place: bool,
}Expand description
A frame’s 8-bit 4:2:0 picture as NV12, a luma plane and an interleaved chroma one, laid out
as an x264 session encodes it in place (x264_param_input_layout): each plane stride bytes
a row within a buffer padded and aligned as x264’s own frames are, which x264 reads without
copying it and writes the padding of. Tightly packed where the build has no x264, whose
OpenH264 session takes no such picture.
Fields§
§buf: Vec<u8>§start: [usize; 2]§stride: [usize; 2]§width: usize§height: usize§in_place: boolImplementations§
Source§impl Nv12Planes
impl Nv12Planes
Sourcepub fn new(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize) -> Self
Black planes for a width x height picture, both even.
Sourcepub fn planes(&self) -> (&[u8], &[u8])
pub fn planes(&self) -> (&[u8], &[u8])
The luma and chroma planes from their first pixel, stride bytes a row for the picture’s
rows.
Sourcepub fn planes_mut(&mut self) -> (&mut [u8], &mut [u8])
pub fn planes_mut(&mut self) -> (&mut [u8], &mut [u8])
Self::planes, to write.
Sourcepub fn id(&self) -> *const u8
pub fn id(&self) -> *const u8
The address of the first luma pixel, which names the picture to the session holding it
(H264EncoderWrapper::held_input).
fn extents(&self) -> (Range<usize>, Range<usize>)
Auto Trait Implementations§
impl Freeze for Nv12Planes
impl RefUnwindSafe for Nv12Planes
impl Send for Nv12Planes
impl Sync for Nv12Planes
impl Unpin for Nv12Planes
impl UnsafeUnpin for Nv12Planes
impl UnwindSafe for Nv12Planes
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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