class BitReaderCore

Defined at line 18 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.h

Public Methods

void BitReaderCore (ByteStreamProvider * byte_stream_provider)

Lifetime of |byte_stream_provider| must be longer than BitReaderCore.

Defined at line 24 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.cc

void ~BitReaderCore ()

Defined at line 32 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.cc

bool ReadFlag (bool * flag)

Read one bit from the stream and return it as a boolean in |*flag|.

Defined at line 34 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.cc

void BitReaderCore (const BitReaderCore & )

Defined at line 36 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.h

BitReaderCore & operator= (const BitReaderCore & )

Defined at line 37 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.h

bool ReadBits (int num_bits, bool * out)

Read one bit from the stream and return it as a boolean in |*out|.

Remark: we do not use the template version for reading a bool

since it generates some optimization warnings during compilation

on Windows platforms.

Defined at line 45 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.h

int PeekBitsMsbAligned (int num_bits, uint64_t * out)

Retrieve some bits without actually consuming them.

Bits returned in |*out| are shifted so the most significant bit contains

the next bit that can be read from the stream.

Return the number of bits actually written in |out|.

Note: |num_bits| is just a suggestion of how many bits the caller

wish to get in |*out| and must be less than 64:

- The number of bits returned can be more than |num_bits|.

- However, it will be strictly less than |num_bits|

if and only if there are not enough bits left in the stream.

Defined at line 45 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.cc

template <typename T>
bool ReadBits (int num_bits, T * out)

Read |num_bits| next bits from stream and return in |*out|, first bit

from the stream starting at |num_bits| position in |*out|,

bits of |*out| whose position is strictly greater than |num_bits|

are all set to zero.

Notes:

- |num_bits| cannot be larger than the bits the type can hold.

- From the above description, passing a signed type in |T| does not

mean the first bit read from the stream gives the sign of the value.

Return false if the given number of bits cannot be read (not enough

bits in the stream), true otherwise. When return false, the stream will

enter a state where further ReadBits/SkipBits operations will always

return false unless |num_bits| is 0. The type |T| has to be a primitive

integer type.

Defined at line 64 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.h

bool SkipBits (int num_bits)

Skip |num_bits| next bits from stream. Return false if the given number of

bits cannot be skipped (not enough bits in the stream), true otherwise.

When return false, the stream will enter a state where further

ReadBits/ReadFlag/SkipBits operations

will always return false unless |num_bits| is 0.

Defined at line 65 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.cc

int bits_read ()

Returns the number of bits read so far.

Defined at line 101 of file ../../src/media/third_party/chromium_media/media/base/bit_reader_core.cc

Records