summaryrefslogtreecommitdiffstats
blob: 1594c66ff90d0b6f75c36ffb81b69662c7536325 (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
35
/*
 * Copyright (c) 2012 Yoann Blein
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#pragma once

#include <vector>
#include <stdint.h>
#include <stddef.h>

namespace Swift {
	class VideoDecoder;

	class VP8RTPParser {
		public:
			VP8RTPParser(VideoDecoder* decoder);

			void newPayloadReceived(const uint8_t* data, size_t len, bool hasMarker);

		private:
			static const uint8_t SBit = 1 << 4;
			static const uint8_t HBit = 1 << 4;
			static const uint8_t Size0BitShift = 5;

			VideoDecoder* decoder;

			std::vector<uint8_t> buffer;
			bool firstPacket;
			size_t frameSize;
			bool isKeyFrame;
			bool showFrame;
	};
}