summaryrefslogtreecommitdiffstats
blob: d93b4764ece42c717332a2cc279e6afaf15dbd65 (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
/*
 * Copyright (c) 2012 Yoann Blein
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#pragma once

#include <Swiften/ScreenSharing/ScreenSharing.h>
#include <Swiften/Jingle/JingleContentID.h>

namespace Swift {
	class ConnectivityManager;
	class JingleDescription;
	class JingleTransportPayload;
	class TimerFactory;
	class Timer;

	class OutgoingScreenSharing : public ScreenSharing {
		public:
			typedef boost::shared_ptr<OutgoingScreenSharing> ref;

		public:
			OutgoingScreenSharing(boost::shared_ptr<JingleSession> session, UDPSocketFactory* udpSocketFactory, TimerFactory* timerFactory);
			virtual ~OutgoingScreenSharing();

			virtual void cancel();

			void start();

		private:
			void handleSocketConnected();
			void handleSessionAcceptReceived(const JingleContentID& /*id*/, boost::shared_ptr<JingleDescription> /*desc*/, boost::shared_ptr<JingleTransportPayload> /*transport*/);
			void handleConnectionFailed();
			void startRTPSession();

		private:
			JingleContentID contentID;
			bool canceled;
			bool sessionAccepted;
			bool socketConnected;

			TimerFactory* timerFactory;
			boost::shared_ptr<Timer> connectionTimer;
	};
}