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

		/* idx1 seektable */
		ParseState idx1_found;
		riff_chunk idx1_header; // dunno if we really need it
		nsavi::IDX1 *index;

		/* INFO */
		Info *info;
		ParseState info_found;
	};
}