7 #ifndef PACKAGER_MEDIA_CODECS_H264_BIT_READER_H_
8 #define PACKAGER_MEDIA_CODECS_H264_BIT_READER_H_
11 #include <sys/types.h>
13 #include "packager/base/macros.h"
30 bool Initialize(
const uint8_t* data, off_t size);
37 bool ReadBits(
int num_bits,
int* out);
42 bool ReadBool(
bool* out) {
44 if (!ReadBits(1, &value))
52 bool SkipBits(
int num_bits);
56 bool ReadUE(
int* val);
59 bool ReadSE(
int* val);
65 bool HasMoreRBSPData();
68 size_t NumEmulationPreventionBytesRead();
73 bool UpdateCurrByte();
86 int num_remaining_bits_in_curr_byte_;
93 size_t emulation_prevention_bytes_;
101 #endif // PACKAGER_MEDIA_CODECS_H264_BIT_READER_H_