2014-03-08 12:07:47 +01:00
|
|
|
/*
|
|
|
|
* 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"
|
2014-12-05 22:14:40 +01:00
|
|
|
#include "log.h"
|
2014-03-08 12:07:47 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
cSatipConfig SatipConfig;
|
|
|
|
|
|
|
|
cSatipConfig::cSatipConfig(void)
|
2014-03-13 17:23:55 +01:00
|
|
|
: operatingModeM(eOperatingModeLow),
|
2014-12-21 15:11:05 +01:00
|
|
|
traceModeM(eTraceModeNormal),
|
2015-01-05 23:58:35 +01:00
|
|
|
ciExtensionM(0),
|
2014-03-10 20:21:08 +01:00
|
|
|
eitScanM(1),
|
2015-01-15 18:27:02 +01:00
|
|
|
useBytesM(1),
|
2016-01-07 20:56:39 +01:00
|
|
|
portRangeStartM(0),
|
|
|
|
portRangeStopM(0),
|
2016-12-11 00:18:12 +01:00
|
|
|
transportModeM(eTransportModeUnicast),
|
2015-03-17 20:25:15 +01:00
|
|
|
detachedModeM(false),
|
2015-01-17 16:29:21 +01:00
|
|
|
disableServerQuirksM(false),
|
2017-11-18 22:32:57 +01:00
|
|
|
useSingleModelServersM(false),
|
|
|
|
rtpRcvBufSizeM(0)
|
2014-03-08 12:07:47 +01:00
|
|
|
{
|
2015-01-11 00:49:59 +01:00
|
|
|
for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i)
|
|
|
|
cicamsM[i] = 0;
|
|
|
|
for (unsigned int i = 0; i < ELEMENTS(disabledSourcesM); ++i)
|
2014-10-31 21:07:33 +01:00
|
|
|
disabledSourcesM[i] = cSource::stNone;
|
2015-01-11 00:49:59 +01:00
|
|
|
for (unsigned int i = 0; i < ELEMENTS(disabledFiltersM); ++i)
|
2014-03-08 12:07:47 +01:00
|
|
|
disabledFiltersM[i] = -1;
|
|
|
|
}
|
|
|
|
|
2015-01-11 00:49:59 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2014-10-31 21:07:33 +01:00
|
|
|
unsigned int cSatipConfig::GetDisabledSourcesCount(void) const
|
|
|
|
{
|
|
|
|
unsigned int n = 0;
|
2015-01-11 00:49:59 +01:00
|
|
|
while ((n < ELEMENTS(disabledSourcesM) && (disabledSourcesM[n] != cSource::stNone)))
|
2014-10-31 21:07:33 +01:00
|
|
|
n++;
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipConfig::GetDisabledSources(unsigned int indexP) const
|
|
|
|
{
|
2015-01-11 00:49:59 +01:00
|
|
|
return (indexP < ELEMENTS(disabledSourcesM)) ? disabledSourcesM[indexP] : cSource::stNone;
|
2014-10-31 21:07:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void cSatipConfig::SetDisabledSources(unsigned int indexP, int sourceP)
|
|
|
|
{
|
2015-01-11 00:49:59 +01:00
|
|
|
if (indexP < ELEMENTS(disabledSourcesM))
|
2014-10-31 21:07:33 +01:00
|
|
|
disabledSourcesM[indexP] = sourceP;
|
|
|
|
}
|
|
|
|
|
2014-03-08 12:07:47 +01:00
|
|
|
unsigned int cSatipConfig::GetDisabledFiltersCount(void) const
|
|
|
|
{
|
|
|
|
unsigned int n = 0;
|
2015-01-11 00:49:59 +01:00
|
|
|
while ((n < ELEMENTS(disabledFiltersM) && (disabledFiltersM[n] != -1)))
|
2014-03-08 12:07:47 +01:00
|
|
|
n++;
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatipConfig::GetDisabledFilters(unsigned int indexP) const
|
|
|
|
{
|
2015-01-11 00:49:59 +01:00
|
|
|
return (indexP < ELEMENTS(disabledFiltersM)) ? disabledFiltersM[indexP] : -1;
|
2014-03-08 12:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void cSatipConfig::SetDisabledFilters(unsigned int indexP, int numberP)
|
|
|
|
{
|
2015-01-11 00:49:59 +01:00
|
|
|
if (indexP < ELEMENTS(disabledFiltersM))
|
2014-03-08 12:07:47 +01:00
|
|
|
disabledFiltersM[indexP] = numberP;
|
|
|
|
}
|