-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweb.h
More file actions
116 lines (93 loc) · 3.47 KB
/
Copy pathweb.h
File metadata and controls
116 lines (93 loc) · 3.47 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* web.c: A plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
* $Id$
*/
#pragma once
#include <string>
#include <shared_mutex>
#include <memory>
#include <vdr/plugin.h>
#include "service/web_service.h"
#include "thrift-services/src-client/BrowserClient.h"
#include "VdrPluginWeb.h"
#include <thrift/transport/TSocket.h>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/transport/TBufferTransports.h>
#include <thrift/server/TThreadPoolServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>
using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using namespace ::apache::thrift::concurrency;
using namespace ::pluginweb;
using namespace ::common;
static const char *VERSION = "0.0.1";
static const char *DESCRIPTION = "Uses the cefbrowser to show HTTP Pages, HbbTV applications and videos";
static const char *MAINMENUENTRY = "Web";
static char* MAINMENUENTRYALT = nullptr;
extern BrowserClient* browserClient;
class cRegularWorker: public cThread {
private:
cMutex m_mutex;
cCondVar m_waitCondition;
public:
cRegularWorker();
~cRegularWorker();
void Stop();
void Action();
};
class cPluginWeb : public cPlugin {
private:
std::unique_ptr<cRegularWorker> regularWorker;
public:
cPluginWeb();
~cPluginWeb() override;
const char *Version() override { return VERSION; }
const char *Description() override { return DESCRIPTION; }
const char *CommandLineHelp() override;
bool ProcessArgs(int argc, char *argv[]) override;
bool Initialize() override;
bool Start() override;
void Stop() override;
void Housekeeping() override;
void MainThreadHook() override;
cString Active() override;
time_t WakeupTime() override;
const char *MainMenuEntry() override { return MAINMENUENTRYALT != nullptr ? MAINMENUENTRYALT : MAINMENUENTRY; }
cOsdObject *MainMenuAction() override;
cMenuSetupPage *SetupMenu() override;
bool SetupParse(const char *Name, const char *Value) override;
bool Service(const char *Id, void *Data) override;
const char **SVDRPHelpPages() override;
cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) override;
bool readConfiguration(const char* configFile);
};
class VdrPluginWebServer : public VdrPluginWebIf {
public:
~VdrPluginWebServer() override;
void ping() override;
bool ProcessOsdUpdate(const ProcessOsdUpdateType& input) override;
bool ProcessOsdUpdateQOI(const ProcessOsdUpdateQOIType& input) override;
bool ProcessTSPacket(const ProcessTSPacketType& input) override;
bool StartVideo(const StartVideoType& input) override;
bool StopVideo() override;
bool PauseVideo() override;
bool ResumeVideo() override;
bool Seeked() override;
bool VideoSize(const VideoSizeType& input) override;
bool VideoFullscreen() override;
bool ResetVideo(const ResetVideoType& input) override;
bool SelectAudioTrack(const SelectAudioTrackType& input) override;
bool IsWebActive() override;
};
class VdrPluginWebCloneFactory : virtual public VdrPluginWebIfFactory {
public:
~VdrPluginWebCloneFactory() override = default;
VdrPluginWebIf* getHandler(const TConnectionInfo& connInfo) override;
void releaseHandler(CommonServiceIf* handler) override;
};