summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordknn <yoann.blein@free.fr>2012-07-14 08:00:24 (GMT)
committerdknn <yoann.blein@free.fr>2012-09-22 09:01:48 (GMT)
commit51958a50e31b483aa932aac8d696b229ba66b5cb (patch)
tree559c19451c2d53a1ee72113154aa187060680f3c /Swiften/ScreenSharing/RTPSessionImpl.cpp
parentce9a3d75677f08af0a226bb3d2bf02c28c938c33 (diff)
downloadswift-contrib-51958a50e31b483aa932aac8d696b229ba66b5cb.zip
swift-contrib-51958a50e31b483aa932aac8d696b229ba66b5cb.tar.bz2
Fixes to make classes working together
Diffstat (limited to 'Swiften/ScreenSharing/RTPSessionImpl.cpp')
-rw-r--r--Swiften/ScreenSharing/RTPSessionImpl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swiften/ScreenSharing/RTPSessionImpl.cpp b/Swiften/ScreenSharing/RTPSessionImpl.cpp
index 62b05d5..94641ff 100644
--- a/Swiften/ScreenSharing/RTPSessionImpl.cpp
+++ b/Swiften/ScreenSharing/RTPSessionImpl.cpp
@@ -23,6 +23,10 @@
namespace Swift {
+Sender::Sender(boost::shared_ptr<UDPSocket> udpSocket)
+ : udpSocket(udpSocket) {
+}
+
bool Sender::SendRTP(const void *data, size_t len) {
send(data, len);
return true;
@@ -38,7 +42,7 @@ bool Sender::ComesFromThisSender (const jrtplib::RTPAddress* address) {
}
void Sender::send(const void* data, size_t len) {
- unsigned char *uint8Data = (unsigned char*)data;
+ uint8_t* uint8Data = (uint8_t*)data;
udpSocket->send(SafeByteArray(uint8Data, uint8Data + len));
}
@@ -55,6 +59,7 @@ RTPSessionImpl::RTPSessionImpl(boost::shared_ptr<UDPSocket> udpSocket, const RTP
packetInjecter = static_cast<jrtplib::RTPExternalTransmissionInfo*>(session.GetTransmissionInfo())->GetPacketInjector();
udpSocket->onDataRead.connect(boost::bind(&RTPSessionImpl::handleDataRead, this, _1));
+ udpSocket->listen();
}
RTPSessionImpl::~RTPSessionImpl()
@@ -97,7 +102,7 @@ void RTPSessionImpl::injectData(const SafeByteArray& data)
void RTPSessionImpl::stop(int maxWaitMs)
{
session.BYEDestroy(jrtplib::RTPTime(0, maxWaitMs * 1000), "", 0);
- // TODO: shutdown socket
+ udpSocket->close();
}
void RTPSessionImpl::checkError(int rtperr) const