summaryrefslogtreecommitdiffstats
blob: b9d966fb8c82e238781922d81b0d29445e047f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2012 Yoann Blein
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#include <Swiften/ScreenSharing/OutgoingScreenSharingManager.h>
#include <Swiften/ScreenSharing/OutgoingScreenSharing.h>
#include <Swiften/Jingle/JingleSessionImpl.h>
#include <Swiften/Jingle/JingleSessionManager.h>

#include <boost/smart_ptr/make_shared.hpp>

namespace Swift {

OutgoingScreenSharingManager::OutgoingScreenSharingManager(JingleSessionManager* jingleSessionManager,IQRouter* router, UDPSocketFactory *udpSocketFactory, ConnectivityManager* connectivityManager, TimerFactory* timerFactory)
	: jsManager(jingleSessionManager), iqRouter(router), connectivityManager(connectivityManager), udpSocketFactory(udpSocketFactory), timerFactory(timerFactory)
{
}

boost::shared_ptr<OutgoingScreenSharing> OutgoingScreenSharingManager::createOutgoingScreenSharing(const JID& from, const JID& recipient)
{
	JingleSessionImpl::ref jingleSession = boost::make_shared<JingleSessionImpl>(from, recipient, idGenerator.generateID(), iqRouter);
	assert(jingleSession);
	jsManager->registerOutgoingSession(from, jingleSession);

	return boost::make_shared<OutgoingScreenSharing>(jingleSession, udpSocketFactory, connectivityManager, timerFactory, recipient);
}

}