5 #ifndef MEDIA_FORMATS_WEBM_WEBM_PARSER_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_PARSER_H_
13 #include "packager/base/macros.h"
15 namespace edash_packager {
35 virtual bool OnListEnd(
int id);
36 virtual bool OnUInt(
int id, int64_t val);
37 virtual bool OnFloat(
int id,
double val);
38 virtual bool OnBinary(
int id,
const uint8_t* data,
int size);
39 virtual bool OnString(
int id,
const std::string& str);
47 struct ListElementInfo;
68 int Parse(
const uint8_t* buf,
int size);
84 int64_t bytes_parsed_;
85 const ListElementInfo* element_info_;
89 void ChangeState(State new_state);
103 int ParseListElement(
int header_size,
105 int64_t element_size,
117 bool OnListStart(
int id, int64_t size);
127 bool IsSiblingOrAncestor(
int id_a,
int id_b)
const;
136 const int root_level_;
143 std::vector<ListState> list_state_stack_;
155 int WebMParseElementHeader(
const uint8_t* buf,
158 int64_t* element_size);
163 #endif // MEDIA_FORMATS_WEBM_WEBM_PARSER_H_