summaryrefslogtreecommitdiffstats
blob: f6d9b62dd4128d9b73519000b9bfa3e95a3f2e2b (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>
#include <Swiften/Elements/RTPPayloadType.h>
#include <Swiften/Base/boost_bsignals.h>

namespace Swift {
	class JingleContentPayload;
	class VP8RTPParser;
	class VideoDecoder;
	class Image;

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

		public:
			IncomingScreenSharing(boost::shared_ptr<JingleSession> jingleSession, UDPSocketFactory* udpSocketFactory,
								  boost::shared_ptr<JingleContentPayload> content);
			virtual ~IncomingScreenSharing();

			virtual void cancel();

			void accept();

		public:
			boost::signal<void (const Image&)> onNewImageReceived;

		private:
			JingleContentID getContentID() const;
			void hangleNewImageDecoded(const Image& image);

		private:
			boost::shared_ptr<JingleContentPayload> initialContent;
			RTPPayloadType payloadTypeUsed;
			VP8RTPParser* parser;
			VideoDecoder* decoder;
	};
}