1
0

demuxer.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. /* this parser is meant for actual playback */
  3. #include "read.h"
  4. #include "avi_header.h"
  5. #include "avi_reader.h"
  6. #include "info.h"
  7. #include "ParserBase.h"
  8. namespace nsavi
  9. {
  10. class Demuxer : public ParserBase
  11. {
  12. public:
  13. Demuxer(nsavi::avi_reader *_reader);
  14. int GetNextMovieChunk(nsavi::avi_reader *reader, void **data, uint32_t *chunk_size, uint32_t *chunk_type, int limit_stream_num=65536);
  15. int GetSeekTable(nsavi::IDX1 **out_index); // get the idx1 chunk
  16. int GetIndexChunk(nsavi::INDX **out_index, uint64_t offset); // get the INDX/##ix/##ix chunk at the given position
  17. int Seek(uint64_t offset, bool absolute, nsavi::avi_reader *reader);
  18. int GetHeaderList(HeaderList *header_list);
  19. int FindMovieChunk();
  20. int SeekToMovieChunk(nsavi::avi_reader *reader);
  21. private:
  22. /* movie chunk */
  23. ParseState movie_found;
  24. riff_chunk movi_header;
  25. uint64_t movie_start;
  26. /* idx1 seektable */
  27. ParseState idx1_found;
  28. riff_chunk idx1_header; // dunno if we really need it
  29. nsavi::IDX1 *index;
  30. /* INFO */
  31. Info *info;
  32. ParseState info_found;
  33. };
  34. }