diff options
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; + }; +} |