summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/Examples/SConscript1
-rw-r--r--Swiften/ScreenSharing/OutgoingScreenSharing.cpp8
-rw-r--r--Swiften/ScreenSharing/RTPSession.cpp15
-rw-r--r--Swiften/ScreenSharing/ScreenSharing.cpp3
4 files changed, 9 insertions, 18 deletions
diff --git a/Swiften/Examples/SConscript b/Swiften/Examples/SConscript
index fb568fc..11238ff 100644
--- a/Swiften/Examples/SConscript
+++ b/Swiften/Examples/SConscript
@@ -9,5 +9,6 @@ SConscript(dirs = [
"LinkLocalTool",
"NetworkTool",
"ParserTester",
"BenchTool",
+ "ScreenSharing",
])
diff --git a/Swiften/ScreenSharing/OutgoingScreenSharing.cpp b/Swiften/ScreenSharing/OutgoingScreenSharing.cpp
index 77226c5..ec0a39c 100644
--- a/Swiften/ScreenSharing/OutgoingScreenSharing.cpp
+++ b/Swiften/ScreenSharing/OutgoingScreenSharing.cpp
@@ -27,13 +27,14 @@ OutgoingScreenSharing::OutgoingScreenSharing(boost::shared_ptr<JingleSession> se
: ScreenSharing(session, udpSocketFactory),
timerFactory(timerFactory), contentID(JingleContentID(idGenerator.generateID(), JingleContentPayload::InitiatorCreator)),
canceled(false), sessionAccepted(false), socketConnected(false), encoder(0), packetizer(0)
{
- session->onSessionAcceptReceived.connect(boost::bind(&OutgoingScreenSharing::handleSessionAcceptReceived, this, _1, _2, _3));
+ jingleSession->onSessionAcceptReceived.connect(boost::bind(&OutgoingScreenSharing::handleSessionAcceptReceived, this, _1, _2, _3));
}
OutgoingScreenSharing::~OutgoingScreenSharing()
{
+ jingleSession->onSessionAcceptReceived.disconnect(boost::bind(&OutgoingScreenSharing::handleSessionAcceptReceived, this, _1, _2, _3));
delete rtpSession;
delete encoder;
delete packetizer;
}
@@ -63,9 +64,8 @@ void OutgoingScreenSharing::start(unsigned int width, unsigned int height)
jingleSession->sendInitiate(contentID, desc, transport);
onStateChange(ScreenSharing::WaitingForAccept);
- serverSocket->onConnected.connect(boost::bind(&OutgoingScreenSharing::handleSocketConnected, this));
serverSocket->connectToFirstIncoming();
}
void OutgoingScreenSharing::addImage(const Image &image)
@@ -78,8 +78,10 @@ void OutgoingScreenSharing::handleSocketConnected()
if (canceled)
return;
SWIFT_LOG(debug) << "Screen sharing: UDP socket connected" << std::endl;
+ serverSocket->onConnected.disconnect(boost::bind(&OutgoingScreenSharing::handleSocketConnected, this));
+
socketConnected = true;
if (sessionAccepted)
startRTPSession();
}
@@ -106,8 +108,10 @@ void OutgoingScreenSharing::handleSessionAcceptReceived(const JingleContentID& /
void OutgoingScreenSharing::handleConnectionFailed()
{
SWIFT_LOG(debug) << "Screen sharing: unable to connect" << std::endl;
+ connectionTimer->onTick.disconnect(boost::bind(&OutgoingScreenSharing::handleConnectionFailed, this));
+
jingleSession->sendTerminate(JinglePayload::Reason::ConnectivityError);
canceled = true;
onStateChange(ScreenSharing::Failed);
diff --git a/Swiften/ScreenSharing/RTPSession.cpp b/Swiften/ScreenSharing/RTPSession.cpp
deleted file mode 100644
index 3a22326..0000000
--- a/Swiften/ScreenSharing/RTPSession.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2012 Yoann Blein
- * Licensed under the simplified BSD license.
- * See Documentation/Licenses/BSD-simplified.txt for more information.
- */
-
-#include <Swiften/ScreenSharing/RTPSession.h>
-
-namespace Swift {
-
-RTPSession::~RTPSession()
-{
-}
-
-}
diff --git a/Swiften/ScreenSharing/ScreenSharing.cpp b/Swiften/ScreenSharing/ScreenSharing.cpp
index eede971..be3c8ab 100644
--- a/Swiften/ScreenSharing/ScreenSharing.cpp
+++ b/Swiften/ScreenSharing/ScreenSharing.cpp
@@ -20,13 +20,14 @@ namespace Swift {
ScreenSharing::ScreenSharing(boost::shared_ptr<JingleSession> session, UDPSocketFactory* udpSocketFactory)
: rtpSession(0), jingleSession(session), udpSocketFactory(udpSocketFactory)
{
- session->onSessionTerminateReceived.connect(boost::bind(&ScreenSharing::handleSessionTerminateReceived, this, _1));
+ jingleSession->onSessionTerminateReceived.connect(boost::bind(&ScreenSharing::handleSessionTerminateReceived, this, _1));
}
ScreenSharing::~ScreenSharing()
{
+ jingleSession->onSessionTerminateReceived.disconnect(boost::bind(&ScreenSharing::handleSessionTerminateReceived, this, _1));
}
void ScreenSharing::stop()
{