7 #ifndef PACKAGER_MEDIA_CODECS_H264_BIT_READER_H_
8 #define PACKAGER_MEDIA_CODECS_H264_BIT_READER_H_
10 #include <sys/types.h>
14 #include <packager/macros/classes.h>
31 bool Initialize(
const uint8_t* data, off_t size);
38 bool ReadBits(
int num_bits,
int* out);
43 bool ReadBool(
bool* out) {
45 if (!ReadBits(1, &value))
53 bool SkipBits(
int num_bits);
57 bool ReadUE(
int* val);
60 bool ReadSE(
int* val);
66 bool HasMoreRBSPData();
69 size_t NumEmulationPreventionBytesRead();
74 bool UpdateCurrByte();
87 int num_remaining_bits_in_curr_byte_;
94 size_t emulation_prevention_bytes_;
All the methods that are virtual are virtual for mocking.