diff options
author | dknn <yoann.blein@free.fr> | 2012-07-08 20:27:27 (GMT) |
---|---|---|
committer | dknn <yoann.blein@free.fr> | 2012-09-22 09:00:01 (GMT) |
commit | 1b2d23c160b4c120a364ff9e86b54e2d8caeaaa4 (patch) | |
tree | 94c9884d7746786568d0da2d6e122dd0f0b5ca9c /Swiften/ScreenSharing/IncomingScreenSharingManager.cpp | |
parent | 4e0236b08d3914d24af32f45bc99663a73c6d83a (diff) | |
download | swift-contrib-1b2d23c160b4c120a364ff9e86b54e2d8caeaaa4.zip swift-contrib-1b2d23c160b4c120a364ff9e86b54e2d8caeaaa4.tar.bz2 |
Screen sharing managing
Diffstat (limited to 'Swiften/ScreenSharing/IncomingScreenSharingManager.cpp')
-rw-r--r-- | Swiften/ScreenSharing/IncomingScreenSharingManager.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/IncomingScreenSharingManager.cpp b/Swiften/ScreenSharing/IncomingScreenSharingManager.cpp new file mode 100644 index 0000000..7706c0a --- /dev/null +++ b/Swiften/ScreenSharing/IncomingScreenSharingManager.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Yoann Blein + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include <Swiften/ScreenSharing/IncomingScreenSharingManager.h> + +#include <Swiften/Elements/JingleRTPDescription.h> +#include <Swiften/ScreenSharing/IncomingScreenSharing.h> +#include <Swiften/Jingle/Jingle.h> +#include <Swiften/Jingle/JingleSessionManager.h> + +#include <boost/make_shared.hpp> + +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<JingleContentPayload::ref>& contents, const Swift::JID& /*recipient*/) +{ + JingleContentPayload::ref content = Jingle::getContentWithDescription<JingleRTPDescription>(contents); + if (!content) + return false; + + // Check transport + // Check description + // Create IncomingScreenSharing + + onIncomingScreenSharing(boost::make_shared<IncomingScreenSharing>(session, udpSocketFactory, content)); + + return true; +} + +} |