[−][src]Struct h264_reader::rbsp::RbspBitReader
Methods
impl<'a> RbspBitReader<'a>[src]
pub fn new(buf: &'a [u8]) -> RbspBitReader<'a>[src]
pub fn read_ue(&mut self) -> Result<u32, BitReaderError>[src]
pub fn read_ue_named(
&mut self,
name: &'static str
) -> Result<u32, RbspBitReaderError>[src]
&mut self,
name: &'static str
) -> Result<u32, RbspBitReaderError>
pub fn read_se_named(
&mut self,
name: &'static str
) -> Result<i32, RbspBitReaderError>[src]
&mut self,
name: &'static str
) -> Result<i32, RbspBitReaderError>
pub fn read_bool_named(
&mut self,
name: &'static str
) -> Result<bool, RbspBitReaderError>[src]
&mut self,
name: &'static str
) -> Result<bool, RbspBitReaderError>
pub fn read_se(&mut self) -> Result<i32, BitReaderError>[src]
pub fn has_more_rbsp_data(&self) -> bool[src]
Methods from Deref<Target = BitReader<'a>>
pub fn relative_reader(&self) -> BitReader<'a>[src]
Returns a copy of current BitReader, with the difference that its position() returns positions relative to the position of the original BitReader at the construction time. After construction, both readers are otherwise completely independent, except of course for sharing the same source data.
use bitreader::BitReader; let bytes = &[0b11110000, 0b00001111]; let mut original = BitReader::new(bytes); assert_eq!(original.read_u8(4).unwrap(), 0b1111); assert_eq!(original.position(), 4); let mut relative = original.relative_reader(); assert_eq!(relative.position(), 0); assert_eq!(original.read_u8(8).unwrap(), 0); assert_eq!(relative.read_u8(8).unwrap(), 0); assert_eq!(original.position(), 12); assert_eq!(relative.position(), 8);
pub fn read_u8(&mut self, bit_count: u8) -> Result<u8, BitReaderError>[src]
Read at most 8 bits into a u8.
pub fn read_u8_slice(
&mut self,
output_bytes: &mut [u8]
) -> Result<(), BitReaderError>[src]
&mut self,
output_bytes: &mut [u8]
) -> Result<(), BitReaderError>
Fills the entire output_bytes slice. If there aren't enough bits remaining
after the internal cursor's current position, the cursor won't be moved forward
and the contents of output_bytes won't be modified.
pub fn read_u16(&mut self, bit_count: u8) -> Result<u16, BitReaderError>[src]
Read at most 16 bits into a u16.
pub fn read_u32(&mut self, bit_count: u8) -> Result<u32, BitReaderError>[src]
Read at most 32 bits into a u32.
pub fn read_u64(&mut self, bit_count: u8) -> Result<u64, BitReaderError>[src]
Read at most 64 bits into a u64.
pub fn read_i8(&mut self, bit_count: u8) -> Result<i8, BitReaderError>[src]
Read at most 8 bits into a i8. Assumes the bits are stored in two's complement format.
pub fn read_i16(&mut self, bit_count: u8) -> Result<i16, BitReaderError>[src]
Read at most 16 bits into a i16. Assumes the bits are stored in two's complement format.
pub fn read_i32(&mut self, bit_count: u8) -> Result<i32, BitReaderError>[src]
Read at most 32 bits into a i32. Assumes the bits are stored in two's complement format.
pub fn read_i64(&mut self, bit_count: u8) -> Result<i64, BitReaderError>[src]
Read at most 64 bits into a i64. Assumes the bits are stored in two's complement format.
pub fn read_bool(&mut self) -> Result<bool, BitReaderError>[src]
Read a single bit as a boolean value. Interprets 1 as true and 0 as false.
pub fn skip(&mut self, bit_count: u64) -> Result<(), BitReaderError>[src]
Skip arbitrary number of bits. However, you can skip at most to the end of the byte slice.
pub fn position(&self) -> u64[src]
Returns the position of the cursor, or how many bits have been read so far.
pub fn remaining(&self) -> u64[src]
Returns the number of bits not yet read from the underlying slice.
pub fn is_aligned(&self, alignment_bytes: u32) -> bool[src]
Helper to make sure the "bit cursor" is exactly at the beginning of a byte, or at specific multi-byte alignment position.
For example reader.is_aligned(1) returns true if exactly n bytes, or n * 8 bits, has been
read. Similarly, reader.is_aligned(4) returns true if exactly n * 32 bits, or n 4-byte
sequences has been read.
This function can be used to validate the data is being read properly, for example by
adding invocations wrapped into debug_assert!() to places where it is known the data
should be n-byte aligned.
Trait Implementations
impl<'a> Deref for RbspBitReader<'a>[src]
type Target = BitReader<'a>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target[src]
impl<'a> DerefMut for RbspBitReader<'a>[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for RbspBitReader<'a>
impl<'a> Send for RbspBitReader<'a>
impl<'a> Sync for RbspBitReader<'a>
impl<'a> Unpin for RbspBitReader<'a>
impl<'a> UnwindSafe for RbspBitReader<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,