summaryrefslogtreecommitdiffstats
blob: 0bdc6646ebcf67632b4d991761d2d6efb37e203b (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
31
32
33
34
/*
 * Copyright (c) 2012 Yoann Blein
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#pragma once

#include <Swiften/ScreenSharing/VideoDecoder.h>

#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_decoder.h"

namespace Swift {
	class Image;

	class VP8Decoder : public VideoDecoder {
		public:
			VP8Decoder();
			virtual ~VP8Decoder();

			void updateCodecConfig();

			virtual void decodeFrame(const std::vector<uint8_t> &frame, int pictureID);

		private:
			Image convertYV12toRGB(const vpx_image_t* img);

		private:
			vpx_codec_iface_t* codecInterface;
			vpx_codec_ctx_t codecContext;
			vpx_codec_flags_t codecFlags;
	};
}