2007-09-15 17:38:38 +02:00
|
|
|
/*
|
|
|
|
* config.c: IPTV plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
cIptvConfig IptvConfig;
|
|
|
|
|
|
|
|
cIptvConfig::cIptvConfig(void)
|
2013-02-23 14:31:11 +01:00
|
|
|
: tsBufferSizeM(2),
|
|
|
|
tsBufferPrefillRatioM(0),
|
|
|
|
extProtocolBasePortM(4321),
|
|
|
|
useBytesM(1),
|
|
|
|
sectionFilteringM(1)
|
2007-09-15 17:38:38 +02:00
|
|
|
{
|
2013-02-23 14:31:11 +01:00
|
|
|
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i)
|
|
|
|
disabledFiltersM[i] = -1;
|
|
|
|
memset(configDirectoryM, '\0', sizeof(configDirectoryM));
|
2007-10-06 02:02:50 +02:00
|
|
|
}
|
|
|
|
|
2008-01-05 00:36:37 +01:00
|
|
|
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
|
2007-10-06 02:02:50 +02:00
|
|
|
{
|
|
|
|
unsigned int n = 0;
|
2013-02-23 14:31:11 +01:00
|
|
|
while ((n < ARRAY_SIZE(disabledFiltersM) && (disabledFiltersM[n] != -1)))
|
2008-02-01 22:54:24 +01:00
|
|
|
n++;
|
2007-10-06 02:02:50 +02:00
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
2013-02-23 14:31:11 +01:00
|
|
|
int cIptvConfig::GetDisabledFilters(unsigned int indexP) const
|
2007-10-06 02:02:50 +02:00
|
|
|
{
|
2013-02-23 14:31:11 +01:00
|
|
|
return (indexP < ARRAY_SIZE(disabledFiltersM)) ? disabledFiltersM[indexP] : -1;
|
2007-10-06 02:02:50 +02:00
|
|
|
}
|
|
|
|
|
2013-02-23 14:31:11 +01:00
|
|
|
void cIptvConfig::SetDisabledFilters(unsigned int indexP, int numberP)
|
2007-10-06 02:02:50 +02:00
|
|
|
{
|
2013-02-23 14:31:11 +01:00
|
|
|
if (indexP < ARRAY_SIZE(disabledFiltersM))
|
|
|
|
disabledFiltersM[indexP] = numberP;
|
2007-09-15 17:38:38 +02:00
|
|
|
}
|
2007-10-20 00:54:03 +02:00
|
|
|
|
|
|
|
void cIptvConfig::SetConfigDirectory(const char *directoryP)
|
|
|
|
{
|
2012-03-30 18:01:46 +02:00
|
|
|
debug("cIptvConfig::SetConfigDirectory(%s)\n", directoryP);
|
2013-02-23 14:31:11 +01:00
|
|
|
ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory");
|
2007-10-20 00:54:03 +02:00
|
|
|
}
|