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;
69 int Parse(
const uint8_t* buf,
int size);
72 bool IsParsingComplete()
const;
85 int64_t bytes_parsed_;
86 const ListElementInfo* element_info_;
90 void ChangeState(State new_state);
104 int ParseListElement(
int header_size,
106 int64_t element_size,
118 bool OnListStart(
int id, int64_t size);
128 bool IsSiblingOrAncestor(
int id_a,
int id_b)
const;
137 const int root_level_;
144 std::vector<ListState> list_state_stack_;
157 int WebMParseElementHeader(
const uint8_t* buf,
160 int64_t* element_size);
165 #endif // MEDIA_FORMATS_WEBM_WEBM_PARSER_H_