summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/ScreenSharing/ScreenSharing.h')
-rw-r--r--Swiften/ScreenSharing/ScreenSharing.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/ScreenSharing.h b/Swiften/ScreenSharing/ScreenSharing.h
new file mode 100644
index 0000000..1f6f753
--- /dev/null
+++ b/Swiften/ScreenSharing/ScreenSharing.h
@@ -0,0 +1,59 @@
+/*
+ * 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 <boost/shared_ptr.hpp>
+
+namespace Swift {
+ class JingleSession;
+ class JingleRawUDPTransportPayload;
+ class UDPSocketFactory;
+ class UDPSocket;
+
+ 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> session, UDPSocketFactory* udpSocketFactory);
+ virtual ~ScreenSharing();
+
+ virtual void cancel() = 0;
+
+ public:
+ boost::signal<void (SCState)> onStateChange;
+
+ protected:
+ bool addBestCandidate(boost::shared_ptr<JingleRawUDPTransportPayload> transport);
+
+ protected:
+ static const int listeningPort = 28888;
+
+ IDGenerator idGenerator;
+ boost::shared_ptr<UDPSocket> serverSocket;
+ boost::shared_ptr<UDPSocket> clientSocket;
+
+ boost::shared_ptr<JingleSession> session;
+ UDPSocketFactory* udpSocketFactory;
+
+ };
+}