blob: 6107ec5628b24a9e5a94ded793e68d9221ba81e1 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*
* Copyright (c) 2012 Yoann Blein
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
#pragma once
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/Elements/JinglePayload.h>
#include <boost/shared_ptr.hpp>
namespace Swift {
class JingleSession;
class JingleRawUDPTransportPayload;
class UDPSocketFactory;
class UDPSocket;
class RTPSession;
class ScreenSharing {
public:
typedef boost::shared_ptr<ScreenSharing> ref;
enum SCState {
Canceled,
Failed,
Finished,
Negotiating,
Connecting,
BroadCasting,
Receiving,
WaitingForStart,
WaitingForAccept,
};
public:
ScreenSharing(boost::shared_ptr<JingleSession> jingleSession, UDPSocketFactory* udpSocketFactory);
virtual ~ScreenSharing();
virtual void cancel() = 0;
void stop();
public:
boost::signal<void (SCState)> onStateChange;
boost::signal<void ()> onFinished;
protected:
bool addBestCandidate(boost::shared_ptr<JingleRawUDPTransportPayload> transport);
void handleSessionTerminateReceived(boost::optional<JinglePayload::Reason> reason);
protected:
IDGenerator idGenerator;
boost::shared_ptr<UDPSocket> serverSocket;
boost::shared_ptr<UDPSocket> clientSocket;
RTPSession* rtpSession;
boost::shared_ptr<JingleSession> jingleSession;
UDPSocketFactory* udpSocketFactory;
};
}
|