diff options
author | dknn <yoann.blein@free.fr> | 2012-07-08 20:26:03 (GMT) |
---|---|---|
committer | dknn <yoann.blein@free.fr> | 2012-09-22 08:55:56 (GMT) |
commit | 4e0236b08d3914d24af32f45bc99663a73c6d83a (patch) | |
tree | 054b63bad9da90762568ed096525099dab54de7e /Swiften/ScreenSharing/RTPSessionImpl.cpp | |
parent | dc259819a687fa9a6f9007ed15b443f737c5d473 (diff) | |
download | swift-contrib-4e0236b08d3914d24af32f45bc99663a73c6d83a.zip swift-contrib-4e0236b08d3914d24af32f45bc99663a73c6d83a.tar.bz2 |
RTP update
Diffstat (limited to 'Swiften/ScreenSharing/RTPSessionImpl.cpp')
-rw-r--r-- | Swiften/ScreenSharing/RTPSessionImpl.cpp | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/Swiften/ScreenSharing/RTPSessionImpl.cpp b/Swiften/ScreenSharing/RTPSessionImpl.cpp index b8c443e..eb67d4e 100644 --- a/Swiften/ScreenSharing/RTPSessionImpl.cpp +++ b/Swiften/ScreenSharing/RTPSessionImpl.cpp @@ -7,11 +7,14 @@ #include <Swiften/ScreenSharing/RTPSessionImpl.h> #include <Swiften/ScreenSharing/RTPException.h> +#include <Swiften/Network/BoostUDPSocket.h> +#include <Swiften/Base/boost_bsignals.h> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/classification.hpp> #include <boost/lexical_cast.hpp> #include <boost/numeric/conversion/cast.hpp> +#include <boost/bind.hpp> #include <rtppacket.h> #include <rtpsourcedata.h> @@ -19,9 +22,24 @@ namespace Swift { -RTPSessionImpl::RTPSessionImpl(const HostAddressPort& remotePeer, PayloadType payloadType, int frequency) - : RTPSession(remotePeer, payloadType, frequency) +RTPSessionImpl::RTPSessionImpl() + : RTPSession() { +} + +RTPSessionImpl::~RTPSessionImpl() +{ +} + +void RTPSessionImpl::create(boost::shared_ptr<UDPSocket> udpSocket, const HostAddressPort &remotePeer, RTPSession::PayloadType payloadType, int frequency) +{ + this->udpSocket = udpSocket; + this->udpSocket->onDataRead.connect(boost::bind(&RTPSessionImpl::handleDataRead, this, _1)); + + this->payloadType = payloadType; + this->frequency = frequency; + nativeAddressToJRTPAddress(remotePeer, jRTPRemotePeer); + jrtplib::RTPExternalTransmissionParams transparams(&sender, 0); jrtplib::RTPSessionParams sessparams; @@ -30,15 +48,7 @@ RTPSessionImpl::RTPSessionImpl(const HostAddressPort& remotePeer, PayloadType pa checkError(session.Create(sessparams, &transparams, jrtplib::RTPTransmitter::ExternalProto)); - //session.SetDefaultPayloadType(VP8); - packetInjecter = static_cast<jrtplib::RTPExternalTransmissionInfo*>(session.GetTransmissionInfo())->GetPacketInjector(); - - nativeAddressToJRTPAddress(remotePeer, jRTPRemotePeer); -} - -RTPSessionImpl::~RTPSessionImpl() -{ } void RTPSessionImpl::poll() @@ -86,6 +96,11 @@ void RTPSessionImpl::checkError(int rtperr) const throw RTPException(jrtplib::RTPGetErrorString(rtperr)); } +void RTPSessionImpl::handleDataRead(boost::shared_ptr<SafeByteArray> data) +{ + injectData(*data); +} + void RTPSessionImpl::nativeAddressToJRTPAddress(const HostAddressPort& hostAddressPort, jrtplib::RTPIPv4Address& jRTPAddress) { // Split address |