-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsofthddevice-drm.h
233 lines (200 loc) · 7.57 KB
/
softhddevice-drm.h
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
///
/// @file softhddevice.h @brief software HD device plugin header file.
///
/// Copyright (c) 2011, 2014 by Johns. All Rights Reserved.
/// Copyright (c) 2018 - 2019 zille. All Rights Reserved.
///
/// Contributor(s):
///
/// License: AGPLv3
///
/// This program is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
/// published by the Free Software Foundation, either version 3 of the
/// License.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Affero General Public License for more details.
///
/// $Id$
//////////////////////////////////////////////////////////////////////////////
/// vdr-plugin version number.
/// Makefile extracts the version number for generating the file name
/// for the distribution archive.
static const char *const VERSION = "0.0.1rc1"
#ifdef GIT_REV
"-GIT" GIT_REV
#endif
;
/// vdr-plugin description.
static const char *const DESCRIPTION =
trNOOP("A software and GPU emulated HD device");
/// vdr-plugin text of main menu entry
static const char *MAINMENUENTRY = trNOOP("SoftHdDevice-drm");
/// single instance of softhddevice plugin device.
static class cSoftHdDevice *MyDevice;
//////////////////////////////////////////////////////////////////////////////
static char ConfigMakePrimary; ///< config primary wanted
static char ConfigHideMainMenuEntry; ///< config hide main menu entry
static int ConfigVideoAudioDelay; ///< config audio delay
static char ConfigAudioPassthrough; ///< config audio pass-through mask
static char AudioPassthroughState; ///< flag audio pass-through on/off
static char ConfigAudioDownmix; ///< config ffmpeg audio downmix
static char ConfigAudioSoftvol; ///< config use software volume
static char ConfigAudioNormalize; ///< config use normalize volume
static int ConfigAudioMaxNormalize; ///< config max normalize factor
static char ConfigAudioCompression; ///< config use volume compression
static int ConfigAudioMaxCompression; ///< config max volume compression
static int ConfigAudioStereoDescent; ///< config reduce stereo loudness
int ConfigAudioBufferTime; ///< config size ms of audio buffer
static int ConfigAudioAutoAES; ///< config automatic AES handling
static int ConfigAudioEq; ///< config equalizer filter
static int SetupAudioEqBand[18]; ///< config equalizer filter bands
static volatile int DoMakePrimary; ///< switch primary device to this
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// OSD
//////////////////////////////////////////////////////////////////////////////
/**
** Soft device plugin OSD class.
*/
class cSoftOsd:public cOsd
{
public:
static volatile char Dirty; ///< flag force redraw everything
int OsdLevel; ///< current osd level FIXME: remove
cSoftOsd(int, int, uint); ///< osd constructor
virtual ~ cSoftOsd(void); ///< osd destructor
/// set the sub-areas to the given areas
virtual eOsdError SetAreas(const tArea *, int);
virtual void Flush(void); ///< commits all data to the hardware
virtual void SetActive(bool); ///< sets OSD to be the active one
};
volatile char cSoftOsd::Dirty; ///< flag force redraw everything
//////////////////////////////////////////////////////////////////////////////
// OSD provider
//////////////////////////////////////////////////////////////////////////////
/**
** Soft device plugin OSD provider class.
*/
class cSoftOsdProvider:public cOsdProvider
{
private:
static cOsd *Osd; ///< single OSD
public:
virtual cOsd * CreateOsd(int, int, uint);
virtual bool ProvidesTrueColor(void);
cSoftOsdProvider(void); ///< OSD provider constructor
//virtual ~cSoftOsdProvider(); ///< OSD provider destructor
};
cOsd *cSoftOsdProvider::Osd; ///< single osd
//////////////////////////////////////////////////////////////////////////////
// cMenuSetupPage
//////////////////////////////////////////////////////////////////////////////
/**
** Soft device plugin menu setup page class.
*/
class cMenuSetupSoft:public cMenuSetupPage
{
protected:
///
/// local copies of global setup variables:
/// @{
int General;
int MakePrimary;
int HideMainMenuEntry;
int Audio;
int AudioDelay;
int AudioPassthroughDefault;
int AudioPassthroughPCM;
int AudioPassthroughAC3;
int AudioPassthroughEAC3;
int AudioDownmix;
int AudioSoftvol;
int AudioNormalize;
int AudioMaxNormalize;
int AudioCompression;
int AudioMaxCompression;
int AudioStereoDescent;
int AudioBufferTime;
int AudioAutoAES;
int AudioFilter;
int AudioEq;
int AudioEqBand[18];
/// @}
private:
inline cOsdItem * CollapsedItem(const char *, int &, const char * = NULL);
void Create(void); // create sub-menu
protected:
virtual void Store(void);
public:
cMenuSetupSoft(void);
virtual eOSState ProcessKey(eKeys); // handle input
};
//////////////////////////////////////////////////////////////////////////////
// cDevice
//////////////////////////////////////////////////////////////////////////////
class cSoftHdDevice:public cDevice
{
public:
cSoftHdDevice(void);
virtual ~ cSoftHdDevice(void);
virtual cString DeviceName(void) const { return "softhddevice-drm"; }
virtual bool HasDecoder(void) const;
virtual bool CanReplay(void) const;
virtual bool SetPlayMode(ePlayMode);
virtual void TrickSpeed(int, bool);
virtual void Clear(void);
virtual void Play(void);
virtual void Freeze(void);
virtual void Mute(void);
virtual void StillPicture(const uchar *, int);
virtual bool Poll(cPoller &, int = 0);
virtual bool Flush(int = 0);
virtual int64_t GetSTC(void);
virtual void SetVideoDisplayFormat(eVideoDisplayFormat);
virtual void SetVideoFormat(bool);
virtual void GetVideoSize(int &, int &, double &);
virtual void GetOsdSize(int &, int &, double &);
virtual int PlayVideo(const uchar *, int);
virtual int PlayAudio(const uchar *, int, uchar);
virtual void SetAudioChannelDevice(int);
virtual int GetAudioChannelDevice(void);
virtual void SetDigitalAudioDevice(bool);
virtual void SetAudioTrackDevice(eTrackType);
virtual void SetVolumeDevice(int);
// Image Grab facilities
virtual uchar *GrabImage(int &, bool, int, int, int);
// SPU facilities
private:
cDvbSpuDecoder * spuDecoder;
public:
virtual cSpuDecoder * GetSpuDecoder(void);
protected:
virtual void MakePrimaryDevice(bool);
};
//////////////////////////////////////////////////////////////////////////////
// cPlugin
//////////////////////////////////////////////////////////////////////////////
class cPluginSoftHdDevice:public cPlugin
{
public:
cPluginSoftHdDevice(void);
virtual ~ cPluginSoftHdDevice(void);
virtual const char *Version(void);
virtual const char *Description(void);
virtual const char *CommandLineHelp(void);
virtual bool ProcessArgs(int, char *[]);
virtual bool Initialize(void);
virtual bool Start(void);
virtual void Stop(void);
virtual const char *MainMenuEntry(void);
virtual cOsdObject *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void);
virtual bool SetupParse(const char *, const char *);
virtual bool Service(const char *, void * = NULL);
virtual const char **SVDRPHelpPages(void);
virtual cString SVDRPCommand(const char *, const char *, int &);
};