diff options
author | dknn <yoann.blein@free.fr> | 2012-07-03 08:41:38 (GMT) |
---|---|---|
committer | dknn <yoann.blein@free.fr> | 2012-09-22 08:53:12 (GMT) |
commit | 63f031be6dc042ea7d769d5de283af466399371e (patch) | |
tree | 9386d5be56a60f41f4636cc2460b736a654585db /Swiften/ScreenSharing/RTPSessionImpl.h | |
parent | 9af0239df10283e03ace0a6a9d719bbe8dc32398 (diff) | |
download | swift-contrib-63f031be6dc042ea7d769d5de283af466399371e.zip swift-contrib-63f031be6dc042ea7d769d5de283af466399371e.tar.bz2 |
Abstract layer between Swiften & JRTPLIB
Diffstat (limited to 'Swiften/ScreenSharing/RTPSessionImpl.h')
-rw-r--r-- | Swiften/ScreenSharing/RTPSessionImpl.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/RTPSessionImpl.h b/Swiften/ScreenSharing/RTPSessionImpl.h new file mode 100644 index 0000000..15ca4b3 --- /dev/null +++ b/Swiften/ScreenSharing/RTPSessionImpl.h @@ -0,0 +1,65 @@ +/* + * 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/RTPSession.h> + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#include <rtpsession.h> +#pragma clang diagnostic pop +#include <rtpexternaltransmitter.h> +#include <rtpipv4address.h> + +namespace Swift { + + // Temporary class + class Sender : public jrtplib::RTPExternalSender + { + public: + Sender() {} + + virtual bool SendRTP (const void* /*data*/, size_t /*len*/) + { + return true; + } + + virtual bool SendRTCP (const void* /*data*/, size_t /*len*/) + { + return true; + } + + virtual bool ComesFromThisSender (const jrtplib::RTPAddress* /*address*/) + { + return false; + } + }; + + class RTPSessionImpl : public RTPSession { + public: + RTPSessionImpl(const HostAddressPort& remotePeer, PayloadType payloadType, int frequency); + virtual ~RTPSessionImpl(); + + virtual void poll(); + virtual void checkIncomingPackets(); + virtual void sendPacket(const SafeByteArray &data, int timestampinc, bool marker = false); + virtual void injectData(const SafeByteArray &data); + virtual void stop(int maxWaitMs = 100); + + private: + static void nativeAddressToJRTPAddress(const HostAddressPort& hostAddressPort, jrtplib::RTPIPv4Address& jRTPAddress); + + private: + inline void checkError(int rtperr) const; + + private: + jrtplib::RTPIPv4Address jRTPRemotePeer; + jrtplib::RTPSession session; + Sender sender; + jrtplib::RTPExternalPacketInjecter *packetInjecter; + }; +} |