1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 11:37:03 +00:00

Compare commits

..

28 Commits

Author SHA1 Message Date
Rolf Ahrenberg
5ae793f030 Updated for vdr-2.4.0. 2018-04-15 22:27:15 +03:00
Rolf Ahrenberg
0fe1cb7ab5 Updated for vdr-2.3.7. 2017-06-24 23:20:33 +03:00
Rolf Ahrenberg
08cecd5eba Merge pull request #4 from tmn505/polish_language
Add polish language
2017-02-28 21:53:04 +02:00
Tomasz Maciej Nowak
22beb1662f Add polish language 2017-02-28 16:34:56 +01:00
Frank Neumann
ce8680cbc9 Add Catalan and Espanol translations. 2017-02-11 19:35:17 +02:00
Rolf Ahrenberg
0d2f32dc6a Use 2MB ringbuffer per device. 2016-05-12 23:51:03 +03:00
Rolf Ahrenberg
201b50eb9d C++11 requires a mandatory space when concatenating string literals. 2016-02-07 13:41:37 +02:00
Rolf Ahrenberg
777be25375 Update README. 2016-01-31 20:22:16 +02:00
Rolf Ahrenberg
ccc9bab5e0 Updated for vdr-2.3.1. 2015-09-19 17:20:56 +03:00
Rolf Ahrenberg
03a1e33e2f Prepared for a release. 2015-04-04 14:13:22 +03:00
Rolf Ahrenberg
130e2d09d0 Got rid of IPTV_DEBUG. 2015-03-08 15:47:12 +02:00
Rolf Ahrenberg
bc6da9dd63 Added support for tracing modes. 2015-03-08 15:40:27 +02:00
Rolf Ahrenberg
63359e4c24 Fixed CURL timeout and added a stale connection detection (Thanks to Daniel Ribeiro). 2015-02-24 20:30:43 +02:00
Rolf Ahrenberg
e9c8b8d4e0 Updated the APIVERSNUM requirement. 2015-02-20 20:43:19 +02:00
Rolf Ahrenberg
f5fcb6df2a Updated version number. 2015-02-15 22:13:45 +02:00
Rolf Ahrenberg
67050306c5 Reworded setup menu items. 2015-02-15 20:15:38 +02:00
Rolf Ahrenberg
a1aba865ed Updated translation file headers. 2015-02-12 23:43:10 +02:00
Rolf Ahrenberg
b8cb4188d2 Merge pull request #2 from varaslt/master
Added lithuanian translation file
2015-02-12 23:38:32 +02:00
Valdemaras Pipiras
1a93fec590 Added lithuanian translation file 2015-02-12 23:16:30 +02:00
Rolf Ahrenberg
4f980e5cd9 Updated German translations (Thanks to Frank Neumann). 2015-02-12 22:17:04 +02:00
Antti Seppälä
68d7183fa9 Fix IPTV Makefile dependency
Every *.c file should depend on Makefile changes as it contians parameters for entire plugin build.
2015-01-02 14:29:44 +02:00
Rolf Ahrenberg
54a990ffe8 Updated HISTORY. 2014-05-10 15:53:36 +03:00
Rolf Ahrenberg
53c2026a60 Added RTP packet error detection. 2014-04-05 19:11:30 +03:00
Rolf Ahrenberg
dc9f9f2b86 Removed unnecessary TS buffer settings. 2014-04-05 19:01:36 +03:00
Rolf Ahrenberg
688c7db1fc Refactored the section filtering. 2014-04-05 18:43:23 +03:00
Rolf Ahrenberg
591fb8431b Updated the section filtering options. 2014-04-05 18:29:45 +03:00
Rolf Ahrenberg
dab869cf3a Updated for vdr-2.1.6. 2014-03-16 16:46:21 +02:00
Rolf Ahrenberg
aaca7cba1a Fixed installation target bugs (Thanks to Alexander Grothe). 2014-03-09 16:04:54 +02:00
41 changed files with 1220 additions and 709 deletions

57
HISTORY
View File

@@ -226,6 +226,10 @@ VDR Plugin 'iptv' Revision History
- Made devices to shutdown already in cPluginManager::Stop() - Made devices to shutdown already in cPluginManager::Stop()
to prevent possible crashes while VDR shutdown. 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 VDR Plugin 'iptv' Revision History
@@ -235,3 +239,56 @@ VDR Plugin 'iptv' Revision History
- Added initial CAM support. - Added initial CAM support.
- Added missing RTSP/UDP 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.
==================================
VDR Plugin 'iptv' Revision History
==================================
2015-02-19: Version 2.2.0
- Updated for vdr-2.2.0.
- Updated German translations (Thanks to Frank Neumann).
- Updated Lithuanian translations (Thanks to Valdemaras
Pipiras).
2015-04-04: Version 2.2.1
- Fixed CURL timeout and added a stale connection
detection (Thanks to Daniel Ribeiro).
- Got rid of IPTV_DEBUG.
- Added support for tracing modes.
==================================
VDR Plugin 'iptv' Revision History
==================================
2017-06-24: Version 2.3.0
- Updated for vdr-2.3.7.
- Added Polish translation (Thanks to Tomasz Nowak).
- Added Catalan and Spanish translations (Thanks to Gabriel Bonich).
==================================
VDR Plugin 'iptv' Revision History
==================================
2018-04-15: Version 2.4.0
- Updated for vdr-2.4.0.

View File

@@ -2,18 +2,10 @@
# Makefile for IPTV plugin # Makefile for IPTV plugin
# #
# Debugging on/off
#IPTV_DEBUG = 1
# Default shell for EXT protocol # Default shell for EXT protocol
#IPTV_EXTSHELL = /bin/bash #IPTV_EXTSHELL = /bin/bash
# Strip debug symbols? Set eg. to /bin/true if not
STRIP = strip
# The official name of this plugin. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
# By default the main source file also carries this name. # By default the main source file also carries this name.
@@ -32,6 +24,7 @@ PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(s
LIBDIR = $(call PKGCFG,libdir) LIBDIR = $(call PKGCFG,libdir)
LOCDIR = $(call PKGCFG,locdir) LOCDIR = $(call PKGCFG,locdir)
PLGCFG = $(call PKGCFG,plgcfg) PLGCFG = $(call PKGCFG,plgcfg)
RESDIR = $(call PKGCFG,resdir)
CFGDIR = $(call PKGCFG,configdir) CFGDIR = $(call PKGCFG,configdir)
# #
TMPDIR ?= /tmp TMPDIR ?= /tmp
@@ -40,6 +33,7 @@ TMPDIR ?= /tmp
export CFLAGS = $(call PKGCFG,cflags) export CFLAGS = $(call PKGCFG,cflags)
export CXXFLAGS = $(call PKGCFG,cxxflags) export CXXFLAGS = $(call PKGCFG,cxxflags)
STRIP ?= /bin/true
### The version number of VDR's plugin API: ### The version number of VDR's plugin API:
@@ -68,10 +62,6 @@ INCLUDES +=
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
ifdef IPTV_DEBUG
DEFINES += -DDEBUG
endif
ifdef IPTV_EXTSHELL ifdef IPTV_EXTSHELL
DEFINES += -DEXTSHELL='"$(IPTV_EXTSHELL)"' DEFINES += -DEXTSHELL='"$(IPTV_EXTSHELL)"'
endif endif
@@ -96,15 +86,16 @@ all: $(SOFILE) i18n
### Implicit rules: ### Implicit rules:
%.o: %.c %.o: %.c Makefile
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< @echo CC $@
$(Q)$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
### Dependencies: ### Dependencies:
MAKEDEP = $(CXX) -MM -MG MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies DEPFILE = .dependencies
$(DEPFILE): Makefile $(DEPFILE): Makefile
@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ $(Q)$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
-include $(DEPFILE) -include $(DEPFILE)
@@ -117,17 +108,21 @@ I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLU
I18Npot = $(PODIR)/$(PLUGIN).pot I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po %.mo: %.po
msgfmt -c -o $@ $< @echo MO $@
$(Q)msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.c) $(I18Npot): $(wildcard *.c)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` @echo GT $@
$(Q)xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
%.po: $(I18Npot) %.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @echo PO $@
$(Q)msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
@touch $@ @touch $@
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo $(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
install -D -m644 $< $@ @echo IN $@
$(Q)install -D -m644 $< $@
.PHONY: i18n .PHONY: i18n
i18n: $(I18Nmo) $(I18Npot) i18n: $(I18Nmo) $(I18Npot)
@@ -137,17 +132,18 @@ install-i18n: $(I18Nmsgs)
### Targets: ### Targets:
$(SOFILE): $(OBJS) $(SOFILE): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@ @echo LD $@
ifndef IPTV_DEBUG $(Q)$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
@$(STRIP) $@ $(Q)$(STRIP) $@
endif
install-lib: $(SOFILE) install-lib: $(SOFILE)
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) @echo IN $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
$(Q)install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
install-conf: install-conf:
@mkdir -p $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN) @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 install: install-lib install-i18n install-conf
@@ -165,4 +161,4 @@ clean:
.PHONY: cppcheck .PHONY: cppcheck
cppcheck: cppcheck:
@cppcheck --language=c++ --enable=all -v -f $(OBJS:%.o=%.c) $(Q)cppcheck --language=c++ --enable=all -v -f $(OBJS:%.o=%.c)

7
README
View File

@@ -46,13 +46,6 @@ make -C iptv-X.Y.Z install
Setup menu: Setup menu:
- TS buffer size [MB] = 2 Defines ringbuffer size for transport
stream in MB.
Valid range: 1...4
- TS buffer prefill ratio [%] = 0 Defines prefill ratio for transport
stream ringbuffer before data is
transferred to VDR.
Valid range: 0...40
- Protocol base port = 4321 Defines base port used in CURL/EXT - Protocol base port = 4321 Defines base port used in CURL/EXT
protocol. Two ports are defined for protocol. Two ports are defined for
each device. each device.

View File

@@ -79,8 +79,6 @@ const section_filter_table_type section_filter_table[SECTION_FILTER_TABLE_SIZE]
{trNOOP("PAT (0x00)"), "PAT", 0x00, 0x00, 0xFF}, {trNOOP("PAT (0x00)"), "PAT", 0x00, 0x00, 0xFF},
{trNOOP("NIT (0x40)"), "NIT", 0x10, 0x40, 0xFF}, {trNOOP("NIT (0x40)"), "NIT", 0x10, 0x40, 0xFF},
{trNOOP("SDT (0x42)"), "SDT", 0x11, 0x42, 0xFF}, {trNOOP("SDT (0x42)"), "SDT", 0x11, 0x42, 0xFF},
{trNOOP("EIT (0x4E/0x4F)"), "EIT", 0x12, 0x4E, 0xFE}, {trNOOP("EIT (0x4E/0x4F/0x5X/0x6X)"), "EIT", 0x12, 0x40, 0xC0},
{trNOOP("EIT (0x5X)"), "EIT", 0x12, 0x50, 0xF0},
{trNOOP("EIT (0x6X)"), "EIT", 0x12, 0x60, 0xF0},
{trNOOP("TDT (0x70)"), "TDT", 0x14, 0x70, 0xFF}, {trNOOP("TDT (0x70)"), "TDT", 0x14, 0x70, 0xFF},
}; };

View File

@@ -12,18 +12,10 @@
#include <vdr/config.h> #include <vdr/config.h>
#include <vdr/i18n.h> #include <vdr/i18n.h>
#ifdef DEBUG
#define debug(x...) dsyslog("IPTV: " x);
#define info(x...) isyslog("IPTV: " x);
#define error(x...) esyslog("ERROR: " x);
#else
#define debug(x...) ;
#define info(x...) isyslog("IPTV: " x);
#define error(x...) esyslog("ERROR: " x);
#endif
#define ELEMENTS(x) (sizeof(x) / sizeof(x[0])) #define ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
#define IPTV_BUFFER_SIZE KILOBYTE(2048)
#define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr" #define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr"
#define IPTV_SOURCE_CHARACTER 'I' #define IPTV_SOURCE_CHARACTER 'I'
@@ -38,20 +30,19 @@
#define IPTV_STATS_ACTIVE_PIDS_COUNT 10 #define IPTV_STATS_ACTIVE_PIDS_COUNT 10
#define IPTV_STATS_ACTIVE_FILTERS_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) \ #define ERROR_IF_FUNC(exp, errstr, func, ret) \
do { \ do { \
if (exp) { \ if (exp) { \
char tmp[64]; \ char tmp[64]; \
error("[%s,%d]: "errstr": %s", __FILE__, __LINE__, \ esyslog("[%s,%d]: " errstr ": %s", __FILE__, __LINE__, \
strerror_r(errno, tmp, sizeof(tmp))); \ strerror_r(errno, tmp, sizeof(tmp))); \
func; \ func; \
ret; \ ret; \
} \ } \
} while (0) } while (0)
#define ERROR_IF_RET(exp, errstr, ret) ERROR_IF_FUNC(exp, errstr, ,ret); #define ERROR_IF_RET(exp, errstr, ret) ERROR_IF_FUNC(exp, errstr, ,ret);
#define ERROR_IF(exp, errstr) ERROR_IF_FUNC(exp, errstr, , ); #define ERROR_IF(exp, errstr) ERROR_IF_FUNC(exp, errstr, , );

View File

@@ -5,13 +5,13 @@
* *
*/ */
#include "log.h"
#include "config.h" #include "config.h"
cIptvConfig IptvConfig; cIptvConfig IptvConfig;
cIptvConfig::cIptvConfig(void) cIptvConfig::cIptvConfig(void)
: tsBufferSizeM(2), : traceModeM(eTraceModeNormal),
tsBufferPrefillRatioM(0),
protocolBasePortM(4321), protocolBasePortM(4321),
useBytesM(1), useBytesM(1),
sectionFilteringM(1) sectionFilteringM(1)
@@ -19,6 +19,7 @@ cIptvConfig::cIptvConfig(void)
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i) for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i)
disabledFiltersM[i] = -1; disabledFiltersM[i] = -1;
memset(configDirectoryM, 0, sizeof(configDirectoryM)); memset(configDirectoryM, 0, sizeof(configDirectoryM));
memset(resourceDirectoryM, 0, sizeof(resourceDirectoryM));
} }
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
@@ -42,6 +43,12 @@ void cIptvConfig::SetDisabledFilters(unsigned int indexP, int numberP)
void cIptvConfig::SetConfigDirectory(const char *directoryP) void cIptvConfig::SetConfigDirectory(const char *directoryP)
{ {
debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP); debug1("%s (%s)", __PRETTY_FUNCTION__, directoryP);
ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory"); ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory");
} }
void cIptvConfig::SetResourceDirectory(const char *directoryP)
{
debug1("%s (%s)", __PRETTY_FUNCTION__, directoryP);
ERROR_IF(!realpath(directoryP, resourceDirectoryM), "Cannot canonicalize resource directory");
}

View File

@@ -14,31 +14,52 @@
class cIptvConfig class cIptvConfig
{ {
private: private:
unsigned int tsBufferSizeM; unsigned int traceModeM;
unsigned int tsBufferPrefillRatioM;
unsigned int protocolBasePortM; unsigned int protocolBasePortM;
unsigned int useBytesM; unsigned int useBytesM;
unsigned int sectionFilteringM; unsigned int sectionFilteringM;
int disabledFiltersM[SECTION_FILTER_TABLE_SIZE]; int disabledFiltersM[SECTION_FILTER_TABLE_SIZE];
char configDirectoryM[PATH_MAX]; char configDirectoryM[PATH_MAX];
char resourceDirectoryM[PATH_MAX];
public: public:
enum eTraceMode {
eTraceModeNormal = 0x0000,
eTraceModeDebug1 = 0x0001,
eTraceModeDebug2 = 0x0002,
eTraceModeDebug3 = 0x0004,
eTraceModeDebug4 = 0x0008,
eTraceModeDebug5 = 0x0010,
eTraceModeDebug6 = 0x0020,
eTraceModeDebug7 = 0x0040,
eTraceModeDebug8 = 0x0080,
eTraceModeDebug9 = 0x0100,
eTraceModeDebug10 = 0x0200,
eTraceModeDebug11 = 0x0400,
eTraceModeDebug12 = 0x0800,
eTraceModeDebug13 = 0x1000,
eTraceModeDebug14 = 0x2000,
eTraceModeDebug15 = 0x4000,
eTraceModeDebug16 = 0x8000,
eTraceModeMask = 0xFFFF
};
cIptvConfig(); cIptvConfig();
unsigned int GetTsBufferSize(void) const { return tsBufferSizeM; } unsigned int GetTraceMode(void) const { return traceModeM; }
unsigned int GetTsBufferPrefillRatio(void) const { return tsBufferPrefillRatioM; } bool IsTraceMode(eTraceMode modeP) const { return (traceModeM & modeP); }
unsigned int GetProtocolBasePort(void) const { return protocolBasePortM; } unsigned int GetProtocolBasePort(void) const { return protocolBasePortM; }
unsigned int GetUseBytes(void) const { return useBytesM; } unsigned int GetUseBytes(void) const { return useBytesM; }
unsigned int GetSectionFiltering(void) const { return sectionFilteringM; } unsigned int GetSectionFiltering(void) const { return sectionFilteringM; }
const char *GetConfigDirectory(void) const { return configDirectoryM; } const char *GetConfigDirectory(void) const { return configDirectoryM; }
const char *GetResourceDirectory(void) const { return resourceDirectoryM; }
unsigned int GetDisabledFiltersCount(void) const; unsigned int GetDisabledFiltersCount(void) const;
int GetDisabledFilters(unsigned int indexP) const; int GetDisabledFilters(unsigned int indexP) const;
void SetTsBufferSize(unsigned int sizeP) { tsBufferSizeM = sizeP; } void SetTraceMode(unsigned int modeP) { traceModeM = (modeP & eTraceModeMask); }
void SetTsBufferPrefillRatio(unsigned int ratioP) { tsBufferPrefillRatioM = ratioP; }
void SetProtocolBasePort(unsigned int portNumberP) { protocolBasePortM = portNumberP; } void SetProtocolBasePort(unsigned int portNumberP) { protocolBasePortM = portNumberP; }
void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; } void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; }
void SetSectionFiltering(unsigned int onOffP) { sectionFilteringM = onOffP; } void SetSectionFiltering(unsigned int onOffP) { sectionFilteringM = onOffP; }
void SetDisabledFilters(unsigned int indexP, int numberP); void SetDisabledFilters(unsigned int indexP, int numberP);
void SetConfigDirectory(const char *directoryP); void SetConfigDirectory(const char *directoryP);
void SetResourceDirectory(const char *directoryP);
}; };
extern cIptvConfig IptvConfig; extern cIptvConfig IptvConfig;

View File

@@ -22,9 +22,9 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
pidScanEnabledM(false), pidScanEnabledM(false),
channelM() channelM()
{ {
unsigned int bufsize = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize()); unsigned int bufsize = (unsigned int)IPTV_BUFFER_SIZE;
bufsize -= (bufsize % TS_SIZE); bufsize -= (bufsize % TS_SIZE);
isyslog("creating IPTV device %d (CardIndex=%d)", deviceIndexM, CardIndex()); info("Creating IPTV device %d (CardIndex=%d)", deviceIndexM, CardIndex());
tsBufferM = new cRingBufferLinear(bufsize + 1, TS_SIZE, false, tsBufferM = new cRingBufferLinear(bufsize + 1, TS_SIZE, false,
*cString::sprintf("IPTV TS %d", deviceIndexM)); *cString::sprintf("IPTV TS %d", deviceIndexM));
if (tsBufferM) { if (tsBufferM) {
@@ -32,7 +32,6 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
tsBufferM->SetIoThrottle(); tsBufferM->SetIoThrottle();
pIptvStreamerM = new cIptvStreamer(*this, tsBufferM->Free()); pIptvStreamerM = new cIptvStreamer(*this, tsBufferM->Free());
} }
ResetBuffering();
pUdpProtocolM = new cIptvProtocolUdp(); pUdpProtocolM = new cIptvProtocolUdp();
pCurlProtocolM = new cIptvProtocolCurl(); pCurlProtocolM = new cIptvProtocolCurl();
pHttpProtocolM = new cIptvProtocolHttp(); pHttpProtocolM = new cIptvProtocolHttp();
@@ -51,13 +50,13 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
if (S_ISFIFO(sb.st_mode)) { if (S_ISFIFO(sb.st_mode)) {
dvrFdM = open(filename, O_RDWR | O_NONBLOCK); dvrFdM = open(filename, O_RDWR | O_NONBLOCK);
if (dvrFdM >= 0) if (dvrFdM >= 0)
dsyslog("IPTV device %d redirecting input stream to '%s'", deviceIndexM, *filename); info("IPTV device %d redirecting input stream to '%s'", deviceIndexM, *filename);
} }
} }
cIptvDevice::~cIptvDevice() cIptvDevice::~cIptvDevice()
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
// Stop section handler of iptv device // Stop section handler of iptv device
StopSectionHandler(); StopSectionHandler();
DELETE_POINTER(pIptvSectionM); DELETE_POINTER(pIptvSectionM);
@@ -80,7 +79,7 @@ cIptvDevice::~cIptvDevice()
bool cIptvDevice::Initialize(unsigned int deviceCountP) bool cIptvDevice::Initialize(unsigned int deviceCountP)
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceCountP); debug1("%s (%u)", __PRETTY_FUNCTION__, deviceCountP);
new cIptvSourceParam(IPTV_SOURCE_CHARACTER, "IPTV"); new cIptvSourceParam(IPTV_SOURCE_CHARACTER, "IPTV");
if (deviceCountP > IPTV_MAX_DEVICES) if (deviceCountP > IPTV_MAX_DEVICES)
deviceCountP = IPTV_MAX_DEVICES; deviceCountP = IPTV_MAX_DEVICES;
@@ -93,7 +92,7 @@ bool cIptvDevice::Initialize(unsigned int deviceCountP)
void cIptvDevice::Shutdown(void) void cIptvDevice::Shutdown(void)
{ {
debug("cIptvDevice::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
for (int i = 0; i < IPTV_MAX_DEVICES; ++i) { for (int i = 0; i < IPTV_MAX_DEVICES; ++i) {
if (IptvDevicesS[i]) if (IptvDevicesS[i])
IptvDevicesS[i]->CloseDvr(); IptvDevicesS[i]->CloseDvr();
@@ -103,7 +102,7 @@ void cIptvDevice::Shutdown(void)
unsigned int cIptvDevice::Count(void) unsigned int cIptvDevice::Count(void)
{ {
unsigned int count = 0; unsigned int count = 0;
debug("cIptvDevice::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
for (unsigned int i = 0; i < IPTV_MAX_DEVICES; ++i) { for (unsigned int i = 0; i < IPTV_MAX_DEVICES; ++i) {
if (IptvDevicesS[i] != NULL) if (IptvDevicesS[i] != NULL)
count++; count++;
@@ -113,10 +112,10 @@ unsigned int cIptvDevice::Count(void)
cIptvDevice *cIptvDevice::GetIptvDevice(int cardIndexP) cIptvDevice *cIptvDevice::GetIptvDevice(int cardIndexP)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, cardIndexP); debug16("%s (%d)", __PRETTY_FUNCTION__, cardIndexP);
for (unsigned int i = 0; i < IPTV_MAX_DEVICES; ++i) { for (unsigned int i = 0; i < IPTV_MAX_DEVICES; ++i) {
if (IptvDevicesS[i] && (IptvDevicesS[i]->CardIndex() == cardIndexP)) { if (IptvDevicesS[i] && (IptvDevicesS[i]->CardIndex() == cardIndexP)) {
//debug("cIptvDevice::%s(%d): found!", __FUNCTION__, cardIndexP); debug16("%s (%d) Found", __PRETTY_FUNCTION__, cardIndexP);
return IptvDevicesS[i]; return IptvDevicesS[i];
} }
} }
@@ -125,24 +124,25 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int cardIndexP)
cString cIptvDevice::GetGeneralInformation(void) cString cIptvDevice::GetGeneralInformation(void)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
LOCK_CHANNELS_READ;
return cString::sprintf("IPTV device: %d\nCardIndex: %d\nStream: %s\nStream bitrate: %s\n%sChannel: %s", return cString::sprintf("IPTV device: %d\nCardIndex: %d\nStream: %s\nStream bitrate: %s\n%sChannel: %s",
deviceIndexM, CardIndex(), deviceIndexM, CardIndex(),
pIptvStreamerM ? *pIptvStreamerM->GetInformation() : "", pIptvStreamerM ? *pIptvStreamerM->GetInformation() : "",
pIptvStreamerM ? *pIptvStreamerM->GetStreamerStatistic() : "", pIptvStreamerM ? *pIptvStreamerM->GetStreamerStatistic() : "",
*GetBufferStatistic(), *GetBufferStatistic(),
*Channels.GetByNumber(cDevice::CurrentChannel())->ToText()); *Channels->GetByNumber(cDevice::CurrentChannel())->ToText());
} }
cString cIptvDevice::GetPidsInformation(void) cString cIptvDevice::GetPidsInformation(void)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return GetPidStatistic(); return GetPidStatistic();
} }
cString cIptvDevice::GetFiltersInformation(void) cString cIptvDevice::GetFiltersInformation(void)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return cString::sprintf("Active section filters:\n%s", pIptvSectionM ? *pIptvSectionM->GetInformation() : ""); return cString::sprintf("Active section filters:\n%s", pIptvSectionM ? *pIptvSectionM->GetInformation() : "");
} }
@@ -178,37 +178,37 @@ cString cIptvDevice::GetInformation(unsigned int pageP)
cString cIptvDevice::DeviceType(void) const cString cIptvDevice::DeviceType(void) const
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return "IPTV"; return "IPTV";
} }
cString cIptvDevice::DeviceName(void) const cString cIptvDevice::DeviceName(void) const
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return cString::sprintf("IPTV %d", deviceIndexM); return cString::sprintf("IPTV %d", deviceIndexM);
} }
int cIptvDevice::SignalStrength(void) const int cIptvDevice::SignalStrength(void) const
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return (100); return (100);
} }
int cIptvDevice::SignalQuality(void) const int cIptvDevice::SignalQuality(void) const
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return (100); return (100);
} }
bool cIptvDevice::ProvidesSource(int sourceP) const bool cIptvDevice::ProvidesSource(int sourceP) const
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return (cSource::IsType(sourceP, IPTV_SOURCE_CHARACTER)); return (cSource::IsType(sourceP, IPTV_SOURCE_CHARACTER));
} }
bool cIptvDevice::ProvidesTransponder(const cChannel *channelP) const bool cIptvDevice::ProvidesTransponder(const cChannel *channelP) const
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
return (ProvidesSource(channelP->Source())); return (ProvidesSource(channelP->Source()));
} }
@@ -218,7 +218,7 @@ bool cIptvDevice::ProvidesChannel(const cChannel *channelP, int priorityP, bool
bool hasPriority = (priorityP == IDLEPRIORITY) || (priorityP > this->Priority()); bool hasPriority = (priorityP == IDLEPRIORITY) || (priorityP > this->Priority());
bool needsDetachReceivers = false; bool needsDetachReceivers = false;
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
if (channelP && ProvidesTransponder(channelP)) { if (channelP && ProvidesTransponder(channelP)) {
result = hasPriority; result = hasPriority;
@@ -264,7 +264,7 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
cIptvProtocolIf *protocol; cIptvProtocolIf *protocol;
cIptvTransponderParameters itp(channelP->Parameters()); cIptvTransponderParameters itp(channelP->Parameters());
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
if (isempty(itp.Address())) { if (isempty(itp.Address())) {
error("Unrecognized IPTV address: %s", channelP->Parameters()); error("Unrecognized IPTV address: %s", channelP->Parameters());
@@ -305,7 +305,7 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
bool cIptvDevice::SetPid(cPidHandle *handleP, int typeP, bool onP) 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); debug1("%s (%d, %d, %d) [device %d]", __PRETTY_FUNCTION__, handleP ? handleP->pid : -1, typeP, onP, deviceIndexM);
if (pIptvStreamerM && handleP) if (pIptvStreamerM && handleP)
return pIptvStreamerM->SetPid(handleP->pid, typeP, onP); return pIptvStreamerM->SetPid(handleP->pid, typeP, onP);
return true; return true;
@@ -313,7 +313,7 @@ bool cIptvDevice::SetPid(cPidHandle *handleP, int typeP, bool onP)
int cIptvDevice::OpenFilter(u_short pidP, u_char tidP, u_char maskP) int cIptvDevice::OpenFilter(u_short pidP, u_char tidP, u_char maskP)
{ {
//debug("cIptvDevice::%s(%d): pid=%d tid=%d mask=%d", __FUNCTION__, deviceIndexM, pidP, tidP, maskP); debug16("%s (%d, %d, %d) [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, deviceIndexM);
if (pIptvSectionM && IptvConfig.GetSectionFiltering()) { if (pIptvSectionM && IptvConfig.GetSectionFiltering()) {
if (pIptvStreamerM) if (pIptvStreamerM)
pIptvStreamerM->SetPid(pidP, ptOther, true); pIptvStreamerM->SetPid(pidP, ptOther, true);
@@ -324,7 +324,7 @@ int cIptvDevice::OpenFilter(u_short pidP, u_char tidP, u_char maskP)
void cIptvDevice::CloseFilter(int handleP) void cIptvDevice::CloseFilter(int handleP)
{ {
//debug("cIptvDevice::%s(%d): handle=%d", __FUNCTION__, deviceIndexM, handleP); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, handleP, deviceIndexM);
if (pIptvSectionM) { if (pIptvSectionM) {
if (pIptvStreamerM) if (pIptvStreamerM)
pIptvStreamerM->SetPid(pIptvSectionM->GetPid(handleP), ptOther, false); pIptvStreamerM->SetPid(pIptvSectionM->GetPid(handleP), ptOther, false);
@@ -334,10 +334,9 @@ void cIptvDevice::CloseFilter(int handleP)
bool cIptvDevice::OpenDvr(void) bool cIptvDevice::OpenDvr(void)
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
isPacketDeliveredM = false; isPacketDeliveredM = false;
tsBufferM->Clear(); tsBufferM->Clear();
ResetBuffering();
if (pIptvStreamerM) if (pIptvStreamerM)
pIptvStreamerM->Open(); pIptvStreamerM->Open();
if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering()) if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering())
@@ -350,7 +349,7 @@ bool cIptvDevice::OpenDvr(void)
void cIptvDevice::CloseDvr(void) void cIptvDevice::CloseDvr(void)
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
if (pidScanEnabledM && pPidScannerM) if (pidScanEnabledM && pPidScannerM)
pPidScannerM->Close(); pPidScannerM->Close();
if (sidScanEnabledM && pSidScannerM) if (sidScanEnabledM && pSidScannerM)
@@ -362,38 +361,19 @@ void cIptvDevice::CloseDvr(void)
bool cIptvDevice::HasLock(int timeoutMsP) const bool cIptvDevice::HasLock(int timeoutMsP) const
{ {
//debug("cIptvDevice::%s(%d): timeoutMs=%d", __FUNCTION__, deviceIndexM, timeoutMsP); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM);
return (!IsBuffering()); return (pIptvStreamerM && pIptvStreamerM->Active());
} }
bool cIptvDevice::HasInternalCam(void) bool cIptvDevice::HasInternalCam(void)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
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; return false;
} }
void cIptvDevice::WriteData(uchar *bufferP, int lengthP) void cIptvDevice::WriteData(uchar *bufferP, int lengthP)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIndexM);
int len; int len;
// Send data to dvr fifo // Send data to dvr fifo
if (dvrFdM >= 0) if (dvrFdM >= 0)
@@ -411,7 +391,7 @@ void cIptvDevice::WriteData(uchar *bufferP, int lengthP)
unsigned int cIptvDevice::CheckData(void) unsigned int cIptvDevice::CheckData(void)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
if (tsBufferM) if (tsBufferM)
return (unsigned int)tsBufferM->Free(); return (unsigned int)tsBufferM->Free();
return 0; return 0;
@@ -419,8 +399,8 @@ unsigned int cIptvDevice::CheckData(void)
uchar *cIptvDevice::GetData(int *availableP) uchar *cIptvDevice::GetData(int *availableP)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
if (isOpenDvrM && tsBufferM && !IsBuffering()) { if (isOpenDvrM && tsBufferM) {
int count = 0; int count = 0;
if (isPacketDeliveredM) if (isPacketDeliveredM)
SkipData(TS_SIZE); SkipData(TS_SIZE);
@@ -434,7 +414,7 @@ uchar *cIptvDevice::GetData(int *availableP)
} }
} }
tsBufferM->Del(count); 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; return NULL;
} }
isPacketDeliveredM = true; isPacketDeliveredM = true;
@@ -450,7 +430,7 @@ uchar *cIptvDevice::GetData(int *availableP)
void cIptvDevice::SkipData(int countP) void cIptvDevice::SkipData(int countP)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s (%d) [device %d]]", __PRETTY_FUNCTION__, countP, deviceIndexM);
tsBufferM->Del(countP); tsBufferM->Del(countP);
isPacketDeliveredM = false; isPacketDeliveredM = false;
// Update buffer statistics // Update buffer statistics
@@ -459,7 +439,7 @@ void cIptvDevice::SkipData(int countP)
bool cIptvDevice::GetTSPacket(uchar *&dataP) bool cIptvDevice::GetTSPacket(uchar *&dataP)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
if (tsBufferM) { if (tsBufferM) {
if (cCamSlot *cs = CamSlot()) { if (cCamSlot *cs = CamSlot()) {
if (cs->WantsTsData()) { if (cs->WantsTsData()) {

View File

@@ -40,7 +40,6 @@ private:
bool sidScanEnabledM; bool sidScanEnabledM;
bool pidScanEnabledM; bool pidScanEnabledM;
cRingBufferLinear *tsBufferM; cRingBufferLinear *tsBufferM;
mutable int tsBufferPrefillM;
cChannel channelM; cChannel channelM;
cIptvProtocolUdp *pUdpProtocolM; cIptvProtocolUdp *pUdpProtocolM;
cIptvProtocolCurl *pCurlProtocolM; cIptvProtocolCurl *pCurlProtocolM;
@@ -69,11 +68,6 @@ private:
cString GetPidsInformation(void); cString GetPidsInformation(void);
cString GetFiltersInformation(void); cString GetFiltersInformation(void);
// for channel parsing & buffering
private:
void ResetBuffering(void);
bool IsBuffering(void) const;
// for channel info // for channel info
public: public:
virtual cString DeviceType(void) const; virtual cString DeviceType(void) const;

68
iptv.c
View File

@@ -13,15 +13,15 @@
#include "device.h" #include "device.h"
#include "iptvservice.h" #include "iptvservice.h"
#if defined(APIVERSNUM) && APIVERSNUM < 20104 #if defined(APIVERSNUM) && APIVERSNUM < 20400
#error "VDR-2.1.4 API version or greater is required!" #error "VDR-2.4.0 API version or greater is required!"
#endif #endif
#ifndef GITVERSION #ifndef GITVERSION
#define GITVERSION "" #define GITVERSION ""
#endif #endif
const char VERSION[] = "2.1.0" GITVERSION; const char VERSION[] = "2.4.0" GITVERSION;
static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
class cPluginIptv : public cPlugin { class cPluginIptv : public cPlugin {
@@ -54,7 +54,7 @@ public:
cPluginIptv::cPluginIptv(void) cPluginIptv::cPluginIptv(void)
: deviceCountM(1) : deviceCountM(1)
{ {
//debug("cPluginIptv::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Initialize any member variables here. // Initialize any member variables here.
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
@@ -62,23 +62,25 @@ cPluginIptv::cPluginIptv(void)
cPluginIptv::~cPluginIptv() cPluginIptv::~cPluginIptv()
{ {
//debug("cPluginIptv::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Clean up after yourself! // Clean up after yourself!
} }
const char *cPluginIptv::CommandLineHelp(void) const char *cPluginIptv::CommandLineHelp(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Return a string that describes all known command line options. // Return a string that describes all known command line options.
return " -d <num>, --devices=<number> number of devices to be created\n"; return " -d <num>, --devices=<number> number of devices to be created\n"
" -t <mode>, --trace=<mode> set the tracing mode\n";
} }
bool cPluginIptv::ProcessArgs(int argc, char *argv[]) bool cPluginIptv::ProcessArgs(int argc, char *argv[])
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Implement command line argument processing here if applicable. // Implement command line argument processing here if applicable.
static const struct option long_options[] = { static const struct option long_options[] = {
{ "devices", required_argument, NULL, 'd' }, { "devices", required_argument, NULL, 'd' },
{ "trace", required_argument, NULL, 't' },
{ NULL, no_argument, NULL, 0 } { NULL, no_argument, NULL, 0 }
}; };
@@ -88,6 +90,9 @@ bool cPluginIptv::ProcessArgs(int argc, char *argv[])
case 'd': case 'd':
deviceCountM = atoi(optarg); deviceCountM = atoi(optarg);
break; break;
case 't':
IptvConfig.SetTraceMode(strtol(optarg, NULL, 0));
break;
default: default:
return false; return false;
} }
@@ -97,15 +102,16 @@ bool cPluginIptv::ProcessArgs(int argc, char *argv[])
bool cPluginIptv::Initialize(void) bool cPluginIptv::Initialize(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Initialize any background activities the plugin shall perform. // 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); return cIptvDevice::Initialize(deviceCountM);
} }
bool cPluginIptv::Start(void) bool cPluginIptv::Start(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Start any background activities the plugin shall perform. // Start any background activities the plugin shall perform.
if (curl_global_init(CURL_GLOBAL_ALL) == CURLE_OK) { if (curl_global_init(CURL_GLOBAL_ALL) == CURLE_OK) {
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
@@ -123,7 +129,7 @@ bool cPluginIptv::Start(void)
void cPluginIptv::Stop(void) void cPluginIptv::Stop(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Stop any background activities the plugin is performing. // Stop any background activities the plugin is performing.
cIptvDevice::Shutdown(); cIptvDevice::Shutdown();
curl_global_cleanup(); curl_global_cleanup();
@@ -131,54 +137,54 @@ void cPluginIptv::Stop(void)
void cPluginIptv::Housekeeping(void) void cPluginIptv::Housekeeping(void)
{ {
//debug("cPluginIptv::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Perform any cleanup or other regular tasks. // Perform any cleanup or other regular tasks.
} }
void cPluginIptv::MainThreadHook(void) void cPluginIptv::MainThreadHook(void)
{ {
//debug("cPluginIptv::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Perform actions in the context of the main program thread. // Perform actions in the context of the main program thread.
// WARNING: Use with great care - see PLUGINS.html! // WARNING: Use with great care - see PLUGINS.html!
} }
cString cPluginIptv::Active(void) cString cPluginIptv::Active(void)
{ {
//debug("cPluginIptv::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Return a message string if shutdown should be postponed // Return a message string if shutdown should be postponed
return NULL; return NULL;
} }
time_t cPluginIptv::WakeupTime(void) time_t cPluginIptv::WakeupTime(void)
{ {
//debug("cPluginIptv::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Return custom wakeup time for shutdown script // Return custom wakeup time for shutdown script
return 0; return 0;
} }
cOsdObject *cPluginIptv::MainMenuAction(void) cOsdObject *cPluginIptv::MainMenuAction(void)
{ {
//debug("cPluginIptv::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Perform the action when selected from the main VDR menu. // Perform the action when selected from the main VDR menu.
return NULL; return NULL;
} }
cMenuSetupPage *cPluginIptv::SetupMenu(void) cMenuSetupPage *cPluginIptv::SetupMenu(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Return a setup menu in case the plugin supports one. // Return a setup menu in case the plugin supports one.
return new cIptvPluginSetup(); return new cIptvPluginSetup();
} }
int cPluginIptv::ParseFilters(const char *valueP, int *filtersP) int cPluginIptv::ParseFilters(const char *valueP, int *filtersP)
{ {
debug("cPluginIptv::%s(%s)", __FUNCTION__, valueP); debug1("%s (%s, )", __PRETTY_FUNCTION__, valueP);
char buffer[256]; char buffer[256];
int n = 0; int n = 0;
while (valueP && *valueP && (n < SECTION_FILTER_TABLE_SIZE)) { while (valueP && *valueP && (n < SECTION_FILTER_TABLE_SIZE)) {
strn0cpy(buffer, valueP, sizeof(buffer)); strn0cpy(buffer, valueP, sizeof(buffer));
int i = atoi(buffer); int i = atoi(buffer);
//debug("cPluginIptv::%s(): filters[%d]=%d", __FUNCTION__, n, i); debug16("%s (%s, ) filters[%d]=%d", __PRETTY_FUNCTION__, valueP, n, i);
if (i >= 0) if (i >= 0)
filtersP[n++] = i; filtersP[n++] = i;
if ((valueP = strchr(valueP, ' ')) != NULL) if ((valueP = strchr(valueP, ' ')) != NULL)
@@ -189,13 +195,9 @@ int cPluginIptv::ParseFilters(const char *valueP, int *filtersP)
bool cPluginIptv::SetupParse(const char *nameP, const char *valueP) bool cPluginIptv::SetupParse(const char *nameP, const char *valueP)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s (%s, %s)", __PRETTY_FUNCTION__, nameP, valueP);
// Parse your own setup parameters and store their values. // Parse your own setup parameters and store their values.
if (!strcasecmp(nameP, "TsBufferSize")) if (!strcasecmp(nameP, "ExtProtocolBasePort"))
IptvConfig.SetTsBufferSize(atoi(valueP));
else if (!strcasecmp(nameP, "TsBufferPrefill"))
IptvConfig.SetTsBufferPrefillRatio(atoi(valueP));
else if (!strcasecmp(nameP, "ExtProtocolBasePort"))
IptvConfig.SetProtocolBasePort(atoi(valueP)); IptvConfig.SetProtocolBasePort(atoi(valueP));
else if (!strcasecmp(nameP, "SectionFiltering")) else if (!strcasecmp(nameP, "SectionFiltering"))
IptvConfig.SetSectionFiltering(atoi(valueP)); IptvConfig.SetSectionFiltering(atoi(valueP));
@@ -214,7 +216,7 @@ bool cPluginIptv::SetupParse(const char *nameP, const char *valueP)
bool cPluginIptv::Service(const char *idP, void *dataP) bool cPluginIptv::Service(const char *idP, void *dataP)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s (%s, )", __PRETTY_FUNCTION__, idP);
if (strcmp(idP, "IptvService-v1.0") == 0) { if (strcmp(idP, "IptvService-v1.0") == 0) {
if (dataP) { if (dataP) {
IptvService_v1_0 *data = reinterpret_cast<IptvService_v1_0*>(dataP); IptvService_v1_0 *data = reinterpret_cast<IptvService_v1_0*>(dataP);
@@ -231,7 +233,7 @@ bool cPluginIptv::Service(const char *idP, void *dataP)
const char **cPluginIptv::SVDRPHelpPages(void) const char **cPluginIptv::SVDRPHelpPages(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
static const char *HelpPages[] = { static const char *HelpPages[] = {
"INFO [ <page> ]\n" "INFO [ <page> ]\n"
" Print IPTV device information and statistics.\n" " Print IPTV device information and statistics.\n"
@@ -239,6 +241,8 @@ const char **cPluginIptv::SVDRPHelpPages(void)
" option: 1=general 2=pids 3=section filters.\n", " option: 1=general 2=pids 3=section filters.\n",
"MODE\n" "MODE\n"
" Toggles between bit or byte information mode.\n", " Toggles between bit or byte information mode.\n",
"TRAC [ <mode> ]\n"
" Gets and/or sets used tracing mode.\n",
NULL NULL
}; };
return HelpPages; return HelpPages;
@@ -246,7 +250,7 @@ const char **cPluginIptv::SVDRPHelpPages(void)
cString cPluginIptv::SVDRPCommand(const char *commandP, const char *optionP, int &replyCodeP) cString cPluginIptv::SVDRPCommand(const char *commandP, const char *optionP, int &replyCodeP)
{ {
debug("cPluginIptv::%s(%s, %s)", __FUNCTION__, commandP, optionP); debug1("%s (%s, %s, )", __PRETTY_FUNCTION__, commandP, optionP);
if (strcasecmp(commandP, "INFO") == 0) { if (strcasecmp(commandP, "INFO") == 0) {
cIptvDevice *device = cIptvDevice::GetIptvDevice(cDevice::ActualDevice()->CardIndex()); cIptvDevice *device = cIptvDevice::GetIptvDevice(cDevice::ActualDevice()->CardIndex());
if (device) { if (device) {
@@ -268,6 +272,12 @@ cString cPluginIptv::SVDRPCommand(const char *commandP, const char *optionP, int
IptvConfig.SetUseBytes(mode); IptvConfig.SetUseBytes(mode);
return cString::sprintf("IPTV information mode is: %s\n", mode ? "bytes" : "bits"); return cString::sprintf("IPTV information mode is: %s\n", mode ? "bytes" : "bits");
} }
else if (strcasecmp(commandP, "TRAC") == 0) {
if (optionP && *optionP)
IptvConfig.SetTraceMode(strtol(optionP, NULL, 0));
return cString::sprintf("IPTV tracing mode: 0x%04X\n", IptvConfig.GetTraceMode());
}
return NULL; return NULL;
} }

48
log.h Normal file
View File

@@ -0,0 +1,48 @@
/*
* log.h: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __IPTV_LOG_H
#define __IPTV_LOG_H
#include "config.h"
#define error(x...) esyslog("IPTV-ERROR: " x)
#define info(x...) isyslog("IPTV: " x)
// 0x0001: Generic call stack
#define debug1(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug1) ? dsyslog("IPTV1: " x) : void() )
// 0x0002: TBD
#define debug2(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug2) ? dsyslog("IPTV2: " x) : void() )
// 0x0004: TBD
#define debug3(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug3) ? dsyslog("IPTV3: " x) : void() )
// 0x0008: TBD
#define debug4(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug4) ? dsyslog("IPTV4: " x) : void() )
// 0x0010: TBD
#define debug5(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug5) ? dsyslog("IPTV5: " x) : void() )
// 0x0020: TBD
#define debug6(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug6) ? dsyslog("IPTV6: " x) : void() )
// 0x0040: TBD
#define debug7(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug7) ? dsyslog("IPTV7: " x) : void() )
// 0x0080: CURL
#define debug8(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug8) ? dsyslog("IPTV8: " x) : void() )
// 0x0100: TBD
#define debug9(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug9) ? dsyslog("IPTV9: " x) : void() )
// 0x0200: TBD
#define debug10(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug10) ? dsyslog("IPTV10: " x) : void() )
// 0x0400: TBD
#define debug11(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug11) ? dsyslog("IPTV11: " x) : void() )
// 0x0800: TBD
#define debug12(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug12) ? dsyslog("IPTV12: " x) : void() )
// 0x1000: TBD
#define debug13(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug13) ? dsyslog("IPTV13: " x) : void() )
// 0x2000: TBD
#define debug14(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug14) ? dsyslog("IPTV14: " x) : void() )
// 0x4000: TBD
#define debug15(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug15) ? dsyslog("IPTV15: " x) : void() )
// 0x8000; Extra call stack
#define debug16(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug16) ? dsyslog("IPTV16: " x) : void() )
#endif // __IPTV_LOG_H

View File

@@ -22,17 +22,17 @@ cPidScanner::cPidScanner(void)
numVpidsM(0), numVpidsM(0),
numApidsM(0) numApidsM(0)
{ {
debug("cPidScanner::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cPidScanner::~cPidScanner() cPidScanner::~cPidScanner()
{ {
debug("cPidScanner::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
void cPidScanner::SetChannel(const tChannelID &channelIdP) void cPidScanner::SetChannel(const tChannelID &channelIdP)
{ {
debug("cPidScanner::%s(%s)", __FUNCTION__, *channelIdP.ToString()); debug1("%s (%s)", __PRETTY_FUNCTION__, *channelIdP.ToString());
channelIdM = channelIdP; channelIdM = channelIdP;
vPidM = 0xFFFF; vPidM = 0xFFFF;
numVpidsM = 0; numVpidsM = 0;
@@ -43,13 +43,13 @@ void cPidScanner::SetChannel(const tChannelID &channelIdP)
void cPidScanner::Process(const uint8_t* bufP) void cPidScanner::Process(const uint8_t* bufP)
{ {
//debug("cPidScanner::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
if (!processM) if (!processM)
return; return;
// Stop scanning after defined timeout // Stop scanning after defined timeout
if (timeoutM.TimedOut()) { if (timeoutM.TimedOut()) {
debug("cPidScanner::%s(): timed out determining pids", __FUNCTION__); debug1("%s Timed out determining pids", __PRETTY_FUNCTION__);
processM = false; processM = false;
} }
@@ -84,35 +84,37 @@ void cPidScanner::Process(const uint8_t* bufP)
// Stream ID // Stream ID
if ((sid >= 0xC0) && (sid <= 0xDF)) { if ((sid >= 0xC0) && (sid <= 0xDF)) {
if (pid < aPidM) { if (pid < aPidM) {
debug("cPidScanner::%s(): found lower Apid: 0x%X instead of 0x%X", __FUNCTION__, pid, aPidM); debug1("%s Found lower Apid: 0x%X instead of 0x%X", __PRETTY_FUNCTION__, pid, aPidM);
aPidM = pid; aPidM = pid;
numApidsM = 1; numApidsM = 1;
} }
else if (pid == aPidM) { else if (pid == aPidM) {
++numApidsM; ++numApidsM;
debug("cPidScanner::%s(): incrementing Apids, now at %d", __FUNCTION__, numApidsM); debug1("%s Incrementing Apids, now at %d", __PRETTY_FUNCTION__, numApidsM);
} }
} }
else if ((sid >= 0xE0) && (sid <= 0xEF)) { else if ((sid >= 0xE0) && (sid <= 0xEF)) {
if (pid < vPidM) { if (pid < vPidM) {
debug("cPidScanner::%s(): found lower Vpid: 0x%X instead of 0x%X", __FUNCTION__, pid, vPidM); debug1("%s Found lower Vpid: 0x%X instead of 0x%X", __PRETTY_FUNCTION__, pid, vPidM);
vPidM = pid; vPidM = pid;
numVpidsM = 1; numVpidsM = 1;
} }
else if (pid == vPidM) { else if (pid == vPidM) {
++numVpidsM; ++numVpidsM;
debug("cPidScanner::%s(): incrementing Vpids, now at %d", __FUNCTION__, numVpidsM); debug1("%s Incrementing Vpids, now at %d", __PRETTY_FUNCTION__, numVpidsM);
} }
} }
} }
if (((numVpidsM >= PIDSCANNER_VPID_COUNT) && (numApidsM >= PIDSCANNER_APID_COUNT)) || if (((numVpidsM >= PIDSCANNER_VPID_COUNT) && (numApidsM >= PIDSCANNER_APID_COUNT)) ||
(abs(numApidsM - numVpidsM) >= PIDSCANNER_PID_DELTA_COUNT)) { (abs(numApidsM - numVpidsM) >= PIDSCANNER_PID_DELTA_COUNT)) {
// Lock channels for pid updates // Lock channels for pid updates
if (!Channels.Lock(true, 10)) {
timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS); timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS);
cStateKey StateKey;
cChannels *Channels = cChannels::GetChannelsWrite(StateKey, 10);
if (!Channels)
return; return;
} bool ChannelsModified = false;
cChannel *IptvChannel = Channels.GetByChannelID(channelIdM); cChannel *IptvChannel = Channels->GetByChannelID(channelIdM);
if (IptvChannel) { if (IptvChannel) {
int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated
int Atypes[MAXAPIDS + 1] = { 0 }; int Atypes[MAXAPIDS + 1] = { 0 };
@@ -146,10 +148,10 @@ void cPidScanner::Process(const uint8_t* bufP)
} }
for (unsigned int i = 0; i < MAXSPIDS; ++i) for (unsigned int i = 0; i < MAXSPIDS; ++i)
Spids[i] = IptvChannel->Spid(i); Spids[i] = IptvChannel->Spid(i);
debug("cPidScanner::%s(): vpid=0x%04X, apid=0x%04X", __FUNCTION__, vPidM, aPidM); debug1("%s vpid=0x%04X, apid=0x%04X", __PRETTY_FUNCTION__, vPidM, aPidM);
IptvChannel->SetPids(vPidM, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid); ChannelsModified |= IptvChannel->SetPids(vPidM, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
} }
Channels.Unlock(); StateKey.Remove(ChannelsModified);
processM = false; processM = false;
} }
} }

View File

@@ -11,6 +11,8 @@
#include <vdr/tools.h> #include <vdr/tools.h>
#include <vdr/channels.h> #include <vdr/channels.h>
#include "log.h"
class cPidScanner { class cPidScanner {
private: private:
enum { enum {
@@ -32,8 +34,8 @@ public:
~cPidScanner(); ~cPidScanner();
void SetChannel(const tChannelID &channelIdP); void SetChannel(const tChannelID &channelIdP);
void Process(const uint8_t* bufP); void Process(const uint8_t* bufP);
void Open() { debug("cPidScanner::%s()", __FUNCTION__); timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS); } void Open() { debug1("%s", __PRETTY_FUNCTION__); timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS); }
void Close() { debug("cPidScanner::%s()", __FUNCTION__); timeoutM.Set(0); } void Close() { debug1("%s", __PRETTY_FUNCTION__); timeoutM.Set(0); }
}; };
#endif // __PIDSCANNER_H #endif // __PIDSCANNER_H

134
po/ca_ES.po Normal file
View File

@@ -0,0 +1,134 @@
# VDR plugin language source file.
# Copyright (C) 2007-2017 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package.
# Gabriel Bonich, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
"Language-Team: Catalan <vdr@linuxtv.org>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "PAT (0x00)"
msgstr "PAT (0x00)"
msgid "NIT (0x40)"
msgstr "NIT (0x40)"
msgid "SDT (0x42)"
msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "TDT (0x70)"
msgstr "TDT (0x70)"
msgid "Experience the IPTV"
msgstr "Experimenta la IPTV"
msgid "IPTV Information"
msgstr "Informació IPTV"
msgid "General"
msgstr "General"
msgid "Pids"
msgstr "Pids"
msgid "Filters"
msgstr "Filtres"
msgid "Bits/bytes"
msgstr "Bits/Bytes"
msgid "IPTV information not available!"
msgstr "Informació IPTV no disponible!"
msgid "Protocol base port"
msgstr "Port Protocol"
msgid ""
"Define a base port used by CURL/EXT protocol.\n"
"\n"
"The 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."
msgstr ""
"Definir el port utilizat por el protocol CURL/EXT.\n"
"\n"
"El nombre de ports es defineix por el nombre de dispositius IPTV. Aquesta configuració estableix el port que escolta a las conexions de las aplicaciones externas quant s'utiliza el protocol CURL / EXT."
msgid "Use section filtering"
msgstr "Utilitzi la secció de filtrat"
msgid ""
"Define whether the section filtering shall be used.\n"
"\n"
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
"Enabling this feature does not affect streams that do not contain section data."
msgstr ""
"Definir si s'utilizarà la secció de filtrat.\n"
"\n"
"Secció de filtrat significa que el plugin IPTV tracta de analitzar i proporcionar a VDR les dades secundaries sobre el fluxe actiu. VDR pot utilitzar aquestes dades per proporcionar diverses funcionalitats com ara la detecció de canvis automatics del PID,EPG, etc.\n"
"L'activació d'aquesta funció no afecta als fluxes que no contenen dades de la secció."
msgid "Disabled filters"
msgstr "Desactivar Filtres"
msgid ""
"Define number of section filters to be disabled.\n"
"\n"
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
msgstr ""
"Definir el nombre de filtres de sección a desactivar.\n"
"\n"
"Certs filtres de secció podrien causar un comportament no desitjat a VDR, com el temps que sincronitza malament. Aquí la llista negra dels filtres, les dades útils de la secció es poden deixar intactes perquè VDR els processi."
msgid "Filter"
msgstr "Filtre"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Definir un filtre que no funcioni per ser inclos a la llista negre."
msgid "Help"
msgstr "Ajuda"
msgid "UDP"
msgstr "UDP"
msgid "CURL"
msgstr "CURL"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "ARXIU"
msgid "EXT"
msgstr "EXT"
msgid "Rid"
msgstr "Rid"
msgid "Scan section ids"
msgstr "Escaneja secció ids"
msgid "Scan pids"
msgstr "Escaneja pids"
msgid "Protocol"
msgstr "Protocol"
msgid "Address"
msgstr "Direcció"
msgid "Parameter"
msgstr "Parametre"

View File

@@ -1,15 +1,16 @@
# VDR plugin language source file. # VDR plugin language source file.
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala # Copyright (C) 2007-2018 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package. # This file is distributed under the same license as the iptv package.
# Tobias <vdr@e-tobi.net>, 2007. # Tobias <vdr@e-tobi.net>, 2007.
# Frank Neumann, 2015.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.1.0\n" "Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-08 01:18+0200\n" "POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n" "Last-Translator: Frank Neumann <fnu@yavdr.org>\n"
"Language-Team: German <vdr@linuxtv.org>\n" "Language-Team: German <vdr@linuxtv.org>\n"
"Language: de\n" "Language: de\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -26,14 +27,8 @@ msgstr "NIT (0x40)"
msgid "SDT (0x42)" msgid "SDT (0x42)"
msgstr "SDT (0x42)" msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F)" msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F)" msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "EIT (0x5X)"
msgstr "EIT (0x5X)"
msgid "EIT (0x6X)"
msgstr "EIT (0x6X)"
msgid "TDT (0x70)" msgid "TDT (0x70)"
msgstr "TDT (0x70)" msgstr "TDT (0x70)"
@@ -57,37 +52,22 @@ msgid "Bits/bytes"
msgstr "Bits/Bytes" msgstr "Bits/Bytes"
msgid "IPTV information not available!" msgid "IPTV information not available!"
msgstr "IPTV Informationen nicht verfügbar!" msgstr "Keine IPTV Informationen 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" msgid "Protocol base port"
msgstr "Protokoll Basisport" msgstr "Basis Port Protokoll"
msgid "" msgid ""
"Define a base port used by CURL/EXT protocol.\n" "Define a base port used by CURL/EXT protocol.\n"
"\n" "\n"
"The 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." "The 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."
msgstr "" msgstr ""
"Bestimme einen Basis Port für das CURL/EXT Protokoll.\n"
"\n"
"Der Bereich der Ports wird durch die Anzahl der IPTV Geräte festgelegt. Diese Einstellung bestimmt den Port auf den für Verbindungen gelauscht wird, wenn externe Applikationen das CURL/EXT Protokoll nutzen."
msgid "Use section filtering" msgid "Use section filtering"
msgstr "Benutze Abschnittsfilterung" msgstr "Benutze Abschnittsfilter"
msgid "" msgid ""
"Define whether the section filtering shall be used.\n" "Define whether the section filtering shall be used.\n"
@@ -95,22 +75,28 @@ msgid ""
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n" "Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
"Enabling this feature does not affect streams that do not contain section data." "Enabling this feature does not affect streams that do not contain section data."
msgstr "" msgstr ""
"Legt fest ob Abschnittsfilter genutzt werden sollen.\n"
"\n"
"Mit Abschnittsfiltern versucht das IPTV Plugin Sekundärdaten der aktiven Quelle zu analysieren und VDR bereitzustellen. VDR kann mit diesen Daten verschiedene Funktionen, wie automatische PID Erkennung und EPG, bereitstellen.\n"
"Die Nutzung dieser Fähigkeit hat keinen Einfluss auf Quellen, die keine Abschnittsdaten enthalten."
msgid "Disable filters" msgid "Disabled filters"
msgstr "Deaktiviere Filter" msgstr "Deaktivierte Filter"
msgid "" msgid ""
"Define number of section filters to be disabled.\n" "Define number of section filters to be disabled.\n"
"\n" "\n"
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process." "Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
msgstr "" msgstr ""
"Bestimme die Anzahl der Abschnittsfilter die deaktiviert werden sollen.\n"
"\n"
"Bestimmte Abschnittsfilter können unerwünschtes Verhalten mit VDR, z.B. falsche Zeit-Synchronisation, verursachen. Durch das Ausblenden einzelner Filter können nützliche Daten dieser Abschnitte für den VDR erhalten werden."
#. TRANSLATORS: note the singular! msgid "Filter"
msgid "Disable filter" msgstr "Filter"
msgstr "Deaktiviere Filter"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "" msgstr "Bestimme einen fehlerhaften Filter der ausgeblendet werden soll."
msgid "Help" msgid "Help"
msgstr "Hilfe" msgstr "Hilfe"
@@ -130,20 +116,14 @@ msgstr "DATEI"
msgid "EXT" msgid "EXT"
msgstr "EXT" msgstr "EXT"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid" msgid "Rid"
msgstr "Rid" msgstr "Rid"
msgid "Scan section ids" msgid "Scan section ids"
msgstr "Scanne Section IDS" msgstr "Suche Abschnitt IDs"
msgid "Scan pids" msgid "Scan pids"
msgstr "Scanne PIDS" msgstr "Suche PIDs"
msgid "Protocol" msgid "Protocol"
msgstr "Protokoll" msgstr "Protokoll"

134
po/es_ES.po Normal file
View File

@@ -0,0 +1,134 @@
# VDR plugin language source file.
# Copyright (C) 2007-2017 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package.
# Gabriel Bonich, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
"Language-Team: Spanish <vdr@linuxtv.org>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "PAT (0x00)"
msgstr "PAT (0x00)"
msgid "NIT (0x40)"
msgstr "NIT (0x40)"
msgid "SDT (0x42)"
msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "TDT (0x70)"
msgstr "TDT (0x70)"
msgid "Experience the IPTV"
msgstr "Experimente la IPTV"
msgid "IPTV Information"
msgstr "Información IPTV"
msgid "General"
msgstr "General"
msgid "Pids"
msgstr "Pids"
msgid "Filters"
msgstr "Filtros"
msgid "Bits/bytes"
msgstr "Bits/Bytes"
msgid "IPTV information not available!"
msgstr "Información IPTV no disponible!"
msgid "Protocol base port"
msgstr "Puerto Protocolo"
msgid ""
"Define a base port used by CURL/EXT protocol.\n"
"\n"
"The 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."
msgstr ""
"Definir el puerto utilizado por el protocolo CURL/EXT.\n"
"\n"
"El rango de puertos se define por el número de dispositivos IPTV. Esta configuración establece el puerto que se escucha para las conexiones de las aplicaciones externas cuando se utiliza el protocolo CURL / EXT."
msgid "Use section filtering"
msgstr "Utilice la sección de filtrado"
msgid ""
"Define whether the section filtering shall be used.\n"
"\n"
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
"Enabling this feature does not affect streams that do not contain section data."
msgstr ""
"Definir si se utilizará la sección de filtrado.\n"
"\n"
"Sección de filtrado significa que el plugin IPTV trata de analizar y proporcionar a VDR los datos secundarios sobre el flujo activo. VDR puede entonces utilizar estos datos para proporcionar diversas funcionalidades tales como detección automática del cambio del PID, EPG, etc.\n"
"El uso de esta capacidad no afecta a fuentes que no contienen datos de la sección."
msgid "Disabled filters"
msgstr "Desactivar Filtros"
msgid ""
"Define number of section filters to be disabled.\n"
"\n"
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
msgstr ""
"Defina el número de filtros de sección a deshabilitar.\n"
"\n"
"Ciertos filtros de sección pueden causar algún comportamiento no deseado a VDR, como el tiempo que sincroniza mal. Aquí la lista negra de los filtros, los datos útiles de la sección se pueden dejar intactos para que VDR los procese."
msgid "Filter"
msgstr "Filtro"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Defina un filtro que no funcione para ser incluido en la lista negra."
msgid "Help"
msgstr "Ayuda"
msgid "UDP"
msgstr "UDP"
msgid "CURL"
msgstr "CURL"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "ARCHIVO"
msgid "EXT"
msgstr "EXT"
msgid "Rid"
msgstr "Rid"
msgid "Scan section ids"
msgstr "Escanea sección ids"
msgid "Scan pids"
msgstr "Escanea pids"
msgid "Protocol"
msgstr "Protocolo"
msgid "Address"
msgstr "Dirección"
msgid "Parameter"
msgstr "Parametro"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # VDR plugin language source file.
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala # Copyright (C) 2007-2018 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package. # This file is distributed under the same license as the iptv package.
# Rolf Ahrenberg # Rolf Ahrenberg
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.1.0\n" "Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-08 01:18+0200\n" "POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Rolf Ahrenberg\n" "Last-Translator: Rolf Ahrenberg\n"
"Language-Team: Finnish <vdr@linuxtv.org>\n" "Language-Team: Finnish <vdr@linuxtv.org>\n"
"Language: fi\n" "Language: fi\n"
@@ -25,14 +25,8 @@ msgstr "NIT (0x40)"
msgid "SDT (0x42)" msgid "SDT (0x42)"
msgstr "SDT (0x42)" msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F)" msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F)" msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "EIT (0x5X)"
msgstr "EIT (0x5X)"
msgid "EIT (0x6X)"
msgstr "EIT (0x6X)"
msgid "TDT (0x70)" msgid "TDT (0x70)"
msgstr "TDT (0x70)" msgstr "TDT (0x70)"
@@ -58,30 +52,6 @@ msgstr "Bitit/tavut"
msgid "IPTV information not available!" msgid "IPTV information not available!"
msgstr "IPTV-tietoja ei saatavilla!" 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" msgid "Protocol base port"
msgstr "Protokollan perusportti" msgstr "Protokollan perusportti"
@@ -108,7 +78,7 @@ msgstr ""
"IPTV-laajennos voi suodattaa lähetteestä VDR:lle tarjottavia sektioita, joita käytetään esim. ohjelmaoppaan ja ohjelmatunnisteiden (PID) päivittämiseen.\n" "IPTV-laajennos voi suodattaa lähetteestä VDR:lle tarjottavia sektioita, joita käytetään esim. ohjelmaoppaan ja ohjelmatunnisteiden (PID) päivittämiseen.\n"
"Toiminto ei vaikuta lähetteeseen, jossa ei ole sektioita." "Toiminto ei vaikuta lähetteeseen, jossa ei ole sektioita."
msgid "Disable filters" msgid "Disabled filters"
msgstr "Poista suodattimia käytöstä" msgstr "Poista suodattimia käytöstä"
msgid "" msgid ""
@@ -120,9 +90,8 @@ msgstr ""
"\n" "\n"
"Tietyt sektiot saattavat aiheuttaa virheellistä toimintaa VDR:ssä, esimerkiksi asettavat väärän kellonajan, ja näiden poistaminen auttaa VDR:ää toimimaan kunnolla jäljelle jäävien sektioiden kanssa." "Tietyt sektiot saattavat aiheuttaa virheellistä toimintaa VDR:ssä, esimerkiksi asettavat väärän kellonajan, ja näiden poistaminen auttaa VDR:ää toimimaan kunnolla jäljelle jäävien sektioiden kanssa."
#. TRANSLATORS: note the singular! msgid "Filter"
msgid "Disable filter" msgstr "Suodatin"
msgstr "Poista suodatin käytöstä"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle listalle." msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle listalle."
@@ -145,12 +114,6 @@ msgstr "FILE"
msgid "EXT" msgid "EXT"
msgstr "EXT" msgstr "EXT"
msgid "Nid"
msgstr "Verkko-ID"
msgid "Tid"
msgstr "Lähete-ID"
msgid "Rid" msgid "Rid"
msgstr "Radio-ID" msgstr "Radio-ID"

View File

@@ -1,15 +1,15 @@
# French translations for iptv package. # French translations for iptv package.
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala # Copyright (C) 2007-2018 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package. # This file is distributed under the same license as the iptv package.
# Bruno ROUSSEL <bruno.roussel@free.fr>, 2007. # Bruno ROUSSEL <bruno.roussel@free.fr>, 2007.
# NIVAL Michaël <mnival@club-internet.fr>, 2008. # NIVAL Michaël <mnival@club-internet.fr>, 2008.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.1.0\n" "Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-08 01:18+0200\n" "POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n" "Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
"Language-Team: French <vdr@linuxtv.org>\n" "Language-Team: French <vdr@linuxtv.org>\n"
"Language: fr\n" "Language: fr\n"
@@ -27,14 +27,8 @@ msgstr "NIT (0x40)"
msgid "SDT (0x42)" msgid "SDT (0x42)"
msgstr "SDT (0x42)" msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F)" msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F)" msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "EIT (0x5X)"
msgstr "EIT (0x5X)"
msgid "EIT (0x6X)"
msgstr "EIT (0x6X)"
msgid "TDT (0x70)" msgid "TDT (0x70)"
msgstr "TDT (0x70)" msgstr "TDT (0x70)"
@@ -60,30 +54,6 @@ msgstr "Bits/Bytes"
msgid "IPTV information not available!" msgid "IPTV information not available!"
msgstr "Information sur IPTV non disponible !" 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" msgid "Protocol base port"
msgstr "Port de base du protocole" msgstr "Port de base du protocole"
@@ -110,7 +80,7 @@ msgstr ""
"La section filtrage signifie que le plugin IPTV essayera d'analyser et de fournir à VDR des données secondaires disponible sur le flux. VDR peut alors utiliser ces données pour fournir des fonctionnalitées supplémentaires tel que la détection de changement de pid et d'EPG etc.\n" "La section filtrage signifie que le plugin IPTV essayera d'analyser et de fournir à VDR des données secondaires disponible sur le flux. VDR peut alors utiliser ces données pour fournir des fonctionnalitées supplémentaires tel que la détection de changement de pid et d'EPG etc.\n"
"L'activation de cette fonctionnalité n'a pas d'incidence sur les flux qui ne contiennent pas de données de la section." "L'activation de cette fonctionnalité n'a pas d'incidence sur les flux qui ne contiennent pas de données de la section."
msgid "Disable filters" msgid "Disabled filters"
msgstr "Désactiver les filtres" msgstr "Désactiver les filtres"
msgid "" msgid ""
@@ -122,9 +92,8 @@ msgstr ""
"\n" "\n"
"Certains filtrage de section peux engendrer des comportement indésirables. Blacklist les filtres qui seront laissé intact pour VDR." "Certains filtrage de section peux engendrer des comportement indésirables. Blacklist les filtres qui seront laissé intact pour VDR."
#. TRANSLATORS: note the singular! msgid "Filter"
msgid "Disable filter" msgstr "Filtre"
msgstr "Désactiver le filtre"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Définit les mauvais comportement qui doivent être désactivé." msgstr "Définit les mauvais comportement qui doivent être désactivé."
@@ -147,12 +116,6 @@ msgstr "FICHIER"
msgid "EXT" msgid "EXT"
msgstr "EXT" msgstr "EXT"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid" msgid "Rid"
msgstr "Rid" msgstr "Rid"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # VDR plugin language source file.
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala # Copyright (C) 2007-2018 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package. # This file is distributed under the same license as the iptv package.
# Diego Pierotto <vdr-italian@tiscali.it>, 2008. # Diego Pierotto <vdr-italian@tiscali.it>, 2008.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.1.0\n" "Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-08 01:18+0200\n" "POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: Italian <vdr@linuxtv.org>\n" "Language-Team: Italian <vdr@linuxtv.org>\n"
"Language: it\n" "Language: it\n"
@@ -26,14 +26,8 @@ msgstr "NIT (0x40)"
msgid "SDT (0x42)" msgid "SDT (0x42)"
msgstr "SDT (0x42)" msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F)" msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F)" msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "EIT (0x5X)"
msgstr "EIT (0x5X)"
msgid "EIT (0x6X)"
msgstr "EIT (0x6X)"
msgid "TDT (0x70)" msgid "TDT (0x70)"
msgstr "TDT (0x70)" msgstr "TDT (0x70)"
@@ -59,30 +53,6 @@ msgstr "Bits/bytes"
msgid "IPTV information not available!" msgid "IPTV information not available!"
msgstr "Informazione IPTV non disponibile!" 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" msgid "Protocol base port"
msgstr "Porta base protocollo" msgstr "Porta base protocollo"
@@ -109,7 +79,7 @@ msgstr ""
"La sezioni filtri significa che il plugin IPTV prova a elaborare e fornire a VDR dati secondari sul flusso attualmente attivo. VDR può successivamente usare questi dati per fornire varie funzionalità come il rilevamento del cambio Pid automatico, EPG, etc.\n" "La sezioni filtri significa che il plugin IPTV prova a elaborare e fornire a VDR dati secondari sul flusso attualmente attivo. VDR può successivamente usare questi dati per fornire varie funzionalità come il rilevamento del cambio Pid automatico, EPG, etc.\n"
"Abilitare questa funzione non influisce sui flussi che non contengono dati di sezione." "Abilitare questa funzione non influisce sui flussi che non contengono dati di sezione."
msgid "Disable filters" msgid "Disabled filters"
msgstr "Disabilita filtri" msgstr "Disabilita filtri"
msgid "" msgid ""
@@ -121,9 +91,8 @@ msgstr ""
"\n" "\n"
"Certe sezioni filtri potrebbero generare alcuni comportamenti indesiderati per VDR come la non sincronizzazione dell'ora. Inserendo qui i filtri nella lista nera i dati di sezione utili possono essere lasciati intatti per l'elaborazione da parte di VDR." "Certe sezioni filtri potrebbero generare alcuni comportamenti indesiderati per VDR come la non sincronizzazione dell'ora. Inserendo qui i filtri nella lista nera i dati di sezione utili possono essere lasciati intatti per l'elaborazione da parte di VDR."
#. TRANSLATORS: note the singular! msgid "Filter"
msgid "Disable filter" msgstr "Filtro"
msgstr "Disabilita filtro"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Definisci un filtro corrotto che sarà messo nella lista nera." msgstr "Definisci un filtro corrotto che sarà messo nella lista nera."
@@ -146,12 +115,6 @@ msgstr "FILE"
msgid "EXT" msgid "EXT"
msgstr "EXT" msgstr "EXT"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid" msgid "Rid"
msgstr "Rid" msgstr "Rid"

133
po/lt_LT.po Normal file
View File

@@ -0,0 +1,133 @@
# VDR plugin language source file.
# Copyright (C) 2007-2018 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package.
# Valdemaras Pipiras
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Valdemaras Pipiras\n"
"Language-Team: Lithuanian <vdr@linuxtv.org>\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "PAT (0x00)"
msgstr "PAT (0x00)"
msgid "NIT (0x40)"
msgstr "NIT (0x40)"
msgid "SDT (0x42)"
msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "TDT (0x70)"
msgstr "TDT (0x70)"
msgid "Experience the IPTV"
msgstr "Išbandyk IPTV"
msgid "IPTV Information"
msgstr "IPTV informacija"
msgid "General"
msgstr "Pagrindinis"
msgid "Pids"
msgstr "Pidai"
msgid "Filters"
msgstr "Filtrai"
msgid "Bits/bytes"
msgstr "Bitai/baitai"
msgid "IPTV information not available!"
msgstr "Nėra IPTV informacijos!"
msgid "Protocol base port"
msgstr "Numatytasis protokolo portas"
msgid ""
"Define a base port used by CURL/EXT protocol.\n"
"\n"
"The 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."
msgstr ""
"Nustatykite pagrindinį portą naudojamą CURL/EXT transliavimo metodų.\n"
"\n"
"Portų rėžis nustatomas pagal IPTV įrenginių skaičių. Šis nustatymas nustato portą kuris priima išorinių programų užklausas, kai naudojamas CURL/EXT transliavimo metodas."
msgid "Use section filtering"
msgstr "Naudoti paketų filtravimą"
msgid ""
"Define whether the section filtering shall be used.\n"
"\n"
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
"Enabling this feature does not affect streams that do not contain section data."
msgstr ""
"Numatyti ar paketų firltravimas bus naudojamas.\n"
"\n"
"Dalinis filtravimas reiškia tai kad IPTV pluginas bando ištraukti informaciją ir VDR sistemai pateikti papildomus duomenis apie dabar aktyvius srautus. VDR sistema po to gali naudoti šiuos duomenis įvairiems fokusams, tokiems kaip automatinis pid'ų pasikeitimo nustatymas arba EPG informacija it t.t.\n"
"Jei srautai neturi paketinės informacijos, jie nebus analizuojami net įjungus šį nustatymą."
msgid "Disabled filters"
msgstr "Išjungti filtrus"
msgid ""
"Define number of section filters to be disabled.\n"
"\n"
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
msgstr ""
"Nurodyti kokį kiekį paketų filtrų išjungti.\n"
"\n"
"Šitie paketų filtrai gali sutrikdyti sistemos darbą, pavyzdžiui gali atsirasti laiko asinchronizacija. Atjungiant čia filtrus, gali būti palikta tik naudinga paketinė informacija nepažeidžianti sistemos darbo."
msgid "Filter"
msgstr "Filtrą"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Nustatyti kad netinkamai veikiantis filtras būtu išjungtas."
msgid "Help"
msgstr "Pagalba"
msgid "UDP"
msgstr "UDP"
msgid "CURL"
msgstr "CURL"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "FAILAS"
msgid "EXT"
msgstr "EXT"
msgid "Rid"
msgstr "Radio-ID"
msgid "Scan section ids"
msgstr "Skanuoti paketų id"
msgid "Scan pids"
msgstr "Skanuoti pidus"
msgid "Protocol"
msgstr "Protokolas"
msgid "Address"
msgstr "Adresas"
msgid "Parameter"
msgstr "Parametras"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # VDR plugin language source file.
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala # Copyright (C) 2007-2018 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package. # This file is distributed under the same license as the iptv package.
# Carel, 2010. # Carel, 2010.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.1.0\n" "Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-08 01:18+0200\n" "POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Carel\n" "Last-Translator: Carel\n"
"Language-Team: Dutch <vdr@linuxtv.org>\n" "Language-Team: Dutch <vdr@linuxtv.org>\n"
"Language: nl\n" "Language: nl\n"
@@ -26,14 +26,8 @@ msgstr "NIT (0x40)"
msgid "SDT (0x42)" msgid "SDT (0x42)"
msgstr "SDT (0x42)" msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F)" msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F)" msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "EIT (0x5X)"
msgstr "EIT (0x5X)"
msgid "EIT (0x6X)"
msgstr "EIT (0x6X)"
msgid "TDT (0x70)" msgid "TDT (0x70)"
msgstr "TDT (0x70)" msgstr "TDT (0x70)"
@@ -59,30 +53,6 @@ msgstr "Bits/Bytes"
msgid "IPTV information not available!" msgid "IPTV information not available!"
msgstr "IPTV informatie niet beschikbaar!" 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" msgid "Protocol base port"
msgstr "Protocol basispoort" msgstr "Protocol basispoort"
@@ -108,7 +78,7 @@ msgstr ""
"\n" "\n"
"Bij sectiefiltering zal de IPTV plugin VDR van extra informatie over de stream voorzien. VDR kan dan bijvoorbeeld automatisch de PIDs wijzigen of de EPG tonen.Het gebruik van deze mogelijkheid heeft geen effect op streams die geen sectiedata bevatten." "Bij sectiefiltering zal de IPTV plugin VDR van extra informatie over de stream voorzien. VDR kan dan bijvoorbeeld automatisch de PIDs wijzigen of de EPG tonen.Het gebruik van deze mogelijkheid heeft geen effect op streams die geen sectiedata bevatten."
msgid "Disable filters" msgid "Disabled filters"
msgstr "Deactiveer filter" msgstr "Deactiveer filter"
msgid "" msgid ""
@@ -120,9 +90,8 @@ msgstr ""
"\n" "\n"
"Sommige sctiefilters kunnen ongewenste effecten veroorzaken. Door ze hier op te nemen blijft de data intact zodat VDR het kan blijven gebruiken." "Sommige sctiefilters kunnen ongewenste effecten veroorzaken. Door ze hier op te nemen blijft de data intact zodat VDR het kan blijven gebruiken."
#. TRANSLATORS: note the singular! msgid "Filter"
msgid "Disable filter" msgstr "Filter"
msgstr "Deactiveer filter"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Blacklist een probleem veroorzakend filter " msgstr "Blacklist een probleem veroorzakend filter "
@@ -145,12 +114,6 @@ msgstr "BESTAND"
msgid "EXT" msgid "EXT"
msgstr "EXT" msgstr "EXT"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid" msgid "Rid"
msgstr "Rid" msgstr "Rid"

134
po/pl_PL.po Normal file
View File

@@ -0,0 +1,134 @@
# VDR plugin language source file.
# Copyright (C) 2007-2017 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the vdr-iptv package.
# Tomasz Maciej Nowak, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Tomasz Maciej Nowak <tomek_n@o2.pl>\n"
"Language-Team: Polish <vdr@linuxtv.org>\n"
"Language: pl_PL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.11\n"
msgid "PAT (0x00)"
msgstr "PAT (0x00)"
msgid "NIT (0x40)"
msgstr "NIT (0x40)"
msgid "SDT (0x42)"
msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "TDT (0x70)"
msgstr "TDT (0x70)"
msgid "Experience the IPTV"
msgstr "Poznaj IPTV"
msgid "IPTV Information"
msgstr "IPTV - informacje"
msgid "General"
msgstr "Główne"
msgid "Pids"
msgstr "Pidy"
msgid "Filters"
msgstr "Filtry"
msgid "Bits/bytes"
msgstr "Bity/bajty"
msgid "IPTV information not available!"
msgstr "Brak dostępnych informacji IPTV!"
msgid "Protocol base port"
msgstr "Podstawowy port protokołu"
msgid ""
"Define a base port used by CURL/EXT protocol.\n"
"\n"
"The 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."
msgstr ""
"Określa podstawowy port używany przez protokół CURL/EXT.\n"
"\n"
"Zakres portów jest zdefiniowany liczbą urządzeń IPTV. To ustawienie nadaje port, który nasłuchuje połączeń z zewnętrznych aplikacji używających protokołu CURL/EXT."
msgid "Use section filtering"
msgstr "Używaj filtrowania sekcji"
msgid ""
"Define whether the section filtering shall be used.\n"
"\n"
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
"Enabling this feature does not affect streams that do not contain section data."
msgstr ""
"Określa czy włączyć filtrowanie sekcji.\n"
"\n"
"Filtrowanie sekcji oznacza że wtyczka IPTV próbuje analizować i dostarczyć VDR dodatkowe informacje o aktywnym strumieniu. VDR może użyć tych danych aby dostarczyć dodatkowe usługi jak automatyczne wykrycie zmiany pidów i EPG, etc.\n"
"Włączenie tej funkcji nie wpływa na strumienie nie posiadające danych sekcji."
msgid "Disabled filters"
msgstr "Wyłączone filtry"
msgid ""
"Define number of section filters to be disabled.\n"
"\n"
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
msgstr ""
"Określa liczbę wyłączonych filtrów sekcji.\n"
"\n"
"Niektóre filtry sekcji mogą powodować niezamierzone efekty w VDR, takie jak zły czas synchronizacji. Poprzez wyłączenie niektórych filtrów, użyteczne dane sekcji będą dostępne do przetworzenia dla VDR."
msgid "Filter"
msgstr "Filtr"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Określa filtry powodujące zakłócenia, które mają być wyłączone."
msgid "Help"
msgstr "Pomoc"
msgid "UDP"
msgstr "UDP"
msgid "CURL"
msgstr "CURL"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "PLIK"
msgid "EXT"
msgstr "EXT"
msgid "Rid"
msgstr "Rid"
msgid "Scan section ids"
msgstr "Skanuj sekcję identyfikatorów"
msgid "Scan pids"
msgstr "Skanuj pidy"
msgid "Protocol"
msgstr "Protokół"
msgid "Address"
msgstr "Adres"
msgid "Parameter"
msgstr "Parametr"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # VDR plugin language source file.
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala # Copyright (C) 2007-2018 Rolf Ahrenberg & Antti Seppala
# This file is distributed under the same license as the iptv package. # This file is distributed under the same license as the iptv package.
# Alexander Gross <Bikalexander@gmail.com>, 2008. # Alexander Gross <Bikalexander@gmail.com>, 2008.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.1.0\n" "Project-Id-Version: vdr-iptv 2.4.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-08 01:18+0200\n" "POT-Creation-Date: 2018-04-15 04:15+0300\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2018-04-15 04:15+0300\n"
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n" "Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
"Language-Team: Russian <vdr@linuxtv.org>\n" "Language-Team: Russian <vdr@linuxtv.org>\n"
"Language: ru\n" "Language: ru\n"
@@ -27,14 +27,8 @@ msgstr "NIT (0x40)"
msgid "SDT (0x42)" msgid "SDT (0x42)"
msgstr "SDT (0x42)" msgstr "SDT (0x42)"
msgid "EIT (0x4E/0x4F)" msgid "EIT (0x4E/0x4F/0x5X/0x6X)"
msgstr "EIT (0x4E/0x4F)" msgstr "EIT (0x4E/0x4F/0x5X/0x6X)"
msgid "EIT (0x5X)"
msgstr "EIT (0x5X)"
msgid "EIT (0x6X)"
msgstr "EIT (0x6X)"
msgid "TDT (0x70)" msgid "TDT (0x70)"
msgstr "TDT (0x70)" msgstr "TDT (0x70)"
@@ -60,24 +54,6 @@ msgstr "Биты / байт"
msgid "IPTV information not available!" msgid "IPTV information not available!"
msgstr "IPTV информация отсутствует!" 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" msgid "Protocol base port"
msgstr "Базисный порт протокола" msgstr "Базисный порт протокола"
@@ -97,7 +73,7 @@ msgid ""
"Enabling this feature does not affect streams that do not contain section data." "Enabling this feature does not affect streams that do not contain section data."
msgstr "" msgstr ""
msgid "Disable filters" msgid "Disabled filters"
msgstr "Деактивировать фильтры" msgstr "Деактивировать фильтры"
msgid "" msgid ""
@@ -106,9 +82,8 @@ msgid ""
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process." "Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
msgstr "" msgstr ""
#. TRANSLATORS: note the singular! msgid "Filter"
msgid "Disable filter" msgstr "фильтр"
msgstr "Деактивировать фильтр"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Неправильно работающий фильтр, занести в черный список." msgstr "Неправильно работающий фильтр, занести в черный список."
@@ -131,12 +106,6 @@ msgstr "ФАЙЛ"
msgid "EXT" msgid "EXT"
msgstr "EXT" msgstr "EXT"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid" msgid "Rid"
msgstr "Rid" msgstr "Rid"

View File

@@ -7,6 +7,7 @@
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#include "log.h"
#include "protocolcurl.h" #include "protocolcurl.h"
#ifdef CURLOPT_RTSPHEADER #ifdef CURLOPT_RTSPHEADER
@@ -31,15 +32,14 @@ cIptvProtocolCurl::cIptvProtocolCurl()
handleM(NULL), handleM(NULL),
multiM(NULL), multiM(NULL),
headerListM(NULL), headerListM(NULL),
ringBufferM(new cRingBufferLinear(MEGABYTE(IptvConfig.GetTsBufferSize()), ringBufferM(new cRingBufferLinear(IPTV_BUFFER_SIZE, 7 * TS_SIZE, false, "IPTV CURL")),
7 * TS_SIZE, false, "IPTV CURL")),
rtspControlM(""), rtspControlM(""),
modeM(eModeUnknown), modeM(eModeUnknown),
timeoutM(), timeoutM(),
connectedM(false), connectedM(false),
pausedM(false) pausedM(false)
{ {
debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
if (ringBufferM) { if (ringBufferM) {
ringBufferM->SetTimeouts(100, 0); ringBufferM->SetTimeouts(100, 0);
ringBufferM->SetIoThrottle(); ringBufferM->SetIoThrottle();
@@ -49,17 +49,46 @@ cIptvProtocolCurl::cIptvProtocolCurl()
cIptvProtocolCurl::~cIptvProtocolCurl() cIptvProtocolCurl::~cIptvProtocolCurl()
{ {
debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
Disconnect(); Disconnect();
// Free allocated memory // Free allocated memory
DELETE_POINTER(ringBufferM); DELETE_POINTER(ringBufferM);
} }
int cIptvProtocolCurl::DebugCallback(CURL *handleP, curl_infotype typeP, char *dataP, size_t sizeP, void *userPtrP)
{
cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP);
if (obj) {
switch (typeP) {
case CURLINFO_TEXT:
debug8("%s INFO %.*s", __PRETTY_FUNCTION__, (int)sizeP, dataP);
break;
case CURLINFO_HEADER_IN:
debug8("%s HEAD <<< %.*s", __PRETTY_FUNCTION__, (int)sizeP, dataP);
break;
case CURLINFO_HEADER_OUT:
debug8("%s HEAD >>>\n%.*s", __PRETTY_FUNCTION__, (int)sizeP, dataP);
break;
case CURLINFO_DATA_IN:
debug8("%s DATA <<< %zu", __PRETTY_FUNCTION__, sizeP);
break;
case CURLINFO_DATA_OUT:
debug8("%s DATA >>> %zu", __PRETTY_FUNCTION__, sizeP);
break;
default:
break;
}
}
return 0;
}
size_t cIptvProtocolCurl::WriteCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP) size_t cIptvProtocolCurl::WriteCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP)
{ {
cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP); cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP);
size_t len = sizeP * nmembP; size_t len = sizeP * nmembP;
//debug("cIptvProtocolCurl::%s(%zu)", __FUNCTION__, len); debug16("%s (, %zu, %zu, ) len=%zu", __PRETTY_FUNCTION__, sizeP, nmembP, len);
if (obj && !obj->PutData((unsigned char *)ptrP, (int)len)) if (obj && !obj->PutData((unsigned char *)ptrP, (int)len))
return CURL_WRITEFUNC_PAUSE; return CURL_WRITEFUNC_PAUSE;
@@ -72,7 +101,7 @@ size_t cIptvProtocolCurl::WriteRtspCallback(void *ptrP, size_t sizeP, size_t nme
cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP); cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP);
size_t len = sizeP * nmembP; size_t len = sizeP * nmembP;
unsigned char *p = (unsigned char *)ptrP; unsigned char *p = (unsigned char *)ptrP;
//debug("cIptvProtocolCurl::%s(%zu)", __FUNCTION__, len); debug16("%s (, %zu, %zu, ) len=%zu", __PRETTY_FUNCTION__, sizeP, nmembP, len);
// Validate packet header ('$') and channel (0) // Validate packet header ('$') and channel (0)
if (obj && (p[0] == 0x24) && (p[1] == 0)) { if (obj && (p[0] == 0x24) && (p[1] == 0)) {
@@ -114,7 +143,7 @@ size_t cIptvProtocolCurl::DescribeCallback(void *ptrP, size_t sizeP, size_t nmem
{ {
cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP); cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP);
size_t len = sizeP * nmembP; size_t len = sizeP * nmembP;
//debug("cIptvProtocolCurl::%s(%zu)", __FUNCTION__, len); debug16("%s (, %zu, %zu, ) len=%zu", __PRETTY_FUNCTION__, sizeP, nmembP, len);
bool found = false; bool found = false;
cString control = ""; cString control = "";
@@ -122,7 +151,7 @@ size_t cIptvProtocolCurl::DescribeCallback(void *ptrP, size_t sizeP, size_t nmem
char *r = strtok(p, "\r\n"); char *r = strtok(p, "\r\n");
while (r) { while (r) {
//debug("cIptvProtocolCurl::%s(%zu): %s", __FUNCTION__, len, r); debug16("%s (, %zu, %zu, ) len=%zu r=%s", __PRETTY_FUNCTION__, sizeP, nmembP, len, r);
// Look for a media name: "video" // Look for a media name: "video"
if (strstr(r, "m=video")) { if (strstr(r, "m=video")) {
found = true; found = true;
@@ -148,13 +177,13 @@ size_t cIptvProtocolCurl::HeaderCallback(void *ptrP, size_t sizeP, size_t nmembP
{ {
//cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP); //cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP);
size_t len = sizeP * nmembP; size_t len = sizeP * nmembP;
//debug("cIptvProtocolCurl::%s(%zu)", __FUNCTION__, len); debug16("%s (, %zu, %zu, ) len=%zu", __PRETTY_FUNCTION__, sizeP, nmembP, len);
char *p = (char *)ptrP; char *p = (char *)ptrP;
char *r = strtok(p, "\r\n"); char *r = strtok(p, "\r\n");
while (r) { while (r) {
//debug("cIptvProtocolCurl::%s(%zu): %s", __FUNCTION__, len, r); debug16("%s (, %zu, %zu, ) len=%zu r=%s", __PRETTY_FUNCTION__, sizeP, nmembP, len, r);
r = strtok(NULL, "\r\n"); r = strtok(NULL, "\r\n");
} }
@@ -164,7 +193,7 @@ size_t cIptvProtocolCurl::HeaderCallback(void *ptrP, size_t sizeP, size_t nmembP
void cIptvProtocolCurl::SetRtspControl(const char *controlP) void cIptvProtocolCurl::SetRtspControl(const char *controlP)
{ {
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
//debug("cIptvProtocolCurl::%s(%s)", __FUNCTION__, controlP); debug16("%s (%s)", __PRETTY_FUNCTION__, controlP);
cString protocol = ChangeCase(controlP, false).Truncate(7); cString protocol = ChangeCase(controlP, false).Truncate(7);
if (startswith(*protocol, "rtsp://")) { if (startswith(*protocol, "rtsp://")) {
streamUrlM = controlP; streamUrlM = controlP;
@@ -177,13 +206,13 @@ void cIptvProtocolCurl::SetRtspControl(const char *controlP)
bool cIptvProtocolCurl::PutData(unsigned char *dataP, int lenP) bool cIptvProtocolCurl::PutData(unsigned char *dataP, int lenP)
{ {
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
//debug("cIptvProtocolCurl::%s(%d)", __FUNCTION__, lenP); debug16("%s (, %d)", __PRETTY_FUNCTION__, lenP);
if (pausedM) if (pausedM)
return false; return false;
if (ringBufferM && (lenP >= 0)) { if (ringBufferM && (lenP >= 0)) {
// Should we pause the transfer ? // Should we pause the transfer ?
if (ringBufferM->Free() < (2 * CURL_MAX_WRITE_SIZE)) { if (ringBufferM->Free() < (2 * CURL_MAX_WRITE_SIZE)) {
debug("cIptvProtocolCurl::%s(pause): free=%d available=%d len=%d", __FUNCTION__, debug1("%s Pause free=%d available=%d len=%d", __PRETTY_FUNCTION__,
ringBufferM->Free(), ringBufferM->Available(), lenP); ringBufferM->Free(), ringBufferM->Available(), lenP);
pausedM = true; pausedM = true;
return false; return false;
@@ -199,14 +228,14 @@ bool cIptvProtocolCurl::PutData(unsigned char *dataP, int lenP)
void cIptvProtocolCurl::DelData(int lenP) void cIptvProtocolCurl::DelData(int lenP)
{ {
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
//debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
if (ringBufferM && (lenP >= 0)) if (ringBufferM && (lenP >= 0))
ringBufferM->Del(lenP); ringBufferM->Del(lenP);
} }
void cIptvProtocolCurl::ClearData() void cIptvProtocolCurl::ClearData()
{ {
//debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
if (ringBufferM) if (ringBufferM)
ringBufferM->Clear(); ringBufferM->Clear();
} }
@@ -214,7 +243,7 @@ void cIptvProtocolCurl::ClearData()
unsigned char *cIptvProtocolCurl::GetData(int &lenP) unsigned char *cIptvProtocolCurl::GetData(int &lenP)
{ {
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
//debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
unsigned char *p = NULL; unsigned char *p = NULL;
lenP = 0; lenP = 0;
if (ringBufferM) { if (ringBufferM) {
@@ -246,7 +275,7 @@ unsigned char *cIptvProtocolCurl::GetData(int &lenP)
bool cIptvProtocolCurl::Connect() bool cIptvProtocolCurl::Connect()
{ {
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
if (connectedM) if (connectedM)
return true; return true;
@@ -258,10 +287,10 @@ bool cIptvProtocolCurl::Connect()
CURLcode res = CURLE_OK; CURLcode res = CURLE_OK;
cString netrc = cString::sprintf("%s/netrc", IptvConfig.GetConfigDirectory()); cString netrc = cString::sprintf("%s/netrc", IptvConfig.GetConfigDirectory());
#ifdef DEBUG
// Verbose output // Verbose output
iptv_curl_easy_setopt(handleM, CURLOPT_VERBOSE, 1L); iptv_curl_easy_setopt(handleM, CURLOPT_VERBOSE, 1L);
#endif iptv_curl_easy_setopt(handleM, CURLOPT_DEBUGFUNCTION, cIptvProtocolCurl::DebugCallback);
iptv_curl_easy_setopt(handleM, CURLOPT_DEBUGDATA, this);
// Set callbacks // Set callbacks
iptv_curl_easy_setopt(handleM, CURLOPT_WRITEFUNCTION, cIptvProtocolCurl::WriteCallback); iptv_curl_easy_setopt(handleM, CURLOPT_WRITEFUNCTION, cIptvProtocolCurl::WriteCallback);
@@ -278,8 +307,9 @@ bool cIptvProtocolCurl::Connect()
iptv_curl_easy_setopt(handleM, CURLOPT_NETRC_FILE, *netrc); iptv_curl_easy_setopt(handleM, CURLOPT_NETRC_FILE, *netrc);
// Set timeouts // Set timeouts
iptv_curl_easy_setopt(handleM, CURLOPT_TIMEOUT, (long)eConnectTimeoutS);
iptv_curl_easy_setopt(handleM, CURLOPT_CONNECTTIMEOUT, (long)eConnectTimeoutS); iptv_curl_easy_setopt(handleM, CURLOPT_CONNECTTIMEOUT, (long)eConnectTimeoutS);
iptv_curl_easy_setopt(handleM, CURLOPT_LOW_SPEED_LIMIT, (long)eLowSpeedLimitBytes);
iptv_curl_easy_setopt(handleM, CURLOPT_LOW_SPEED_TIME, (long)eLowSpeedTimeoutS);
// Set user-agent // Set user-agent
iptv_curl_easy_setopt(handleM, CURLOPT_USERAGENT, *cString::sprintf("vdr-%s/%s", PLUGIN_NAME_I18N, VERSION)); iptv_curl_easy_setopt(handleM, CURLOPT_USERAGENT, *cString::sprintf("vdr-%s/%s", PLUGIN_NAME_I18N, VERSION));
@@ -408,7 +438,7 @@ bool cIptvProtocolCurl::Connect()
bool cIptvProtocolCurl::Disconnect() bool cIptvProtocolCurl::Disconnect()
{ {
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
if (!connectedM) if (!connectedM)
return true; return true;
@@ -463,20 +493,20 @@ bool cIptvProtocolCurl::Disconnect()
bool cIptvProtocolCurl::Open(void) bool cIptvProtocolCurl::Open(void)
{ {
debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
return Connect(); return Connect();
} }
bool cIptvProtocolCurl::Close(void) bool cIptvProtocolCurl::Close(void)
{ {
debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
Disconnect(); Disconnect();
return true; return true;
} }
int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP) int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
{ {
//debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug16("%s (, %u)", __PRETTY_FUNCTION__, bufferLenP);
int len = 0; int len = 0;
if (ringBufferM) { if (ringBufferM) {
// Fill up the buffer // Fill up the buffer
@@ -490,7 +520,7 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
// Remember the heart beat // Remember the heart beat
if (timeoutM.TimedOut()) { if (timeoutM.TimedOut()) {
debug("cIptvProtocolCurl::%s(): KeepAlive", __FUNCTION__); debug1("%s KeepAlive", __PRETTY_FUNCTION__);
cString uri = cString::sprintf("%s", *streamUrlM); cString uri = cString::sprintf("%s", *streamUrlM);
iptv_curl_easy_setopt(handleM, CURLOPT_RTSP_STREAM_URI, *uri); iptv_curl_easy_setopt(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
iptv_curl_easy_setopt(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS); iptv_curl_easy_setopt(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS);
@@ -522,8 +552,8 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
// Use 20% threshold before continuing to filling up the buffer. // Use 20% threshold before continuing to filling up the buffer.
mutexM.Lock(); 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__, debug1("%s Continue free=%d available=%d", __PRETTY_FUNCTION__,
ringBufferM->Free(), ringBufferM->Available()); ringBufferM->Free(), ringBufferM->Available());
pausedM = false; pausedM = false;
curl_easy_pause(handleM, CURLPAUSE_CONT); curl_easy_pause(handleM, CURLPAUSE_CONT);
@@ -537,7 +567,7 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
CURLMsg *msg = curl_multi_info_read(multiM, &msgcount); CURLMsg *msg = curl_multi_info_read(multiM, &msgcount);
mutexM.Unlock(); mutexM.Unlock();
if (msg && (msg->msg == CURLMSG_DONE)) { if (msg && (msg->msg == CURLMSG_DONE)) {
debug("cIptvProtocolCurl::%s(done): %s (%d)", __FUNCTION__, debug1("%s Done %s (%d)", __PRETTY_FUNCTION__,
curl_easy_strerror(msg->data.result), msg->data.result); curl_easy_strerror(msg->data.result), msg->data.result);
Disconnect(); Disconnect();
Connect(); Connect();
@@ -558,7 +588,7 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
len = min(len, (int)bufferLenP); len = min(len, (int)bufferLenP);
memcpy(bufferAddrP, p, len); memcpy(bufferAddrP, p, len);
DelData(len); DelData(len);
//debug("cIptvProtocolCurl::%s(): get %d bytes", __FUNCTION__, len); debug16("%s Get %d bytes", __PRETTY_FUNCTION__, len);
} }
} }
@@ -567,7 +597,7 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
bool cIptvProtocolCurl::SetSource(const char* locationP, const int parameterP, const int indexP) bool cIptvProtocolCurl::SetSource(const char* locationP, const int parameterP, const int indexP)
{ {
debug("cIptvProtocolCurl::%s(%s, %d, %d)", __FUNCTION__, locationP, parameterP, indexP); debug1("%s (%s, %d, %d)", __PRETTY_FUNCTION__, locationP, parameterP, indexP);
if (!isempty(locationP)) { if (!isempty(locationP)) {
// Disconnect // Disconnect
Disconnect(); Disconnect();
@@ -584,7 +614,7 @@ bool cIptvProtocolCurl::SetSource(const char* locationP, const int parameterP, c
modeM = eModeFile; modeM = eModeFile;
else else
modeM = eModeUnknown; modeM = eModeUnknown;
debug("cIptvProtocolCurl::%s(): %s (%d)", __FUNCTION__, *protocol, modeM); debug1("%s (%s, %d, %d) protocol=%s mode=%d", __PRETTY_FUNCTION__, locationP, parameterP, indexP, *protocol, modeM);
// Update stream parameter - force UDP mode for RTSP // Update stream parameter - force UDP mode for RTSP
streamParamM = (modeM == eModeRtsp) ? 0 : parameterP; streamParamM = (modeM == eModeRtsp) ? 0 : parameterP;
// Update listen port // Update listen port
@@ -597,12 +627,12 @@ bool cIptvProtocolCurl::SetSource(const char* locationP, const int parameterP, c
bool cIptvProtocolCurl::SetPid(int pidP, int typeP, bool onP) bool cIptvProtocolCurl::SetPid(int pidP, int typeP, bool onP)
{ {
//debug("cIptvProtocolCurl::%s(%d, %d, %d)", __FUNCTION__, pidP, typeP, onP); debug16("%s (%d, %d, %d)", __PRETTY_FUNCTION__, pidP, typeP, onP);
return true; return true;
} }
cString cIptvProtocolCurl::GetInformation(void) cString cIptvProtocolCurl::GetInformation(void)
{ {
//debug("cIptvProtocolCurl::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
return cString::sprintf("%s [%d]", *streamUrlM, streamParamM); return cString::sprintf("%s [%d]", *streamUrlM, streamParamM);
} }

View File

@@ -30,10 +30,13 @@ private:
}; };
enum { enum {
eConnectTimeoutS = 5, // in seconds eConnectTimeoutS = 5, // in seconds
eLowSpeedTimeoutS = 3, // in seconds
eLowSpeedLimitBytes = 100, // in bytes per second
eMaxDownloadSpeedMBits = 20, // in megabits per second eMaxDownloadSpeedMBits = 20, // in megabits per second
eKeepAliveIntervalMs = 300000 // in milliseconds eKeepAliveIntervalMs = 300000 // in milliseconds
}; };
static int DebugCallback(CURL *handleP, curl_infotype typeP, char *dataP, size_t sizeP, void *userPtrP);
static size_t WriteCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP); static size_t WriteCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);
static size_t WriteRtspCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP); static size_t WriteRtspCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);
static size_t DescribeCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP); static size_t DescribeCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);

View File

@@ -17,6 +17,7 @@
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#include "log.h"
#include "protocolext.h" #include "protocolext.h"
#ifndef EXTSHELL #ifndef EXTSHELL
@@ -29,19 +30,19 @@ cIptvProtocolExt::cIptvProtocolExt()
scriptParameterM(0), scriptParameterM(0),
streamPortM(0) streamPortM(0)
{ {
debug("cIptvProtocolExt::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvProtocolExt::~cIptvProtocolExt() cIptvProtocolExt::~cIptvProtocolExt()
{ {
debug("cIptvProtocolExt::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Drop the socket connection // Drop the socket connection
cIptvProtocolExt::Close(); cIptvProtocolExt::Close();
} }
void cIptvProtocolExt::ExecuteScript(void) void cIptvProtocolExt::ExecuteScript(void)
{ {
debug("cIptvProtocolExt::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Check if already executing // Check if already executing
if (isActiveM || isempty(scriptFileM)) if (isActiveM || isempty(scriptFileM))
return; return;
@@ -59,7 +60,7 @@ void cIptvProtocolExt::ExecuteScript(void)
close(i); close(i);
// Execute the external script // Execute the external script
cString cmd = cString::sprintf("%s %d %d", *scriptFileM, scriptParameterM, streamPortM); cString cmd = cString::sprintf("%s %d %d", *scriptFileM, scriptParameterM, streamPortM);
debug("cIptvProtocolExt::%s(child): %s", __FUNCTION__, *cmd); debug1("%s Child %s", __PRETTY_FUNCTION__, *cmd);
// Create a new session for a process group // Create a new session for a process group
ERROR_IF_RET(setsid() == -1, "setsid()", _exit(-1)); ERROR_IF_RET(setsid() == -1, "setsid()", _exit(-1));
if (execl(EXTSHELL, "sh", "-c", *cmd, (char *)NULL) == -1) { if (execl(EXTSHELL, "sh", "-c", *cmd, (char *)NULL) == -1) {
@@ -69,13 +70,13 @@ void cIptvProtocolExt::ExecuteScript(void)
_exit(0); _exit(0);
} }
else { else {
debug("cIptvProtocolExt::%s(): pid=%d", __FUNCTION__, pidM); debug1("%s pid=%d", __PRETTY_FUNCTION__, pidM);
} }
} }
void cIptvProtocolExt::TerminateScript(void) void cIptvProtocolExt::TerminateScript(void)
{ {
debug("cIptvProtocolExt::%s(): pid=%d", __FUNCTION__, pidM); debug1("%s pid=%d", __PRETTY_FUNCTION__, pidM);
if (!isActiveM || isempty(scriptFileM)) if (!isActiveM || isempty(scriptFileM))
return; return;
if (pidM > 0) { if (pidM > 0) {
@@ -111,7 +112,7 @@ void cIptvProtocolExt::TerminateScript(void)
if (!retval && waitStatus.si_pid && (waitStatus.si_pid == pidM) && if (!retval && waitStatus.si_pid && (waitStatus.si_pid == pidM) &&
((waitStatus.si_code == CLD_EXITED) || (waitStatus.si_code == CLD_KILLED))) { ((waitStatus.si_code == CLD_EXITED) || (waitStatus.si_code == CLD_KILLED))) {
#endif // __FreeBSD__ #endif // __FreeBSD__
debug("cIptvProtocolExt::%s(): child (%d) exited as expected", __FUNCTION__, pidM); debug1("%s Child (%d) exited as expected", __PRETTY_FUNCTION__, pidM);
waitOver = true; waitOver = true;
} }
// Unsuccessful wait, avoid busy looping // Unsuccessful wait, avoid busy looping
@@ -124,7 +125,7 @@ void cIptvProtocolExt::TerminateScript(void)
bool cIptvProtocolExt::Open(void) bool cIptvProtocolExt::Open(void)
{ {
debug("cIptvProtocolExt::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Reject empty script files // Reject empty script files
if (!strlen(*scriptFileM)) if (!strlen(*scriptFileM))
return false; return false;
@@ -138,7 +139,7 @@ bool cIptvProtocolExt::Open(void)
bool cIptvProtocolExt::Close(void) bool cIptvProtocolExt::Close(void)
{ {
debug("cIptvProtocolExt::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Terminate the external script // Terminate the external script
TerminateScript(); TerminateScript();
isActiveM = false; isActiveM = false;
@@ -154,11 +155,11 @@ int cIptvProtocolExt::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
bool cIptvProtocolExt::SetSource(const char* locationP, const int parameterP, const int indexP) bool cIptvProtocolExt::SetSource(const char* locationP, const int parameterP, const int indexP)
{ {
debug("cIptvProtocolExt::%s(%s, %d, %d)", __FUNCTION__, locationP, parameterP, indexP); debug1("%s (%s, %d, %d)", __PRETTY_FUNCTION__, locationP, parameterP, indexP);
if (!isempty(locationP)) { if (!isempty(locationP)) {
struct stat stbuf; struct stat stbuf;
// Update script file and parameter // 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)) { if ((stat(*scriptFileM, &stbuf) != 0) || (strstr(*scriptFileM, "..") != 0)) {
error("Non-existent or relative path script '%s'", *scriptFileM); error("Non-existent or relative path script '%s'", *scriptFileM);
return false; return false;
@@ -172,12 +173,12 @@ bool cIptvProtocolExt::SetSource(const char* locationP, const int parameterP, co
bool cIptvProtocolExt::SetPid(int pidP, int typeP, bool onP) bool cIptvProtocolExt::SetPid(int pidP, int typeP, bool onP)
{ {
//debug("cIptvProtocolExt::%s(%d, %d, %d)", __FUNCTION__, pidP, typeP, onP); debug16("%s (%d, %d, %d)", __PRETTY_FUNCTION__, pidP, typeP, onP);
return true; return true;
} }
cString cIptvProtocolExt::GetInformation(void) cString cIptvProtocolExt::GetInformation(void)
{ {
//debug("cIptvProtocolExt::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
return cString::sprintf("ext://%s:%d", *scriptFileM, scriptParameterM); return cString::sprintf("ext://%s:%d", *scriptFileM, scriptParameterM);
} }

View File

@@ -12,6 +12,7 @@
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#include "log.h"
#include "protocolfile.h" #include "protocolfile.h"
cIptvProtocolFile::cIptvProtocolFile() cIptvProtocolFile::cIptvProtocolFile()
@@ -20,12 +21,12 @@ cIptvProtocolFile::cIptvProtocolFile()
fileStreamM(NULL), fileStreamM(NULL),
isActiveM(false) isActiveM(false)
{ {
debug("cIptvProtocolFile::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvProtocolFile::~cIptvProtocolFile() cIptvProtocolFile::~cIptvProtocolFile()
{ {
debug("cIptvProtocolFile::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Drop open handles // Drop open handles
cIptvProtocolFile::Close(); cIptvProtocolFile::Close();
// Free allocated memory // Free allocated memory
@@ -34,7 +35,7 @@ cIptvProtocolFile::~cIptvProtocolFile()
bool cIptvProtocolFile::OpenFile(void) bool cIptvProtocolFile::OpenFile(void)
{ {
debug("cIptvProtocolFile::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Check that stream address is valid // Check that stream address is valid
if (!isActiveM && !isempty(fileLocationM)) { if (!isActiveM && !isempty(fileLocationM)) {
fileStreamM = fopen(fileLocationM, "rb"); fileStreamM = fopen(fileLocationM, "rb");
@@ -47,7 +48,7 @@ bool cIptvProtocolFile::OpenFile(void)
void cIptvProtocolFile::CloseFile(void) void cIptvProtocolFile::CloseFile(void)
{ {
debug("cIptvProtocolFile::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Check that file stream is valid // Check that file stream is valid
if (isActiveM && !isempty(fileLocationM)) { if (isActiveM && !isempty(fileLocationM)) {
fclose(fileStreamM); fclose(fileStreamM);
@@ -58,10 +59,10 @@ void cIptvProtocolFile::CloseFile(void)
int cIptvProtocolFile::Read(unsigned char* bufferAddrP, unsigned int bufferLenP) int cIptvProtocolFile::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
{ {
//debug("cIptvProtocolFile::%s()", __FUNCTION__); debug16("%s (, %u)", __PRETTY_FUNCTION__, bufferLenP);
// Check errors // Check errors
if (!fileStreamM || ferror(fileStreamM)) { if (!fileStreamM || ferror(fileStreamM)) {
debug("cIptvProtocolFile::%s(): stream error", __FUNCTION__); debug1("%s (, %d) Stream error", __PRETTY_FUNCTION__, bufferLenP);
return -1; return -1;
} }
// Rewind if EOF // Rewind if EOF
@@ -81,7 +82,7 @@ int cIptvProtocolFile::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
bool cIptvProtocolFile::Open(void) bool cIptvProtocolFile::Open(void)
{ {
debug("cIptvProtocolFile::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Open the file stream // Open the file stream
OpenFile(); OpenFile();
return true; return true;
@@ -89,7 +90,7 @@ bool cIptvProtocolFile::Open(void)
bool cIptvProtocolFile::Close(void) bool cIptvProtocolFile::Close(void)
{ {
debug("cIptvProtocolFile::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Close the file stream // Close the file stream
CloseFile(); CloseFile();
return true; return true;
@@ -97,7 +98,7 @@ bool cIptvProtocolFile::Close(void)
bool cIptvProtocolFile::SetSource(const char* locationP, const int parameterP, const int indexP) bool cIptvProtocolFile::SetSource(const char* locationP, const int parameterP, const int indexP)
{ {
debug("cIptvProtocolFile::%s(%s, %d, %d)", __FUNCTION__, locationP, parameterP, indexP); debug1("%s (%s, %d, %d)", __PRETTY_FUNCTION__, locationP, parameterP, indexP);
if (!isempty(locationP)) { if (!isempty(locationP)) {
// Close the file stream // Close the file stream
CloseFile(); CloseFile();
@@ -112,12 +113,12 @@ bool cIptvProtocolFile::SetSource(const char* locationP, const int parameterP, c
bool cIptvProtocolFile::SetPid(int pidP, int typeP, bool onP) bool cIptvProtocolFile::SetPid(int pidP, int typeP, bool onP)
{ {
//debug("cIptvProtocolFile::%s(%d, %d, %d)", __FUNCTION__, pidP, typeP, onP); debug16("%s (%d, %d, %d)", __PRETTY_FUNCTION__, pidP, typeP, onP);
return true; return true;
} }
cString cIptvProtocolFile::GetInformation(void) cString cIptvProtocolFile::GetInformation(void)
{ {
//debug("cIptvProtocolFile::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
return cString::sprintf("file://%s:%d", fileLocationM, fileDelayM); return cString::sprintf("file://%s:%d", fileLocationM, fileDelayM);
} }

View File

@@ -16,6 +16,7 @@
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#include "log.h"
#include "protocolhttp.h" #include "protocolhttp.h"
cIptvProtocolHttp::cIptvProtocolHttp() cIptvProtocolHttp::cIptvProtocolHttp()
@@ -23,12 +24,12 @@ cIptvProtocolHttp::cIptvProtocolHttp()
streamPathM(strdup("/")), streamPathM(strdup("/")),
streamPortM(0) streamPortM(0)
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvProtocolHttp::~cIptvProtocolHttp() cIptvProtocolHttp::~cIptvProtocolHttp()
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Close the socket // Close the socket
cIptvProtocolHttp::Close(); cIptvProtocolHttp::Close();
// Free allocated memory // Free allocated memory
@@ -38,7 +39,7 @@ cIptvProtocolHttp::~cIptvProtocolHttp()
bool cIptvProtocolHttp::Connect(void) bool cIptvProtocolHttp::Connect(void)
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Check that stream address is valid // Check that stream address is valid
if (!isActiveM && !isempty(streamAddrM) && !isempty(streamPathM)) { if (!isActiveM && !isempty(streamAddrM) && !isempty(streamPathM)) {
// Ensure that socket is valid and connect // Ensure that socket is valid and connect
@@ -56,7 +57,7 @@ bool cIptvProtocolHttp::Connect(void)
"\r\n", streamPathM, streamAddrM, "\r\n", streamPathM, streamAddrM,
PLUGIN_NAME_I18N, VERSION); PLUGIN_NAME_I18N, VERSION);
unsigned int len = strlen(*buffer); unsigned int len = strlen(*buffer);
debug("cIptvProtocolHttp::%s(): requesting %d: %s", __FUNCTION__, len, *buffer); debug1("%s Requesting %d: %s", __PRETTY_FUNCTION__, len, *buffer);
if (!Write(*buffer, len)) { if (!Write(*buffer, len)) {
CloseSocket(); CloseSocket();
return false; return false;
@@ -74,7 +75,7 @@ bool cIptvProtocolHttp::Connect(void)
bool cIptvProtocolHttp::Disconnect(void) bool cIptvProtocolHttp::Disconnect(void)
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
if (isActiveM) { if (isActiveM) {
// Close the socket // Close the socket
CloseSocket(); CloseSocket();
@@ -87,7 +88,7 @@ bool cIptvProtocolHttp::Disconnect(void)
bool cIptvProtocolHttp::GetHeaderLine(char* destP, unsigned int destLenP, bool cIptvProtocolHttp::GetHeaderLine(char* destP, unsigned int destLenP,
unsigned int &recvLenP) unsigned int &recvLenP)
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s (, %u, )", __PRETTY_FUNCTION__, destLenP);
bool linefeed = false; bool linefeed = false;
bool newline = false; bool newline = false;
char *bufptr = destP; char *bufptr = destP;
@@ -128,7 +129,7 @@ bool cIptvProtocolHttp::GetHeaderLine(char* destP, unsigned int destLenP,
bool cIptvProtocolHttp::ProcessHeaders(void) bool cIptvProtocolHttp::ProcessHeaders(void)
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
unsigned int lineLength = 0; unsigned int lineLength = 0;
int version = 0, response = 0; int version = 0, response = 0;
bool responseFound = false; bool responseFound = false;
@@ -159,14 +160,14 @@ bool cIptvProtocolHttp::ProcessHeaders(void)
bool cIptvProtocolHttp::Open(void) bool cIptvProtocolHttp::Open(void)
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Connect the socket // Connect the socket
return Connect(); return Connect();
} }
bool cIptvProtocolHttp::Close(void) bool cIptvProtocolHttp::Close(void)
{ {
debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Disconnect the current stream // Disconnect the current stream
Disconnect(); Disconnect();
return true; return true;
@@ -179,7 +180,7 @@ int cIptvProtocolHttp::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
bool cIptvProtocolHttp::SetSource(const char* locationP, const int parameterP, const int indexP) bool cIptvProtocolHttp::SetSource(const char* locationP, const int parameterP, const int indexP)
{ {
debug("cIptvProtocolHttp::%s(%s, %d, %d)", __FUNCTION__, locationP, parameterP, indexP); debug1("%s (%s, %d, %d)", __PRETTY_FUNCTION__, locationP, parameterP, indexP);
if (!isempty(locationP)) { if (!isempty(locationP)) {
// Disconnect the current socket // Disconnect the current socket
Disconnect(); Disconnect();
@@ -201,12 +202,12 @@ bool cIptvProtocolHttp::SetSource(const char* locationP, const int parameterP, c
bool cIptvProtocolHttp::SetPid(int pidP, int typeP, bool onP) bool cIptvProtocolHttp::SetPid(int pidP, int typeP, bool onP)
{ {
//debug("cIptvProtocolHttp::%s(%d, %d, %d)", __FUNCTION__, pidP, typeP, onP); debug16("%s (%d, %d, %d)", __PRETTY_FUNCTION__, pidP, typeP, onP);
return true; return true;
} }
cString cIptvProtocolHttp::GetInformation(void) cString cIptvProtocolHttp::GetInformation(void)
{ {
//debug("cIptvProtocolHttp::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
return cString::sprintf("http://%s:%d%s", streamAddrM, streamPortM, streamPathM); return cString::sprintf("http://%s:%d%s", streamAddrM, streamPortM, streamPathM);
} }

View File

@@ -15,8 +15,9 @@
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#include "protocoludp.h" #include "log.h"
#include "socket.h" #include "socket.h"
#include "protocoludp.h"
cIptvProtocolUdp::cIptvProtocolUdp() cIptvProtocolUdp::cIptvProtocolUdp()
: isIGMPv3M(false), : isIGMPv3M(false),
@@ -24,12 +25,12 @@ cIptvProtocolUdp::cIptvProtocolUdp()
streamAddrM(strdup("")), streamAddrM(strdup("")),
streamPortM(0) streamPortM(0)
{ {
debug("cIptvProtocolUdp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvProtocolUdp::~cIptvProtocolUdp() cIptvProtocolUdp::~cIptvProtocolUdp()
{ {
debug("cIptvProtocolUdp::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Drop the multicast group and close the socket // Drop the multicast group and close the socket
cIptvProtocolUdp::Close(); cIptvProtocolUdp::Close();
// Free allocated memory // Free allocated memory
@@ -39,7 +40,7 @@ cIptvProtocolUdp::~cIptvProtocolUdp()
bool cIptvProtocolUdp::Open(void) bool cIptvProtocolUdp::Open(void)
{ {
debug("cIptvProtocolUdp::%s(%s)", __FUNCTION__, streamAddrM); debug1("%s streamAddr='%s'", __PRETTY_FUNCTION__, streamAddrM);
OpenSocket(streamPortM, streamAddrM, sourceAddrM, isIGMPv3M); OpenSocket(streamPortM, streamAddrM, sourceAddrM, isIGMPv3M);
if (!isempty(streamAddrM)) { if (!isempty(streamAddrM)) {
// Join a new multicast group // Join a new multicast group
@@ -50,7 +51,7 @@ bool cIptvProtocolUdp::Open(void)
bool cIptvProtocolUdp::Close(void) bool cIptvProtocolUdp::Close(void)
{ {
debug("cIptvProtocolUdp::%s(%s)", __FUNCTION__, streamAddrM); debug1("%s streamAddr='%s'", __PRETTY_FUNCTION__, streamAddrM);
if (!isempty(streamAddrM)) { if (!isempty(streamAddrM)) {
// Drop the multicast group // Drop the multicast group
OpenSocket(streamPortM, streamAddrM, sourceAddrM, isIGMPv3M); OpenSocket(streamPortM, streamAddrM, sourceAddrM, isIGMPv3M);
@@ -72,7 +73,7 @@ int cIptvProtocolUdp::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
bool cIptvProtocolUdp::SetSource(const char* locationP, const int parameterP, const int indexP) bool cIptvProtocolUdp::SetSource(const char* locationP, const int parameterP, const int indexP)
{ {
debug("cIptvProtocolUdp::%s(%s, %d, %d)", __FUNCTION__, locationP, parameterP, indexP); debug1("%s (%s, %d, %d)", __PRETTY_FUNCTION__, locationP, parameterP, indexP);
if (!isempty(locationP)) { if (!isempty(locationP)) {
// Drop the multicast group // Drop the multicast group
if (!isempty(streamAddrM)) { if (!isempty(streamAddrM)) {
@@ -105,13 +106,13 @@ bool cIptvProtocolUdp::SetSource(const char* locationP, const int parameterP, co
bool cIptvProtocolUdp::SetPid(int pidP, int typeP, bool onP) bool cIptvProtocolUdp::SetPid(int pidP, int typeP, bool onP)
{ {
//debug("cIptvProtocolUdp::%s(%d, %d, %d)", __FUNCTION__, pidP, typeP, onP); debug16("%s (%d, %d, %d)", __PRETTY_FUNCTION__, pidP, typeP, onP);
return true; return true;
} }
cString cIptvProtocolUdp::GetInformation(void) cString cIptvProtocolUdp::GetInformation(void)
{ {
//debug("cIptvProtocolUdp::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
if (isIGMPv3M) if (isIGMPv3M)
return cString::sprintf("udp://%s@%s:%d", sourceAddrM, streamAddrM, streamPortM); return cString::sprintf("udp://%s@%s:%d", sourceAddrM, streamAddrM, streamPortM);
return cString::sprintf("udp://%s:%d", streamAddrM, streamPortM); return cString::sprintf("udp://%s:%d", streamAddrM, streamPortM);

View File

@@ -6,6 +6,7 @@
*/ */
#include "config.h" #include "config.h"
#include "log.h"
#include "sectionfilter.h" #include "sectionfilter.h"
cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t tidP, uint8_t maskP) cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t tidP, uint8_t maskP)
@@ -17,9 +18,10 @@ cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t
secLenM(0), secLenM(0),
tsFeedpM(0), tsFeedpM(0),
pidM(pidP), pidM(pidP),
ringBufferM(new cRingBufferFrame(eDmxMaxSectionCount * eDmxMaxSectionSize)),
deviceIndexM(deviceIndexP) deviceIndexM(deviceIndexP)
{ {
//debug("cIptvSectionFilter::%s(%d, %d)", __FUNCTION__, deviceIndexM, pidM); debug16("%s (%d, %d)", __PRETTY_FUNCTION__, deviceIndexM, pidM);
int i; int i;
memset(secBufBaseM, 0, sizeof(secBufBaseM)); memset(secBufBaseM, 0, sizeof(secBufBaseM));
@@ -33,11 +35,11 @@ cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t
filterMaskM[0] = maskP; filterMaskM[0] = maskP;
// Invert the filter // Invert the filter
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) for (i = 0; i < eDmxMaxFilterSize; ++i)
filterValueM[i] ^= 0xFF; filterValueM[i] ^= 0xFF;
uint8_t mask, mode, doneq = 0; uint8_t mask, mode, doneq = 0;
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) { for (i = 0; i < eDmxMaxFilterSize; ++i) {
mode = filterModeM[i]; mode = filterModeM[i];
mask = filterMaskM[i]; mask = filterMaskM[i];
maskAndModeM[i] = (uint8_t)(mask & mode); maskAndModeM[i] = (uint8_t)(mask & mode);
@@ -48,7 +50,7 @@ cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t
// Create sockets // Create sockets
socketM[0] = socketM[1] = -1; 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]; char tmp[64];
error("Opening section filter sockets failed (device=%d pid=%d): %s", deviceIndexM, pidM, strerror_r(errno, tmp, sizeof(tmp))); error("Opening section filter sockets failed (device=%d pid=%d): %s", deviceIndexM, pidM, strerror_r(errno, tmp, sizeof(tmp)));
} }
@@ -60,7 +62,7 @@ cIptvSectionFilter::cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t
cIptvSectionFilter::~cIptvSectionFilter() cIptvSectionFilter::~cIptvSectionFilter()
{ {
//debug("cIptvSectionFilter::%s(%d, %d)", __FUNCTION__, deviceIndexM, pidM); debug16("%s (%d, %d)", __PRETTY_FUNCTION__, deviceIndexM, pidM);
int tmp = socketM[1]; int tmp = socketM[1];
socketM[1] = -1; socketM[1] = -1;
if (tmp >= 0) if (tmp >= 0)
@@ -70,6 +72,7 @@ cIptvSectionFilter::~cIptvSectionFilter()
if (tmp >= 0) if (tmp >= 0)
close(tmp); close(tmp);
secBufM = NULL; secBufM = NULL;
DELETENULL(ringBufferM);
} }
inline uint16_t cIptvSectionFilter::GetLength(const uint8_t *dataP) inline uint16_t cIptvSectionFilter::GetLength(const uint8_t *dataP)
@@ -89,7 +92,7 @@ int cIptvSectionFilter::Filter(void)
int i; int i;
uint8_t neq = 0; 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]); uint8_t calcxor = (uint8_t)(filterValueM[i] ^ secBufM[i]);
if (maskAndModeM[i] & calcxor) if (maskAndModeM[i] & calcxor)
return 0; return 0;
@@ -99,13 +102,8 @@ int cIptvSectionFilter::Filter(void)
if (doneqM && !neq) if (doneqM && !neq)
return 0; return 0;
// There is no data in the read socket, more can be written if (ringBufferM && (secLenM > 0))
if ((socketM[0] >= 0) && (socketM[1] >= 0) /*&& !select_single_desc(socketM[0], 0, false)*/) { ringBufferM->Put(new cFrame(secBufM, secLenM));
ssize_t len = write(socketM[1], secBufM, secLenM);
ERROR_IF(len < 0, "write()");
// Update statistics
AddSectionStatistic(len, 1);
}
} }
return 0; return 0;
} }
@@ -122,11 +120,11 @@ int cIptvSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
{ {
uint16_t limit, seclen, n; uint16_t limit, seclen, n;
if (tsFeedpM >= DMX_MAX_SECFEED_SIZE) if (tsFeedpM >= eDmxMaxSectionFeedSize)
return 0; return 0;
if (tsFeedpM + lenP > DMX_MAX_SECFEED_SIZE) if (tsFeedpM + lenP > eDmxMaxSectionFeedSize)
lenP = (uint8_t)(DMX_MAX_SECFEED_SIZE - tsFeedpM); lenP = (uint8_t)(eDmxMaxSectionFeedSize - tsFeedpM);
if (lenP <= 0) if (lenP <= 0)
return 0; return 0;
@@ -135,7 +133,7 @@ int cIptvSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
tsFeedpM = uint16_t(tsFeedpM + lenP); tsFeedpM = uint16_t(tsFeedpM + lenP);
limit = tsFeedpM; limit = tsFeedpM;
if (limit > DMX_MAX_SECFEED_SIZE) if (limit > eDmxMaxSectionFeedSize)
return -1; // internal error should never happen return -1; // internal error should never happen
// Always set secbuf // Always set secbuf
@@ -143,7 +141,7 @@ int cIptvSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
for (n = 0; secBufpM + 2 < limit; ++n) { for (n = 0; secBufpM + 2 < limit; ++n) {
seclen = GetLength(secBufM); seclen = GetLength(secBufM);
if ((seclen <= 0) || (seclen > DMX_MAX_SECTION_SIZE) || ((seclen + secBufpM) > limit)) if ((seclen <= 0) || (seclen > eDmxMaxSectionSize) || ((seclen + secBufpM) > limit))
return 0; return 0;
secLenM = seclen; secLenM = seclen;
if (pusiSeenM) if (pusiSeenM)
@@ -211,15 +209,35 @@ 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) 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(), mutexM(),
deviceIndexM(deviceIndexP), deviceIndexM(deviceIndexP)
processedM(false),
ringBufferM(new cRingBufferLinear(bufferLenP, TS_SIZE, false, *cString::sprintf("IPTV SECTION HANDLER %d", deviceIndexP)))
{ {
debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s (%d, %d) [device %d]", __PRETTY_FUNCTION__, deviceIndexP, bufferLenP, deviceIndexM);
// Initialize filter pointers // Initialize filter pointers
memset(filtersM, 0, sizeof(filtersM)); memset(filtersM, 0, sizeof(filtersM));
@@ -237,9 +255,10 @@ cIptvSectionFilterHandler::cIptvSectionFilterHandler(int deviceIndexP, unsigned
cIptvSectionFilterHandler::~cIptvSectionFilterHandler() cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
{ {
debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM); debug1("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
Stop(); // Stop thread
if (Running())
Cancel(3);
DELETE_POINTER(ringBufferM); DELETE_POINTER(ringBufferM);
// Destroy all filters // Destroy all filters
@@ -248,26 +267,28 @@ cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
Delete(i); 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) void cIptvSectionFilterHandler::Action(void)
{ {
debug("cIptvSectionFilterHandler::%s(%d): entering", __FUNCTION__, deviceIndexM); debug1("%s Entering [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
bool processed = false;
// Do the thread loop // Do the thread loop
while (Running()) { 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 // Read one TS packet
if (ringBufferM) { if (ringBufferM) {
int len = 0; int len = 0;
if (processedM) { if (processed) {
ringBufferM->Del(TS_SIZE); ringBufferM->Del(TS_SIZE);
processedM = false; processed = false;
} }
uchar *p = ringBufferM->Get(len); uchar *p = ringBufferM->Get(len);
if (p && (len >= TS_SIZE)) { if (p && (len >= TS_SIZE)) {
@@ -279,7 +300,7 @@ void cIptvSectionFilterHandler::Action(void)
} }
} }
ringBufferM->Del(len); ringBufferM->Del(len);
debug("cIptvSectionFilterHandler::%s(%d): Skipped %d bytes to sync on TS packet", __FUNCTION__, deviceIndexM, len); debug1("%s Skipped %d bytes to sync on TS packet [device %d]]", __PRETTY_FUNCTION__, len, deviceIndexM);
continue; continue;
} }
// Process TS packet through all filters // Process TS packet through all filters
@@ -289,18 +310,18 @@ void cIptvSectionFilterHandler::Action(void)
filtersM[i]->Process(p); filtersM[i]->Process(p);
} }
mutexM.Unlock(); mutexM.Unlock();
processedM = true; processed = true;
continue; continue;
} }
} }
cCondWait::SleepMs(10); // to avoid busy loop and reduce cpu load cCondWait::SleepMs(10); // to avoid busy loop and reduce cpu load
} }
debug("cIptvSectionFilterHandler::%s(%d): exiting", __FUNCTION__, deviceIndexM); debug1("%s Exiting [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
} }
cString cIptvSectionFilterHandler::GetInformation(void) cString cIptvSectionFilterHandler::GetInformation(void)
{ {
//debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
// loop through active section filters // loop through active section filters
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
cString s = ""; cString s = "";
@@ -319,9 +340,9 @@ cString cIptvSectionFilterHandler::GetInformation(void)
bool cIptvSectionFilterHandler::Delete(unsigned int indexP) bool cIptvSectionFilterHandler::Delete(unsigned int indexP)
{ {
//debug("cIptvSectionFilterHandler::%s(%d): index=%d", __FUNCTION__, deviceIndexM, indexP); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, indexP, deviceIndexM);
if ((indexP < eMaxSecFilterCount) && filtersM[indexP]) { if ((indexP < eMaxSecFilterCount) && filtersM[indexP]) {
//debug("cIptvSectionFilterHandler::%s(%d): found %d", __FUNCTION__, deviceIndexM, indexP); debug16("%s (%d) Found [device %d]", __PRETTY_FUNCTION__, indexP, deviceIndexM);
cIptvSectionFilter *tmp = filtersM[indexP]; cIptvSectionFilter *tmp = filtersM[indexP];
filtersM[indexP] = NULL; filtersM[indexP] = NULL;
delete tmp; delete tmp;
@@ -332,7 +353,7 @@ bool cIptvSectionFilterHandler::Delete(unsigned int indexP)
bool cIptvSectionFilterHandler::IsBlackListed(u_short pidP, u_char tidP, u_char maskP) const bool cIptvSectionFilterHandler::IsBlackListed(u_short pidP, u_char tidP, u_char maskP) const
{ {
//debug("cIptvSectionFilterHandler::%s(%d): pid=%d tid=%02X mask=%02X", __FUNCTION__, deviceIndexM, pidP, tidP, maskP); debug16("%s (%d, %02X, %02X) [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, deviceIndexM);
// loop through section filter table // loop through section filter table
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) { for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) {
int index = IptvConfig.GetDisabledFilters(i); int index = IptvConfig.GetDisabledFilters(i);
@@ -340,7 +361,7 @@ bool cIptvSectionFilterHandler::IsBlackListed(u_short pidP, u_char tidP, u_char
if ((index >= 0) && (index < SECTION_FILTER_TABLE_SIZE) && if ((index >= 0) && (index < SECTION_FILTER_TABLE_SIZE) &&
(section_filter_table[index].pid == pidP) && (section_filter_table[index].tid == tidP) && (section_filter_table[index].pid == pidP) && (section_filter_table[index].tid == tidP) &&
(section_filter_table[index].mask == maskP)) { (section_filter_table[index].mask == maskP)) {
//debug("cIptvSectionFilterHandler::%s(%d): found %s", __FUNCTION__, deviceIndexM, section_filter_table[index].description); debug16("%s (%d, %02X, %02X) Found %s [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, section_filter_table[index].description, deviceIndexM);
return true; return true;
} }
} }
@@ -358,7 +379,7 @@ int cIptvSectionFilterHandler::Open(u_short pidP, u_char tidP, u_char maskP)
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) { for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
if (!filtersM[i]) { if (!filtersM[i]) {
filtersM[i] = new cIptvSectionFilter(deviceIndexM, pidP, tidP, maskP); 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); debug16("%s (%d, %02X, %02X) handle=%d index=%u [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, filtersM[i]->GetFd(), i, deviceIndexM);
return filtersM[i]->GetFd(); return filtersM[i]->GetFd();
} }
} }
@@ -373,7 +394,7 @@ void cIptvSectionFilterHandler::Close(int handleP)
// Search the filter for deletion // Search the filter for deletion
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) { for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
if (filtersM[i] && (handleP == filtersM[i]->GetFd())) { if (filtersM[i] && (handleP == filtersM[i]->GetFd())) {
debug("cIptvSectionFilterHandler::%s(%d): pid=%d handle=%d index=%d", __FUNCTION__, deviceIndexM, filtersM[i]->GetPid(), filtersM[i]->GetFd(), i); debug1("%s (%d) pid=%d handle=%d index=%d [device %d]", __PRETTY_FUNCTION__, handleP, filtersM[i]->GetPid(), filtersM[i]->GetFd(), i, deviceIndexM);
Delete(i); Delete(i);
break; break;
} }
@@ -387,7 +408,7 @@ int cIptvSectionFilterHandler::GetPid(int handleP)
// Search the filter for data // Search the filter for data
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) { for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
if (filtersM[i] && (handleP == filtersM[i]->GetFd())) { if (filtersM[i] && (handleP == filtersM[i]->GetFd())) {
debug("cIptvSectionFilterHandler::%s(%d): pid=%d handle=%d index=%d", __FUNCTION__, deviceIndexM, filtersM[i]->GetPid(), filtersM[i]->GetFd(), i); debug1("%s (%d) pid=%d handle=%d index=%d [device %d]", __PRETTY_FUNCTION__, handleP, filtersM[i]->GetPid(), filtersM[i]->GetFd(), i, deviceIndexM);
return filtersM[i]->GetPid(); return filtersM[i]->GetPid();
} }
} }
@@ -396,7 +417,7 @@ int cIptvSectionFilterHandler::GetPid(int handleP)
void cIptvSectionFilterHandler::Write(uchar *bufferP, int lengthP) void cIptvSectionFilterHandler::Write(uchar *bufferP, int lengthP)
{ {
//debug("cIptvSectionFilterHandler::%s(%d): length=%d", __FUNCTION__, deviceIndexM, lengthP); debug16("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIndexM);
// Fill up the buffer // Fill up the buffer
if (ringBufferM) { if (ringBufferM) {
int len = ringBufferM->Put(bufferP, lengthP); int len = ringBufferM->Put(bufferP, lengthP);

View File

@@ -18,10 +18,11 @@
class cIptvSectionFilter : public cIptvSectionStatistics { class cIptvSectionFilter : public cIptvSectionStatistics {
private: private:
enum dmx_limits { enum {
DMX_MAX_FILTER_SIZE = 18, eDmxMaxFilterSize = 18,
DMX_MAX_SECTION_SIZE = 4096, eDmxMaxSectionCount = 64,
DMX_MAX_SECFEED_SIZE = (DMX_MAX_SECTION_SIZE + TS_SIZE) eDmxMaxSectionSize = 4096,
eDmxMaxSectionFeedSize = (eDmxMaxSectionSize + TS_SIZE)
}; };
int pusiSeenM; int pusiSeenM;
@@ -29,21 +30,22 @@ private:
int doneqM; int doneqM;
uint8_t *secBufM; uint8_t *secBufM;
uint8_t secBufBaseM[DMX_MAX_SECFEED_SIZE]; uint8_t secBufBaseM[eDmxMaxSectionFeedSize];
uint16_t secBufpM; uint16_t secBufpM;
uint16_t secLenM; uint16_t secLenM;
uint16_t tsFeedpM; uint16_t tsFeedpM;
uint16_t pidM; uint16_t pidM;
cRingBufferFrame *ringBufferM;
int deviceIndexM; int deviceIndexM;
int socketM[2]; int socketM[2];
uint8_t filterValueM[DMX_MAX_FILTER_SIZE]; uint8_t filterValueM[eDmxMaxFilterSize];
uint8_t filterMaskM[DMX_MAX_FILTER_SIZE]; uint8_t filterMaskM[eDmxMaxFilterSize];
uint8_t filterModeM[DMX_MAX_FILTER_SIZE]; uint8_t filterModeM[eDmxMaxFilterSize];
uint8_t maskAndModeM[DMX_MAX_FILTER_SIZE]; uint8_t maskAndModeM[eDmxMaxFilterSize];
uint8_t maskAndNotModeM[DMX_MAX_FILTER_SIZE]; uint8_t maskAndNotModeM[eDmxMaxFilterSize];
inline uint16_t GetLength(const uint8_t *dataP); inline uint16_t GetLength(const uint8_t *dataP);
void New(void); void New(void);
@@ -56,6 +58,7 @@ public:
cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t tidP, uint8_t maskP); cIptvSectionFilter(int deviceIndexP, uint16_t pidP, uint8_t tidP, uint8_t maskP);
virtual ~cIptvSectionFilter(); virtual ~cIptvSectionFilter();
void Process(const uint8_t* dataP); void Process(const uint8_t* dataP);
bool Send(void);
int GetFd(void) { return socketM[0]; } int GetFd(void) { return socketM[0]; }
uint16_t GetPid(void) const { return pidM; } uint16_t GetPid(void) const { return pidM; }
}; };
@@ -65,10 +68,9 @@ private:
enum { enum {
eMaxSecFilterCount = 32 eMaxSecFilterCount = 32
}; };
cRingBufferLinear *ringBufferM;
cMutex mutexM; cMutex mutexM;
int deviceIndexM; int deviceIndexM;
bool processedM;
cRingBufferLinear *ringBufferM;
cIptvSectionFilter *filtersM[eMaxSecFilterCount]; cIptvSectionFilter *filtersM[eMaxSecFilterCount];
bool Delete(unsigned int indexP); bool Delete(unsigned int indexP);
@@ -80,7 +82,6 @@ protected:
public: public:
cIptvSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP); cIptvSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP);
virtual ~cIptvSectionFilterHandler(); virtual ~cIptvSectionFilterHandler();
bool Stop(void);
cString GetInformation(void); cString GetInformation(void);
int Open(u_short pidP, u_char tidP, u_char maskP); int Open(u_short pidP, u_char tidP, u_char maskP);
void Close(int handleP); void Close(int handleP);

23
setup.c
View File

@@ -112,9 +112,7 @@ eOSState cIptvMenuInfo::ProcessKey(eKeys keyP)
cIptvPluginSetup::cIptvPluginSetup() cIptvPluginSetup::cIptvPluginSetup()
{ {
debug("cIptvPluginSetup::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
tsBufferSizeM = IptvConfig.GetTsBufferSize();
tsBufferPrefillM = IptvConfig.GetTsBufferPrefillRatio();
protocolBasePortM = IptvConfig.GetProtocolBasePort(); protocolBasePortM = IptvConfig.GetProtocolBasePort();
sectionFilteringM = IptvConfig.GetSectionFiltering(); sectionFilteringM = IptvConfig.GetSectionFiltering();
numDisabledFiltersM = IptvConfig.GetDisabledFiltersCount(); numDisabledFiltersM = IptvConfig.GetDisabledFiltersCount();
@@ -136,12 +134,6 @@ void cIptvPluginSetup::Setup(void)
Clear(); Clear();
helpM.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)); 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.")); 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."));
@@ -149,12 +141,11 @@ void cIptvPluginSetup::Setup(void)
helpM.Append(tr("Define whether the section filtering shall be used.\n\nSection filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\nEnabling this feature does not affect streams that do not contain section data.")); helpM.Append(tr("Define whether the section filtering shall be used.\n\nSection filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\nEnabling this feature does not affect streams that do not contain section data."));
if (sectionFilteringM) { if (sectionFilteringM) {
Add(new cMenuEditIntItem(tr("Disable filters"), &numDisabledFiltersM, 0, SECTION_FILTER_TABLE_SIZE)); Add(new cMenuEditIntItem(tr("Disabled filters"), &numDisabledFiltersM, 0, SECTION_FILTER_TABLE_SIZE));
helpM.Append(tr("Define number of section filters to be disabled.\n\nCertain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process.")); helpM.Append(tr("Define number of section filters to be disabled.\n\nCertain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."));
for (int i = 0; i < numDisabledFiltersM; ++i) { for (int i = 0; i < numDisabledFiltersM; ++i) {
// TRANSLATORS: note the singular! Add(new cMenuEditStraItem(*cString::sprintf(" %s %d", tr("Filter"), i + 1), &disabledFilterIndexesM[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNamesM));
Add(new cMenuEditStraItem(tr("Disable filter"), &disabledFilterIndexesM[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNamesM));
helpM.Append(tr("Define an ill-behaving filter to be blacklisted.")); helpM.Append(tr("Define an ill-behaving filter to be blacklisted."));
} }
} }
@@ -165,7 +156,7 @@ void cIptvPluginSetup::Setup(void)
eOSState cIptvPluginSetup::ShowInfo(void) eOSState cIptvPluginSetup::ShowInfo(void)
{ {
debug("cIptvPluginSetup::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
if (HasSubMenu()) if (HasSubMenu())
return osContinue; return osContinue;
return AddSubMenu(new cIptvMenuInfo()); return AddSubMenu(new cIptvMenuInfo());
@@ -210,21 +201,17 @@ void cIptvPluginSetup::StoreFilters(const char *nameP, int *valuesP)
q += strlen(s); q += strlen(s);
} }
*q = 0; *q = 0;
debug("cIptvPluginSetup::%s(%s, %s)", __FUNCTION__, nameP, buffer); debug1("%s (%s, %s)", __PRETTY_FUNCTION__, nameP, buffer);
SetupStore(nameP, buffer); SetupStore(nameP, buffer);
} }
void cIptvPluginSetup::Store(void) void cIptvPluginSetup::Store(void)
{ {
// Store values into setup.conf // Store values into setup.conf
SetupStore("TsBufferSize", tsBufferSizeM);
SetupStore("TsBufferPrefill", tsBufferPrefillM);
SetupStore("ExtProtocolBasePort", protocolBasePortM); SetupStore("ExtProtocolBasePort", protocolBasePortM);
SetupStore("SectionFiltering", sectionFilteringM); SetupStore("SectionFiltering", sectionFilteringM);
StoreFilters("DisabledFilters", disabledFilterIndexesM); StoreFilters("DisabledFilters", disabledFilterIndexesM);
// Update global config // Update global config
IptvConfig.SetTsBufferSize(tsBufferSizeM);
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefillM);
IptvConfig.SetProtocolBasePort(protocolBasePortM); IptvConfig.SetProtocolBasePort(protocolBasePortM);
IptvConfig.SetSectionFiltering(sectionFilteringM); IptvConfig.SetSectionFiltering(sectionFilteringM);
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)

View File

@@ -15,8 +15,6 @@
class cIptvPluginSetup : public cMenuSetupPage class cIptvPluginSetup : public cMenuSetupPage
{ {
private: private:
int tsBufferSizeM;
int tsBufferPrefillM;
int protocolBasePortM; int protocolBasePortM;
int sectionFilteringM; int sectionFilteringM;
int numDisabledFiltersM; int numDisabledFiltersM;

View File

@@ -17,19 +17,19 @@ cSidScanner::cSidScanner(void)
tidFoundM(false), tidFoundM(false),
isActiveM(false) isActiveM(false)
{ {
debug("cSidScanner::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
Set(0x00, 0x00); // PAT Set(0x00, 0x00); // PAT
Set(0x10, 0x40); // NIT Set(0x10, 0x40); // NIT
} }
cSidScanner::~cSidScanner() cSidScanner::~cSidScanner()
{ {
debug("cSidScanner::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
void cSidScanner::SetChannel(const tChannelID &channelIdP) void cSidScanner::SetChannel(const tChannelID &channelIdP)
{ {
debug("cSidScanner::%s(%s)", __FUNCTION__, *channelIdP.ToString()); debug1("%s (%s)", __PRETTY_FUNCTION__, *channelIdP.ToString());
channelIdM = channelIdP; channelIdM = channelIdP;
sidFoundM = false; sidFoundM = false;
nidFoundM = false; nidFoundM = false;
@@ -40,12 +40,12 @@ void cSidScanner::Process(u_short pidP, u_char tidP, const u_char *dataP, int le
{ {
int newSid = -1, newNid = -1, newTid = -1; int newSid = -1, newNid = -1, newTid = -1;
//debug("cSidScanner::%s()", __FUNCTION__); debug16("%s (%d, %02X, , %d)", __PRETTY_FUNCTION__, pidP, tidP, lengthP);
if (!isActiveM) if (!isActiveM)
return; return;
if (channelIdM.Valid()) { if (channelIdM.Valid()) {
if ((pidP == 0x00) && (tidP == 0x00)) { if ((pidP == 0x00) && (tidP == 0x00)) {
//debug("cSidScanner::%s(%d, %02X)", __FUNCTION__, pidP, tidP); debug16("%s (%d, %02X, , %d) pat", __PRETTY_FUNCTION__, pidP, tidP, lengthP);
SI::PAT pat(dataP, false); SI::PAT pat(dataP, false);
if (!pat.CheckCRCAndParse()) if (!pat.CheckCRCAndParse())
return; return;
@@ -53,7 +53,7 @@ void cSidScanner::Process(u_short pidP, u_char tidP, const u_char *dataP, int le
for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) { for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) {
if (!assoc.isNITPid()) { if (!assoc.isNITPid()) {
if (assoc.getServiceId() != channelIdM.Sid()) { if (assoc.getServiceId() != channelIdM.Sid()) {
debug("cSidScanner::%s(): sid=%d", __FUNCTION__, assoc.getServiceId()); debug1("%s (%d, %02X, , %d) sid=%d", __PRETTY_FUNCTION__, pidP, tidP, lengthP, assoc.getServiceId());
newSid = assoc.getServiceId(); newSid = assoc.getServiceId();
} }
sidFoundM = true; sidFoundM = true;
@@ -62,19 +62,19 @@ void cSidScanner::Process(u_short pidP, u_char tidP, const u_char *dataP, int le
} }
} }
else if ((pidP == 0x10) && (tidP == 0x40)) { else if ((pidP == 0x10) && (tidP == 0x40)) {
debug("cSidScanner::%s(%d, %02X)", __FUNCTION__, pidP, tidP); debug1("%s (%d, %02X, , %d)", __PRETTY_FUNCTION__, pidP, tidP, lengthP);
SI::NIT nit(dataP, false); SI::NIT nit(dataP, false);
if (!nit.CheckCRCAndParse()) if (!nit.CheckCRCAndParse())
return; return;
SI::NIT::TransportStream ts; SI::NIT::TransportStream ts;
for (SI::Loop::Iterator it; nit.transportStreamLoop.getNext(ts, it); ) { for (SI::Loop::Iterator it; nit.transportStreamLoop.getNext(ts, it); ) {
if (ts.getTransportStreamId() != channelIdM.Tid()) { if (ts.getTransportStreamId() != channelIdM.Tid()) {
debug("cSidScanner::%s(): tsid=%d", __FUNCTION__, ts.getTransportStreamId()); debug1("%s (%d, %02X, , %d) tsid=%d", __PRETTY_FUNCTION__, pidP, tidP, lengthP, ts.getTransportStreamId());
newTid = ts.getTransportStreamId(); newTid = ts.getTransportStreamId();
tidFoundM = true; tidFoundM = true;
} }
if (ts.getOriginalNetworkId() != channelIdM.Nid()) { if (ts.getOriginalNetworkId() != channelIdM.Nid()) {
debug("cSidScanner::%s(): onid=%d", __FUNCTION__, ts.getOriginalNetworkId()); debug1("%s (%d, %02X, , %d) onid=%d", __PRETTY_FUNCTION__, pidP, tidP, lengthP, ts.getOriginalNetworkId());
newNid = ts.getOriginalNetworkId(); newNid = ts.getOriginalNetworkId();
nidFoundM = true; nidFoundM = true;
} }
@@ -82,20 +82,24 @@ void cSidScanner::Process(u_short pidP, u_char tidP, const u_char *dataP, int le
} }
// fallback for network id if not found already // fallback for network id if not found already
if (!nidFoundM && (nit.getNetworkId() != channelIdM.Nid())) { if (!nidFoundM && (nit.getNetworkId() != channelIdM.Nid())) {
debug("cSidScanner::%s(): nid=%d", __FUNCTION__, nit.getNetworkId()); debug1("%s (%d, %02X, , %d) nid=%d", __PRETTY_FUNCTION__, pidP, tidP, lengthP, nit.getNetworkId());
newNid = nit.getNetworkId(); newNid = nit.getNetworkId();
nidFoundM = true; nidFoundM = true;
} }
} }
} }
if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) { if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) {
if (!Channels.Lock(true, 10)) cStateKey StateKey;
cChannels *Channels = cChannels::GetChannelsWrite(StateKey, 10);
if (!Channels)
return; return;
cChannel *IptvChannel = Channels.GetByChannelID(channelIdM); bool ChannelsModified = false;
cChannel *IptvChannel = Channels->GetByChannelID(channelIdM);
if (IptvChannel) if (IptvChannel)
IptvChannel->SetId((newNid < 0) ? IptvChannel->Nid() : newNid, (newTid < 0) ? IptvChannel->Tid() : newTid, ChannelsModified |= IptvChannel->SetId(Channels, (newNid < 0) ? IptvChannel->Nid() : newNid,
(newTid < 0) ? IptvChannel->Tid() : newTid,
(newSid < 0) ? IptvChannel->Sid() : newSid, IptvChannel->Rid()); (newSid < 0) ? IptvChannel->Sid() : newSid, IptvChannel->Rid());
Channels.Unlock(); StateKey.Remove(ChannelsModified);
} }
if (sidFoundM && nidFoundM && tidFoundM) { if (sidFoundM && nidFoundM && tidFoundM) {
SetChannel(tChannelID::InvalidID); SetChannel(tChannelID::InvalidID);

View File

@@ -11,6 +11,8 @@
#include <vdr/channels.h> #include <vdr/channels.h>
#include <vdr/filter.h> #include <vdr/filter.h>
#include "log.h"
class cSidScanner : public cFilter { class cSidScanner : public cFilter {
private: private:
tChannelID channelIdM; tChannelID channelIdM;
@@ -26,8 +28,8 @@ public:
cSidScanner(void); cSidScanner(void);
~cSidScanner(); ~cSidScanner();
void SetChannel(const tChannelID &channelIdP); void SetChannel(const tChannelID &channelIdP);
void Open() { debug("cSidScanner::%s()", __FUNCTION__); isActiveM = true; } void Open() { debug1("%s", __PRETTY_FUNCTION__); isActiveM = true; }
void Close() { debug("cSidScanner::%s()", __FUNCTION__); isActiveM = false; } void Close() { debug1("%s", __PRETTY_FUNCTION__); isActiveM = false; }
}; };
#endif // __SIDSCANNER_H #endif // __SIDSCANNER_H

View File

@@ -16,31 +16,35 @@
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#include "log.h"
#include "socket.h" #include "socket.h"
cIptvSocket::cIptvSocket() cIptvSocket::cIptvSocket()
: socketPortM(0), : socketPortM(0),
socketDescM(-1), socketDescM(-1),
lastErrorReportM(0),
packetErrorsM(0),
sequenceNumberM(-1),
isActiveM(false) isActiveM(false)
{ {
debug("cIptvSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
memset(&sockAddrM, 0, sizeof(sockAddrM)); memset(&sockAddrM, 0, sizeof(sockAddrM));
} }
cIptvSocket::~cIptvSocket() cIptvSocket::~cIptvSocket()
{ {
debug("cIptvSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Close the socket // Close the socket
CloseSocket(); CloseSocket();
} }
bool cIptvSocket::OpenSocket(const int portP, const bool isUdpP) bool cIptvSocket::OpenSocket(const int portP, const bool isUdpP)
{ {
debug("cIptvSocket::%s(%d, %d)", __FUNCTION__, portP, isUdpP); debug1("%s (%d, %d)", __PRETTY_FUNCTION__, portP, isUdpP);
// If socket is there already and it is bound to a different port, it must // If socket is there already and it is bound to a different port, it must
// be closed first // be closed first
if (portP != socketPortM) { if (portP != socketPortM) {
debug("cIptvSocket::%s(): socket tear-down", __FUNCTION__); debug1("%s (%d, %d) Socket tear-down", __PRETTY_FUNCTION__, portP, isUdpP);
CloseSocket(); CloseSocket();
} }
// Bind to the socket if it is not active already // Bind to the socket if it is not active already
@@ -79,7 +83,7 @@ bool cIptvSocket::OpenSocket(const int portP, const bool isUdpP)
void cIptvSocket::CloseSocket(void) void cIptvSocket::CloseSocket(void)
{ {
debug("cIptvSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Check if socket exists // Check if socket exists
if (socketDescM >= 0) { if (socketDescM >= 0) {
close(socketDescM); close(socketDescM);
@@ -87,6 +91,11 @@ void cIptvSocket::CloseSocket(void)
socketPortM = 0; socketPortM = 0;
memset(&sockAddrM, 0, sizeof(sockAddrM)); 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) bool cIptvSocket::CheckAddress(const char *addrP, in_addr_t *inAddrP)
@@ -95,7 +104,7 @@ bool cIptvSocket::CheckAddress(const char *addrP, in_addr_t *inAddrP)
// First try only the IP address // First try only the IP address
*inAddrP = inet_addr(addrP); *inAddrP = inet_addr(addrP);
if (*inAddrP == htonl(INADDR_NONE)) { if (*inAddrP == htonl(INADDR_NONE)) {
debug("cIptvSocket::%s(%s): cannot convert to address", __FUNCTION__, addrP); debug1("%s (%s, ) Cannot convert to address", __PRETTY_FUNCTION__, addrP);
// It may be a host name, get the name // It may be a host name, get the name
struct hostent *host = gethostbyname(addrP); struct hostent *host = gethostbyname(addrP);
if (!host) { if (!host) {
@@ -117,17 +126,17 @@ cIptvUdpSocket::cIptvUdpSocket()
sourceAddrM(htonl(INADDR_ANY)), sourceAddrM(htonl(INADDR_ANY)),
useIGMPv3M(false) useIGMPv3M(false)
{ {
debug("cIptvUdpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvUdpSocket::~cIptvUdpSocket() cIptvUdpSocket::~cIptvUdpSocket()
{ {
debug("cIptvUdpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
bool cIptvUdpSocket::OpenSocket(const int portP) bool cIptvUdpSocket::OpenSocket(const int portP)
{ {
debug("cIptvUdpSocket::%s()", __FUNCTION__); debug1("%s (%d)", __PRETTY_FUNCTION__, portP);
streamAddrM = htonl(INADDR_ANY); streamAddrM = htonl(INADDR_ANY);
sourceAddrM = htonl(INADDR_ANY); sourceAddrM = htonl(INADDR_ANY);
useIGMPv3M = false; useIGMPv3M = false;
@@ -136,7 +145,7 @@ bool cIptvUdpSocket::OpenSocket(const int portP)
bool cIptvUdpSocket::OpenSocket(const int portP, const char *streamAddrP, const char *sourceAddrP, bool useIGMPv3P) bool cIptvUdpSocket::OpenSocket(const int portP, const char *streamAddrP, const char *sourceAddrP, bool useIGMPv3P)
{ {
debug("cIptvUdpSocket::%s(%d, %s, %s, %d)", __FUNCTION__, portP, streamAddrP, sourceAddrP, useIGMPv3P); debug1("%s (%d, %s, %s, %d)", __PRETTY_FUNCTION__, portP, streamAddrP, sourceAddrP, useIGMPv3P);
CheckAddress(streamAddrP, &streamAddrM); CheckAddress(streamAddrP, &streamAddrM);
CheckAddress(sourceAddrP, &sourceAddrM); CheckAddress(sourceAddrP, &sourceAddrM);
useIGMPv3M = useIGMPv3P; useIGMPv3M = useIGMPv3P;
@@ -145,7 +154,7 @@ bool cIptvUdpSocket::OpenSocket(const int portP, const char *streamAddrP, const
void cIptvUdpSocket::CloseSocket(void) void cIptvUdpSocket::CloseSocket(void)
{ {
debug("cIptvUdpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
streamAddrM = htonl(INADDR_ANY); streamAddrM = htonl(INADDR_ANY);
sourceAddrM = htonl(INADDR_ANY); sourceAddrM = htonl(INADDR_ANY);
useIGMPv3M = false; useIGMPv3M = false;
@@ -154,7 +163,7 @@ void cIptvUdpSocket::CloseSocket(void)
bool cIptvUdpSocket::JoinMulticast(void) bool cIptvUdpSocket::JoinMulticast(void)
{ {
debug("cIptvUdpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Check if socket exists // Check if socket exists
if (!isActiveM && (socketDescM >= 0)) { if (!isActiveM && (socketDescM >= 0)) {
// Join a new multicast group // Join a new multicast group
@@ -188,7 +197,7 @@ bool cIptvUdpSocket::JoinMulticast(void)
bool cIptvUdpSocket::DropMulticast(void) bool cIptvUdpSocket::DropMulticast(void)
{ {
debug("cIptvUdpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Check if socket exists // Check if socket exists
if (isActiveM && (socketDescM >= 0)) { if (isActiveM && (socketDescM >= 0)) {
// Drop the existing multicast group // Drop the existing multicast group
@@ -223,10 +232,10 @@ bool cIptvUdpSocket::DropMulticast(void)
int cIptvUdpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP) int cIptvUdpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
{ {
//debug("cIptvUdpSocket::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Error out if socket not initialized // Error out if socket not initialized
if (socketDescM <= 0) { if (socketDescM <= 0) {
error("Invalid socket in cIptvUdpSocket::%s()", __FUNCTION__); error("%s Invalid socket", __PRETTY_FUNCTION__);
return -1; return -1;
} }
int len = 0; int len = 0;
@@ -274,6 +283,21 @@ int cIptvUdpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
unsigned int cc = bufferAddrP[0] & 0x0F; unsigned int cc = bufferAddrP[0] & 0x0F;
// Payload type: MPEG2 TS = 33 // Payload type: MPEG2 TS = 33
//unsigned int pt = bufferAddrP[1] & 0x7F; //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 // Header lenght
unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t); unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t);
// Check if extension // Check if extension
@@ -307,30 +331,30 @@ int cIptvUdpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
// TCP socket class // TCP socket class
cIptvTcpSocket::cIptvTcpSocket() cIptvTcpSocket::cIptvTcpSocket()
{ {
debug("cIptvTcpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvTcpSocket::~cIptvTcpSocket() cIptvTcpSocket::~cIptvTcpSocket()
{ {
debug("cIptvTcpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
bool cIptvTcpSocket::OpenSocket(const int portP, const char *streamAddrP) bool cIptvTcpSocket::OpenSocket(const int portP, const char *streamAddrP)
{ {
debug("cIptvTcpSocket::%s(%d, %s)", __FUNCTION__, portP, streamAddrP); debug1("%s (%d, %s)", __PRETTY_FUNCTION__, portP, streamAddrP);
// Socket must be opened before setting the host address // Socket must be opened before setting the host address
return (cIptvSocket::OpenSocket(portP, false) && CheckAddress(streamAddrP, &sockAddrM.sin_addr.s_addr)); return (cIptvSocket::OpenSocket(portP, false) && CheckAddress(streamAddrP, &sockAddrM.sin_addr.s_addr));
} }
void cIptvTcpSocket::CloseSocket(void) void cIptvTcpSocket::CloseSocket(void)
{ {
debug("cIptvTcpSocket::%s()", __FUNCTION__); debug1("%s()", __PRETTY_FUNCTION__);
cIptvSocket::CloseSocket(); cIptvSocket::CloseSocket();
} }
bool cIptvTcpSocket::ConnectSocket(void) bool cIptvTcpSocket::ConnectSocket(void)
{ {
debug("cIptvTcpSocket::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
if (!isActiveM && (socketDescM >= 0)) { if (!isActiveM && (socketDescM >= 0)) {
int retval = connect(socketDescM, (struct sockaddr *)&sockAddrM, sizeof(sockAddrM)); int retval = connect(socketDescM, (struct sockaddr *)&sockAddrM, sizeof(sockAddrM));
// Non-blocking sockets always report in-progress error when connected // Non-blocking sockets always report in-progress error when connected
@@ -356,10 +380,10 @@ bool cIptvTcpSocket::ConnectSocket(void)
int cIptvTcpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP) int cIptvTcpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
{ {
//debug("cIptvTcpSocket::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Error out if socket not initialized // Error out if socket not initialized
if (socketDescM <= 0) { if (socketDescM <= 0) {
error("Invalid socket in cIptvTcpSocket::%s()", __FUNCTION__); error("%s Invalid socket", __PRETTY_FUNCTION__);
return -1; return -1;
} }
int len = 0; int len = 0;
@@ -373,10 +397,10 @@ int cIptvTcpSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
bool cIptvTcpSocket::ReadChar(char *bufferAddrP, unsigned int timeoutMsP) bool cIptvTcpSocket::ReadChar(char *bufferAddrP, unsigned int timeoutMsP)
{ {
//debug("cIptvTcpSocket::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Error out if socket not initialized // Error out if socket not initialized
if (socketDescM <= 0) { if (socketDescM <= 0) {
error("Invalid socket in cIptvTcpSocket::%s()", __FUNCTION__); error("%s Invalid socket", __PRETTY_FUNCTION__);
return false; return false;
} }
socklen_t addrlen = sizeof(sockAddrM); socklen_t addrlen = sizeof(sockAddrM);
@@ -398,10 +422,10 @@ bool cIptvTcpSocket::ReadChar(char *bufferAddrP, unsigned int timeoutMsP)
bool cIptvTcpSocket::Write(const char *bufferAddrP, unsigned int bufferLenP) bool cIptvTcpSocket::Write(const char *bufferAddrP, unsigned int bufferLenP)
{ {
//debug("cIptvTcpSocket::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Error out if socket not initialized // Error out if socket not initialized
if (socketDescM <= 0) { if (socketDescM <= 0) {
error("Invalid socket in cIptvTcpSocket::%s()", __FUNCTION__); error("%s Invalid socket", __PRETTY_FUNCTION__);
return false; return false;
} }
ERROR_IF_RET(send(socketDescM, bufferAddrP, bufferLenP, 0) < 0, "send()", return false); ERROR_IF_RET(send(socketDescM, bufferAddrP, bufferLenP, 0) < 0, "send()", return false);

View File

@@ -18,8 +18,14 @@ private:
int socketPortM; int socketPortM;
protected: protected:
enum {
eReportIntervalS = 300 // in seconds
};
int socketDescM; int socketDescM;
struct sockaddr_in sockAddrM; struct sockaddr_in sockAddrM;
time_t lastErrorReportM;
int packetErrorsM;
int sequenceNumberM;
bool isActiveM; bool isActiveM;
protected: protected:

View File

@@ -6,7 +6,9 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include "common.h" #include "common.h"
#include "log.h"
#include "source.h" #include "source.h"
// --- cIptvTransponderParameters -------------------------------------------- // --- cIptvTransponderParameters --------------------------------------------
@@ -17,7 +19,7 @@ cIptvTransponderParameters::cIptvTransponderParameters(const char *parametersP)
protocolM(eProtocolUDP), protocolM(eProtocolUDP),
parameterM(0) parameterM(0)
{ {
debug("cIptvTransponderParameters::%s(%s)", __FUNCTION__, parametersP); debug1("%s (%s)", __PRETTY_FUNCTION__, parametersP);
memset(&addressM, 0, sizeof(addressM)); memset(&addressM, 0, sizeof(addressM));
Parse(parametersP); Parse(parametersP);
@@ -25,7 +27,7 @@ cIptvTransponderParameters::cIptvTransponderParameters(const char *parametersP)
cString cIptvTransponderParameters::ToString(char typeP) const cString cIptvTransponderParameters::ToString(char typeP) const
{ {
debug("cIptvTransponderParameters::%s(%c)", __FUNCTION__, typeP); debug1("%s (%c)", __PRETTY_FUNCTION__, typeP);
const char *protocolstr; const char *protocolstr;
@@ -52,7 +54,7 @@ cString cIptvTransponderParameters::ToString(char typeP) const
bool cIptvTransponderParameters::Parse(const char *strP) bool cIptvTransponderParameters::Parse(const char *strP)
{ {
debug("cIptvTransponderParameters::%s(%s)", __FUNCTION__, strP); debug1("%s (%s)", __PRETTY_FUNCTION__, strP);
bool result = false; bool result = false;
if (strP && *strP) { if (strP && *strP) {
@@ -136,13 +138,11 @@ const char *cIptvSourceParam::allowedProtocolCharsS = " abcdefghijklmnopqrstuvwx
cIptvSourceParam::cIptvSourceParam(char sourceP, const char *descriptionP) cIptvSourceParam::cIptvSourceParam(char sourceP, const char *descriptionP)
: cSourceParam(sourceP, descriptionP), : cSourceParam(sourceP, descriptionP),
paramM(0), paramM(0),
nidM(0),
tidM(0),
ridM(0), ridM(0),
dataM(), dataM(),
itpM() itpM()
{ {
debug("cIptvSourceParam::%s(%c, %s)", __FUNCTION__, sourceP, descriptionP); debug1("%s (%c, %s)", __PRETTY_FUNCTION__, sourceP, descriptionP);
protocolsM[cIptvTransponderParameters::eProtocolUDP] = tr("UDP"); protocolsM[cIptvTransponderParameters::eProtocolUDP] = tr("UDP");
protocolsM[cIptvTransponderParameters::eProtocolCURL] = tr("CURL"); protocolsM[cIptvTransponderParameters::eProtocolCURL] = tr("CURL");
@@ -153,10 +153,8 @@ cIptvSourceParam::cIptvSourceParam(char sourceP, const char *descriptionP)
void cIptvSourceParam::SetData(cChannel *channelP) void cIptvSourceParam::SetData(cChannel *channelP)
{ {
debug("cIptvSourceParam::%s(%s)", __FUNCTION__, channelP->Parameters()); debug1("%s (%s)", __PRETTY_FUNCTION__, channelP->Parameters());
dataM = *channelP; dataM = *channelP;
nidM = dataM.Nid();
tidM = dataM.Tid();
ridM = dataM.Rid(); ridM = dataM.Rid();
itpM.Parse(dataM.Parameters()); itpM.Parse(dataM.Parameters());
paramM = 0; paramM = 0;
@@ -164,23 +162,21 @@ void cIptvSourceParam::SetData(cChannel *channelP)
void cIptvSourceParam::GetData(cChannel *channelP) void cIptvSourceParam::GetData(cChannel *channelP)
{ {
debug("cIptvSourceParam::%s(%s)", __FUNCTION__, channelP->Parameters()); debug1("%s (%s)", __PRETTY_FUNCTION__, channelP->Parameters());
channelP->SetTransponderData(channelP->Source(), channelP->Frequency(), dataM.Srate(), itpM.ToString(Source()), true); channelP->SetTransponderData(channelP->Source(), channelP->Frequency(), dataM.Srate(), itpM.ToString(Source()), true);
channelP->SetId(nidM, tidM, channelP->Sid(), ridM); channelP->SetId(NULL, channelP->Nid(), channelP->Tid(), channelP->Sid(), ridM);
} }
cOsdItem *cIptvSourceParam::GetOsdItem(void) cOsdItem *cIptvSourceParam::GetOsdItem(void)
{ {
debug("cIptvSourceParam::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
switch (paramM++) { switch (paramM++) {
case 0: return new cMenuEditIntItem( tr("Nid"), &nidM, 0); case 0: return new cMenuEditIntItem( tr("Rid"), &ridM, 0);
case 1: return new cMenuEditIntItem( tr("Tid"), &tidM, 0); case 1: return new cMenuEditBoolItem(tr("Scan section ids"), &itpM.sidScanM);
case 2: return new cMenuEditIntItem( tr("Rid"), &ridM, 0); case 2: return new cMenuEditBoolItem(tr("Scan pids"), &itpM.pidScanM);
case 3: return new cMenuEditBoolItem(tr("Scan section ids"), &itpM.sidScanM); case 3: return new cMenuEditStraItem(tr("Protocol"), &itpM.protocolM, ELEMENTS(protocolsM), protocolsM);
case 4: return new cMenuEditBoolItem(tr("Scan pids"), &itpM.pidScanM); case 4: return new cMenuEditStrItem( tr("Address"), itpM.addressM, sizeof(itpM.addressM), allowedProtocolCharsS);
case 5: return new cMenuEditStraItem(tr("Protocol"), &itpM.protocolM, ELEMENTS(protocolsM), protocolsM); case 5: return new cMenuEditIntItem( tr("Parameter"), &itpM.parameterM, 0, 0xFFFF);
case 6: return new cMenuEditStrItem( tr("Address"), itpM.addressM, sizeof(itpM.addressM), allowedProtocolCharsS);
case 7: return new cMenuEditIntItem( tr("Parameter"), &itpM.parameterM, 0, 0xFFFF);
default: return NULL; default: return NULL;
} }
return NULL; return NULL;

View File

@@ -51,8 +51,6 @@ class cIptvSourceParam : public cSourceParam
{ {
private: private:
int paramM; int paramM;
int nidM;
int tidM;
int ridM; int ridM;
cChannel dataM; cChannel dataM;
cIptvTransponderParameters itpM; cIptvTransponderParameters itpM;

View File

@@ -8,8 +8,9 @@
#include <limits.h> #include <limits.h>
#include "common.h" #include "common.h"
#include "statistics.h"
#include "config.h" #include "config.h"
#include "log.h"
#include "statistics.h"
// Section statistics class // Section statistics class
cIptvSectionStatistics::cIptvSectionStatistics() cIptvSectionStatistics::cIptvSectionStatistics()
@@ -18,17 +19,17 @@ cIptvSectionStatistics::cIptvSectionStatistics()
timerM(), timerM(),
mutexM() mutexM()
{ {
//debug("cIptvSectionStatistics::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
} }
cIptvSectionStatistics::~cIptvSectionStatistics() cIptvSectionStatistics::~cIptvSectionStatistics()
{ {
//debug("cIptvSectionStatistics::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
} }
cString cIptvSectionStatistics::GetSectionStatistic() cString cIptvSectionStatistics::GetSectionStatistic()
{ {
//debug("cIptvSectionStatistics::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
timerM.Set(); timerM.Set();
@@ -44,7 +45,7 @@ cString cIptvSectionStatistics::GetSectionStatistic()
void cIptvSectionStatistics::AddSectionStatistic(long bytesP, long callsP) void cIptvSectionStatistics::AddSectionStatistic(long bytesP, long callsP)
{ {
//debug("cIptvSectionStatistics::%s(%ld, %ld)", __FUNCTION__, bytesP, callsP); debug16("%s (%ld, %ld)", __PRETTY_FUNCTION__, bytesP, callsP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
filteredDataM += bytesP; filteredDataM += bytesP;
numberOfCallsM += callsP; numberOfCallsM += callsP;
@@ -57,7 +58,7 @@ cIptvPidStatistics::cIptvPidStatistics()
: timerM(), : timerM(),
mutexM() mutexM()
{ {
debug("cIptvPidStatistics::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct); const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct);
for (int i = 0; i < numberOfElements; ++i) { for (int i = 0; i < numberOfElements; ++i) {
mostActivePidsM[i].pid = -1; mostActivePidsM[i].pid = -1;
@@ -67,12 +68,12 @@ cIptvPidStatistics::cIptvPidStatistics()
cIptvPidStatistics::~cIptvPidStatistics() cIptvPidStatistics::~cIptvPidStatistics()
{ {
debug("cIptvPidStatistics::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cString cIptvPidStatistics::GetPidStatistic() cString cIptvPidStatistics::GetPidStatistic()
{ {
//debug("cIptvPidStatistics::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct); const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct);
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
@@ -97,7 +98,7 @@ cString cIptvPidStatistics::GetPidStatistic()
int cIptvPidStatistics::SortPids(const void* data1P, const void* data2P) int cIptvPidStatistics::SortPids(const void* data1P, const void* data2P)
{ {
//debug("cIptvPidStatistics::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
const pidStruct *comp1 = reinterpret_cast<const pidStruct*>(data1P); const pidStruct *comp1 = reinterpret_cast<const pidStruct*>(data1P);
const pidStruct *comp2 = reinterpret_cast<const pidStruct*>(data2P); const pidStruct *comp2 = reinterpret_cast<const pidStruct*>(data2P);
if (comp1->dataAmount > comp2->dataAmount) if (comp1->dataAmount > comp2->dataAmount)
@@ -109,7 +110,7 @@ int cIptvPidStatistics::SortPids(const void* data1P, const void* data2P)
void cIptvPidStatistics::AddPidStatistic(int pidP, long payloadP) void cIptvPidStatistics::AddPidStatistic(int pidP, long payloadP)
{ {
//debug("cIptvPidStatistics::%s(%ld, %ld)", __FUNCTION__, pidP, payloadP); debug16("%s (%d, %ld)", __PRETTY_FUNCTION__, pidP, payloadP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct); const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct);
// If our statistic already is in the array, update it and quit // If our statistic already is in the array, update it and quit
@@ -139,17 +140,17 @@ cIptvStreamerStatistics::cIptvStreamerStatistics()
timerM(), timerM(),
mutexM() mutexM()
{ {
debug("cIptvStreamerStatistics::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvStreamerStatistics::~cIptvStreamerStatistics() cIptvStreamerStatistics::~cIptvStreamerStatistics()
{ {
debug("cIptvStreamerStatistics::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cString cIptvStreamerStatistics::GetStreamerStatistic() cString cIptvStreamerStatistics::GetStreamerStatistic()
{ {
//debug("cIptvStreamerStatistics::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
timerM.Set(); timerM.Set();
@@ -163,7 +164,7 @@ cString cIptvStreamerStatistics::GetStreamerStatistic()
void cIptvStreamerStatistics::AddStreamerStatistic(long bytesP) void cIptvStreamerStatistics::AddStreamerStatistic(long bytesP)
{ {
//debug("cIptvStreamerStatistics::%s(%ld)", __FUNCTION__, bytesP); debug16("%s (%ld)", __PRETTY_FUNCTION__, bytesP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
dataBytesM += bytesP; dataBytesM += bytesP;
} }
@@ -177,22 +178,22 @@ cIptvBufferStatistics::cIptvBufferStatistics()
timerM(), timerM(),
mutexM() mutexM()
{ {
debug("cIptvBufferStatistics::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cIptvBufferStatistics::~cIptvBufferStatistics() cIptvBufferStatistics::~cIptvBufferStatistics()
{ {
debug("cIptvBufferStatistics::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
} }
cString cIptvBufferStatistics::GetBufferStatistic() cString cIptvBufferStatistics::GetBufferStatistic()
{ {
//debug("cIptvBufferStatistics::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
timerM.Set(); timerM.Set();
long bitrate = elapsed ? (long)(1000.0L * dataBytesM / KILOBYTE(1) / elapsed) : 0L; 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); float percentage = (float)((float)usedSpaceM / (float)totalSpace * 100.0);
long totalKilos = totalSpace / KILOBYTE(1); long totalKilos = totalSpace / KILOBYTE(1);
long usedKilos = usedSpaceM / KILOBYTE(1); long usedKilos = usedSpaceM / KILOBYTE(1);
@@ -211,7 +212,7 @@ cString cIptvBufferStatistics::GetBufferStatistic()
void cIptvBufferStatistics::AddBufferStatistic(long bytesP, long usedP) void cIptvBufferStatistics::AddBufferStatistic(long bytesP, long usedP)
{ {
//debug("cIptvBufferStatistics::%s(%ld, %ld)", __FUNCTION__, bytesP, usedP); debug16("%s (%ld, %ld)", __PRETTY_FUNCTION__, bytesP, usedP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
dataBytesM += bytesP; dataBytesM += bytesP;
if (usedP > usedSpaceM) if (usedP > usedSpaceM)

View File

@@ -6,6 +6,7 @@
*/ */
#include "common.h" #include "common.h"
#include "log.h"
#include "streamer.h" #include "streamer.h"
cIptvStreamer::cIptvStreamer(cIptvDeviceIf &deviceP, unsigned int packetLenP) cIptvStreamer::cIptvStreamer(cIptvDeviceIf &deviceP, unsigned int packetLenP)
@@ -15,7 +16,7 @@ cIptvStreamer::cIptvStreamer(cIptvDeviceIf &deviceP, unsigned int packetLenP)
packetBufferLenM(packetLenP), packetBufferLenM(packetLenP),
protocolM(NULL) protocolM(NULL)
{ {
debug("cIptvStreamer::%s(%d)", __FUNCTION__, packetBufferLenM); debug1("%s (, %d)", __PRETTY_FUNCTION__, packetBufferLenM);
// Allocate packet buffer // Allocate packet buffer
packetBufferM = MALLOC(unsigned char, packetBufferLenM); packetBufferM = MALLOC(unsigned char, packetBufferLenM);
if (packetBufferM) if (packetBufferM)
@@ -26,7 +27,7 @@ cIptvStreamer::cIptvStreamer(cIptvDeviceIf &deviceP, unsigned int packetLenP)
cIptvStreamer::~cIptvStreamer() cIptvStreamer::~cIptvStreamer()
{ {
debug("cIptvStreamer::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Close the protocol // Close the protocol
Close(); Close();
protocolM = NULL; protocolM = NULL;
@@ -36,7 +37,7 @@ cIptvStreamer::~cIptvStreamer()
void cIptvStreamer::Action(void) void cIptvStreamer::Action(void)
{ {
debug("cIptvStreamer::%s(): entering", __FUNCTION__); debug1("%s() Entering", __PRETTY_FUNCTION__);
// Increase priority // Increase priority
//SetPriority(-1); //SetPriority(-1);
// Do the thread loop // Do the thread loop
@@ -52,12 +53,12 @@ void cIptvStreamer::Action(void)
else else
sleepM.Wait(10); // to avoid busy loop and reduce cpu load sleepM.Wait(10); // to avoid busy loop and reduce cpu load
} }
debug("cIptvStreamer::%s(): exiting", __FUNCTION__); debug1("%s Exiting", __PRETTY_FUNCTION__);
} }
bool cIptvStreamer::Open(void) bool cIptvStreamer::Open(void)
{ {
debug("cIptvStreamer::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Open the protocol // Open the protocol
if (protocolM && !protocolM->Open()) if (protocolM && !protocolM->Open())
return false; return false;
@@ -68,7 +69,7 @@ bool cIptvStreamer::Open(void)
bool cIptvStreamer::Close(void) bool cIptvStreamer::Close(void)
{ {
debug("cIptvStreamer::%s()", __FUNCTION__); debug1("%s", __PRETTY_FUNCTION__);
// Stop thread // Stop thread
sleepM.Signal(); sleepM.Signal();
if (Running()) if (Running())
@@ -81,7 +82,7 @@ bool cIptvStreamer::Close(void)
bool cIptvStreamer::SetSource(const char* locationP, const int parameterP, const int indexP, cIptvProtocolIf* protocolP) bool cIptvStreamer::SetSource(const char* locationP, const int parameterP, const int indexP, cIptvProtocolIf* protocolP)
{ {
debug("cIptvStreamer::%s(%s, %d, %d)", __FUNCTION__, locationP, parameterP, indexP); debug1("%s (%s, %d, %d, )", __PRETTY_FUNCTION__, locationP, parameterP, indexP);
if (!isempty(locationP)) { if (!isempty(locationP)) {
// Update protocol and set location and parameter; Close the existing one if changed // Update protocol and set location and parameter; Close the existing one if changed
if (protocolM != protocolP) { if (protocolM != protocolP) {
@@ -101,7 +102,7 @@ bool cIptvStreamer::SetSource(const char* locationP, const int parameterP, const
bool cIptvStreamer::SetPid(int pidP, int typeP, bool onP) bool cIptvStreamer::SetPid(int pidP, int typeP, bool onP)
{ {
debug("cIptvStreamer::%s(%d, %d, %d)", __FUNCTION__, pidP, typeP, onP); debug1("%s (%d, %d, %d)", __PRETTY_FUNCTION__, pidP, typeP, onP);
if (protocolM) if (protocolM)
return protocolM->SetPid(pidP, typeP, onP); return protocolM->SetPid(pidP, typeP, onP);
return true; return true;
@@ -109,7 +110,7 @@ bool cIptvStreamer::SetPid(int pidP, int typeP, bool onP)
cString cIptvStreamer::GetInformation(void) cString cIptvStreamer::GetInformation(void)
{ {
//debug("cIptvStreamer::%s()", __FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cString s; cString s;
if (protocolM) if (protocolM)
s = protocolM->GetInformation(); s = protocolM->GetInformation();