summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/ScreenSharing/VP8RTPParser.h')
-rw-r--r--Swiften/ScreenSharing/VP8RTPParser.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/VP8RTPParser.h b/Swiften/ScreenSharing/VP8RTPParser.h
new file mode 100644
index 0000000..c88e2a6
--- /dev/null
+++ b/Swiften/ScreenSharing/VP8RTPParser.h
@@ -0,0 +1,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 VP8Decoder;
+
+ class VP8RTPParser {
+ public:
+ VP8RTPParser(VP8Decoder* 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;
+
+ VP8Decoder* decoder;
+
+ std::vector<uint8_t> buffer;
+ bool firstPacket;
+ size_t frameSize;
+ bool isKeyFrame;
+ bool showFrame;
+ };
+}