pub struct NalSampleWriter { /* private fields */ }Expand description
One H.264 / HEVC track’s conversion from packets to stored samples (4-byte length-prefixed NALs). See the module docs.
Implementations§
Source§impl NalSampleWriter
impl NalSampleWriter
Sourcepub fn new(extradata: &[u8], hevc: bool) -> NalSampleWriter
pub fn new(extradata: &[u8], hevc: bool) -> NalSampleWriter
A writer for an H.264 (hevc == false) or HEVC track with this
extradata.
Sourcepub fn framing(&self) -> Option<NalFraming>
pub fn framing(&self) -> Option<NalFraming>
The track’s framing, once its first packet has settled it.
Sourcepub fn write<'a>(
&mut self,
data: &'a [u8],
out: &mut Vec<u8>,
) -> Result<Stored<'a>, String>
pub fn write<'a>( &mut self, data: &'a [u8], out: &mut Vec<u8>, ) -> Result<Stored<'a>, String>
Store one packet. Length-prefixed packets keep every byte, their
parameter sets included: with 4-byte lengths the packet is the sample
(Stored::Verbatim); otherwise each NAL is re-prefixed with a 4-byte
length into out. Annex-B packets are converted into out as before,
their parameter sets returned rather than written. The error says why
a packet could not be stored without losing bytes.
Trait Implementations§
Source§impl Clone for NalSampleWriter
impl Clone for NalSampleWriter
Auto Trait Implementations§
impl Forget for NalSampleWriter
impl Freeze for NalSampleWriter
impl Move for NalSampleWriter
impl RefUnwindSafe for NalSampleWriter
impl Send for NalSampleWriter
impl Sync for NalSampleWriter
impl Unpin for NalSampleWriter
impl UnsafeUnpin for NalSampleWriter
impl UnwindSafe for NalSampleWriter
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