Shaka Player Embedded
|
#include <buffer_reader.h>
Public Member Functions | |
BufferReader () | |
BufferReader (const uint8_t *data, size_t data_size) | |
const uint8_t * | data () const |
bool | empty () const |
size_t | BytesRemaining () const |
void | SetBuffer (const uint8_t *data, size_t data_size) |
size_t | Read (uint8_t *dest, size_t dest_size) |
size_t | Skip (size_t count) |
size_t | SkipBits (size_t count) |
uint8_t | ReadUint8 () |
uint32_t | ReadUint32 (Endianness endianness=kBigEndian) |
uint64_t | ReadBits (size_t count, Endianness endianness=kBigEndian) |
uint64_t | ReadExpGolomb () |
A simple utility class to read bytes from a buffer. This does not own the data and is not thread safe.
Definition at line 41 of file buffer_reader.h.
shaka::util::BufferReader::BufferReader | ( | ) |
Definition at line 26 of file buffer_reader.cc.
shaka::util::BufferReader::BufferReader | ( | const uint8_t * | data, |
size_t | data_size | ||
) |
Definition at line 27 of file buffer_reader.cc.
|
inline |
Definition at line 56 of file buffer_reader.h.
|
inline |
Definition at line 47 of file buffer_reader.h.
|
inline |
Definition at line 51 of file buffer_reader.h.
size_t shaka::util::BufferReader::Read | ( | uint8_t * | dest, |
size_t | dest_size | ||
) |
Reads up to |dest_size| bytes and copies them into |dest|.
dest | The buffer to copy the data to. |
dest_size | The number of bytes in |dest|. |
Definition at line 36 of file buffer_reader.cc.
uint64_t shaka::util::BufferReader::ReadBits | ( | size_t | count, |
Endianness | endianness = kBigEndian |
||
) |
Reads the given number of bits. If there aren't enough bits, this will fill remaining bits with 0. This can only read up to 64 bits.
Little endian mode can only be used at a byte-aligned position and can only read whole bytes.
Definition at line 63 of file buffer_reader.cc.
uint64_t shaka::util::BufferReader::ReadExpGolomb | ( | ) |
Reads a variably-sized integer in a Exponential-Golomb format.
Definition at line 99 of file buffer_reader.cc.
|
inline |
Reads a 32-bit integer from the buffer.
Definition at line 94 of file buffer_reader.h.
|
inline |
Reads a 8-bit integer from the buffer. If the reader is empty, this returns 0.
Definition at line 89 of file buffer_reader.h.
void shaka::util::BufferReader::SetBuffer | ( | const uint8_t * | data, |
size_t | data_size | ||
) |
Resets the buffer that this type will read from.
Definition at line 30 of file buffer_reader.cc.
|
inline |
Skips the given number of bytes.
Definition at line 75 of file buffer_reader.h.
size_t shaka::util::BufferReader::SkipBits | ( | size_t | count | ) |
Skips the given number of bits.
Definition at line 52 of file buffer_reader.cc.