Skip to main content

BitWriter

Struct BitWriter 

Source
pub struct BitWriter<W: Write> { /* private fields */ }
Expand description

Writes H.264 bitstream syntax elements to RBSP writer.

Implementations§

Source§

impl<W: Write> BitWriter<W>

Source

pub fn new(writer: W) -> Self

Creates a new BitWriter writing to writer.

Source

pub fn writer(&mut self) -> Option<&mut W>

Returns a mutable reference to the underlying writer, if the stream is byte-aligned.

Source

pub fn into_writer(self) -> W

Returns the underlying writer.

§Warning

Any unwritten partial bits are discarded.

Trait Implementations§

Source§

impl<W: Write> BitWrite for BitWriter<W>

Source§

fn write_ue(&mut self, value: u32) -> Result<()>

Writes an unsigned Exp-Golomb-coded value, as defined in the H.264 spec.
Source§

fn write_se(&mut self, value: i32) -> Result<()>

Writes a signed Exp-Golomb-coded value, as defined in the H.264 spec.
Source§

fn write_bit(&mut self, bit: bool) -> Result<()>

Writes a single bit.
Source§

fn write<const BITS: u32, I: Integer>(&mut self, value: I) -> Result<()>

Writes BITS bits of value.
Source§

fn write_var<I: Integer>(&mut self, bit_count: u32, value: I) -> Result<()>

Writes bit_count bits of value.
Source§

fn write_rbsp_trailing_bits(&mut self) -> Result<()>

Writes the RBSP trailing bits: a stop bit (1) and then zero-padding to byte boundary.

Auto Trait Implementations§

§

impl<W> Freeze for BitWriter<W>

§

impl<W> RefUnwindSafe for BitWriter<W>

§

impl<W> Send for BitWriter<W>

§

impl<W> Sync for BitWriter<W>

§

impl<W> Unpin for BitWriter<W>

§

impl<W> UnsafeUnpin for BitWriter<W>

§

impl<W> UnwindSafe for BitWriter<W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.