diff options
author | dknn <yoann.blein@free.fr> | 2012-06-26 14:05:35 (GMT) |
---|---|---|
committer | dknn <yoann.blein@free.fr> | 2012-09-22 08:53:12 (GMT) |
commit | 39ac2af90938aec4f4e43b81a6e043e0ebcdd798 (patch) | |
tree | add99f9eb287778191ebde47917adbaa96a39b8a /Swiften/ScreenSharing/VP8RTPPacketizer.h | |
parent | f374887e7a27831771304a09a74d6cd54f8ef4e4 (diff) | |
download | swift-contrib-39ac2af90938aec4f4e43b81a6e043e0ebcdd798.zip swift-contrib-39ac2af90938aec4f4e43b81a6e043e0ebcdd798.tar.bz2 |
Single threaded codec
Diffstat (limited to 'Swiften/ScreenSharing/VP8RTPPacketizer.h')
-rw-r--r-- | Swiften/ScreenSharing/VP8RTPPacketizer.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/VP8RTPPacketizer.h b/Swiften/ScreenSharing/VP8RTPPacketizer.h new file mode 100644 index 0000000..0ef48be --- /dev/null +++ b/Swiften/ScreenSharing/VP8RTPPacketizer.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2012 Yoann Blein + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> +#include <vector> +#include <stdint.h> +#include <Swiften/Base/boost_bsignals.h> +#include "vpx/vpx_encoder.h" + + +namespace Swift { + class SafeByteArray; + + class VP8RTPPacketizer { + public: + VP8RTPPacketizer(); + + void packetizeFrame(const vpx_codec_cx_pkt_t* pkt); + + boost::signal<void (const std::vector<uint8_t>&, bool marker)> onNewPayloadReady; + + private: + static const uint8_t SBit = 1 << 4; + static const uint8_t HBit = 1 << 4; + static const uint8_t Size0BitMask = 7; + static const uint8_t Size0BitShift = 5; + static const size_t MaxRTPPayloadSize = 1400; // Replace with JRTPLIB's one + + std::vector<uint8_t> payloadBuffer; + }; +} |