pub struct NalUnit<'a> { /* private fields */ }Expand description
Borrowed H.264 NAL payload and decoded header fields.
The payload starts at the NAL header byte and aliases the input Annex-B buffer. It does not include the three- or four-byte start code.
Implementations§
Source§impl<'a> NalUnit<'a>
impl<'a> NalUnit<'a>
Sourcepub fn new_from_h264_payload(payload: &'a [u8]) -> Result<Self>
pub fn new_from_h264_payload(payload: &'a [u8]) -> Result<Self>
Interpret a non-empty payload using the H.264 one-byte NAL header.
§Errors
Returns an error when payload is empty.
Sourcepub const fn nal_unit_type(self) -> u8
pub const fn nal_unit_type(self) -> u8
Return the H.264 nal_unit_type header field.
Sourcepub const fn reference_idc(self) -> u8
pub const fn reference_idc(self) -> u8
Return the H.264 nal_ref_idc header field.
Sourcepub const fn payload(self) -> &'a [u8] ⓘ
pub const fn payload(self) -> &'a [u8] ⓘ
Return the borrowed payload including its NAL header byte.
Sourcepub const fn start_code_offset(self) -> Option<usize>
pub const fn start_code_offset(self) -> Option<usize>
Return the source Annex-B start-code byte offset, when parsed from a stream.
Sourcepub const fn start_code_len(self) -> usize
pub const fn start_code_len(self) -> usize
Return the source Annex-B start-code width, or zero for a raw payload.
Trait Implementations§
impl<'a> Copy for NalUnit<'a>
impl<'a> Eq for NalUnit<'a>
impl<'a> StructuralPartialEq for NalUnit<'a>
Auto Trait Implementations§
impl<'a> Forget for NalUnit<'a>
impl<'a> Freeze for NalUnit<'a>
impl<'a> Move for NalUnit<'a>
impl<'a> RefUnwindSafe for NalUnit<'a>
impl<'a> Send for NalUnit<'a>
impl<'a> Sync for NalUnit<'a>
impl<'a> Unpin for NalUnit<'a>
impl<'a> UnsafeUnpin for NalUnit<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for NalUnit<'a>where
&'a [u8]: UnwindSafe,
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