mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 11:37:03 +00:00
Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0fc83cba6 | ||
|
|
49fcbc8921 | ||
|
|
dbeb014a85 | ||
|
|
26cd1aa1f1 | ||
|
|
a32cb95960 | ||
|
|
abfa46c064 | ||
|
|
aa1bfab60d | ||
|
|
3ffba13a6c | ||
|
|
57d63db034 | ||
|
|
2484c3bdd6 | ||
|
|
912bf068ac | ||
|
|
a8d01e32a1 | ||
|
|
d1c2d48a6b | ||
|
|
e74d4f88f4 | ||
|
|
55bf971e3e | ||
|
|
30abbc3e80 | ||
|
|
74761da04a | ||
|
|
b221a9a406 | ||
|
|
fd7a43d733 | ||
|
|
d546cac834 | ||
|
|
94225ac6a4 | ||
|
|
25ec9df0cc | ||
|
|
abf0a5ece4 | ||
|
|
024ee7ba89 | ||
|
|
73906ab698 | ||
|
|
ec2ec19f68 | ||
|
|
1e8f117988 | ||
|
|
00cf880a5d | ||
|
|
71472a1033 | ||
|
|
0eff9de2ee | ||
|
|
9a19009451 | ||
|
|
04c194ffc7 | ||
|
|
40125dd9bb | ||
|
|
c5a7598544 | ||
|
|
4e8e26a4b3 | ||
|
|
9ec10262d4 | ||
|
|
501701e3d3 | ||
|
|
53b5644973 | ||
|
|
17b4709c30 | ||
|
|
2bff3d0f8f | ||
|
|
6324eaf128 | ||
|
|
b31de2ec23 | ||
|
|
b3b28a5faa | ||
|
|
037adaac86 | ||
|
|
6fa46ca9e3 | ||
|
|
c507f373ff | ||
|
|
e798ff1424 | ||
|
|
613152c6db | ||
|
|
740d93aa2c | ||
|
|
94e70db977 | ||
|
|
698ebb3a3c | ||
|
|
aaf93246c1 | ||
|
|
1d8044b4e4 | ||
|
|
573584022c | ||
|
|
5420374543 | ||
|
|
71952ae0dc | ||
|
|
c8fe6b1389 | ||
|
|
dd540f8eef | ||
|
|
3de5d6c467 | ||
|
|
c525b553e4 | ||
|
|
71b0e52712 | ||
|
|
398a8d75b9 | ||
|
|
554bc5cb41 | ||
|
|
4188a5d4e2 | ||
|
|
55440bf047 | ||
|
|
3fe71ae011 | ||
|
|
16b40c6774 | ||
|
|
a03bd6309c | ||
|
|
89e3aba59e | ||
|
|
68459e6553 | ||
|
|
29cb25485f | ||
|
|
c176429338 | ||
|
|
05d70f67b1 | ||
|
|
537c16a43b | ||
|
|
b88b14912c | ||
|
|
c1544453b6 | ||
|
|
5c14668598 | ||
|
|
d4a255a773 | ||
|
|
24bcf25571 | ||
|
|
78f4a2a0fc | ||
|
|
65d79abbf4 | ||
|
|
caf326bb4d | ||
|
|
18c2962cd9 | ||
|
|
1e2d0955de | ||
|
|
27437381d0 | ||
|
|
7ce44c9175 | ||
|
|
7206a8d189 | ||
|
|
dce9d3361f | ||
|
|
d71f79bdd8 | ||
|
|
dcf7ce5447 | ||
|
|
3ae015cf51 | ||
|
|
4915630cfc | ||
|
|
28d1869a28 | ||
|
|
c8c9dccf2b | ||
|
|
adcde3954c | ||
|
|
c3d38f2345 | ||
|
|
8f552bd19f | ||
|
|
3b5b7eac24 | ||
|
|
3daea8b1ba | ||
|
|
b5744903cd | ||
|
|
61a588ed22 | ||
|
|
9e630760f6 | ||
|
|
b3b0ae3567 | ||
|
|
4b8b396f6b | ||
|
|
19b49e00e5 | ||
|
|
bde204f3b3 | ||
|
|
60ed46f42f | ||
|
|
c6671b20db | ||
|
|
edb54e537d | ||
|
|
9750b0f565 |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.dependencies
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
*~
|
||||||
|
po/*.pot
|
||||||
|
po/*.mo
|
||||||
98
HISTORY
98
HISTORY
@@ -18,3 +18,101 @@ VDR Plugin 'iptv' Revision History
|
|||||||
- Added some minor tweaks.
|
- Added some minor tweaks.
|
||||||
- RTP payload now restricted to TS only.
|
- RTP payload now restricted to TS only.
|
||||||
- Added preliminary support for vdr-1.4.7.
|
- Added preliminary support for vdr-1.4.7.
|
||||||
|
|
||||||
|
2007-11-04: Version 0.0.4
|
||||||
|
|
||||||
|
- Added German translation (Thanks to Tobias Grimm).
|
||||||
|
- Added pluginparam patch for vdr-1.5.11.
|
||||||
|
- Updated Makefile 'i18n' targets.
|
||||||
|
|
||||||
|
2007-11-27: Version 0.0.5
|
||||||
|
|
||||||
|
- Added French translation (Thanks to Bruno Roussel).
|
||||||
|
- Added a more sophisticated example script (Thanks to Tobias Grimm).
|
||||||
|
- Improved iptvstream.sh compatibility under non-bash shells.
|
||||||
|
|
||||||
|
2008-01-20: Version 0.0.6
|
||||||
|
|
||||||
|
- Fixed some lint warnings.
|
||||||
|
- Added Italian translation (Thanks to Diego Pierotto).
|
||||||
|
- Added '-Wno-parentheses' to the compiler options.
|
||||||
|
- Mapped 'kInfo' as help key in setup menu.
|
||||||
|
- Refactored statistic collecting code.
|
||||||
|
|
||||||
|
2008-02-18: Version 0.0.7
|
||||||
|
|
||||||
|
- Updated for vdr-1.5.15.
|
||||||
|
- Replaced asprintf with cString.
|
||||||
|
- Updated French translation (Thanks to Michaël Nival).
|
||||||
|
- Modified VDR locale support detection.
|
||||||
|
- Added preliminary automatic Pid scanning functionality.
|
||||||
|
- Modified channels.conf format to enable/disable channel
|
||||||
|
specific pid and sid scanning functionality.
|
||||||
|
- Removed the general sid scanning setup option.
|
||||||
|
|
||||||
|
2008-03-27: Version 0.2.0
|
||||||
|
|
||||||
|
- Updated for vdr-1.6.0.
|
||||||
|
- Updated Italian translation (Thanks to Diego Pierotto).
|
||||||
|
- Added Russian translation (Thanks to Alexander Gross).
|
||||||
|
|
||||||
|
2008-06-20: Version 0.2.1
|
||||||
|
|
||||||
|
- Updated Italian translation (Thanks to Diego Pierotto).
|
||||||
|
- Removed compatibility mode for old channels.conf format.
|
||||||
|
- Updated vlc2iptv script for new channels.conf format.
|
||||||
|
- Added pluginparam patch for vdr-1.7.0.
|
||||||
|
- Added new example scripts from VDR-WIKI.
|
||||||
|
|
||||||
|
2008-10-12: Version 0.2.2
|
||||||
|
|
||||||
|
- Converted HISTORY and fi_FI.po to UTF-8.
|
||||||
|
- Updated Italian translation (Thanks to Diego Pierotto).
|
||||||
|
- Tweaked pid scanner parameters for HD broadcasts.
|
||||||
|
- Fixed opening of fifo tap.
|
||||||
|
- Updated iptvstream.sh script to support optional video resolution
|
||||||
|
settings.
|
||||||
|
- Optimized streamer thread termination.
|
||||||
|
|
||||||
|
2008-12-16: Version 0.2.3
|
||||||
|
|
||||||
|
- Updated for vdr-1.7.2.
|
||||||
|
- Silenced a compilation warning.
|
||||||
|
|
||||||
|
2009-02-25: Version 0.2.4
|
||||||
|
|
||||||
|
- Updated for vdr-1.7.4.
|
||||||
|
- Fixed blacklisting of PAT section filter.
|
||||||
|
- Set max IPTV device count to VDR's max devices.
|
||||||
|
- Fixed a possible crash in sid and pid scanners.
|
||||||
|
|
||||||
|
2009-03-08: Version 0.2.5
|
||||||
|
|
||||||
|
- Optimized TS packet data flow.
|
||||||
|
- Refactored section filter class.
|
||||||
|
- Cleaned up example scripts.
|
||||||
|
- Fixed pid scanner to set the existing video stream type
|
||||||
|
(Thanks to ua0lnj for reporting this one).
|
||||||
|
- Added optional patches to disable CA updates.
|
||||||
|
|
||||||
|
2009-03-22: Version 0.2.6
|
||||||
|
|
||||||
|
- Added a note about recommended frequencies into README.
|
||||||
|
- Fixed a locking bug with section filters.
|
||||||
|
- Fixed some lint warnings.
|
||||||
|
|
||||||
|
2009-06-01: Version 0.3.0
|
||||||
|
|
||||||
|
- Added iptvstream-notrap.sh script.
|
||||||
|
- Fixed setting parameters when protocol changes
|
||||||
|
(Thanks to Peter Holik for reporting this one).
|
||||||
|
- Updated example scripts to use ffmpeg's direct UDP output
|
||||||
|
and added a new "image.sh" script (Thanks to Peter Holik).
|
||||||
|
|
||||||
|
2009-10-01: Version 0.3.1
|
||||||
|
|
||||||
|
- Updated patches.
|
||||||
|
- Added optional patches to disable EIT scanning.
|
||||||
|
- Fixed handling of HTTP protocol headers.
|
||||||
|
- Modified sectionfilters to use socket pair instead of
|
||||||
|
filesystem fifos.
|
||||||
|
|||||||
62
Makefile
62
Makefile
@@ -1,7 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Makefile for a Video Disk Recorder plugin
|
# Makefile for IPTV plugin
|
||||||
#
|
#
|
||||||
# $Id: Makefile,v 1.22 2007/10/28 16:26:28 rahrenbe Exp $
|
|
||||||
|
|
||||||
# Debugging on/off
|
# Debugging on/off
|
||||||
#IPTV_DEBUG = 1
|
#IPTV_DEBUG = 1
|
||||||
@@ -24,7 +23,7 @@ VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ p
|
|||||||
### The C++ compiler and options:
|
### The C++ compiler and options:
|
||||||
|
|
||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual
|
CXXFLAGS ?= -fPIC -g -O2 -Wall -Wextra -Wswitch-default -Wfloat-equal -Wundef -Wpointer-arith -Wconversion -Wcast-align -Wredundant-decls -Wno-unused-parameter -Woverloaded-virtual -Wno-parentheses
|
||||||
|
|
||||||
### The directory environment:
|
### The directory environment:
|
||||||
|
|
||||||
@@ -40,9 +39,6 @@ TMPDIR = /tmp
|
|||||||
|
|
||||||
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
|
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
|
||||||
|
|
||||||
### Test whether VDR has locale support
|
|
||||||
VDRLOCALE = $(shell grep '^LOCALEDIR' $(VDRDIR)/Makefile)
|
|
||||||
|
|
||||||
### The name of the distribution archive:
|
### The name of the distribution archive:
|
||||||
|
|
||||||
ARCHIVE = $(PLUGIN)-$(VERSION)
|
ARCHIVE = $(PLUGIN)-$(VERSION)
|
||||||
@@ -58,11 +54,14 @@ ifdef IPTV_DEBUG
|
|||||||
DEFINES += -DDEBUG
|
DEFINES += -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.PHONY: all all-redirect
|
||||||
|
all-redirect: all
|
||||||
|
|
||||||
### The object files (add further files here):
|
### The object files (add further files here):
|
||||||
|
|
||||||
OBJS = $(PLUGIN).o config.o setup.o device.o streamer.o protocoludp.o \
|
OBJS = $(PLUGIN).o config.o setup.o device.o streamer.o protocoludp.o \
|
||||||
protocolhttp.o protocolfile.o protocolext.o sectionfilter.o \
|
protocolhttp.o protocolfile.o protocolext.o sectionfilter.o \
|
||||||
sidscanner.o statistics.o common.o socket.o i18n.o
|
sidscanner.o pidscanner.o statistics.o common.o socket.o
|
||||||
|
|
||||||
### The main target:
|
### The main target:
|
||||||
|
|
||||||
@@ -78,7 +77,7 @@ all: libvdr-$(PLUGIN).so i18n
|
|||||||
MAKEDEP = $(CXX) -MM -MG
|
MAKEDEP = $(CXX) -MM -MG
|
||||||
DEPFILE = .dependencies
|
DEPFILE = .dependencies
|
||||||
$(DEPFILE): Makefile
|
$(DEPFILE): Makefile
|
||||||
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(subst i18n.c,,$(OBJS:%.o=%.c)) > $@
|
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
|
||||||
|
|
||||||
-include $(DEPFILE)
|
-include $(DEPFILE)
|
||||||
|
|
||||||
@@ -87,50 +86,25 @@ $(DEPFILE): Makefile
|
|||||||
PODIR = po
|
PODIR = po
|
||||||
LOCALEDIR = $(VDRDIR)/locale
|
LOCALEDIR = $(VDRDIR)/locale
|
||||||
I18Npo = $(wildcard $(PODIR)/*.po)
|
I18Npo = $(wildcard $(PODIR)/*.po)
|
||||||
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
|
I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
|
||||||
I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file))))
|
|
||||||
I18Npot = $(PODIR)/$(PLUGIN).pot
|
I18Npot = $(PODIR)/$(PLUGIN).pot
|
||||||
ifeq ($(strip $(APIVERSION)),1.5.7)
|
|
||||||
I18Nvdrmo = $(PLUGIN).mo
|
|
||||||
else
|
|
||||||
I18Nvdrmo = vdr-$(PLUGIN).mo
|
|
||||||
endif
|
|
||||||
|
|
||||||
### Do gettext based i18n stuff
|
|
||||||
|
|
||||||
ifneq ($(strip $(VDRLOCALE)),)
|
|
||||||
|
|
||||||
%.mo: %.po
|
%.mo: %.po
|
||||||
msgfmt -c -o $@ $<
|
msgfmt -c -o $@ $<
|
||||||
|
|
||||||
$(I18Npot): $(wildcard *.c)
|
$(I18Npot): $(wildcard *.c)
|
||||||
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='Rolf Ahrenberg' -o $@ $(subst i18n.c,,$(wildcard *.c))
|
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='Rolf Ahrenberg' -o $@ $^
|
||||||
|
|
||||||
$(I18Npo): $(I18Npot)
|
%.po: $(I18Npot)
|
||||||
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
|
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
|
||||||
|
@touch $@
|
||||||
|
|
||||||
i18n: $(I18Npot) $(I18Nmo)
|
$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
|
||||||
@mkdir -p $(LOCALEDIR)
|
@mkdir -p $(dir $@)
|
||||||
for i in $(I18Ndirs); do\
|
cp $< $@
|
||||||
mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\
|
|
||||||
cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/$(I18Nvdrmo);\
|
|
||||||
done
|
|
||||||
|
|
||||||
i18n.c: i18n-template.c
|
.PHONY: i18n
|
||||||
@cp i18n-template.c i18n.c
|
i18n: $(I18Nmsgs) $(I18Npot)
|
||||||
|
|
||||||
### Do i18n.c based i18n stuff
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
i18n:
|
|
||||||
@### nothing to do
|
|
||||||
|
|
||||||
#i18n compatibility generator:
|
|
||||||
i18n.c: i18n-template.c po2i18n.pl $(I18Npo)
|
|
||||||
./po2i18n.pl < i18n-template.c > i18n.c
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
### Targets:
|
### Targets:
|
||||||
|
|
||||||
@@ -145,9 +119,9 @@ dist: clean
|
|||||||
@-rm -rf $(TMPDIR)/$(ARCHIVE)
|
@-rm -rf $(TMPDIR)/$(ARCHIVE)
|
||||||
@mkdir $(TMPDIR)/$(ARCHIVE)
|
@mkdir $(TMPDIR)/$(ARCHIVE)
|
||||||
@cp -a * $(TMPDIR)/$(ARCHIVE)
|
@cp -a * $(TMPDIR)/$(ARCHIVE)
|
||||||
@tar czf $(PACKAGE).tgz -C $(TMPDIR) --exclude CVS $(ARCHIVE)
|
@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
|
||||||
@-rm -rf $(TMPDIR)/$(ARCHIVE)
|
@-rm -rf $(TMPDIR)/$(ARCHIVE)
|
||||||
@echo Distribution package created as $(PACKAGE).tgz
|
@echo Distribution package created as $(PACKAGE).tgz
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@-rm -f $(OBJS) $(DEPFILE) i18n.c *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
|
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
|
||||||
|
|||||||
57
README
57
README
@@ -3,8 +3,8 @@ This is an IPTV plugin for the Video Disk Recorder (VDR).
|
|||||||
Written by: Rolf Ahrenberg
|
Written by: Rolf Ahrenberg
|
||||||
< R o l f . A h r e n b e r g @ s c i . f i >
|
< R o l f . A h r e n b e r g @ s c i . f i >
|
||||||
|
|
||||||
Antti Sepp<EFBFBD>l<EFBFBD>
|
Antti Seppälä
|
||||||
<a j h s e p p a @ n i k s u l a . h u t . f i >
|
< a . s e p p a l a @ g m a i l . c o m >
|
||||||
|
|
||||||
Project's homepage: http://www.saunalahti.fi/~rahrenbe/vdr/iptv/
|
Project's homepage: http://www.saunalahti.fi/~rahrenbe/vdr/iptv/
|
||||||
|
|
||||||
@@ -44,10 +44,7 @@ cd /put/your/path/here/VDR/PLUGINS/src
|
|||||||
tar -xzf /put/your/path/here/vdr-iptv-X.Y.Z.tgz
|
tar -xzf /put/your/path/here/vdr-iptv-X.Y.Z.tgz
|
||||||
ln -s iptv-X.Y.Z iptv
|
ln -s iptv-X.Y.Z iptv
|
||||||
cd /put/your/path/here/VDR
|
cd /put/your/path/here/VDR
|
||||||
# Note: pluginparam patch is required for every vdr
|
|
||||||
patch -p1 < PLUGINS/src/iptv/patches/vdr-X.Y.Z-pluginparam.patch
|
patch -p1 < PLUGINS/src/iptv/patches/vdr-X.Y.Z-pluginparam.patch
|
||||||
# Note: closefilter patch is required only for vdr-1.5.9 or earlier
|
|
||||||
patch -p1 < PLUGINS/src/iptv/patches/vdr-X.Y.Z-closefilter.patch
|
|
||||||
cp sources.conf /path/to/vdrconf/
|
cp sources.conf /path/to/vdrconf/
|
||||||
cp -R PLUGINS/src/iptv/iptv /path/to/vdrconf/plugins/
|
cp -R PLUGINS/src/iptv/iptv /path/to/vdrconf/plugins/
|
||||||
make
|
make
|
||||||
@@ -70,10 +67,6 @@ Setup menu:
|
|||||||
- Use section filtering = 1 Defines whether section filtering shall
|
- Use section filtering = 1 Defines whether section filtering shall
|
||||||
be used.
|
be used.
|
||||||
Valid range: 0...1
|
Valid range: 0...1
|
||||||
- Scan Sid automatically = 1 Defines whether service id shall be
|
|
||||||
scanned automatically. Requires section
|
|
||||||
filtering.
|
|
||||||
Valid range: 0...1
|
|
||||||
- Disable filters = 0 Certain section filters might cause some
|
- Disable filters = 0 Certain section filters might cause some
|
||||||
unwanted behaviour to VDR such as time
|
unwanted behaviour to VDR such as time
|
||||||
being falsely synchronized etc. This
|
being falsely synchronized etc. This
|
||||||
@@ -96,6 +89,17 @@ Channel editor menu:
|
|||||||
pressing the Red button. The channel editor is functionally similar to
|
pressing the Red button. The channel editor is functionally similar to
|
||||||
VDR's built-in channel editor.
|
VDR's built-in channel editor.
|
||||||
|
|
||||||
|
- Scan Sid: [yes|no] Defines whether service id shall be
|
||||||
|
scanned automatically. Service id is
|
||||||
|
used in channel identification and
|
||||||
|
EPG information is set according to it.
|
||||||
|
This option requires section filtering.
|
||||||
|
|
||||||
|
- Scan pids: [yes|no] Defines whether video and audio pids
|
||||||
|
shall be scanned automatically. This
|
||||||
|
option is useful with streams missing
|
||||||
|
correct PAT/PMT information.
|
||||||
|
|
||||||
Information menu:
|
Information menu:
|
||||||
|
|
||||||
- [Red:General] Opens the general information page.
|
- [Red:General] Opens the general information page.
|
||||||
@@ -107,16 +111,17 @@ Configuration:
|
|||||||
|
|
||||||
- channels.conf
|
- channels.conf
|
||||||
|
|
||||||
TV4;IPTV:4:IPTV|EXT|iptvstream.sh|0:P:0:0:680:0:0:4:0:0:0
|
TV4;IPTV:40:IPTV|S1P0|EXT|iptvstream.sh|0:P:0:0:680:0:0:4:0:0:0
|
||||||
TV3;IPTV:3:IPTV|FILE|/video/stream.ts|5:P:0:514:670:2321:0:3:0:0:0
|
TV3;IPTV:30:IPTV|S0P1|FILE|/video/stream.ts|5:P:0:514:670:2321:0:3:0:0:0
|
||||||
TV2;IPTV:2:IPTV|HTTP|127.0.0.1/TS/2|3000:P:0:513:660:2321:0:2:0:0:0
|
TV2;IPTV:20:IPTV|S0P1|HTTP|127.0.0.1/TS/2|3000:P:0:513:660:2321:0:2:0:0:0
|
||||||
TV1;IPTV:1:IPTV|UDP|127.0.0.1|1234:P:0:512:650:2321:0:1:0:0:0
|
TV1;IPTV:10:IPTV|S1P0|UDP|127.0.0.1|1234:P:0:512:650:2321:0:1:0:0:0
|
||||||
^ ^ ^ ^ ^ ^
|
^ ^ ^ ^ ^ ^ ^
|
||||||
| | | | | Source type ("P")
|
| | | | | | Source type ("P")
|
||||||
| | | | IP Port Number, File delay (ms), Script parameter
|
| | | | | IP Port Number, File delay (ms), Script parameter
|
||||||
| | | IP Address, File location, Script location
|
| | | | IP Address, File location, Script location
|
||||||
| | Protocol ("UDP", "HTTP", "FILE", "EXT")
|
| | | Protocol ("UDP", "HTTP", "FILE", "EXT")
|
||||||
| Plugin ID ("IPTV")
|
| | Parameters ("S" Sid scan, "P" Pid scan, "0" disable, "1" enable)
|
||||||
|
| Plugin ID ("IPTV")
|
||||||
Unique enumeration
|
Unique enumeration
|
||||||
|
|
||||||
- UDP multicast rules for iptables firewall
|
- UDP multicast rules for iptables firewall
|
||||||
@@ -158,8 +163,20 @@ Notes:
|
|||||||
- The following section filters are recommended to be disabled:
|
- The following section filters are recommended to be disabled:
|
||||||
"NIT (0x40)", "SDT (0x42)", "TDT (0x70)"
|
"NIT (0x40)", "SDT (0x42)", "TDT (0x70)"
|
||||||
|
|
||||||
|
- The IPTV devices look for a "/tmp/vdr-iptv<devicenumber>.dvr" fifo at
|
||||||
|
startup. If the fifo is found and succesfully opened, the device writes
|
||||||
|
the current data stream into it. This can be used for debugging purposes.
|
||||||
|
|
||||||
|
- Multiple channels with identical service id should have frequency
|
||||||
|
difference of 4 or greater. It's recommended to use frequencies in decades
|
||||||
|
(10, 20, 30, 40, ...) for all IPTV channel entries.
|
||||||
|
|
||||||
|
- VLC processes won't get killed on some setups with the provided iptvstream.sh
|
||||||
|
script and the iptvstream-notrap.sh script should be used instead in these
|
||||||
|
cases.
|
||||||
|
|
||||||
Acknowledgements:
|
Acknowledgements:
|
||||||
|
|
||||||
- The IPTV section filtering code is derived from Linux kernel.
|
- The IPTV section filtering code is derived from Linux kernel.
|
||||||
|
|
||||||
- Udo Richter's po2i18n package is used to support VDR's old i18n system.
|
- The pid scanning code is derived from Udo Richter's streamplayer plugin.
|
||||||
|
|||||||
9
common.c
9
common.c
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: common.c,v 1.8 2007/10/26 23:18:50 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vdr/tools.h>
|
#include <vdr/tools.h>
|
||||||
@@ -11,7 +10,7 @@
|
|||||||
|
|
||||||
uint16_t ts_pid(const uint8_t *buf)
|
uint16_t ts_pid(const uint8_t *buf)
|
||||||
{
|
{
|
||||||
return ((buf[1] & 0x1f) << 8) + buf[2];
|
return (uint16_t)(((buf[1] & 0x1f) << 8) + buf[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t payload(const uint8_t *tsp)
|
uint8_t payload(const uint8_t *tsp)
|
||||||
@@ -23,7 +22,7 @@ uint8_t payload(const uint8_t *tsp)
|
|||||||
if (tsp[4] > 183) // corrupted data?
|
if (tsp[4] > 183) // corrupted data?
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return 184 - 1 - tsp[4];
|
return (uint8_t)((184 - 1) - tsp[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 184;
|
return 184;
|
||||||
@@ -50,9 +49,9 @@ int select_single_desc(int descriptor, const int usecs, const bool selectWrite)
|
|||||||
FD_SET(descriptor, &fds);
|
FD_SET(descriptor, &fds);
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
if (selectWrite)
|
if (selectWrite)
|
||||||
retval = select(descriptor + 1, NULL, &fds, NULL, &tv);
|
retval = select(descriptor + 1, NULL, &fds, NULL, &tv);
|
||||||
else
|
else
|
||||||
retval = select(descriptor + 1, &fds, NULL, NULL, &tv);
|
retval = select(descriptor + 1, &fds, NULL, NULL, &tv);
|
||||||
// Check if error
|
// Check if error
|
||||||
ERROR_IF_RET(retval < 0, "select()", return retval);
|
ERROR_IF_RET(retval < 0, "select()", return retval);
|
||||||
return retval;
|
return retval;
|
||||||
|
|||||||
23
common.h
23
common.h
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: common.h,v 1.18 2007/10/28 16:22:44 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_COMMON_H
|
#ifndef __IPTV_COMMON_H
|
||||||
@@ -15,10 +14,10 @@
|
|||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define debug(x...) dsyslog("IPTV: " x);
|
#define debug(x...) dsyslog("IPTV: " x);
|
||||||
#define error(x...) esyslog("IPTV: " x);
|
#define error(x...) esyslog("ERROR: " x);
|
||||||
#else
|
#else
|
||||||
#define debug(x...) ;
|
#define debug(x...) ;
|
||||||
#define error(x...) esyslog("IPTV: " x);
|
#define error(x...) esyslog("ERROR: " x);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef trNOOP
|
#ifndef trNOOP
|
||||||
@@ -29,6 +28,8 @@
|
|||||||
#define trVDR(s) tr(s)
|
#define trVDR(s) tr(s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr"
|
||||||
|
|
||||||
#define IPTV_DEVICE_INFO_ALL 0
|
#define IPTV_DEVICE_INFO_ALL 0
|
||||||
#define IPTV_DEVICE_INFO_GENERAL 1
|
#define IPTV_DEVICE_INFO_GENERAL 1
|
||||||
#define IPTV_DEVICE_INFO_PIDS 2
|
#define IPTV_DEVICE_INFO_PIDS 2
|
||||||
@@ -40,13 +41,13 @@
|
|||||||
#define SECTION_FILTER_TABLE_SIZE 7
|
#define SECTION_FILTER_TABLE_SIZE 7
|
||||||
|
|
||||||
#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("ERROR: "errstr": %s", strerror_r(errno, tmp, sizeof(tmp))); \
|
error(errstr": %s", strerror_r(errno, tmp, sizeof(tmp))); \
|
||||||
func; \
|
func; \
|
||||||
ret; \
|
ret; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +64,8 @@
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||||
|
|
||||||
uint16_t ts_pid(const uint8_t *buf);
|
uint16_t ts_pid(const uint8_t *buf);
|
||||||
uint8_t payload(const uint8_t *tsp);
|
uint8_t payload(const uint8_t *tsp);
|
||||||
const char *id_pid(const u_short Pid);
|
const char *id_pid(const u_short Pid);
|
||||||
|
|||||||
21
config.c
21
config.c
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.c,v 1.18 2007/10/20 17:26:46 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -11,35 +10,33 @@
|
|||||||
cIptvConfig IptvConfig;
|
cIptvConfig IptvConfig;
|
||||||
|
|
||||||
cIptvConfig::cIptvConfig(void)
|
cIptvConfig::cIptvConfig(void)
|
||||||
: readBufferTsCount(48),
|
: tsBufferSize(2),
|
||||||
tsBufferSize(2),
|
|
||||||
tsBufferPrefillRatio(0),
|
tsBufferPrefillRatio(0),
|
||||||
extProtocolBasePort(4321),
|
extProtocolBasePort(4321),
|
||||||
useBytes(1),
|
useBytes(1),
|
||||||
sectionFiltering(1),
|
sectionFiltering(1)
|
||||||
sidScanning(1)
|
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < sizeof(disabledFilters); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters); ++i)
|
||||||
disabledFilters[i] = -1;
|
disabledFilters[i] = -1;
|
||||||
memset(configDirectory, '\0', sizeof(configDirectory));
|
memset(configDirectory, '\0', sizeof(configDirectory));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int cIptvConfig::GetDisabledFiltersCount(void)
|
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
|
||||||
{
|
{
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
while ((disabledFilters[n] != -1) && (n < sizeof(disabledFilters)))
|
while ((n < ARRAY_SIZE(disabledFilters) && (disabledFilters[n] != -1)))
|
||||||
n++;
|
n++;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvConfig::GetDisabledFilters(unsigned int Index)
|
int cIptvConfig::GetDisabledFilters(unsigned int Index) const
|
||||||
{
|
{
|
||||||
return (Index < sizeof(disabledFilters)) ? disabledFilters[Index] : -1;
|
return (Index < ARRAY_SIZE(disabledFilters)) ? disabledFilters[Index] : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvConfig::SetDisabledFilters(unsigned int Index, int Number)
|
void cIptvConfig::SetDisabledFilters(unsigned int Index, int Number)
|
||||||
{
|
{
|
||||||
if (Index < sizeof(disabledFilters))
|
if (Index < ARRAY_SIZE(disabledFilters))
|
||||||
disabledFilters[Index] = Number;
|
disabledFilters[Index] = Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
22
config.h
22
config.h
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.h,v 1.17 2007/10/28 16:22:44 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_CONFIG_H
|
#ifndef __IPTV_CONFIG_H
|
||||||
@@ -15,34 +14,29 @@
|
|||||||
class cIptvConfig
|
class cIptvConfig
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unsigned int readBufferTsCount;
|
|
||||||
unsigned int tsBufferSize;
|
unsigned int tsBufferSize;
|
||||||
unsigned int tsBufferPrefillRatio;
|
unsigned int tsBufferPrefillRatio;
|
||||||
unsigned int extProtocolBasePort;
|
unsigned int extProtocolBasePort;
|
||||||
unsigned int useBytes;
|
unsigned int useBytes;
|
||||||
unsigned int sectionFiltering;
|
unsigned int sectionFiltering;
|
||||||
unsigned int sidScanning;
|
|
||||||
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
||||||
char configDirectory[255];
|
char configDirectory[255];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cIptvConfig();
|
cIptvConfig();
|
||||||
unsigned int GetReadBufferTsCount(void) { return readBufferTsCount; }
|
unsigned int GetTsBufferSize(void) const { return tsBufferSize; }
|
||||||
unsigned int GetTsBufferSize(void) { return tsBufferSize; }
|
unsigned int GetTsBufferPrefillRatio(void) const { return tsBufferPrefillRatio; }
|
||||||
unsigned int GetTsBufferPrefillRatio(void) { return tsBufferPrefillRatio; }
|
unsigned int GetExtProtocolBasePort(void) const { return extProtocolBasePort; }
|
||||||
unsigned int GetExtProtocolBasePort(void) { return extProtocolBasePort; }
|
unsigned int GetUseBytes(void) const { return useBytes; }
|
||||||
unsigned int GetUseBytes(void) { return useBytes; }
|
unsigned int GetSectionFiltering(void) const { return sectionFiltering; }
|
||||||
unsigned int GetSectionFiltering(void) { return sectionFiltering; }
|
const char *GetConfigDirectory(void) const { return configDirectory; }
|
||||||
unsigned int GetSidScanning(void) { return sidScanning; }
|
unsigned int GetDisabledFiltersCount(void) const;
|
||||||
const char *GetConfigDirectory(void) { return configDirectory; }
|
int GetDisabledFilters(unsigned int Index) const;
|
||||||
unsigned int GetDisabledFiltersCount(void);
|
|
||||||
int GetDisabledFilters(unsigned int Index);
|
|
||||||
void SetTsBufferSize(unsigned int Size) { tsBufferSize = Size; }
|
void SetTsBufferSize(unsigned int Size) { tsBufferSize = Size; }
|
||||||
void SetTsBufferPrefillRatio(unsigned int Ratio) { tsBufferPrefillRatio = Ratio; }
|
void SetTsBufferPrefillRatio(unsigned int Ratio) { tsBufferPrefillRatio = Ratio; }
|
||||||
void SetExtProtocolBasePort(unsigned int PortNumber) { extProtocolBasePort = PortNumber; }
|
void SetExtProtocolBasePort(unsigned int PortNumber) { extProtocolBasePort = PortNumber; }
|
||||||
void SetUseBytes(unsigned int On) { useBytes = On; }
|
void SetUseBytes(unsigned int On) { useBytes = On; }
|
||||||
void SetSectionFiltering(unsigned int On) { sectionFiltering = On; }
|
void SetSectionFiltering(unsigned int On) { sectionFiltering = On; }
|
||||||
void SetSidScanning(unsigned int On) { sidScanning = On; }
|
|
||||||
void SetDisabledFilters(unsigned int Index, int Number);
|
void SetDisabledFilters(unsigned int Index, int Number);
|
||||||
void SetConfigDirectory(const char *directoryP);
|
void SetConfigDirectory(const char *directoryP);
|
||||||
};
|
};
|
||||||
|
|||||||
145
device.c
145
device.c
@@ -3,54 +3,69 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: device.c,v 1.76 2007/10/26 23:48:30 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
|
|
||||||
#define IPTV_MAX_DEVICES 8
|
#define IPTV_MAX_DEVICES MAXDEVICES
|
||||||
|
|
||||||
cIptvDevice * IptvDevices[IPTV_MAX_DEVICES] = { NULL };
|
static cIptvDevice * IptvDevices[IPTV_MAX_DEVICES] = { NULL };
|
||||||
|
|
||||||
unsigned int cIptvDevice::deviceCount = 0;
|
unsigned int cIptvDevice::deviceCount = 0;
|
||||||
|
|
||||||
cIptvDevice::cIptvDevice(unsigned int Index)
|
cIptvDevice::cIptvDevice(unsigned int Index)
|
||||||
: deviceIndex(Index),
|
: deviceIndex(Index),
|
||||||
|
dvrFd(-1),
|
||||||
isPacketDelivered(false),
|
isPacketDelivered(false),
|
||||||
isOpenDvr(false),
|
isOpenDvr(false),
|
||||||
mutex()
|
sidScanEnabled(false),
|
||||||
|
pidScanEnabled(false)
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::cIptvDevice(%d)\n", deviceIndex);
|
unsigned int bufsize = MEGABYTE(IptvConfig.GetTsBufferSize());
|
||||||
tsBuffer = new cRingBufferLinear(MEGABYTE(IptvConfig.GetTsBufferSize()),
|
bufsize -= (bufsize % TS_SIZE);
|
||||||
(TS_SIZE * IptvConfig.GetReadBufferTsCount()),
|
isyslog("creating IPTV device %d (CardIndex=%d)", deviceIndex, CardIndex());
|
||||||
false, "IPTV");
|
tsBuffer = new cRingBufferLinear(bufsize + 1, TS_SIZE, false,
|
||||||
tsBuffer->SetTimeouts(100, 100);
|
*cString::sprintf("IPTV %d", deviceIndex));
|
||||||
|
tsBuffer->SetTimeouts(10, 10);
|
||||||
ResetBuffering();
|
ResetBuffering();
|
||||||
pUdpProtocol = new cIptvProtocolUdp();
|
pUdpProtocol = new cIptvProtocolUdp();
|
||||||
pHttpProtocol = new cIptvProtocolHttp();
|
pHttpProtocol = new cIptvProtocolHttp();
|
||||||
pFileProtocol = new cIptvProtocolFile();
|
pFileProtocol = new cIptvProtocolFile();
|
||||||
pExtProtocol = new cIptvProtocolExt();
|
pExtProtocol = new cIptvProtocolExt();
|
||||||
pIptvStreamer = new cIptvStreamer(tsBuffer, &mutex);
|
pIptvStreamer = new cIptvStreamer(tsBuffer, (100 * TS_SIZE));
|
||||||
|
pPidScanner = new cPidScanner;
|
||||||
// Initialize filter pointers
|
// Initialize filter pointers
|
||||||
memset(&secfilters, '\0', sizeof(secfilters));
|
memset(secfilters, '\0', sizeof(secfilters));
|
||||||
// Start section handler for iptv device
|
// Start section handler for iptv device
|
||||||
StartSectionHandler();
|
StartSectionHandler();
|
||||||
// Sid scanner must be created after the section handler
|
// Sid scanner must be created after the section handler
|
||||||
pSidScanner = new cSidScanner;
|
pSidScanner = new cSidScanner;
|
||||||
if (pSidScanner)
|
if (pSidScanner)
|
||||||
AttachFilter(pSidScanner);
|
AttachFilter(pSidScanner);
|
||||||
|
// Check if dvr fifo exists
|
||||||
|
struct stat sb;
|
||||||
|
cString filename = cString::sprintf(IPTV_DVR_FILENAME, deviceIndex);
|
||||||
|
stat(filename, &sb);
|
||||||
|
if (S_ISFIFO(sb.st_mode)) {
|
||||||
|
dvrFd = open(filename, O_RDWR | O_NONBLOCK);
|
||||||
|
if (dvrFd >= 0)
|
||||||
|
dsyslog("IPTV device %d redirecting input stream to '%s'", deviceIndex, *filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvDevice::~cIptvDevice()
|
cIptvDevice::~cIptvDevice()
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::~cIptvDevice(%d)\n", deviceIndex);
|
debug("cIptvDevice::~cIptvDevice(%d)\n", deviceIndex);
|
||||||
|
// Stop section handler of iptv device
|
||||||
|
StopSectionHandler();
|
||||||
DELETE_POINTER(pIptvStreamer);
|
DELETE_POINTER(pIptvStreamer);
|
||||||
DELETE_POINTER(pUdpProtocol);
|
DELETE_POINTER(pUdpProtocol);
|
||||||
DELETE_POINTER(pHttpProtocol);
|
DELETE_POINTER(pHttpProtocol);
|
||||||
DELETE_POINTER(pFileProtocol);
|
DELETE_POINTER(pFileProtocol);
|
||||||
DELETE_POINTER(pExtProtocol);
|
DELETE_POINTER(pExtProtocol);
|
||||||
DELETE_POINTER(tsBuffer);
|
DELETE_POINTER(tsBuffer);
|
||||||
|
DELETE_POINTER(pPidScanner);
|
||||||
// Detach and destroy sid filter
|
// Detach and destroy sid filter
|
||||||
if (pSidScanner) {
|
if (pSidScanner) {
|
||||||
Detach(pSidScanner);
|
Detach(pSidScanner);
|
||||||
@@ -59,6 +74,12 @@ cIptvDevice::~cIptvDevice()
|
|||||||
// Destroy all filters
|
// Destroy all filters
|
||||||
for (int i = 0; i < eMaxSecFilterCount; ++i)
|
for (int i = 0; i < eMaxSecFilterCount; ++i)
|
||||||
DeleteFilter(i);
|
DeleteFilter(i);
|
||||||
|
// Close dvr fifo
|
||||||
|
if (dvrFd >= 0) {
|
||||||
|
int fd = dvrFd;
|
||||||
|
dvrFd = -1;
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvDevice::Initialize(unsigned int DeviceCount)
|
bool cIptvDevice::Initialize(unsigned int DeviceCount)
|
||||||
@@ -102,15 +123,15 @@ cString cIptvDevice::GetGeneralInformation(void)
|
|||||||
return cString::sprintf("IPTV device: %d\nCardIndex: %d\n%s%s%sChannel: %s",
|
return cString::sprintf("IPTV device: %d\nCardIndex: %d\n%s%s%sChannel: %s",
|
||||||
deviceIndex, CardIndex(),
|
deviceIndex, CardIndex(),
|
||||||
pIptvStreamer ? *pIptvStreamer->GetInformation() : "",
|
pIptvStreamer ? *pIptvStreamer->GetInformation() : "",
|
||||||
pIptvStreamer ? *pIptvStreamer->GetStatistic() : "",
|
pIptvStreamer ? *pIptvStreamer->GetStreamerStatistic() : "",
|
||||||
*cIptvBufferStatistics::GetStatistic(),
|
*GetBufferStatistic(),
|
||||||
*Channels.GetByNumber(cDevice::CurrentChannel())->ToText());
|
*Channels.GetByNumber(cDevice::CurrentChannel())->ToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvDevice::GetPidsInformation(void)
|
cString cIptvDevice::GetPidsInformation(void)
|
||||||
{
|
{
|
||||||
//debug("cIptvDevice::GetPidsInformation(%d)\n", deviceIndex);
|
//debug("cIptvDevice::GetPidsInformation(%d)\n", deviceIndex);
|
||||||
return cIptvPidStatistics::GetStatistic();
|
return GetPidStatistic();
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvDevice::GetFiltersInformation(void)
|
cString cIptvDevice::GetFiltersInformation(void)
|
||||||
@@ -122,7 +143,7 @@ cString cIptvDevice::GetFiltersInformation(void)
|
|||||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||||
if (secfilters[i]) {
|
if (secfilters[i]) {
|
||||||
info = cString::sprintf("%sFilter %d: %s Pid=0x%02X (%s)\n", *info, i,
|
info = cString::sprintf("%sFilter %d: %s Pid=0x%02X (%s)\n", *info, i,
|
||||||
*secfilters[i]->GetStatistic(), secfilters[i]->GetPid(),
|
*secfilters[i]->GetSectionStatistic(), secfilters[i]->GetPid(),
|
||||||
id_pid(secfilters[i]->GetPid()));
|
id_pid(secfilters[i]->GetPid()));
|
||||||
if (++count > IPTV_STATS_ACTIVE_FILTERS_COUNT)
|
if (++count > IPTV_STATS_ACTIVE_FILTERS_COUNT)
|
||||||
break;
|
break;
|
||||||
@@ -155,13 +176,34 @@ cString cIptvDevice::GetInformation(unsigned int Page)
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvDevice::GetChannelSettings(const char *IptvParam, int *Parameter, cIptvProtocolIf* *Protocol)
|
cString cIptvDevice::GetChannelSettings(const char *IptvParam, int *Parameter, int *SidScan, int *PidScan, cIptvProtocolIf* *Protocol)
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
|
debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
|
||||||
char *tag = NULL;
|
char *tag = NULL;
|
||||||
char *proto = NULL;
|
char *proto = NULL;
|
||||||
char *loc = NULL;
|
char *loc = NULL;
|
||||||
if (sscanf(IptvParam, "%a[^|]|%a[^|]|%a[^|]|%u", &tag, &proto, &loc, Parameter) == 4) {
|
if (sscanf(IptvParam, "%a[^|]|S%dP%d|%a[^|]|%a[^|]|%u", &tag, SidScan, PidScan, &proto, &loc, Parameter) == 6) {
|
||||||
|
cString tagstr(tag, true);
|
||||||
|
cString protostr(proto, true);
|
||||||
|
cString locstr(loc, true);
|
||||||
|
// check if IPTV tag
|
||||||
|
if (strncasecmp(*tagstr, "IPTV", 4) == 0) {
|
||||||
|
// check if protocol is supported and update the pointer
|
||||||
|
if (strncasecmp(*protostr, "UDP", 3) == 0)
|
||||||
|
*Protocol = pUdpProtocol;
|
||||||
|
else if (strncasecmp(*protostr, "HTTP", 4) == 0)
|
||||||
|
*Protocol = pHttpProtocol;
|
||||||
|
else if (strncasecmp(*protostr, "FILE", 4) == 0)
|
||||||
|
*Protocol = pFileProtocol;
|
||||||
|
else if (strncasecmp(*protostr, "EXT", 3) == 0)
|
||||||
|
*Protocol = pExtProtocol;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
// return location
|
||||||
|
return locstr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sscanf(IptvParam, "%a[^|]|P%dS%d|%a[^|]|%a[^|]|%u", &tag, PidScan, SidScan, &proto, &loc, Parameter) == 6) {
|
||||||
cString tagstr(tag, true);
|
cString tagstr(tag, true);
|
||||||
cString protostr(proto, true);
|
cString protostr(proto, true);
|
||||||
cString locstr(loc, true);
|
cString locstr(loc, true);
|
||||||
@@ -216,21 +258,31 @@ bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *N
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cIptvDevice::NumProvidedSystems(void) const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
|
bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
|
||||||
{
|
{
|
||||||
int parameter;
|
int parameter, sidscan, pidscan;
|
||||||
cString location;
|
cString location;
|
||||||
cIptvProtocolIf *protocol;
|
cIptvProtocolIf *protocol;
|
||||||
|
|
||||||
debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex);
|
debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex);
|
||||||
location = GetChannelSettings(Channel->PluginParam(), ¶meter, &protocol);
|
location = GetChannelSettings(Channel->PluginParam(), ¶meter, &sidscan, &pidscan, &protocol);
|
||||||
if (isempty(location)) {
|
if (isempty(location)) {
|
||||||
error("ERROR: Unrecognized IPTV channel settings: %s", Channel->PluginParam());
|
error("Unrecognized IPTV channel settings: %s", Channel->PluginParam());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
pIptvStreamer->Set(location, parameter, deviceIndex, protocol);
|
sidScanEnabled = sidscan ? true : false;
|
||||||
if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
|
pidScanEnabled = pidscan ? true : false;
|
||||||
pSidScanner->SetChannel(Channel);
|
if (pIptvStreamer->Set(location, parameter, deviceIndex, protocol)) {
|
||||||
|
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||||
|
pSidScanner->SetChannel(Channel);
|
||||||
|
if (pidScanEnabled && pPidScanner)
|
||||||
|
pPidScanner->SetChannel(Channel);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +304,7 @@ bool cIptvDevice::DeleteFilter(unsigned int Index)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvDevice::IsBlackListed(u_short Pid, u_char Tid, u_char Mask)
|
bool cIptvDevice::IsBlackListed(u_short Pid, u_char Tid, u_char Mask) const
|
||||||
{
|
{
|
||||||
//debug("cIptvDevice::IsBlackListed(%d) Pid=%d Tid=%02X Mask=%02X\n", deviceIndex, Pid, Tid, Mask);
|
//debug("cIptvDevice::IsBlackListed(%d) Pid=%d Tid=%02X Mask=%02X\n", deviceIndex, Pid, Tid, Mask);
|
||||||
// loop through section filter table
|
// loop through section filter table
|
||||||
@@ -277,11 +329,13 @@ int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask)
|
|||||||
// Blacklist check, refuse certain filters
|
// Blacklist check, refuse certain filters
|
||||||
if (IsBlackListed(Pid, Tid, Mask))
|
if (IsBlackListed(Pid, Tid, Mask))
|
||||||
return -1;
|
return -1;
|
||||||
|
// Lock
|
||||||
|
cMutexLock MutexLock(&mutex);
|
||||||
// Search the next free filter slot
|
// Search the next free filter slot
|
||||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||||
if (!secfilters[i]) {
|
if (!secfilters[i]) {
|
||||||
//debug("cIptvDevice::OpenFilter(%d): Pid=%d Tid=%02X Mask=%02X Index=%d\n", deviceIndex, Pid, Tid, Mask, i);
|
//debug("cIptvDevice::OpenFilter(%d): Pid=%d Tid=%02X Mask=%02X Index=%d\n", deviceIndex, Pid, Tid, Mask, i);
|
||||||
secfilters[i] = new cIptvSectionFilter(i, deviceIndex, Pid, Tid, Mask);
|
secfilters[i] = new cIptvSectionFilter(deviceIndex, i, Pid, Tid, Mask);
|
||||||
return secfilters[i]->GetReadDesc();
|
return secfilters[i]->GetReadDesc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,6 +345,9 @@ int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask)
|
|||||||
|
|
||||||
void cIptvDevice::CloseFilter(int Handle)
|
void cIptvDevice::CloseFilter(int Handle)
|
||||||
{
|
{
|
||||||
|
// Lock
|
||||||
|
cMutexLock MutexLock(&mutex);
|
||||||
|
// Search the filter for deletion
|
||||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||||
if (secfilters[i] && (Handle == secfilters[i]->GetReadDesc())) {
|
if (secfilters[i] && (Handle == secfilters[i]->GetReadDesc())) {
|
||||||
//debug("cIptvDevice::CloseFilter(%d): %d\n", deviceIndex, Handle);
|
//debug("cIptvDevice::CloseFilter(%d): %d\n", deviceIndex, Handle);
|
||||||
@@ -303,14 +360,13 @@ void cIptvDevice::CloseFilter(int Handle)
|
|||||||
bool cIptvDevice::OpenDvr(void)
|
bool cIptvDevice::OpenDvr(void)
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::OpenDvr(%d)\n", deviceIndex);
|
debug("cIptvDevice::OpenDvr(%d)\n", deviceIndex);
|
||||||
mutex.Lock();
|
|
||||||
isPacketDelivered = false;
|
isPacketDelivered = false;
|
||||||
tsBuffer->Clear();
|
tsBuffer->Clear();
|
||||||
mutex.Unlock();
|
|
||||||
ResetBuffering();
|
ResetBuffering();
|
||||||
pIptvStreamer->Open();
|
if (pIptvStreamer)
|
||||||
if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
|
pIptvStreamer->Open();
|
||||||
pSidScanner->SetStatus(true);
|
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||||
|
pSidScanner->Open();
|
||||||
isOpenDvr = true;
|
isOpenDvr = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -318,9 +374,10 @@ bool cIptvDevice::OpenDvr(void)
|
|||||||
void cIptvDevice::CloseDvr(void)
|
void cIptvDevice::CloseDvr(void)
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::CloseDvr(%d)\n", deviceIndex);
|
debug("cIptvDevice::CloseDvr(%d)\n", deviceIndex);
|
||||||
if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
|
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||||
pSidScanner->SetStatus(false);
|
pSidScanner->Close();
|
||||||
pIptvStreamer->Close();
|
if (pIptvStreamer)
|
||||||
|
pIptvStreamer->Close();
|
||||||
isOpenDvr = false;
|
isOpenDvr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,12 +410,12 @@ bool cIptvDevice::GetTSPacket(uchar *&Data)
|
|||||||
{
|
{
|
||||||
int Count = 0;
|
int Count = 0;
|
||||||
//debug("cIptvDevice::GetTSPacket(%d)\n", deviceIndex);
|
//debug("cIptvDevice::GetTSPacket(%d)\n", deviceIndex);
|
||||||
if (!IsBuffering()) {
|
if (tsBuffer && !IsBuffering()) {
|
||||||
if (isPacketDelivered) {
|
if (isPacketDelivered) {
|
||||||
tsBuffer->Del(TS_SIZE);
|
tsBuffer->Del(TS_SIZE);
|
||||||
isPacketDelivered = false;
|
isPacketDelivered = false;
|
||||||
// Update buffer statistics
|
// Update buffer statistics
|
||||||
cIptvBufferStatistics::AddStatistic(TS_SIZE, tsBuffer->Available());
|
AddBufferStatistic(TS_SIZE, tsBuffer->Available());
|
||||||
}
|
}
|
||||||
uchar *p = tsBuffer->Get(Count);
|
uchar *p = tsBuffer->Get(Count);
|
||||||
if (p && Count >= TS_SIZE) {
|
if (p && Count >= TS_SIZE) {
|
||||||
@@ -370,23 +427,31 @@ bool cIptvDevice::GetTSPacket(uchar *&Data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tsBuffer->Del(Count);
|
tsBuffer->Del(Count);
|
||||||
error("ERROR: skipped %d bytes to sync on TS packet\n", Count);
|
error("Skipped %d bytes to sync on TS packet\n", Count);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
isPacketDelivered = true;
|
isPacketDelivered = true;
|
||||||
Data = p;
|
Data = p;
|
||||||
// Update pid statistics
|
// Update pid statistics
|
||||||
cIptvPidStatistics::AddStatistic(ts_pid(p), payload(p));
|
AddPidStatistic(ts_pid(p), payload(p));
|
||||||
|
// Send data also to dvr fifo
|
||||||
|
if (dvrFd >= 0)
|
||||||
|
Count = (int)write(dvrFd, p, TS_SIZE);
|
||||||
|
// Analyze incomplete streams with built-in pid analyzer
|
||||||
|
if (pidScanEnabled && pPidScanner)
|
||||||
|
pPidScanner->Process(p);
|
||||||
|
// Lock
|
||||||
|
cMutexLock MutexLock(&mutex);
|
||||||
// Run the data through all filters
|
// Run the data through all filters
|
||||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||||
if (secfilters[i])
|
if (secfilters[i])
|
||||||
secfilters[i]->ProcessData(p);
|
secfilters[i]->Process(p);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Reduce cpu load by preventing busylooping
|
// Reduce cpu load by preventing busylooping
|
||||||
cCondWait::SleepMs(100);
|
cCondWait::SleepMs(10);
|
||||||
Data = NULL;
|
Data = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
17
device.h
17
device.h
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: device.h,v 1.34 2007/10/19 21:36:28 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_DEVICE_H
|
#ifndef __IPTV_DEVICE_H
|
||||||
@@ -17,6 +16,7 @@
|
|||||||
#include "protocolext.h"
|
#include "protocolext.h"
|
||||||
#include "streamer.h"
|
#include "streamer.h"
|
||||||
#include "sectionfilter.h"
|
#include "sectionfilter.h"
|
||||||
|
#include "pidscanner.h"
|
||||||
#include "sidscanner.h"
|
#include "sidscanner.h"
|
||||||
#include "statistics.h"
|
#include "statistics.h"
|
||||||
|
|
||||||
@@ -34,8 +34,11 @@ private:
|
|||||||
eMaxSecFilterCount = 32
|
eMaxSecFilterCount = 32
|
||||||
};
|
};
|
||||||
unsigned int deviceIndex;
|
unsigned int deviceIndex;
|
||||||
|
int dvrFd;
|
||||||
bool isPacketDelivered;
|
bool isPacketDelivered;
|
||||||
bool isOpenDvr;
|
bool isOpenDvr;
|
||||||
|
bool sidScanEnabled;
|
||||||
|
bool pidScanEnabled;
|
||||||
cRingBufferLinear *tsBuffer;
|
cRingBufferLinear *tsBuffer;
|
||||||
int tsBufferPrefill;
|
int tsBufferPrefill;
|
||||||
cIptvProtocolUdp *pUdpProtocol;
|
cIptvProtocolUdp *pUdpProtocol;
|
||||||
@@ -43,6 +46,7 @@ private:
|
|||||||
cIptvProtocolFile *pFileProtocol;
|
cIptvProtocolFile *pFileProtocol;
|
||||||
cIptvProtocolExt *pExtProtocol;
|
cIptvProtocolExt *pExtProtocol;
|
||||||
cIptvStreamer *pIptvStreamer;
|
cIptvStreamer *pIptvStreamer;
|
||||||
|
cPidScanner *pPidScanner;
|
||||||
cSidScanner *pSidScanner;
|
cSidScanner *pSidScanner;
|
||||||
cMutex mutex;
|
cMutex mutex;
|
||||||
cIptvSectionFilter* secfilters[eMaxSecFilterCount];
|
cIptvSectionFilter* secfilters[eMaxSecFilterCount];
|
||||||
@@ -53,26 +57,31 @@ public:
|
|||||||
virtual ~cIptvDevice();
|
virtual ~cIptvDevice();
|
||||||
cString GetInformation(unsigned int Page = IPTV_DEVICE_INFO_ALL);
|
cString GetInformation(unsigned int Page = IPTV_DEVICE_INFO_ALL);
|
||||||
|
|
||||||
// for statistics and general information
|
// copy and assignment constructors
|
||||||
private:
|
private:
|
||||||
|
cIptvDevice(const cIptvDevice&);
|
||||||
|
cIptvDevice& operator=(const cIptvDevice&);
|
||||||
|
|
||||||
|
// for statistics and general information
|
||||||
cString GetGeneralInformation(void);
|
cString GetGeneralInformation(void);
|
||||||
cString GetPidsInformation(void);
|
cString GetPidsInformation(void);
|
||||||
cString GetFiltersInformation(void);
|
cString GetFiltersInformation(void);
|
||||||
|
|
||||||
// for channel parsing & buffering
|
// for channel parsing & buffering
|
||||||
private:
|
private:
|
||||||
cString GetChannelSettings(const char *IptvParam, int *Parameter, cIptvProtocolIf* *Protocol);
|
cString GetChannelSettings(const char *IptvParam, int *Parameter, int *SidScan, int *PidScan, cIptvProtocolIf* *Protocol);
|
||||||
bool ProvidesIptv(const char *Param) const;
|
bool ProvidesIptv(const char *Param) const;
|
||||||
void ResetBuffering(void);
|
void ResetBuffering(void);
|
||||||
bool IsBuffering(void);
|
bool IsBuffering(void);
|
||||||
bool DeleteFilter(unsigned int Index);
|
bool DeleteFilter(unsigned int Index);
|
||||||
bool IsBlackListed(u_short Pid, u_char Tid, u_char Mask);
|
bool IsBlackListed(u_short Pid, u_char Tid, u_char Mask) const;
|
||||||
|
|
||||||
// for channel selection
|
// for channel selection
|
||||||
public:
|
public:
|
||||||
virtual bool ProvidesSource(int Source) const;
|
virtual bool ProvidesSource(int Source) const;
|
||||||
virtual bool ProvidesTransponder(const cChannel *Channel) const;
|
virtual bool ProvidesTransponder(const cChannel *Channel) const;
|
||||||
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
|
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
|
||||||
|
virtual int NumProvidedSystems(void) const;
|
||||||
protected:
|
protected:
|
||||||
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* i18n.c: IPTV plugin for the Video Disk Recorder
|
|
||||||
*
|
|
||||||
* See the README file for copyright information and how to reach the author.
|
|
||||||
*
|
|
||||||
* $Id: i18n-template.c,v 1.1 2007/10/28 16:22:44 rahrenbe Exp $
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "i18n.h"
|
|
||||||
|
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM < 10507
|
|
||||||
const tI18nPhrase IptvPhrases[] = {
|
|
||||||
// START I18N
|
|
||||||
// END I18N
|
|
||||||
{ NULL }
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
18
i18n.h
18
i18n.h
@@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* i18n.h: IPTV plugin for the Video Disk Recorder
|
|
||||||
*
|
|
||||||
* See the README file for copyright information and how to reach the author.
|
|
||||||
*
|
|
||||||
* $Id: i18n.h,v 1.1 2007/10/28 16:22:44 rahrenbe Exp $
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __IPTV_I18N_H
|
|
||||||
#define __IPTV_I18N_H
|
|
||||||
|
|
||||||
#include <vdr/i18n.h>
|
|
||||||
|
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM < 10507
|
|
||||||
extern const tI18nPhrase IptvPhrases[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // __IPTV_I18N_H
|
|
||||||
59
iptv.c
59
iptv.c
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: iptv.c,v 1.27 2007/10/28 16:22:44 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@@ -12,17 +11,16 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "i18n.h"
|
|
||||||
|
|
||||||
#ifndef PLUGINPARAMPATCHVERSNUM
|
#ifndef PLUGINPARAMPATCHVERSNUM
|
||||||
#error "You must apply the pluginparam patch for VDR!"
|
#error "You must apply the pluginparam patch for VDR!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM < 10510 && !defined(CLOSEFILTERPATCHVERSNUM)
|
#if defined(APIVERSNUM) && APIVERSNUM < 10600
|
||||||
#error "You must apply the closefilter patch for VDR!"
|
#error "VDR-1.6.0 API version or greater is required!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char VERSION[] = "0.0.3";
|
static const char VERSION[] = "0.3.1";
|
||||||
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
|
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
|
||||||
|
|
||||||
class cPluginIptv : public cPlugin {
|
class cPluginIptv : public cPlugin {
|
||||||
@@ -79,20 +77,20 @@ bool cPluginIptv::ProcessArgs(int argc, char *argv[])
|
|||||||
debug("cPluginIptv::ProcessArgs()\n");
|
debug("cPluginIptv::ProcessArgs()\n");
|
||||||
// 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' },
|
||||||
{ NULL }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt_long(argc, argv, "d:", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "d:", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'd':
|
case 'd':
|
||||||
deviceCount = atoi(optarg);
|
deviceCount = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,9 +98,6 @@ bool cPluginIptv::Initialize(void)
|
|||||||
{
|
{
|
||||||
debug("cPluginIptv::Initialize()\n");
|
debug("cPluginIptv::Initialize()\n");
|
||||||
// Initialize any background activities the plugin shall perform.
|
// Initialize any background activities the plugin shall perform.
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM < 10507
|
|
||||||
RegisterI18n(IptvPhrases);
|
|
||||||
#endif
|
|
||||||
IptvConfig.SetConfigDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N));
|
IptvConfig.SetConfigDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N));
|
||||||
return cIptvDevice::Initialize(deviceCount);
|
return cIptvDevice::Initialize(deviceCount);
|
||||||
}
|
}
|
||||||
@@ -167,14 +162,14 @@ int cPluginIptv::ParseFilters(const char *Value, int *Filters)
|
|||||||
char buffer[256];
|
char buffer[256];
|
||||||
int n = 0;
|
int n = 0;
|
||||||
while (Value && *Value && (n < SECTION_FILTER_TABLE_SIZE)) {
|
while (Value && *Value && (n < SECTION_FILTER_TABLE_SIZE)) {
|
||||||
strn0cpy(buffer, Value, sizeof(buffer));
|
strn0cpy(buffer, Value, sizeof(buffer));
|
||||||
int i = atoi(buffer);
|
int i = atoi(buffer);
|
||||||
//debug("cPluginIptv::ParseFilters(): Filters[%d]=%d\n", n, i);
|
//debug("cPluginIptv::ParseFilters(): Filters[%d]=%d\n", n, i);
|
||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
Filters[n++] = i;
|
Filters[n++] = i;
|
||||||
if ((Value = strchr(Value, ' ')) != NULL)
|
if ((Value = strchr(Value, ' ')) != NULL)
|
||||||
Value++;
|
Value++;
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,12 +185,12 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
|
|||||||
IptvConfig.SetExtProtocolBasePort(atoi(Value));
|
IptvConfig.SetExtProtocolBasePort(atoi(Value));
|
||||||
else if (!strcasecmp(Name, "SectionFiltering"))
|
else if (!strcasecmp(Name, "SectionFiltering"))
|
||||||
IptvConfig.SetSectionFiltering(atoi(Value));
|
IptvConfig.SetSectionFiltering(atoi(Value));
|
||||||
else if (!strcasecmp(Name, "SidScanning"))
|
|
||||||
IptvConfig.SetSidScanning(atoi(Value));
|
|
||||||
else if (!strcasecmp(Name, "DisabledFilters")) {
|
else if (!strcasecmp(Name, "DisabledFilters")) {
|
||||||
int DisabledFilters[SECTION_FILTER_TABLE_SIZE] = { -1 };
|
int DisabledFilters[SECTION_FILTER_TABLE_SIZE];
|
||||||
int DisabledFiltersCount = ParseFilters(Value, DisabledFilters);
|
for (unsigned int i = 0; i < ARRAY_SIZE(DisabledFilters); ++i)
|
||||||
for (int i = 0; i < DisabledFiltersCount; ++i)
|
DisabledFilters[i] = -1;
|
||||||
|
unsigned int DisabledFiltersCount = ParseFilters(Value, DisabledFilters);
|
||||||
|
for (unsigned int i = 0; i < DisabledFiltersCount; ++i)
|
||||||
IptvConfig.SetDisabledFilters(i, DisabledFilters[i]);
|
IptvConfig.SetDisabledFilters(i, DisabledFilters[i]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
84
iptv/image.sh
Executable file
84
iptv/image.sh
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# image.sh is used by the VDR iptv plugin to transcode images from
|
||||||
|
# a web server to provide a video stream.
|
||||||
|
#
|
||||||
|
# The script originates from Peter Holik
|
||||||
|
#
|
||||||
|
# Example channels.conf entries:
|
||||||
|
# Energy;IPTV:50:IPTV|S0P0|EXT|png.sh|1:P:0:256:257:0:0:3:0:0:0
|
||||||
|
# Temperature;IPTV:60:IPTV|S0P0|EXT|png.sh|2:P:0:256:257:0:0:3:0:0:0
|
||||||
|
# Temperature Week;IPTV:70:IPTV|S0P0|EXT|png.sh|3:P:0:256:257:0:0:3:0:0:0
|
||||||
|
# Server Temperature;IPTV:80:IPTV|S0P0|EXT|png.sh|4:P:0:256:257:0:0:3:0:0:0
|
||||||
|
# Server Temperature Week;IPTV:90:IPTV|S0P0|EXT|png.sh|5:P:0:256:257:0:0:3:0:0:0
|
||||||
|
# Traffic;IPTV:100:IPTV|S0P0|EXT|png.sh|6:P:0:256:257:0:0:3:0:0:0
|
||||||
|
#
|
||||||
|
# webcam.sh is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This package is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this package; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
logger "$0: error: Invalid parameter count '$#' $*"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Channels.conf parameter
|
||||||
|
case ${1} in
|
||||||
|
1)
|
||||||
|
URL="http://proxy/cgi-bin/bin/graph.cgi?hostname=proxy;plugin=energy;type=electricity"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
URL="http://proxy/cgi-bin/bin/graph.cgi?hostname=proxy;plugin=temp;type=temperature;type_instance=Outdoor"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
URL="http://proxy/cgi-bin/bin/graph.cgi?hostname=proxy;plugin=temp;type=temperature;type_instance=Outdoor;begin=-604800"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
URL="http://proxy/cgi-bin/bin/graph.cgi?hostname=proxy;plugin=temp;type=temperature;type_instance=Server"
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
URL="http://proxy/cgi-bin/bin/graph.cgi?hostname=proxy;plugin=temp;type=temperature;type_instance=Server;begin=-604800"
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
URL="http://proxy/cgi-bin/bin/graph.cgi?hostname=proxy;plugin=interface;type=if_octets;type_instance=ppp0"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
URL="" # Default URL - TODO get dummy picture
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Iptv plugin listens this port
|
||||||
|
PORT=${2}
|
||||||
|
|
||||||
|
# Stream temporary files
|
||||||
|
IMAGE=/tmp/image.png
|
||||||
|
LOG=/dev/null
|
||||||
|
|
||||||
|
{
|
||||||
|
# Using wget because ffmpeg cannot handle http/1.1 "Transfer-Encoding: chunked"
|
||||||
|
wget -q -O "${IMAGE}" "${URL}"
|
||||||
|
|
||||||
|
# Build stream from audiodump with cycle image as video
|
||||||
|
# PID 0x100/256 = Video 0x101/257 = Audio
|
||||||
|
exec ffmpeg -v 10 \
|
||||||
|
-analyzeduration 0 \
|
||||||
|
-loop_input \
|
||||||
|
-i "${IMAGE}" \
|
||||||
|
-f mpegts -r 25 -vcodec mpeg2video -b 4000k -s 664x540 -padleft 20 -padright 20 -padtop 16 -padbottom 20 \
|
||||||
|
-an \
|
||||||
|
"udp://127.0.0.1:${PORT}?pkt_size=16356"
|
||||||
|
} > ${LOG} 2>&1
|
||||||
67
iptv/internetradio.sh
Executable file
67
iptv/internetradio.sh
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# internetradio.sh is used by the VDR iptv plugin to transcode an internet
|
||||||
|
# radio stream.
|
||||||
|
#
|
||||||
|
# The script originates from:
|
||||||
|
# http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin
|
||||||
|
#
|
||||||
|
# An example channels.conf entry:
|
||||||
|
# internetradio;IPTV:2:IPTV|S0P0|EXT|internetradio.sh|0:P:0:0:256:0:0:2:0:0:0
|
||||||
|
#
|
||||||
|
# internetradio.sh is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This package is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this package; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
logger "$0: error: Invalid parameter count '$#' $*"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Channels.conf parameter
|
||||||
|
PARAMETER=${1}
|
||||||
|
|
||||||
|
# Iptv plugin listens this port
|
||||||
|
PORT=${2}
|
||||||
|
|
||||||
|
# Stream configuration
|
||||||
|
URL="mms://stream"
|
||||||
|
TITLE="internetradio"
|
||||||
|
|
||||||
|
# Stream temporary files
|
||||||
|
FIFO=/tmp/internetradio.fifo
|
||||||
|
LOG=/dev/null
|
||||||
|
|
||||||
|
{
|
||||||
|
rm -f "${FIFO}"
|
||||||
|
mkfifo "${FIFO}"
|
||||||
|
|
||||||
|
mplayer -dumpstream "${URL}" \
|
||||||
|
-quiet -nolirc -noautosub -noconsolecontrols -novideo -nojoystick \
|
||||||
|
-dumpfile "$FIFO" &
|
||||||
|
|
||||||
|
# Time to connect and fill pipe
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
# Build audio only stream
|
||||||
|
# PID 0x100/256 = Audio
|
||||||
|
ffmpeg -v -1 \
|
||||||
|
-i "${FIFO}" \
|
||||||
|
-title "${TITLE}" \
|
||||||
|
-f mpegts -acodec mp2 -ac 2 -ab 96k -ar 48000 \
|
||||||
|
"udp://127.0.0.1:${PORT}?pkt_size=16356"
|
||||||
|
|
||||||
|
rm -f "${FIFO}"
|
||||||
|
} > ${LOG} 2>&1
|
||||||
76
iptv/iptvstream-notrap.sh
Executable file
76
iptv/iptvstream-notrap.sh
Executable file
@@ -0,0 +1,76 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# iptvstream.sh can be used by the VDR iptv plugin to transcode external
|
||||||
|
# sources
|
||||||
|
#
|
||||||
|
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
|
||||||
|
#
|
||||||
|
# iptvstream.sh is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This package is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this package; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301, USA.
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
logger "$0: error: Invalid parameter count '$#' $*"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Channels.conf parameter
|
||||||
|
PARAMETER=${1}
|
||||||
|
|
||||||
|
# Iptv plugin listens this port
|
||||||
|
PORT=${2}
|
||||||
|
|
||||||
|
# Default settings for stream transcoding
|
||||||
|
VCODEC=mp2v
|
||||||
|
VBITRATE=2400
|
||||||
|
ACODEC=mpga
|
||||||
|
ABITRATE=320
|
||||||
|
|
||||||
|
# There is a way to specify multiple URLs in the same script. The selection is
|
||||||
|
# then controlled by the extra parameter passed by IPTV plugin to the script
|
||||||
|
case ${PARAMETER} in
|
||||||
|
1)
|
||||||
|
URL=""
|
||||||
|
WIDTH=720
|
||||||
|
HEIGHT=576
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
URL=""
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
URL=""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
URL="" # Default URL
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "${URL}" ]; then
|
||||||
|
logger "$0: error: URL not defined!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create transcoding options
|
||||||
|
TRANSCODE_OPTS="vcodec=${VCODEC},acodec=${ACODEC},vb=${VBITRATE},ab=${ABITRATE}"
|
||||||
|
if [ -n "${WIDTH}" -a -n "${HEIGHT}" ] ; then
|
||||||
|
TRANSCODE_OPTS="${TRANSCODE_OPTS},width=${WIDTH},height=${HEIGHT}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create unique pids for the stream
|
||||||
|
let VPID=${PARAMETER}+1
|
||||||
|
let APID=${PARAMETER}+2
|
||||||
|
let SPID=${PARAMETER}+3
|
||||||
|
|
||||||
|
# Execute VLC
|
||||||
|
exec vlc "${URL}" --sout "#transcode{${TRANSCODE_OPTS}}:standard{access=udp,mux=ts{pid-video=${VPID},pid-audio=${APID},pid-spu=${SPID}},dst=127.0.0.1:${PORT}}" --intf dummy
|
||||||
@@ -1,8 +1,28 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# iptvstream.sh can be used by the VDR iptv plugin to transcode external
|
||||||
|
# sources
|
||||||
|
#
|
||||||
|
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
|
||||||
|
#
|
||||||
|
# iptvstream.sh is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This package is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this package; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301, USA.
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
logger "$0: error: Invalid parameter count '$#' $*"
|
logger "$0: error: Invalid parameter count '$#' $*"
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Channels.conf parameter
|
# Channels.conf parameter
|
||||||
@@ -11,30 +31,40 @@ PARAMETER=${1}
|
|||||||
# Iptv plugin listens this port
|
# Iptv plugin listens this port
|
||||||
PORT=${2}
|
PORT=${2}
|
||||||
|
|
||||||
# Default bitrates for stream transcoding
|
# Default settings for stream transcoding
|
||||||
|
VCODEC=mp2v
|
||||||
VBITRATE=2400
|
VBITRATE=2400
|
||||||
|
ACODEC=mpga
|
||||||
ABITRATE=320
|
ABITRATE=320
|
||||||
|
|
||||||
# There is a way to specify multiple URLs in the same script. The selection is
|
# There is a way to specify multiple URLs in the same script. The selection is
|
||||||
# then controlled by the extra parameter passed by IPTV plugin to the script
|
# then controlled by the extra parameter passed by IPTV plugin to the script
|
||||||
case $PARAMETER in
|
case ${PARAMETER} in
|
||||||
1)
|
1)
|
||||||
URL=""
|
URL=""
|
||||||
;;
|
WIDTH=720
|
||||||
|
HEIGHT=576
|
||||||
|
;;
|
||||||
2)
|
2)
|
||||||
URL=""
|
URL=""
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
URL=""
|
URL=""
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
URL="" # Default URL
|
URL="" # Default URL
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -z "${URL}" ]; then
|
if [ -z "${URL}" ]; then
|
||||||
logger "$0: error: URL not defined!"
|
logger "$0: error: URL not defined!"
|
||||||
exit 1;
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create transcoding options
|
||||||
|
TRANSCODE_OPTS="vcodec=${VCODEC},acodec=${ACODEC},vb=${VBITRATE},ab=${ABITRATE}"
|
||||||
|
if [ -n "${WIDTH}" -a -n "${HEIGHT}" ] ; then
|
||||||
|
TRANSCODE_OPTS="${TRANSCODE_OPTS},width=${WIDTH},height=${HEIGHT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create unique pids for the stream
|
# Create unique pids for the stream
|
||||||
@@ -42,5 +72,12 @@ let VPID=${PARAMETER}+1
|
|||||||
let APID=${PARAMETER}+2
|
let APID=${PARAMETER}+2
|
||||||
let SPID=${PARAMETER}+3
|
let SPID=${PARAMETER}+3
|
||||||
|
|
||||||
# Use 'exec' for capturing program pid for further management in IPTV plugin
|
# Capture VLC pid for further management in IPTV plugin
|
||||||
exec vlc "${URL}" --sout "#transcode{vcodec=mp2v,acodec=mpga,vb=${VBITRATE},ab=${ABITRATE}}:standard{access=udp,mux=ts{pid-video=${VPID},pid-audio=${APID},pid-spu=${SPID}},dst=127.0.0.1:${PORT}}" --intf dummy
|
vlc "${URL}" --sout "#transcode{${TRANSCODE_OPTS}}:standard{access=udp,mux=ts{pid-video=${VPID},pid-audio=${APID},pid-spu=${SPID}},dst=127.0.0.1:${PORT}}" --intf dummy &
|
||||||
|
|
||||||
|
PID=${!}
|
||||||
|
|
||||||
|
trap 'kill -INT ${PID} 2> /dev/null' INT EXIT QUIT TERM
|
||||||
|
|
||||||
|
# Waiting for the given PID to terminate
|
||||||
|
wait ${PID}
|
||||||
|
|||||||
54
iptv/linein.sh
Executable file
54
iptv/linein.sh
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# linein.sh is used by the VDR iptv plugin to transcode line-in of
|
||||||
|
# a soundcard.
|
||||||
|
#
|
||||||
|
# The script originates from:
|
||||||
|
# http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin
|
||||||
|
#
|
||||||
|
# An example channels.conf entry:
|
||||||
|
# linein;IPTV:5:IPTV|S0P0|EXT|linein.sh|0:P:27500:0:256:0:0:5:5:5:0
|
||||||
|
#
|
||||||
|
# linein.sh is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This package is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this package; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
logger "$0: error: Invalid parameter count '$#' $*"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Channels.conf parameter
|
||||||
|
PARAMETER=${1}
|
||||||
|
|
||||||
|
# Iptv plugin listens this port
|
||||||
|
PORT=${2}
|
||||||
|
|
||||||
|
# Stream configuration
|
||||||
|
TITLE="linein"
|
||||||
|
|
||||||
|
# Stream temporary files
|
||||||
|
LOG=/dev/null
|
||||||
|
|
||||||
|
{
|
||||||
|
# PID 0x100/256 = Audio
|
||||||
|
arecord -q -D hw:0,0 -f dat | \
|
||||||
|
ffmpeg -v -1 \
|
||||||
|
-f wav \
|
||||||
|
-i - \
|
||||||
|
-title "${TITLE}" \
|
||||||
|
-f mpegts -acodec mp2 -ac 2 -ab 128k -ar 48000 \
|
||||||
|
"udp://127.0.0.1:${PORT}?pkt_size=16356"
|
||||||
|
} > ${LOG} 2>&1
|
||||||
100
iptv/vlc2iptv
Executable file
100
iptv/vlc2iptv
Executable file
@@ -0,0 +1,100 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# vlc2iptv is used by the VDR iptv plugin to transcode external sources
|
||||||
|
#
|
||||||
|
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
|
||||||
|
# (C) 2007 Tobias Grimm
|
||||||
|
#
|
||||||
|
# vlc2iptv is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This package is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this package; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# <Global Settings>
|
||||||
|
#
|
||||||
|
|
||||||
|
CHANNELS_CONF=/var/lib/vdr/channels.conf
|
||||||
|
CHANNEL_SETTINGS_DIR=/etc/vdr/plugins/iptv/vlcinput/
|
||||||
|
VIDEO_BITRATE=2400
|
||||||
|
AUDIO_BITRATE=320
|
||||||
|
|
||||||
|
#
|
||||||
|
# </Global Settings>
|
||||||
|
#
|
||||||
|
|
||||||
|
exit_with_error()
|
||||||
|
{
|
||||||
|
logger "vlc2iptv: error: $*"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
read_arguments()
|
||||||
|
{
|
||||||
|
[ $# -ne 2 ] && exit_with_error "Invalid parameter count '$#' $*"
|
||||||
|
PARAMETER=$1
|
||||||
|
PORT=$2
|
||||||
|
}
|
||||||
|
|
||||||
|
lookup_channel_and_pids()
|
||||||
|
{
|
||||||
|
[ ! -e "$CHANNELS_CONF" ] && \
|
||||||
|
exit_with_error "channels.conf not found ($CHANNELS_CONF)"
|
||||||
|
|
||||||
|
local CHANNEL_RECORD=`grep "[:]IPTV[|][SP][10][SP][10][|]EXT[|]vlc2iptv[|]$PARAMETER[:]" $CHANNELS_CONF`
|
||||||
|
[ -z "$CHANNEL_RECORD" ] && \
|
||||||
|
exit_with_error "no iptv channel with parameter $PARAMETER found"
|
||||||
|
|
||||||
|
CHANNEL_NAME=`echo $CHANNEL_RECORD | awk "-F[;,:]" '{print $1}'`
|
||||||
|
VPID=`echo $CHANNEL_RECORD | awk -F: '{print $6}'`
|
||||||
|
APID=`echo $CHANNEL_RECORD | awk -F: '{print $7}'`
|
||||||
|
SPID=0
|
||||||
|
}
|
||||||
|
|
||||||
|
load_channel_configuration()
|
||||||
|
{
|
||||||
|
local CHANNEL_SETTINGS_FILE="$CHANNEL_SETTINGS_DIR/$CHANNEL_NAME.conf"
|
||||||
|
|
||||||
|
[ ! -e $CHANNEL_SETTINGS_FILE ] && \
|
||||||
|
exit_with_error "No vlc input configuration for channel '$CHANNEL_NAME'"
|
||||||
|
. $CHANNEL_SETTINGS_FILE
|
||||||
|
|
||||||
|
[ -z "$URL" ] && \
|
||||||
|
exit_with_error "No URL specified for channel '$CHANNEL_NAME'"
|
||||||
|
}
|
||||||
|
|
||||||
|
read_arguments $*
|
||||||
|
lookup_channel_and_pids
|
||||||
|
load_channel_configuration
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start VLC
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ -n "$WIDTH" -a -n "$HEIGHT" ] ; then
|
||||||
|
RESIZE_OPTIONS=",width=${WIDTH},height=${HEIGHT}"
|
||||||
|
else
|
||||||
|
RESIZE_OPTIONS=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
vlc "${URL}" \
|
||||||
|
--sout "#transcode{vcodec=mp2v$RESIZE_OPTIONS,acodec=mpga,vb=${VIDEO_BITRATE},ab=${AUDIO_BITRATE}}:standard{access=udp,mux=ts{pid-video=${VPID},pid-audio=${APID},pid-spu=${SPID}},dst=127.0.0.1:${PORT}}" \
|
||||||
|
--intf dummy &
|
||||||
|
|
||||||
|
PID=${!}
|
||||||
|
|
||||||
|
trap 'kill -INT ${PID} 2> /dev/null' INT EXIT QUIT TERM
|
||||||
|
|
||||||
|
# Waiting for the given PID to terminate
|
||||||
|
wait ${PID}
|
||||||
69
iptv/webcam.sh
Executable file
69
iptv/webcam.sh
Executable file
@@ -0,0 +1,69 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# webcam.sh is used by the VDR iptv plugin to transcode an internet radio
|
||||||
|
# stream remuxed with images (e.g. webcam) to provide a video stream.
|
||||||
|
#
|
||||||
|
# The script originates from:
|
||||||
|
# http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin
|
||||||
|
#
|
||||||
|
# An example channels.conf entry:
|
||||||
|
# webcam;IPTV:3:IPTV|S0P0|EXT|webcam.sh|0:P:0:256:257:0:0:3:0:0:0
|
||||||
|
#
|
||||||
|
# webcam.sh is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This package is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this package; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
logger "$0: error: Invalid parameter count '$#' $*"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Channels.conf parameter
|
||||||
|
PARAMETER=${1}
|
||||||
|
|
||||||
|
# Iptv plugin listens this port
|
||||||
|
PORT=${2}
|
||||||
|
|
||||||
|
# Stream configuration
|
||||||
|
URL="http://stream.address"
|
||||||
|
IMAGE="image.jpg"
|
||||||
|
TITLE="webcam"
|
||||||
|
|
||||||
|
# Stream temporary files
|
||||||
|
FIFO=/tmp/webcam.fifo
|
||||||
|
LOG=/dev/null
|
||||||
|
|
||||||
|
{
|
||||||
|
rm -f "${FIFO}"
|
||||||
|
mkfifo "${FIFO}"
|
||||||
|
|
||||||
|
mplayer -dumpstream "${URL}" \
|
||||||
|
-quiet -nolirc -noautosub -noconsolecontrols -novideo -nojoystick \
|
||||||
|
-dumpfile "${FIFO}" &
|
||||||
|
|
||||||
|
# Time to connect and fill pipe
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
# Build stream from audiodump with cycle image as video
|
||||||
|
# PID 0x100/256 = Video 0x101/257 = Audio
|
||||||
|
ffmpeg -v -1 \
|
||||||
|
-i "${FIFO}" -r 0.5 -loop_input -i '${IMAGE}' \
|
||||||
|
-title "${TITLE}" \
|
||||||
|
-f mpegts -intra -r 24 -vcodec mpeg2video -b 500k -s 352x288 \
|
||||||
|
-acodec mp2 -ac 2 -ab 96k -ar 48000 \
|
||||||
|
"udp://127.0.0.1:${PORT}?pkt_size=16356"
|
||||||
|
|
||||||
|
rm -f "${FIFO}"
|
||||||
|
} > ${LOG} 2>&1
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
diff -Nru vdr-1.4.7-vanilla/config.h vdr-1.4.7-closefilter/config.h
|
|
||||||
--- vdr-1.4.7-vanilla/config.h 2007-10-27 01:08:39.000000000 +0300
|
|
||||||
+++ vdr-1.4.7-closefilter/config.h 2007-10-27 01:39:43.000000000 +0300
|
|
||||||
@@ -29,6 +29,8 @@
|
|
||||||
#define APIVERSION "1.4.5"
|
|
||||||
#define APIVERSNUM 10405 // Version * 10000 + Major * 100 + Minor
|
|
||||||
|
|
||||||
+#define CLOSEFILTERPATCHVERSNUM 1
|
|
||||||
+
|
|
||||||
// When loading plugins, VDR searches them by their APIVERSION, which
|
|
||||||
// may be smaller than VDRVERSION in case there have been no changes to
|
|
||||||
// VDR header files since the last APIVERSION. This allows compiled
|
|
||||||
diff -Nru vdr-1.4.7-vanilla/device.c vdr-1.4.7-closefilter/device.c
|
|
||||||
--- vdr-1.4.7-vanilla/device.c 2007-10-27 01:08:39.000000000 +0300
|
|
||||||
+++ vdr-1.4.7-closefilter/device.c 2007-10-27 01:37:34.000000000 +0300
|
|
||||||
@@ -509,6 +509,11 @@
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+void cDevice::CloseFilter(int Handle)
|
|
||||||
+{
|
|
||||||
+ close(Handle);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void cDevice::AttachFilter(cFilter *Filter)
|
|
||||||
{
|
|
||||||
if (sectionHandler)
|
|
||||||
diff -Nru vdr-1.4.7-vanilla/device.h vdr-1.4.7-closefilter/device.h
|
|
||||||
--- vdr-1.4.7-vanilla/device.h 2007-10-27 01:08:39.000000000 +0300
|
|
||||||
+++ vdr-1.4.7-closefilter/device.h 2007-10-27 01:37:19.000000000 +0300
|
|
||||||
@@ -302,6 +302,11 @@
|
|
||||||
///< Opens a file handle for the given filter data.
|
|
||||||
///< A derived device that provides section data must
|
|
||||||
///< implement this function.
|
|
||||||
+ virtual void CloseFilter(int Handle);
|
|
||||||
+ ///< Closes a file handle that has previously been opened
|
|
||||||
+ ///< by OpenFilter(). If this is as simple as calling close(Handle),
|
|
||||||
+ ///< a derived class need not implement this function, because this
|
|
||||||
+ ///< is done by the default implementation.
|
|
||||||
void AttachFilter(cFilter *Filter);
|
|
||||||
///< Attaches the given filter to this device.
|
|
||||||
void Detach(cFilter *Filter);
|
|
||||||
diff -Nru vdr-1.4.7-vanilla/dvbdevice.c vdr-1.4.7-closefilter/dvbdevice.c
|
|
||||||
--- vdr-1.4.7-vanilla/dvbdevice.c 2007-10-27 01:08:39.000000000 +0300
|
|
||||||
+++ vdr-1.4.7-closefilter/dvbdevice.c 2007-10-27 01:37:50.000000000 +0300
|
|
||||||
@@ -726,6 +726,11 @@
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+void cDvbDevice::CloseFilter(int Handle)
|
|
||||||
+{
|
|
||||||
+ close(Handle);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void cDvbDevice::TurnOffLiveMode(bool LiveView)
|
|
||||||
{
|
|
||||||
if (LiveView) {
|
|
||||||
diff -Nru vdr-1.4.7-vanilla/dvbdevice.h vdr-1.4.7-closefilter/dvbdevice.h
|
|
||||||
--- vdr-1.4.7-vanilla/dvbdevice.h 2007-10-27 01:08:39.000000000 +0300
|
|
||||||
+++ vdr-1.4.7-closefilter/dvbdevice.h 2007-10-27 01:37:59.000000000 +0300
|
|
||||||
@@ -79,6 +79,7 @@
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
|
|
||||||
+ virtual void CloseFilter(int Handle);
|
|
||||||
|
|
||||||
// Image Grab facilities
|
|
||||||
|
|
||||||
diff -Nru vdr-1.4.7-vanilla/sections.c vdr-1.4.7-closefilter/sections.c
|
|
||||||
--- vdr-1.4.7-vanilla/sections.c 2007-10-27 01:08:39.000000000 +0300
|
|
||||||
+++ vdr-1.4.7-closefilter/sections.c 2007-10-27 01:34:06.000000000 +0300
|
|
||||||
@@ -105,7 +105,7 @@
|
|
||||||
for (fh = filterHandles.First(); fh; fh = filterHandles.Next(fh)) {
|
|
||||||
if (fh->filterData.Is(FilterData->pid, FilterData->tid, FilterData->mask)) {
|
|
||||||
if (--fh->used <= 0) {
|
|
||||||
- close(fh->handle);
|
|
||||||
+ device->CloseFilter(fh->handle);
|
|
||||||
filterHandles.Del(fh);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
11
patches/vdr-1.6.0-disable_ca_updates.patch
Normal file
11
patches/vdr-1.6.0-disable_ca_updates.patch
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
diff -Nru vdr-1.6.0-vanilla/pat.c vdr-1.6.0-disable-ca-updates/pat.c
|
||||||
|
--- vdr-1.6.0-vanilla/pat.c 2008-02-08 15:48:31.000000000 +0200
|
||||||
|
+++ vdr-1.6.0-disable-ca-updates/pat.c 2009-03-07 14:56:42.000000000 +0200
|
||||||
|
@@ -440,6 +440,7 @@
|
||||||
|
}
|
||||||
|
if (Setup.UpdateChannels >= 2) {
|
||||||
|
Channel->SetPids(Vpid, Vpid ? Ppid : 0, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
|
||||||
|
+ if (!Channel->IsPlug())
|
||||||
|
Channel->SetCaIds(CaDescriptors->CaIds());
|
||||||
|
}
|
||||||
|
Channel->SetCaDescriptors(CaDescriptorHandler.AddCaDescriptors(CaDescriptors));
|
||||||
12
patches/vdr-1.6.0-disable_eitscan.patch
Normal file
12
patches/vdr-1.6.0-disable_eitscan.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
diff -Nru vdr-1.6.0-vanilla/eitscan.c vdr-1.6.0-disable_eitscan/eitscan.c
|
||||||
|
--- vdr-1.6.0-vanilla/eitscan.c 2006-01-07 16:10:17.000000000 +0200
|
||||||
|
+++ vdr-1.6.0-disable_eitscan/eitscan.c 2009-06-17 16:04:23.000000000 +0300
|
||||||
|
@@ -146,7 +146,7 @@
|
||||||
|
if (Device) {
|
||||||
|
for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) {
|
||||||
|
const cChannel *Channel = ScanData->GetChannel();
|
||||||
|
- if (Channel) {
|
||||||
|
+ if (Channel && !Channel->IsPlug()) {
|
||||||
|
if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= CA_ENCRYPTED_MIN) {
|
||||||
|
if (Device->ProvidesTransponder(Channel)) {
|
||||||
|
if (!Device->Receiving()) {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
diff -Nru vdr-1.5.10-vanilla/channels.c vdr-1.5.10-pluginparam/channels.c
|
diff -Nru vdr-1.6.0-vanilla/channels.c vdr-1.6.0-pluginparam/channels.c
|
||||||
--- vdr-1.5.10-vanilla/channels.c 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/channels.c 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/channels.c 2007-10-27 01:53:27.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/channels.c 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -166,6 +166,7 @@
|
@@ -166,6 +166,7 @@
|
||||||
shortName = strdup("");
|
shortName = strdup("");
|
||||||
provider = strdup("");
|
provider = strdup("");
|
||||||
@@ -44,17 +44,17 @@ diff -Nru vdr-1.5.10-vanilla/channels.c vdr-1.5.10-pluginparam/channels.c
|
|||||||
+bool cChannel::SetPlugTransponderData(int Source, int Frequency, const char *PluginParam)
|
+bool cChannel::SetPlugTransponderData(int Source, int Frequency, const char *PluginParam)
|
||||||
+{
|
+{
|
||||||
+ if (source != Source || frequency != Frequency || (strcmp(pluginParam, PluginParam) != 0)) {
|
+ if (source != Source || frequency != Frequency || (strcmp(pluginParam, PluginParam) != 0)) {
|
||||||
+ if (Number()) {
|
+ if (Number()) {
|
||||||
+ dsyslog("changing transponder data of channel %d from %s:%d:%s to %s:%d:%s", Number(), *cSource::ToString(source), frequency, pluginParam, *cSource::ToString(Source), Frequency, PluginParam);
|
+ dsyslog("changing transponder data of channel %d from %s:%d:%s to %s:%d:%s", Number(), *cSource::ToString(source), frequency, pluginParam, *cSource::ToString(Source), Frequency, PluginParam);
|
||||||
+ modification |= CHANNELMOD_TRANSP;
|
+ modification |= CHANNELMOD_TRANSP;
|
||||||
+ Channels.SetModified();
|
+ Channels.SetModified();
|
||||||
+ }
|
+ }
|
||||||
+ source = Source;
|
+ source = Source;
|
||||||
+ frequency = Frequency;
|
+ frequency = Frequency;
|
||||||
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
|
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
|
||||||
+ schedule = NULL;
|
+ schedule = NULL;
|
||||||
+ }
|
+ }
|
||||||
+ return true;
|
+ return true;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH)
|
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH)
|
||||||
@@ -122,9 +122,9 @@ diff -Nru vdr-1.5.10-vanilla/channels.c vdr-1.5.10-pluginparam/channels.c
|
|||||||
|
|
||||||
free(parambuf);
|
free(parambuf);
|
||||||
free(sourcebuf);
|
free(sourcebuf);
|
||||||
diff -Nru vdr-1.5.10-vanilla/channels.h vdr-1.5.10-pluginparam/channels.h
|
diff -Nru vdr-1.6.0-vanilla/channels.h vdr-1.6.0-pluginparam/channels.h
|
||||||
--- vdr-1.5.10-vanilla/channels.h 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/channels.h 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/channels.h 2007-10-27 01:53:27.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/channels.h 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -114,6 +114,7 @@
|
@@ -114,6 +114,7 @@
|
||||||
char *shortName;
|
char *shortName;
|
||||||
char *provider;
|
char *provider;
|
||||||
@@ -164,22 +164,22 @@ diff -Nru vdr-1.5.10-vanilla/channels.h vdr-1.5.10-pluginparam/channels.h
|
|||||||
void SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
|
void SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
|
||||||
void SetCaIds(const int *CaIds); // list must be zero-terminated
|
void SetCaIds(const int *CaIds); // list must be zero-terminated
|
||||||
void SetCaDescriptors(int Level);
|
void SetCaDescriptors(int Level);
|
||||||
diff -Nru vdr-1.5.10-vanilla/config.h vdr-1.5.10-pluginparam/config.h
|
diff -Nru vdr-1.6.0-vanilla/config.h vdr-1.6.0-pluginparam/config.h
|
||||||
--- vdr-1.5.10-vanilla/config.h 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/config.h 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/config.h 2007-10-27 01:53:59.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/config.h 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -30,6 +30,8 @@
|
@@ -30,6 +30,8 @@
|
||||||
#define APIVERSION "1.5.10"
|
#define APIVERSION "1.6.0"
|
||||||
#define APIVERSNUM 10510 // Version * 10000 + Major * 100 + Minor
|
#define APIVERSNUM 10600 // Version * 10000 + Major * 100 + Minor
|
||||||
|
|
||||||
+#define PLUGINPARAMPATCHVERSNUM 1
|
+#define PLUGINPARAMPATCHVERSNUM 1
|
||||||
+
|
+
|
||||||
// When loading plugins, VDR searches them by their APIVERSION, which
|
// When loading plugins, VDR searches them by their APIVERSION, which
|
||||||
// may be smaller than VDRVERSION in case there have been no changes to
|
// may be smaller than VDRVERSION in case there have been no changes to
|
||||||
// VDR header files since the last APIVERSION. This allows compiled
|
// VDR header files since the last APIVERSION. This allows compiled
|
||||||
diff -Nru vdr-1.5.10-vanilla/menu.c vdr-1.5.10-pluginparam/menu.c
|
diff -Nru vdr-1.6.0-vanilla/menu.c vdr-1.6.0-pluginparam/menu.c
|
||||||
--- vdr-1.5.10-vanilla/menu.c 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/menu.c 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/menu.c 2007-10-27 01:53:27.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/menu.c 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -219,6 +219,7 @@
|
@@ -253,6 +253,7 @@
|
||||||
cChannel *channel;
|
cChannel *channel;
|
||||||
cChannel data;
|
cChannel data;
|
||||||
char name[256];
|
char name[256];
|
||||||
@@ -187,15 +187,15 @@ diff -Nru vdr-1.5.10-vanilla/menu.c vdr-1.5.10-pluginparam/menu.c
|
|||||||
void Setup(void);
|
void Setup(void);
|
||||||
public:
|
public:
|
||||||
cMenuEditChannel(cChannel *Channel, bool New = false);
|
cMenuEditChannel(cChannel *Channel, bool New = false);
|
||||||
@@ -251,6 +252,7 @@
|
@@ -285,6 +286,7 @@
|
||||||
|
|
||||||
// Parameters for all types of sources:
|
// Parameters for all types of sources:
|
||||||
strn0cpy(name, data.name, sizeof(name));
|
strn0cpy(name, data.name, sizeof(name));
|
||||||
+ strn0cpy(pluginParam, data.pluginParam, sizeof(pluginParam));
|
+ strn0cpy(pluginParam, data.pluginParam, sizeof(pluginParam));
|
||||||
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name), tr(FileNameChars)));
|
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name)));
|
||||||
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
|
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
|
||||||
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
|
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
|
||||||
@@ -281,6 +283,7 @@
|
@@ -315,6 +317,7 @@
|
||||||
ST(" T") Add(new cMenuEditMapItem( tr("Transmission"), &data.transmission, TransmissionValues));
|
ST(" T") Add(new cMenuEditMapItem( tr("Transmission"), &data.transmission, TransmissionValues));
|
||||||
ST(" T") Add(new cMenuEditMapItem( tr("Guard"), &data.guard, GuardValues));
|
ST(" T") Add(new cMenuEditMapItem( tr("Guard"), &data.guard, GuardValues));
|
||||||
ST(" T") Add(new cMenuEditMapItem( tr("Hierarchy"), &data.hierarchy, HierarchyValues, tr("none")));
|
ST(" T") Add(new cMenuEditMapItem( tr("Hierarchy"), &data.hierarchy, HierarchyValues, tr("none")));
|
||||||
@@ -203,7 +203,7 @@ diff -Nru vdr-1.5.10-vanilla/menu.c vdr-1.5.10-pluginparam/menu.c
|
|||||||
|
|
||||||
SetCurrent(Get(current));
|
SetCurrent(Get(current));
|
||||||
Display();
|
Display();
|
||||||
@@ -295,6 +298,7 @@
|
@@ -329,6 +332,7 @@
|
||||||
if (Key == kOk) {
|
if (Key == kOk) {
|
||||||
if (Channels.HasUniqueChannelID(&data, channel)) {
|
if (Channels.HasUniqueChannelID(&data, channel)) {
|
||||||
data.name = strcpyrealloc(data.name, name);
|
data.name = strcpyrealloc(data.name, name);
|
||||||
@@ -211,19 +211,29 @@ diff -Nru vdr-1.5.10-vanilla/menu.c vdr-1.5.10-pluginparam/menu.c
|
|||||||
if (channel) {
|
if (channel) {
|
||||||
*channel = data;
|
*channel = data;
|
||||||
isyslog("edited channel %d %s", channel->Number(), *data.ToText());
|
isyslog("edited channel %d %s", channel->Number(), *data.ToText());
|
||||||
diff -Nru vdr-1.5.10-vanilla/po/fi_FI.po vdr-1.5.10-pluginparam/po/fi_FI.po
|
diff -Nru vdr-1.6.0-vanilla/po/fi_FI.po vdr-1.6.0-pluginparam/po/fi_FI.po
|
||||||
--- vdr-1.5.10-vanilla/po/fi_FI.po 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/po/fi_FI.po 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/po/fi_FI.po 2007-10-27 01:53:27.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/po/fi_FI.po 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -998,3 +998,6 @@
|
@@ -1001,3 +1001,6 @@
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "VDR will shut down in %s minutes"
|
msgid "VDR will shut down in %s minutes"
|
||||||
msgstr "VDR sammuu %s minuutin kuluttua"
|
msgstr "VDR sammuu %s minuutin kuluttua"
|
||||||
+
|
+
|
||||||
+msgid "Parameters"
|
+msgid "Parameters"
|
||||||
+msgstr "Parametrit"
|
+msgstr "Parametrit"
|
||||||
diff -Nru vdr-1.5.10-vanilla/sources.c vdr-1.5.10-pluginparam/sources.c
|
diff -Nru vdr-1.6.0-vanilla/po/fr_FR.po vdr-1.6.0-pluginparam/po/fr_FR.po
|
||||||
--- vdr-1.5.10-vanilla/sources.c 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/po/fr_FR.po 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/sources.c 2007-10-27 01:53:27.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/po/fr_FR.po 2008-03-27 22:06:47.000000000 +0200
|
||||||
|
@@ -1004,3 +1004,6 @@
|
||||||
|
#, c-format
|
||||||
|
msgid "VDR will shut down in %s minutes"
|
||||||
|
msgstr "VDR s'arrêtera dans %s minutes"
|
||||||
|
+
|
||||||
|
+msgid "Parameters"
|
||||||
|
+msgstr "Paramètres"
|
||||||
|
diff -Nru vdr-1.6.0-vanilla/sources.c vdr-1.6.0-pluginparam/sources.c
|
||||||
|
--- vdr-1.6.0-vanilla/sources.c 2008-03-27 21:43:25.000000000 +0200
|
||||||
|
+++ vdr-1.6.0-pluginparam/sources.c 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -37,6 +37,7 @@
|
@@ -37,6 +37,7 @@
|
||||||
char buffer[16];
|
char buffer[16];
|
||||||
char *q = buffer;
|
char *q = buffer;
|
||||||
@@ -240,9 +250,9 @@ diff -Nru vdr-1.5.10-vanilla/sources.c vdr-1.5.10-pluginparam/sources.c
|
|||||||
case 'C': type = stCable; break;
|
case 'C': type = stCable; break;
|
||||||
case 'S': type = stSat; break;
|
case 'S': type = stSat; break;
|
||||||
case 'T': type = stTerr; break;
|
case 'T': type = stTerr; break;
|
||||||
diff -Nru vdr-1.5.10-vanilla/sources.conf vdr-1.5.10-pluginparam/sources.conf
|
diff -Nru vdr-1.6.0-vanilla/sources.conf vdr-1.6.0-pluginparam/sources.conf
|
||||||
--- vdr-1.5.10-vanilla/sources.conf 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/sources.conf 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/sources.conf 2007-10-27 01:53:27.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/sources.conf 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -188,3 +188,7 @@
|
@@ -188,3 +188,7 @@
|
||||||
# Terrestrial
|
# Terrestrial
|
||||||
|
|
||||||
@@ -251,9 +261,9 @@ diff -Nru vdr-1.5.10-vanilla/sources.conf vdr-1.5.10-pluginparam/sources.conf
|
|||||||
+# Plugin
|
+# Plugin
|
||||||
+
|
+
|
||||||
+P Plugin
|
+P Plugin
|
||||||
diff -Nru vdr-1.5.10-vanilla/sources.h vdr-1.5.10-pluginparam/sources.h
|
diff -Nru vdr-1.6.0-vanilla/sources.h vdr-1.6.0-pluginparam/sources.h
|
||||||
--- vdr-1.5.10-vanilla/sources.h 2007-10-14 18:21:57.000000000 +0300
|
--- vdr-1.6.0-vanilla/sources.h 2008-03-27 21:43:25.000000000 +0200
|
||||||
+++ vdr-1.5.10-pluginparam/sources.h 2007-10-27 01:53:27.000000000 +0300
|
+++ vdr-1.6.0-pluginparam/sources.h 2008-03-27 22:06:47.000000000 +0200
|
||||||
@@ -16,10 +16,11 @@
|
@@ -16,10 +16,11 @@
|
||||||
public:
|
public:
|
||||||
enum eSourceType {
|
enum eSourceType {
|
||||||
11
patches/vdr-1.7.9-disable_ca_updates.patch
Normal file
11
patches/vdr-1.7.9-disable_ca_updates.patch
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
diff -Nru vdr-1.7.9-vanilla/pat.c vdr-1.7.9-disable_ca_updates/pat.c
|
||||||
|
--- vdr-1.7.9-vanilla/pat.c 2009-08-23 18:12:33.000000000 +0300
|
||||||
|
+++ vdr-1.7.9-disable_ca_updates/pat.c 2009-08-23 18:20:58.000000000 +0300
|
||||||
|
@@ -452,6 +452,7 @@
|
||||||
|
}
|
||||||
|
if (Setup.UpdateChannels >= 2) {
|
||||||
|
Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
|
||||||
|
+ if (!Channel->IsPlug())
|
||||||
|
Channel->SetCaIds(CaDescriptors->CaIds());
|
||||||
|
Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds);
|
||||||
|
}
|
||||||
12
patches/vdr-1.7.9-disable_eitscan.patch
Normal file
12
patches/vdr-1.7.9-disable_eitscan.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
diff -Nru vdr-1.7.9-vanilla/eitscan.c vdr-1.7.9-disable_eitscan/eitscan.c
|
||||||
|
--- vdr-1.7.9-vanilla/eitscan.c 2009-08-23 18:12:32.000000000 +0300
|
||||||
|
+++ vdr-1.7.9-disable_eitscan/eitscan.c 2009-08-23 18:20:42.000000000 +0300
|
||||||
|
@@ -146,7 +146,7 @@
|
||||||
|
if (Device) {
|
||||||
|
for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) {
|
||||||
|
const cChannel *Channel = ScanData->GetChannel();
|
||||||
|
- if (Channel) {
|
||||||
|
+ if (Channel && !Channel->IsPlug()) {
|
||||||
|
if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= CA_ENCRYPTED_MIN) {
|
||||||
|
if (Device->ProvidesTransponder(Channel)) {
|
||||||
|
if (!Device->Receiving()) {
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
diff -Nru vdr-1.7.9-vanilla/channels.c vdr-1.7.9-pluginsparam/channels.c
|
||||||
--- vdr-1.4.7-vanilla/channels.c 2007-10-27 01:08:39.000000000 +0300
|
--- vdr-1.7.9-vanilla/channels.c 2009-08-23 18:12:32.000000000 +0300
|
||||||
+++ vdr-1.4.7-pluginparam/channels.c 2007-10-27 01:09:05.000000000 +0300
|
+++ vdr-1.7.9-pluginsparam/channels.c 2009-08-23 18:18:54.000000000 +0300
|
||||||
@@ -166,6 +166,7 @@
|
@@ -188,6 +188,7 @@
|
||||||
shortName = strdup("");
|
shortName = strdup("");
|
||||||
provider = strdup("");
|
provider = strdup("");
|
||||||
portalName = strdup("");
|
portalName = strdup("");
|
||||||
+ pluginParam = strdup("");
|
+ pluginParam = strdup("");
|
||||||
memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
|
memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
|
||||||
inversion = INVERSION_AUTO;
|
inversion = INVERSION_AUTO;
|
||||||
bandwidth = BANDWIDTH_AUTO;
|
bandwidth = 8000000;
|
||||||
@@ -187,6 +188,7 @@
|
@@ -211,6 +212,7 @@
|
||||||
shortName = NULL;
|
shortName = NULL;
|
||||||
provider = NULL;
|
provider = NULL;
|
||||||
portalName = NULL;
|
portalName = NULL;
|
||||||
@@ -17,7 +17,7 @@ diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
|||||||
schedule = NULL;
|
schedule = NULL;
|
||||||
linkChannels = NULL;
|
linkChannels = NULL;
|
||||||
refChannel = NULL;
|
refChannel = NULL;
|
||||||
@@ -215,6 +217,7 @@
|
@@ -239,6 +241,7 @@
|
||||||
free(shortName);
|
free(shortName);
|
||||||
free(provider);
|
free(provider);
|
||||||
free(portalName);
|
free(portalName);
|
||||||
@@ -25,7 +25,7 @@ diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
|||||||
}
|
}
|
||||||
|
|
||||||
cChannel& cChannel::operator= (const cChannel &Channel)
|
cChannel& cChannel::operator= (const cChannel &Channel)
|
||||||
@@ -223,6 +226,7 @@
|
@@ -247,6 +250,7 @@
|
||||||
shortName = strcpyrealloc(shortName, Channel.shortName);
|
shortName = strcpyrealloc(shortName, Channel.shortName);
|
||||||
provider = strcpyrealloc(provider, Channel.provider);
|
provider = strcpyrealloc(provider, Channel.provider);
|
||||||
portalName = strcpyrealloc(portalName, Channel.portalName);
|
portalName = strcpyrealloc(portalName, Channel.portalName);
|
||||||
@@ -33,10 +33,10 @@ diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
|||||||
memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__);
|
memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -280,9 +284,26 @@
|
@@ -306,9 +310,26 @@
|
||||||
transmission = Channel->transmission;
|
|
||||||
guard = Channel->guard;
|
guard = Channel->guard;
|
||||||
hierarchy = Channel->hierarchy;
|
hierarchy = Channel->hierarchy;
|
||||||
|
rollOff = Channel->rollOff;
|
||||||
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, Channel->pluginParam);
|
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, Channel->pluginParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,23 +44,23 @@ diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
|||||||
+bool cChannel::SetPlugTransponderData(int Source, int Frequency, const char *PluginParam)
|
+bool cChannel::SetPlugTransponderData(int Source, int Frequency, const char *PluginParam)
|
||||||
+{
|
+{
|
||||||
+ if (source != Source || frequency != Frequency || (strcmp(pluginParam, PluginParam) != 0)) {
|
+ if (source != Source || frequency != Frequency || (strcmp(pluginParam, PluginParam) != 0)) {
|
||||||
+ if (Number()) {
|
+ if (Number()) {
|
||||||
+ dsyslog("changing transponder data of channel %d from %s:%d:%s to %s:%d:%s", Number(), *cSource::ToString(source), frequency, pluginParam, *cSource::ToString(Source), Frequency, PluginParam);
|
+ dsyslog("changing transponder data of channel %d from %s:%d:%s to %s:%d:%s", Number(), *cSource::ToString(source), frequency, pluginParam, *cSource::ToString(Source), Frequency, PluginParam);
|
||||||
+ modification |= CHANNELMOD_TRANSP;
|
+ modification |= CHANNELMOD_TRANSP;
|
||||||
+ Channels.SetModified();
|
+ Channels.SetModified();
|
||||||
+ }
|
+ }
|
||||||
+ source = Source;
|
+ source = Source;
|
||||||
+ frequency = Frequency;
|
+ frequency = Frequency;
|
||||||
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
|
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
|
||||||
+ schedule = NULL;
|
+ schedule = NULL;
|
||||||
+ }
|
+ }
|
||||||
+ return true;
|
+ return true;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH)
|
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, int Modulation, int System, int RollOff)
|
||||||
{
|
{
|
||||||
// Workarounds for broadcaster stupidity:
|
// Workarounds for broadcaster stupidity:
|
||||||
@@ -407,6 +428,18 @@
|
@@ -438,6 +459,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
|||||||
#define STRDIFF 0x01
|
#define STRDIFF 0x01
|
||||||
#define VALDIFF 0x02
|
#define VALDIFF 0x02
|
||||||
|
|
||||||
@@ -579,7 +612,7 @@
|
@@ -648,7 +681,7 @@
|
||||||
if (isdigit(type))
|
if (isdigit(type))
|
||||||
type = 'S';
|
type = 'S';
|
||||||
#define ST(s) if (strchr(s, type))
|
#define ST(s) if (strchr(s, type))
|
||||||
@@ -88,33 +88,33 @@ diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
|||||||
char *q = buffer;
|
char *q = buffer;
|
||||||
*q = 0;
|
*q = 0;
|
||||||
ST(" S ") q += sprintf(q, "%c", polarization);
|
ST(" S ") q += sprintf(q, "%c", polarization);
|
||||||
@@ -591,6 +624,7 @@
|
@@ -662,6 +695,7 @@
|
||||||
|
ST(" S ") q += PrintParameter(q, 'S', MapToUser(system, SystemValues));
|
||||||
ST(" T") q += PrintParameter(q, 'T', MapToUser(transmission, TransmissionValues));
|
ST(" T") q += PrintParameter(q, 'T', MapToUser(transmission, TransmissionValues));
|
||||||
ST(" T") q += PrintParameter(q, 'G', MapToUser(guard, GuardValues));
|
|
||||||
ST(" T") q += PrintParameter(q, 'Y', MapToUser(hierarchy, HierarchyValues));
|
ST(" T") q += PrintParameter(q, 'Y', MapToUser(hierarchy, HierarchyValues));
|
||||||
+ ST("P ") snprintf(buffer, sizeof(buffer), "%s", pluginParam);
|
+ ST("P ") snprintf(buffer, sizeof(buffer), "%s", pluginParam);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -612,7 +646,7 @@
|
@@ -690,7 +724,7 @@
|
||||||
|
|
||||||
bool cChannel::StringToParameters(const char *s)
|
bool cChannel::StringToParameters(const char *s)
|
||||||
{
|
{
|
||||||
- while (s && *s) {
|
- while (s && *s) {
|
||||||
+ while (s && *s && !IsPlug()) {
|
+ while (s && *s && !IsPlug()) {
|
||||||
switch (toupper(*s)) {
|
switch (toupper(*s)) {
|
||||||
|
case 'A': s = SkipDigits(s); break; // for compatibility with the "multiproto" approach - may be removed in future versions
|
||||||
case 'B': s = ParseParameter(s, bandwidth, BandwidthValues); break;
|
case 'B': s = ParseParameter(s, bandwidth, BandwidthValues); break;
|
||||||
case 'C': s = ParseParameter(s, coderateH, CoderateValues); break;
|
@@ -808,7 +842,7 @@
|
||||||
@@ -722,7 +756,7 @@
|
|
||||||
dpids[0] = 0;
|
dpids[0] = 0;
|
||||||
ok = false;
|
ok = false;
|
||||||
if (parambuf && sourcebuf && vpidbuf && apidbuf) {
|
if (parambuf && sourcebuf && vpidbuf && apidbuf) {
|
||||||
- ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0;
|
- ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0;
|
||||||
+ ok = ((source = cSource::FromString(sourcebuf)) >= 0) && StringToParameters(parambuf);
|
+ ok = ((source = cSource::FromString(sourcebuf)) >= 0) && StringToParameters(parambuf);
|
||||||
|
|
||||||
char *p = strchr(vpidbuf, '+');
|
char *p;
|
||||||
if (p)
|
if ((p = strchr(vpidbuf, '=')) != NULL) {
|
||||||
@@ -813,6 +847,7 @@
|
@@ -903,6 +937,7 @@
|
||||||
shortName = strcpyrealloc(shortName, p);
|
shortName = strcpyrealloc(shortName, p);
|
||||||
}
|
}
|
||||||
name = strcpyrealloc(name, namebuf);
|
name = strcpyrealloc(name, namebuf);
|
||||||
@@ -122,10 +122,10 @@ diff -Nru vdr-1.4.7-vanilla/channels.c vdr-1.4.7-pluginparam/channels.c
|
|||||||
|
|
||||||
free(parambuf);
|
free(parambuf);
|
||||||
free(sourcebuf);
|
free(sourcebuf);
|
||||||
diff -Nru vdr-1.4.7-vanilla/channels.h vdr-1.4.7-pluginparam/channels.h
|
diff -Nru vdr-1.7.9-vanilla/channels.h vdr-1.7.9-pluginsparam/channels.h
|
||||||
--- vdr-1.4.7-vanilla/channels.h 2007-10-27 01:08:39.000000000 +0300
|
--- vdr-1.7.9-vanilla/channels.h 2009-08-23 18:12:32.000000000 +0300
|
||||||
+++ vdr-1.4.7-pluginparam/channels.h 2007-10-27 01:12:37.000000000 +0300
|
+++ vdr-1.7.9-pluginsparam/channels.h 2009-08-23 18:18:54.000000000 +0300
|
||||||
@@ -114,6 +114,7 @@
|
@@ -116,6 +116,7 @@
|
||||||
char *shortName;
|
char *shortName;
|
||||||
char *provider;
|
char *provider;
|
||||||
char *portalName;
|
char *portalName;
|
||||||
@@ -133,7 +133,7 @@ diff -Nru vdr-1.4.7-vanilla/channels.h vdr-1.4.7-pluginparam/channels.h
|
|||||||
int __BeginData__;
|
int __BeginData__;
|
||||||
int frequency; // MHz
|
int frequency; // MHz
|
||||||
int source;
|
int source;
|
||||||
@@ -165,6 +166,7 @@
|
@@ -174,6 +175,7 @@
|
||||||
int Frequency(void) const { return frequency; } ///< Returns the actual frequency, as given in 'channels.conf'
|
int Frequency(void) const { return frequency; } ///< Returns the actual frequency, as given in 'channels.conf'
|
||||||
int Transponder(void) const; ///< Returns the transponder frequency in MHz, plus the polarization in case of sat
|
int Transponder(void) const; ///< Returns the transponder frequency in MHz, plus the polarization in case of sat
|
||||||
static int Transponder(int Frequency, char Polarization); ///< builds the transponder from the given Frequency and Polarization
|
static int Transponder(int Frequency, char Polarization); ///< builds the transponder from the given Frequency and Polarization
|
||||||
@@ -141,77 +141,45 @@ diff -Nru vdr-1.4.7-vanilla/channels.h vdr-1.4.7-pluginparam/channels.h
|
|||||||
int Source(void) const { return source; }
|
int Source(void) const { return source; }
|
||||||
int Srate(void) const { return srate; }
|
int Srate(void) const { return srate; }
|
||||||
int Vpid(void) const { return vpid; }
|
int Vpid(void) const { return vpid; }
|
||||||
@@ -198,6 +200,7 @@
|
@@ -214,6 +216,7 @@
|
||||||
int Hierarchy(void) const { return hierarchy; }
|
int RollOff(void) const { return rollOff; }
|
||||||
const cLinkChannels* LinkChannels(void) const { return linkChannels; }
|
const cLinkChannels* LinkChannels(void) const { return linkChannels; }
|
||||||
const cChannel *RefChannel(void) const { return refChannel; }
|
const cChannel *RefChannel(void) const { return refChannel; }
|
||||||
+ bool IsPlug(void) const { return cSource::IsPlug(source); }
|
+ bool IsPlug(void) const { return cSource::IsPlug(source); }
|
||||||
bool IsCable(void) const { return cSource::IsCable(source); }
|
bool IsCable(void) const { return cSource::IsCable(source); }
|
||||||
bool IsSat(void) const { return cSource::IsSat(source); }
|
bool IsSat(void) const { return cSource::IsSat(source); }
|
||||||
bool IsTerr(void) const { return cSource::IsTerr(source); }
|
bool IsTerr(void) const { return cSource::IsTerr(source); }
|
||||||
@@ -205,12 +208,14 @@
|
@@ -221,12 +224,14 @@
|
||||||
bool HasTimer(void) const;
|
bool HasTimer(void) const;
|
||||||
int Modification(int Mask = CHANNELMOD_ALL);
|
int Modification(int Mask = CHANNELMOD_ALL);
|
||||||
void CopyTransponderData(const cChannel *Channel);
|
void CopyTransponderData(const cChannel *Channel);
|
||||||
+ bool SetPlugTransponderData(int Source, int Frequency, const char *PluginParam);
|
+ bool SetPlugTransponderData(int Source, int Frequency, const char *PluginParam);
|
||||||
bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH);
|
bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, int Modulation, int System, int RollOff);
|
||||||
bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH);
|
bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH);
|
||||||
bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission);
|
bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission);
|
||||||
void SetId(int Nid, int Tid, int Sid, int Rid = 0);
|
void SetId(int Nid, int Tid, int Sid, int Rid = 0);
|
||||||
void SetName(const char *Name, const char *ShortName, const char *Provider);
|
void SetName(const char *Name, const char *ShortName, const char *Provider);
|
||||||
void SetPortalName(const char *PortalName);
|
void SetPortalName(const char *PortalName);
|
||||||
+ void SetPluginParam(const char *PluginParam);
|
+ void SetPluginParam(const char *PluginParam);
|
||||||
void SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int Tpid);
|
void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
|
||||||
void SetCaIds(const int *CaIds); // list must be zero-terminated
|
void SetCaIds(const int *CaIds); // list must be zero-terminated
|
||||||
void SetCaDescriptors(int Level);
|
void SetCaDescriptors(int Level);
|
||||||
diff -Nru vdr-1.4.7-vanilla/config.h vdr-1.4.7-pluginparam/config.h
|
diff -Nru vdr-1.7.9-vanilla/config.h vdr-1.7.9-pluginsparam/config.h
|
||||||
--- vdr-1.4.7-vanilla/config.h 2007-10-27 01:08:39.000000000 +0300
|
--- vdr-1.7.9-vanilla/config.h 2009-08-23 18:12:32.000000000 +0300
|
||||||
+++ vdr-1.4.7-pluginparam/config.h 2007-10-27 01:14:39.000000000 +0300
|
+++ vdr-1.7.9-pluginsparam/config.h 2009-08-23 18:18:54.000000000 +0300
|
||||||
@@ -29,6 +29,8 @@
|
@@ -30,6 +30,8 @@
|
||||||
#define APIVERSION "1.4.5"
|
#define APIVERSION "1.7.9"
|
||||||
#define APIVERSNUM 10405 // Version * 10000 + Major * 100 + Minor
|
#define APIVERSNUM 10709 // Version * 10000 + Major * 100 + Minor
|
||||||
|
|
||||||
+#define PLUGINPARAMPATCHVERSNUM 1
|
+#define PLUGINPARAMPATCHVERSNUM 1
|
||||||
+
|
+
|
||||||
// When loading plugins, VDR searches them by their APIVERSION, which
|
// When loading plugins, VDR searches them by their APIVERSION, which
|
||||||
// may be smaller than VDRVERSION in case there have been no changes to
|
// may be smaller than VDRVERSION in case there have been no changes to
|
||||||
// VDR header files since the last APIVERSION. This allows compiled
|
// VDR header files since the last APIVERSION. This allows compiled
|
||||||
diff -Nru vdr-1.4.7-vanilla/i18n.c vdr-1.4.7-pluginparam/i18n.c
|
diff -Nru vdr-1.7.9-vanilla/menu.c vdr-1.7.9-pluginsparam/menu.c
|
||||||
--- vdr-1.4.7-vanilla/i18n.c 2007-10-27 01:08:39.000000000 +0300
|
--- vdr-1.7.9-vanilla/menu.c 2009-08-23 18:12:32.000000000 +0300
|
||||||
+++ vdr-1.4.7-pluginparam/i18n.c 2007-10-27 01:11:38.000000000 +0300
|
+++ vdr-1.7.9-pluginsparam/menu.c 2009-08-23 18:18:54.000000000 +0300
|
||||||
@@ -6126,6 +6126,28 @@
|
@@ -190,6 +190,7 @@
|
||||||
"Ingen titel",
|
|
||||||
"Bez názvu",
|
|
||||||
},
|
|
||||||
+ { "Parameters",
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "Parametrit",
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ "",// TODO
|
|
||||||
+ },
|
|
||||||
{ NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
diff -Nru vdr-1.4.7-vanilla/menu.c vdr-1.4.7-pluginparam/menu.c
|
|
||||||
--- vdr-1.4.7-vanilla/menu.c 2007-10-27 01:08:39.000000000 +0300
|
|
||||||
+++ vdr-1.4.7-pluginparam/menu.c 2007-10-27 01:09:05.000000000 +0300
|
|
||||||
@@ -216,6 +216,7 @@
|
|
||||||
cChannel *channel;
|
cChannel *channel;
|
||||||
cChannel data;
|
cChannel data;
|
||||||
char name[256];
|
char name[256];
|
||||||
@@ -219,23 +187,23 @@ diff -Nru vdr-1.4.7-vanilla/menu.c vdr-1.4.7-pluginparam/menu.c
|
|||||||
void Setup(void);
|
void Setup(void);
|
||||||
public:
|
public:
|
||||||
cMenuEditChannel(cChannel *Channel, bool New = false);
|
cMenuEditChannel(cChannel *Channel, bool New = false);
|
||||||
@@ -248,6 +249,7 @@
|
@@ -222,6 +223,7 @@
|
||||||
|
|
||||||
// Parameters for all types of sources:
|
// Parameters for all types of sources:
|
||||||
strn0cpy(name, data.name, sizeof(name));
|
strn0cpy(name, data.name, sizeof(name));
|
||||||
+ strn0cpy(pluginParam, data.pluginParam, sizeof(pluginParam));
|
+ strn0cpy(pluginParam, data.pluginParam, sizeof(pluginParam));
|
||||||
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name), tr(FileNameChars)));
|
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name)));
|
||||||
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
|
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
|
||||||
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
|
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
|
||||||
@@ -276,6 +278,7 @@
|
@@ -254,6 +256,7 @@
|
||||||
ST(" T") Add(new cMenuEditMapItem( tr("Transmission"), &data.transmission, TransmissionValues));
|
|
||||||
ST(" T") Add(new cMenuEditMapItem( tr("Guard"), &data.guard, GuardValues));
|
ST(" T") Add(new cMenuEditMapItem( tr("Guard"), &data.guard, GuardValues));
|
||||||
ST(" T") Add(new cMenuEditMapItem( tr("Hierarchy"), &data.hierarchy, HierarchyValues, tr("none")));
|
ST(" T") Add(new cMenuEditMapItem( tr("Hierarchy"), &data.hierarchy, HierarchyValues));
|
||||||
|
ST(" S ") Add(new cMenuEditMapItem( tr("Rolloff"), &data.rollOff, RollOffValues));
|
||||||
+ ST("P ") Add(new cMenuEditStrItem( tr("Parameters"), pluginParam, sizeof(pluginParam), tr(FileNameChars)));
|
+ ST("P ") Add(new cMenuEditStrItem( tr("Parameters"), pluginParam, sizeof(pluginParam), tr(FileNameChars)));
|
||||||
|
|
||||||
SetCurrent(Get(current));
|
SetCurrent(Get(current));
|
||||||
Display();
|
Display();
|
||||||
@@ -290,6 +293,7 @@
|
@@ -268,6 +271,7 @@
|
||||||
if (Key == kOk) {
|
if (Key == kOk) {
|
||||||
if (Channels.HasUniqueChannelID(&data, channel)) {
|
if (Channels.HasUniqueChannelID(&data, channel)) {
|
||||||
data.name = strcpyrealloc(data.name, name);
|
data.name = strcpyrealloc(data.name, name);
|
||||||
@@ -243,9 +211,29 @@ diff -Nru vdr-1.4.7-vanilla/menu.c vdr-1.4.7-pluginparam/menu.c
|
|||||||
if (channel) {
|
if (channel) {
|
||||||
*channel = data;
|
*channel = data;
|
||||||
isyslog("edited channel %d %s", channel->Number(), *data.ToText());
|
isyslog("edited channel %d %s", channel->Number(), *data.ToText());
|
||||||
diff -Nru vdr-1.4.7-vanilla/sources.c vdr-1.4.7-pluginparam/sources.c
|
diff -Nru vdr-1.7.9-vanilla/po/fi_FI.po vdr-1.7.9-pluginsparam/po/fi_FI.po
|
||||||
--- vdr-1.4.7-vanilla/sources.c 2007-10-27 01:08:39.000000000 +0300
|
--- vdr-1.7.9-vanilla/po/fi_FI.po 2009-08-23 18:12:33.000000000 +0300
|
||||||
+++ vdr-1.4.7-pluginparam/sources.c 2007-10-27 01:09:20.000000000 +0300
|
+++ vdr-1.7.9-pluginsparam/po/fi_FI.po 2009-08-23 18:18:54.000000000 +0300
|
||||||
|
@@ -1025,3 +1025,6 @@
|
||||||
|
#, c-format
|
||||||
|
msgid "VDR will shut down in %s minutes"
|
||||||
|
msgstr "VDR sammuu %s minuutin kuluttua"
|
||||||
|
+
|
||||||
|
+msgid "Parameters"
|
||||||
|
+msgstr "Parametrit"
|
||||||
|
diff -Nru vdr-1.7.9-vanilla/po/fr_FR.po vdr-1.7.9-pluginsparam/po/fr_FR.po
|
||||||
|
--- vdr-1.7.9-vanilla/po/fr_FR.po 2009-08-23 18:12:33.000000000 +0300
|
||||||
|
+++ vdr-1.7.9-pluginsparam/po/fr_FR.po 2009-08-23 18:18:54.000000000 +0300
|
||||||
|
@@ -1028,3 +1028,6 @@
|
||||||
|
#, c-format
|
||||||
|
msgid "VDR will shut down in %s minutes"
|
||||||
|
msgstr "VDR s'arrêtera dans %s minutes"
|
||||||
|
+
|
||||||
|
+msgid "Parameters"
|
||||||
|
+msgstr "Paramètres"
|
||||||
|
diff -Nru vdr-1.7.9-vanilla/sources.c vdr-1.7.9-pluginsparam/sources.c
|
||||||
|
--- vdr-1.7.9-vanilla/sources.c 2009-08-23 18:12:32.000000000 +0300
|
||||||
|
+++ vdr-1.7.9-pluginsparam/sources.c 2009-08-23 18:18:54.000000000 +0300
|
||||||
@@ -37,6 +37,7 @@
|
@@ -37,6 +37,7 @@
|
||||||
char buffer[16];
|
char buffer[16];
|
||||||
char *q = buffer;
|
char *q = buffer;
|
||||||
@@ -262,10 +250,10 @@ diff -Nru vdr-1.4.7-vanilla/sources.c vdr-1.4.7-pluginparam/sources.c
|
|||||||
case 'C': type = stCable; break;
|
case 'C': type = stCable; break;
|
||||||
case 'S': type = stSat; break;
|
case 'S': type = stSat; break;
|
||||||
case 'T': type = stTerr; break;
|
case 'T': type = stTerr; break;
|
||||||
diff -Nru vdr-1.4.7-vanilla/sources.conf vdr-1.4.7-pluginparam/sources.conf
|
diff -Nru vdr-1.7.9-vanilla/sources.conf vdr-1.7.9-pluginsparam/sources.conf
|
||||||
--- vdr-1.4.7-vanilla/sources.conf 2007-10-27 01:08:39.000000000 +0300
|
--- vdr-1.7.9-vanilla/sources.conf 2009-08-23 18:12:32.000000000 +0300
|
||||||
+++ vdr-1.4.7-pluginparam/sources.conf 2007-10-27 01:09:20.000000000 +0300
|
+++ vdr-1.7.9-pluginsparam/sources.conf 2009-08-23 18:18:54.000000000 +0300
|
||||||
@@ -188,3 +188,7 @@
|
@@ -194,3 +194,7 @@
|
||||||
# Terrestrial
|
# Terrestrial
|
||||||
|
|
||||||
T Terrestrial
|
T Terrestrial
|
||||||
@@ -273,9 +261,9 @@ diff -Nru vdr-1.4.7-vanilla/sources.conf vdr-1.4.7-pluginparam/sources.conf
|
|||||||
+# Plugin
|
+# Plugin
|
||||||
+
|
+
|
||||||
+P Plugin
|
+P Plugin
|
||||||
diff -Nru vdr-1.4.7-vanilla/sources.h vdr-1.4.7-pluginparam/sources.h
|
diff -Nru vdr-1.7.9-vanilla/sources.h vdr-1.7.9-pluginsparam/sources.h
|
||||||
--- vdr-1.4.7-vanilla/sources.h 2007-10-27 01:08:40.000000000 +0300
|
--- vdr-1.7.9-vanilla/sources.h 2009-08-23 18:12:32.000000000 +0300
|
||||||
+++ vdr-1.4.7-pluginparam/sources.h 2007-10-27 01:09:20.000000000 +0300
|
+++ vdr-1.7.9-pluginsparam/sources.h 2009-08-23 18:18:54.000000000 +0300
|
||||||
@@ -16,10 +16,11 @@
|
@@ -16,10 +16,11 @@
|
||||||
public:
|
public:
|
||||||
enum eSourceType {
|
enum eSourceType {
|
||||||
161
pidscanner.c
Normal file
161
pidscanner.c
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
/*
|
||||||
|
* pidscanner.c: IPTV plugin for the Video Disk Recorder
|
||||||
|
*
|
||||||
|
* See the README file for copyright information and how to reach the author.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include "pidscanner.h"
|
||||||
|
|
||||||
|
#define PIDSCANNER_TIMEOUT_IN_MS 15000 /* 15s timeout for detection */
|
||||||
|
#define PIDSCANNER_APID_COUNT 5 /* minimum count of audio pid samples for pid detection */
|
||||||
|
#define PIDSCANNER_VPID_COUNT 5 /* minimum count of video pid samples for pid detection */
|
||||||
|
#define PIDSCANNER_PID_DELTA_COUNT 100 /* minimum count of pid samples for audio/video only pid detection */
|
||||||
|
|
||||||
|
cPidScanner::cPidScanner(void)
|
||||||
|
: timeout(0),
|
||||||
|
process(true),
|
||||||
|
Vpid(0xFFFF),
|
||||||
|
Apid(0xFFFF),
|
||||||
|
numVpids(0),
|
||||||
|
numApids(0)
|
||||||
|
{
|
||||||
|
debug("cPidScanner::cPidScanner()\n");
|
||||||
|
channel = cChannel();
|
||||||
|
}
|
||||||
|
|
||||||
|
cPidScanner::~cPidScanner()
|
||||||
|
{
|
||||||
|
debug("cPidScanner::~cPidScanner()\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void cPidScanner::SetChannel(const cChannel *Channel)
|
||||||
|
{
|
||||||
|
if (Channel) {
|
||||||
|
debug("cPidScanner::SetChannel(): %s\n", Channel->PluginParam());
|
||||||
|
channel = *Channel;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
debug("cPidScanner::SetChannel()\n");
|
||||||
|
channel = cChannel();
|
||||||
|
}
|
||||||
|
Vpid = 0xFFFF;
|
||||||
|
numVpids = 0;
|
||||||
|
Apid = 0xFFFF;
|
||||||
|
numApids = 0;
|
||||||
|
process = true;
|
||||||
|
timeout.Set(PIDSCANNER_TIMEOUT_IN_MS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cPidScanner::Process(const uint8_t* buf)
|
||||||
|
{
|
||||||
|
//debug("cPidScanner::Process()\n");
|
||||||
|
if (!process)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Stop scanning after defined timeout
|
||||||
|
if (timeout.TimedOut()) {
|
||||||
|
debug("cPidScanner::Process: Timed out determining pids\n");
|
||||||
|
process = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify TS packet
|
||||||
|
if (buf[0] != 0x47) {
|
||||||
|
error("Not TS packet: 0x%X\n", buf[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Found TS packet
|
||||||
|
int pid = ts_pid(buf);
|
||||||
|
int xpid = (buf[1] << 8 | buf[2]);
|
||||||
|
|
||||||
|
// Check if payload available
|
||||||
|
uint8_t count = payload(buf);
|
||||||
|
if (count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (xpid & 0x4000) {
|
||||||
|
// Stream start (Payload Unit Start Indicator)
|
||||||
|
uchar *d = (uint8_t*)buf;
|
||||||
|
d += 4;
|
||||||
|
// pointer to payload
|
||||||
|
if (buf[3] & 0x20)
|
||||||
|
d += d[0] + 1;
|
||||||
|
// Skip adaption field
|
||||||
|
if (buf[3] & 0x10) {
|
||||||
|
// Payload present
|
||||||
|
if ((d[0] == 0) && (d[1] == 0) && (d[2] == 1)) {
|
||||||
|
// PES packet start
|
||||||
|
int sid = d[3];
|
||||||
|
// Stream ID
|
||||||
|
if ((sid >= 0xC0) && (sid <= 0xDF)) {
|
||||||
|
if (pid < Apid) {
|
||||||
|
debug("cPidScanner::Process: Found lower Apid: 0x%X instead of 0x%X\n", pid, Apid);
|
||||||
|
Apid = pid;
|
||||||
|
numApids = 1;
|
||||||
|
}
|
||||||
|
else if (pid == Apid) {
|
||||||
|
++numApids;
|
||||||
|
debug("cPidScanner::Process: Incrementing Apids, now at %d\n", numApids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((sid >= 0xE0) && (sid <= 0xEF)) {
|
||||||
|
if (pid < Vpid) {
|
||||||
|
debug("cPidScanner::Process: Found lower Vpid: 0x%X instead of 0x%X\n", pid, Vpid);
|
||||||
|
Vpid = pid;
|
||||||
|
numVpids = 1;
|
||||||
|
}
|
||||||
|
else if (pid == Vpid) {
|
||||||
|
++numVpids;
|
||||||
|
debug("cPidScanner::Process: Incrementing Vpids, now at %d\n", numVpids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (((numVpids >= PIDSCANNER_VPID_COUNT) && (numApids >= PIDSCANNER_APID_COUNT)) ||
|
||||||
|
(abs(numApids - numVpids) >= PIDSCANNER_PID_DELTA_COUNT)) {
|
||||||
|
// Lock channels for pid updates
|
||||||
|
if (!Channels.Lock(true, 10)) {
|
||||||
|
timeout.Set(PIDSCANNER_TIMEOUT_IN_MS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
|
||||||
|
if (IptvChannel) {
|
||||||
|
int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated
|
||||||
|
int Dpids[MAXDPIDS + 1] = { 0 };
|
||||||
|
int Spids[MAXSPIDS + 1] = { 0 };
|
||||||
|
char ALangs[MAXAPIDS][MAXLANGCODE2] = { "" };
|
||||||
|
char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" };
|
||||||
|
char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" };
|
||||||
|
int Ppid = IptvChannel->Ppid();
|
||||||
|
int Tpid = IptvChannel->Tpid();
|
||||||
|
bool foundApid = false;
|
||||||
|
if (numVpids < PIDSCANNER_VPID_COUNT)
|
||||||
|
Vpid = 0; // No detected video pid
|
||||||
|
else if (numApids < PIDSCANNER_APID_COUNT)
|
||||||
|
Apid = 0; // No detected audio pid
|
||||||
|
for (unsigned int i = 1; i < MAXAPIDS; ++i) {
|
||||||
|
Apids[i] = IptvChannel->Apid(i);
|
||||||
|
if (Apids[i] && (Apids[i] == Apid))
|
||||||
|
foundApid = true;
|
||||||
|
}
|
||||||
|
if (!foundApid)
|
||||||
|
Apids[0] = Apid;
|
||||||
|
for (unsigned int i = 0; i < MAXDPIDS; ++i)
|
||||||
|
Dpids[i] = IptvChannel->Dpid(i);
|
||||||
|
for (unsigned int i = 0; i < MAXSPIDS; ++i)
|
||||||
|
Spids[i] = IptvChannel->Spid(i);
|
||||||
|
debug("cPidScanner::Process(): Vpid=0x%04X, Apid=0x%04X\n", Vpid, Apid);
|
||||||
|
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
|
||||||
|
int Vtype = IptvChannel->Vtype();
|
||||||
|
IptvChannel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
|
||||||
|
#else
|
||||||
|
IptvChannel->SetPids(Vpid, Ppid, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
Channels.Unlock();
|
||||||
|
process = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
pidscanner.h
Normal file
31
pidscanner.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* pidscanner.h: IPTV plugin for the Video Disk Recorder
|
||||||
|
*
|
||||||
|
* See the README file for copyright information and how to reach the author.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __PIDSCANNER_H
|
||||||
|
#define __PIDSCANNER_H
|
||||||
|
|
||||||
|
#include <vdr/tools.h>
|
||||||
|
#include <vdr/channels.h>
|
||||||
|
|
||||||
|
class cPidScanner {
|
||||||
|
private:
|
||||||
|
cTimeMs timeout;
|
||||||
|
cChannel channel;
|
||||||
|
bool process;
|
||||||
|
int Vpid;
|
||||||
|
int Apid;
|
||||||
|
int numVpids;
|
||||||
|
int numApids;
|
||||||
|
|
||||||
|
public:
|
||||||
|
cPidScanner(void);
|
||||||
|
~cPidScanner();
|
||||||
|
void SetChannel(const cChannel *Channel);
|
||||||
|
void Process(const uint8_t* buf);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __PIDSCANNER_H
|
||||||
169
po/de_DE.po
Normal file
169
po/de_DE.po
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
# VDR plugin language source file.
|
||||||
|
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||||
|
# This file is distributed under the same license as the iptv package.
|
||||||
|
# Tobias <vdr@e-tobi.net>, 2007.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: iptv 0.2.5\n"
|
||||||
|
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||||
|
"POT-Creation-Date: 2009-03-06 22:15+0200\n"
|
||||||
|
"PO-Revision-Date: 2007-10-29 21:19+0100\n"
|
||||||
|
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
|
||||||
|
"Language-Team: German\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)"
|
||||||
|
msgstr "EIT (0x4E/0x4F)"
|
||||||
|
|
||||||
|
msgid "EIT (0x5X)"
|
||||||
|
msgstr "EIT (0x5X)"
|
||||||
|
|
||||||
|
msgid "EIT (0x6X)"
|
||||||
|
msgstr "EIT (0x6X)"
|
||||||
|
|
||||||
|
msgid "TDT (0x70)"
|
||||||
|
msgstr "TDT (0x70)"
|
||||||
|
|
||||||
|
msgid "Experience the IPTV"
|
||||||
|
msgstr "Erlebe IPTV"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "DATEI"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protokoll"
|
||||||
|
|
||||||
|
msgid "Delay (ms)"
|
||||||
|
msgstr "Verzögerung (ms)"
|
||||||
|
|
||||||
|
msgid "Script"
|
||||||
|
msgstr "Skript"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Parameter"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Adresse"
|
||||||
|
|
||||||
|
msgid "Port"
|
||||||
|
msgstr "Port"
|
||||||
|
|
||||||
|
msgid "Scan Sid"
|
||||||
|
msgstr "Scanne SID"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Scanne PIDS"
|
||||||
|
|
||||||
|
msgid "Vtype"
|
||||||
|
msgstr "Vtype"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Cannot find unique channel settings!"
|
||||||
|
msgstr "Kann eindeutige Kanaleinstellungen nicht finden!"
|
||||||
|
|
||||||
|
msgid "IPTV Channels"
|
||||||
|
msgstr "IPTV Kanäle"
|
||||||
|
|
||||||
|
msgid "IPTV Information"
|
||||||
|
msgstr "IPTV Informationen"
|
||||||
|
|
||||||
|
msgid "General"
|
||||||
|
msgstr "Allgemein"
|
||||||
|
|
||||||
|
msgid "Pids"
|
||||||
|
msgstr "Pids"
|
||||||
|
|
||||||
|
msgid "Filters"
|
||||||
|
msgstr "Filter"
|
||||||
|
|
||||||
|
msgid "Bits/bytes"
|
||||||
|
msgstr "Bits/Bytes"
|
||||||
|
|
||||||
|
msgid "IPTV information not available!"
|
||||||
|
msgstr "IPTV Informationen nicht verfügbar!"
|
||||||
|
|
||||||
|
msgid "TS buffer size [MB]"
|
||||||
|
msgstr "TS Puffergröße [MB]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||||
|
"\n"
|
||||||
|
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "TS buffer prefill ratio [%]"
|
||||||
|
msgstr "TS Puffer-Preload [%]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||||
|
"\n"
|
||||||
|
"This is useful if streaming media over a slow or unreliable connection."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "EXT protocol base port"
|
||||||
|
msgstr "EXT Protokoll Basisport"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a base port used by 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 EXT protocol."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Use section filtering"
|
||||||
|
msgstr "Benutze Abschnittsfilterung"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
|
||||||
|
msgid "Disable filters"
|
||||||
|
msgstr "Deaktiviere Filter"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
|
||||||
|
#. TRANSLATORS: note the singular!
|
||||||
|
msgid "Disable filter"
|
||||||
|
msgstr "Deaktiviere Filter"
|
||||||
|
|
||||||
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Help"
|
||||||
|
msgstr "Hilfe"
|
||||||
87
po/fi_FI.po
87
po/fi_FI.po
@@ -1,18 +1,18 @@
|
|||||||
# VDR plugin language source file.
|
# VDR plugin language source file.
|
||||||
# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de>
|
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||||
# This file is distributed under the same license as the VDR 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 1.5.7\n"
|
"Project-Id-Version: iptv 0.2.5\n"
|
||||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||||
"POT-Creation-Date: 2007-10-20 19:43+0300\n"
|
"POT-Creation-Date: 2009-03-06 22:15+0200\n"
|
||||||
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
|
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
|
||||||
"Last-Translator: Rolf Ahrenberg\n"
|
"Last-Translator: Rolf Ahrenberg\n"
|
||||||
"Language-Team: <vdr@linuxtv.org>\n"
|
"Language-Team: <vdr@linuxtv.org>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=ISO-8859-15\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
msgid "PAT (0x00)"
|
msgid "PAT (0x00)"
|
||||||
@@ -69,17 +69,26 @@ msgstr "Osoite"
|
|||||||
msgid "Port"
|
msgid "Port"
|
||||||
msgstr "Portti"
|
msgstr "Portti"
|
||||||
|
|
||||||
|
msgid "Scan Sid"
|
||||||
|
msgstr "Etsi palvelu-ID"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Etsi pidit"
|
||||||
|
|
||||||
|
msgid "Vtype"
|
||||||
|
msgstr "Kuvatyyppi"
|
||||||
|
|
||||||
msgid "Nid"
|
msgid "Nid"
|
||||||
msgstr "Verkko-ID"
|
msgstr "Verkko-ID"
|
||||||
|
|
||||||
msgid "Tid"
|
msgid "Tid"
|
||||||
msgstr "L<EFBFBD>hete-ID"
|
msgstr "Lähete-ID"
|
||||||
|
|
||||||
msgid "Rid"
|
msgid "Rid"
|
||||||
msgstr "Radio-ID"
|
msgstr "Radio-ID"
|
||||||
|
|
||||||
msgid "Cannot find unique channel settings!"
|
msgid "Cannot find unique channel settings!"
|
||||||
msgstr "Yksil<EFBFBD>llisi<EFBFBD> kanava-asetuksia ei l<EFBFBD>ydet<EFBFBD>!"
|
msgstr "Yksilöllisiä kanava-asetuksia ei löydetä!"
|
||||||
|
|
||||||
msgid "IPTV Channels"
|
msgid "IPTV Channels"
|
||||||
msgstr "IPTV-kanavat"
|
msgstr "IPTV-kanavat"
|
||||||
@@ -105,21 +114,71 @@ msgstr "IPTV-tietoja ei saatavilla!"
|
|||||||
msgid "TS buffer size [MB]"
|
msgid "TS buffer size [MB]"
|
||||||
msgstr "TS-puskurin koko [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 [%]"
|
msgid "TS buffer prefill ratio [%]"
|
||||||
msgstr "TS-puskurin esit<EFBFBD>ytt<EFBFBD>aste [%]"
|
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 "EXT protocol base port"
|
msgid "EXT protocol base port"
|
||||||
msgstr "EXT-protokollan perusportti"
|
msgstr "EXT-protokollan perusportti"
|
||||||
|
|
||||||
msgid "Use section filtering"
|
msgid ""
|
||||||
msgstr "K<>yt<79> sektioiden suodatusta"
|
"Define a base port used by 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 EXT protocol."
|
||||||
|
msgstr ""
|
||||||
|
"Määrittele EXT-protokollan käyttämä perusportti.\n"
|
||||||
|
"\n"
|
||||||
|
"Porttiavaruuden koko määräytyy käytettyjen IPTV-laitteiden mukaan. Laajennos lukee EXT-protokollan yhteydessä perusportista dataa, jota ulkoiset ohjelmistot tarjoavat."
|
||||||
|
|
||||||
msgid "Scan Sid automatically"
|
msgid "Use section filtering"
|
||||||
msgstr "Etsi palvelu-ID automaattisesti"
|
msgstr "Käytä sektioiden suodatusta"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
"Määrittele suodatuksen käyttö sektioille.\n"
|
||||||
|
"\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."
|
||||||
|
|
||||||
msgid "Disable filters"
|
msgid "Disable filters"
|
||||||
msgstr "Poista suodattimia k<EFBFBD>yt<EFBFBD>st<EFBFBD>"
|
msgstr "Poista suodattimia käytöstä"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
"Määrittele käytöstä poistettavien suodattimien lukumäärä sektioille.\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."
|
||||||
|
|
||||||
#. TRANSLATORS: note the singular!
|
#. TRANSLATORS: note the singular!
|
||||||
msgid "Disable filter"
|
msgid "Disable filter"
|
||||||
msgstr "Poista suodatin k<EFBFBD>yt<EFBFBD>st<EFBFBD>"
|
msgstr "Poista suodatin käytöstä"
|
||||||
|
|
||||||
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
|
msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle listalle."
|
||||||
|
|
||||||
|
msgid "Help"
|
||||||
|
msgstr "Opaste"
|
||||||
|
|||||||
186
po/fr_FR.po
Normal file
186
po/fr_FR.po
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
# French translations for iptv package.
|
||||||
|
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||||
|
# This file is distributed under the same license as the iptv package.
|
||||||
|
# Bruno ROUSSEL <bruno.roussel@free.fr>, 2007.
|
||||||
|
# NIVAL Michaël <mnival@club-internet.fr>, 2008.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: iptv 0.2.5\n"
|
||||||
|
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||||
|
"POT-Creation-Date: 2009-03-06 22:15+0200\n"
|
||||||
|
"PO-Revision-Date: 2008-01-26 13:14+0100\n"
|
||||||
|
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
|
||||||
|
"Language-Team: French\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)"
|
||||||
|
msgstr "EIT (0x4E/0x4F)"
|
||||||
|
|
||||||
|
msgid "EIT (0x5X)"
|
||||||
|
msgstr "EIT (0x5X)"
|
||||||
|
|
||||||
|
msgid "EIT (0x6X)"
|
||||||
|
msgstr "EIT (0x6X)"
|
||||||
|
|
||||||
|
msgid "TDT (0x70)"
|
||||||
|
msgstr "TDT (0x70)"
|
||||||
|
|
||||||
|
msgid "Experience the IPTV"
|
||||||
|
msgstr "L'expérience IPTV"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "FICHIER"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protocole"
|
||||||
|
|
||||||
|
msgid "Delay (ms)"
|
||||||
|
msgstr "Délai (ms)"
|
||||||
|
|
||||||
|
msgid "Script"
|
||||||
|
msgstr "Script"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Paramètre"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Adresse"
|
||||||
|
|
||||||
|
msgid "Port"
|
||||||
|
msgstr "Port"
|
||||||
|
|
||||||
|
msgid "Scan Sid"
|
||||||
|
msgstr "Scanne les SID"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Scanne les PID"
|
||||||
|
|
||||||
|
msgid "Vtype"
|
||||||
|
msgstr "Vtype"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Cannot find unique channel settings!"
|
||||||
|
msgstr "Impossible de trouver un paramètre de chaîne unique !"
|
||||||
|
|
||||||
|
msgid "IPTV Channels"
|
||||||
|
msgstr "Canal IPTV"
|
||||||
|
|
||||||
|
msgid "IPTV Information"
|
||||||
|
msgstr "Information sur IPTV"
|
||||||
|
|
||||||
|
msgid "General"
|
||||||
|
msgstr "Général"
|
||||||
|
|
||||||
|
msgid "Pids"
|
||||||
|
msgstr "Pids"
|
||||||
|
|
||||||
|
msgid "Filters"
|
||||||
|
msgstr "Filtres"
|
||||||
|
|
||||||
|
msgid "Bits/bytes"
|
||||||
|
msgstr "Bits/Bytes"
|
||||||
|
|
||||||
|
msgid "IPTV information not available!"
|
||||||
|
msgstr "Information sur IPTV non disponible !"
|
||||||
|
|
||||||
|
msgid "TS buffer size [MB]"
|
||||||
|
msgstr "Taille du buffer TS [MB]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||||
|
"\n"
|
||||||
|
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||||
|
msgstr ""
|
||||||
|
"Définit la taille du ringbuffer pour le transport du flux en megabytes.\n"
|
||||||
|
"\n"
|
||||||
|
"Une taille plus petite taille aide la consommation de mémoire, mais c'est sujet à plus de débordement de tampon."
|
||||||
|
|
||||||
|
msgid "TS buffer prefill ratio [%]"
|
||||||
|
msgstr "Taux du buffer de pré-remplissage TS [%]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||||
|
"\n"
|
||||||
|
"This is useful if streaming media over a slow or unreliable connection."
|
||||||
|
msgstr ""
|
||||||
|
"Définit le ratio de pré-remplissage du ringbuffer pour le transport du flux avant transfert dans VDR.\n"
|
||||||
|
"\n"
|
||||||
|
"Cette option est utile si le streaming est sur une connexion lente ou peu fiables."
|
||||||
|
|
||||||
|
msgid "EXT protocol base port"
|
||||||
|
msgstr "Port de base du protocole EXT"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a base port used by 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 EXT protocol."
|
||||||
|
msgstr ""
|
||||||
|
"Définit le port de base utilisé par le protocole EXT.\n"
|
||||||
|
"\n"
|
||||||
|
"La plage de port est défini par le nombre de dispositif IPTV. Ce paramètre défini le port qui est écouté pour les connexions à partir d'applications externes en utilisant le protocole EXT."
|
||||||
|
|
||||||
|
msgid "Use section filtering"
|
||||||
|
msgstr "Utiliser le filtrage de section"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
"Définit si la section de filtrage doit être utilisé.\n"
|
||||||
|
"\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."
|
||||||
|
|
||||||
|
msgid "Disable filters"
|
||||||
|
msgstr "Désactiver les 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 ""
|
||||||
|
"Définit le numéro de section de filtrage qui sont désactivé.\n"
|
||||||
|
"\n"
|
||||||
|
"Certains filtrage de section peux engendrer des comportement indésirables. Blacklist les filtres qui seront laissé intact pour VDR."
|
||||||
|
|
||||||
|
#. TRANSLATORS: note the singular!
|
||||||
|
msgid "Disable filter"
|
||||||
|
msgstr "Désactiver le filtre"
|
||||||
|
|
||||||
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
|
msgstr "Définit les mauvais comportement qui doivent être désactivé."
|
||||||
|
|
||||||
|
msgid "Help"
|
||||||
|
msgstr "Aide"
|
||||||
185
po/it_IT.po
Normal file
185
po/it_IT.po
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
# VDR plugin language source file.
|
||||||
|
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||||
|
# This file is distributed under the same license as the iptv package.
|
||||||
|
# Diego Pierotto <vdr-italian@tiscali.it>, 2008.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: iptv 0.2.5\n"
|
||||||
|
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||||
|
"POT-Creation-Date: 2009-03-06 22:15+0200\n"
|
||||||
|
"PO-Revision-Date: 2008-07-13 03:28+0100\n"
|
||||||
|
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
|
||||||
|
"Language-Team: Italian\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)"
|
||||||
|
msgstr "EIT (0x4E/0x4F)"
|
||||||
|
|
||||||
|
msgid "EIT (0x5X)"
|
||||||
|
msgstr "EIT (0x5X)"
|
||||||
|
|
||||||
|
msgid "EIT (0x6X)"
|
||||||
|
msgstr "EIT (0x6X)"
|
||||||
|
|
||||||
|
msgid "TDT (0x70)"
|
||||||
|
msgstr "TDT (0x70)"
|
||||||
|
|
||||||
|
msgid "Experience the IPTV"
|
||||||
|
msgstr "Scopri la IPTV"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "FILE"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protocollo"
|
||||||
|
|
||||||
|
msgid "Delay (ms)"
|
||||||
|
msgstr "Ritardo (ms)"
|
||||||
|
|
||||||
|
msgid "Script"
|
||||||
|
msgstr "Script"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Parametro"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Indirizzo"
|
||||||
|
|
||||||
|
msgid "Port"
|
||||||
|
msgstr "Porta"
|
||||||
|
|
||||||
|
msgid "Scan Sid"
|
||||||
|
msgstr "Scansione Sid"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Scansione Pids"
|
||||||
|
|
||||||
|
msgid "Vtype"
|
||||||
|
msgstr "Vtype"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Cannot find unique channel settings!"
|
||||||
|
msgstr "Impossibile trovare impostazioni canale unico!"
|
||||||
|
|
||||||
|
msgid "IPTV Channels"
|
||||||
|
msgstr "Canali IPTV"
|
||||||
|
|
||||||
|
msgid "IPTV Information"
|
||||||
|
msgstr "Informazione IPTV"
|
||||||
|
|
||||||
|
msgid "General"
|
||||||
|
msgstr "Generale"
|
||||||
|
|
||||||
|
msgid "Pids"
|
||||||
|
msgstr "Pids"
|
||||||
|
|
||||||
|
msgid "Filters"
|
||||||
|
msgstr "Filtri"
|
||||||
|
|
||||||
|
msgid "Bits/bytes"
|
||||||
|
msgstr "Bits/bytes"
|
||||||
|
|
||||||
|
msgid "IPTV information not available!"
|
||||||
|
msgstr "Informazione IPTV non disponibile!"
|
||||||
|
|
||||||
|
msgid "TS buffer size [MB]"
|
||||||
|
msgstr "Dimensione buffer TS [MB]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||||
|
"\n"
|
||||||
|
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||||
|
msgstr ""
|
||||||
|
"Definisci una dimensione del buffer in MB per i flussi di trasporto.\n"
|
||||||
|
"\n"
|
||||||
|
"Dimensioni più piccole aiutano il consumo di memoria, ma sono più inclini a generare buffer overflows."
|
||||||
|
|
||||||
|
msgid "TS buffer prefill ratio [%]"
|
||||||
|
msgstr "Riempimento buffer TS [%]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||||
|
"\n"
|
||||||
|
"This is useful if streaming media over a slow or unreliable connection."
|
||||||
|
msgstr ""
|
||||||
|
"Definisci un rapporto di riempimento del buffer per i flussi di trasporto prima che i dati siano trasferiti a VDR.\n"
|
||||||
|
"\n"
|
||||||
|
"Questo è utile se si trasmette dati su una connessione lenta oppure inaffidabile."
|
||||||
|
|
||||||
|
msgid "EXT protocol base port"
|
||||||
|
msgstr "Porta base protocollo EXT"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a base port used by 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 EXT protocol."
|
||||||
|
msgstr ""
|
||||||
|
"Definisci una porta base usata dal protocollo EXT.\n"
|
||||||
|
"\n"
|
||||||
|
"Il range della porta è definito dal numero di periferiche IPTV. Questo parametro imposta la porta che è in ascolto per connessioni da applicazioni esterne quando si usa il protocollo EXT."
|
||||||
|
|
||||||
|
msgid "Use section filtering"
|
||||||
|
msgstr "Utilizza sezione filtri"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
"Definisci se la sezione filtri sarà utilizzata.\n"
|
||||||
|
"\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."
|
||||||
|
|
||||||
|
msgid "Disable filters"
|
||||||
|
msgstr "Disabilita filtri"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
"Definisci il numero di sezione filtri che sarà disabilitato.\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."
|
||||||
|
|
||||||
|
#. TRANSLATORS: note the singular!
|
||||||
|
msgid "Disable filter"
|
||||||
|
msgstr "Disabilita filtro"
|
||||||
|
|
||||||
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
|
msgstr "Definisci un filtro corrotto che sarà messo nella lista nera."
|
||||||
|
|
||||||
|
msgid "Help"
|
||||||
|
msgstr "Aiuto"
|
||||||
170
po/ru_RU.po
Normal file
170
po/ru_RU.po
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
# VDR plugin language source file.
|
||||||
|
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||||
|
# This file is distributed under the same license as the iptv package.
|
||||||
|
# Alexander Gross <Bikalexander@gmail.com>, 2008.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: iptv 0.2.5\n"
|
||||||
|
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||||
|
"POT-Creation-Date: 2009-03-06 22:15+0200\n"
|
||||||
|
"PO-Revision-Date: 2008-03-16 12:14+0100\n"
|
||||||
|
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
|
||||||
|
"Language-Team: Russian <de@li.org>\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"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
|
||||||
|
msgid "PAT (0x00)"
|
||||||
|
msgstr "PAT (0x00)"
|
||||||
|
|
||||||
|
msgid "NIT (0x40)"
|
||||||
|
msgstr "NIT (0x40)"
|
||||||
|
|
||||||
|
msgid "SDT (0x42)"
|
||||||
|
msgstr "SDT (0x42)"
|
||||||
|
|
||||||
|
msgid "EIT (0x4E/0x4F)"
|
||||||
|
msgstr "EIT (0x4E/0x4F)"
|
||||||
|
|
||||||
|
msgid "EIT (0x5X)"
|
||||||
|
msgstr "EIT (0x5X)"
|
||||||
|
|
||||||
|
msgid "EIT (0x6X)"
|
||||||
|
msgstr "EIT (0x6X)"
|
||||||
|
|
||||||
|
msgid "TDT (0x70)"
|
||||||
|
msgstr "TDT (0x70)"
|
||||||
|
|
||||||
|
msgid "Experience the IPTV"
|
||||||
|
msgstr "Попробуй IPTV"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "ФАЙЛ"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Протокол"
|
||||||
|
|
||||||
|
msgid "Delay (ms)"
|
||||||
|
msgstr "Задержка (мс)"
|
||||||
|
|
||||||
|
msgid "Script"
|
||||||
|
msgstr "Скрипт"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Параметр"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Адрес"
|
||||||
|
|
||||||
|
msgid "Port"
|
||||||
|
msgstr "Порт"
|
||||||
|
|
||||||
|
msgid "Scan Sid"
|
||||||
|
msgstr "Сканировать SID"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Сканировать пиды"
|
||||||
|
|
||||||
|
msgid "Vtype"
|
||||||
|
msgstr "Vtype"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Cannot find unique channel settings!"
|
||||||
|
msgstr "Невозможно найти уникальные настройки канала!"
|
||||||
|
|
||||||
|
msgid "IPTV Channels"
|
||||||
|
msgstr "IPTV каналы"
|
||||||
|
|
||||||
|
msgid "IPTV Information"
|
||||||
|
msgstr "IPTV информация"
|
||||||
|
|
||||||
|
msgid "General"
|
||||||
|
msgstr "Общее"
|
||||||
|
|
||||||
|
msgid "Pids"
|
||||||
|
msgstr "Пиды"
|
||||||
|
|
||||||
|
msgid "Filters"
|
||||||
|
msgstr "Фильтры"
|
||||||
|
|
||||||
|
msgid "Bits/bytes"
|
||||||
|
msgstr "Биты / байт"
|
||||||
|
|
||||||
|
msgid "IPTV information not available!"
|
||||||
|
msgstr "IPTV информация отсутствует!"
|
||||||
|
|
||||||
|
msgid "TS buffer size [MB]"
|
||||||
|
msgstr "Размер TS буфера [MB]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||||
|
"\n"
|
||||||
|
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "TS buffer prefill ratio [%]"
|
||||||
|
msgstr "Предварительный буфер TS [%]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||||
|
"\n"
|
||||||
|
"This is useful if streaming media over a slow or unreliable connection."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "EXT protocol base port"
|
||||||
|
msgstr "Базисный порт EXT протокола"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a base port used by 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 EXT protocol."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Use section filtering"
|
||||||
|
msgstr "Использовать область фильтрации"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
|
||||||
|
msgid "Disable filters"
|
||||||
|
msgstr "Деактивировать фильтры"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
|
||||||
|
#. TRANSLATORS: note the singular!
|
||||||
|
msgid "Disable filter"
|
||||||
|
msgstr "Деактивировать фильтр"
|
||||||
|
|
||||||
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
|
msgstr "Неправильно работающий фильтр, занести в черный список."
|
||||||
|
|
||||||
|
msgid "Help"
|
||||||
|
msgstr "Справка"
|
||||||
156
po2i18n.pl
156
po2i18n.pl
@@ -1,156 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
#
|
|
||||||
# po2i18n - Convert plugin po files in into i18n.c-format
|
|
||||||
#
|
|
||||||
# See the README file for copyright information and how to reach the author.
|
|
||||||
#
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
my @LANGS = (
|
|
||||||
"en_US",
|
|
||||||
"de_DE",
|
|
||||||
"sl_SI",
|
|
||||||
"it_IT",
|
|
||||||
"nl_NL",
|
|
||||||
"pt_PT",
|
|
||||||
"fr_FR",
|
|
||||||
"nn_NO",
|
|
||||||
"fi_FI",
|
|
||||||
"pl_PL",
|
|
||||||
"es_ES",
|
|
||||||
"el_GR",
|
|
||||||
"sv_SE",
|
|
||||||
"ro_RO",
|
|
||||||
"hu_HU",
|
|
||||||
"ca_ES",
|
|
||||||
"ru_RU",
|
|
||||||
"hr_HR",
|
|
||||||
"et_EE",
|
|
||||||
"da_DK",
|
|
||||||
"cs_CZ",
|
|
||||||
"tr_TR"
|
|
||||||
);
|
|
||||||
|
|
||||||
my %VERS = (
|
|
||||||
"en_US" => 10200,
|
|
||||||
"de_DE" => 10200,
|
|
||||||
"sl_SI" => 10200,
|
|
||||||
"it_IT" => 10200,
|
|
||||||
"nl_NL" => 10200,
|
|
||||||
"pt_PT" => 10200,
|
|
||||||
"fr_FR" => 10200,
|
|
||||||
"nn_NO" => 10200,
|
|
||||||
"fi_FI" => 10200,
|
|
||||||
"pl_PL" => 10200,
|
|
||||||
"es_ES" => 10200,
|
|
||||||
"el_GR" => 10200,
|
|
||||||
"sv_SE" => 10200,
|
|
||||||
"ro_RO" => 10200,
|
|
||||||
"hu_HU" => 10200,
|
|
||||||
"ca_ES" => 10200,
|
|
||||||
"ru_RU" => 10302,
|
|
||||||
"hr_HR" => 10307,
|
|
||||||
"et_EE" => 10313,
|
|
||||||
"da_DK" => 10316,
|
|
||||||
"cs_CZ" => 10342,
|
|
||||||
"tr_TR" => 10502
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
my %strings;
|
|
||||||
|
|
||||||
foreach my $lang (@LANGS) { $strings{$lang} = { }; }
|
|
||||||
|
|
||||||
|
|
||||||
sub LoadLanguage(*) {
|
|
||||||
my ($lang) = @_;
|
|
||||||
|
|
||||||
if (!open FILE, "<", "po/$lang.po") {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $msgid = "";
|
|
||||||
my $msgstr = "";
|
|
||||||
my $last = 0; # 0=init, 1=msgid was last, 2=msgstr was last
|
|
||||||
|
|
||||||
while (<FILE>) {
|
|
||||||
chomp;
|
|
||||||
my $line = $_;
|
|
||||||
|
|
||||||
if ($line =~ /^msgid "(.*)"$/) {
|
|
||||||
if ($last eq 2) {
|
|
||||||
$strings{$lang}->{$msgid} = $msgstr;
|
|
||||||
$strings{"en_US"}->{$msgid} = $msgid;
|
|
||||||
}
|
|
||||||
$msgid = $1;
|
|
||||||
$last = 1;
|
|
||||||
} elsif ($line =~ /^msgstr "(.*)"/) {
|
|
||||||
$msgstr = $1;
|
|
||||||
$last = 2;
|
|
||||||
} elsif ($line =~ /^"(.*)"/) {
|
|
||||||
if ($last eq 1) {
|
|
||||||
$msgid = $msgid . $1;
|
|
||||||
} elsif ($last eq 2) {
|
|
||||||
$msgstr = $msgstr . $1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($last eq 2) {
|
|
||||||
$strings{$lang}->{$msgid} = $msgstr;
|
|
||||||
$strings{"en_US"}->{$msgid} = $msgid;
|
|
||||||
}
|
|
||||||
|
|
||||||
close FILE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach my $lang (@LANGS) {
|
|
||||||
LoadLanguage($lang);
|
|
||||||
}
|
|
||||||
|
|
||||||
my @msgids = sort keys %{$strings{"en_US"}};
|
|
||||||
|
|
||||||
|
|
||||||
my $silent = 0;
|
|
||||||
|
|
||||||
while (<>) {
|
|
||||||
my $line = $_;
|
|
||||||
|
|
||||||
if ($line =~ /^\/\/ START I18N/) {
|
|
||||||
print "// START I18N - automatically generated by po2i18n.pl\n";
|
|
||||||
for my $msgid (@msgids) {
|
|
||||||
next if $msgid eq "";
|
|
||||||
|
|
||||||
my $head = " { ";
|
|
||||||
my $endif = "";
|
|
||||||
my $versnum = 10200;
|
|
||||||
|
|
||||||
for my $lang (@LANGS) {
|
|
||||||
if ($VERS{$lang} ne $versnum) {
|
|
||||||
$versnum = $VERS{$lang};
|
|
||||||
print $endif;
|
|
||||||
print "#if VDRVERSNUM >= $versnum\n";
|
|
||||||
$endif = "#endif\n";
|
|
||||||
}
|
|
||||||
my $msgstr = $strings{$lang}->{$msgid};
|
|
||||||
$msgstr = "" if !defined $msgstr;
|
|
||||||
|
|
||||||
print "$head\"$msgstr\",\n";
|
|
||||||
$head = " ";
|
|
||||||
}
|
|
||||||
print $endif;
|
|
||||||
print " },\n";
|
|
||||||
}
|
|
||||||
$silent = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$silent) { print $line; }
|
|
||||||
|
|
||||||
if ($line =~ /^\/\/ END I18N/) {
|
|
||||||
print "// END I18N - automatically generated by po2i18n.pl\n";
|
|
||||||
$silent = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocolext.c,v 1.20 2007/10/21 19:32:14 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@@ -22,21 +21,17 @@
|
|||||||
|
|
||||||
cIptvProtocolExt::cIptvProtocolExt()
|
cIptvProtocolExt::cIptvProtocolExt()
|
||||||
: pid(-1),
|
: pid(-1),
|
||||||
|
scriptFile(""),
|
||||||
scriptParameter(0)
|
scriptParameter(0)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::cIptvProtocolExt()\n");
|
debug("cIptvProtocolExt::cIptvProtocolExt()\n");
|
||||||
scriptFile = strdup("");
|
|
||||||
listenAddr = strdup("127.0.0.1");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvProtocolExt::~cIptvProtocolExt()
|
cIptvProtocolExt::~cIptvProtocolExt()
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::~cIptvProtocolExt()\n");
|
debug("cIptvProtocolExt::~cIptvProtocolExt()\n");
|
||||||
// Drop the socket connection
|
// Drop the socket connection
|
||||||
Close();
|
cIptvProtocolExt::Close();
|
||||||
// Free allocated memory
|
|
||||||
free(scriptFile);
|
|
||||||
free(listenAddr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvProtocolExt::ExecuteScript(void)
|
void cIptvProtocolExt::ExecuteScript(void)
|
||||||
@@ -44,7 +39,7 @@ void cIptvProtocolExt::ExecuteScript(void)
|
|||||||
debug("cIptvProtocolExt::ExecuteScript()\n");
|
debug("cIptvProtocolExt::ExecuteScript()\n");
|
||||||
// Check if already executing
|
// Check if already executing
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
error("ERROR: Cannot execute script!");
|
error("Cannot execute script!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Let's fork
|
// Let's fork
|
||||||
@@ -56,15 +51,12 @@ void cIptvProtocolExt::ExecuteScript(void)
|
|||||||
for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
|
for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
|
||||||
close(i);
|
close(i);
|
||||||
// Execute the external script
|
// Execute the external script
|
||||||
char* cmd = NULL;
|
cString cmd = cString::sprintf("%s %d %d", *scriptFile, scriptParameter, socketPort);
|
||||||
asprintf(&cmd, "%s %d %d", scriptFile, scriptParameter, socketPort);
|
debug("cIptvProtocolExt::ExecuteScript(child): %s\n", *cmd);
|
||||||
debug("cIptvProtocolExt::ExecuteScript(child): %s\n", cmd);
|
if (execl("/bin/sh", "sh", "-c", *cmd, NULL) == -1) {
|
||||||
if (execl("/bin/sh", "sh", "-c", cmd, NULL) == -1) {
|
error("Script execution failed: %s", *cmd);
|
||||||
error("ERROR: Script executionfailed: %s", cmd);
|
|
||||||
free(cmd);
|
|
||||||
_exit(-1);
|
_exit(-1);
|
||||||
}
|
}
|
||||||
free(cmd);
|
|
||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -87,7 +79,7 @@ void cIptvProtocolExt::TerminateScript(void)
|
|||||||
retval = 0;
|
retval = 0;
|
||||||
waitms += timeoutms;
|
waitms += timeoutms;
|
||||||
if ((waitms % 2000) == 0) {
|
if ((waitms % 2000) == 0) {
|
||||||
error("ERROR: Script '%s' won't terminate - killing it!", scriptFile);
|
error("Script '%s' won't terminate - killing it!", *scriptFile);
|
||||||
kill(pid, SIGKILL);
|
kill(pid, SIGKILL);
|
||||||
}
|
}
|
||||||
// Clear wait status to make sure child exit status is accessible
|
// Clear wait status to make sure child exit status is accessible
|
||||||
@@ -114,8 +106,8 @@ bool cIptvProtocolExt::Open(void)
|
|||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::Open()\n");
|
debug("cIptvProtocolExt::Open()\n");
|
||||||
// Reject empty script files
|
// Reject empty script files
|
||||||
if (!strlen(scriptFile))
|
if (!strlen(*scriptFile))
|
||||||
return false;
|
return false;
|
||||||
// Create the listening socket
|
// Create the listening socket
|
||||||
OpenSocket(socketPort);
|
OpenSocket(socketPort);
|
||||||
// Execute the external script
|
// Execute the external script
|
||||||
@@ -135,9 +127,9 @@ bool cIptvProtocolExt::Close(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvProtocolExt::Read(unsigned char* *BufferAddr)
|
int cIptvProtocolExt::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||||
{
|
{
|
||||||
return cIptvUdpSocket::Read(BufferAddr);
|
return cIptvUdpSocket::Read(BufferAddr, BufferLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolExt::Set(const char* Location, const int Parameter, const int Index)
|
bool cIptvProtocolExt::Set(const char* Location, const int Parameter, const int Index)
|
||||||
@@ -146,10 +138,9 @@ bool cIptvProtocolExt::Set(const char* Location, const int Parameter, const int
|
|||||||
if (!isempty(Location)) {
|
if (!isempty(Location)) {
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
// Update script file and parameter
|
// Update script file and parameter
|
||||||
free(scriptFile);
|
scriptFile = cString::sprintf("%s/%s", IptvConfig.GetConfigDirectory(), Location);
|
||||||
asprintf(&scriptFile, "%s/%s", IptvConfig.GetConfigDirectory(), Location);
|
if ((stat(*scriptFile, &stbuf) != 0) || (strstr(*scriptFile, "..") != 0)) {
|
||||||
if ((stat(scriptFile, &stbuf) != 0) || (strstr(scriptFile, "..") != 0)) {
|
error("Non-existent or relative path script '%s'", *scriptFile);
|
||||||
error("ERROR: Non-existent or relative path script '%s'", scriptFile);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
scriptParameter = Parameter;
|
scriptParameter = Parameter;
|
||||||
@@ -162,5 +153,5 @@ bool cIptvProtocolExt::Set(const char* Location, const int Parameter, const int
|
|||||||
cString cIptvProtocolExt::GetInformation(void)
|
cString cIptvProtocolExt::GetInformation(void)
|
||||||
{
|
{
|
||||||
//debug("cIptvProtocolExt::GetInformation()");
|
//debug("cIptvProtocolExt::GetInformation()");
|
||||||
return cString::sprintf("ext://%s:%d", scriptFile, scriptParameter);
|
return cString::sprintf("ext://%s:%d", *scriptFile, scriptParameter);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocolext.h,v 1.8 2007/10/21 17:32:43 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLEXT_H
|
#ifndef __IPTV_PROTOCOLEXT_H
|
||||||
@@ -16,8 +15,7 @@
|
|||||||
class cIptvProtocolExt : public cIptvUdpSocket, public cIptvProtocolIf {
|
class cIptvProtocolExt : public cIptvUdpSocket, public cIptvProtocolIf {
|
||||||
private:
|
private:
|
||||||
int pid;
|
int pid;
|
||||||
char* listenAddr;
|
cString scriptFile;
|
||||||
char* scriptFile;
|
|
||||||
int scriptParameter;
|
int scriptParameter;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -27,11 +25,11 @@ private:
|
|||||||
public:
|
public:
|
||||||
cIptvProtocolExt();
|
cIptvProtocolExt();
|
||||||
virtual ~cIptvProtocolExt();
|
virtual ~cIptvProtocolExt();
|
||||||
int Read(unsigned char* *BufferAddr);
|
int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
virtual bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
virtual bool Open(void);
|
bool Open(void);
|
||||||
virtual bool Close(void);
|
bool Close(void);
|
||||||
virtual cString GetInformation(void);
|
cString GetInformation(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_PROTOCOLEXT_H
|
#endif // __IPTV_PROTOCOLEXT_H
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocolfile.c,v 1.14 2007/10/20 23:25:14 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -17,25 +16,20 @@
|
|||||||
|
|
||||||
cIptvProtocolFile::cIptvProtocolFile()
|
cIptvProtocolFile::cIptvProtocolFile()
|
||||||
: fileDelay(0),
|
: fileDelay(0),
|
||||||
readBufferLen(TS_SIZE * IptvConfig.GetReadBufferTsCount()),
|
fileStream(NULL),
|
||||||
isActive(false)
|
isActive(false)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolFile::cIptvProtocolFile()\n");
|
debug("cIptvProtocolFile::cIptvProtocolFile()\n");
|
||||||
fileLocation = strdup("");
|
fileLocation = strdup("");
|
||||||
// Allocate receive buffer
|
|
||||||
readBuffer = MALLOC(unsigned char, readBufferLen);
|
|
||||||
if (!readBuffer)
|
|
||||||
error("ERROR: MALLOC() failed in ProtocolFile()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvProtocolFile::~cIptvProtocolFile()
|
cIptvProtocolFile::~cIptvProtocolFile()
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolFile::~cIptvProtocolFile()\n");
|
debug("cIptvProtocolFile::~cIptvProtocolFile()\n");
|
||||||
// Drop open handles
|
// Drop open handles
|
||||||
Close();
|
cIptvProtocolFile::Close();
|
||||||
// Free allocated memory
|
// Free allocated memory
|
||||||
free(fileLocation);
|
free(fileLocation);
|
||||||
free(readBuffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolFile::OpenFile(void)
|
bool cIptvProtocolFile::OpenFile(void)
|
||||||
@@ -62,10 +56,9 @@ void cIptvProtocolFile::CloseFile(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvProtocolFile::Read(unsigned char* *BufferAddr)
|
int cIptvProtocolFile::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||||
{
|
{
|
||||||
//debug("cIptvProtocolFile::Read()\n");
|
//debug("cIptvProtocolFile::Read()\n");
|
||||||
*BufferAddr = readBuffer;
|
|
||||||
// Check errors
|
// Check errors
|
||||||
if (ferror(fileStream)) {
|
if (ferror(fileStream)) {
|
||||||
debug("Read error\n");
|
debug("Read error\n");
|
||||||
@@ -82,7 +75,7 @@ int cIptvProtocolFile::Read(unsigned char* *BufferAddr)
|
|||||||
// during the sleep and buffers are disposed. Check here that the plugin is
|
// during the sleep and buffers are disposed. Check here that the plugin is
|
||||||
// still active before accessing the buffers
|
// still active before accessing the buffers
|
||||||
if (isActive)
|
if (isActive)
|
||||||
return fread(readBuffer, sizeof(unsigned char), readBufferLen, fileStream);
|
return (int)fread(BufferAddr, sizeof(unsigned char), BufferLen, fileStream);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocolfile.h,v 1.7 2007/10/19 22:18:55 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLFILE_H
|
#ifndef __IPTV_PROTOCOLFILE_H
|
||||||
@@ -17,8 +16,6 @@ private:
|
|||||||
char* fileLocation;
|
char* fileLocation;
|
||||||
int fileDelay;
|
int fileDelay;
|
||||||
FILE* fileStream;
|
FILE* fileStream;
|
||||||
unsigned char* readBuffer;
|
|
||||||
unsigned int readBufferLen;
|
|
||||||
bool isActive;
|
bool isActive;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -28,11 +25,11 @@ private:
|
|||||||
public:
|
public:
|
||||||
cIptvProtocolFile();
|
cIptvProtocolFile();
|
||||||
virtual ~cIptvProtocolFile();
|
virtual ~cIptvProtocolFile();
|
||||||
virtual int Read(unsigned char* *BufferAddr);
|
int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
virtual bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
virtual bool Open(void);
|
bool Open(void);
|
||||||
virtual bool Close(void);
|
bool Close(void);
|
||||||
virtual cString GetInformation(void);
|
cString GetInformation(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_PROTOCOLFILE_H
|
#endif // __IPTV_PROTOCOLFILE_H
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocolhttp.c,v 1.21 2007/10/21 19:46:03 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -30,11 +29,10 @@ cIptvProtocolHttp::~cIptvProtocolHttp()
|
|||||||
{
|
{
|
||||||
debug("cIptvProtocolHttp::~cIptvProtocolHttp()\n");
|
debug("cIptvProtocolHttp::~cIptvProtocolHttp()\n");
|
||||||
// Close the socket
|
// Close the socket
|
||||||
Close();
|
cIptvProtocolHttp::Close();
|
||||||
// Free allocated memory
|
// Free allocated memory
|
||||||
free(streamPath);
|
free(streamPath);
|
||||||
free(streamAddr);
|
free(streamAddr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolHttp::Connect(void)
|
bool cIptvProtocolHttp::Connect(void)
|
||||||
@@ -47,7 +45,7 @@ bool cIptvProtocolHttp::Connect(void)
|
|||||||
|
|
||||||
// First try only the IP address
|
// First try only the IP address
|
||||||
sockAddr.sin_addr.s_addr = inet_addr(streamAddr);
|
sockAddr.sin_addr.s_addr = inet_addr(streamAddr);
|
||||||
|
|
||||||
if (sockAddr.sin_addr.s_addr == INADDR_NONE) {
|
if (sockAddr.sin_addr.s_addr == INADDR_NONE) {
|
||||||
debug("Cannot convert %s directly to internet address\n", streamAddr);
|
debug("Cannot convert %s directly to internet address\n", streamAddr);
|
||||||
|
|
||||||
@@ -55,17 +53,15 @@ bool cIptvProtocolHttp::Connect(void)
|
|||||||
struct hostent *host;
|
struct hostent *host;
|
||||||
host = gethostbyname(streamAddr);
|
host = gethostbyname(streamAddr);
|
||||||
if (!host) {
|
if (!host) {
|
||||||
error("%s is not valid address\n", streamAddr);
|
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
error("ERROR: %s", strerror_r(h_errno, tmp, sizeof(tmp)));
|
error("%s is not valid address: %s", streamAddr, strerror_r(h_errno, tmp, sizeof(tmp)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
sockAddr.sin_addr.s_addr = inet_addr(*host->h_addr_list);
|
sockAddr.sin_addr.s_addr = inet_addr(*host->h_addr_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
int err = connect(socketDesc, (struct sockaddr*)&sockAddr,
|
int err = connect(socketDesc, (struct sockaddr *)&sockAddr, sizeof(sockAddr));
|
||||||
sizeof(sockAddr));
|
|
||||||
// Non-blocking sockets always report in-progress error when connected
|
// Non-blocking sockets always report in-progress error when connected
|
||||||
ERROR_IF_FUNC(err < 0 && errno != EINPROGRESS, "connect()", CloseSocket(), return false);
|
ERROR_IF_FUNC(err < 0 && errno != EINPROGRESS, "connect()", CloseSocket(), return false);
|
||||||
// Select with 800ms timeout on the socket completion, check if it is writable
|
// Select with 800ms timeout on the socket completion, check if it is writable
|
||||||
@@ -80,27 +76,23 @@ bool cIptvProtocolHttp::Connect(void)
|
|||||||
|
|
||||||
// If not any errors, then socket must be ready and connected
|
// If not any errors, then socket must be ready and connected
|
||||||
if (socketStatus != 0) {
|
if (socketStatus != 0) {
|
||||||
error("Cannot connect to %s\n", streamAddr);
|
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
error("ERROR: %s", strerror_r(socketStatus, tmp, sizeof(tmp)));
|
error("Cannot connect to %s: %s", streamAddr, strerror_r(socketStatus, tmp, sizeof(tmp)));
|
||||||
CloseSocket();
|
CloseSocket();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formulate and send HTTP request
|
// Formulate and send HTTP request
|
||||||
char buffer[256];
|
cString buffer = cString::sprintf("GET %s HTTP/1.1\r\n"
|
||||||
memset(buffer, '\0', sizeof(buffer));
|
"Host: %s\r\n"
|
||||||
snprintf(buffer, sizeof(buffer),
|
"User-Agent: vdr-iptv\r\n"
|
||||||
"GET %s HTTP/1.1\r\n"
|
"Range: bytes=0-\r\n"
|
||||||
"Host: %s\r\n"
|
"Connection: Close\r\n"
|
||||||
"User-Agent: vdr-iptv\r\n"
|
"\r\n", streamPath, streamAddr);
|
||||||
"Range: bytes=0-\r\n"
|
|
||||||
"Connection: Close\r\n"
|
|
||||||
"\r\n", streamPath, streamAddr);
|
|
||||||
|
|
||||||
//debug("Sending http request: %s\n", buffer);
|
debug("Sending http request: %s\n", *buffer);
|
||||||
err = send(socketDesc, buffer, strlen(buffer), 0);
|
ssize_t err2 = send(socketDesc, buffer, strlen(buffer), 0);
|
||||||
ERROR_IF_FUNC(err < 0, "send()", CloseSocket(), return false);
|
ERROR_IF_FUNC(err2 < 0, "send()", CloseSocket(), return false);
|
||||||
|
|
||||||
// Now process headers
|
// Now process headers
|
||||||
if (!ProcessHeaders()) {
|
if (!ProcessHeaders()) {
|
||||||
@@ -119,21 +111,21 @@ bool cIptvProtocolHttp::Disconnect(void)
|
|||||||
debug("cIptvProtocolHttp::Disconnect()\n");
|
debug("cIptvProtocolHttp::Disconnect()\n");
|
||||||
// Check that stream address is valid
|
// Check that stream address is valid
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
// Close the socket
|
// Close the socket
|
||||||
CloseSocket();
|
CloseSocket();
|
||||||
// Update active flag
|
// Update active flag
|
||||||
isActive = false;
|
isActive = false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen,
|
bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen,
|
||||||
unsigned int &recvLen)
|
unsigned int &recvLen)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolHttp::GetHeaderLine()\n");
|
debug("cIptvProtocolHttp::GetHeaderLine()\n");
|
||||||
bool linefeed = false;
|
bool linefeed = false;
|
||||||
bool newline = false;
|
bool newline = false;
|
||||||
char buf[256];
|
char buf[4096];
|
||||||
char *bufptr = buf;
|
char *bufptr = buf;
|
||||||
memset(buf, '\0', sizeof(buf));
|
memset(buf, '\0', sizeof(buf));
|
||||||
recvLen = 0;
|
recvLen = 0;
|
||||||
@@ -147,7 +139,7 @@ bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen,
|
|||||||
return false;
|
return false;
|
||||||
// Check if data available
|
// Check if data available
|
||||||
else if (retval) {
|
else if (retval) {
|
||||||
int retval = recvfrom(socketDesc, bufptr, 1, MSG_DONTWAIT,
|
ssize_t retval = recvfrom(socketDesc, bufptr, 1, MSG_DONTWAIT,
|
||||||
(struct sockaddr *)&sockAddr, &addrlen);
|
(struct sockaddr *)&sockAddr, &addrlen);
|
||||||
if (retval <= 0)
|
if (retval <= 0)
|
||||||
return false;
|
return false;
|
||||||
@@ -166,6 +158,7 @@ bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen,
|
|||||||
// Check that buffers won't be exceeded
|
// Check that buffers won't be exceeded
|
||||||
if (recvLen >= sizeof(buf) || recvLen >= destLen) {
|
if (recvLen >= sizeof(buf) || recvLen >= destLen) {
|
||||||
error("Header wouldn't fit into buffer\n");
|
error("Header wouldn't fit into buffer\n");
|
||||||
|
recvLen = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,20 +177,20 @@ bool cIptvProtocolHttp::ProcessHeaders(void)
|
|||||||
unsigned int lineLength = 0;
|
unsigned int lineLength = 0;
|
||||||
int response = 0;
|
int response = 0;
|
||||||
bool responseFound = false;
|
bool responseFound = false;
|
||||||
char buf[256];
|
char buf[4096];
|
||||||
|
|
||||||
while (!responseFound || lineLength != 0) {
|
while (!responseFound || lineLength != 0) {
|
||||||
memset(buf, '\0', sizeof(buf));
|
memset(buf, '\0', sizeof(buf));
|
||||||
if (!GetHeaderLine(buf, sizeof(buf), lineLength))
|
if (!GetHeaderLine(buf, sizeof(buf), lineLength))
|
||||||
return false;
|
return false;
|
||||||
if (!responseFound && sscanf(buf, "HTTP/1.%*i %i ",&response) != 1) {
|
if (!responseFound && sscanf(buf, "HTTP/1.%*i %i ", &response) != 1) {
|
||||||
error("Expected HTTP header not found\n");
|
error("Expected HTTP header not found\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
responseFound = true;
|
responseFound = true;
|
||||||
if (response != 200) {
|
if (response != 200) {
|
||||||
error("ERROR: %s\n", buf);
|
error("%s\n", buf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,31 +212,31 @@ bool cIptvProtocolHttp::Close(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvProtocolHttp::Read(unsigned char* *BufferAddr)
|
int cIptvProtocolHttp::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||||
{
|
{
|
||||||
return cIptvTcpSocket::Read(BufferAddr);
|
return cIptvTcpSocket::Read(BufferAddr, BufferLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolHttp::Set(const char* Location, const int Parameter, const int Index)
|
bool cIptvProtocolHttp::Set(const char* Location, const int Parameter, const int Index)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolHttp::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
|
debug("cIptvProtocolHttp::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
|
||||||
if (!isempty(Location)) {
|
if (!isempty(Location)) {
|
||||||
// Disconnect the current socket
|
// Disconnect the current socket
|
||||||
Disconnect();
|
Disconnect();
|
||||||
// Update stream address, path and port
|
// Update stream address, path and port
|
||||||
streamAddr = strcpyrealloc(streamAddr, Location);
|
streamAddr = strcpyrealloc(streamAddr, Location);
|
||||||
char *path = strstr(streamAddr, "/");
|
char *path = strstr(streamAddr, "/");
|
||||||
if (path) {
|
if (path) {
|
||||||
streamPath = strcpyrealloc(streamPath, path);
|
streamPath = strcpyrealloc(streamPath, path);
|
||||||
*path = 0;
|
*path = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
streamPath = strcpyrealloc(streamPath, "/");
|
streamPath = strcpyrealloc(streamPath, "/");
|
||||||
socketPort = Parameter;
|
socketPort = Parameter;
|
||||||
debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
|
//debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
|
||||||
// Re-connect the socket
|
// Re-connect the socket
|
||||||
Connect();
|
Connect();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocolhttp.h,v 1.11 2007/10/21 17:32:43 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLHTTP_H
|
#ifndef __IPTV_PROTOCOLHTTP_H
|
||||||
@@ -21,18 +20,17 @@ private:
|
|||||||
private:
|
private:
|
||||||
bool Connect(void);
|
bool Connect(void);
|
||||||
bool Disconnect(void);
|
bool Disconnect(void);
|
||||||
bool GetHeaderLine(char* dest, unsigned int destLen,
|
bool GetHeaderLine(char* dest, unsigned int destLen, unsigned int &recvLen);
|
||||||
unsigned int &recvLen);
|
|
||||||
bool ProcessHeaders(void);
|
bool ProcessHeaders(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cIptvProtocolHttp();
|
cIptvProtocolHttp();
|
||||||
virtual ~cIptvProtocolHttp();
|
virtual ~cIptvProtocolHttp();
|
||||||
int Read(unsigned char* *BufferAddr);
|
int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
virtual bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
virtual bool Open(void);
|
bool Open(void);
|
||||||
virtual bool Close(void);
|
bool Close(void);
|
||||||
virtual cString GetInformation(void);
|
cString GetInformation(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_PROTOCOLHTTP_H
|
#endif // __IPTV_PROTOCOLHTTP_H
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocolif.h,v 1.7 2007/10/19 22:18:55 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLIF_H
|
#ifndef __IPTV_PROTOCOLIF_H
|
||||||
@@ -13,15 +12,15 @@ class cIptvProtocolIf {
|
|||||||
public:
|
public:
|
||||||
cIptvProtocolIf() {}
|
cIptvProtocolIf() {}
|
||||||
virtual ~cIptvProtocolIf() {}
|
virtual ~cIptvProtocolIf() {}
|
||||||
virtual int Read(unsigned char* *BufferAddr) = 0;
|
virtual int Read(unsigned char* BufferAddr, unsigned int BufferLen) = 0;
|
||||||
virtual bool Set(const char* Location, const int Parameter, const int Index) = 0;
|
virtual bool Set(const char* Location, const int Parameter, const int Index) = 0;
|
||||||
virtual bool Open(void) = 0;
|
virtual bool Open(void) = 0;
|
||||||
virtual bool Close(void) = 0;
|
virtual bool Close(void) = 0;
|
||||||
virtual cString GetInformation(void) = 0;
|
virtual cString GetInformation(void) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cIptvProtocolIf(const cIptvProtocolIf&);
|
cIptvProtocolIf(const cIptvProtocolIf&);
|
||||||
cIptvProtocolIf& operator=(const cIptvProtocolIf&);
|
cIptvProtocolIf& operator=(const cIptvProtocolIf&);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_PROTOCOLIF_H
|
#endif // __IPTV_PROTOCOLIF_H
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocoludp.c,v 1.21 2007/10/21 19:32:15 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -29,7 +28,7 @@ cIptvProtocolUdp::~cIptvProtocolUdp()
|
|||||||
{
|
{
|
||||||
debug("cIptvProtocolUdp::~cIptvProtocolUdp()\n");
|
debug("cIptvProtocolUdp::~cIptvProtocolUdp()\n");
|
||||||
// Drop the multicast group and close the socket
|
// Drop the multicast group and close the socket
|
||||||
Close();
|
cIptvProtocolUdp::Close();
|
||||||
// Free allocated memory
|
// Free allocated memory
|
||||||
free(streamAddr);
|
free(streamAddr);
|
||||||
}
|
}
|
||||||
@@ -92,9 +91,9 @@ bool cIptvProtocolUdp::Close(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvProtocolUdp::Read(unsigned char* *BufferAddr)
|
int cIptvProtocolUdp::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||||
{
|
{
|
||||||
return cIptvUdpSocket::Read(BufferAddr);
|
return cIptvUdpSocket::Read(BufferAddr, BufferLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolUdp::Set(const char* Location, const int Parameter, const int Index)
|
bool cIptvProtocolUdp::Set(const char* Location, const int Parameter, const int Index)
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: protocoludp.h,v 1.12 2007/10/21 17:32:43 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLUDP_H
|
#ifndef __IPTV_PROTOCOLUDP_H
|
||||||
@@ -24,11 +23,11 @@ private:
|
|||||||
public:
|
public:
|
||||||
cIptvProtocolUdp();
|
cIptvProtocolUdp();
|
||||||
virtual ~cIptvProtocolUdp();
|
virtual ~cIptvProtocolUdp();
|
||||||
int Read(unsigned char* *BufferAddr);
|
int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
virtual bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
virtual bool Open(void);
|
bool Open(void);
|
||||||
virtual bool Close(void);
|
bool Close(void);
|
||||||
virtual cString GetInformation(void);
|
cString GetInformation(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_PROTOCOLUDP_H
|
#endif // __IPTV_PROTOCOLUDP_H
|
||||||
|
|||||||
283
sectionfilter.c
283
sectionfilter.c
@@ -3,16 +3,12 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: sectionfilter.c,v 1.15 2007/10/20 23:25:14 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sectionfilter.h"
|
#include "sectionfilter.h"
|
||||||
#include "statistics.h"
|
|
||||||
|
|
||||||
#define IPTV_FILTER_FILENAME "/tmp/vdr-iptv%d.filter%d"
|
cIptvSectionFilter::cIptvSectionFilter(int DeviceIndex, int Index,
|
||||||
|
uint16_t Pid, uint8_t Tid, uint8_t Mask)
|
||||||
cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
|
|
||||||
u_short Pid, u_char Tid, u_char Mask)
|
|
||||||
: pusi_seen(0),
|
: pusi_seen(0),
|
||||||
feedcc(0),
|
feedcc(0),
|
||||||
doneq(0),
|
doneq(0),
|
||||||
@@ -21,174 +17,122 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
|
|||||||
seclen(0),
|
seclen(0),
|
||||||
tsfeedp(0),
|
tsfeedp(0),
|
||||||
pid(Pid),
|
pid(Pid),
|
||||||
|
devid(DeviceIndex),
|
||||||
id(Index)
|
id(Index)
|
||||||
{
|
{
|
||||||
//debug("cIptvSectionFilter::cIptvSectionFilter(%d)\n", Index);
|
//debug("cIptvSectionFilter::cIptvSectionFilter(%d, %d)\n", devid, id);
|
||||||
|
int i;
|
||||||
|
|
||||||
memset(secbuf_base, '\0', sizeof(secbuf_base));
|
memset(secbuf_base, '\0', sizeof(secbuf_base));
|
||||||
memset(filter_value, '\0', sizeof(filter_value));
|
memset(filter_value, '\0', sizeof(filter_value));
|
||||||
memset(filter_mask, '\0', sizeof(filter_mask));
|
memset(filter_mask, '\0', sizeof(filter_mask));
|
||||||
memset(filter_mode, '\0', sizeof(filter_mode));
|
memset(filter_mode, '\0', sizeof(filter_mode));
|
||||||
memset(maskandmode, '\0', sizeof(maskandmode));
|
memset(maskandmode, '\0', sizeof(maskandmode));
|
||||||
memset(maskandnotmode, '\0', sizeof(maskandnotmode));
|
memset(maskandnotmode, '\0', sizeof(maskandnotmode));
|
||||||
memset(pipeName, '\0', sizeof(pipeName));
|
|
||||||
|
|
||||||
SetPipeName(devInd);
|
|
||||||
|
|
||||||
filter_value[0] = Tid;
|
filter_value[0] = Tid;
|
||||||
filter_mask[0] = Mask;
|
filter_mask[0] = Mask;
|
||||||
|
|
||||||
// Invert the filter
|
// Invert the filter
|
||||||
for (int i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
|
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i)
|
||||||
filter_value[i] ^= 0xff;
|
filter_value[i] ^= 0xff;
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t mask, mode, local_doneq = 0;
|
uint8_t mask, mode, local_doneq = 0;
|
||||||
for (int i = 0; i < DMX_MAX_FILTER_SIZE; i++) {
|
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
|
||||||
mode = filter_mode[i];
|
mode = filter_mode[i];
|
||||||
mask = filter_mask[i];
|
mask = filter_mask[i];
|
||||||
maskandmode[i] = mask & mode;
|
maskandmode[i] = (uint8_t)(mask & mode);
|
||||||
local_doneq |= maskandnotmode[i] = mask & ~mode;
|
maskandnotmode[i] = (uint8_t)(mask & ~mode);
|
||||||
}
|
local_doneq |= maskandnotmode[i];
|
||||||
|
}
|
||||||
doneq = local_doneq ? 1 : 0;
|
doneq = local_doneq ? 1 : 0;
|
||||||
|
|
||||||
struct stat sb;
|
// Create sockets
|
||||||
stat(pipeName, &sb);
|
socket[0] = socket[1] = -1;
|
||||||
if (S_ISFIFO(sb.st_mode))
|
if (socketpair(AF_UNIX, SOCK_DGRAM, 0, socket) != 0) {
|
||||||
unlink(pipeName);
|
char tmp[64];
|
||||||
int err = mknod(pipeName, 0644 | S_IFIFO, 0);
|
error("Opening section filter sockets failed (device=%d id=%d): %s\n", devid, id, strerror_r(errno, tmp, sizeof(tmp)));
|
||||||
ERROR_IF_RET(err < 0, "mknod()", return);
|
}
|
||||||
|
else if ((fcntl(socket[0], F_SETFL, O_NONBLOCK) != 0) || (fcntl(socket[1], F_SETFL, O_NONBLOCK) != 0)) {
|
||||||
// Create descriptors
|
char tmp[64];
|
||||||
fifoDescriptor = open(pipeName, O_RDWR | O_NONBLOCK);
|
error("Setting section filter socket to non-blocking mode failed (device=%d id=%d): %s", devid, id, strerror_r(errno, tmp, sizeof(tmp)));
|
||||||
readDescriptor = open(pipeName, O_RDONLY | O_NONBLOCK);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvSectionFilter::~cIptvSectionFilter()
|
cIptvSectionFilter::~cIptvSectionFilter()
|
||||||
{
|
{
|
||||||
//debug("cIptvSectionFilter::~cIptvSectionfilter(%d)\n", id);
|
//debug("cIptvSectionFilter::~cIptvSectionfilter(%d, %d)\n", devid, id);
|
||||||
close(fifoDescriptor);
|
int tmp = socket[1];
|
||||||
close(readDescriptor);
|
socket[1] = -1;
|
||||||
unlink(pipeName);
|
if (tmp >= 0)
|
||||||
memset(pipeName, '\0', sizeof(pipeName));
|
close(tmp);
|
||||||
fifoDescriptor = -1;
|
tmp = socket[0];
|
||||||
readDescriptor = -1;
|
socket[0] = -1;
|
||||||
|
if (tmp >= 0)
|
||||||
|
close(tmp);
|
||||||
|
secbuf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvSectionFilter::SetPipeName(int deviceIndex)
|
int cIptvSectionFilter::GetReadDesc(void)
|
||||||
{
|
{
|
||||||
snprintf(pipeName, sizeof(pipeName), IPTV_FILTER_FILENAME, deviceIndex, id);
|
return socket[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvSectionFilter::GetReadDesc()
|
inline uint16_t cIptvSectionFilter::GetLength(const uint8_t *Data)
|
||||||
{
|
{
|
||||||
return readDescriptor;
|
return (uint16_t)(3 + ((Data[1] & 0x0f) << 8) + Data[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint16_t cIptvSectionFilter::section_length(const uint8_t *buf)
|
void cIptvSectionFilter::New(void)
|
||||||
{
|
{
|
||||||
return 3 + ((buf[1] & 0x0f) << 8) + buf[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
int cIptvSectionFilter::dmxdev_section_callback(const uint8_t *buffer1, size_t buffer1_len,
|
|
||||||
const uint8_t *buffer2, size_t buffer2_len,
|
|
||||||
enum dmx_success success)
|
|
||||||
{
|
|
||||||
// See if there is data in the fifo
|
|
||||||
int retval = select_single_desc(fifoDescriptor, 0, false);
|
|
||||||
// There is no data in the fifo, more can be written
|
|
||||||
if (!retval) {
|
|
||||||
#ifdef DEBUG_PRINTF
|
|
||||||
printf("id = %d, pid %d would now write %d data to buffer\n", id, pid, buffer1_len);
|
|
||||||
for (unsigned int i = 0; i < buffer1_len; ++i)
|
|
||||||
printf("0x%X ", buffer1[i]);
|
|
||||||
printf("\n");
|
|
||||||
#endif
|
|
||||||
retval = write(fifoDescriptor, buffer1, buffer1_len);
|
|
||||||
ERROR_IF(retval < 0, "write()");
|
|
||||||
// Update statistics
|
|
||||||
AddStatistic(retval, 1);
|
|
||||||
}
|
|
||||||
#ifdef DEBUG_PRINTF
|
|
||||||
else if (retval)
|
|
||||||
printf("id %d pid %d data is already present\n", id, pid);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cIptvSectionFilter::demux_swfilter_section_new()
|
|
||||||
{
|
|
||||||
#ifdef DEMUX_SECTION_LOSS_LOG
|
|
||||||
if (secbufp < tsfeedp) {
|
|
||||||
int i, n = tsfeedp - secbufp;
|
|
||||||
/*
|
|
||||||
* Section padding is done with 0xff bytes entirely.
|
|
||||||
* Due to speed reasons, we won't check all of them
|
|
||||||
* but just first and last.
|
|
||||||
*/
|
|
||||||
if (secbuf[0] != 0xff || secbuf[n - 1] != 0xff) {
|
|
||||||
printf("sectionfilter.c section ts padding loss: %d/%d\n",
|
|
||||||
n, tsfeedp);
|
|
||||||
printf("sectionfilter.c pad data:");
|
|
||||||
for (i = 0; i < n; i++)
|
|
||||||
printf(" %02x", secbuf[i]);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
tsfeedp = secbufp = seclen = 0;
|
tsfeedp = secbufp = seclen = 0;
|
||||||
secbuf = secbuf_base;
|
secbuf = secbuf_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvSectionFilter::demux_swfilter_sectionfilter()
|
int cIptvSectionFilter::Filter(void)
|
||||||
{
|
{
|
||||||
uint8_t neq = 0;
|
uint8_t neq = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < DMX_MAX_FILTER_SIZE; i++) {
|
if (secbuf) {
|
||||||
uint8_t local_xor = filter_value[i] ^ secbuf[i];
|
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
|
||||||
if (maskandmode[i] & local_xor) {
|
uint8_t local_xor = (uint8_t)(filter_value[i] ^ secbuf[i]);
|
||||||
#ifdef DEBUG_PRINTF
|
if (maskandmode[i] & local_xor)
|
||||||
printf("maskandmode discard\n");
|
return 0;
|
||||||
#endif
|
neq |= (maskandnotmode[i] & local_xor);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
neq |= maskandnotmode[i] & local_xor;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doneq && !neq) {
|
if (doneq && !neq)
|
||||||
#ifdef DEBUG_PRINTF
|
return 0;
|
||||||
printf("doneq discard, doneq = 0x%X, neq = 0x%X\n", doneq, !neq);
|
|
||||||
#endif
|
// There is no data in the read socket, more can be written
|
||||||
return 0;
|
if ((socket[0] >= 0) && (socket[1] >= 0) /*&& !select_single_desc(socket[0], 0, false)*/) {
|
||||||
|
ssize_t len = write(socket[1], secbuf, seclen);
|
||||||
|
ERROR_IF(len < 0, "write()");
|
||||||
|
// Update statistics
|
||||||
|
AddSectionStatistic(len, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return dmxdev_section_callback(secbuf, seclen, NULL, 0, DMX_OK);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int cIptvSectionFilter::demux_swfilter_section_feed()
|
inline int cIptvSectionFilter::Feed(void)
|
||||||
{
|
{
|
||||||
if (demux_swfilter_sectionfilter() < 0)
|
if (Filter() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
seclen = 0;
|
seclen = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvSectionFilter::demux_swfilter_section_copy_dump(const uint8_t *buf, uint8_t len)
|
int cIptvSectionFilter::CopyDump(const uint8_t *buf, uint8_t len)
|
||||||
{
|
{
|
||||||
uint16_t limit, seclen_local, n;
|
uint16_t limit, seclen_local, n;
|
||||||
|
|
||||||
if (tsfeedp >= DMX_MAX_SECFEED_SIZE)
|
if (tsfeedp >= DMX_MAX_SECFEED_SIZE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (tsfeedp + len > DMX_MAX_SECFEED_SIZE) {
|
if (tsfeedp + len > DMX_MAX_SECFEED_SIZE)
|
||||||
#ifdef DEMUX_SECTION_LOSS_LOG
|
len = (uint8_t)(DMX_MAX_SECFEED_SIZE - tsfeedp);
|
||||||
printf("sectionfilter.c section buffer full loss: %d/%d\n",
|
|
||||||
tsfeedp + len - DMX_MAX_SECFEED_SIZE,
|
|
||||||
DMX_MAX_SECFEED_SIZE);
|
|
||||||
#endif
|
|
||||||
len = DMX_MAX_SECFEED_SIZE - tsfeedp;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (len <= 0)
|
if (len <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -196,108 +140,79 @@ int cIptvSectionFilter::demux_swfilter_section_copy_dump(const uint8_t *buf, uin
|
|||||||
memcpy(secbuf_base + tsfeedp, buf, len);
|
memcpy(secbuf_base + tsfeedp, buf, len);
|
||||||
tsfeedp += len;
|
tsfeedp += len;
|
||||||
|
|
||||||
/*
|
|
||||||
* Dump all the sections we can find in the data (Emard)
|
|
||||||
*/
|
|
||||||
limit = tsfeedp;
|
limit = tsfeedp;
|
||||||
if (limit > DMX_MAX_SECFEED_SIZE)
|
if (limit > DMX_MAX_SECFEED_SIZE)
|
||||||
return -1; /* internal error should never happen */
|
return -1; // internal error should never happen
|
||||||
|
|
||||||
/* to be sure always set secbuf */
|
// Always set secbuf
|
||||||
secbuf = secbuf_base + secbufp;
|
secbuf = secbuf_base + secbufp;
|
||||||
|
|
||||||
for (n = 0; secbufp + 2 < limit; n++) {
|
for (n = 0; secbufp + 2 < limit; ++n) {
|
||||||
seclen_local = section_length(secbuf);
|
seclen_local = GetLength(secbuf);
|
||||||
if (seclen_local <= 0 || seclen_local > DMX_MAX_SECTION_SIZE ||
|
if ((seclen_local <= 0) || (seclen_local > DMX_MAX_SECTION_SIZE) || ((seclen_local + secbufp) > limit))
|
||||||
seclen_local + secbufp > limit)
|
|
||||||
return 0;
|
return 0;
|
||||||
#ifdef DEBUG_PRINTF
|
|
||||||
printf("Non-mismatching seclen! %d, limit = %d\n", seclen_local, limit);
|
|
||||||
#endif
|
|
||||||
seclen = seclen_local;
|
seclen = seclen_local;
|
||||||
/* dump [secbuf .. secbuf+seclen) */
|
|
||||||
if (pusi_seen)
|
if (pusi_seen)
|
||||||
demux_swfilter_section_feed();
|
Feed();
|
||||||
#ifdef DEMUX_SECTION_LOSS_LOG
|
secbufp += seclen_local;
|
||||||
else
|
secbuf += seclen_local;
|
||||||
printf("sectionfilter.c pusi not seen, discarding section data\n");
|
|
||||||
#endif
|
|
||||||
secbufp += seclen_local; /* secbufp and secbuf moving together is */
|
|
||||||
secbuf += seclen_local; /* redundant but saves pointer arithmetic */
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvSectionFilter::ProcessData(const uint8_t* buf)
|
void cIptvSectionFilter::Process(const uint8_t* Data)
|
||||||
{
|
{
|
||||||
if (buf[0] != 0x47) {
|
if (Data[0] != TS_SYNC_BYTE)
|
||||||
error("Not TS packet: 0x%X\n", buf[0]);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// Stop if not the PID this filter is looking for
|
// Stop if not the PID this filter is looking for
|
||||||
if (ts_pid(buf) != pid)
|
if (ts_pid(Data) != pid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint8_t count = payload(buf);
|
uint8_t count = payload(Data);
|
||||||
|
|
||||||
if (count == 0) /* count == 0 if no payload or out of range */
|
// Check if no payload or out of range
|
||||||
|
if (count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint8_t p = 188 - count; /* payload start */
|
// Payload start
|
||||||
|
uint8_t p = (uint8_t)(TS_SIZE - count);
|
||||||
|
|
||||||
uint8_t cc = buf[3] & 0x0f;
|
uint8_t cc = (uint8_t)(Data[3] & 0x0f);
|
||||||
int ccok = ((feedcc + 1) & 0x0f) == cc;
|
int ccok = ((feedcc + 1) & 0x0f) == cc;
|
||||||
feedcc = cc;
|
feedcc = cc;
|
||||||
|
|
||||||
int dc_i = 0;
|
int dc_i = 0;
|
||||||
if (buf[3] & 0x20) {
|
if (Data[3] & 0x20) {
|
||||||
/* adaption field present, check for discontinuity_indicator */
|
// Adaption field present, check for discontinuity_indicator
|
||||||
if ((buf[4] > 0) && (buf[5] & 0x80))
|
if ((Data[4] > 0) && (Data[5] & 0x80))
|
||||||
dc_i = 1;
|
dc_i = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ccok || dc_i) {
|
if (!ccok || dc_i) {
|
||||||
#ifdef DEMUX_SECTION_LOSS_LOG
|
// Discontinuity detected. Reset pusi_seen = 0 to
|
||||||
printf("sectionfilter.c discontinuity detected %d bytes lost\n",
|
// stop feeding of suspicious data until next PUSI=1 arrives
|
||||||
count);
|
|
||||||
/*
|
|
||||||
* those bytes under sume circumstances will again be reported
|
|
||||||
* in the following demux_swfilter_section_new
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
/*
|
|
||||||
* Discontinuity detected. Reset pusi_seen = 0 to
|
|
||||||
* stop feeding of suspicious data until next PUSI=1 arrives
|
|
||||||
*/
|
|
||||||
pusi_seen = 0;
|
pusi_seen = 0;
|
||||||
demux_swfilter_section_new();
|
New();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf[1] & 0x40) {
|
if (Data[1] & 0x40) {
|
||||||
/* PUSI=1 (is set), section boundary is here */
|
// PUSI=1 (is set), section boundary is here
|
||||||
if (count > 1 && buf[p] < count) {
|
if (count > 1 && Data[p] < count) {
|
||||||
#ifdef DEBUG_PRINTF
|
const uint8_t *before = &Data[p + 1];
|
||||||
printf("Valid section\n");
|
uint8_t before_len = Data[p];
|
||||||
#endif
|
|
||||||
const uint8_t *before = &buf[p + 1];
|
|
||||||
uint8_t before_len = buf[p];
|
|
||||||
const uint8_t *after = &before[before_len];
|
const uint8_t *after = &before[before_len];
|
||||||
uint8_t after_len = count - 1 - before_len;
|
uint8_t after_len = (uint8_t)(count - 1 - before_len);
|
||||||
|
CopyDump(before, before_len);
|
||||||
|
|
||||||
demux_swfilter_section_copy_dump(before, before_len);
|
// Before start of new section, set pusi_seen = 1
|
||||||
/* before start of new section, set pusi_seen = 1 */
|
|
||||||
pusi_seen = 1;
|
pusi_seen = 1;
|
||||||
demux_swfilter_section_new();
|
New();
|
||||||
demux_swfilter_section_copy_dump(after, after_len);
|
CopyDump(after, after_len);
|
||||||
}
|
}
|
||||||
#ifdef DEMUX_SECTION_LOSS_LOG
|
|
||||||
else if (count > 0)
|
|
||||||
printf("sectionfilter.c PUSI=1 but %d bytes lost\n", count);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* PUSI=0 (is not set), no section boundary */
|
// PUSI=0 (is not set), no section boundary
|
||||||
demux_swfilter_section_copy_dump(&buf[p], count);
|
CopyDump(&Data[p], count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,49 +3,24 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: sectionfilter.h,v 1.7 2007/10/08 23:51:58 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_SECTIONFILTER_H
|
#ifndef __IPTV_SECTIONFILTER_H
|
||||||
#define __IPTV_SECTIONFILTER_H
|
#define __IPTV_SECTIONFILTER_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <vdr/device.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <libgen.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "statistics.h"
|
#include "statistics.h"
|
||||||
|
|
||||||
class cIptvSectionFilter : public cIptvSectionStatistics {
|
class cIptvSectionFilter : public cIptvSectionStatistics {
|
||||||
private:
|
private:
|
||||||
enum dmx_success {
|
|
||||||
DMX_OK = 0, /* Received Ok */
|
|
||||||
DMX_LENGTH_ERROR, /* Incorrect length */
|
|
||||||
DMX_OVERRUN_ERROR, /* Receiver ring buffer overrun */
|
|
||||||
DMX_CRC_ERROR, /* Incorrect CRC */
|
|
||||||
DMX_FRAME_ERROR, /* Frame alignment error */
|
|
||||||
DMX_FIFO_ERROR, /* Receiver FIFO overrun */
|
|
||||||
DMX_MISSED_ERROR /* Receiver missed packet */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum dmx_limits {
|
enum dmx_limits {
|
||||||
DMX_MAX_FILTER_SIZE = 18,
|
DMX_MAX_FILTER_SIZE = 18,
|
||||||
DMX_MAX_SECTION_SIZE = 4096,
|
DMX_MAX_SECTION_SIZE = 4096,
|
||||||
DMX_MAX_SECFEED_SIZE = (DMX_MAX_SECTION_SIZE + 188)
|
DMX_MAX_SECFEED_SIZE = (DMX_MAX_SECTION_SIZE + TS_SIZE)
|
||||||
};
|
};
|
||||||
|
|
||||||
int fifoDescriptor;
|
|
||||||
int readDescriptor;
|
|
||||||
|
|
||||||
int pusi_seen;
|
int pusi_seen;
|
||||||
int feedcc;
|
int feedcc;
|
||||||
int doneq;
|
int doneq;
|
||||||
@@ -56,49 +31,32 @@ private:
|
|||||||
uint16_t seclen;
|
uint16_t seclen;
|
||||||
uint16_t tsfeedp;
|
uint16_t tsfeedp;
|
||||||
uint16_t pid;
|
uint16_t pid;
|
||||||
|
|
||||||
|
int devid;
|
||||||
int id;
|
int id;
|
||||||
|
int socket[2];
|
||||||
|
|
||||||
uint8_t filter_value[DMX_MAX_FILTER_SIZE];
|
uint8_t filter_value[DMX_MAX_FILTER_SIZE];
|
||||||
uint8_t filter_mask[DMX_MAX_FILTER_SIZE];
|
uint8_t filter_mask[DMX_MAX_FILTER_SIZE];
|
||||||
uint8_t filter_mode[DMX_MAX_FILTER_SIZE];
|
uint8_t filter_mode[DMX_MAX_FILTER_SIZE];
|
||||||
|
|
||||||
uint8_t maskandmode[DMX_MAX_FILTER_SIZE];
|
uint8_t maskandmode[DMX_MAX_FILTER_SIZE];
|
||||||
uint8_t maskandnotmode[DMX_MAX_FILTER_SIZE];
|
uint8_t maskandnotmode[DMX_MAX_FILTER_SIZE];
|
||||||
|
|
||||||
char pipeName[128];
|
inline uint16_t GetLength(const uint8_t *Data);
|
||||||
|
void New(void);
|
||||||
inline uint16_t section_length(const uint8_t *buf);
|
int Filter(void);
|
||||||
|
inline int Feed(void);
|
||||||
int dmxdev_section_callback(const uint8_t *buffer1,
|
int CopyDump(const uint8_t *buf, uint8_t len);
|
||||||
size_t buffer1_len,
|
|
||||||
const uint8_t *buffer2,
|
|
||||||
size_t buffer2_len,
|
|
||||||
enum dmx_success success);
|
|
||||||
|
|
||||||
void demux_swfilter_section_new();
|
|
||||||
|
|
||||||
int demux_swfilter_sectionfilter();
|
|
||||||
|
|
||||||
inline int demux_swfilter_section_feed();
|
|
||||||
|
|
||||||
int demux_swfilter_section_copy_dump(const uint8_t *buf,
|
|
||||||
uint8_t len);
|
|
||||||
|
|
||||||
int GetFifoDesc();
|
|
||||||
void ClearPipeName();
|
|
||||||
void SetPipeName(int deviceIndex);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// constructor & destructor
|
// constructor & destructor
|
||||||
cIptvSectionFilter(int Index, int devInd, u_short Pid, u_char Tid,
|
cIptvSectionFilter(int Index, int DeviceIndex, uint16_t Pid,
|
||||||
u_char Mask);
|
uint8_t Tid, uint8_t Mask);
|
||||||
|
|
||||||
virtual ~cIptvSectionFilter();
|
virtual ~cIptvSectionFilter();
|
||||||
|
void Process(const uint8_t* Data);
|
||||||
void ProcessData(const uint8_t* buf);
|
int GetReadDesc(void);
|
||||||
|
uint16_t GetPid(void) const { return pid; }
|
||||||
int GetReadDesc();
|
|
||||||
uint16_t GetPid() { return pid; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_SECTIONFILTER_H
|
#endif // __IPTV_SECTIONFILTER_H
|
||||||
|
|||||||
222
setup.c
222
setup.c
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: setup.c,v 1.43 2007/10/27 12:07:40 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -11,16 +10,13 @@
|
|||||||
#include <vdr/device.h>
|
#include <vdr/device.h>
|
||||||
#include <vdr/interface.h>
|
#include <vdr/interface.h>
|
||||||
#include <vdr/status.h>
|
#include <vdr/status.h>
|
||||||
|
#include <vdr/menu.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#ifndef trVDR
|
|
||||||
#define trVDR(s) tr(s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// --- cIptvMenuEditChannel --------------------------------------------------
|
// --- cIptvMenuEditChannel --------------------------------------------------
|
||||||
|
|
||||||
class cIptvMenuEditChannel : public cOsdMenu
|
class cIptvMenuEditChannel : public cOsdMenu
|
||||||
@@ -34,14 +30,15 @@ private:
|
|||||||
eProtocolCount
|
eProtocolCount
|
||||||
};
|
};
|
||||||
struct tIptvChannel {
|
struct tIptvChannel {
|
||||||
int frequency, source, protocol, parameter, vpid, ppid, tpid, sid, nid, tid, rid;
|
int frequency, source, protocol, parameter, vpid, ppid, vtype, tpid, sid, nid, tid, rid;
|
||||||
int apid[MAXAPIDS + 1], dpid[MAXDPIDS + 1], spid[MAXSPIDS + 1], caids[MAXCAIDS + 1];
|
int apid[MAXAPIDS + 1], dpid[MAXDPIDS + 1], spid[MAXSPIDS + 1], caids[MAXCAIDS + 1];
|
||||||
|
int sidscan, pidscan;
|
||||||
char name[256], location[256];
|
char name[256], location[256];
|
||||||
} data;
|
} data;
|
||||||
cChannel *channel;
|
cChannel *channel;
|
||||||
const char *protocols[eProtocolCount];
|
const char *protocols[eProtocolCount];
|
||||||
void Setup(void);
|
void Setup(void);
|
||||||
cString GetIptvSettings(const char *Param, int *Parameter, int *Protocol);
|
cString GetIptvSettings(const char *Param, int *Parameter, int *SidScan, int *PidScan, int *Protocol);
|
||||||
void GetChannelData(cChannel *Channel);
|
void GetChannelData(cChannel *Channel);
|
||||||
void SetChannelData(cChannel *Channel);
|
void SetChannelData(cChannel *Channel);
|
||||||
|
|
||||||
@@ -56,7 +53,7 @@ cIptvMenuEditChannel::cIptvMenuEditChannel(cChannel *Channel, bool New)
|
|||||||
protocols[eProtocolUDP] = tr("UDP");
|
protocols[eProtocolUDP] = tr("UDP");
|
||||||
protocols[eProtocolHTTP] = tr("HTTP");
|
protocols[eProtocolHTTP] = tr("HTTP");
|
||||||
protocols[eProtocolFILE] = tr("FILE");
|
protocols[eProtocolFILE] = tr("FILE");
|
||||||
protocols[eProtocolEXT] = tr("EXT");
|
protocols[eProtocolEXT] = tr("EXT");
|
||||||
channel = Channel;
|
channel = Channel;
|
||||||
GetChannelData(channel);
|
GetChannelData(channel);
|
||||||
if (New) {
|
if (New) {
|
||||||
@@ -68,12 +65,33 @@ cIptvMenuEditChannel::cIptvMenuEditChannel(cChannel *Channel, bool New)
|
|||||||
Setup();
|
Setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvMenuEditChannel::GetIptvSettings(const char *Param, int *Parameter, int *Protocol)
|
cString cIptvMenuEditChannel::GetIptvSettings(const char *Param, int *Parameter, int *SidScan, int *PidScan, int *Protocol)
|
||||||
{
|
{
|
||||||
char *tag = NULL;
|
char *tag = NULL;
|
||||||
char *proto = NULL;
|
char *proto = NULL;
|
||||||
char *loc = NULL;
|
char *loc = NULL;
|
||||||
if (sscanf(Param, "%a[^|]|%a[^|]|%a[^|]|%u", &tag, &proto, &loc, Parameter) == 4) {
|
if (sscanf(Param, "%a[^|]|S%dP%d|%a[^|]|%a[^|]|%d", &tag, SidScan, PidScan, &proto, &loc, Parameter) == 6) {
|
||||||
|
cString tagstr(tag, true);
|
||||||
|
cString protostr(proto, true);
|
||||||
|
cString locstr(loc, true);
|
||||||
|
// check if IPTV tag
|
||||||
|
if (strncasecmp(*tagstr, "IPTV", 4) == 0) {
|
||||||
|
// check if protocol is supported and update the pointer
|
||||||
|
if (strncasecmp(*protostr, "UDP", 3) == 0)
|
||||||
|
*Protocol = eProtocolUDP;
|
||||||
|
else if (strncasecmp(*protostr, "HTTP", 4) == 0)
|
||||||
|
*Protocol = eProtocolHTTP;
|
||||||
|
else if (strncasecmp(*protostr, "FILE", 4) == 0)
|
||||||
|
*Protocol = eProtocolFILE;
|
||||||
|
else if (strncasecmp(*protostr, "EXT", 3) == 0)
|
||||||
|
*Protocol = eProtocolEXT;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
// return location
|
||||||
|
return locstr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sscanf(Param, "%a[^|]|P%dS%d|%a[^|]|%a[^|]|%d", &tag, PidScan, SidScan, &proto, &loc, Parameter) == 6) {
|
||||||
cString tagstr(tag, true);
|
cString tagstr(tag, true);
|
||||||
cString protostr(proto, true);
|
cString protostr(proto, true);
|
||||||
cString locstr(loc, true);
|
cString locstr(loc, true);
|
||||||
@@ -100,26 +118,31 @@ cString cIptvMenuEditChannel::GetIptvSettings(const char *Param, int *Parameter,
|
|||||||
void cIptvMenuEditChannel::GetChannelData(cChannel *Channel)
|
void cIptvMenuEditChannel::GetChannelData(cChannel *Channel)
|
||||||
{
|
{
|
||||||
if (Channel) {
|
if (Channel) {
|
||||||
int parameter, protocol;
|
int parameter, protocol, sidscan, pidscan;
|
||||||
data.frequency = Channel->Frequency();
|
data.frequency = Channel->Frequency();
|
||||||
data.source = Channel->Source();
|
data.source = Channel->Source();
|
||||||
data.vpid = Channel->Vpid();
|
data.vpid = Channel->Vpid();
|
||||||
data.ppid = Channel->Ppid();
|
data.ppid = Channel->Ppid();
|
||||||
|
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
|
||||||
|
data.vtype = Channel->Vtype();
|
||||||
|
#endif
|
||||||
data.tpid = Channel->Tpid();
|
data.tpid = Channel->Tpid();
|
||||||
for (unsigned int i = 0; i < sizeof(data.apid); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.apid); ++i)
|
||||||
data.apid[i] = Channel->Apid(i);
|
data.apid[i] = Channel->Apid(i);
|
||||||
for (unsigned int i = 0; i < sizeof(data.dpid); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.dpid); ++i)
|
||||||
data.dpid[i] = Channel->Dpid(i);
|
data.dpid[i] = Channel->Dpid(i);
|
||||||
for (unsigned int i = 0; i < sizeof(data.spid); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.spid); ++i)
|
||||||
data.spid[i] = Channel->Spid(i);
|
data.spid[i] = Channel->Spid(i);
|
||||||
for (unsigned int i = 0; i < sizeof(data.caids); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.caids); ++i)
|
||||||
data.caids[i] = Channel->Ca(i);
|
data.caids[i] = Channel->Ca(i);
|
||||||
data.sid = Channel->Sid();
|
data.sid = Channel->Sid();
|
||||||
data.nid = Channel->Nid();
|
data.nid = Channel->Nid();
|
||||||
data.tid = Channel->Tid();
|
data.tid = Channel->Tid();
|
||||||
data.rid = Channel->Rid();
|
data.rid = Channel->Rid();
|
||||||
strn0cpy(data.name, Channel->Name(), sizeof(data.name));
|
strn0cpy(data.name, Channel->Name(), sizeof(data.name));
|
||||||
strn0cpy(data.location, *GetIptvSettings(Channel->PluginParam(), ¶meter, &protocol), sizeof(data.location));
|
strn0cpy(data.location, *GetIptvSettings(Channel->PluginParam(), ¶meter, &sidscan, &pidscan, &protocol), sizeof(data.location));
|
||||||
|
data.sidscan = sidscan;
|
||||||
|
data.pidscan = pidscan;
|
||||||
data.protocol = protocol;
|
data.protocol = protocol;
|
||||||
data.parameter = parameter;
|
data.parameter = parameter;
|
||||||
}
|
}
|
||||||
@@ -128,14 +151,15 @@ void cIptvMenuEditChannel::GetChannelData(cChannel *Channel)
|
|||||||
data.source = cSource::FromData(cSource::stPlug);
|
data.source = cSource::FromData(cSource::stPlug);
|
||||||
data.vpid = 0;
|
data.vpid = 0;
|
||||||
data.ppid = 0;
|
data.ppid = 0;
|
||||||
|
data.vtype = 0;
|
||||||
data.tpid = 0;
|
data.tpid = 0;
|
||||||
for (unsigned int i = 0; i < sizeof(data.apid); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.apid); ++i)
|
||||||
data.apid[i] = 0;
|
data.apid[i] = 0;
|
||||||
for (unsigned int i = 0; i < sizeof(data.dpid); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.dpid); ++i)
|
||||||
data.dpid[i] = 0;
|
data.dpid[i] = 0;
|
||||||
for (unsigned int i = 0; i < sizeof(data.spid); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.spid); ++i)
|
||||||
data.spid[i] = 0;
|
data.spid[i] = 0;
|
||||||
for (unsigned int i = 0; i < sizeof(data.caids); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(data.caids); ++i)
|
||||||
data.caids[i] = 0;
|
data.caids[i] = 0;
|
||||||
data.sid = 1;
|
data.sid = 1;
|
||||||
data.nid = 0;
|
data.nid = 0;
|
||||||
@@ -143,6 +167,8 @@ void cIptvMenuEditChannel::GetChannelData(cChannel *Channel)
|
|||||||
data.rid = 0;
|
data.rid = 0;
|
||||||
strn0cpy(data.name, "IPTV", sizeof(data.name));
|
strn0cpy(data.name, "IPTV", sizeof(data.name));
|
||||||
strn0cpy(data.location, "127.0.0.1", sizeof(data.location));
|
strn0cpy(data.location, "127.0.0.1", sizeof(data.location));
|
||||||
|
data.sidscan = 0;
|
||||||
|
data.pidscan = 0;
|
||||||
data.protocol = eProtocolUDP;
|
data.protocol = eProtocolUDP;
|
||||||
data.parameter = 1234;
|
data.parameter = 1234;
|
||||||
}
|
}
|
||||||
@@ -156,23 +182,23 @@ void cIptvMenuEditChannel::SetChannelData(cChannel *Channel)
|
|||||||
char dlangs[MAXDPIDS][MAXLANGCODE2] = { "" };
|
char dlangs[MAXDPIDS][MAXLANGCODE2] = { "" };
|
||||||
switch (data.protocol) {
|
switch (data.protocol) {
|
||||||
case eProtocolEXT:
|
case eProtocolEXT:
|
||||||
param = cString::sprintf("IPTV|EXT|%s|%d", data.location, data.parameter);
|
param = cString::sprintf("IPTV|S%dP%d|EXT|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
||||||
break;
|
break;
|
||||||
case eProtocolFILE:
|
case eProtocolFILE:
|
||||||
param = cString::sprintf("IPTV|FILE|%s|%d", data.location, data.parameter);
|
param = cString::sprintf("IPTV|S%dP%d|FILE|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
||||||
break;
|
break;
|
||||||
case eProtocolHTTP:
|
case eProtocolHTTP:
|
||||||
param = cString::sprintf("IPTV|HTTP|%s|%d", data.location, data.parameter);
|
param = cString::sprintf("IPTV|S%dP%d|HTTP|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case eProtocolUDP:
|
case eProtocolUDP:
|
||||||
param = cString::sprintf("IPTV|UDP|%s|%d", data.location, data.parameter);
|
param = cString::sprintf("IPTV|S%dP%d|UDP|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM < 10510
|
|
||||||
Channel->SetPids(data.vpid, data.ppid, data.apid, alangs, data.dpid, dlangs, data.tpid);
|
|
||||||
#else
|
|
||||||
char slangs[MAXSPIDS][MAXLANGCODE2] = { "" };
|
char slangs[MAXSPIDS][MAXLANGCODE2] = { "" };
|
||||||
|
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
|
||||||
|
Channel->SetPids(data.vpid, data.ppid, data.vtype, data.apid, alangs, data.dpid, dlangs, data.spid, slangs, data.tpid);
|
||||||
|
#else
|
||||||
Channel->SetPids(data.vpid, data.ppid, data.apid, alangs, data.dpid, dlangs, data.spid, slangs, data.tpid);
|
Channel->SetPids(data.vpid, data.ppid, data.apid, alangs, data.dpid, dlangs, data.spid, slangs, data.tpid);
|
||||||
#endif
|
#endif
|
||||||
Channel->SetCaIds(data.caids);
|
Channel->SetCaIds(data.caids);
|
||||||
@@ -191,33 +217,39 @@ void cIptvMenuEditChannel::Setup(void)
|
|||||||
eProtocolCount, protocols));
|
eProtocolCount, protocols));
|
||||||
switch (data.protocol) {
|
switch (data.protocol) {
|
||||||
case eProtocolFILE:
|
case eProtocolFILE:
|
||||||
Add(new cMenuEditStrItem(trVDR("File"), data.location, sizeof(data.location), trVDR(FileNameChars)));
|
Add(new cMenuEditStrItem(trVDR("File"), data.location, sizeof(data.location)));
|
||||||
Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.parameter, 0, 0xFFFF));
|
Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.parameter, 0, 0xFFFF));
|
||||||
break;
|
break;
|
||||||
case eProtocolEXT:
|
case eProtocolEXT:
|
||||||
Add(new cMenuEditStrItem(tr("Script"), data.location, sizeof(data.location), trVDR(FileNameChars)));
|
Add(new cMenuEditStrItem(tr("Script"), data.location, sizeof(data.location)));
|
||||||
Add(new cMenuEditIntItem(tr("Parameter"), &data.parameter, 0, 0xFFFF));
|
Add(new cMenuEditIntItem(tr("Parameter"), &data.parameter, 0, 0xFFFF));
|
||||||
break;
|
break;
|
||||||
case eProtocolHTTP:
|
case eProtocolHTTP:
|
||||||
case eProtocolUDP:
|
case eProtocolUDP:
|
||||||
default:
|
default:
|
||||||
Add(new cMenuEditStrItem(tr("Address"), data.location, sizeof(data.location), trVDR(FileNameChars)));
|
Add(new cMenuEditStrItem(tr("Address"), data.location, sizeof(data.location)));
|
||||||
Add(new cMenuEditIntItem(tr("Port"), &data.parameter, 0, 0xFFFF));
|
Add(new cMenuEditIntItem(tr("Port"), &data.parameter, 0, 0xFFFF));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
cOsdItem *sidScanItem = new cMenuEditBoolItem(tr("Scan Sid"), &data.sidscan);
|
||||||
|
if (!IptvConfig.GetSectionFiltering())
|
||||||
|
sidScanItem->SetSelectable(false);
|
||||||
|
Add(sidScanItem);
|
||||||
|
Add(new cMenuEditBoolItem(tr("Scan pids"), &data.pidscan));
|
||||||
// Normal settings
|
// Normal settings
|
||||||
Add(new cMenuEditStrItem(trVDR("Name"), data.name, sizeof(data.name), trVDR(FileNameChars)));
|
Add(new cMenuEditStrItem(trVDR("Name"), data.name, sizeof(data.name)));
|
||||||
Add(new cMenuEditIntItem(trVDR("Frequency"), &data.frequency));
|
Add(new cMenuEditIntItem(trVDR("Frequency"), &data.frequency));
|
||||||
Add(new cMenuEditIntItem(trVDR("Vpid"), &data.vpid, 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Vpid"), &data.vpid, 0, 0x1FFF));
|
||||||
|
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
|
||||||
|
Add(new cMenuEditIntItem(tr ("Vtype"), &data.vtype, 0, 0xFF));
|
||||||
|
#endif
|
||||||
Add(new cMenuEditIntItem(trVDR("Ppid"), &data.ppid, 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Ppid"), &data.ppid, 0, 0x1FFF));
|
||||||
Add(new cMenuEditIntItem(trVDR("Apid1"), &data.apid[0], 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Apid1"), &data.apid[0], 0, 0x1FFF));
|
||||||
Add(new cMenuEditIntItem(trVDR("Apid2"), &data.apid[1], 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Apid2"), &data.apid[1], 0, 0x1FFF));
|
||||||
Add(new cMenuEditIntItem(trVDR("Dpid1"), &data.dpid[0], 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Dpid1"), &data.dpid[0], 0, 0x1FFF));
|
||||||
Add(new cMenuEditIntItem(trVDR("Dpid2"), &data.dpid[1], 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Dpid2"), &data.dpid[1], 0, 0x1FFF));
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM >= 10510
|
|
||||||
Add(new cMenuEditIntItem(trVDR("Spid1"), &data.spid[0], 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Spid1"), &data.spid[0], 0, 0x1FFF));
|
||||||
Add(new cMenuEditIntItem(trVDR("Spid2"), &data.spid[1], 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Spid2"), &data.spid[1], 0, 0x1FFF));
|
||||||
#endif
|
|
||||||
Add(new cMenuEditIntItem(trVDR("Tpid"), &data.tpid, 0, 0x1FFF));
|
Add(new cMenuEditIntItem(trVDR("Tpid"), &data.tpid, 0, 0x1FFF));
|
||||||
Add(new cMenuEditIntItem(trVDR("CA"), &data.caids[0], 0, 0xFFFF));
|
Add(new cMenuEditIntItem(trVDR("CA"), &data.caids[0], 0, 0xFFFF));
|
||||||
Add(new cMenuEditIntItem(trVDR("Sid"), &data.sid, 1, 0xFFFF));
|
Add(new cMenuEditIntItem(trVDR("Sid"), &data.sid, 1, 0xFFFF));
|
||||||
@@ -240,44 +272,44 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
|
|||||||
bool firstIncrement = true;
|
bool firstIncrement = true;
|
||||||
// Search for identical channels as these will be ignored by vdr
|
// Search for identical channels as these will be ignored by vdr
|
||||||
for (cChannel *iteratorChannel = Channels.First(); iteratorChannel;
|
for (cChannel *iteratorChannel = Channels.First(); iteratorChannel;
|
||||||
iteratorChannel = Channels.Next(iteratorChannel)) {
|
iteratorChannel = Channels.Next(iteratorChannel)) {
|
||||||
// This is one of the channels cause the uniquity check to fail
|
// This is one of the channels cause the uniquity check to fail
|
||||||
if (!iteratorChannel->GroupSep() && iteratorChannel != channel
|
if (!iteratorChannel->GroupSep() && iteratorChannel != channel &&
|
||||||
&& iteratorChannel->GetChannelID() == newchannel.GetChannelID()) {
|
iteratorChannel->GetChannelID() == newchannel.GetChannelID()) {
|
||||||
// See if it has unique Plugin param. If yes then increment
|
// See if it has unique Plugin param. If yes then increment
|
||||||
// the corresponding Rid until it is unique
|
// the corresponding Rid until it is unique
|
||||||
if (strcmp(iteratorChannel->PluginParam(),
|
if (strcmp(iteratorChannel->PluginParam(),
|
||||||
newchannel.PluginParam())) {
|
newchannel.PluginParam())) {
|
||||||
// If the channel RID is already at maximum, then fail the
|
// If the channel RID is already at maximum, then fail the
|
||||||
// channel modification
|
// channel modification
|
||||||
if (iteratorChannel->Rid() >= 0x1FFF) {
|
if (iteratorChannel->Rid() >= 0x1FFF) {
|
||||||
debug("Cannot increment RID over maximum value\n");
|
debug("Cannot increment RID over maximum value\n");
|
||||||
uniquityFailed = true;
|
uniquityFailed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
debug("Incrementing conflicting channel RID\n");
|
debug("Incrementing conflicting channel RID\n");
|
||||||
iteratorChannel->SetId(iteratorChannel->Nid(),
|
iteratorChannel->SetId(iteratorChannel->Nid(),
|
||||||
iteratorChannel->Tid(),
|
iteratorChannel->Tid(),
|
||||||
iteratorChannel->Sid(),
|
iteratorChannel->Sid(),
|
||||||
firstIncrement ?
|
firstIncrement ?
|
||||||
0 : iteratorChannel->Rid() + 1);
|
0 : iteratorChannel->Rid() + 1);
|
||||||
|
|
||||||
// Try zero Rid:s at first increment. Prevents them from
|
// Try zero Rid:s at first increment. Prevents them from
|
||||||
// creeping slowly towards their maximum value
|
// creeping slowly towards their maximum value
|
||||||
firstIncrement = false;
|
firstIncrement = false;
|
||||||
|
|
||||||
// Re-set the search and start again
|
// Re-set the search and start again
|
||||||
iteratorChannel = Channels.First();
|
iteratorChannel = Channels.First();
|
||||||
continue;
|
continue;
|
||||||
// Cannot work around by incrementing rid because channels
|
// Cannot work around by incrementing rid because channels
|
||||||
// are actually copies of each other
|
// are actually copies of each other
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uniquityFailed = true;
|
uniquityFailed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!uniquityFailed) {
|
if (!uniquityFailed) {
|
||||||
if (channel) {
|
if (channel) {
|
||||||
SetChannelData(channel);
|
SetChannelData(channel);
|
||||||
@@ -346,9 +378,7 @@ cIptvMenuChannelItem::cIptvMenuChannelItem(cChannel *Channel)
|
|||||||
|
|
||||||
void cIptvMenuChannelItem::Set(void)
|
void cIptvMenuChannelItem::Set(void)
|
||||||
{
|
{
|
||||||
char *buffer = NULL;
|
SetText(cString::sprintf("%d\t%s", channel->Number(), channel->Name()));
|
||||||
asprintf(&buffer, "%d\t%s", channel->Number(), channel->Name());
|
|
||||||
SetText(buffer, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- cIptvMenuChannels -----------------------------------------------------
|
// --- cIptvMenuChannels -----------------------------------------------------
|
||||||
@@ -357,7 +387,7 @@ class cIptvMenuChannels : public cOsdMenu
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
void Setup(void);
|
void Setup(void);
|
||||||
cChannel *GetChannel(int Index);
|
cChannel *GetChannel(int Index) const;
|
||||||
void Propagate(void);
|
void Propagate(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -397,16 +427,16 @@ void cIptvMenuChannels::Setup(void)
|
|||||||
Display();
|
Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
cChannel *cIptvMenuChannels::GetChannel(int Index)
|
cChannel *cIptvMenuChannels::GetChannel(int Index) const
|
||||||
{
|
{
|
||||||
cIptvMenuChannelItem *p = (cIptvMenuChannelItem *)Get(Index);
|
cIptvMenuChannelItem *p = dynamic_cast<cIptvMenuChannelItem *>(Get(Index));
|
||||||
return p ? (cChannel *)p->Channel() : NULL;
|
return p ? (cChannel *)p->Channel() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvMenuChannels::Propagate(void)
|
void cIptvMenuChannels::Propagate(void)
|
||||||
{
|
{
|
||||||
Channels.ReNumber();
|
Channels.ReNumber();
|
||||||
for (cIptvMenuChannelItem *ci = (cIptvMenuChannelItem *)First(); ci; ci = (cIptvMenuChannelItem *)ci->Next())
|
for (cIptvMenuChannelItem *ci = dynamic_cast<cIptvMenuChannelItem *>(First()); ci; ci = dynamic_cast<cIptvMenuChannelItem *>(ci->Next()))
|
||||||
ci->Set();
|
ci->Set();
|
||||||
Display();
|
Display();
|
||||||
Channels.SetModified(true);
|
Channels.SetModified(true);
|
||||||
@@ -549,7 +579,7 @@ void cIptvMenuInfo::Display(void)
|
|||||||
{
|
{
|
||||||
cOsdMenu::Display();
|
cOsdMenu::Display();
|
||||||
DisplayMenu()->SetText(text, true);
|
DisplayMenu()->SetText(text, true);
|
||||||
if (text)
|
if (*text)
|
||||||
cStatus::MsgOsdTextItem(text);
|
cStatus::MsgOsdTextItem(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,7 +614,7 @@ eOSState cIptvMenuInfo::ProcessKey(eKeys Key)
|
|||||||
case kYellow: page = IPTV_DEVICE_INFO_FILTERS;
|
case kYellow: page = IPTV_DEVICE_INFO_FILTERS;
|
||||||
UpdateInfo();
|
UpdateInfo();
|
||||||
break;
|
break;
|
||||||
case kBlue: IptvConfig.SetUseBytes(!IptvConfig.GetUseBytes());
|
case kBlue: IptvConfig.SetUseBytes(IptvConfig.GetUseBytes() ? 0 : 1);
|
||||||
UpdateInfo();
|
UpdateInfo();
|
||||||
break;
|
break;
|
||||||
default: if (timeout.TimedOut())
|
default: if (timeout.TimedOut())
|
||||||
@@ -605,7 +635,6 @@ cIptvPluginSetup::cIptvPluginSetup()
|
|||||||
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
|
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
|
||||||
extProtocolBasePort = IptvConfig.GetExtProtocolBasePort();
|
extProtocolBasePort = IptvConfig.GetExtProtocolBasePort();
|
||||||
sectionFiltering = IptvConfig.GetSectionFiltering();
|
sectionFiltering = IptvConfig.GetSectionFiltering();
|
||||||
sidScanning = IptvConfig.GetSidScanning();
|
|
||||||
numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
|
numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
|
||||||
if (numDisabledFilters > SECTION_FILTER_TABLE_SIZE)
|
if (numDisabledFilters > SECTION_FILTER_TABLE_SIZE)
|
||||||
numDisabledFilters = SECTION_FILTER_TABLE_SIZE;
|
numDisabledFilters = SECTION_FILTER_TABLE_SIZE;
|
||||||
@@ -620,19 +649,33 @@ cIptvPluginSetup::cIptvPluginSetup()
|
|||||||
void cIptvPluginSetup::Setup(void)
|
void cIptvPluginSetup::Setup(void)
|
||||||
{
|
{
|
||||||
int current = Current();
|
int current = Current();
|
||||||
|
|
||||||
Clear();
|
Clear();
|
||||||
Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 1, 4));
|
help.Clear();
|
||||||
|
|
||||||
|
Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 1, 4));
|
||||||
|
help.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 [%]"), &tsBufferPrefill, 0, 40));
|
Add(new cMenuEditIntItem( tr("TS buffer prefill ratio [%]"), &tsBufferPrefill, 0, 40));
|
||||||
Add(new cMenuEditIntItem( tr("EXT protocol base port"), &extProtocolBasePort, 0, 0xFFF7));
|
help.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 cMenuEditBoolItem(tr("Use section filtering"), §ionFiltering));
|
|
||||||
|
Add(new cMenuEditIntItem( tr("EXT protocol base port"), &extProtocolBasePort, 0, 0xFFF7));
|
||||||
|
help.Append(tr("Define a base port used by 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 EXT protocol."));
|
||||||
|
|
||||||
|
Add(new cMenuEditBoolItem(tr("Use section filtering"), §ionFiltering));
|
||||||
|
help.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 (sectionFiltering) {
|
if (sectionFiltering) {
|
||||||
Add(new cMenuEditBoolItem(tr("Scan Sid automatically"), &sidScanning));
|
Add(new cMenuEditIntItem( tr("Disable filters"), &numDisabledFilters, 0, SECTION_FILTER_TABLE_SIZE));
|
||||||
Add(new cMenuEditIntItem( tr("Disable filters"), &numDisabledFilters, 0, SECTION_FILTER_TABLE_SIZE));
|
help.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 < numDisabledFilters; ++i) {
|
for (int i = 0; i < numDisabledFilters; ++i) {
|
||||||
// TRANSLATORS: note the singular!
|
// TRANSLATORS: note the singular!
|
||||||
Add(new cMenuEditStraItem(tr("Disable filter"), &disabledFilterIndexes[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNames));
|
Add(new cMenuEditStraItem(tr("Disable filter"), &disabledFilterIndexes[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNames));
|
||||||
|
help.Append(tr("Define an ill-behaving filter to be blacklisted."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCurrent(Get(current));
|
SetCurrent(Get(current));
|
||||||
Display();
|
Display();
|
||||||
}
|
}
|
||||||
@@ -658,18 +701,23 @@ eOSState cIptvPluginSetup::ProcessKey(eKeys Key)
|
|||||||
int oldsectionFiltering = sectionFiltering;
|
int oldsectionFiltering = sectionFiltering;
|
||||||
int oldNumDisabledFilters = numDisabledFilters;
|
int oldNumDisabledFilters = numDisabledFilters;
|
||||||
eOSState state = cMenuSetupPage::ProcessKey(Key);
|
eOSState state = cMenuSetupPage::ProcessKey(Key);
|
||||||
|
|
||||||
if (state == osUnknown) {
|
if (state == osUnknown) {
|
||||||
switch (Key) {
|
switch (Key) {
|
||||||
case kRed: return EditChannel();
|
case kRed: return EditChannel();
|
||||||
case kBlue: return ShowInfo();
|
case kBlue: return ShowInfo();
|
||||||
default: state = osContinue;
|
case kInfo: if (Current() < help.Size())
|
||||||
|
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), help[Current()]));
|
||||||
|
default: state = osContinue; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Key != kNone) && ((numDisabledFilters != oldNumDisabledFilters) || (sectionFiltering != oldsectionFiltering))) {
|
if ((Key != kNone) && ((numDisabledFilters != oldNumDisabledFilters) || (sectionFiltering != oldsectionFiltering))) {
|
||||||
while ((numDisabledFilters < oldNumDisabledFilters) && (oldNumDisabledFilters > 0))
|
while ((numDisabledFilters < oldNumDisabledFilters) && (oldNumDisabledFilters > 0))
|
||||||
disabledFilterIndexes[--oldNumDisabledFilters] = -1;
|
disabledFilterIndexes[--oldNumDisabledFilters] = -1;
|
||||||
Setup();
|
Setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,14 +747,12 @@ void cIptvPluginSetup::Store(void)
|
|||||||
SetupStore("TsBufferPrefill", tsBufferPrefill);
|
SetupStore("TsBufferPrefill", tsBufferPrefill);
|
||||||
SetupStore("ExtProtocolBasePort", extProtocolBasePort);
|
SetupStore("ExtProtocolBasePort", extProtocolBasePort);
|
||||||
SetupStore("SectionFiltering", sectionFiltering);
|
SetupStore("SectionFiltering", sectionFiltering);
|
||||||
SetupStore("SidScanning", sidScanning);
|
|
||||||
StoreFilters("DisabledFilters", disabledFilterIndexes);
|
StoreFilters("DisabledFilters", disabledFilterIndexes);
|
||||||
// Update global config
|
// Update global config
|
||||||
IptvConfig.SetTsBufferSize(tsBufferSize);
|
IptvConfig.SetTsBufferSize(tsBufferSize);
|
||||||
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
|
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
|
||||||
IptvConfig.SetExtProtocolBasePort(extProtocolBasePort);
|
IptvConfig.SetExtProtocolBasePort(extProtocolBasePort);
|
||||||
IptvConfig.SetSectionFiltering(sectionFiltering);
|
IptvConfig.SetSectionFiltering(sectionFiltering);
|
||||||
IptvConfig.SetSidScanning(sidScanning);
|
|
||||||
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
|
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
|
||||||
IptvConfig.SetDisabledFilters(i, disabledFilterIndexes[i]);
|
IptvConfig.SetDisabledFilters(i, disabledFilterIndexes[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
5
setup.h
5
setup.h
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: setup.h,v 1.16 2007/10/20 17:26:46 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_SETUP_H
|
#ifndef __IPTV_SETUP_H
|
||||||
@@ -19,14 +18,14 @@ private:
|
|||||||
int tsBufferPrefill;
|
int tsBufferPrefill;
|
||||||
int extProtocolBasePort;
|
int extProtocolBasePort;
|
||||||
int sectionFiltering;
|
int sectionFiltering;
|
||||||
int sidScanning;
|
|
||||||
int numDisabledFilters;
|
int numDisabledFilters;
|
||||||
int disabledFilterIndexes[SECTION_FILTER_TABLE_SIZE];
|
int disabledFilterIndexes[SECTION_FILTER_TABLE_SIZE];
|
||||||
const char *disabledFilterNames[SECTION_FILTER_TABLE_SIZE];
|
const char *disabledFilterNames[SECTION_FILTER_TABLE_SIZE];
|
||||||
|
cVector<const char*> help;
|
||||||
|
|
||||||
eOSState EditChannel(void);
|
eOSState EditChannel(void);
|
||||||
eOSState ShowInfo(void);
|
eOSState ShowInfo(void);
|
||||||
virtual void Setup(void);
|
void Setup(void);
|
||||||
void StoreFilters(const char *Name, int *Values);
|
void StoreFilters(const char *Name, int *Values);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: sidscanner.c,v 1.1 2007/10/01 18:14:57 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libsi/section.h>
|
#include <libsi/section.h>
|
||||||
@@ -52,8 +51,9 @@ void cSidScanner::Process(u_short Pid, u_char Tid, const u_char *Data, int Lengt
|
|||||||
if (!Channels.Lock(true, 10))
|
if (!Channels.Lock(true, 10))
|
||||||
return;
|
return;
|
||||||
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
|
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
|
||||||
IptvChannel->SetId(IptvChannel->Nid(), IptvChannel->Tid(),
|
if (IptvChannel)
|
||||||
assoc.getServiceId(), IptvChannel->Rid());
|
IptvChannel->SetId(IptvChannel->Nid(), IptvChannel->Tid(),
|
||||||
|
assoc.getServiceId(), IptvChannel->Rid());
|
||||||
Channels.Unlock();
|
Channels.Unlock();
|
||||||
}
|
}
|
||||||
SetChannel(NULL);
|
SetChannel(NULL);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: sidscanner.h,v 1.1 2007/10/01 18:14:57 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SIDSCANNER_H
|
#ifndef __SIDSCANNER_H
|
||||||
@@ -18,11 +17,13 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
||||||
|
virtual void SetStatus(bool On);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cSidScanner(void);
|
cSidScanner(void);
|
||||||
virtual void SetStatus(bool On);
|
|
||||||
void SetChannel(const cChannel *Channel);
|
void SetChannel(const cChannel *Channel);
|
||||||
|
void Open() { SetStatus(true); }
|
||||||
|
void Close() { SetStatus(false); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __SIDSCANNER_H
|
#endif // __SIDSCANNER_H
|
||||||
|
|||||||
132
socket.c
132
socket.c
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: socket.c,v 1.6 2007/10/26 22:07:10 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -21,14 +20,9 @@
|
|||||||
cIptvSocket::cIptvSocket()
|
cIptvSocket::cIptvSocket()
|
||||||
: socketPort(0),
|
: socketPort(0),
|
||||||
socketDesc(-1),
|
socketDesc(-1),
|
||||||
readBufferLen(TS_SIZE * IptvConfig.GetReadBufferTsCount()),
|
|
||||||
isActive(false)
|
isActive(false)
|
||||||
{
|
{
|
||||||
debug("cIptvSocket::cIptvSocket()\n");
|
debug("cIptvSocket::cIptvSocket()\n");
|
||||||
// Allocate receive buffer
|
|
||||||
readBuffer = MALLOC(unsigned char, readBufferLen);
|
|
||||||
if (!readBuffer)
|
|
||||||
error("ERROR: MALLOC() failed in socket()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvSocket::~cIptvSocket()
|
cIptvSocket::~cIptvSocket()
|
||||||
@@ -36,8 +30,6 @@ cIptvSocket::~cIptvSocket()
|
|||||||
debug("cIptvSocket::~cIptvSocket()\n");
|
debug("cIptvSocket::~cIptvSocket()\n");
|
||||||
// Close the socket
|
// Close the socket
|
||||||
CloseSocket();
|
CloseSocket();
|
||||||
// Free allocated memory
|
|
||||||
free(readBuffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvSocket::OpenSocket(const int Port, const bool isUdp)
|
bool cIptvSocket::OpenSocket(const int Port, const bool isUdp)
|
||||||
@@ -51,7 +43,7 @@ bool cIptvSocket::OpenSocket(const int Port, const bool isUdp)
|
|||||||
}
|
}
|
||||||
// Bind to the socket if it is not active already
|
// Bind to the socket if it is not active already
|
||||||
if (socketDesc < 0) {
|
if (socketDesc < 0) {
|
||||||
int yes = 1;
|
int yes = 1;
|
||||||
// Create socket
|
// Create socket
|
||||||
if (isUdp)
|
if (isUdp)
|
||||||
socketDesc = socket(PF_INET, SOCK_DGRAM, 0);
|
socketDesc = socket(PF_INET, SOCK_DGRAM, 0);
|
||||||
@@ -59,19 +51,20 @@ bool cIptvSocket::OpenSocket(const int Port, const bool isUdp)
|
|||||||
socketDesc = socket(PF_INET, SOCK_STREAM, 0);
|
socketDesc = socket(PF_INET, SOCK_STREAM, 0);
|
||||||
ERROR_IF_RET(socketDesc < 0, "socket()", return false);
|
ERROR_IF_RET(socketDesc < 0, "socket()", return false);
|
||||||
// Make it use non-blocking I/O to avoid stuck read calls
|
// Make it use non-blocking I/O to avoid stuck read calls
|
||||||
ERROR_IF_FUNC(fcntl(socketDesc, F_SETFL, O_NONBLOCK), "fcntl()", CloseSocket(), return false);
|
ERROR_IF_FUNC(fcntl(socketDesc, F_SETFL, O_NONBLOCK), "fcntl()",
|
||||||
|
CloseSocket(), return false);
|
||||||
// Allow multiple sockets to use the same PORT number
|
// Allow multiple sockets to use the same PORT number
|
||||||
ERROR_IF_FUNC(setsockopt(socketDesc, SOL_SOCKET, SO_REUSEADDR, &yes,
|
ERROR_IF_FUNC(setsockopt(socketDesc, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0, "setsockopt()",
|
||||||
sizeof(yes)) < 0, "setsockopt()", CloseSocket(), return false);
|
CloseSocket(), return false);
|
||||||
// Bind socket
|
// Bind socket
|
||||||
memset(&sockAddr, '\0', sizeof(sockAddr));
|
memset(&sockAddr, '\0', sizeof(sockAddr));
|
||||||
sockAddr.sin_family = AF_INET;
|
sockAddr.sin_family = AF_INET;
|
||||||
sockAddr.sin_port = htons(Port);
|
sockAddr.sin_port = htons((uint16_t)(Port & 0xFFFF));
|
||||||
sockAddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
sockAddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
if (isUdp) {
|
if (isUdp) {
|
||||||
int err = bind(socketDesc, (struct sockaddr *)&sockAddr, sizeof(sockAddr));
|
int err = bind(socketDesc, (struct sockaddr *)&sockAddr, sizeof(sockAddr));
|
||||||
ERROR_IF_FUNC(err < 0, "bind()", CloseSocket(), return false);
|
ERROR_IF_FUNC(err < 0, "bind()", CloseSocket(), return false);
|
||||||
}
|
}
|
||||||
// Update socket port
|
// Update socket port
|
||||||
socketPort = Port;
|
socketPort = Port;
|
||||||
}
|
}
|
||||||
@@ -105,60 +98,49 @@ bool cIptvUdpSocket::OpenSocket(const int Port)
|
|||||||
return cIptvSocket::OpenSocket(Port, true);
|
return cIptvSocket::OpenSocket(Port, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvUdpSocket::Read(unsigned char* *BufferAddr)
|
int cIptvUdpSocket::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||||
{
|
{
|
||||||
//debug("cIptvUdpSocket::Read()\n");
|
//debug("cIptvUdpSocket::Read()\n");
|
||||||
// Error out if socket not initialized
|
// Error out if socket not initialized
|
||||||
if (socketDesc <= 0) {
|
if (socketDesc <= 0) {
|
||||||
error("ERROR: Invalid socket in %s\n", __FUNCTION__);
|
error("Invalid socket in %s\n", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
socklen_t addrlen = sizeof(sockAddr);
|
socklen_t addrlen = sizeof(sockAddr);
|
||||||
// Set argument point to read buffer
|
int len = 0;
|
||||||
*BufferAddr = readBuffer;
|
// Read data from socket
|
||||||
// Wait 500ms for data
|
if (isActive && socketDesc && BufferAddr && (BufferLen > 0))
|
||||||
int retval = select_single_desc(socketDesc, 500000, false);
|
len = (int)recvfrom(socketDesc, BufferAddr, BufferLen, MSG_DONTWAIT,
|
||||||
// Check if error
|
(struct sockaddr *)&sockAddr, &addrlen);
|
||||||
if (retval < 0)
|
if ((len > 0) && (BufferAddr[0] == TS_SYNC_BYTE)) {
|
||||||
return retval;
|
return len;
|
||||||
// Check if data available
|
}
|
||||||
else if (retval) {
|
else if (len > 3) {
|
||||||
int len = 0;
|
// http://www.networksorcery.com/enp/rfc/rfc2250.txt
|
||||||
// Read data from socket
|
// version
|
||||||
if (isActive)
|
unsigned int v = (BufferAddr[0] >> 6) & 0x03;
|
||||||
len = recvfrom(socketDesc, readBuffer, readBufferLen, MSG_DONTWAIT,
|
// extension bit
|
||||||
(struct sockaddr *)&sockAddr, &addrlen);
|
unsigned int x = (BufferAddr[0] >> 4) & 0x01;
|
||||||
ERROR_IF_RET(len < 0, "recvfrom()", return len);
|
// cscr count
|
||||||
if ((len > 0) && (readBuffer[0] == 0x47)) {
|
unsigned int cc = BufferAddr[0] & 0x0F;
|
||||||
// Set argument point to read buffer
|
// payload type: MPEG2 TS = 33
|
||||||
*BufferAddr = &readBuffer[0];
|
//unsigned int pt = readBuffer[1] & 0x7F;
|
||||||
return len;
|
// header lenght
|
||||||
|
unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t);
|
||||||
|
// check if extension
|
||||||
|
if (x) {
|
||||||
|
// extension header length
|
||||||
|
unsigned int ehl = (((BufferAddr[headerlen + 2] & 0xFF) << 8) |
|
||||||
|
(BufferAddr[headerlen + 3] & 0xFF));
|
||||||
|
// update header length
|
||||||
|
headerlen += (ehl + 1) * (unsigned int)sizeof(uint32_t);
|
||||||
}
|
}
|
||||||
else if (len > 3) {
|
// Check that rtp is version 2 and payload contains multiple of TS packet data
|
||||||
// http://www.networksorcery.com/enp/rfc/rfc2250.txt
|
if ((v == 2) && (((len - headerlen) % TS_SIZE) == 0) &&
|
||||||
// version
|
(BufferAddr[headerlen] == TS_SYNC_BYTE)) {
|
||||||
unsigned int v = (readBuffer[0] >> 6) & 0x03;
|
// Set argument point to payload in read buffer
|
||||||
// extension bit
|
memmove(BufferAddr, &BufferAddr[headerlen], (len - headerlen));
|
||||||
unsigned int x = (readBuffer[0] >> 4) & 0x01;
|
return (len - headerlen);
|
||||||
// cscr count
|
|
||||||
unsigned int cc = readBuffer[0] & 0x0F;
|
|
||||||
// payload type: MPEG2 TS = 33
|
|
||||||
//unsigned int pt = readBuffer[1] & 0x7F;
|
|
||||||
// header lenght
|
|
||||||
unsigned int headerlen = (3 + cc) * sizeof(uint32_t);
|
|
||||||
// check if extension
|
|
||||||
if (x) {
|
|
||||||
// extension header length
|
|
||||||
unsigned int ehl = (((readBuffer[headerlen + 2] & 0xFF) << 8) | (readBuffer[headerlen + 3] & 0xFF));
|
|
||||||
// update header length
|
|
||||||
headerlen += (ehl + 1) * sizeof(uint32_t);
|
|
||||||
}
|
|
||||||
// Check that rtp is version 2 and payload contains multiple of TS packet data
|
|
||||||
if ((v == 2) && (((len - headerlen) % TS_SIZE) == 0) && (readBuffer[headerlen] == 0x47)) {
|
|
||||||
// Set argument point to payload in read buffer
|
|
||||||
*BufferAddr = &readBuffer[headerlen];
|
|
||||||
return (len - headerlen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -181,28 +163,18 @@ bool cIptvTcpSocket::OpenSocket(const int Port)
|
|||||||
return cIptvSocket::OpenSocket(Port, false);
|
return cIptvSocket::OpenSocket(Port, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvTcpSocket::Read(unsigned char* *BufferAddr)
|
int cIptvTcpSocket::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||||
{
|
{
|
||||||
//debug("cIptvTcpSocket::Read()\n");
|
//debug("cIptvTcpSocket::Read()\n");
|
||||||
// Error out if socket not initialized
|
// Error out if socket not initialized
|
||||||
if (socketDesc <= 0) {
|
if (socketDesc <= 0) {
|
||||||
error("ERROR: Invalid socket in %s\n", __FUNCTION__);
|
error("Invalid socket in %s\n", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
socklen_t addrlen = sizeof(sockAddr);
|
|
||||||
// Set argument point to read buffer
|
|
||||||
*BufferAddr = readBuffer;
|
|
||||||
// Wait 500ms for data
|
|
||||||
int retval = select_single_desc(socketDesc, 500000, false);
|
|
||||||
// Check if error
|
|
||||||
if (retval < 0)
|
|
||||||
return retval;
|
|
||||||
// Check if data available
|
|
||||||
else if (retval) {
|
|
||||||
// Read data from socket
|
|
||||||
if (isActive)
|
|
||||||
return recvfrom(socketDesc, readBuffer, readBufferLen, MSG_DONTWAIT,
|
|
||||||
(struct sockaddr *)&sockAddr, &addrlen);
|
|
||||||
}
|
}
|
||||||
|
socklen_t addrlen = sizeof(sockAddr);
|
||||||
|
// Read data from socket
|
||||||
|
if (isActive && socketDesc && BufferAddr && (BufferLen > 0))
|
||||||
|
return (int)recvfrom(socketDesc, BufferAddr, BufferLen, MSG_DONTWAIT,
|
||||||
|
(struct sockaddr *)&sockAddr, &addrlen);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
7
socket.h
7
socket.h
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: socket.h,v 1.3 2007/10/21 19:32:15 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_SOCKET_H
|
#ifndef __IPTV_SOCKET_H
|
||||||
@@ -15,8 +14,6 @@ class cIptvSocket {
|
|||||||
protected:
|
protected:
|
||||||
int socketPort;
|
int socketPort;
|
||||||
int socketDesc;
|
int socketDesc;
|
||||||
unsigned char* readBuffer;
|
|
||||||
unsigned int readBufferLen;
|
|
||||||
struct sockaddr_in sockAddr;
|
struct sockaddr_in sockAddr;
|
||||||
bool isActive;
|
bool isActive;
|
||||||
|
|
||||||
@@ -33,7 +30,7 @@ class cIptvUdpSocket : public cIptvSocket {
|
|||||||
public:
|
public:
|
||||||
cIptvUdpSocket();
|
cIptvUdpSocket();
|
||||||
virtual ~cIptvUdpSocket();
|
virtual ~cIptvUdpSocket();
|
||||||
virtual int Read(unsigned char* *BufferAddr);
|
virtual int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
bool OpenSocket(const int Port);
|
bool OpenSocket(const int Port);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -41,7 +38,7 @@ class cIptvTcpSocket : public cIptvSocket {
|
|||||||
public:
|
public:
|
||||||
cIptvTcpSocket();
|
cIptvTcpSocket();
|
||||||
virtual ~cIptvTcpSocket();
|
virtual ~cIptvTcpSocket();
|
||||||
virtual int Read(unsigned char* *BufferAddr);
|
virtual int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
bool OpenSocket(const int Port);
|
bool OpenSocket(const int Port);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
* statisticif.h: IPTV plugin for the Video Disk Recorder
|
|
||||||
*
|
|
||||||
* See the README file for copyright information and how to reach the author.
|
|
||||||
*
|
|
||||||
* $Id: statisticif.h,v 1.4 2007/10/07 19:06:33 ajhseppa Exp $
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __IPTV_STATISTICIF_H
|
|
||||||
#define __IPTV_STATISTICIF_H
|
|
||||||
|
|
||||||
#include <vdr/tools.h>
|
|
||||||
|
|
||||||
class cIptvStatisticIf {
|
|
||||||
public:
|
|
||||||
cIptvStatisticIf() {}
|
|
||||||
virtual ~cIptvStatisticIf() {}
|
|
||||||
virtual cString GetStatistic() = 0;
|
|
||||||
|
|
||||||
private:
|
|
||||||
cIptvStatisticIf(const cIptvStatisticIf&);
|
|
||||||
cIptvStatisticIf& operator=(const cIptvStatisticIf&);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __IPTV_STATISTICIF_H
|
|
||||||
31
statistics.c
31
statistics.c
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: statistics.c,v 1.20 2007/10/11 23:06:49 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -27,13 +26,13 @@ cIptvSectionStatistics::~cIptvSectionStatistics()
|
|||||||
//debug("cIptvSectionStatistics::~cIptvSectionStatistics()\n");
|
//debug("cIptvSectionStatistics::~cIptvSectionStatistics()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvSectionStatistics::GetStatistic()
|
cString cIptvSectionStatistics::GetSectionStatistic()
|
||||||
{
|
{
|
||||||
//debug("cIptvSectionStatistics::GetStatistic()\n");
|
//debug("cIptvSectionStatistics::GetStatistic()\n");
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
||||||
timer.Set();
|
timer.Set();
|
||||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * filteredData / elapsed) : 0L;
|
long bitrate = elapsed ? (long)(1000.0L * filteredData / KILOBYTE(1) / elapsed) : 0L;
|
||||||
if (!IptvConfig.GetUseBytes())
|
if (!IptvConfig.GetUseBytes())
|
||||||
bitrate *= 8;
|
bitrate *= 8;
|
||||||
// no trailing linefeed here!
|
// no trailing linefeed here!
|
||||||
@@ -43,7 +42,7 @@ cString cIptvSectionStatistics::GetStatistic()
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvSectionStatistics::AddStatistic(long Bytes, long Calls)
|
void cIptvSectionStatistics::AddSectionStatistic(long Bytes, long Calls)
|
||||||
{
|
{
|
||||||
//debug("cIptvSectionStatistics::AddStatistic(Bytes=%ld, Calls=%ld)\n", Bytes, Calls);
|
//debug("cIptvSectionStatistics::AddStatistic(Bytes=%ld, Calls=%ld)\n", Bytes, Calls);
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
@@ -67,7 +66,7 @@ cIptvPidStatistics::~cIptvPidStatistics()
|
|||||||
debug("cIptvPidStatistics::~cIptvPidStatistics()\n");
|
debug("cIptvPidStatistics::~cIptvPidStatistics()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvPidStatistics::GetStatistic()
|
cString cIptvPidStatistics::GetPidStatistic()
|
||||||
{
|
{
|
||||||
//debug("cIptvPidStatistics::GetStatistic()\n");
|
//debug("cIptvPidStatistics::GetStatistic()\n");
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
@@ -76,7 +75,7 @@ cString cIptvPidStatistics::GetStatistic()
|
|||||||
cString info("Active pids:\n");
|
cString info("Active pids:\n");
|
||||||
for (unsigned int i = 0; i < IPTV_STATS_ACTIVE_PIDS_COUNT; ++i) {
|
for (unsigned int i = 0; i < IPTV_STATS_ACTIVE_PIDS_COUNT; ++i) {
|
||||||
if (mostActivePids[i].pid) {
|
if (mostActivePids[i].pid) {
|
||||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * mostActivePids[i].DataAmount / elapsed) : 0L;
|
long bitrate = elapsed ? (long)(1000.0L * mostActivePids[i].DataAmount / KILOBYTE(1) / elapsed) : 0L;
|
||||||
if (!IptvConfig.GetUseBytes())
|
if (!IptvConfig.GetUseBytes())
|
||||||
bitrate *= 8;
|
bitrate *= 8;
|
||||||
info = cString::sprintf("%sPid %d: %4d (%4ld k%s/s)\n", *info, i,
|
info = cString::sprintf("%sPid %d: %4d (%4ld k%s/s)\n", *info, i,
|
||||||
@@ -84,7 +83,7 @@ cString cIptvPidStatistics::GetStatistic()
|
|||||||
IptvConfig.GetUseBytes() ? "B" : "bit");
|
IptvConfig.GetUseBytes() ? "B" : "bit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memset(&mostActivePids, '\0', sizeof(mostActivePids));
|
memset(mostActivePids, '\0', sizeof(mostActivePids));
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ int cIptvPidStatistics::SortPids(const void* data1, const void* data2)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvPidStatistics::AddStatistic(u_short Pid, long Payload)
|
void cIptvPidStatistics::AddPidStatistic(u_short Pid, long Payload)
|
||||||
{
|
{
|
||||||
//debug("cIptvPidStatistics::AddStatistic(pid=%ld, payload=%ld)\n", Pid, Payload);
|
//debug("cIptvPidStatistics::AddStatistic(pid=%ld, payload=%ld)\n", Pid, Payload);
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
@@ -110,7 +109,7 @@ void cIptvPidStatistics::AddStatistic(u_short Pid, long Payload)
|
|||||||
if (mostActivePids[i].pid == Pid) {
|
if (mostActivePids[i].pid == Pid) {
|
||||||
mostActivePids[i].DataAmount += Payload;
|
mostActivePids[i].DataAmount += Payload;
|
||||||
// Now re-sort the array and quit
|
// Now re-sort the array and quit
|
||||||
qsort(&mostActivePids, numberOfElements, sizeof(pidStruct), SortPids);
|
qsort(mostActivePids, numberOfElements, sizeof(pidStruct), SortPids);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,7 +119,7 @@ void cIptvPidStatistics::AddStatistic(u_short Pid, long Payload)
|
|||||||
mostActivePids[numberOfElements - 1].pid = Pid;
|
mostActivePids[numberOfElements - 1].pid = Pid;
|
||||||
mostActivePids[numberOfElements - 1].DataAmount = Payload;
|
mostActivePids[numberOfElements - 1].DataAmount = Payload;
|
||||||
// Re-sort
|
// Re-sort
|
||||||
qsort(&mostActivePids, numberOfElements, sizeof(pidStruct), SortPids);
|
qsort(mostActivePids, numberOfElements, sizeof(pidStruct), SortPids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,13 +139,13 @@ cIptvStreamerStatistics::~cIptvStreamerStatistics()
|
|||||||
debug("cIptvStreamerStatistics::~cIptvStreamerStatistics()\n");
|
debug("cIptvStreamerStatistics::~cIptvStreamerStatistics()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvStreamerStatistics::GetStatistic()
|
cString cIptvStreamerStatistics::GetStreamerStatistic()
|
||||||
{
|
{
|
||||||
//debug("cIptvStreamerStatistics::GetStatistic()\n");
|
//debug("cIptvStreamerStatistics::GetStatistic()\n");
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
||||||
timer.Set();
|
timer.Set();
|
||||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * dataBytes / elapsed) : 0L;
|
long bitrate = elapsed ? (long)(1000.0L * dataBytes / KILOBYTE(1) / elapsed) : 0L;
|
||||||
if (!IptvConfig.GetUseBytes())
|
if (!IptvConfig.GetUseBytes())
|
||||||
bitrate *= 8;
|
bitrate *= 8;
|
||||||
cString info = cString::sprintf("Stream bitrate: %ld k%s/s\n", bitrate, IptvConfig.GetUseBytes() ? "B" : "bit");
|
cString info = cString::sprintf("Stream bitrate: %ld k%s/s\n", bitrate, IptvConfig.GetUseBytes() ? "B" : "bit");
|
||||||
@@ -154,7 +153,7 @@ cString cIptvStreamerStatistics::GetStatistic()
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvStreamerStatistics::AddStatistic(long Bytes)
|
void cIptvStreamerStatistics::AddStreamerStatistic(long Bytes)
|
||||||
{
|
{
|
||||||
//debug("cIptvStreamerStatistics::AddStatistic(Bytes=%ld)\n", Bytes);
|
//debug("cIptvStreamerStatistics::AddStatistic(Bytes=%ld)\n", Bytes);
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
@@ -177,13 +176,13 @@ cIptvBufferStatistics::~cIptvBufferStatistics()
|
|||||||
debug("cIptvBufferStatistics::~cIptvBufferStatistics()\n");
|
debug("cIptvBufferStatistics::~cIptvBufferStatistics()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvBufferStatistics::GetStatistic()
|
cString cIptvBufferStatistics::GetBufferStatistic()
|
||||||
{
|
{
|
||||||
//debug("cIptvBufferStatistics::GetStatistic()\n");
|
//debug("cIptvBufferStatistics::GetStatistic()\n");
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
||||||
timer.Set();
|
timer.Set();
|
||||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * dataBytes / elapsed) : 0L;
|
long bitrate = elapsed ? (long)(1000.0L * dataBytes / KILOBYTE(1) / elapsed) : 0L;
|
||||||
long totalSpace = MEGABYTE(IptvConfig.GetTsBufferSize());
|
long totalSpace = MEGABYTE(IptvConfig.GetTsBufferSize());
|
||||||
float percentage = (float)((float)usedSpace / (float)totalSpace * 100.0);
|
float percentage = (float)((float)usedSpace / (float)totalSpace * 100.0);
|
||||||
long totalKilos = totalSpace / KILOBYTE(1);
|
long totalKilos = totalSpace / KILOBYTE(1);
|
||||||
@@ -201,7 +200,7 @@ cString cIptvBufferStatistics::GetStatistic()
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvBufferStatistics::AddStatistic(long Bytes, long Used)
|
void cIptvBufferStatistics::AddBufferStatistic(long Bytes, long Used)
|
||||||
{
|
{
|
||||||
//debug("cIptvBufferStatistics::AddStatistic(Bytes=%ld, Used=%ld)\n", Bytes, Used);
|
//debug("cIptvBufferStatistics::AddStatistic(Bytes=%ld, Used=%ld)\n", Bytes, Used);
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
|
|||||||
27
statistics.h
27
statistics.h
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: statistics.h,v 1.10 2007/10/11 23:06:49 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_STATISTICS_H
|
#ifndef __IPTV_STATISTICS_H
|
||||||
@@ -11,17 +10,15 @@
|
|||||||
|
|
||||||
#include <vdr/thread.h>
|
#include <vdr/thread.h>
|
||||||
|
|
||||||
#include "statisticif.h"
|
|
||||||
|
|
||||||
// Section statistics
|
// Section statistics
|
||||||
class cIptvSectionStatistics : public cIptvStatisticIf {
|
class cIptvSectionStatistics {
|
||||||
public:
|
public:
|
||||||
cIptvSectionStatistics();
|
cIptvSectionStatistics();
|
||||||
virtual ~cIptvSectionStatistics();
|
virtual ~cIptvSectionStatistics();
|
||||||
cString GetStatistic();
|
cString GetSectionStatistic();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AddStatistic(long Bytes, long Calls);
|
void AddSectionStatistic(long Bytes, long Calls);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long filteredData;
|
long filteredData;
|
||||||
@@ -31,14 +28,14 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Pid statistics
|
// Pid statistics
|
||||||
class cIptvPidStatistics : public cIptvStatisticIf {
|
class cIptvPidStatistics {
|
||||||
public:
|
public:
|
||||||
cIptvPidStatistics();
|
cIptvPidStatistics();
|
||||||
virtual ~cIptvPidStatistics();
|
virtual ~cIptvPidStatistics();
|
||||||
cString GetStatistic();
|
cString GetPidStatistic();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AddStatistic(u_short Pid, long Payload);
|
void AddPidStatistic(u_short Pid, long Payload);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct pidStruct {
|
struct pidStruct {
|
||||||
@@ -54,14 +51,14 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Streamer statistics
|
// Streamer statistics
|
||||||
class cIptvStreamerStatistics : public cIptvStatisticIf {
|
class cIptvStreamerStatistics {
|
||||||
public:
|
public:
|
||||||
cIptvStreamerStatistics();
|
cIptvStreamerStatistics();
|
||||||
virtual ~cIptvStreamerStatistics();
|
virtual ~cIptvStreamerStatistics();
|
||||||
cString GetStatistic();
|
cString GetStreamerStatistic();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AddStatistic(long Bytes);
|
void AddStreamerStatistic(long Bytes);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long dataBytes;
|
long dataBytes;
|
||||||
@@ -70,14 +67,14 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Buffer statistics
|
// Buffer statistics
|
||||||
class cIptvBufferStatistics : public cIptvStatisticIf {
|
class cIptvBufferStatistics {
|
||||||
public:
|
public:
|
||||||
cIptvBufferStatistics();
|
cIptvBufferStatistics();
|
||||||
virtual ~cIptvBufferStatistics();
|
virtual ~cIptvBufferStatistics();
|
||||||
cString GetStatistic();
|
cString GetBufferStatistic();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AddStatistic(long Bytes, long Used);
|
void AddBufferStatistic(long Bytes, long Used);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long dataBytes;
|
long dataBytes;
|
||||||
|
|||||||
78
streamer.c
78
streamer.c
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: streamer.c,v 1.27 2007/10/20 08:58:15 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vdr/thread.h>
|
#include <vdr/thread.h>
|
||||||
@@ -12,13 +11,19 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "streamer.h"
|
#include "streamer.h"
|
||||||
|
|
||||||
cIptvStreamer::cIptvStreamer(cRingBufferLinear* RingBuffer, cMutex* Mutex)
|
cIptvStreamer::cIptvStreamer(cRingBufferLinear* RingBuffer, unsigned int PacketLen)
|
||||||
: cThread("IPTV streamer"),
|
: cThread("IPTV streamer"),
|
||||||
ringBuffer(RingBuffer),
|
ringBuffer(RingBuffer),
|
||||||
mutex(Mutex),
|
packetBufferLen(PacketLen),
|
||||||
protocol(NULL)
|
protocol(NULL)
|
||||||
{
|
{
|
||||||
debug("cIptvStreamer::cIptvStreamer()\n");
|
debug("cIptvStreamer::cIptvStreamer(%d)\n", packetBufferLen);
|
||||||
|
// Allocate packet buffer
|
||||||
|
packetBuffer = MALLOC(unsigned char, packetBufferLen);
|
||||||
|
if (packetBuffer)
|
||||||
|
memset(packetBuffer, 0, packetBufferLen);
|
||||||
|
else
|
||||||
|
error("MALLOC() failed for packet buffer");
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvStreamer::~cIptvStreamer()
|
cIptvStreamer::~cIptvStreamer()
|
||||||
@@ -26,32 +31,33 @@ cIptvStreamer::~cIptvStreamer()
|
|||||||
debug("cIptvStreamer::~cIptvStreamer()\n");
|
debug("cIptvStreamer::~cIptvStreamer()\n");
|
||||||
// Close the protocol
|
// Close the protocol
|
||||||
Close();
|
Close();
|
||||||
|
protocol = NULL;
|
||||||
|
ringBuffer = NULL;
|
||||||
|
// Free allocated memory
|
||||||
|
free(packetBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvStreamer::Action(void)
|
void cIptvStreamer::Action(void)
|
||||||
{
|
{
|
||||||
debug("cIptvStreamer::Action(): Entering\n");
|
debug("cIptvStreamer::Action(): Entering\n");
|
||||||
|
// Increase priority
|
||||||
|
//SetPriority(-1);
|
||||||
// Do the thread loop
|
// Do the thread loop
|
||||||
while (Running()) {
|
while (packetBuffer && Running()) {
|
||||||
if (ringBuffer && mutex && protocol && ringBuffer->Free()) {
|
int length = -1;
|
||||||
unsigned char *buffer = NULL;
|
if (protocol)
|
||||||
mutex->Lock();
|
length = protocol->Read(packetBuffer, packetBufferLen);
|
||||||
int length = protocol->Read(&buffer);
|
if (length > 0) {
|
||||||
if (length >= 0) {
|
AddStreamerStatistic(length);
|
||||||
AddStatistic(length);
|
if (ringBuffer) {
|
||||||
int p = ringBuffer->Put(buffer, length);
|
int p = ringBuffer->Put(packetBuffer, length);
|
||||||
if (p != length && Running())
|
if (p != length)
|
||||||
ringBuffer->ReportOverflow(length - p);
|
ringBuffer->ReportOverflow(length - p);
|
||||||
mutex->Unlock();
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
mutex->Unlock();
|
sleep.Wait(10); // to avoid busy loop and reduce cpu load
|
||||||
cCondWait::SleepMs(100); // to reduce cpu load
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cCondWait::SleepMs(100); // and avoid busy loop
|
|
||||||
}
|
|
||||||
debug("cIptvStreamer::Action(): Exiting\n");
|
debug("cIptvStreamer::Action(): Exiting\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,9 +65,8 @@ bool cIptvStreamer::Open(void)
|
|||||||
{
|
{
|
||||||
debug("cIptvStreamer::Open()\n");
|
debug("cIptvStreamer::Open()\n");
|
||||||
// Open the protocol
|
// Open the protocol
|
||||||
if (protocol)
|
if (protocol && !protocol->Open())
|
||||||
if(!protocol->Open())
|
return false;
|
||||||
return false;
|
|
||||||
// Start thread
|
// Start thread
|
||||||
Start();
|
Start();
|
||||||
return true;
|
return true;
|
||||||
@@ -71,16 +76,12 @@ bool cIptvStreamer::Close(void)
|
|||||||
{
|
{
|
||||||
debug("cIptvStreamer::Close()\n");
|
debug("cIptvStreamer::Close()\n");
|
||||||
// Stop thread
|
// Stop thread
|
||||||
|
sleep.Signal();
|
||||||
if (Running())
|
if (Running())
|
||||||
Cancel(3);
|
Cancel(3);
|
||||||
// Close the protocol. A mutex should be taken here to avoid a race condition
|
// Close the protocol
|
||||||
// where thread Action() may be in the process of accessing the protocol.
|
if (protocol)
|
||||||
// Taking a mutex serializes the Close() and Action() -calls.
|
|
||||||
if (protocol) {
|
|
||||||
mutex->Lock();
|
|
||||||
protocol->Close();
|
protocol->Close();
|
||||||
mutex->Unlock();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,16 +89,17 @@ bool cIptvStreamer::Set(const char* Location, const int Parameter, const int Ind
|
|||||||
{
|
{
|
||||||
debug("cIptvStreamer::Set(): %s:%d\n", Location, Parameter);
|
debug("cIptvStreamer::Set(): %s:%d\n", Location, Parameter);
|
||||||
if (!isempty(Location)) {
|
if (!isempty(Location)) {
|
||||||
// Update protocol; Close the existing one if changed
|
// Update protocol and set location and parameter; Close the existing one if changed
|
||||||
if (protocol != Protocol) {
|
if (protocol != Protocol) {
|
||||||
if (protocol)
|
if (protocol)
|
||||||
protocol->Close();
|
protocol->Close();
|
||||||
protocol = Protocol;
|
protocol = Protocol;
|
||||||
if (protocol)
|
if (protocol) {
|
||||||
|
protocol->Set(Location, Parameter, Index);
|
||||||
protocol->Open();
|
protocol->Open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Set protocol location and parameter
|
else if (protocol)
|
||||||
if (protocol)
|
|
||||||
protocol->Set(Location, Parameter, Index);
|
protocol->Set(Location, Parameter, Index);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
16
streamer.h
16
streamer.h
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* See the README file for copyright information and how to reach the author.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: streamer.h,v 1.13 2007/10/19 22:18:55 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_STREAMER_H
|
#ifndef __IPTV_STREAMER_H
|
||||||
@@ -20,15 +19,17 @@
|
|||||||
class cIptvStreamer : public cThread, public cIptvStreamerStatistics {
|
class cIptvStreamer : public cThread, public cIptvStreamerStatistics {
|
||||||
private:
|
private:
|
||||||
cRingBufferLinear* ringBuffer;
|
cRingBufferLinear* ringBuffer;
|
||||||
cMutex* mutex;
|
cCondWait sleep;
|
||||||
unsigned char* readBuffer;
|
unsigned char* packetBuffer;
|
||||||
unsigned int readBufferLen;
|
unsigned int packetBufferLen;
|
||||||
cIptvProtocolIf* protocol;
|
cIptvProtocolIf* protocol;
|
||||||
|
|
||||||
public:
|
protected:
|
||||||
cIptvStreamer(cRingBufferLinear* RingBuffer, cMutex* Mutex);
|
|
||||||
virtual ~cIptvStreamer();
|
|
||||||
virtual void Action(void);
|
virtual void Action(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
cIptvStreamer(cRingBufferLinear* RingBuffer, unsigned int PacketLen);
|
||||||
|
virtual ~cIptvStreamer();
|
||||||
bool Set(const char* Location, const int Parameter, const int Index, cIptvProtocolIf* Protocol);
|
bool Set(const char* Location, const int Parameter, const int Index, cIptvProtocolIf* Protocol);
|
||||||
bool Open(void);
|
bool Open(void);
|
||||||
bool Close(void);
|
bool Close(void);
|
||||||
@@ -36,4 +37,3 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_STREAMER_H
|
#endif // __IPTV_STREAMER_H
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user