1
0

ParserBase.h 920 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "read.h"
  3. #include "avi_header.h"
  4. #include "avi_reader.h"
  5. #include "info.h"
  6. namespace nsavi
  7. {
  8. struct HeaderList
  9. {
  10. const AVIH *avi_header;
  11. const STRL *stream_list;
  12. size_t stream_list_size;
  13. const DMLH *odml_header;
  14. };
  15. class ParserBase
  16. {
  17. public:
  18. ParserBase(nsavi::avi_reader *_reader);
  19. int GetRIFFType(uint32_t *type);
  20. protected:
  21. int ParseHeaderList(uint32_t chunk_size, uint32_t *out_bytes_read);
  22. int ParseStreamList(uint32_t chunk_size, STRL *stream, uint32_t *out_bytes_read);
  23. int ParseODML(uint32_t chunk_size, uint32_t *out_bytes_read);
  24. nsavi::avi_reader *reader;
  25. /* RIFF header (12 bytes at start of file) */
  26. ParseState riff_parsed;
  27. riff_chunk riff_header;
  28. uint64_t riff_start; // should normally be 12
  29. /* header list */
  30. ParseState header_list_parsed;
  31. AVIH *avi_header;
  32. STRL *stream_list;
  33. size_t stream_list_size;
  34. DMLH *odml_header;
  35. };
  36. }