mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 11:37:03 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54a990ffe8 | ||
|
|
53c2026a60 | ||
|
|
dc9f9f2b86 | ||
|
|
688c7db1fc | ||
|
|
591fb8431b | ||
|
|
dab869cf3a | ||
|
|
aaca7cba1a |
18
HISTORY
18
HISTORY
@@ -226,6 +226,10 @@ VDR Plugin 'iptv' Revision History
|
||||
- Made devices to shutdown already in cPluginManager::Stop()
|
||||
to prevent possible crashes while VDR shutdown.
|
||||
|
||||
2014-03-09: Version 2.0.3
|
||||
|
||||
- Fixed installation target bugs (Thanks to Alexander Grothe).
|
||||
|
||||
|
||||
==================================
|
||||
VDR Plugin 'iptv' Revision History
|
||||
@@ -235,3 +239,17 @@ VDR Plugin 'iptv' Revision History
|
||||
|
||||
- Added initial CAM support.
|
||||
- Added missing RTSP/UDP support.
|
||||
|
||||
2014-03-09: Version 2.1.1
|
||||
|
||||
- Fixed installation target bugs (Thanks to Alexander Grothe).
|
||||
|
||||
2014-03-16: Version 2.1.2
|
||||
|
||||
- Updated for vdr-2.1.6.
|
||||
|
||||
2014-05-10: Version 2.1.3
|
||||
|
||||
- Updated the section filtering options.
|
||||
- Removed unnecessary TS buffer settings.
|
||||
- Added RTP packet error detection.
|
||||
|
||||
4
Makefile
4
Makefile
@@ -32,6 +32,7 @@ PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(s
|
||||
LIBDIR = $(call PKGCFG,libdir)
|
||||
LOCDIR = $(call PKGCFG,locdir)
|
||||
PLGCFG = $(call PKGCFG,plgcfg)
|
||||
RESDIR = $(call PKGCFG,resdir)
|
||||
CFGDIR = $(call PKGCFG,configdir)
|
||||
#
|
||||
TMPDIR ?= /tmp
|
||||
@@ -147,7 +148,8 @@ install-lib: $(SOFILE)
|
||||
|
||||
install-conf:
|
||||
@mkdir -p $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN)
|
||||
@cp -pn $(PLUGIN)/* $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN)/
|
||||
@mkdir -p $(DESTDIR)$(RESDIR)/plugins/$(PLUGIN)
|
||||
@cp -pn $(PLUGIN)/* $(DESTDIR)$(RESDIR)/plugins/$(PLUGIN)/
|
||||
|
||||
install: install-lib install-i18n install-conf
|
||||
|
||||
|
||||
14
common.c
14
common.c
@@ -75,12 +75,10 @@ cString ChangeCase(const cString &strP, bool upperP)
|
||||
|
||||
const section_filter_table_type section_filter_table[SECTION_FILTER_TABLE_SIZE] =
|
||||
{
|
||||
/* description tag pid tid mask */
|
||||
{trNOOP("PAT (0x00)"), "PAT", 0x00, 0x00, 0xFF},
|
||||
{trNOOP("NIT (0x40)"), "NIT", 0x10, 0x40, 0xFF},
|
||||
{trNOOP("SDT (0x42)"), "SDT", 0x11, 0x42, 0xFF},
|
||||
{trNOOP("EIT (0x4E/0x4F)"), "EIT", 0x12, 0x4E, 0xFE},
|
||||
{trNOOP("EIT (0x5X)"), "EIT", 0x12, 0x50, 0xF0},
|
||||
{trNOOP("EIT (0x6X)"), "EIT", 0x12, 0x60, 0xF0},
|
||||
{trNOOP("TDT (0x70)"), "TDT", 0x14, 0x70, 0xFF},
|
||||
/* description tag pid tid mask */
|
||||
{trNOOP("PAT (0x00)"), "PAT", 0x00, 0x00, 0xFF},
|
||||
{trNOOP("NIT (0x40)"), "NIT", 0x10, 0x40, 0xFF},
|
||||
{trNOOP("SDT (0x42)"), "SDT", 0x11, 0x42, 0xFF},
|
||||
{trNOOP("EIT (0x4E/0x4F/0x5X/0x6X)"), "EIT", 0x12, 0x40, 0xC0},
|
||||
{trNOOP("TDT (0x70)"), "TDT", 0x14, 0x70, 0xFF},
|
||||
};
|
||||
|
||||
4
common.h
4
common.h
@@ -24,6 +24,8 @@
|
||||
|
||||
#define ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
|
||||
|
||||
#define IPTV_BUFFER_SIZE MEGABYTE(1)
|
||||
|
||||
#define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr"
|
||||
|
||||
#define IPTV_SOURCE_CHARACTER 'I'
|
||||
@@ -38,7 +40,7 @@
|
||||
#define IPTV_STATS_ACTIVE_PIDS_COUNT 10
|
||||
#define IPTV_STATS_ACTIVE_FILTERS_COUNT 10
|
||||
|
||||
#define SECTION_FILTER_TABLE_SIZE 7
|
||||
#define SECTION_FILTER_TABLE_SIZE 5
|
||||
|
||||
#define ERROR_IF_FUNC(exp, errstr, func, ret) \
|
||||
do { \
|
||||
|
||||
11
config.c
11
config.c
@@ -10,15 +10,14 @@
|
||||
cIptvConfig IptvConfig;
|
||||
|
||||
cIptvConfig::cIptvConfig(void)
|
||||
: tsBufferSizeM(2),
|
||||
tsBufferPrefillRatioM(0),
|
||||
protocolBasePortM(4321),
|
||||
: protocolBasePortM(4321),
|
||||
useBytesM(1),
|
||||
sectionFilteringM(1)
|
||||
{
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i)
|
||||
disabledFiltersM[i] = -1;
|
||||
memset(configDirectoryM, 0, sizeof(configDirectoryM));
|
||||
memset(resourceDirectoryM, 0, sizeof(resourceDirectoryM));
|
||||
}
|
||||
|
||||
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
|
||||
@@ -45,3 +44,9 @@ void cIptvConfig::SetConfigDirectory(const char *directoryP)
|
||||
debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP);
|
||||
ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory");
|
||||
}
|
||||
|
||||
void cIptvConfig::SetResourceDirectory(const char *directoryP)
|
||||
{
|
||||
debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP);
|
||||
ERROR_IF(!realpath(directoryP, resourceDirectoryM), "Cannot canonicalize resource directory");
|
||||
}
|
||||
|
||||
9
config.h
9
config.h
@@ -14,31 +14,28 @@
|
||||
class cIptvConfig
|
||||
{
|
||||
private:
|
||||
unsigned int tsBufferSizeM;
|
||||
unsigned int tsBufferPrefillRatioM;
|
||||
unsigned int protocolBasePortM;
|
||||
unsigned int useBytesM;
|
||||
unsigned int sectionFilteringM;
|
||||
int disabledFiltersM[SECTION_FILTER_TABLE_SIZE];
|
||||
char configDirectoryM[PATH_MAX];
|
||||
char resourceDirectoryM[PATH_MAX];
|
||||
|
||||
public:
|
||||
cIptvConfig();
|
||||
unsigned int GetTsBufferSize(void) const { return tsBufferSizeM; }
|
||||
unsigned int GetTsBufferPrefillRatio(void) const { return tsBufferPrefillRatioM; }
|
||||
unsigned int GetProtocolBasePort(void) const { return protocolBasePortM; }
|
||||
unsigned int GetUseBytes(void) const { return useBytesM; }
|
||||
unsigned int GetSectionFiltering(void) const { return sectionFilteringM; }
|
||||
const char *GetConfigDirectory(void) const { return configDirectoryM; }
|
||||
const char *GetResourceDirectory(void) const { return resourceDirectoryM; }
|
||||
unsigned int GetDisabledFiltersCount(void) const;
|
||||
int GetDisabledFilters(unsigned int indexP) const;
|
||||
void SetTsBufferSize(unsigned int sizeP) { tsBufferSizeM = sizeP; }
|
||||
void SetTsBufferPrefillRatio(unsigned int ratioP) { tsBufferPrefillRatioM = ratioP; }
|
||||
void SetProtocolBasePort(unsigned int portNumberP) { protocolBasePortM = portNumberP; }
|
||||
void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; }
|
||||
void SetSectionFiltering(unsigned int onOffP) { sectionFilteringM = onOffP; }
|
||||
void SetDisabledFilters(unsigned int indexP, int numberP);
|
||||
void SetConfigDirectory(const char *directoryP);
|
||||
void SetResourceDirectory(const char *directoryP);
|
||||
};
|
||||
|
||||
extern cIptvConfig IptvConfig;
|
||||
|
||||
31
device.c
31
device.c
@@ -22,7 +22,7 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
|
||||
pidScanEnabledM(false),
|
||||
channelM()
|
||||
{
|
||||
unsigned int bufsize = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize());
|
||||
unsigned int bufsize = (unsigned int)IPTV_BUFFER_SIZE;
|
||||
bufsize -= (bufsize % TS_SIZE);
|
||||
isyslog("creating IPTV device %d (CardIndex=%d)", deviceIndexM, CardIndex());
|
||||
tsBufferM = new cRingBufferLinear(bufsize + 1, TS_SIZE, false,
|
||||
@@ -32,7 +32,6 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
|
||||
tsBufferM->SetIoThrottle();
|
||||
pIptvStreamerM = new cIptvStreamer(*this, tsBufferM->Free());
|
||||
}
|
||||
ResetBuffering();
|
||||
pUdpProtocolM = new cIptvProtocolUdp();
|
||||
pCurlProtocolM = new cIptvProtocolCurl();
|
||||
pHttpProtocolM = new cIptvProtocolHttp();
|
||||
@@ -305,7 +304,7 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
|
||||
|
||||
bool cIptvDevice::SetPid(cPidHandle *handleP, int typeP, bool onP)
|
||||
{
|
||||
debug("cIptvDevice::%s(%d): pid=%d type=%d on=%d", __FUNCTION__, deviceIndexM, handleP->pid, typeP, onP);
|
||||
debug("cIptvDevice::%s(%d): pid=%d type=%d on=%d", __FUNCTION__, deviceIndexM, handleP ? handleP->pid : -1, typeP, onP);
|
||||
if (pIptvStreamerM && handleP)
|
||||
return pIptvStreamerM->SetPid(handleP->pid, typeP, onP);
|
||||
return true;
|
||||
@@ -337,7 +336,6 @@ bool cIptvDevice::OpenDvr(void)
|
||||
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
isPacketDeliveredM = false;
|
||||
tsBufferM->Clear();
|
||||
ResetBuffering();
|
||||
if (pIptvStreamerM)
|
||||
pIptvStreamerM->Open();
|
||||
if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering())
|
||||
@@ -363,7 +361,7 @@ void cIptvDevice::CloseDvr(void)
|
||||
bool cIptvDevice::HasLock(int timeoutMsP) const
|
||||
{
|
||||
//debug("cIptvDevice::%s(%d): timeoutMs=%d", __FUNCTION__, deviceIndexM, timeoutMsP);
|
||||
return (!IsBuffering());
|
||||
return (pIptvStreamerM && pIptvStreamerM->Active());
|
||||
}
|
||||
|
||||
bool cIptvDevice::HasInternalCam(void)
|
||||
@@ -372,25 +370,6 @@ bool cIptvDevice::HasInternalCam(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
void cIptvDevice::ResetBuffering(void)
|
||||
{
|
||||
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
// Pad prefill to multiple of TS_SIZE
|
||||
tsBufferPrefillM = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize()) *
|
||||
IptvConfig.GetTsBufferPrefillRatio() / 100;
|
||||
tsBufferPrefillM -= (tsBufferPrefillM % TS_SIZE);
|
||||
}
|
||||
|
||||
bool cIptvDevice::IsBuffering(void) const
|
||||
{
|
||||
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
if (tsBufferPrefillM && tsBufferM && tsBufferM->Available() < tsBufferPrefillM)
|
||||
return true;
|
||||
else
|
||||
tsBufferPrefillM = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void cIptvDevice::WriteData(uchar *bufferP, int lengthP)
|
||||
{
|
||||
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
@@ -420,7 +399,7 @@ unsigned int cIptvDevice::CheckData(void)
|
||||
uchar *cIptvDevice::GetData(int *availableP)
|
||||
{
|
||||
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
if (isOpenDvrM && tsBufferM && !IsBuffering()) {
|
||||
if (isOpenDvrM && tsBufferM) {
|
||||
int count = 0;
|
||||
if (isPacketDeliveredM)
|
||||
SkipData(TS_SIZE);
|
||||
@@ -434,7 +413,7 @@ uchar *cIptvDevice::GetData(int *availableP)
|
||||
}
|
||||
}
|
||||
tsBufferM->Del(count);
|
||||
error("Skipped %d bytes to sync on TS packet", count);
|
||||
info("Skipped %d bytes to sync on TS packet", count);
|
||||
return NULL;
|
||||
}
|
||||
isPacketDeliveredM = true;
|
||||
|
||||
6
device.h
6
device.h
@@ -40,7 +40,6 @@ private:
|
||||
bool sidScanEnabledM;
|
||||
bool pidScanEnabledM;
|
||||
cRingBufferLinear *tsBufferM;
|
||||
mutable int tsBufferPrefillM;
|
||||
cChannel channelM;
|
||||
cIptvProtocolUdp *pUdpProtocolM;
|
||||
cIptvProtocolCurl *pCurlProtocolM;
|
||||
@@ -69,11 +68,6 @@ private:
|
||||
cString GetPidsInformation(void);
|
||||
cString GetFiltersInformation(void);
|
||||
|
||||
// for channel parsing & buffering
|
||||
private:
|
||||
void ResetBuffering(void);
|
||||
bool IsBuffering(void) const;
|
||||
|
||||
// for channel info
|
||||
public:
|
||||
virtual cString DeviceType(void) const;
|
||||
|
||||
15
iptv.c
15
iptv.c
@@ -13,15 +13,15 @@
|
||||
#include "device.h"
|
||||
#include "iptvservice.h"
|
||||
|
||||
#if defined(APIVERSNUM) && APIVERSNUM < 20104
|
||||
#error "VDR-2.1.4 API version or greater is required!"
|
||||
#if defined(APIVERSNUM) && APIVERSNUM < 20106
|
||||
#error "VDR-2.1.6 API version or greater is required!"
|
||||
#endif
|
||||
|
||||
#ifndef GITVERSION
|
||||
#define GITVERSION ""
|
||||
#endif
|
||||
|
||||
const char VERSION[] = "2.1.0" GITVERSION;
|
||||
const char VERSION[] = "2.1.3" GITVERSION;
|
||||
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
|
||||
|
||||
class cPluginIptv : public cPlugin {
|
||||
@@ -99,7 +99,8 @@ bool cPluginIptv::Initialize(void)
|
||||
{
|
||||
debug("cPluginIptv::%s()", __FUNCTION__);
|
||||
// Initialize any background activities the plugin shall perform.
|
||||
IptvConfig.SetConfigDirectory(cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
|
||||
IptvConfig.SetConfigDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N));
|
||||
IptvConfig.SetResourceDirectory(cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
|
||||
return cIptvDevice::Initialize(deviceCountM);
|
||||
}
|
||||
|
||||
@@ -191,11 +192,7 @@ bool cPluginIptv::SetupParse(const char *nameP, const char *valueP)
|
||||
{
|
||||
debug("cPluginIptv::%s()", __FUNCTION__);
|
||||
// Parse your own setup parameters and store their values.
|
||||
if (!strcasecmp(nameP, "TsBufferSize"))
|
||||
IptvConfig.SetTsBufferSize(atoi(valueP));
|
||||
else if (!strcasecmp(nameP, "TsBufferPrefill"))
|
||||
IptvConfig.SetTsBufferPrefillRatio(atoi(valueP));
|
||||
else if (!strcasecmp(nameP, "ExtProtocolBasePort"))
|
||||
if (!strcasecmp(nameP, "ExtProtocolBasePort"))
|
||||
IptvConfig.SetProtocolBasePort(atoi(valueP));
|
||||
else if (!strcasecmp(nameP, "SectionFiltering"))
|
||||
IptvConfig.SetSectionFiltering(atoi(valueP));
|
||||
|
||||
40
po/de_DE.po
40
po/de_DE.po
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.1.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.1.3\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
|
||||
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
|
||||
"Language-Team: German <vdr@linuxtv.org>\n"
|
||||
"Language: de\n"
|
||||
@@ -26,14 +26,8 @@ msgstr "NIT (0x40)"
|
||||
msgid "SDT (0x42)"
|
||||
msgstr "SDT (0x42)"
|
||||
|
||||
msgid "EIT (0x4E/0x4F)"
|
||||
msgstr "EIT (0x4E/0x4F)"
|
||||
|
||||
msgid "EIT (0x5X)"
|
||||
msgstr "EIT (0x5X)"
|
||||
|
||||
msgid "EIT (0x6X)"
|
||||
msgstr "EIT (0x6X)"
|
||||
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
|
||||
msgid "TDT (0x70)"
|
||||
msgstr "TDT (0x70)"
|
||||
@@ -59,24 +53,6 @@ msgstr "Bits/Bytes"
|
||||
msgid "IPTV information not available!"
|
||||
msgstr "IPTV Informationen nicht verfügbar!"
|
||||
|
||||
msgid "TS buffer size [MB]"
|
||||
msgstr "TS Puffergröße [MB]"
|
||||
|
||||
msgid ""
|
||||
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||
"\n"
|
||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||
msgstr ""
|
||||
|
||||
msgid "TS buffer prefill ratio [%]"
|
||||
msgstr "TS Puffer-Preload [%]"
|
||||
|
||||
msgid ""
|
||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||
"\n"
|
||||
"This is useful if streaming media over a slow or unreliable connection."
|
||||
msgstr ""
|
||||
|
||||
msgid "Protocol base port"
|
||||
msgstr "Protokoll Basisport"
|
||||
|
||||
@@ -130,12 +106,6 @@ msgstr "DATEI"
|
||||
msgid "EXT"
|
||||
msgstr "EXT"
|
||||
|
||||
msgid "Nid"
|
||||
msgstr "Nid"
|
||||
|
||||
msgid "Tid"
|
||||
msgstr "Tid"
|
||||
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
|
||||
46
po/fi_FI.po
46
po/fi_FI.po
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.1.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.1.3\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
|
||||
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Rolf Ahrenberg\n"
|
||||
"Language-Team: Finnish <vdr@linuxtv.org>\n"
|
||||
"Language: fi\n"
|
||||
@@ -25,14 +25,8 @@ msgstr "NIT (0x40)"
|
||||
msgid "SDT (0x42)"
|
||||
msgstr "SDT (0x42)"
|
||||
|
||||
msgid "EIT (0x4E/0x4F)"
|
||||
msgstr "EIT (0x4E/0x4F)"
|
||||
|
||||
msgid "EIT (0x5X)"
|
||||
msgstr "EIT (0x5X)"
|
||||
|
||||
msgid "EIT (0x6X)"
|
||||
msgstr "EIT (0x6X)"
|
||||
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
|
||||
msgid "TDT (0x70)"
|
||||
msgstr "TDT (0x70)"
|
||||
@@ -58,30 +52,6 @@ msgstr "Bitit/tavut"
|
||||
msgid "IPTV information not available!"
|
||||
msgstr "IPTV-tietoja ei saatavilla!"
|
||||
|
||||
msgid "TS buffer size [MB]"
|
||||
msgstr "TS-puskurin koko [MB]"
|
||||
|
||||
msgid ""
|
||||
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||
"\n"
|
||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||
msgstr ""
|
||||
"Määritä rengaspuskurin koko TS-lähetteelle megatavuina.\n"
|
||||
"\n"
|
||||
"Pienempi rengaspuskuri vähentää muistinkulutusta, mutta on virhealttiimpi puskurin ylivuodolle."
|
||||
|
||||
msgid "TS buffer prefill ratio [%]"
|
||||
msgstr "TS-puskurin esitäyttöaste [%]"
|
||||
|
||||
msgid ""
|
||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||
"\n"
|
||||
"This is useful if streaming media over a slow or unreliable connection."
|
||||
msgstr ""
|
||||
"Määrittele TS-rengaspuskurin esitäyttöaste, jonka jälkeen lähetettä aletaan siirtämään eteenpäin VDR:lle.\n"
|
||||
"\n"
|
||||
"Puskurin esitäyttö parantaa suoratoistoa hitailla ja epäluotettavilla yhteyksillä."
|
||||
|
||||
msgid "Protocol base port"
|
||||
msgstr "Protokollan perusportti"
|
||||
|
||||
@@ -145,12 +115,6 @@ msgstr "FILE"
|
||||
msgid "EXT"
|
||||
msgstr "EXT"
|
||||
|
||||
msgid "Nid"
|
||||
msgstr "Verkko-ID"
|
||||
|
||||
msgid "Tid"
|
||||
msgstr "Lähete-ID"
|
||||
|
||||
msgid "Rid"
|
||||
msgstr "Radio-ID"
|
||||
|
||||
|
||||
46
po/fr_FR.po
46
po/fr_FR.po
@@ -6,10 +6,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.1.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.1.3\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
|
||||
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
|
||||
"Language-Team: French <vdr@linuxtv.org>\n"
|
||||
"Language: fr\n"
|
||||
@@ -27,14 +27,8 @@ msgstr "NIT (0x40)"
|
||||
msgid "SDT (0x42)"
|
||||
msgstr "SDT (0x42)"
|
||||
|
||||
msgid "EIT (0x4E/0x4F)"
|
||||
msgstr "EIT (0x4E/0x4F)"
|
||||
|
||||
msgid "EIT (0x5X)"
|
||||
msgstr "EIT (0x5X)"
|
||||
|
||||
msgid "EIT (0x6X)"
|
||||
msgstr "EIT (0x6X)"
|
||||
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
|
||||
msgid "TDT (0x70)"
|
||||
msgstr "TDT (0x70)"
|
||||
@@ -60,30 +54,6 @@ msgstr "Bits/Bytes"
|
||||
msgid "IPTV information not available!"
|
||||
msgstr "Information sur IPTV non disponible !"
|
||||
|
||||
msgid "TS buffer size [MB]"
|
||||
msgstr "Taille du buffer TS [MB]"
|
||||
|
||||
msgid ""
|
||||
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||
"\n"
|
||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||
msgstr ""
|
||||
"Définit la taille du ringbuffer pour le transport du flux en megabytes.\n"
|
||||
"\n"
|
||||
"Une taille plus petite taille aide la consommation de mémoire, mais c'est sujet à plus de débordement de tampon."
|
||||
|
||||
msgid "TS buffer prefill ratio [%]"
|
||||
msgstr "Taux du buffer de pré-remplissage TS [%]"
|
||||
|
||||
msgid ""
|
||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||
"\n"
|
||||
"This is useful if streaming media over a slow or unreliable connection."
|
||||
msgstr ""
|
||||
"Définit le ratio de pré-remplissage du ringbuffer pour le transport du flux avant transfert dans VDR.\n"
|
||||
"\n"
|
||||
"Cette option est utile si le streaming est sur une connexion lente ou peu fiables."
|
||||
|
||||
msgid "Protocol base port"
|
||||
msgstr "Port de base du protocole"
|
||||
|
||||
@@ -147,12 +117,6 @@ msgstr "FICHIER"
|
||||
msgid "EXT"
|
||||
msgstr "EXT"
|
||||
|
||||
msgid "Nid"
|
||||
msgstr "Nid"
|
||||
|
||||
msgid "Tid"
|
||||
msgstr "Tid"
|
||||
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
|
||||
46
po/it_IT.po
46
po/it_IT.po
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.1.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.1.3\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
|
||||
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
|
||||
"Language-Team: Italian <vdr@linuxtv.org>\n"
|
||||
"Language: it\n"
|
||||
@@ -26,14 +26,8 @@ msgstr "NIT (0x40)"
|
||||
msgid "SDT (0x42)"
|
||||
msgstr "SDT (0x42)"
|
||||
|
||||
msgid "EIT (0x4E/0x4F)"
|
||||
msgstr "EIT (0x4E/0x4F)"
|
||||
|
||||
msgid "EIT (0x5X)"
|
||||
msgstr "EIT (0x5X)"
|
||||
|
||||
msgid "EIT (0x6X)"
|
||||
msgstr "EIT (0x6X)"
|
||||
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
|
||||
msgid "TDT (0x70)"
|
||||
msgstr "TDT (0x70)"
|
||||
@@ -59,30 +53,6 @@ msgstr "Bits/bytes"
|
||||
msgid "IPTV information not available!"
|
||||
msgstr "Informazione IPTV non disponibile!"
|
||||
|
||||
msgid "TS buffer size [MB]"
|
||||
msgstr "Dimensione buffer TS [MB]"
|
||||
|
||||
msgid ""
|
||||
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||
"\n"
|
||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||
msgstr ""
|
||||
"Definisci una dimensione del buffer in MB per i flussi di trasporto.\n"
|
||||
"\n"
|
||||
"Dimensioni più piccole aiutano il consumo di memoria, ma sono più inclini a generare buffer overflows."
|
||||
|
||||
msgid "TS buffer prefill ratio [%]"
|
||||
msgstr "Riempimento buffer TS [%]"
|
||||
|
||||
msgid ""
|
||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||
"\n"
|
||||
"This is useful if streaming media over a slow or unreliable connection."
|
||||
msgstr ""
|
||||
"Definisci un rapporto di riempimento del buffer per i flussi di trasporto prima che i dati siano trasferiti a VDR.\n"
|
||||
"\n"
|
||||
"Questo è utile se si trasmette dati su una connessione lenta oppure inaffidabile."
|
||||
|
||||
msgid "Protocol base port"
|
||||
msgstr "Porta base protocollo"
|
||||
|
||||
@@ -146,12 +116,6 @@ msgstr "FILE"
|
||||
msgid "EXT"
|
||||
msgstr "EXT"
|
||||
|
||||
msgid "Nid"
|
||||
msgstr "Nid"
|
||||
|
||||
msgid "Tid"
|
||||
msgstr "Tid"
|
||||
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
|
||||
46
po/nl_NL.po
46
po/nl_NL.po
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.1.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.1.3\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
|
||||
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Carel\n"
|
||||
"Language-Team: Dutch <vdr@linuxtv.org>\n"
|
||||
"Language: nl\n"
|
||||
@@ -26,14 +26,8 @@ msgstr "NIT (0x40)"
|
||||
msgid "SDT (0x42)"
|
||||
msgstr "SDT (0x42)"
|
||||
|
||||
msgid "EIT (0x4E/0x4F)"
|
||||
msgstr "EIT (0x4E/0x4F)"
|
||||
|
||||
msgid "EIT (0x5X)"
|
||||
msgstr "EIT (0x5X)"
|
||||
|
||||
msgid "EIT (0x6X)"
|
||||
msgstr "EIT (0x6X)"
|
||||
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
|
||||
msgid "TDT (0x70)"
|
||||
msgstr "TDT (0x70)"
|
||||
@@ -59,30 +53,6 @@ msgstr "Bits/Bytes"
|
||||
msgid "IPTV information not available!"
|
||||
msgstr "IPTV informatie niet beschikbaar!"
|
||||
|
||||
msgid "TS buffer size [MB]"
|
||||
msgstr "TS buffergrootte [MB]"
|
||||
|
||||
msgid ""
|
||||
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||
"\n"
|
||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||
msgstr ""
|
||||
"Stel de grootte van de ringbuffer vast voor transportstreams in megabytes.\n"
|
||||
"\n"
|
||||
"Bij lage waarden zapt VDR sneller maar kunnen leiden tot bufferoverschreidingen en dus dropouts."
|
||||
|
||||
msgid "TS buffer prefill ratio [%]"
|
||||
msgstr "TS buffer-preload [%]"
|
||||
|
||||
msgid ""
|
||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||
"\n"
|
||||
"This is useful if streaming media over a slow or unreliable connection."
|
||||
msgstr ""
|
||||
"Stel een 'prefil ratio' in voor de ringbuffer voor transportstreams voor de data naar VDR wordt verstuurd.\n"
|
||||
"\n"
|
||||
"Dit is aan te bevelen bij onbetrouwbare of langzame verbindingen."
|
||||
|
||||
msgid "Protocol base port"
|
||||
msgstr "Protocol basispoort"
|
||||
|
||||
@@ -145,12 +115,6 @@ msgstr "BESTAND"
|
||||
msgid "EXT"
|
||||
msgstr "EXT"
|
||||
|
||||
msgid "Nid"
|
||||
msgstr "Nid"
|
||||
|
||||
msgid "Tid"
|
||||
msgstr "Tid"
|
||||
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
|
||||
40
po/ru_RU.po
40
po/ru_RU.po
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.1.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.1.3\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
|
||||
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
|
||||
"Language-Team: Russian <vdr@linuxtv.org>\n"
|
||||
"Language: ru\n"
|
||||
@@ -27,14 +27,8 @@ msgstr "NIT (0x40)"
|
||||
msgid "SDT (0x42)"
|
||||
msgstr "SDT (0x42)"
|
||||
|
||||
msgid "EIT (0x4E/0x4F)"
|
||||
msgstr "EIT (0x4E/0x4F)"
|
||||
|
||||
msgid "EIT (0x5X)"
|
||||
msgstr "EIT (0x5X)"
|
||||
|
||||
msgid "EIT (0x6X)"
|
||||
msgstr "EIT (0x6X)"
|
||||
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
|
||||
|
||||
msgid "TDT (0x70)"
|
||||
msgstr "TDT (0x70)"
|
||||
@@ -60,24 +54,6 @@ msgstr "Биты / байт"
|
||||
msgid "IPTV information not available!"
|
||||
msgstr "IPTV информация отсутствует!"
|
||||
|
||||
msgid "TS buffer size [MB]"
|
||||
msgstr "Размер TS буфера [MB]"
|
||||
|
||||
msgid ""
|
||||
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||
"\n"
|
||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||
msgstr ""
|
||||
|
||||
msgid "TS buffer prefill ratio [%]"
|
||||
msgstr "Предварительный буфер TS [%]"
|
||||
|
||||
msgid ""
|
||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||
"\n"
|
||||
"This is useful if streaming media over a slow or unreliable connection."
|
||||
msgstr ""
|
||||
|
||||
msgid "Protocol base port"
|
||||
msgstr "Базисный порт протокола"
|
||||
|
||||
@@ -131,12 +107,6 @@ msgstr "ФАЙЛ"
|
||||
msgid "EXT"
|
||||
msgstr "EXT"
|
||||
|
||||
msgid "Nid"
|
||||
msgstr "Nid"
|
||||
|
||||
msgid "Tid"
|
||||
msgstr "Tid"
|
||||
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ cIptvProtocolCurl::cIptvProtocolCurl()
|
||||
handleM(NULL),
|
||||
multiM(NULL),
|
||||
headerListM(NULL),
|
||||
ringBufferM(new cRingBufferLinear(MEGABYTE(IptvConfig.GetTsBufferSize()),
|
||||
7 * TS_SIZE, false, "IPTV CURL")),
|
||||
ringBufferM(new cRingBufferLinear(IPTV_BUFFER_SIZE, 7 * TS_SIZE, false, "IPTV CURL")),
|
||||
rtspControlM(""),
|
||||
modeM(eModeUnknown),
|
||||
timeoutM(),
|
||||
@@ -522,7 +521,7 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
|
||||
|
||||
// Use 20% threshold before continuing to filling up the buffer.
|
||||
mutexM.Lock();
|
||||
if (pausedM && (ringBufferM->Available() < (MEGABYTE(IptvConfig.GetTsBufferSize()) / 5))) {
|
||||
if (pausedM && (ringBufferM->Available() < (IPTV_BUFFER_SIZE / 5))) {
|
||||
debug("cIptvProtocolCurl::%s(continue): free=%d available=%d", __FUNCTION__,
|
||||
ringBufferM->Free(), ringBufferM->Available());
|
||||
pausedM = false;
|
||||
|
||||
@@ -158,7 +158,7 @@ bool cIptvProtocolExt::SetSource(const char* locationP, const int parameterP, co
|
||||
if (!isempty(locationP)) {
|
||||
struct stat stbuf;
|
||||
// Update script file and parameter
|
||||
scriptFileM = cString::sprintf("%s/%s", IptvConfig.GetConfigDirectory(), locationP);
|
||||
scriptFileM = cString::sprintf("%s/%s", IptvConfig.GetResourceDirectory(), locationP);
|
||||
if ((stat(*scriptFileM, &stbuf) != 0) || (strstr(*scriptFileM, "..") != 0)) {
|
||||
error("Non-existent or relative path script '%s'", *scriptFileM);
|
||||
return false;
|
||||
|
||||
@@ -17,6 +17,7 @@ cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t
|
||||
secLenM(0),
|
||||
tsFeedpM(0),
|
||||
pidM(pidP),
|
||||
ringBufferM(new cRingBufferFrame(eDmxMaxSectionCount * eDmxMaxSectionSize)),
|
||||
deviceIndexM(deviceIndexP)
|
||||
{
|
||||
//debug("cIptvSectionFilter::%s(%d, %d)", __FUNCTION__, deviceIndexM, pidM);
|
||||
@@ -33,11 +34,11 @@ cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t
|
||||
filterMaskM[0] = maskP;
|
||||
|
||||
// Invert the filter
|
||||
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i)
|
||||
for (i = 0; i < eDmxMaxFilterSize; ++i)
|
||||
filterValueM[i] ^= 0xFF;
|
||||
|
||||
uint8_t mask, mode, doneq = 0;
|
||||
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
|
||||
for (i = 0; i < eDmxMaxFilterSize; ++i) {
|
||||
mode = filterModeM[i];
|
||||
mask = filterMaskM[i];
|
||||
maskAndModeM[i] = (uint8_t)(mask & mode);
|
||||
@@ -48,7 +49,7 @@ cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t
|
||||
|
||||
// Create sockets
|
||||
socketM[0] = socketM[1] = -1;
|
||||
if (socketpair(AF_UNIX, SOCK_DGRAM, 0, socketM) != 0) {
|
||||
if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, socketM) != 0) {
|
||||
char tmp[64];
|
||||
error("Opening section filter sockets failed (device=%d pid=%d): %s", deviceIndexM, pidM, strerror_r(errno, tmp, sizeof(tmp)));
|
||||
}
|
||||
@@ -70,6 +71,7 @@ cIptvSectionFilter::~cIptvSectionFilter()
|
||||
if (tmp >= 0)
|
||||
close(tmp);
|
||||
secBufM = NULL;
|
||||
DELETENULL(ringBufferM);
|
||||
}
|
||||
|
||||
inline uint16_t cIptvSectionFilter::GetLength(const uint8_t *dataP)
|
||||
@@ -89,7 +91,7 @@ int cIptvSectionFilter::Filter(void)
|
||||
int i;
|
||||
uint8_t neq = 0;
|
||||
|
||||
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
|
||||
for (i = 0; i < eDmxMaxFilterSize; ++i) {
|
||||
uint8_t calcxor = (uint8_t)(filterValueM[i] ^ secBufM[i]);
|
||||
if (maskAndModeM[i] & calcxor)
|
||||
return 0;
|
||||
@@ -99,13 +101,8 @@ int cIptvSectionFilter::Filter(void)
|
||||
if (doneqM && !neq)
|
||||
return 0;
|
||||
|
||||
// There is no data in the read socket, more can be written
|
||||
if ((socketM[0] >= 0) && (socketM[1] >= 0) /*&& !select_single_desc(socketM[0], 0, false)*/) {
|
||||
ssize_t len = write(socketM[1], secBufM, secLenM);
|
||||
ERROR_IF(len < 0, "write()");
|
||||
// Update statistics
|
||||
AddSectionStatistic(len, 1);
|
||||
}
|
||||
if (ringBufferM && (secLenM > 0))
|
||||
ringBufferM->Put(new cFrame(secBufM, secLenM));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -122,11 +119,11 @@ int cIptvSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
|
||||
{
|
||||
uint16_t limit, seclen, n;
|
||||
|
||||
if (tsFeedpM >= DMX_MAX_SECFEED_SIZE)
|
||||
if (tsFeedpM >= eDmxMaxSectionFeedSize)
|
||||
return 0;
|
||||
|
||||
if (tsFeedpM + lenP > DMX_MAX_SECFEED_SIZE)
|
||||
lenP = (uint8_t)(DMX_MAX_SECFEED_SIZE - tsFeedpM);
|
||||
if (tsFeedpM + lenP > eDmxMaxSectionFeedSize)
|
||||
lenP = (uint8_t)(eDmxMaxSectionFeedSize - tsFeedpM);
|
||||
|
||||
if (lenP <= 0)
|
||||
return 0;
|
||||
@@ -135,7 +132,7 @@ int cIptvSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
|
||||
tsFeedpM = uint16_t(tsFeedpM + lenP);
|
||||
|
||||
limit = tsFeedpM;
|
||||
if (limit > DMX_MAX_SECFEED_SIZE)
|
||||
if (limit > eDmxMaxSectionFeedSize)
|
||||
return -1; // internal error should never happen
|
||||
|
||||
// Always set secbuf
|
||||
@@ -143,7 +140,7 @@ int cIptvSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
|
||||
|
||||
for (n = 0; secBufpM + 2 < limit; ++n) {
|
||||
seclen = GetLength(secBufM);
|
||||
if ((seclen <= 0) || (seclen > DMX_MAX_SECTION_SIZE) || ((seclen + secBufpM) > limit))
|
||||
if ((seclen <= 0) || (seclen > eDmxMaxSectionSize) || ((seclen + secBufpM) > limit))
|
||||
return 0;
|
||||
secLenM = seclen;
|
||||
if (pusiSeenM)
|
||||
@@ -211,13 +208,33 @@ void cIptvSectionFilter::Process(const uint8_t* dataP)
|
||||
}
|
||||
}
|
||||
|
||||
bool cIptvSectionFilter::Send(void)
|
||||
{
|
||||
bool result = false;
|
||||
cFrame *section = ringBufferM->Get();
|
||||
if (section) {
|
||||
uchar *data = section->Data();
|
||||
int count = section->Count();
|
||||
if (data && (count > 0) && (socketM[1] >= 0) && (socketM[0] >= 0)) {
|
||||
ssize_t len = send(socketM[1], data, count, MSG_EOR);
|
||||
ERROR_IF(len < 0 && errno != EAGAIN, "send()");
|
||||
if (len > 0) {
|
||||
ringBufferM->Drop(section);
|
||||
result = !!ringBufferM->Available();
|
||||
// Update statistics
|
||||
AddSectionStatistic(len, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
cIptvSectionFilterHandler::cIptvSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP)
|
||||
: cThread("IPTV section handler", true),
|
||||
: cThread("IPTV section handler"),
|
||||
ringBufferM(new cRingBufferLinear(bufferLenP, TS_SIZE, false, *cString::sprintf("IPTV SECTION HANDLER %d", deviceIndexP))),
|
||||
mutexM(),
|
||||
deviceIndexM(deviceIndexP),
|
||||
processedM(false),
|
||||
ringBufferM(new cRingBufferLinear(bufferLenP, TS_SIZE, false, *cString::sprintf("IPTV SECTION HANDLER %d", deviceIndexP)))
|
||||
deviceIndexM(deviceIndexP)
|
||||
{
|
||||
debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
|
||||
@@ -238,8 +255,9 @@ cIptvSectionFilterHandler::cIptvSectionFilterHandler(int deviceIndexP, unsigned
|
||||
cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
|
||||
{
|
||||
debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
Stop();
|
||||
|
||||
// Stop thread
|
||||
if (Running())
|
||||
Cancel(3);
|
||||
DELETE_POINTER(ringBufferM);
|
||||
|
||||
// Destroy all filters
|
||||
@@ -248,26 +266,28 @@ cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
|
||||
Delete(i);
|
||||
}
|
||||
|
||||
bool cIptvSectionFilterHandler::Stop(void)
|
||||
{
|
||||
debug("cIptvSectionFilterHandler::%s(%d): entering", __FUNCTION__, deviceIndexM);
|
||||
// Stop thread
|
||||
if (Running())
|
||||
Cancel(3);
|
||||
return true;
|
||||
}
|
||||
|
||||
void cIptvSectionFilterHandler::Action(void)
|
||||
{
|
||||
debug("cIptvSectionFilterHandler::%s(%d): entering", __FUNCTION__, deviceIndexM);
|
||||
bool processed = false;
|
||||
// Do the thread loop
|
||||
while (Running()) {
|
||||
// Send demuxed section packets through all filters
|
||||
bool retry = false;
|
||||
mutexM.Lock();
|
||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||
if (filtersM[i] && filtersM[i]->Send())
|
||||
retry = true;
|
||||
}
|
||||
mutexM.Unlock();
|
||||
if (retry)
|
||||
continue;
|
||||
// Read one TS packet
|
||||
if (ringBufferM) {
|
||||
int len = 0;
|
||||
if (processedM) {
|
||||
if (processed) {
|
||||
ringBufferM->Del(TS_SIZE);
|
||||
processedM = false;
|
||||
processed = false;
|
||||
}
|
||||
uchar *p = ringBufferM->Get(len);
|
||||
if (p && (len >= TS_SIZE)) {
|
||||
@@ -289,7 +309,7 @@ void cIptvSectionFilterHandler::Action(void)
|
||||
filtersM[i]->Process(p);
|
||||
}
|
||||
mutexM.Unlock();
|
||||
processedM = true;
|
||||
processed = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -358,7 +378,7 @@ int cIptvSectionFilterHandler::Open(u_short pidP, u_char tidP, u_char maskP)
|
||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||
if (!filtersM[i]) {
|
||||
filtersM[i] = new cIptvSectionFilter(deviceIndexM, pidP, tidP, maskP);
|
||||
debug("cIptvSectionFilterHandler::%s(%d): pid=%d tid=%02X mask=%02X handle=%d index=%d", __FUNCTION__, deviceIndexM, pidP, tidP, maskP, filtersM[i]->GetFd(), i);
|
||||
//debug("cIptvSectionFilterHandler::%s(%d): pid=%d tid=%02X mask=%02X handle=%d index=%u", __FUNCTION__, deviceIndexM, pidP, tidP, maskP, filtersM[i]->GetFd(), i);
|
||||
return filtersM[i]->GetFd();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
|
||||
class cIptvSectionFilter : public cIptvSectionStatistics {
|
||||
private:
|
||||
enum dmx_limits {
|
||||
DMX_MAX_FILTER_SIZE = 18,
|
||||
DMX_MAX_SECTION_SIZE = 4096,
|
||||
DMX_MAX_SECFEED_SIZE = (DMX_MAX_SECTION_SIZE + TS_SIZE)
|
||||
enum {
|
||||
eDmxMaxFilterSize = 18,
|
||||
eDmxMaxSectionCount = 64,
|
||||
eDmxMaxSectionSize = 4096,
|
||||
eDmxMaxSectionFeedSize = (eDmxMaxSectionSize + TS_SIZE)
|
||||
};
|
||||
|
||||
int pusiSeenM;
|
||||
@@ -29,21 +30,22 @@ private:
|
||||
int doneqM;
|
||||
|
||||
uint8_t *secBufM;
|
||||
uint8_t secBufBaseM[DMX_MAX_SECFEED_SIZE];
|
||||
uint8_t secBufBaseM[eDmxMaxSectionFeedSize];
|
||||
uint16_t secBufpM;
|
||||
uint16_t secLenM;
|
||||
uint16_t tsFeedpM;
|
||||
uint16_t pidM;
|
||||
|
||||
cRingBufferFrame *ringBufferM;
|
||||
int deviceIndexM;
|
||||
int socketM[2];
|
||||
|
||||
uint8_t filterValueM[DMX_MAX_FILTER_SIZE];
|
||||
uint8_t filterMaskM[DMX_MAX_FILTER_SIZE];
|
||||
uint8_t filterModeM[DMX_MAX_FILTER_SIZE];
|
||||
uint8_t filterValueM[eDmxMaxFilterSize];
|
||||
uint8_t filterMaskM[eDmxMaxFilterSize];
|
||||
uint8_t filterModeM[eDmxMaxFilterSize];
|
||||
|
||||
uint8_t maskAndModeM[DMX_MAX_FILTER_SIZE];
|
||||
uint8_t maskAndNotModeM[DMX_MAX_FILTER_SIZE];
|
||||
uint8_t maskAndModeM[eDmxMaxFilterSize];
|
||||
uint8_t maskAndNotModeM[eDmxMaxFilterSize];
|
||||
|
||||
inline uint16_t GetLength(const uint8_t *dataP);
|
||||
void New(void);
|
||||
@@ -56,6 +58,7 @@ public:
|
||||
cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t tidP, uint8_t maskP);
|
||||
virtual ~cIptvSectionFilter();
|
||||
void Process(const uint8_t* dataP);
|
||||
bool Send(void);
|
||||
int GetFd(void) { return socketM[0]; }
|
||||
uint16_t GetPid(void) const { return pidM; }
|
||||
};
|
||||
@@ -65,10 +68,9 @@ private:
|
||||
enum {
|
||||
eMaxSecFilterCount = 32
|
||||
};
|
||||
cRingBufferLinear *ringBufferM;
|
||||
cMutex mutexM;
|
||||
int deviceIndexM;
|
||||
bool processedM;
|
||||
cRingBufferLinear *ringBufferM;
|
||||
cIptvSectionFilter *filtersM[eMaxSecFilterCount];
|
||||
|
||||
bool Delete(unsigned int indexP);
|
||||
@@ -80,7 +82,6 @@ protected:
|
||||
public:
|
||||
cIptvSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP);
|
||||
virtual ~cIptvSectionFilterHandler();
|
||||
bool Stop(void);
|
||||
cString GetInformation(void);
|
||||
int Open(u_short pidP, u_char tidP, u_char maskP);
|
||||
void Close(int handleP);
|
||||
|
||||
12
setup.c
12
setup.c
@@ -113,8 +113,6 @@ eOSState cIptvMenuInfo::ProcessKey(eKeys keyP)
|
||||
cIptvPluginSetup::cIptvPluginSetup()
|
||||
{
|
||||
debug("cIptvPluginSetup::%s()", __FUNCTION__);
|
||||
tsBufferSizeM = IptvConfig.GetTsBufferSize();
|
||||
tsBufferPrefillM = IptvConfig.GetTsBufferPrefillRatio();
|
||||
protocolBasePortM = IptvConfig.GetProtocolBasePort();
|
||||
sectionFilteringM = IptvConfig.GetSectionFiltering();
|
||||
numDisabledFiltersM = IptvConfig.GetDisabledFiltersCount();
|
||||
@@ -136,12 +134,6 @@ void cIptvPluginSetup::Setup(void)
|
||||
Clear();
|
||||
helpM.Clear();
|
||||
|
||||
Add(new cMenuEditIntItem(tr("TS buffer size [MB]"), &tsBufferSizeM, 1, 4));
|
||||
helpM.Append(tr("Define a ringbuffer size for transport streams in megabytes.\n\nSmaller sizes help memory consumption, but are more prone to buffer overflows."));
|
||||
|
||||
Add(new cMenuEditIntItem(tr("TS buffer prefill ratio [%]"), &tsBufferPrefillM, 0, 40));
|
||||
helpM.Append(tr("Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n\nThis is useful if streaming media over a slow or unreliable connection."));
|
||||
|
||||
Add(new cMenuEditIntItem(tr("Protocol base port"), &protocolBasePortM, 0, 0xFFFF - MAXDEVICES * 2));
|
||||
helpM.Append(tr("Define a base port used by CURL/EXT protocol.\n\nThe port range is defined by the number of IPTV devices. This setting sets the port which is listened for connections from external applications when using the CURL/EXT protocol."));
|
||||
|
||||
@@ -217,14 +209,10 @@ void cIptvPluginSetup::StoreFilters(const char *nameP, int *valuesP)
|
||||
void cIptvPluginSetup::Store(void)
|
||||
{
|
||||
// Store values into setup.conf
|
||||
SetupStore("TsBufferSize", tsBufferSizeM);
|
||||
SetupStore("TsBufferPrefill", tsBufferPrefillM);
|
||||
SetupStore("ExtProtocolBasePort", protocolBasePortM);
|
||||
SetupStore("SectionFiltering", sectionFilteringM);
|
||||
StoreFilters("DisabledFilters", disabledFilterIndexesM);
|
||||
// Update global config
|
||||
IptvConfig.SetTsBufferSize(tsBufferSizeM);
|
||||
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefillM);
|
||||
IptvConfig.SetProtocolBasePort(protocolBasePortM);
|
||||
IptvConfig.SetSectionFiltering(sectionFilteringM);
|
||||
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
|
||||
|
||||
2
setup.h
2
setup.h
@@ -15,8 +15,6 @@
|
||||
class cIptvPluginSetup : public cMenuSetupPage
|
||||
{
|
||||
private:
|
||||
int tsBufferSizeM;
|
||||
int tsBufferPrefillM;
|
||||
int protocolBasePortM;
|
||||
int sectionFilteringM;
|
||||
int numDisabledFiltersM;
|
||||
|
||||
25
socket.c
25
socket.c
@@ -21,6 +21,9 @@
|
||||
cIptvSocket::cIptvSocket()
|
||||
: socketPortM(0),
|
||||
socketDescM(-1),
|
||||
lastErrorReportM(0),
|
||||
packetErrorsM(0),
|
||||
sequenceNumberM(-1),
|
||||
isActiveM(false)
|
||||
{
|
||||
debug("cIptvSocket::%s()", __FUNCTION__);
|
||||
@@ -87,6 +90,11 @@ void cIptvSocket::CloseSocket(void)
|
||||
socketPortM = 0;
|
||||
memset(&sockAddrM, 0, sizeof(sockAddrM));
|
||||
}
|
||||
if (packetErrorsM) {
|
||||
info("detected %d RTP packet errors", packetErrorsM);
|
||||
packetErrorsM = 0;
|
||||
lastErrorReportM = time(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
bool cIptvSocket::CheckAddress(const char *addrP, in_addr_t *inAddrP)
|
||||
@@ -274,6 +282,21 @@ int cIptvUdpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
|
||||
unsigned int cc = bufferAddrP[0] & 0x0F;
|
||||
// Payload type: MPEG2 TS = 33
|
||||
//unsigned int pt = bufferAddrP[1] & 0x7F;
|
||||
// Sequence number
|
||||
int seq = ((bufferAddrP[2] & 0xFF) << 8) | (bufferAddrP[3] & 0xFF);
|
||||
if ((((sequenceNumberM + 1) % 0xFFFF) == 0) && (seq == 0xFFFF))
|
||||
sequenceNumberM = -1;
|
||||
else if ((sequenceNumberM >= 0) && (((sequenceNumberM + 1) % 0xFFFF) != seq)) {
|
||||
packetErrorsM++;
|
||||
if (time(NULL) - lastErrorReportM > eReportIntervalS) {
|
||||
info("detected %d RTP packet errors", packetErrorsM);
|
||||
packetErrorsM = 0;
|
||||
lastErrorReportM = time(NULL);
|
||||
}
|
||||
sequenceNumberM = seq;
|
||||
}
|
||||
else
|
||||
sequenceNumberM = seq;
|
||||
// Header lenght
|
||||
unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t);
|
||||
// Check if extension
|
||||
@@ -401,7 +424,7 @@ bool cIptvTcpSocket::Write(const char *bufferAddrP, unsigned int bufferLenP)
|
||||
//debug("cIptvTcpSocket::%s()", __FUNCTION__);
|
||||
// Error out if socket not initialized
|
||||
if (socketDescM <= 0) {
|
||||
error("Invalid socket in cIptvTcpSocket::%s()", __FUNCTION__);
|
||||
error("cIptvTcpSocket::%s(): Invalid socket", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
ERROR_IF_RET(send(socketDescM, bufferAddrP, bufferLenP, 0) < 0, "send()", return false);
|
||||
|
||||
6
socket.h
6
socket.h
@@ -18,8 +18,14 @@ private:
|
||||
int socketPortM;
|
||||
|
||||
protected:
|
||||
enum {
|
||||
eReportIntervalS = 300 // in seconds
|
||||
};
|
||||
int socketDescM;
|
||||
struct sockaddr_in sockAddrM;
|
||||
time_t lastErrorReportM;
|
||||
int packetErrorsM;
|
||||
int sequenceNumberM;
|
||||
bool isActiveM;
|
||||
|
||||
protected:
|
||||
|
||||
20
source.c
20
source.c
@@ -136,8 +136,6 @@ const char *cIptvSourceParam::allowedProtocolCharsS = " abcdefghijklmnopqrstuvwx
|
||||
cIptvSourceParam::cIptvSourceParam(char sourceP, const char *descriptionP)
|
||||
: cSourceParam(sourceP, descriptionP),
|
||||
paramM(0),
|
||||
nidM(0),
|
||||
tidM(0),
|
||||
ridM(0),
|
||||
dataM(),
|
||||
itpM()
|
||||
@@ -155,8 +153,6 @@ void cIptvSourceParam::SetData(cChannel *channelP)
|
||||
{
|
||||
debug("cIptvSourceParam::%s(%s)", __FUNCTION__, channelP->Parameters());
|
||||
dataM = *channelP;
|
||||
nidM = dataM.Nid();
|
||||
tidM = dataM.Tid();
|
||||
ridM = dataM.Rid();
|
||||
itpM.Parse(dataM.Parameters());
|
||||
paramM = 0;
|
||||
@@ -166,21 +162,19 @@ void cIptvSourceParam::GetData(cChannel *channelP)
|
||||
{
|
||||
debug("cIptvSourceParam::%s(%s)", __FUNCTION__, channelP->Parameters());
|
||||
channelP->SetTransponderData(channelP->Source(), channelP->Frequency(), dataM.Srate(), itpM.ToString(Source()), true);
|
||||
channelP->SetId(nidM, tidM, channelP->Sid(), ridM);
|
||||
channelP->SetId(channelP->Nid(), channelP->Tid(), channelP->Sid(), ridM);
|
||||
}
|
||||
|
||||
cOsdItem *cIptvSourceParam::GetOsdItem(void)
|
||||
{
|
||||
debug("cIptvSourceParam::%s()", __FUNCTION__);
|
||||
switch (paramM++) {
|
||||
case 0: return new cMenuEditIntItem( tr("Nid"), &nidM, 0);
|
||||
case 1: return new cMenuEditIntItem( tr("Tid"), &tidM, 0);
|
||||
case 2: return new cMenuEditIntItem( tr("Rid"), &ridM, 0);
|
||||
case 3: return new cMenuEditBoolItem(tr("Scan section ids"), &itpM.sidScanM);
|
||||
case 4: return new cMenuEditBoolItem(tr("Scan pids"), &itpM.pidScanM);
|
||||
case 5: return new cMenuEditStraItem(tr("Protocol"), &itpM.protocolM, ELEMENTS(protocolsM), protocolsM);
|
||||
case 6: return new cMenuEditStrItem( tr("Address"), itpM.addressM, sizeof(itpM.addressM), allowedProtocolCharsS);
|
||||
case 7: return new cMenuEditIntItem( tr("Parameter"), &itpM.parameterM, 0, 0xFFFF);
|
||||
case 0: return new cMenuEditIntItem( tr("Rid"), &ridM, 0);
|
||||
case 1: return new cMenuEditBoolItem(tr("Scan section ids"), &itpM.sidScanM);
|
||||
case 2: return new cMenuEditBoolItem(tr("Scan pids"), &itpM.pidScanM);
|
||||
case 3: return new cMenuEditStraItem(tr("Protocol"), &itpM.protocolM, ELEMENTS(protocolsM), protocolsM);
|
||||
case 4: return new cMenuEditStrItem( tr("Address"), itpM.addressM, sizeof(itpM.addressM), allowedProtocolCharsS);
|
||||
case 5: return new cMenuEditIntItem( tr("Parameter"), &itpM.parameterM, 0, 0xFFFF);
|
||||
default: return NULL;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
2
source.h
2
source.h
@@ -51,8 +51,6 @@ class cIptvSourceParam : public cSourceParam
|
||||
{
|
||||
private:
|
||||
int paramM;
|
||||
int nidM;
|
||||
int tidM;
|
||||
int ridM;
|
||||
cChannel dataM;
|
||||
cIptvTransponderParameters itpM;
|
||||
|
||||
@@ -192,7 +192,7 @@ cString cIptvBufferStatistics::GetBufferStatistic()
|
||||
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
|
||||
timerM.Set();
|
||||
long bitrate = elapsed ? (long)(1000.0L * dataBytesM / KILOBYTE(1) / elapsed) : 0L;
|
||||
long totalSpace = MEGABYTE(IptvConfig.GetTsBufferSize());
|
||||
long totalSpace = IPTV_BUFFER_SIZE;
|
||||
float percentage = (float)((float)usedSpaceM / (float)totalSpace * 100.0);
|
||||
long totalKilos = totalSpace / KILOBYTE(1);
|
||||
long usedKilos = usedSpaceM / KILOBYTE(1);
|
||||
|
||||
Reference in New Issue
Block a user