blob: d5dd817c0a409805271fc79154472f19a96b0a4e (
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/ScreenSharing/ScreenSharing.h>
#include <Swiften/Jingle/JingleContentID.h>
#include <Swiften/Elements/RTPPayloadType.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/InputEventPayload.h>
namespace Swift {
class JingleContentPayload;
class VP8RTPParser;
class VideoDecoder;
class Image;
class TimerFactory;
class Timer;
class IQRouter;
class IncomingScreenSharing : public ScreenSharing {
public:
typedef boost::shared_ptr<IncomingScreenSharing> ref;
public:
IncomingScreenSharing(boost::shared_ptr<JingleSession> jingleSession, UDPSocketFactory* udpSocketFactory,
TimerFactory* timerFactory, IQRouter* iqRouter, boost::shared_ptr<JingleContentPayload> content);
virtual ~IncomingScreenSharing();
virtual void cancel();
void accept();
const JID& getSender() const;
void sendInputEvent(const InputEventPayload::Event& event);
public:
boost::signal<void (const Image&)> onNewImageReceived;
private:
JingleContentID getContentID() const;
void handleNewFrameDecoded(int pictureID, bool success);
void handleNewImageAvailable(const Image& image);
void handleEventSendingTimerTick();
void addLastMouseMoveIfDifferent();
private:
boost::shared_ptr<JingleContentPayload> initialContent;
RTPPayloadType payloadTypeUsed;
VP8RTPParser* parser;
VideoDecoder* decoder;
InputEventPayload::Event lastMouveMoveEvent;
InputEventPayload::ref inputEventPayload;
boost::shared_ptr<Timer> eventSendingTimer;
IQRouter* iqRouter;
};
}
|