blob: 321ab4c94ddd89ab9457fafe15e1a9ec73a8ea08 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
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/smart_ptr/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;
}
}
|