summaryrefslogtreecommitdiff
path: root/decoders/ffmpeg_decoder.h
blob: 2acfd8ee3fbed8f58febd5b85fed23fe4c3a2683 (plain)
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
#ifndef FFMPEG_DECODER_H
#define FFMPEG_DECODER_H

#include "decoder.h"

// needed for UINT64_C in libavutil
#include <boost/cstdint.hpp>

extern "C" {
	#include <libavformat/avformat.h>
	#include <libavcodec/avcodec.h>
}

class DecoderFFmpeg : public Decoder {
	private:
		AVFormatContext* lavf_ctx;
		AVCodecContext* lavc_ctx;
		AVCodec* codec;
		char *temp_buffer;
		std::size_t temp_buffer_size;
		std::size_t temp_buffer_pos;
	
	public:
		DecoderFFmpeg(const std::string& filename);
		~DecoderFFmpeg();
		
		virtual std::size_t read(char* buf, std::size_t buf_size);
};

#endif