-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathconfig.c
84 lines (73 loc) · 2.11 KB
/
config.c
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
/*
* config.c: SAT>IP plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#include "discover.h"
#include "log.h"
#include "config.h"
cSatipConfig SatipConfig;
cSatipConfig::cSatipConfig(void)
: operatingModeM(eOperatingModeLow),
traceModeM(eTraceModeNormal),
ciExtensionM(0),
frontendReuseM(1),
eitScanM(1),
useBytesM(1),
portRangeStartM(0),
portRangeStopM(0),
transportModeM(eTransportModeUnicast),
detachedModeM(false),
disableServerQuirksM(false),
useSingleModelServersM(false),
rtpRcvBufSizeM(0)
{
for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i)
cicamsM[i] = 0;
for (unsigned int i = 0; i < ELEMENTS(disabledSourcesM); ++i)
disabledSourcesM[i] = cSource::stNone;
for (unsigned int i = 0; i < ELEMENTS(disabledFiltersM); ++i)
disabledFiltersM[i] = -1;
}
int cSatipConfig::GetCICAM(unsigned int indexP) const
{
return (indexP < ELEMENTS(cicamsM)) ? cicamsM[indexP] : -1;
}
void cSatipConfig::SetCICAM(unsigned int indexP, int cicamP)
{
if (indexP < ELEMENTS(cicamsM))
cicamsM[indexP] = cicamP;
}
unsigned int cSatipConfig::GetDisabledSourcesCount(void) const
{
unsigned int n = 0;
while ((n < ELEMENTS(disabledSourcesM) && (disabledSourcesM[n] != cSource::stNone)))
n++;
return n;
}
int cSatipConfig::GetDisabledSources(unsigned int indexP) const
{
return (indexP < ELEMENTS(disabledSourcesM)) ? disabledSourcesM[indexP] : cSource::stNone;
}
void cSatipConfig::SetDisabledSources(unsigned int indexP, int sourceP)
{
if (indexP < ELEMENTS(disabledSourcesM))
disabledSourcesM[indexP] = sourceP;
}
unsigned int cSatipConfig::GetDisabledFiltersCount(void) const
{
unsigned int n = 0;
while ((n < ELEMENTS(disabledFiltersM) && (disabledFiltersM[n] != -1)))
n++;
return n;
}
int cSatipConfig::GetDisabledFilters(unsigned int indexP) const
{
return (indexP < ELEMENTS(disabledFiltersM)) ? disabledFiltersM[indexP] : -1;
}
void cSatipConfig::SetDisabledFilters(unsigned int indexP, int numberP)
{
if (indexP < ELEMENTS(disabledFiltersM))
disabledFiltersM[indexP] = numberP;
}