/* * Copyright (c) 2012 Yoann Blein * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include #include #include #include namespace Swift { IncomingScreenSharingManager::IncomingScreenSharingManager(JingleSessionManager* jingleSessionManager, IQRouter* router, UDPSocketFactory* udpSocketFactory) : jingleSessionManager(jingleSessionManager), router(router), udpSocketFactory(udpSocketFactory) { jingleSessionManager->addIncomingSessionHandler(this); } IncomingScreenSharingManager::~IncomingScreenSharingManager() { jingleSessionManager->removeIncomingSessionHandler(this); } bool IncomingScreenSharingManager::handleIncomingJingleSession(Swift::JingleSession::ref session, const std::vector& contents, const Swift::JID& /*recipient*/) { JingleContentPayload::ref content = Jingle::getContentWithDescription(contents); if (!content) return false; // Check transport // Check description // Create IncomingScreenSharing onIncomingScreenSharing(boost::make_shared(session, udpSocketFactory, content)); return true; } }