mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 11:37:03 +00:00
Compare commits
120 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06506c41f6 | ||
|
|
c33b05076a | ||
|
|
38bd9a21f6 | ||
|
|
4c7b2ea69b | ||
|
|
c475b26515 | ||
|
|
9145fb8bb8 | ||
|
|
7a8b2962b2 | ||
|
|
626d0402c2 | ||
|
|
b3b06e569f | ||
|
|
ff84c54d50 | ||
|
|
4c39d8cf72 | ||
|
|
0b790260fa | ||
|
|
79113bbe09 | ||
|
|
30de763a4b | ||
|
|
868865c47d | ||
|
|
a73921041f | ||
|
|
49e3a9e23a | ||
|
|
73311873bc | ||
|
|
816c357065 | ||
|
|
5838bda3f0 | ||
|
|
079b02d69e | ||
|
|
6582f137b9 | ||
|
|
2bd31e9eda | ||
|
|
c2f88fbbb3 | ||
|
|
52ae2bdf63 | ||
|
|
1898defeb6 | ||
|
|
21719d3397 | ||
|
|
bf3fc70d2d | ||
|
|
99d6c0f207 | ||
|
|
ca4fdc761f | ||
|
|
37c5ee26ae | ||
|
|
8ba0b3a417 | ||
|
|
cfb60a06ba | ||
|
|
6ed0ebd734 | ||
|
|
2081ab41a8 | ||
|
|
66ab92584b | ||
|
|
05e57802c3 | ||
|
|
55bb0e65df | ||
|
|
ea4f8fde31 | ||
|
|
ef615c4bc5 | ||
|
|
a6d4e850fc | ||
|
|
fd06641449 | ||
|
|
05e52079f8 | ||
|
|
f0469e24cc | ||
|
|
7629e34d2a | ||
|
|
ac458b0c36 | ||
|
|
2d583e8cfa | ||
|
|
b0dba49fbc | ||
|
|
a05766c90d | ||
|
|
d1fdc390c9 | ||
|
|
d126da8ed8 | ||
|
|
2567501b65 | ||
|
|
12b54fbbc2 | ||
|
|
a2d8c367f6 | ||
|
|
3f88e7a911 | ||
|
|
8a96e5b327 | ||
|
|
170cb56263 | ||
|
|
899db53845 | ||
|
|
6eb259e8fb | ||
|
|
204c6020c4 | ||
|
|
c207b5cf6e | ||
|
|
d8585ba0fc | ||
|
|
1a825f5636 | ||
|
|
0720489995 | ||
|
|
3b8cfd2323 | ||
|
|
d737278f78 | ||
|
|
906438e981 | ||
|
|
aa620a314c | ||
|
|
517547dc15 | ||
|
|
60a4d266b7 | ||
|
|
6901970b8a | ||
|
|
d67f0d6ead | ||
|
|
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 |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.dependencies
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
*~
|
||||||
|
po/*.pot
|
||||||
|
po/*.mo
|
||||||
125
HISTORY
125
HISTORY
@@ -1,5 +1,6 @@
|
|||||||
|
==================================
|
||||||
VDR Plugin 'iptv' Revision History
|
VDR Plugin 'iptv' Revision History
|
||||||
----------------------------------
|
==================================
|
||||||
|
|
||||||
2007-10-14: Version 0.0.1
|
2007-10-14: Version 0.0.1
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ VDR Plugin 'iptv' Revision History
|
|||||||
2008-01-20: Version 0.0.6
|
2008-01-20: Version 0.0.6
|
||||||
|
|
||||||
- Fixed some lint warnings.
|
- Fixed some lint warnings.
|
||||||
- Added Italian translation (Thanks to Gringo).
|
- Added Italian translation (Thanks to Diego Pierotto).
|
||||||
- Added '-Wno-parentheses' to the compiler options.
|
- Added '-Wno-parentheses' to the compiler options.
|
||||||
- Mapped 'kInfo' as help key in setup menu.
|
- Mapped 'kInfo' as help key in setup menu.
|
||||||
- Refactored statistic collecting code.
|
- Refactored statistic collecting code.
|
||||||
@@ -43,7 +44,7 @@ VDR Plugin 'iptv' Revision History
|
|||||||
|
|
||||||
- Updated for vdr-1.5.15.
|
- Updated for vdr-1.5.15.
|
||||||
- Replaced asprintf with cString.
|
- Replaced asprintf with cString.
|
||||||
- Updated French translation (Thanks to Micha<EFBFBD>l Nival).
|
- Updated French translation (Thanks to Michaël Nival).
|
||||||
- Modified VDR locale support detection.
|
- Modified VDR locale support detection.
|
||||||
- Added preliminary automatic Pid scanning functionality.
|
- Added preliminary automatic Pid scanning functionality.
|
||||||
- Modified channels.conf format to enable/disable channel
|
- Modified channels.conf format to enable/disable channel
|
||||||
@@ -53,5 +54,121 @@ VDR Plugin 'iptv' Revision History
|
|||||||
2008-03-27: Version 0.2.0
|
2008-03-27: Version 0.2.0
|
||||||
|
|
||||||
- Updated for vdr-1.6.0.
|
- Updated for vdr-1.6.0.
|
||||||
- Updated Italian translation (Thanks to Gringo).
|
- Updated Italian translation (Thanks to Diego Pierotto).
|
||||||
- Added Russian translation (Thanks to Alexander Gross).
|
- 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.
|
||||||
|
|
||||||
|
2010-03-05: Version 0.3.2
|
||||||
|
|
||||||
|
- Updated patches.
|
||||||
|
- Fixed argument corruption.
|
||||||
|
|
||||||
|
|
||||||
|
==================================
|
||||||
|
VDR Plugin 'iptv' Revision History
|
||||||
|
==================================
|
||||||
|
|
||||||
|
2010-03-05: Version 0.4.0
|
||||||
|
|
||||||
|
- Updated for vdr-1.7.13.
|
||||||
|
- Fixed argument corruption.
|
||||||
|
|
||||||
|
2010-03-09: Version 0.4.1
|
||||||
|
|
||||||
|
- Fixed channel parameter corruption.
|
||||||
|
- Added Dutch translation (Thanks to Carel).
|
||||||
|
|
||||||
|
2010-06-06: Version 0.4.2
|
||||||
|
|
||||||
|
- Updated for vdr-1.7.15.
|
||||||
|
|
||||||
|
2012-02-02: Version 0.5.0
|
||||||
|
|
||||||
|
- Updated for vdr-1.7.23.
|
||||||
|
- Renamed Sid scanner to section id scanner and added
|
||||||
|
experimental Tid/Nid support into it.
|
||||||
|
- Added optional source address validation for UDP protocol.
|
||||||
|
- Fixed audio pid detection in pid scanner.
|
||||||
|
- Changed ProvidesChannel() to set the need of detaching
|
||||||
|
receivers due to VDR's channel selection mechanism.
|
||||||
|
- Enabled partial content responses for HTTP protocol.
|
||||||
|
- Fixed EXT protocol execution (Thanks to Peter Holik).
|
||||||
|
- Disable detaching of receivers if retuned to an existing
|
||||||
|
channel (Thanks to Zdeněk Kopřivík).
|
||||||
|
- Canonicalized the configuration directory.
|
||||||
|
- Added support for LDFLAGS.
|
||||||
|
- Added cppcheck target into Makefile.
|
||||||
|
|
||||||
|
2012-04-02: Version 0.5.1
|
||||||
|
|
||||||
|
- Updated for vdr-1.7.27.
|
||||||
|
- Updated Makefile.
|
||||||
|
- Silenced compilation warnings.
|
||||||
|
- Fixed channel switching bugs.
|
||||||
|
- Added support for a service interface.
|
||||||
|
- Changed UDP protocol to always utilize the source address
|
||||||
|
validation.
|
||||||
|
|
||||||
|
2012-04-26: Version 0.5.2
|
||||||
|
|
||||||
|
- Fixed connection problems in HTTP protocol.
|
||||||
|
|||||||
38
Makefile
38
Makefile
@@ -1,7 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Makefile for a Video Disk Recorder plugin
|
# Makefile for IPTV plugin
|
||||||
#
|
#
|
||||||
# $Id: Makefile,v 1.27 2008/02/19 22:29:02 rahrenbe Exp $
|
|
||||||
|
|
||||||
# Debugging on/off
|
# Debugging on/off
|
||||||
#IPTV_DEBUG = 1
|
#IPTV_DEBUG = 1
|
||||||
@@ -19,18 +18,24 @@ PLUGIN = iptv
|
|||||||
|
|
||||||
### The version number of this plugin (taken from the main source file):
|
### The version number of this plugin (taken from the main source file):
|
||||||
|
|
||||||
VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
|
VERSION = $(shell grep 'const char VERSION\[\] *=' $(PLUGIN).c | awk '{ print $$5 }' | sed -e 's/[";]//g')
|
||||||
|
GITTAG = $(shell git describe --always 2>/dev/null)
|
||||||
|
|
||||||
### The C++ compiler and options:
|
### The C++ compiler and options:
|
||||||
|
|
||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
|
CXXFLAGS ?= -fPIC -g -O3 -Wall -Wextra -Wswitch-default -Wfloat-equal -Wundef -Wpointer-arith -Wconversion -Wcast-align -Wredundant-decls -Wno-unused-parameter -Werror=overloaded-virtual -Wno-parentheses
|
||||||
|
LDFLAGS ?= -Wl,--as-needed
|
||||||
|
|
||||||
### The directory environment:
|
### The directory environment:
|
||||||
|
|
||||||
VDRDIR = ../../..
|
VDRDIR ?= ../../..
|
||||||
LIBDIR = ../../lib
|
LIBDIR ?= ../../lib
|
||||||
TMPDIR = /tmp
|
TMPDIR ?= /tmp
|
||||||
|
|
||||||
|
### Make sure that necessary options are included:
|
||||||
|
|
||||||
|
-include $(VDRDIR)/Make.global
|
||||||
|
|
||||||
### Allow user defined options to overwrite defaults:
|
### Allow user defined options to overwrite defaults:
|
||||||
|
|
||||||
@@ -55,6 +60,10 @@ ifdef IPTV_DEBUG
|
|||||||
DEFINES += -DDEBUG
|
DEFINES += -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(strip $(GITTAG)),)
|
||||||
|
DEFINES += -DGITVERSION='"-GIT-$(GITTAG)"'
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: all all-redirect
|
.PHONY: all all-redirect
|
||||||
all-redirect: all
|
all-redirect: all
|
||||||
|
|
||||||
@@ -62,7 +71,7 @@ all-redirect: all
|
|||||||
|
|
||||||
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 pidscanner.o statistics.o common.o socket.o
|
sidscanner.o pidscanner.o statistics.o common.o socket.o source.o
|
||||||
|
|
||||||
### The main target:
|
### The main target:
|
||||||
|
|
||||||
@@ -70,7 +79,7 @@ all: libvdr-$(PLUGIN).so i18n
|
|||||||
|
|
||||||
### Implicit rules:
|
### Implicit rules:
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c Makefile
|
||||||
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
|
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
|
||||||
|
|
||||||
### Dependencies:
|
### Dependencies:
|
||||||
@@ -94,7 +103,7 @@ I18Npot = $(PODIR)/$(PLUGIN).pot
|
|||||||
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 $@ $^
|
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name='vdr-$(PLUGIN)' --package-version='$(VERSION)' --msgid-bugs-address='<see README>' -o $@ `ls $^`
|
||||||
|
|
||||||
%.po: $(I18Npot)
|
%.po: $(I18Npot)
|
||||||
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
|
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
|
||||||
@@ -110,19 +119,22 @@ i18n: $(I18Nmsgs) $(I18Npot)
|
|||||||
### Targets:
|
### Targets:
|
||||||
|
|
||||||
libvdr-$(PLUGIN).so: $(OBJS)
|
libvdr-$(PLUGIN).so: $(OBJS)
|
||||||
$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
|
||||||
ifndef IPTV_DEBUG
|
ifndef IPTV_DEBUG
|
||||||
@$(STRIP) $@
|
@$(STRIP) $@
|
||||||
endif
|
endif
|
||||||
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
|
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
|
||||||
|
|
||||||
dist: clean
|
dist: $(I18Npo) 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) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
|
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
|
||||||
|
|
||||||
|
cppcheck: $(OBJS)
|
||||||
|
@cppcheck --enable=information,style,unusedFunction -v -f $(OBJS:%.o=%.c)
|
||||||
|
|||||||
75
README
75
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/
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ See the file COPYING for more information.
|
|||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
An IPTV patched VDR setup and DVB compatible MPEG1/2 network video streams.
|
DVB compatible MPEG1/2 or H.264 network video streams.
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
|
|
||||||
@@ -44,8 +44,6 @@ 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
|
||||||
patch -p1 < PLUGINS/src/iptv/patches/vdr-X.Y.Z-pluginparam.patch
|
|
||||||
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
|
||||||
make plugins
|
make plugins
|
||||||
@@ -77,29 +75,8 @@ Setup menu:
|
|||||||
options which allow you to disable the
|
options which allow you to disable the
|
||||||
individual section filters.
|
individual section filters.
|
||||||
Valid range: 0...7
|
Valid range: 0...7
|
||||||
- [Red:Channels] Opens IPTV channel editor.
|
|
||||||
- [Blue:Info] Opens IPTV information/statistics menu.
|
- [Blue:Info] Opens IPTV information/statistics menu.
|
||||||
|
|
||||||
Channel editor menu:
|
|
||||||
|
|
||||||
- Because of the different nature and content the VDR channel editor is not
|
|
||||||
best suited for editing of IPTV channels. Therefore an alternative editor
|
|
||||||
is provided which allows more IPTV centric editing of channel information.
|
|
||||||
An IPTV channel editor is accessible via "Setup -> Plugins -> IPTV" and
|
|
||||||
pressing the Red button. The channel editor is functionally similar to
|
|
||||||
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.
|
||||||
@@ -111,17 +88,20 @@ Configuration:
|
|||||||
|
|
||||||
- channels.conf
|
- channels.conf
|
||||||
|
|
||||||
TV4;IPTV:4:IPTV|S1P0|EXT|iptvstream.sh|0:P:0:0:680:0:0:4:0:0:0
|
TV4;IPTV:40:S=1|P=0|F=EXT|U=iptvstream.sh|A=0:I:0:0:680:0:0:4:0:0:0
|
||||||
TV3;IPTV:3:IPTV|S0P1|FILE|/video/stream.ts|5:P:0:514:670:2321:0:3:0:0:0
|
TV3;IPTV:30:S=0|P=1|F=FILE|U=/video/stream.ts|A=5:I:0:514:670:2321:0:3:0:0:0
|
||||||
TV2;IPTV:2:IPTV|S0P1|HTTP|127.0.0.1/TS/2|3000:P:0:513:660:2321:0:2:0:0:0
|
TV2;IPTV:20:S=0|P=1|F=HTTP|U=127.0.0.1/TS/2|A=3000:I:0:513:660:2321:0:2:0:0:0
|
||||||
TV1;IPTV:1:IPTV|S1P0|UDP|127.0.0.1|1234:P:0:512:650:2321:0:1:0:0:0
|
TV1;IPTV:10:S=1|P=0|F=UDP|U=127.0.0.1|A=1234:I:0:512:650:2321:0:1:0:0:0
|
||||||
^ ^ ^ ^ ^ ^ ^
|
^ ^ ^ ^ ^ ^ ^
|
||||||
| | | | | | Source type ("P")
|
| | | | | | Source type ("I")
|
||||||
| | | | | IP Port Number, File delay (ms), Script parameter
|
| | | | | Stream parameter (multicast port
|
||||||
| | | | IP Address, File location, Script location
|
| | | | | number, HTTP port number, file delay
|
||||||
| | | Protocol ("UDP", "HTTP", "FILE", "EXT")
|
| | | | | (ms), script parameter)
|
||||||
| | Parameters ("S" Sid scan, "P" Pid scan, "0" disable, "1" enable)
|
| | | | Stream address (multicast address, URL, file
|
||||||
| Plugin ID ("IPTV")
|
| | | | location, script location)
|
||||||
|
| | | Stream protocol ("UDP", "HTTP", "FILE", "EXT")
|
||||||
|
| | Pid scanner ("0" disable, "1" enable)
|
||||||
|
| Section id (Sid/Nid/Tid) scanner ("0" disable, "1" enable)
|
||||||
Unique enumeration
|
Unique enumeration
|
||||||
|
|
||||||
- UDP multicast rules for iptables firewall
|
- UDP multicast rules for iptables firewall
|
||||||
@@ -151,8 +131,7 @@ External streaming:
|
|||||||
devices can be used simultaneously.
|
devices can be used simultaneously.
|
||||||
|
|
||||||
- IPTV plugin includes an example script which uses VLC media player for
|
- IPTV plugin includes an example script which uses VLC media player for
|
||||||
receiving streams, transcoding and handing the result to IPTV plugin. The
|
receiving streams, transcoding and handing the result to IPTV plugin.
|
||||||
plugin was tested with VLC version 0.8.6c.
|
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
@@ -167,6 +146,24 @@ Notes:
|
|||||||
startup. If the fifo is found and succesfully opened, the device writes
|
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.
|
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.
|
||||||
|
|
||||||
|
- If received MPEG-2 TS streams carry CA descriptors, you'll have to apply
|
||||||
|
"disable_ca_updates" patch to the VDR in order to get rid of "Channel not
|
||||||
|
available" messages.
|
||||||
|
|
||||||
|
- EIT scanning functionality can be disabled for all IPTV channels by applying
|
||||||
|
the "disable_eitscan" patch to the VDR.
|
||||||
|
|
||||||
|
- Section id and pid scanners should be disabled after the correct data is
|
||||||
|
found. This can be made via VDR's channel editor.
|
||||||
|
|
||||||
Acknowledgements:
|
Acknowledgements:
|
||||||
|
|
||||||
- The IPTV section filtering code is derived from Linux kernel.
|
- The IPTV section filtering code is derived from Linux kernel.
|
||||||
|
|||||||
5
common.c
5
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.10 2008/01/30 21:57:33 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;
|
||||||
|
|||||||
34
common.h
34
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.20 2008/02/17 19:18:47 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_COMMON_H
|
#ifndef __IPTV_COMMON_H
|
||||||
@@ -15,27 +14,24 @@
|
|||||||
|
|
||||||
#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
|
#define ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
|
||||||
#define trNOOP(s) (s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef trVDR
|
|
||||||
#define trVDR(s) tr(s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IPTV_FILTER_FILENAME "/tmp/vdr-iptv%d.filter%d"
|
|
||||||
#define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr"
|
#define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr"
|
||||||
|
|
||||||
|
#define IPTV_SOURCE_CHARACTER 'I'
|
||||||
|
|
||||||
#define IPTV_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
|
||||||
#define IPTV_DEVICE_INFO_FILTERS 3
|
#define IPTV_DEVICE_INFO_FILTERS 3
|
||||||
|
#define IPTV_DEVICE_INFO_PROTOCOL 4
|
||||||
|
#define IPTV_DEVICE_INFO_BITRATE 5
|
||||||
|
|
||||||
#define IPTV_STATS_ACTIVE_PIDS_COUNT 10
|
#define IPTV_STATS_ACTIVE_PIDS_COUNT 10
|
||||||
#define IPTV_STATS_ACTIVE_FILTERS_COUNT 10
|
#define IPTV_STATS_ACTIVE_FILTERS_COUNT 10
|
||||||
@@ -43,13 +39,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)
|
||||||
|
|
||||||
|
|
||||||
@@ -83,5 +79,7 @@ struct section_filter_table_type {
|
|||||||
|
|
||||||
extern const section_filter_table_type section_filter_table[SECTION_FILTER_TABLE_SIZE];
|
extern const section_filter_table_type section_filter_table[SECTION_FILTER_TABLE_SIZE];
|
||||||
|
|
||||||
|
extern const char VERSION[];
|
||||||
|
|
||||||
#endif // __IPTV_COMMON_H
|
#endif // __IPTV_COMMON_H
|
||||||
|
|
||||||
|
|||||||
12
config.c
12
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.21 2008/02/01 21:54:24 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -11,14 +10,13 @@
|
|||||||
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)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters) - 1; ++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));
|
||||||
}
|
}
|
||||||
@@ -26,7 +24,7 @@ cIptvConfig::cIptvConfig(void)
|
|||||||
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
|
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
|
||||||
{
|
{
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
while ((disabledFilters[n] != -1) && (n < ARRAY_SIZE(disabledFilters) - 1))
|
while ((n < ARRAY_SIZE(disabledFilters) && (disabledFilters[n] != -1)))
|
||||||
n++;
|
n++;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
@@ -44,6 +42,6 @@ void cIptvConfig::SetDisabledFilters(unsigned int Index, int Number)
|
|||||||
|
|
||||||
void cIptvConfig::SetConfigDirectory(const char *directoryP)
|
void cIptvConfig::SetConfigDirectory(const char *directoryP)
|
||||||
{
|
{
|
||||||
debug("cIptvConfig::SetConfigDirectory(%s)", directoryP);
|
debug("cIptvConfig::SetConfigDirectory(%s)\n", directoryP);
|
||||||
strn0cpy(configDirectory, directoryP, sizeof(configDirectory));
|
ERROR_IF(!realpath(directoryP, configDirectory), "Cannot canonicalize configuration directory");
|
||||||
}
|
}
|
||||||
|
|||||||
5
config.h
5
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.20 2008/02/01 21:54:24 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_CONFIG_H
|
#ifndef __IPTV_CONFIG_H
|
||||||
@@ -15,18 +14,16 @@
|
|||||||
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;
|
||||||
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
||||||
char configDirectory[255];
|
char configDirectory[PATH_MAX];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cIptvConfig();
|
cIptvConfig();
|
||||||
unsigned int GetReadBufferTsCount(void) const { return readBufferTsCount; }
|
|
||||||
unsigned int GetTsBufferSize(void) const { return tsBufferSize; }
|
unsigned int GetTsBufferSize(void) const { return tsBufferSize; }
|
||||||
unsigned int GetTsBufferPrefillRatio(void) const { return tsBufferPrefillRatio; }
|
unsigned int GetTsBufferPrefillRatio(void) const { return tsBufferPrefillRatio; }
|
||||||
unsigned int GetExtProtocolBasePort(void) const { return extProtocolBasePort; }
|
unsigned int GetExtProtocolBasePort(void) const { return extProtocolBasePort; }
|
||||||
|
|||||||
223
device.c
223
device.c
@@ -3,15 +3,15 @@
|
|||||||
*
|
*
|
||||||
* 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.85 2008/02/19 22:29:02 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "source.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;
|
||||||
|
|
||||||
@@ -22,26 +22,27 @@ cIptvDevice::cIptvDevice(unsigned int Index)
|
|||||||
isOpenDvr(false),
|
isOpenDvr(false),
|
||||||
sidScanEnabled(false),
|
sidScanEnabled(false),
|
||||||
pidScanEnabled(false),
|
pidScanEnabled(false),
|
||||||
mutex()
|
channelId(tChannelID::InvalidID)
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::cIptvDevice(%d)\n", deviceIndex);
|
unsigned int bufsize = (unsigned int)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;
|
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
|
// Check if dvr fifo exists
|
||||||
@@ -49,7 +50,7 @@ cIptvDevice::cIptvDevice(unsigned int Index)
|
|||||||
cString filename = cString::sprintf(IPTV_DVR_FILENAME, deviceIndex);
|
cString filename = cString::sprintf(IPTV_DVR_FILENAME, deviceIndex);
|
||||||
stat(filename, &sb);
|
stat(filename, &sb);
|
||||||
if (S_ISFIFO(sb.st_mode)) {
|
if (S_ISFIFO(sb.st_mode)) {
|
||||||
dvrFd = open(filename, O_WRONLY | O_NONBLOCK);
|
dvrFd = open(filename, O_RDWR | O_NONBLOCK);
|
||||||
if (dvrFd >= 0)
|
if (dvrFd >= 0)
|
||||||
dsyslog("IPTV device %d redirecting input stream to '%s'", deviceIndex, *filename);
|
dsyslog("IPTV device %d redirecting input stream to '%s'", deviceIndex, *filename);
|
||||||
}
|
}
|
||||||
@@ -86,6 +87,7 @@ cIptvDevice::~cIptvDevice()
|
|||||||
bool cIptvDevice::Initialize(unsigned int DeviceCount)
|
bool cIptvDevice::Initialize(unsigned int DeviceCount)
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::Initialize(): DeviceCount=%d\n", DeviceCount);
|
debug("cIptvDevice::Initialize(): DeviceCount=%d\n", DeviceCount);
|
||||||
|
new cIptvSourceParam(IPTV_SOURCE_CHARACTER, "IPTV");
|
||||||
if (DeviceCount > IPTV_MAX_DEVICES)
|
if (DeviceCount > IPTV_MAX_DEVICES)
|
||||||
DeviceCount = IPTV_MAX_DEVICES;
|
DeviceCount = IPTV_MAX_DEVICES;
|
||||||
for (unsigned int i = 0; i < DeviceCount; ++i)
|
for (unsigned int i = 0; i < DeviceCount; ++i)
|
||||||
@@ -121,7 +123,7 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int CardIndex)
|
|||||||
cString cIptvDevice::GetGeneralInformation(void)
|
cString cIptvDevice::GetGeneralInformation(void)
|
||||||
{
|
{
|
||||||
//debug("cIptvDevice::GetGeneralInformation(%d)\n", deviceIndex);
|
//debug("cIptvDevice::GetGeneralInformation(%d)\n", deviceIndex);
|
||||||
return cString::sprintf("IPTV device: %d\nCardIndex: %d\n%s%s%sChannel: %s",
|
return cString::sprintf("IPTV device: %d\nCardIndex: %d\nStream: %s\nStream bitrate: %s\n%sChannel: %s",
|
||||||
deviceIndex, CardIndex(),
|
deviceIndex, CardIndex(),
|
||||||
pIptvStreamer ? *pIptvStreamer->GetInformation() : "",
|
pIptvStreamer ? *pIptvStreamer->GetInformation() : "",
|
||||||
pIptvStreamer ? *pIptvStreamer->GetStreamerStatistic() : "",
|
pIptvStreamer ? *pIptvStreamer->GetStreamerStatistic() : "",
|
||||||
@@ -167,6 +169,12 @@ cString cIptvDevice::GetInformation(unsigned int Page)
|
|||||||
case IPTV_DEVICE_INFO_FILTERS:
|
case IPTV_DEVICE_INFO_FILTERS:
|
||||||
info = GetFiltersInformation();
|
info = GetFiltersInformation();
|
||||||
break;
|
break;
|
||||||
|
case IPTV_DEVICE_INFO_PROTOCOL:
|
||||||
|
info = pIptvStreamer ? *pIptvStreamer->GetInformation() : "";
|
||||||
|
break;
|
||||||
|
case IPTV_DEVICE_INFO_BITRATE:
|
||||||
|
info = pIptvStreamer ? *pIptvStreamer->GetStreamerStatistic() : "";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
info = cString::sprintf("%s%s%s",
|
info = cString::sprintf("%s%s%s",
|
||||||
*GetGeneralInformation(),
|
*GetGeneralInformation(),
|
||||||
@@ -177,103 +185,46 @@ cString cIptvDevice::GetInformation(unsigned int Page)
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvDevice::GetChannelSettings(const char *IptvParam, int *Parameter, int *SidScan, int *PidScan, cIptvProtocolIf* *Protocol)
|
cString cIptvDevice::DeviceType(void) const
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
|
debug("cIptvDevice::DeviceType(%d)\n", deviceIndex);
|
||||||
char *tag = NULL;
|
return "IPTV";
|
||||||
char *proto = NULL;
|
|
||||||
char *loc = NULL;
|
|
||||||
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 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// compatibility mode for old channels.conf format
|
|
||||||
else if (sscanf(IptvParam, "%a[^|]|%a[^|]|%a[^|]|%u", &tag, &proto, &loc, Parameter) == 4) {
|
|
||||||
cString tagstr(tag, true);
|
|
||||||
cString protostr(proto, true);
|
|
||||||
cString locstr(loc, true);
|
|
||||||
*SidScan = 0;
|
|
||||||
*PidScan = 0;
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvDevice::ProvidesIptv(const char *Param) const
|
cString cIptvDevice::DeviceName(void) const
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::ProvidesIptv(%d)\n", deviceIndex);
|
debug("cIptvDevice::DeviceName(%d)\n", deviceIndex);
|
||||||
return (strncasecmp(Param, "IPTV", 4) == 0);
|
return cString::sprintf("IPTV %d", deviceIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
int cIptvDevice::SignalStrength(void) const
|
||||||
|
{
|
||||||
|
debug("cIptvDevice::SignalStrength(%d)\n", deviceIndex);
|
||||||
|
return (100);
|
||||||
|
}
|
||||||
|
|
||||||
|
int cIptvDevice::SignalQuality(void) const
|
||||||
|
{
|
||||||
|
debug("cIptvDevice::SignalQuality(%d)\n", deviceIndex);
|
||||||
|
return (100);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvDevice::ProvidesSource(int Source) const
|
bool cIptvDevice::ProvidesSource(int Source) const
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::ProvidesSource(%d)\n", deviceIndex);
|
debug("cIptvDevice::ProvidesSource(%d)\n", deviceIndex);
|
||||||
return (cSource::IsPlug(Source));
|
return (cSource::IsType(Source, IPTV_SOURCE_CHARACTER));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvDevice::ProvidesTransponder(const cChannel *Channel) const
|
bool cIptvDevice::ProvidesTransponder(const cChannel *Channel) const
|
||||||
{
|
{
|
||||||
debug("cIptvDevice::ProvidesTransponder(%d)\n", deviceIndex);
|
debug("cIptvDevice::ProvidesTransponder(%d)\n", deviceIndex);
|
||||||
return (ProvidesSource(Channel->Source()) && ProvidesIptv(Channel->PluginParam()));
|
return (ProvidesSource(Channel->Source()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
|
bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
bool needsDetachReceivers = false;
|
bool needsDetachReceivers = Receiving(true) && Channel && !(Channel->GetChannelID() == channelId);
|
||||||
|
|
||||||
debug("cIptvDevice::ProvidesChannel(%d)\n", deviceIndex);
|
debug("cIptvDevice::ProvidesChannel(%d)\n", deviceIndex);
|
||||||
if (ProvidesTransponder(Channel))
|
if (ProvidesTransponder(Channel))
|
||||||
@@ -283,6 +234,11 @@ bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *N
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cIptvDevice::ProvidesEIT(void) const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int cIptvDevice::NumProvidedSystems(void) const
|
int cIptvDevice::NumProvidedSystems(void) const
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
@@ -290,23 +246,42 @@ int cIptvDevice::NumProvidedSystems(void) const
|
|||||||
|
|
||||||
bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
|
bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
|
||||||
{
|
{
|
||||||
int parameter, sidscan, pidscan;
|
|
||||||
cString location;
|
|
||||||
cIptvProtocolIf *protocol;
|
cIptvProtocolIf *protocol;
|
||||||
|
cIptvTransponderParameters itp(Channel->Parameters());
|
||||||
|
|
||||||
debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex);
|
debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex);
|
||||||
location = GetChannelSettings(Channel->PluginParam(), ¶meter, &sidscan, &pidscan, &protocol);
|
|
||||||
if (isempty(location)) {
|
if (isempty(itp.Address())) {
|
||||||
error("ERROR: Unrecognized IPTV channel settings: %s", Channel->PluginParam());
|
error("Unrecognized IPTV address: %s", Channel->Parameters());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sidScanEnabled = sidscan ? true : false;
|
switch (itp.Protocol()) {
|
||||||
pidScanEnabled = pidscan ? true : false;
|
case cIptvTransponderParameters::eProtocolUDP:
|
||||||
pIptvStreamer->Set(location, parameter, deviceIndex, protocol);
|
protocol = pUdpProtocol;
|
||||||
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
break;
|
||||||
pSidScanner->SetChannel(Channel);
|
case cIptvTransponderParameters::eProtocolHTTP:
|
||||||
if (pidScanEnabled && pPidScanner)
|
protocol = pHttpProtocol;
|
||||||
pPidScanner->SetChannel(Channel);
|
break;
|
||||||
|
case cIptvTransponderParameters::eProtocolFILE:
|
||||||
|
protocol = pFileProtocol;
|
||||||
|
break;
|
||||||
|
case cIptvTransponderParameters::eProtocolEXT:
|
||||||
|
protocol = pExtProtocol;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
error("Unrecognized IPTV protocol: %s", Channel->Parameters());
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sidScanEnabled = itp.SidScan() ? true : false;
|
||||||
|
pidScanEnabled = itp.PidScan() ? true : false;
|
||||||
|
if (pIptvStreamer->Set(itp.Address(), itp.Parameter(), deviceIndex, protocol)) {
|
||||||
|
channelId = Channel->GetChannelID();
|
||||||
|
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||||
|
pSidScanner->SetChannel(channelId);
|
||||||
|
if (pidScanEnabled && pPidScanner)
|
||||||
|
pPidScanner->SetChannel(channelId);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,7 +303,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
|
||||||
@@ -353,11 +328,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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,6 +344,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);
|
||||||
@@ -379,14 +359,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)
|
||||||
|
pIptvStreamer->Open();
|
||||||
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||||
pSidScanner->SetStatus(true);
|
pSidScanner->Open();
|
||||||
isOpenDvr = true;
|
isOpenDvr = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -394,8 +373,8 @@ 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 (pidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||||
pSidScanner->SetStatus(false);
|
pSidScanner->Close();
|
||||||
if (pIptvStreamer)
|
if (pIptvStreamer)
|
||||||
pIptvStreamer->Close();
|
pIptvStreamer->Close();
|
||||||
isOpenDvr = false;
|
isOpenDvr = false;
|
||||||
@@ -411,7 +390,7 @@ void cIptvDevice::ResetBuffering(void)
|
|||||||
{
|
{
|
||||||
debug("cIptvDevice::ResetBuffering(%d)\n", deviceIndex);
|
debug("cIptvDevice::ResetBuffering(%d)\n", deviceIndex);
|
||||||
// pad prefill to multiple of TS_SIZE
|
// pad prefill to multiple of TS_SIZE
|
||||||
tsBufferPrefill = MEGABYTE(IptvConfig.GetTsBufferSize()) *
|
tsBufferPrefill = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize()) *
|
||||||
IptvConfig.GetTsBufferPrefillRatio() / 100;
|
IptvConfig.GetTsBufferPrefillRatio() / 100;
|
||||||
tsBufferPrefill -= (tsBufferPrefill % TS_SIZE);
|
tsBufferPrefill -= (tsBufferPrefill % TS_SIZE);
|
||||||
}
|
}
|
||||||
@@ -428,15 +407,15 @@ bool cIptvDevice::IsBuffering(void)
|
|||||||
|
|
||||||
bool cIptvDevice::GetTSPacket(uchar *&Data)
|
bool cIptvDevice::GetTSPacket(uchar *&Data)
|
||||||
{
|
{
|
||||||
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
|
||||||
AddBufferStatistic(TS_SIZE, tsBuffer->Available());
|
AddBufferStatistic(TS_SIZE, tsBuffer->Available());
|
||||||
}
|
}
|
||||||
|
int Count = 0;
|
||||||
uchar *p = tsBuffer->Get(Count);
|
uchar *p = tsBuffer->Get(Count);
|
||||||
if (p && Count >= TS_SIZE) {
|
if (p && Count >= TS_SIZE) {
|
||||||
if (*p != TS_SYNC_BYTE) {
|
if (*p != TS_SYNC_BYTE) {
|
||||||
@@ -447,29 +426,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
|
||||||
AddPidStatistic(ts_pid(p), payload(p));
|
AddPidStatistic(ts_pid(p), payload(p));
|
||||||
// Send data also to dvr fifo
|
// Send data also to dvr fifo
|
||||||
if (dvrFd >= 0)
|
if (dvrFd >= 0)
|
||||||
write(dvrFd, p, TS_SIZE);
|
Count = (int)write(dvrFd, p, TS_SIZE);
|
||||||
// Analyze incomplete streams with built-in pid analyzer
|
// Analyze incomplete streams with built-in pid analyzer
|
||||||
if (pidScanEnabled && pPidScanner)
|
if (pidScanEnabled && pPidScanner)
|
||||||
pPidScanner->Process(p);
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
15
device.h
15
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.39 2008/02/17 19:18:47 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_DEVICE_H
|
#ifndef __IPTV_DEVICE_H
|
||||||
@@ -42,6 +41,7 @@ private:
|
|||||||
bool pidScanEnabled;
|
bool pidScanEnabled;
|
||||||
cRingBufferLinear *tsBuffer;
|
cRingBufferLinear *tsBuffer;
|
||||||
int tsBufferPrefill;
|
int tsBufferPrefill;
|
||||||
|
tChannelID channelId;
|
||||||
cIptvProtocolUdp *pUdpProtocol;
|
cIptvProtocolUdp *pUdpProtocol;
|
||||||
cIptvProtocolHttp *pHttpProtocol;
|
cIptvProtocolHttp *pHttpProtocol;
|
||||||
cIptvProtocolFile *pFileProtocol;
|
cIptvProtocolFile *pFileProtocol;
|
||||||
@@ -50,7 +50,7 @@ private:
|
|||||||
cPidScanner *pPidScanner;
|
cPidScanner *pPidScanner;
|
||||||
cSidScanner *pSidScanner;
|
cSidScanner *pSidScanner;
|
||||||
cMutex mutex;
|
cMutex mutex;
|
||||||
cIptvSectionFilter* secfilters[eMaxSecFilterCount];
|
cIptvSectionFilter *secfilters[eMaxSecFilterCount];
|
||||||
|
|
||||||
// constructor & destructor
|
// constructor & destructor
|
||||||
public:
|
public:
|
||||||
@@ -70,18 +70,23 @@ private:
|
|||||||
|
|
||||||
// for channel parsing & buffering
|
// for channel parsing & buffering
|
||||||
private:
|
private:
|
||||||
cString GetChannelSettings(const char *IptvParam, int *Parameter, int *SidScan, int *PidScan, cIptvProtocolIf* *Protocol);
|
|
||||||
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 info
|
||||||
|
virtual cString DeviceType(void) const;
|
||||||
|
virtual cString DeviceName(void) const;
|
||||||
|
virtual int SignalStrength(void) const;
|
||||||
|
virtual int SignalQuality(void) 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 bool ProvidesEIT(void) const;
|
||||||
virtual int NumProvidedSystems(void) const;
|
virtual int NumProvidedSystems(void) const;
|
||||||
protected:
|
protected:
|
||||||
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
||||||
|
|||||||
28
iptv.c
28
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.38 2008/03/27 20:27:26 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@@ -12,16 +11,17 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
|
#include "iptvservice.h"
|
||||||
|
|
||||||
#ifndef PLUGINPARAMPATCHVERSNUM
|
#if defined(APIVERSNUM) && APIVERSNUM < 10727
|
||||||
#error "You must apply the pluginparam patch for VDR!"
|
#error "VDR-1.7.27 API version or greater is required!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(APIVERSNUM) && APIVERSNUM < 10600
|
#ifndef GITVERSION
|
||||||
#error "VDR-1.6.0 API version or greater is required!"
|
#define GITVERSION ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char VERSION[] = "0.2.0";
|
const char VERSION[] = "0.5.2" GITVERSION;
|
||||||
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
|
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
|
||||||
|
|
||||||
class cPluginIptv : public cPlugin {
|
class cPluginIptv : public cPlugin {
|
||||||
@@ -79,7 +79,7 @@ bool cPluginIptv::ProcessArgs(int argc, char *argv[])
|
|||||||
// 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, no_argument, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
@@ -201,8 +201,18 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
|
|||||||
|
|
||||||
bool cPluginIptv::Service(const char *Id, void *Data)
|
bool cPluginIptv::Service(const char *Id, void *Data)
|
||||||
{
|
{
|
||||||
//debug("cPluginIptv::Service()\n");
|
debug("cPluginIptv::Service()\n");
|
||||||
// Handle custom service requests from other plugins
|
if (strcmp(Id,"IptvService-v1.0") == 0) {
|
||||||
|
if (Data) {
|
||||||
|
IptvService_v1_0 *data = (IptvService_v1_0*)Data;
|
||||||
|
cIptvDevice *dev = cIptvDevice::GetIptvDevice(data->cardIndex);
|
||||||
|
if (!dev)
|
||||||
|
return false;
|
||||||
|
data->protocol = dev->GetInformation(IPTV_DEVICE_INFO_PROTOCOL);
|
||||||
|
data->bitrate = dev->GetInformation(IPTV_DEVICE_INFO_BITRATE);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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:S=0|P=0|F=EXT|U=png.sh|A=1:I:0:256:257:0:0:3:0:0:0
|
||||||
|
# Temperature;IPTV:60:S=0|P=0|EXT|U=png.sh|A=2:I:0:256:257:0:0:3:0:0:0
|
||||||
|
# Temperature Week;IPTV:70:S=0|P=0|EXT|U=png.sh|A=3:I:0:256:257:0:0:3:0:0:0
|
||||||
|
# Server Temperature;IPTV:80:S=0|P=0|EXT|U=png.sh|A=4:I:0:256:257:0:0:3:0:0:0
|
||||||
|
# Server Temperature Week;IPTV:90:S=0|P=0|EXT|U=png.sh|A=5:I:0:256:257:0:0:3:0:0:0
|
||||||
|
# Traffic;IPTV:100:S=0|P=0|EXT|U=png.sh|A=6:I: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:S=0|P=0|F=EXT|U=internetradio.sh|A=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,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# iptvstream.sh can be used by the VDR iptv plug-in to transcode external
|
# iptvstream.sh can be used by the VDR iptv plugin to transcode external
|
||||||
# sources
|
# sources
|
||||||
#
|
#
|
||||||
# (C) 2007 Rolf Ahrenberg, Antti Sepp<EFBFBD>l<EFBFBD>
|
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
|
||||||
#
|
#
|
||||||
# iptvstream.sh is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
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
|
||||||
@@ -31,30 +31,44 @@ 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
|
||||||
|
FPS=25
|
||||||
|
;;
|
||||||
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
|
||||||
|
if [ -n "${FPS}" ] ; then
|
||||||
|
TRANSCODE_OPTS="${TRANSCODE_OPTS},fps=${FPS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create unique pids for the stream
|
# Create unique pids for the stream
|
||||||
@@ -63,7 +77,7 @@ let APID=${PARAMETER}+2
|
|||||||
let SPID=${PARAMETER}+3
|
let SPID=${PARAMETER}+3
|
||||||
|
|
||||||
# Capture VLC pid for further management in IPTV plugin
|
# Capture VLC pid for further management in IPTV plugin
|
||||||
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=${!}
|
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:S=0|P=0|F=EXT|U=linein.sh|A=0:I: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
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# vlc2iptv is used by the VDR iptv plug-in to transcode external sources
|
# vlc2iptv is used by the VDR iptv plugin to transcode external sources
|
||||||
#
|
#
|
||||||
# (C) 2007 Rolf Ahrenberg, Antti Sepp<EFBFBD>l<EFBFBD>
|
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
|
||||||
# (C) 2007 Tobias Grimm
|
# (C) 2007 Tobias Grimm
|
||||||
#
|
#
|
||||||
# vlc2iptv is free software; you can redistribute it and/or modify
|
# vlc2iptv is free software; you can redistribute it and/or modify
|
||||||
@@ -37,7 +37,7 @@ AUDIO_BITRATE=320
|
|||||||
exit_with_error()
|
exit_with_error()
|
||||||
{
|
{
|
||||||
logger "vlc2iptv: error: $*"
|
logger "vlc2iptv: error: $*"
|
||||||
exit 1;
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
read_arguments()
|
read_arguments()
|
||||||
@@ -52,7 +52,7 @@ lookup_channel_and_pids()
|
|||||||
[ ! -e "$CHANNELS_CONF" ] && \
|
[ ! -e "$CHANNELS_CONF" ] && \
|
||||||
exit_with_error "channels.conf not found ($CHANNELS_CONF)"
|
exit_with_error "channels.conf not found ($CHANNELS_CONF)"
|
||||||
|
|
||||||
local CHANNEL_RECORD=`grep ":IPTV|EXT|vlc2iptv|$PARAMETER:" $CHANNELS_CONF`
|
local CHANNEL_RECORD=`grep "[:]S=[10][|]P=[10][|]F=EXT[|]U=vlc2iptv[|]A=$PARAMETER[:]I" $CHANNELS_CONF`
|
||||||
[ -z "$CHANNEL_RECORD" ] && \
|
[ -z "$CHANNEL_RECORD" ] && \
|
||||||
exit_with_error "no iptv channel with parameter $PARAMETER found"
|
exit_with_error "no iptv channel with parameter $PARAMETER found"
|
||||||
|
|
||||||
|
|||||||
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:S=0|P=0|F=EXT|U=webcam.sh|A=0:I: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
|
||||||
22
iptvservice.h
Normal file
22
iptvservice.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* iptvservice.h: IPTV plugin for the Video Disk Recorder
|
||||||
|
*
|
||||||
|
* See the README file for copyright information and how to reach the author.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __IPTVSERVICE_H
|
||||||
|
#define __IPTVSERVICE_H
|
||||||
|
|
||||||
|
#include <vdr/tools.h>
|
||||||
|
|
||||||
|
#define stIptv ('I' << 24)
|
||||||
|
|
||||||
|
struct IptvService_v1_0 {
|
||||||
|
unsigned int cardIndex;
|
||||||
|
cString protocol;
|
||||||
|
cString bitrate;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //__IPTVSERVICE_H
|
||||||
|
|
||||||
@@ -1,287 +0,0 @@
|
|||||||
diff -Nru vdr-1.6.0-vanilla/channels.c vdr-1.6.0-pluginparam/channels.c
|
|
||||||
--- vdr-1.6.0-vanilla/channels.c 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ vdr-1.6.0-pluginparam/channels.c 2008-03-27 22:06:47.000000000 +0200
|
|
||||||
@@ -166,6 +166,7 @@
|
|
||||||
shortName = strdup("");
|
|
||||||
provider = strdup("");
|
|
||||||
portalName = strdup("");
|
|
||||||
+ pluginParam = strdup("");
|
|
||||||
memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
|
|
||||||
inversion = INVERSION_AUTO;
|
|
||||||
bandwidth = BANDWIDTH_AUTO;
|
|
||||||
@@ -187,6 +188,7 @@
|
|
||||||
shortName = NULL;
|
|
||||||
provider = NULL;
|
|
||||||
portalName = NULL;
|
|
||||||
+ pluginParam = NULL;
|
|
||||||
schedule = NULL;
|
|
||||||
linkChannels = NULL;
|
|
||||||
refChannel = NULL;
|
|
||||||
@@ -215,6 +217,7 @@
|
|
||||||
free(shortName);
|
|
||||||
free(provider);
|
|
||||||
free(portalName);
|
|
||||||
+ free(pluginParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
cChannel& cChannel::operator= (const cChannel &Channel)
|
|
||||||
@@ -223,6 +226,7 @@
|
|
||||||
shortName = strcpyrealloc(shortName, Channel.shortName);
|
|
||||||
provider = strcpyrealloc(provider, Channel.provider);
|
|
||||||
portalName = strcpyrealloc(portalName, Channel.portalName);
|
|
||||||
+ pluginParam = strcpyrealloc(pluginParam, Channel.pluginParam);
|
|
||||||
memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
@@ -280,9 +284,26 @@
|
|
||||||
transmission = Channel->transmission;
|
|
||||||
guard = Channel->guard;
|
|
||||||
hierarchy = Channel->hierarchy;
|
|
||||||
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, Channel->pluginParam);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+bool cChannel::SetPlugTransponderData(int Source, int Frequency, const char *PluginParam)
|
|
||||||
+{
|
|
||||||
+ if (source != Source || frequency != Frequency || (strcmp(pluginParam, PluginParam) != 0)) {
|
|
||||||
+ 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);
|
|
||||||
+ modification |= CHANNELMOD_TRANSP;
|
|
||||||
+ Channels.SetModified();
|
|
||||||
+ }
|
|
||||||
+ source = Source;
|
|
||||||
+ frequency = Frequency;
|
|
||||||
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
|
|
||||||
+ schedule = NULL;
|
|
||||||
+ }
|
|
||||||
+ return true;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH)
|
|
||||||
{
|
|
||||||
// Workarounds for broadcaster stupidity:
|
|
||||||
@@ -407,6 +428,18 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+void cChannel::SetPluginParam(const char *PluginParam)
|
|
||||||
+{
|
|
||||||
+ if (!isempty(PluginParam) && strcmp(pluginParam, PluginParam) != 0) {
|
|
||||||
+ if (Number()) {
|
|
||||||
+ dsyslog("changing plugin parameters of channel %d from '%s' to '%s'", Number(), pluginParam, PluginParam);
|
|
||||||
+ modification |= CHANNELMOD_TRANSP;
|
|
||||||
+ Channels.SetModified();
|
|
||||||
+ }
|
|
||||||
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#define STRDIFF 0x01
|
|
||||||
#define VALDIFF 0x02
|
|
||||||
|
|
||||||
@@ -593,7 +626,7 @@
|
|
||||||
if (isdigit(type))
|
|
||||||
type = 'S';
|
|
||||||
#define ST(s) if (strchr(s, type))
|
|
||||||
- char buffer[64];
|
|
||||||
+ char buffer[256];
|
|
||||||
char *q = buffer;
|
|
||||||
*q = 0;
|
|
||||||
ST(" S ") q += sprintf(q, "%c", polarization);
|
|
||||||
@@ -605,6 +638,7 @@
|
|
||||||
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("P ") snprintf(buffer, sizeof(buffer), "%s", pluginParam);
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -626,7 +660,7 @@
|
|
||||||
|
|
||||||
bool cChannel::StringToParameters(const char *s)
|
|
||||||
{
|
|
||||||
- while (s && *s) {
|
|
||||||
+ while (s && *s && !IsPlug()) {
|
|
||||||
switch (toupper(*s)) {
|
|
||||||
case 'B': s = ParseParameter(s, bandwidth, BandwidthValues); break;
|
|
||||||
case 'C': s = ParseParameter(s, coderateH, CoderateValues); break;
|
|
||||||
@@ -736,7 +770,7 @@
|
|
||||||
dpids[0] = 0;
|
|
||||||
ok = false;
|
|
||||||
if (parambuf && sourcebuf && vpidbuf && apidbuf) {
|
|
||||||
- ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0;
|
|
||||||
+ ok = ((source = cSource::FromString(sourcebuf)) >= 0) && StringToParameters(parambuf);
|
|
||||||
|
|
||||||
char *p = strchr(vpidbuf, '+');
|
|
||||||
if (p)
|
|
||||||
@@ -827,6 +861,7 @@
|
|
||||||
shortName = strcpyrealloc(shortName, p);
|
|
||||||
}
|
|
||||||
name = strcpyrealloc(name, namebuf);
|
|
||||||
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, parambuf);
|
|
||||||
|
|
||||||
free(parambuf);
|
|
||||||
free(sourcebuf);
|
|
||||||
diff -Nru vdr-1.6.0-vanilla/channels.h vdr-1.6.0-pluginparam/channels.h
|
|
||||||
--- vdr-1.6.0-vanilla/channels.h 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ vdr-1.6.0-pluginparam/channels.h 2008-03-27 22:06:47.000000000 +0200
|
|
||||||
@@ -114,6 +114,7 @@
|
|
||||||
char *shortName;
|
|
||||||
char *provider;
|
|
||||||
char *portalName;
|
|
||||||
+ char *pluginParam;
|
|
||||||
int __BeginData__;
|
|
||||||
int frequency; // MHz
|
|
||||||
int source;
|
|
||||||
@@ -165,6 +166,7 @@
|
|
||||||
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
|
|
||||||
static int Transponder(int Frequency, char Polarization); ///< builds the transponder from the given Frequency and Polarization
|
|
||||||
+ const char *PluginParam(void) const { return pluginParam; }
|
|
||||||
int Source(void) const { return source; }
|
|
||||||
int Srate(void) const { return srate; }
|
|
||||||
int Vpid(void) const { return vpid; }
|
|
||||||
@@ -199,6 +201,7 @@
|
|
||||||
int Hierarchy(void) const { return hierarchy; }
|
|
||||||
const cLinkChannels* LinkChannels(void) const { return linkChannels; }
|
|
||||||
const cChannel *RefChannel(void) const { return refChannel; }
|
|
||||||
+ bool IsPlug(void) const { return cSource::IsPlug(source); }
|
|
||||||
bool IsCable(void) const { return cSource::IsCable(source); }
|
|
||||||
bool IsSat(void) const { return cSource::IsSat(source); }
|
|
||||||
bool IsTerr(void) const { return cSource::IsTerr(source); }
|
|
||||||
@@ -206,12 +209,14 @@
|
|
||||||
bool HasTimer(void) const;
|
|
||||||
int Modification(int Mask = CHANNELMOD_ALL);
|
|
||||||
void CopyTransponderData(const cChannel *Channel);
|
|
||||||
+ bool SetPlugTransponderData(int Source, int Frequency, const char *PluginParam);
|
|
||||||
bool SetSatTransponderData(int Source, int Frequency, char Polarization, 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);
|
|
||||||
void SetId(int Nid, int Tid, int Sid, int Rid = 0);
|
|
||||||
void SetName(const char *Name, const char *ShortName, const char *Provider);
|
|
||||||
void SetPortalName(const char *PortalName);
|
|
||||||
+ void SetPluginParam(const char *PluginParam);
|
|
||||||
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 SetCaDescriptors(int Level);
|
|
||||||
diff -Nru vdr-1.6.0-vanilla/config.h vdr-1.6.0-pluginparam/config.h
|
|
||||||
--- vdr-1.6.0-vanilla/config.h 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ vdr-1.6.0-pluginparam/config.h 2008-03-27 22:06:47.000000000 +0200
|
|
||||||
@@ -30,6 +30,8 @@
|
|
||||||
#define APIVERSION "1.6.0"
|
|
||||||
#define APIVERSNUM 10600 // Version * 10000 + Major * 100 + Minor
|
|
||||||
|
|
||||||
+#define PLUGINPARAMPATCHVERSNUM 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.6.0-vanilla/menu.c vdr-1.6.0-pluginparam/menu.c
|
|
||||||
--- vdr-1.6.0-vanilla/menu.c 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ vdr-1.6.0-pluginparam/menu.c 2008-03-27 22:06:47.000000000 +0200
|
|
||||||
@@ -253,6 +253,7 @@
|
|
||||||
cChannel *channel;
|
|
||||||
cChannel data;
|
|
||||||
char name[256];
|
|
||||||
+ char pluginParam[256];
|
|
||||||
void Setup(void);
|
|
||||||
public:
|
|
||||||
cMenuEditChannel(cChannel *Channel, bool New = false);
|
|
||||||
@@ -285,6 +286,7 @@
|
|
||||||
|
|
||||||
// Parameters for all types of sources:
|
|
||||||
strn0cpy(name, data.name, sizeof(name));
|
|
||||||
+ strn0cpy(pluginParam, data.pluginParam, sizeof(pluginParam));
|
|
||||||
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name)));
|
|
||||||
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
|
|
||||||
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
|
|
||||||
@@ -315,6 +317,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("Hierarchy"), &data.hierarchy, HierarchyValues, tr("none")));
|
|
||||||
+ ST("P ") Add(new cMenuEditStrItem( tr("Parameters"), pluginParam, sizeof(pluginParam), tr(FileNameChars)));
|
|
||||||
|
|
||||||
SetCurrent(Get(current));
|
|
||||||
Display();
|
|
||||||
@@ -329,6 +332,7 @@
|
|
||||||
if (Key == kOk) {
|
|
||||||
if (Channels.HasUniqueChannelID(&data, channel)) {
|
|
||||||
data.name = strcpyrealloc(data.name, name);
|
|
||||||
+ data.pluginParam = strcpyrealloc(data.pluginParam, pluginParam);
|
|
||||||
if (channel) {
|
|
||||||
*channel = data;
|
|
||||||
isyslog("edited channel %d %s", channel->Number(), *data.ToText());
|
|
||||||
diff -Nru vdr-1.6.0-vanilla/po/fi_FI.po vdr-1.6.0-pluginparam/po/fi_FI.po
|
|
||||||
--- vdr-1.6.0-vanilla/po/fi_FI.po 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ vdr-1.6.0-pluginparam/po/fi_FI.po 2008-03-27 22:06:47.000000000 +0200
|
|
||||||
@@ -1001,3 +1001,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.6.0-vanilla/po/fr_FR.po vdr-1.6.0-pluginparam/po/fr_FR.po
|
|
||||||
--- vdr-1.6.0-vanilla/po/fr_FR.po 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ 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<72>tera dans %s minutes"
|
|
||||||
+
|
|
||||||
+msgid "Parameters"
|
|
||||||
+msgstr "Param<61>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 @@
|
|
||||||
char buffer[16];
|
|
||||||
char *q = buffer;
|
|
||||||
switch (Code & st_Mask) {
|
|
||||||
+ case stPlug: *q++ = 'P'; break;
|
|
||||||
case stCable: *q++ = 'C'; break;
|
|
||||||
case stSat: *q++ = 'S';
|
|
||||||
{
|
|
||||||
@@ -56,6 +57,7 @@
|
|
||||||
{
|
|
||||||
int type = stNone;
|
|
||||||
switch (toupper(*s)) {
|
|
||||||
+ case 'P': type = stPlug; break;
|
|
||||||
case 'C': type = stCable; break;
|
|
||||||
case 'S': type = stSat; break;
|
|
||||||
case 'T': type = stTerr; break;
|
|
||||||
diff -Nru vdr-1.6.0-vanilla/sources.conf vdr-1.6.0-pluginparam/sources.conf
|
|
||||||
--- vdr-1.6.0-vanilla/sources.conf 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ vdr-1.6.0-pluginparam/sources.conf 2008-03-27 22:06:47.000000000 +0200
|
|
||||||
@@ -188,3 +188,7 @@
|
|
||||||
# Terrestrial
|
|
||||||
|
|
||||||
T Terrestrial
|
|
||||||
+
|
|
||||||
+# Plugin
|
|
||||||
+
|
|
||||||
+P Plugin
|
|
||||||
diff -Nru vdr-1.6.0-vanilla/sources.h vdr-1.6.0-pluginparam/sources.h
|
|
||||||
--- vdr-1.6.0-vanilla/sources.h 2008-03-27 21:43:25.000000000 +0200
|
|
||||||
+++ vdr-1.6.0-pluginparam/sources.h 2008-03-27 22:06:47.000000000 +0200
|
|
||||||
@@ -16,10 +16,11 @@
|
|
||||||
public:
|
|
||||||
enum eSourceType {
|
|
||||||
stNone = 0x0000,
|
|
||||||
+ stPlug = 0x2000,
|
|
||||||
stCable = 0x4000,
|
|
||||||
stSat = 0x8000,
|
|
||||||
stTerr = 0xC000,
|
|
||||||
- st_Mask = 0xC000,
|
|
||||||
+ st_Mask = 0xE000,
|
|
||||||
st_Neg = 0x0800,
|
|
||||||
st_Pos = 0x07FF,
|
|
||||||
};
|
|
||||||
@@ -35,6 +36,7 @@
|
|
||||||
static cString ToString(int Code);
|
|
||||||
static int FromString(const char *s);
|
|
||||||
static int FromData(eSourceType SourceType, int Position = 0, bool East = false);
|
|
||||||
+ static bool IsPlug(int Code) { return (Code & st_Mask) == stPlug; }
|
|
||||||
static bool IsCable(int Code) { return (Code & st_Mask) == stCable; }
|
|
||||||
static bool IsSat(int Code) { return (Code & st_Mask) == stSat; }
|
|
||||||
static bool IsTerr(int Code) { return (Code & st_Mask) == stTerr; }
|
|
||||||
11
patches/vdr-1.7.27-disable_ca_updates.patch
Normal file
11
patches/vdr-1.7.27-disable_ca_updates.patch
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
diff -Nru vdr-1.7.27-vanilla/pat.c vdr-1.7.27-disable_ca_updates/pat.c
|
||||||
|
--- vdr-1.7.27-vanilla/pat.c 2012-03-25 15:17:57.000000000 +0300
|
||||||
|
+++ vdr-1.7.27-disable_ca_updates/pat.c 2012-03-31 20:42:14.000000000 +0300
|
||||||
|
@@ -537,6 +537,7 @@
|
||||||
|
}
|
||||||
|
if (Setup.UpdateChannels >= 2) {
|
||||||
|
Channel->SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
|
||||||
|
+ if (!cSource::IsType(Channel->Source(), 'I'))
|
||||||
|
Channel->SetCaIds(CaDescriptors->CaIds());
|
||||||
|
Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds);
|
||||||
|
}
|
||||||
99
pidscanner.c
99
pidscanner.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: pidscanner.c,v 1.6 2008/02/02 21:06:14 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
@@ -11,11 +10,12 @@
|
|||||||
|
|
||||||
#define PIDSCANNER_TIMEOUT_IN_MS 15000 /* 15s timeout for detection */
|
#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_APID_COUNT 5 /* minimum count of audio pid samples for pid detection */
|
||||||
#define PIDSCANNER_VPID_COUNT 10 /* minimum count of video pid samples for pid detection */
|
#define PIDSCANNER_VPID_COUNT 5 /* minimum count of video pid samples for pid detection */
|
||||||
#define PIDSCANNER_PID_DELTA_COUNT 50 /* minimum count of pid samples for audio/video only pid detection */
|
#define PIDSCANNER_PID_DELTA_COUNT 100 /* minimum count of pid samples for audio/video only pid detection */
|
||||||
|
|
||||||
cPidScanner::cPidScanner(void)
|
cPidScanner::cPidScanner(void)
|
||||||
: timeout(0),
|
: timeout(0),
|
||||||
|
channelId(tChannelID::InvalidID),
|
||||||
process(true),
|
process(true),
|
||||||
Vpid(0xFFFF),
|
Vpid(0xFFFF),
|
||||||
Apid(0xFFFF),
|
Apid(0xFFFF),
|
||||||
@@ -23,24 +23,17 @@ cPidScanner::cPidScanner(void)
|
|||||||
numApids(0)
|
numApids(0)
|
||||||
{
|
{
|
||||||
debug("cPidScanner::cPidScanner()\n");
|
debug("cPidScanner::cPidScanner()\n");
|
||||||
channel = cChannel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cPidScanner::~cPidScanner()
|
cPidScanner::~cPidScanner()
|
||||||
{
|
{
|
||||||
debug("cPidScanner::~cPidScanner()\n");
|
debug("cPidScanner::~cPidScanner()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPidScanner::SetChannel(const cChannel *Channel)
|
void cPidScanner::SetChannel(const tChannelID &ChannelId)
|
||||||
{
|
{
|
||||||
if (Channel) {
|
debug("cPidScanner::SetChannel(): %s\n", *ChannelId.ToString());
|
||||||
debug("cPidScanner::SetChannel(): %s\n", Channel->PluginParam());
|
channelId = ChannelId;
|
||||||
channel = *Channel;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
debug("cPidScanner::SetChannel()\n");
|
|
||||||
channel = cChannel();
|
|
||||||
}
|
|
||||||
Vpid = 0xFFFF;
|
Vpid = 0xFFFF;
|
||||||
numVpids = 0;
|
numVpids = 0;
|
||||||
Apid = 0xFFFF;
|
Apid = 0xFFFF;
|
||||||
@@ -92,61 +85,71 @@ void cPidScanner::Process(const uint8_t* buf)
|
|||||||
// Stream ID
|
// Stream ID
|
||||||
if ((sid >= 0xC0) && (sid <= 0xDF)) {
|
if ((sid >= 0xC0) && (sid <= 0xDF)) {
|
||||||
if (pid < Apid) {
|
if (pid < Apid) {
|
||||||
debug("Found lower Apid: 0x%X instead of 0x%X\n", pid, Apid);
|
debug("cPidScanner::Process: Found lower Apid: 0x%X instead of 0x%X\n", pid, Apid);
|
||||||
Apid = pid;
|
Apid = pid;
|
||||||
numApids = 1;
|
numApids = 1;
|
||||||
}
|
}
|
||||||
else if (pid == Apid) {
|
else if (pid == Apid) {
|
||||||
++numApids;
|
++numApids;
|
||||||
debug("Incrementing Apids, now at %d\n", numApids);
|
debug("cPidScanner::Process: Incrementing Apids, now at %d\n", numApids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((sid >= 0xE0) && (sid <= 0xEF)) {
|
else if ((sid >= 0xE0) && (sid <= 0xEF)) {
|
||||||
if (pid < Vpid) {
|
if (pid < Vpid) {
|
||||||
debug("Found lower Vpid: 0x%X instead of 0x%X\n", pid, Vpid);
|
debug("cPidScanner::Process: Found lower Vpid: 0x%X instead of 0x%X\n", pid, Vpid);
|
||||||
Vpid = pid;
|
Vpid = pid;
|
||||||
numVpids = 1;
|
numVpids = 1;
|
||||||
}
|
}
|
||||||
else if (pid == Vpid) {
|
else if (pid == Vpid) {
|
||||||
++numVpids;
|
++numVpids;
|
||||||
debug("Incrementing Vpids, now at %d\n", numVpids);
|
debug("cPidScanner::Process: Incrementing Vpids, now at %d\n", numVpids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (((numVpids > PIDSCANNER_VPID_COUNT) && (numApids > PIDSCANNER_APID_COUNT)) ||
|
if (((numVpids >= PIDSCANNER_VPID_COUNT) && (numApids >= PIDSCANNER_APID_COUNT)) ||
|
||||||
(abs(numApids - numVpids) > PIDSCANNER_PID_DELTA_COUNT)) {
|
(abs(numApids - numVpids) >= PIDSCANNER_PID_DELTA_COUNT)) {
|
||||||
// Lock channels for pid updates
|
// Lock channels for pid updates
|
||||||
if (!Channels.Lock(true, 10)) {
|
if (!Channels.Lock(true, 10)) {
|
||||||
timeout.Set(PIDSCANNER_TIMEOUT_IN_MS);
|
timeout.Set(PIDSCANNER_TIMEOUT_IN_MS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
|
cChannel *IptvChannel = Channels.GetByChannelID(channelId);
|
||||||
int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated
|
if (IptvChannel) {
|
||||||
int Dpids[MAXDPIDS + 1] = { 0 };
|
int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated
|
||||||
int Spids[MAXSPIDS + 1] = { 0 };
|
int Atypes[MAXAPIDS + 1] = { 0 };
|
||||||
char ALangs[MAXAPIDS][MAXLANGCODE2] = { "" };
|
int Dpids[MAXDPIDS + 1] = { 0 };
|
||||||
char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" };
|
int Dtypes[MAXDPIDS + 1] = { 0 };
|
||||||
char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" };
|
int Spids[MAXSPIDS + 1] = { 0 };
|
||||||
int Ppid = IptvChannel->Ppid();
|
char ALangs[MAXAPIDS][MAXLANGCODE2] = { "" };
|
||||||
int Tpid = IptvChannel->Tpid();
|
char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" };
|
||||||
bool foundApid = false;
|
char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" };
|
||||||
if (numVpids <= PIDSCANNER_VPID_COUNT)
|
int Vtype = IptvChannel->Vtype();
|
||||||
Vpid = 0; // No detected video pid
|
int Ppid = IptvChannel->Ppid();
|
||||||
else if (numApids <= PIDSCANNER_APID_COUNT)
|
int Tpid = IptvChannel->Tpid();
|
||||||
Apid = 0; // No detected audio pid
|
bool foundApid = false;
|
||||||
for (unsigned int i = 1; i < MAXAPIDS; ++i) {
|
if (numVpids < PIDSCANNER_VPID_COUNT)
|
||||||
Apids[i] = IptvChannel->Apid(i);
|
Vpid = 0; // No detected video pid
|
||||||
if (Apids[i] && (Apids[i] == Apid))
|
else if (numApids < PIDSCANNER_APID_COUNT)
|
||||||
foundApid = true;
|
Apid = 0; // No detected audio pid
|
||||||
}
|
for (unsigned int i = 0; i < MAXAPIDS; ++i) {
|
||||||
if (!foundApid)
|
Apids[i] = IptvChannel->Apid(i);
|
||||||
Apids[0] = Apid;
|
Atypes[i] = IptvChannel->Atype(i);
|
||||||
for (unsigned int i = 0; i < MAXDPIDS; ++i)
|
if (Apids[i] && (Apids[i] == Apid))
|
||||||
Dpids[i] = IptvChannel->Dpid(i);
|
foundApid = true;
|
||||||
for (unsigned int i = 0; i < MAXSPIDS; ++i)
|
}
|
||||||
Spids[i] = IptvChannel->Spid(i);
|
if (!foundApid) {
|
||||||
debug("cPidScanner::Process(): Vpid=0x%04X, Apid=0x%04X\n", Vpid, Apid);
|
Apids[0] = Apid;
|
||||||
IptvChannel->SetPids(Vpid, Ppid, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
|
Atypes[0] = 4;
|
||||||
|
}
|
||||||
|
for (unsigned int i = 0; i < MAXDPIDS; ++i) {
|
||||||
|
Dpids[i] = IptvChannel->Dpid(i);
|
||||||
|
Dtypes[i] = IptvChannel->Dtype(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);
|
||||||
|
IptvChannel->SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
|
||||||
|
}
|
||||||
Channels.Unlock();
|
Channels.Unlock();
|
||||||
process = false;
|
process = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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: pidscanner.h,v 1.3 2008/02/02 20:51:47 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __PIDSCANNER_H
|
#ifndef __PIDSCANNER_H
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
class cPidScanner {
|
class cPidScanner {
|
||||||
private:
|
private:
|
||||||
cTimeMs timeout;
|
cTimeMs timeout;
|
||||||
cChannel channel;
|
tChannelID channelId;
|
||||||
bool process;
|
bool process;
|
||||||
int Vpid;
|
int Vpid;
|
||||||
int Apid;
|
int Apid;
|
||||||
@@ -25,7 +24,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
cPidScanner(void);
|
cPidScanner(void);
|
||||||
~cPidScanner();
|
~cPidScanner();
|
||||||
void SetChannel(const cChannel *Channel);
|
void SetChannel(const tChannelID &ChannelId);
|
||||||
void Process(const uint8_t* buf);
|
void Process(const uint8_t* buf);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
98
po/de_DE.po
98
po/de_DE.po
@@ -5,12 +5,13 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: iptv 0.2.0\n"
|
"Project-Id-Version: vdr-iptv 0.5.2\n"
|
||||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2008-02-01 23:43+0200\n"
|
"POT-Creation-Date: 2012-02-02 02:02+0300\n"
|
||||||
"PO-Revision-Date: 2007-10-29 21:19+0100\n"
|
"PO-Revision-Date: 2012-02-02 02:02+0300\n"
|
||||||
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
|
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
|
||||||
"Language-Team: German\n"
|
"Language-Team: German <vdr@linuxtv.org>\n"
|
||||||
|
"Language: de\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=utf-8\n"
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
@@ -40,57 +41,6 @@ msgstr "TDT (0x70)"
|
|||||||
msgid "Experience the IPTV"
|
msgid "Experience the IPTV"
|
||||||
msgstr "Erlebe 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 "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"
|
msgid "IPTV Information"
|
||||||
msgstr "IPTV Informationen"
|
msgstr "IPTV Informationen"
|
||||||
|
|
||||||
@@ -164,3 +114,39 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr "Hilfe"
|
msgstr "Hilfe"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "DATEI"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Scan section ids"
|
||||||
|
msgstr "Scanne Section IDS"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Scanne PIDS"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protokoll"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Adresse"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Parameter"
|
||||||
|
|||||||
132
po/fi_FI.po
132
po/fi_FI.po
@@ -5,14 +5,15 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: iptv 0.2.0\n"
|
"Project-Id-Version: vdr-iptv 0.5.2\n"
|
||||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2008-02-01 23:43+0200\n"
|
"POT-Creation-Date: 2012-02-02 02:02+0300\n"
|
||||||
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
|
"PO-Revision-Date: 2012-02-02 02:02+0300\n"
|
||||||
"Last-Translator: Rolf Ahrenberg\n"
|
"Last-Translator: Rolf Ahrenberg\n"
|
||||||
"Language-Team: <vdr@linuxtv.org>\n"
|
"Language-Team: Finnish <vdr@linuxtv.org>\n"
|
||||||
|
"Language: fi\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)"
|
||||||
@@ -39,57 +40,6 @@ msgstr "TDT (0x70)"
|
|||||||
msgid "Experience the IPTV"
|
msgid "Experience the IPTV"
|
||||||
msgstr "Koe IPTV:n ihmeellinen maailma"
|
msgstr "Koe IPTV:n ihmeellinen maailma"
|
||||||
|
|
||||||
msgid "UDP"
|
|
||||||
msgstr "UDP"
|
|
||||||
|
|
||||||
msgid "HTTP"
|
|
||||||
msgstr "HTTP"
|
|
||||||
|
|
||||||
msgid "FILE"
|
|
||||||
msgstr "FILE"
|
|
||||||
|
|
||||||
msgid "EXT"
|
|
||||||
msgstr "EXT"
|
|
||||||
|
|
||||||
msgid "Protocol"
|
|
||||||
msgstr "Protokolla"
|
|
||||||
|
|
||||||
msgid "Delay (ms)"
|
|
||||||
msgstr "Viive (ms)"
|
|
||||||
|
|
||||||
msgid "Script"
|
|
||||||
msgstr "Skripti"
|
|
||||||
|
|
||||||
msgid "Parameter"
|
|
||||||
msgstr "Parametri"
|
|
||||||
|
|
||||||
msgid "Address"
|
|
||||||
msgstr "Osoite"
|
|
||||||
|
|
||||||
msgid "Port"
|
|
||||||
msgstr "Portti"
|
|
||||||
|
|
||||||
msgid "Scan Sid"
|
|
||||||
msgstr "Etsi palvelu-ID"
|
|
||||||
|
|
||||||
msgid "Scan pids"
|
|
||||||
msgstr "Etsi pidit"
|
|
||||||
|
|
||||||
msgid "Nid"
|
|
||||||
msgstr "Verkko-ID"
|
|
||||||
|
|
||||||
msgid "Tid"
|
|
||||||
msgstr "L<>hete-ID"
|
|
||||||
|
|
||||||
msgid "Rid"
|
|
||||||
msgstr "Radio-ID"
|
|
||||||
|
|
||||||
msgid "Cannot find unique channel settings!"
|
|
||||||
msgstr "Yksil<69>llisi<73> kanava-asetuksia ei l<>ydet<65>!"
|
|
||||||
|
|
||||||
msgid "IPTV Channels"
|
|
||||||
msgstr "IPTV-kanavat"
|
|
||||||
|
|
||||||
msgid "IPTV Information"
|
msgid "IPTV Information"
|
||||||
msgstr "IPTV-tiedot"
|
msgstr "IPTV-tiedot"
|
||||||
|
|
||||||
@@ -116,21 +66,21 @@ msgid ""
|
|||||||
"\n"
|
"\n"
|
||||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"M<EFBFBD><EFBFBD>rit<EFBFBD> rengaspuskurin koko TS-l<EFBFBD>hetteelle megatavuina.\n"
|
"Määritä rengaspuskurin koko TS-lähetteelle megatavuina.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Pienempi rengaspuskuri v<EFBFBD>hent<EFBFBD><EFBFBD> muistinkulutusta, mutta on virhealttiimpi puskurin ylivuodolle."
|
"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 ""
|
msgid ""
|
||||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"This is useful if streaming media over a slow or unreliable connection."
|
"This is useful if streaming media over a slow or unreliable connection."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"M<EFBFBD><EFBFBD>rittele TS-rengaspuskurin esit<EFBFBD>ytt<EFBFBD>aste, jonka j<EFBFBD>lkeen l<EFBFBD>hetett<EFBFBD> aletaan siirt<EFBFBD>m<EFBFBD><EFBFBD>n eteenp<EFBFBD>in VDR:lle.\n"
|
"Määrittele TS-rengaspuskurin esitäyttöaste, jonka jälkeen lähetettä aletaan siirtämään eteenpäin VDR:lle.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Puskurin esit<EFBFBD>ytt<EFBFBD> parantaa suoratoistoa hitailla ja ep<EFBFBD>luotettavilla yhteyksill<EFBFBD>."
|
"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"
|
||||||
@@ -140,12 +90,12 @@ msgid ""
|
|||||||
"\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."
|
"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 ""
|
msgstr ""
|
||||||
"M<EFBFBD><EFBFBD>rittele EXT-protokollan k<EFBFBD>ytt<EFBFBD>m<EFBFBD> perusportti.\n"
|
"Määrittele EXT-protokollan käyttämä perusportti.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Porttiavaruuden koko m<EFBFBD><EFBFBD>r<EFBFBD>ytyy k<EFBFBD>ytettyjen IPTV-laitteiden mukaan. Laajennos lukee EXT-protokollan yhteydess<EFBFBD> perusportista dataa, jota ulkoiset ohjelmistot tarjoavat."
|
"Porttiavaruuden koko määräytyy käytettyjen IPTV-laitteiden mukaan. Laajennos lukee EXT-protokollan yhteydessä perusportista dataa, jota ulkoiset ohjelmistot tarjoavat."
|
||||||
|
|
||||||
msgid "Use section filtering"
|
msgid "Use section filtering"
|
||||||
msgstr "K<EFBFBD>yt<EFBFBD> sektioiden suodatusta"
|
msgstr "Käytä sektioiden suodatusta"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define whether the section filtering shall be used.\n"
|
"Define whether the section filtering shall be used.\n"
|
||||||
@@ -153,29 +103,65 @@ msgid ""
|
|||||||
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
|
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
|
||||||
"Enabling this feature does not affect streams that do not contain section data."
|
"Enabling this feature does not affect streams that do not contain section data."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"M<EFBFBD><EFBFBD>rittele suodatuksen k<EFBFBD>ytt<EFBFBD> sektioille.\n"
|
"Määrittele suodatuksen käyttö sektioille.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"IPTV-laajennos voi suodattaa l<EFBFBD>hetteest<EFBFBD> VDR:lle tarjottavia sektioita, joita k<EFBFBD>ytet<EFBFBD><EFBFBD>n esim. ohjelmaoppaan ja ohjelmatunnisteiden (PID) p<EFBFBD>ivitt<EFBFBD>miseen.\n"
|
"IPTV-laajennos voi suodattaa lähetteestä VDR:lle tarjottavia sektioita, joita käytetään esim. ohjelmaoppaan ja ohjelmatunnisteiden (PID) päivittämiseen.\n"
|
||||||
"Toiminto ei vaikuta l<EFBFBD>hetteeseen, jossa ei ole sektioita."
|
"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 ""
|
msgid ""
|
||||||
"Define number of section filters to be disabled.\n"
|
"Define number of section filters to be disabled.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"M<EFBFBD><EFBFBD>rittele k<EFBFBD>yt<EFBFBD>st<EFBFBD> poistettavien suodattimien lukum<EFBFBD><EFBFBD>r<EFBFBD> sektioille.\n"
|
"Määrittele käytöstä poistettavien suodattimien lukumäärä sektioille.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Tietyt sektiot saattavat aiheuttaa virheellist<EFBFBD> toimintaa VDR:ss<EFBFBD>, esimerkiksi asettavat v<EFBFBD><EFBFBD>r<EFBFBD>n kellonajan, ja n<EFBFBD>iden poistaminen auttaa VDR:<EFBFBD><EFBFBD> toimimaan kunnolla j<EFBFBD>ljelle j<EFBFBD><EFBFBD>vien sektioiden kanssa."
|
"Tietyt sektiot saattavat aiheuttaa virheellistä toimintaa VDR:ssä, esimerkiksi asettavat väärän kellonajan, ja näiden poistaminen auttaa VDR:ää toimimaan kunnolla jäljelle jäävien sektioiden kanssa."
|
||||||
|
|
||||||
#. TRANSLATORS: note the singular!
|
#. 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."
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
msgstr "M<EFBFBD><EFBFBD>rittele k<EFBFBD>yt<EFBFBD>st<EFBFBD> poistettava suodatin, joka lis<EFBFBD>t<EFBFBD><EFBFBD>n mustalle listalle."
|
msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle listalle."
|
||||||
|
|
||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr "Opaste"
|
msgstr "Opaste"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "FILE"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Verkko-ID"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Lähete-ID"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Radio-ID"
|
||||||
|
|
||||||
|
msgid "Scan section ids"
|
||||||
|
msgstr "Etsi sektiotunnisteet"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Etsi pidit"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protokolla"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Osoite"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Parametri"
|
||||||
|
|||||||
98
po/fr_FR.po
98
po/fr_FR.po
@@ -6,12 +6,13 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: iptv 0.2.0\n"
|
"Project-Id-Version: vdr-iptv 0.5.2\n"
|
||||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2008-02-01 23:43+0200\n"
|
"POT-Creation-Date: 2012-02-02 02:02+0300\n"
|
||||||
"PO-Revision-Date: 2008-01-26 13:14+0100\n"
|
"PO-Revision-Date: 2010-09-09 09:09+0300\n"
|
||||||
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
|
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
|
||||||
"Language-Team: French\n"
|
"Language-Team: French <vdr@linuxtv.org>\n"
|
||||||
|
"Language: fr\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=utf-8\n"
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
@@ -41,57 +42,6 @@ msgstr "TDT (0x70)"
|
|||||||
msgid "Experience the IPTV"
|
msgid "Experience the IPTV"
|
||||||
msgstr "L'expérience 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 "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"
|
msgid "IPTV Information"
|
||||||
msgstr "Information sur IPTV"
|
msgstr "Information sur IPTV"
|
||||||
|
|
||||||
@@ -181,3 +131,39 @@ msgstr "Définit les mauvais comportement qui doivent être désactivé."
|
|||||||
|
|
||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr "Aide"
|
msgstr "Aide"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "FICHIER"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Scan section ids"
|
||||||
|
msgstr "Scanne les section ID"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Scanne les PID"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protocole"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Adresse"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Paramètre"
|
||||||
|
|||||||
118
po/it_IT.po
118
po/it_IT.po
@@ -1,16 +1,17 @@
|
|||||||
# VDR plugin language source file.
|
# VDR plugin language source file.
|
||||||
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||||
# This file is distributed under the same license as the iptv package.
|
# This file is distributed under the same license as the iptv package.
|
||||||
# Gringo <vdr-italian@tiscali.it>, 2008.
|
# Diego Pierotto <vdr-italian@tiscali.it>, 2008.
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: iptv 0.2.0\n"
|
"Project-Id-Version: vdr-iptv 0.5.2\n"
|
||||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2008-02-01 23:43+0200\n"
|
"POT-Creation-Date: 2012-02-02 02:02+0300\n"
|
||||||
"PO-Revision-Date: 2008-02-22 02:08+0100\n"
|
"PO-Revision-Date: 2012-02-02 02:02+0300\n"
|
||||||
"Last-Translator: Gringo <vdr-italian@tiscali.it>\n"
|
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
|
||||||
"Language-Team: Italian\n"
|
"Language-Team: Italian <vdr@linuxtv.org>\n"
|
||||||
|
"Language: it\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=utf-8\n"
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
@@ -38,58 +39,7 @@ msgid "TDT (0x70)"
|
|||||||
msgstr "TDT (0x70)"
|
msgstr "TDT (0x70)"
|
||||||
|
|
||||||
msgid "Experience the IPTV"
|
msgid "Experience the IPTV"
|
||||||
msgstr "Esperimenta la 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 "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"
|
msgid "IPTV Information"
|
||||||
msgstr "Informazione IPTV"
|
msgstr "Informazione IPTV"
|
||||||
@@ -117,19 +67,19 @@ msgid ""
|
|||||||
"\n"
|
"\n"
|
||||||
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Definisce una dimensione del buffer in megabytes per i flussi di trasporto.\n"
|
"Definisci una dimensione del buffer in MB per i flussi di trasporto.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Dimensioni più piccole aiutano il consumo di memoria, ma sono più inclini a generare buffer overflows."
|
"Dimensioni più piccole aiutano il consumo di memoria, ma sono più inclini a generare buffer overflows."
|
||||||
|
|
||||||
msgid "TS buffer prefill ratio [%]"
|
msgid "TS buffer prefill ratio [%]"
|
||||||
msgstr "Percentuale preriempimento buffer TS [%]"
|
msgstr "Riempimento buffer TS [%]"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"This is useful if streaming media over a slow or unreliable connection."
|
"This is useful if streaming media over a slow or unreliable connection."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Definisce un rapporto di preriempimento del buffer per i flussi di trasporto prima che i dati siano trasferiti a VDR.\n"
|
"Definisci un rapporto di riempimento del buffer per i flussi di trasporto prima che i dati siano trasferiti a VDR.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Questo è utile se si trasmette dati su una connessione lenta oppure inaffidabile."
|
"Questo è utile se si trasmette dati su una connessione lenta oppure inaffidabile."
|
||||||
|
|
||||||
@@ -141,7 +91,7 @@ msgid ""
|
|||||||
"\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."
|
"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 ""
|
msgstr ""
|
||||||
"Definisce una porta base usata dal protocollo EXT.\n"
|
"Definisci una porta base usata dal protocollo EXT.\n"
|
||||||
"\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."
|
"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."
|
||||||
|
|
||||||
@@ -154,7 +104,7 @@ msgid ""
|
|||||||
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
|
"Section filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\n"
|
||||||
"Enabling this feature does not affect streams that do not contain section data."
|
"Enabling this feature does not affect streams that do not contain section data."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Definisce se la sezione filtri sarà utilizzata.\n"
|
"Definisci se la sezione filtri sarà utilizzata.\n"
|
||||||
"\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"
|
"La sezioni filtri significa che il plugin IPTV prova a elaborare e fornire a VDR dati secondari sul flusso attualmente attivo. VDR può successivamente usare questi dati per fornire varie funzionalità come il rilevamento del cambio Pid automatico, EPG, etc.\n"
|
||||||
"Abilitare questa funzione non influisce sui flussi che non contengono dati di sezione."
|
"Abilitare questa funzione non influisce sui flussi che non contengono dati di sezione."
|
||||||
@@ -167,7 +117,7 @@ msgid ""
|
|||||||
"\n"
|
"\n"
|
||||||
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Definisce che il numero di sezione filtri sarà disabilitato.\n"
|
"Definisci il numero di sezione filtri che sarà disabilitato.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Certe sezioni filtri potrebbero generare alcuni comportamenti indesiderati per VDR come la non sincronizzazione dell'ora. Inserendo qui i filtri nella lista nera i dati di sezione utili possono essere lasciati intatti per l'elaborazione da parte di VDR."
|
"Certe sezioni filtri potrebbero generare alcuni comportamenti indesiderati per VDR come la non sincronizzazione dell'ora. Inserendo qui i filtri nella lista nera i dati di sezione utili possono essere lasciati intatti per l'elaborazione da parte di VDR."
|
||||||
|
|
||||||
@@ -176,7 +126,43 @@ msgid "Disable filter"
|
|||||||
msgstr "Disabilita filtro"
|
msgstr "Disabilita filtro"
|
||||||
|
|
||||||
msgid "Define an ill-behaving filter to be blacklisted."
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
msgstr "Definisce che un filtro corrotto sia messo nella lista nera."
|
msgstr "Definisci un filtro corrotto che sarà messo nella lista nera."
|
||||||
|
|
||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr "Aiuto"
|
msgstr "Aiuto"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "FILE"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Scan section ids"
|
||||||
|
msgstr "Scansione Section Ids"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Scansione Pids"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protocollo"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Indirizzo"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Parametro"
|
||||||
|
|||||||
167
po/nl_NL.po
Normal file
167
po/nl_NL.po
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
# VDR plugin language source file.
|
||||||
|
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||||
|
# This file is distributed under the same license as the iptv package.
|
||||||
|
# Carel, 2010.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: vdr-iptv 0.5.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
|
"POT-Creation-Date: 2012-02-02 02:02+0300\n"
|
||||||
|
"PO-Revision-Date: 2012-02-02 02:02+0300\n"
|
||||||
|
"Last-Translator: Carel\n"
|
||||||
|
"Language-Team: Dutch <vdr@linuxtv.org>\n"
|
||||||
|
"Language: nl\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 "TV programma's via IP"
|
||||||
|
|
||||||
|
msgid "IPTV Information"
|
||||||
|
msgstr "IPTV informatie"
|
||||||
|
|
||||||
|
msgid "General"
|
||||||
|
msgstr "Algemeen"
|
||||||
|
|
||||||
|
msgid "Pids"
|
||||||
|
msgstr "Pids"
|
||||||
|
|
||||||
|
msgid "Filters"
|
||||||
|
msgstr "Filter"
|
||||||
|
|
||||||
|
msgid "Bits/bytes"
|
||||||
|
msgstr "Bits/Bytes"
|
||||||
|
|
||||||
|
msgid "IPTV information not available!"
|
||||||
|
msgstr "IPTV informatie niet beschikbaar!"
|
||||||
|
|
||||||
|
msgid "TS buffer size [MB]"
|
||||||
|
msgstr "TS buffergrootte [MB]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a ringbuffer size for transport streams in megabytes.\n"
|
||||||
|
"\n"
|
||||||
|
"Smaller sizes help memory consumption, but are more prone to buffer overflows."
|
||||||
|
msgstr ""
|
||||||
|
"Stel de grootte van de ringbuffer vast voor transportstreams in megabytes.\n"
|
||||||
|
"\n"
|
||||||
|
"Bij lage waarden zapt VDR sneller maar kunnen leiden tot bufferoverschreidingen en dus dropouts."
|
||||||
|
|
||||||
|
msgid "TS buffer prefill ratio [%]"
|
||||||
|
msgstr "TS buffer-preload [%]"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define a prefill ratio of the ringbuffer for transport streams before data is transferred to VDR.\n"
|
||||||
|
"\n"
|
||||||
|
"This is useful if streaming media over a slow or unreliable connection."
|
||||||
|
msgstr ""
|
||||||
|
"Stel een 'prefil ratio' in voor de ringbuffer voor transportstreams voor de data naar VDR wordt verstuurd.\n"
|
||||||
|
"\n"
|
||||||
|
"Dit is aan te bevelen bij onbetrouwbare of langzame verbindingen."
|
||||||
|
|
||||||
|
msgid "EXT protocol base port"
|
||||||
|
msgstr "EXT protocol basispoort"
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
"Bepaal de basispoort voor het EXT protocol.\n"
|
||||||
|
"\n"
|
||||||
|
"De poortrange wordt bepaald door het aantal IPTV apparaten. Deze poort luistert naar inkomende verbindingen wanneer het EXT protocol wordt gebruikt."
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
"Bepaal of er sectionfilterimg moet worden gebrukt.\n"
|
||||||
|
"\n"
|
||||||
|
"Bij sectiefiltering zal de IPTV plugin VDR van extra informatie over de stream voorzien. VDR kan dan bijvoorbeeld automatisch de PIDs wijzigen of de EPG tonen.Het gebruik van deze mogelijkheid heeft geen effect op streams die geen sectiedata bevatten."
|
||||||
|
|
||||||
|
msgid "Disable filters"
|
||||||
|
msgstr "Deactiveer 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 ""
|
||||||
|
"Bepaal het aantal de de-activeren sectiefilters.\n"
|
||||||
|
"\n"
|
||||||
|
"Sommige sctiefilters kunnen ongewenste effecten veroorzaken. Door ze hier op te nemen blijft de data intact zodat VDR het kan blijven gebruiken."
|
||||||
|
|
||||||
|
#. TRANSLATORS: note the singular!
|
||||||
|
msgid "Disable filter"
|
||||||
|
msgstr "Deactiveer filter"
|
||||||
|
|
||||||
|
msgid "Define an ill-behaving filter to be blacklisted."
|
||||||
|
msgstr "Blacklist een probleem veroorzakend filter "
|
||||||
|
|
||||||
|
msgid "Help"
|
||||||
|
msgstr "Help"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "BESTAND"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Scan section ids"
|
||||||
|
msgstr "Scan section IDS"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Scan PIDS"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Protocol"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Adres"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Parameter"
|
||||||
97
po/ru_RU.po
97
po/ru_RU.po
@@ -5,12 +5,13 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: iptv 0.2.0\n"
|
"Project-Id-Version: vdr-iptv 0.5.2\n"
|
||||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2008-02-01 23:43+0200\n"
|
"POT-Creation-Date: 2012-02-02 02:02+0300\n"
|
||||||
"PO-Revision-Date: 2008-03-16 12:14+0100\n"
|
"PO-Revision-Date: 2010-09-09 09:09+0300\n"
|
||||||
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
|
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
|
||||||
"Language-Team: Russian <de@li.org>\n"
|
"Language-Team: Russian <vdr@linuxtv.org>\n"
|
||||||
|
"Language: ru\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
@@ -41,57 +42,6 @@ msgstr "TDT (0x70)"
|
|||||||
msgid "Experience the IPTV"
|
msgid "Experience the IPTV"
|
||||||
msgstr "Попробуй 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 "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"
|
msgid "IPTV Information"
|
||||||
msgstr "IPTV информация"
|
msgstr "IPTV информация"
|
||||||
|
|
||||||
@@ -166,3 +116,38 @@ msgstr "Неправильно работающий фильтр, занести
|
|||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr "Справка"
|
msgstr "Справка"
|
||||||
|
|
||||||
|
msgid "UDP"
|
||||||
|
msgstr "UDP"
|
||||||
|
|
||||||
|
msgid "HTTP"
|
||||||
|
msgstr "HTTP"
|
||||||
|
|
||||||
|
msgid "FILE"
|
||||||
|
msgstr "ФАЙЛ"
|
||||||
|
|
||||||
|
msgid "EXT"
|
||||||
|
msgstr "EXT"
|
||||||
|
|
||||||
|
msgid "Nid"
|
||||||
|
msgstr "Nid"
|
||||||
|
|
||||||
|
msgid "Tid"
|
||||||
|
msgstr "Tid"
|
||||||
|
|
||||||
|
msgid "Rid"
|
||||||
|
msgstr "Rid"
|
||||||
|
|
||||||
|
msgid "Scan section ids"
|
||||||
|
msgstr "Сканировать section ids"
|
||||||
|
|
||||||
|
msgid "Scan pids"
|
||||||
|
msgstr "Сканировать пиды"
|
||||||
|
|
||||||
|
msgid "Protocol"
|
||||||
|
msgstr "Протокол"
|
||||||
|
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Адрес"
|
||||||
|
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "Параметр"
|
||||||
|
|||||||
@@ -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.24 2008/02/17 19:18:47 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@@ -23,7 +22,8 @@
|
|||||||
cIptvProtocolExt::cIptvProtocolExt()
|
cIptvProtocolExt::cIptvProtocolExt()
|
||||||
: pid(-1),
|
: pid(-1),
|
||||||
scriptFile(""),
|
scriptFile(""),
|
||||||
scriptParameter(0)
|
scriptParameter(0),
|
||||||
|
streamPort(0)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::cIptvProtocolExt()\n");
|
debug("cIptvProtocolExt::cIptvProtocolExt()\n");
|
||||||
}
|
}
|
||||||
@@ -39,8 +39,10 @@ void cIptvProtocolExt::ExecuteScript(void)
|
|||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::ExecuteScript()\n");
|
debug("cIptvProtocolExt::ExecuteScript()\n");
|
||||||
// Check if already executing
|
// Check if already executing
|
||||||
|
if (isActive || isempty(scriptFile))
|
||||||
|
return;
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
error("ERROR: Cannot execute script!");
|
error("Cannot execute script!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Let's fork
|
// Let's fork
|
||||||
@@ -52,10 +54,10 @@ 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
|
||||||
cString cmd = cString::sprintf("%s %d %d", *scriptFile, scriptParameter, socketPort);
|
cString cmd = cString::sprintf("%s %d %d", *scriptFile, scriptParameter, streamPort);
|
||||||
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/bash", "sh", "-c", *cmd, (char *)NULL) == -1) {
|
||||||
error("ERROR: Script execution failed: %s", *cmd);
|
error("Script execution failed: %s", *cmd);
|
||||||
_exit(-1);
|
_exit(-1);
|
||||||
}
|
}
|
||||||
_exit(0);
|
_exit(0);
|
||||||
@@ -68,6 +70,8 @@ void cIptvProtocolExt::ExecuteScript(void)
|
|||||||
void cIptvProtocolExt::TerminateScript(void)
|
void cIptvProtocolExt::TerminateScript(void)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::TerminateScript(): pid=%d\n", pid);
|
debug("cIptvProtocolExt::TerminateScript(): pid=%d\n", pid);
|
||||||
|
if (!isActive || isempty(scriptFile))
|
||||||
|
return;
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
const unsigned int timeoutms = 100;
|
const unsigned int timeoutms = 100;
|
||||||
unsigned int waitms = 0;
|
unsigned int waitms = 0;
|
||||||
@@ -80,7 +84,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
|
||||||
@@ -107,10 +111,10 @@ 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(streamPort);
|
||||||
// Execute the external script
|
// Execute the external script
|
||||||
ExecuteScript();
|
ExecuteScript();
|
||||||
isActive = true;
|
isActive = true;
|
||||||
@@ -120,17 +124,17 @@ bool cIptvProtocolExt::Open(void)
|
|||||||
bool cIptvProtocolExt::Close(void)
|
bool cIptvProtocolExt::Close(void)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::Close()\n");
|
debug("cIptvProtocolExt::Close()\n");
|
||||||
// Close the socket
|
|
||||||
CloseSocket();
|
|
||||||
// Terminate the external script
|
// Terminate the external script
|
||||||
TerminateScript();
|
TerminateScript();
|
||||||
isActive = false;
|
isActive = false;
|
||||||
|
// Close the socket
|
||||||
|
CloseSocket();
|
||||||
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)
|
||||||
@@ -140,13 +144,13 @@ bool cIptvProtocolExt::Set(const char* Location, const int Parameter, const int
|
|||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
// Update script file and parameter
|
// Update script file and parameter
|
||||||
scriptFile = cString::sprintf("%s/%s", IptvConfig.GetConfigDirectory(), Location);
|
scriptFile = cString::sprintf("%s/%s", IptvConfig.GetConfigDirectory(), Location);
|
||||||
if ((stat(scriptFile, &stbuf) != 0) || (strstr(scriptFile, "..") != 0)) {
|
if ((stat(*scriptFile, &stbuf) != 0) || (strstr(*scriptFile, "..") != 0)) {
|
||||||
error("ERROR: Non-existent or relative path script '%s'", *scriptFile);
|
error("Non-existent or relative path script '%s'", *scriptFile);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
scriptParameter = Parameter;
|
scriptParameter = Parameter;
|
||||||
// Update listen port
|
// Update listen port
|
||||||
socketPort = IptvConfig.GetExtProtocolBasePort() + Index;
|
streamPort = IptvConfig.GetExtProtocolBasePort() + Index;
|
||||||
}
|
}
|
||||||
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: protocolext.h,v 1.10 2008/02/17 19:18:47 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLEXT_H
|
#ifndef __IPTV_PROTOCOLEXT_H
|
||||||
@@ -18,6 +17,7 @@ private:
|
|||||||
int pid;
|
int pid;
|
||||||
cString scriptFile;
|
cString scriptFile;
|
||||||
int scriptParameter;
|
int scriptParameter;
|
||||||
|
int streamPort;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void TerminateScript(void);
|
void TerminateScript(void);
|
||||||
@@ -26,7 +26,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
cIptvProtocolExt();
|
cIptvProtocolExt();
|
||||||
virtual ~cIptvProtocolExt();
|
virtual ~cIptvProtocolExt();
|
||||||
int Read(unsigned char* *BufferAddr);
|
int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
bool Open(void);
|
bool Open(void);
|
||||||
bool Close(void);
|
bool Close(void);
|
||||||
|
|||||||
@@ -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.15 2008/01/04 23:36:37 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -17,15 +16,11 @@
|
|||||||
|
|
||||||
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()
|
||||||
@@ -35,7 +30,6 @@ cIptvProtocolFile::~cIptvProtocolFile()
|
|||||||
cIptvProtocolFile::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.8 2008/01/04 23:36:37 ajhseppa 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,7 +25,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
cIptvProtocolFile();
|
cIptvProtocolFile();
|
||||||
virtual ~cIptvProtocolFile();
|
virtual ~cIptvProtocolFile();
|
||||||
int Read(unsigned char* *BufferAddr);
|
int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
bool Open(void);
|
bool Open(void);
|
||||||
bool Close(void);
|
bool Close(void);
|
||||||
|
|||||||
120
protocolhttp.c
120
protocolhttp.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: protocolhttp.c,v 1.24 2008/02/17 19:18:47 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -20,10 +19,11 @@
|
|||||||
#include "protocolhttp.h"
|
#include "protocolhttp.h"
|
||||||
|
|
||||||
cIptvProtocolHttp::cIptvProtocolHttp()
|
cIptvProtocolHttp::cIptvProtocolHttp()
|
||||||
|
: streamAddr(strdup("")),
|
||||||
|
streamPath(strdup("/")),
|
||||||
|
streamPort(0)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolHttp::cIptvProtocolHttp()\n");
|
debug("cIptvProtocolHttp::cIptvProtocolHttp()\n");
|
||||||
streamAddr = strdup("");
|
|
||||||
streamPath = strdup("/");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvProtocolHttp::~cIptvProtocolHttp()
|
cIptvProtocolHttp::~cIptvProtocolHttp()
|
||||||
@@ -34,7 +34,6 @@ cIptvProtocolHttp::~cIptvProtocolHttp()
|
|||||||
// Free allocated memory
|
// Free allocated memory
|
||||||
free(streamPath);
|
free(streamPath);
|
||||||
free(streamAddr);
|
free(streamAddr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolHttp::Connect(void)
|
bool cIptvProtocolHttp::Connect(void)
|
||||||
@@ -42,69 +41,29 @@ bool cIptvProtocolHttp::Connect(void)
|
|||||||
debug("cIptvProtocolHttp::Connect()\n");
|
debug("cIptvProtocolHttp::Connect()\n");
|
||||||
// Check that stream address is valid
|
// Check that stream address is valid
|
||||||
if (!isActive && !isempty(streamAddr) && !isempty(streamPath)) {
|
if (!isActive && !isempty(streamAddr) && !isempty(streamPath)) {
|
||||||
// Ensure that socket is valid
|
// Ensure that socket is valid and connect
|
||||||
OpenSocket(socketPort);
|
OpenSocket(streamPort, streamAddr);
|
||||||
|
if (!ConnectSocket()) {
|
||||||
// First try only the IP address
|
|
||||||
sockAddr.sin_addr.s_addr = inet_addr(streamAddr);
|
|
||||||
|
|
||||||
if (sockAddr.sin_addr.s_addr == INADDR_NONE) {
|
|
||||||
debug("Cannot convert %s directly to internet address\n", streamAddr);
|
|
||||||
|
|
||||||
// It may be a host name, get the name
|
|
||||||
struct hostent *host;
|
|
||||||
host = gethostbyname(streamAddr);
|
|
||||||
if (!host) {
|
|
||||||
error("%s is not valid address\n", streamAddr);
|
|
||||||
char tmp[64];
|
|
||||||
error("ERROR: %s", strerror_r(h_errno, tmp, sizeof(tmp)));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
sockAddr.sin_addr.s_addr = inet_addr(*host->h_addr_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
int err = connect(socketDesc, (struct sockaddr*)&sockAddr,
|
|
||||||
sizeof(sockAddr));
|
|
||||||
// Non-blocking sockets always report in-progress error when connected
|
|
||||||
ERROR_IF_FUNC(err < 0 && errno != EINPROGRESS, "connect()", CloseSocket(), return false);
|
|
||||||
// Select with 800ms timeout on the socket completion, check if it is writable
|
|
||||||
int retval = select_single_desc(socketDesc, 800000, true);
|
|
||||||
if (retval < 0)
|
|
||||||
return retval;
|
|
||||||
|
|
||||||
// Select has returned. Get socket errors if there are any
|
|
||||||
int socketStatus = 0;
|
|
||||||
socklen_t len = sizeof(socketStatus);
|
|
||||||
getsockopt(socketDesc, SOL_SOCKET, SO_ERROR, &socketStatus, &len);
|
|
||||||
|
|
||||||
// If not any errors, then socket must be ready and connected
|
|
||||||
if (socketStatus != 0) {
|
|
||||||
error("Cannot connect to %s\n", streamAddr);
|
|
||||||
char tmp[64];
|
|
||||||
error("ERROR: %s", strerror_r(socketStatus, tmp, sizeof(tmp)));
|
|
||||||
CloseSocket();
|
CloseSocket();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formulate and send HTTP request
|
// Formulate and send HTTP request
|
||||||
cString buffer = cString::sprintf("GET %s HTTP/1.1\r\n"
|
cString buffer = cString::sprintf("GET %s HTTP/1.1\r\n"
|
||||||
"Host: %s\r\n"
|
"Host: %s\r\n"
|
||||||
"User-Agent: vdr-iptv\r\n"
|
"User-Agent: vdr-%s/%s\r\n"
|
||||||
"Range: bytes=0-\r\n"
|
"Range: bytes=0-\r\n"
|
||||||
"Connection: Close\r\n"
|
"Connection: Close\r\n"
|
||||||
"\r\n", streamPath, streamAddr);
|
"\r\n", streamPath, streamAddr, PLUGIN_NAME_I18N, VERSION);
|
||||||
|
|
||||||
debug("Sending http request: %s\n", *buffer);
|
debug("Sending http request: %s\n", *buffer);
|
||||||
err = send(socketDesc, buffer, strlen(buffer), 0);
|
if (!Write(*buffer, (unsigned int)strlen(*buffer))) {
|
||||||
ERROR_IF_FUNC(err < 0, "send()", CloseSocket(), return false);
|
CloseSocket();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Now process headers
|
// Now process headers
|
||||||
if (!ProcessHeaders()) {
|
if (!ProcessHeaders()) {
|
||||||
CloseSocket();
|
CloseSocket();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update active flag
|
// Update active flag
|
||||||
isActive = true;
|
isActive = true;
|
||||||
}
|
}
|
||||||
@@ -114,7 +73,6 @@ bool cIptvProtocolHttp::Connect(void)
|
|||||||
bool cIptvProtocolHttp::Disconnect(void)
|
bool cIptvProtocolHttp::Disconnect(void)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolHttp::Disconnect()\n");
|
debug("cIptvProtocolHttp::Disconnect()\n");
|
||||||
// Check that stream address is valid
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
// Close the socket
|
// Close the socket
|
||||||
CloseSocket();
|
CloseSocket();
|
||||||
@@ -125,29 +83,20 @@ bool cIptvProtocolHttp::Disconnect(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 *bufptr = dest;
|
||||||
char *bufptr = buf;
|
|
||||||
memset(buf, '\0', sizeof(buf));
|
|
||||||
recvLen = 0;
|
recvLen = 0;
|
||||||
|
|
||||||
|
if (!dest)
|
||||||
|
return false;
|
||||||
|
|
||||||
while (!newline || !linefeed) {
|
while (!newline || !linefeed) {
|
||||||
socklen_t addrlen = sizeof(sockAddr);
|
|
||||||
// Wait 500ms for data
|
// Wait 500ms for data
|
||||||
int retval = select_single_desc(socketDesc, 500000, false);
|
if (ReadChar(bufptr, 500)) {
|
||||||
// Check if error
|
|
||||||
if (retval < 0)
|
|
||||||
return false;
|
|
||||||
// Check if data available
|
|
||||||
else if (retval) {
|
|
||||||
int retval = recvfrom(socketDesc, bufptr, 1, MSG_DONTWAIT,
|
|
||||||
(struct sockaddr *)&sockAddr, &addrlen);
|
|
||||||
if (retval <= 0)
|
|
||||||
return false;
|
|
||||||
// Parsing end conditions, if line ends with \r\n
|
// Parsing end conditions, if line ends with \r\n
|
||||||
if (linefeed && *bufptr == '\n')
|
if (linefeed && *bufptr == '\n')
|
||||||
newline = true;
|
newline = true;
|
||||||
@@ -160,18 +109,18 @@ bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen,
|
|||||||
++recvLen;
|
++recvLen;
|
||||||
}
|
}
|
||||||
++bufptr;
|
++bufptr;
|
||||||
// Check that buffers won't be exceeded
|
// Check that buffer won't be exceeded
|
||||||
if (recvLen >= sizeof(buf) || recvLen >= destLen) {
|
if (recvLen >= destLen) {
|
||||||
error("Header wouldn't fit into buffer\n");
|
error("Header wouldn't fit into buffer\n");
|
||||||
|
recvLen = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
error("No HTTP response received\n");
|
error("No HTTP response received in 500ms\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy(dest, buf, recvLen);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,22 +128,27 @@ bool cIptvProtocolHttp::ProcessHeaders(void)
|
|||||||
{
|
{
|
||||||
debug("cIptvProtocolHttp::ProcessHeaders()\n");
|
debug("cIptvProtocolHttp::ProcessHeaders()\n");
|
||||||
unsigned int lineLength = 0;
|
unsigned int lineLength = 0;
|
||||||
int response = 0;
|
int version = 0, response = 0;
|
||||||
bool responseFound = false;
|
bool responseFound = false;
|
||||||
char buf[256];
|
char fmt[32];
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
// Generate HTTP response format string with 2 arguments
|
||||||
|
snprintf(fmt, sizeof(fmt), "HTTP/1.%%%zui %%%zui ", sizeof(version) - 1, sizeof(response) - 1);
|
||||||
|
|
||||||
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, fmt, &version, &response) != 2) {
|
||||||
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) {
|
// Allow only 'OK' and 'Partial Content'
|
||||||
error("ERROR: %s\n", buf);
|
if ((response != 200) && (response != 206)) {
|
||||||
|
error("Invalid HTTP response (%d): %s\n", response, buf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,9 +170,9 @@ 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)
|
||||||
@@ -236,8 +190,8 @@ bool cIptvProtocolHttp::Set(const char* Location, const int Parameter, const int
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
streamPath = strcpyrealloc(streamPath, "/");
|
streamPath = strcpyrealloc(streamPath, "/");
|
||||||
socketPort = Parameter;
|
streamPort = Parameter;
|
||||||
debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
|
//debug("http://%s:%d%s\n", streamAddr, streamPort, streamPath);
|
||||||
// Re-connect the socket
|
// Re-connect the socket
|
||||||
Connect();
|
Connect();
|
||||||
}
|
}
|
||||||
@@ -247,5 +201,5 @@ bool cIptvProtocolHttp::Set(const char* Location, const int Parameter, const int
|
|||||||
cString cIptvProtocolHttp::GetInformation(void)
|
cString cIptvProtocolHttp::GetInformation(void)
|
||||||
{
|
{
|
||||||
//debug("cIptvProtocolHttp::GetInformation()");
|
//debug("cIptvProtocolHttp::GetInformation()");
|
||||||
return cString::sprintf("http://%s:%d%s", streamAddr, socketPort, streamPath);
|
return cString::sprintf("http://%s:%d%s", streamAddr, streamPort, streamPath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.12 2008/01/04 23:36:37 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLHTTP_H
|
#ifndef __IPTV_PROTOCOLHTTP_H
|
||||||
@@ -17,18 +16,18 @@ class cIptvProtocolHttp : public cIptvTcpSocket, public cIptvProtocolIf {
|
|||||||
private:
|
private:
|
||||||
char* streamAddr;
|
char* streamAddr;
|
||||||
char* streamPath;
|
char* streamPath;
|
||||||
|
int streamPort;
|
||||||
|
|
||||||
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);
|
||||||
bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
bool Open(void);
|
bool Open(void);
|
||||||
bool Close(void);
|
bool Close(void);
|
||||||
|
|||||||
@@ -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.8 2008/01/30 21:57:33 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLIF_H
|
#ifndef __IPTV_PROTOCOLIF_H
|
||||||
@@ -13,7 +12,7 @@ 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;
|
||||||
|
|||||||
@@ -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.22 2008/01/04 23:36:37 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -20,9 +19,10 @@
|
|||||||
#include "socket.h"
|
#include "socket.h"
|
||||||
|
|
||||||
cIptvProtocolUdp::cIptvProtocolUdp()
|
cIptvProtocolUdp::cIptvProtocolUdp()
|
||||||
|
: streamAddr(strdup("")),
|
||||||
|
streamPort(0)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolUdp::cIptvProtocolUdp()\n");
|
debug("cIptvProtocolUdp::cIptvProtocolUdp()\n");
|
||||||
streamAddr = strdup("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvProtocolUdp::~cIptvProtocolUdp()
|
cIptvProtocolUdp::~cIptvProtocolUdp()
|
||||||
@@ -34,86 +34,61 @@ cIptvProtocolUdp::~cIptvProtocolUdp()
|
|||||||
free(streamAddr);
|
free(streamAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolUdp::JoinMulticast(void)
|
|
||||||
{
|
|
||||||
debug("cIptvProtocolUdp::JoinMulticast()\n");
|
|
||||||
// Check that stream address is valid
|
|
||||||
if (!isActive && !isempty(streamAddr)) {
|
|
||||||
// Ensure that socket is valid
|
|
||||||
OpenSocket(socketPort);
|
|
||||||
// Join a new multicast group
|
|
||||||
struct ip_mreq mreq;
|
|
||||||
mreq.imr_multiaddr.s_addr = inet_addr(streamAddr);
|
|
||||||
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
|
||||||
int err = setsockopt(socketDesc, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq,
|
|
||||||
sizeof(mreq));
|
|
||||||
ERROR_IF_RET(err < 0, "setsockopt()", return false);
|
|
||||||
// Update multicasting flag
|
|
||||||
isActive = true;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cIptvProtocolUdp::DropMulticast(void)
|
|
||||||
{
|
|
||||||
debug("cIptvProtocolUdp::DropMulticast()\n");
|
|
||||||
// Check that stream address is valid
|
|
||||||
if (isActive && !isempty(streamAddr)) {
|
|
||||||
// Ensure that socket is valid
|
|
||||||
OpenSocket(socketPort);
|
|
||||||
// Drop the multicast group
|
|
||||||
struct ip_mreq mreq;
|
|
||||||
mreq.imr_multiaddr.s_addr = inet_addr(streamAddr);
|
|
||||||
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
|
||||||
int err = setsockopt(socketDesc, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq,
|
|
||||||
sizeof(mreq));
|
|
||||||
ERROR_IF_RET(err < 0, "setsockopt()", return false);
|
|
||||||
// Update multicasting flag
|
|
||||||
isActive = false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cIptvProtocolUdp::Open(void)
|
bool cIptvProtocolUdp::Open(void)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolUdp::Open()\n");
|
debug("cIptvProtocolUdp::Open(): streamAddr=%s\n", streamAddr);
|
||||||
// Join a new multicast group
|
OpenSocket(streamPort, inet_addr(streamAddr));
|
||||||
JoinMulticast();
|
if (!isempty(streamAddr)) {
|
||||||
|
// Join a new multicast group
|
||||||
|
JoinMulticast();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvProtocolUdp::Close(void)
|
bool cIptvProtocolUdp::Close(void)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolUdp::Close()\n");
|
debug("cIptvProtocolUdp::Close(): streamAddr=%s\n", streamAddr);
|
||||||
// Drop the multicast group
|
if (!isempty(streamAddr)) {
|
||||||
DropMulticast();
|
// Drop the multicast group
|
||||||
|
OpenSocket(streamPort, inet_addr(streamAddr));
|
||||||
|
DropMulticast();
|
||||||
|
}
|
||||||
// Close the socket
|
// Close the socket
|
||||||
CloseSocket();
|
CloseSocket();
|
||||||
|
// Do NOT reset stream and source addresses
|
||||||
|
//streamAddr = strcpyrealloc(streamAddr, "");
|
||||||
|
//streamPort = 0;
|
||||||
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)
|
||||||
{
|
{
|
||||||
debug("cIptvProtocolUdp::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
|
debug("cIptvProtocolUdp::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
|
||||||
if (!isempty(Location)) {
|
if (!isempty(Location)) {
|
||||||
// Drop the multicast group
|
// Drop the multicast group
|
||||||
DropMulticast();
|
if (!isempty(streamAddr)) {
|
||||||
// Update stream address and port
|
OpenSocket(streamPort, inet_addr(streamAddr));
|
||||||
streamAddr = strcpyrealloc(streamAddr, Location);
|
DropMulticast();
|
||||||
socketPort = Parameter;
|
}
|
||||||
// Join a new multicast group
|
// Update stream address and port
|
||||||
JoinMulticast();
|
streamAddr = strcpyrealloc(streamAddr, Location);
|
||||||
}
|
streamPort = Parameter;
|
||||||
|
// Join a new multicast group
|
||||||
|
if (!isempty(streamAddr)) {
|
||||||
|
OpenSocket(streamPort, inet_addr(streamAddr));
|
||||||
|
JoinMulticast();
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cString cIptvProtocolUdp::GetInformation(void)
|
cString cIptvProtocolUdp::GetInformation(void)
|
||||||
{
|
{
|
||||||
//debug("cIptvProtocolUdp::GetInformation()");
|
//debug("cIptvProtocolUdp::GetInformation()");
|
||||||
return cString::sprintf("udp://%s:%d", streamAddr, socketPort);
|
return cString::sprintf("udp://%s:%d", streamAddr, streamPort);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.13 2008/01/04 23:36:37 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_PROTOCOLUDP_H
|
#ifndef __IPTV_PROTOCOLUDP_H
|
||||||
@@ -16,15 +15,12 @@
|
|||||||
class cIptvProtocolUdp : public cIptvUdpSocket, public cIptvProtocolIf {
|
class cIptvProtocolUdp : public cIptvUdpSocket, public cIptvProtocolIf {
|
||||||
private:
|
private:
|
||||||
char* streamAddr;
|
char* streamAddr;
|
||||||
|
int streamPort;
|
||||||
private:
|
|
||||||
bool JoinMulticast(void);
|
|
||||||
bool DropMulticast(void);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cIptvProtocolUdp();
|
cIptvProtocolUdp();
|
||||||
virtual ~cIptvProtocolUdp();
|
virtual ~cIptvProtocolUdp();
|
||||||
int Read(unsigned char* *BufferAddr);
|
int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
||||||
bool Set(const char* Location, const int Parameter, const int Index);
|
bool Set(const char* Location, const int Parameter, const int Index);
|
||||||
bool Open(void);
|
bool Open(void);
|
||||||
bool Close(void);
|
bool Close(void);
|
||||||
|
|||||||
276
sectionfilter.c
276
sectionfilter.c
@@ -3,13 +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.19 2008/02/17 19:18:47 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sectionfilter.h"
|
#include "sectionfilter.h"
|
||||||
|
|
||||||
cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
|
cIptvSectionFilter::cIptvSectionFilter(int DeviceIndex, int Index,
|
||||||
u_short Pid, u_char Tid, u_char Mask)
|
uint16_t Pid, uint8_t Tid, uint8_t Mask)
|
||||||
: pusi_seen(0),
|
: pusi_seen(0),
|
||||||
feedcc(0),
|
feedcc(0),
|
||||||
doneq(0),
|
doneq(0),
|
||||||
@@ -18,10 +17,12 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
|
|||||||
seclen(0),
|
seclen(0),
|
||||||
tsfeedp(0),
|
tsfeedp(0),
|
||||||
pid(Pid),
|
pid(Pid),
|
||||||
id(Index),
|
devid(DeviceIndex),
|
||||||
pipeName("")
|
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));
|
||||||
@@ -29,268 +30,189 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
|
|||||||
memset(maskandmode, '\0', sizeof(maskandmode));
|
memset(maskandmode, '\0', sizeof(maskandmode));
|
||||||
memset(maskandnotmode, '\0', sizeof(maskandnotmode));
|
memset(maskandnotmode, '\0', sizeof(maskandnotmode));
|
||||||
|
|
||||||
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)
|
||||||
fifoDescriptor = -1;
|
close(tmp);
|
||||||
readDescriptor = -1;
|
tmp = socket[0];
|
||||||
|
socket[0] = -1;
|
||||||
|
if (tmp >= 0)
|
||||||
|
close(tmp);
|
||||||
|
secbuf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvSectionFilter::SetPipeName(int deviceIndex)
|
int cIptvSectionFilter::GetReadDesc(void)
|
||||||
{
|
{
|
||||||
pipeName = cString::sprintf(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
|
|
||||||
AddSectionStatistic(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;
|
if (secbuf) {
|
||||||
int i;
|
int i;
|
||||||
|
uint8_t neq = 0;
|
||||||
|
|
||||||
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
|
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
|
||||||
uint8_t local_xor = filter_value[i] ^ secbuf[i];
|
uint8_t local_xor = (uint8_t)(filter_value[i] ^ secbuf[i]);
|
||||||
if (maskandmode[i] & local_xor) {
|
if (maskandmode[i] & local_xor)
|
||||||
#ifdef DEBUG_PRINTF
|
return 0;
|
||||||
printf("maskandmode discard\n");
|
neq |= (maskandnotmode[i] & local_xor);
|
||||||
#endif
|
|
||||||
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;
|
||||||
|
|
||||||
memcpy(secbuf_base + tsfeedp, buf, len);
|
memcpy(secbuf_base + tsfeedp, buf, len);
|
||||||
tsfeedp += len;
|
tsfeedp = uint16_t(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 = uint16_t(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.8 2008/02/17 19:18:47 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];
|
||||||
|
|
||||||
cString pipeName;
|
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
|
||||||
|
|||||||
553
setup.c
553
setup.c
@@ -3,13 +3,8 @@
|
|||||||
*
|
*
|
||||||
* 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.57 2008/02/19 22:29:02 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include <vdr/device.h>
|
|
||||||
#include <vdr/interface.h>
|
|
||||||
#include <vdr/status.h>
|
#include <vdr/status.h>
|
||||||
#include <vdr/menu.h>
|
#include <vdr/menu.h>
|
||||||
|
|
||||||
@@ -18,537 +13,6 @@
|
|||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#ifndef trVDR
|
|
||||||
#define trVDR(s) tr(s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// --- cIptvMenuEditChannel --------------------------------------------------
|
|
||||||
|
|
||||||
class cIptvMenuEditChannel : public cOsdMenu
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
enum {
|
|
||||||
eProtocolUDP,
|
|
||||||
eProtocolHTTP,
|
|
||||||
eProtocolFILE,
|
|
||||||
eProtocolEXT,
|
|
||||||
eProtocolCount
|
|
||||||
};
|
|
||||||
struct tIptvChannel {
|
|
||||||
int frequency, source, protocol, parameter, vpid, ppid, tpid, sid, nid, tid, rid;
|
|
||||||
int apid[MAXAPIDS + 1], dpid[MAXDPIDS + 1], spid[MAXSPIDS + 1], caids[MAXCAIDS + 1];
|
|
||||||
int sidscan, pidscan;
|
|
||||||
char name[256], location[256];
|
|
||||||
} data;
|
|
||||||
cChannel *channel;
|
|
||||||
const char *protocols[eProtocolCount];
|
|
||||||
void Setup(void);
|
|
||||||
cString GetIptvSettings(const char *Param, int *Parameter, int *SidScan, int *PidScan, int *Protocol);
|
|
||||||
void GetChannelData(cChannel *Channel);
|
|
||||||
void SetChannelData(cChannel *Channel);
|
|
||||||
|
|
||||||
public:
|
|
||||||
cIptvMenuEditChannel(cChannel *Channel, bool New = false);
|
|
||||||
virtual eOSState ProcessKey(eKeys Key);
|
|
||||||
};
|
|
||||||
|
|
||||||
cIptvMenuEditChannel::cIptvMenuEditChannel(cChannel *Channel, bool New)
|
|
||||||
:cOsdMenu(trVDR("Edit channel"), 16)
|
|
||||||
{
|
|
||||||
protocols[eProtocolUDP] = tr("UDP");
|
|
||||||
protocols[eProtocolHTTP] = tr("HTTP");
|
|
||||||
protocols[eProtocolFILE] = tr("FILE");
|
|
||||||
protocols[eProtocolEXT] = tr("EXT");
|
|
||||||
channel = Channel;
|
|
||||||
GetChannelData(channel);
|
|
||||||
if (New) {
|
|
||||||
channel = NULL;
|
|
||||||
data.nid = 0;
|
|
||||||
data.tid = 0;
|
|
||||||
data.rid = 0;
|
|
||||||
}
|
|
||||||
Setup();
|
|
||||||
}
|
|
||||||
|
|
||||||
cString cIptvMenuEditChannel::GetIptvSettings(const char *Param, int *Parameter, int *SidScan, int *PidScan, int *Protocol)
|
|
||||||
{
|
|
||||||
char *tag = NULL;
|
|
||||||
char *proto = NULL;
|
|
||||||
char *loc = NULL;
|
|
||||||
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 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[^|]|%a[^|]|%a[^|]|%d", &tag, &proto, &loc, Parameter) == 4) {
|
|
||||||
cString tagstr(tag, true);
|
|
||||||
cString protostr(proto, true);
|
|
||||||
cString locstr(loc, true);
|
|
||||||
*SidScan = 0;
|
|
||||||
*PidScan = 0;
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cIptvMenuEditChannel::GetChannelData(cChannel *Channel)
|
|
||||||
{
|
|
||||||
if (Channel) {
|
|
||||||
int parameter, protocol, sidscan, pidscan;
|
|
||||||
data.frequency = Channel->Frequency();
|
|
||||||
data.source = Channel->Source();
|
|
||||||
data.vpid = Channel->Vpid();
|
|
||||||
data.ppid = Channel->Ppid();
|
|
||||||
data.tpid = Channel->Tpid();
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.apid); ++i)
|
|
||||||
data.apid[i] = Channel->Apid(i);
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.dpid); ++i)
|
|
||||||
data.dpid[i] = Channel->Dpid(i);
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.spid); ++i)
|
|
||||||
data.spid[i] = Channel->Spid(i);
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.caids); ++i)
|
|
||||||
data.caids[i] = Channel->Ca(i);
|
|
||||||
data.sid = Channel->Sid();
|
|
||||||
data.nid = Channel->Nid();
|
|
||||||
data.tid = Channel->Tid();
|
|
||||||
data.rid = Channel->Rid();
|
|
||||||
strn0cpy(data.name, Channel->Name(), sizeof(data.name));
|
|
||||||
strn0cpy(data.location, *GetIptvSettings(Channel->PluginParam(), ¶meter, &sidscan, &pidscan, &protocol), sizeof(data.location));
|
|
||||||
data.sidscan = sidscan;
|
|
||||||
data.pidscan = pidscan;
|
|
||||||
data.protocol = protocol;
|
|
||||||
data.parameter = parameter;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
data.frequency = 1;
|
|
||||||
data.source = cSource::FromData(cSource::stPlug);
|
|
||||||
data.vpid = 0;
|
|
||||||
data.ppid = 0;
|
|
||||||
data.tpid = 0;
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.apid); ++i)
|
|
||||||
data.apid[i] = 0;
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.dpid); ++i)
|
|
||||||
data.dpid[i] = 0;
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.spid); ++i)
|
|
||||||
data.spid[i] = 0;
|
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(data.caids); ++i)
|
|
||||||
data.caids[i] = 0;
|
|
||||||
data.sid = 1;
|
|
||||||
data.nid = 0;
|
|
||||||
data.tid = 0;
|
|
||||||
data.rid = 0;
|
|
||||||
strn0cpy(data.name, "IPTV", sizeof(data.name));
|
|
||||||
strn0cpy(data.location, "127.0.0.1", sizeof(data.location));
|
|
||||||
data.sidscan = 0;
|
|
||||||
data.pidscan = 0;
|
|
||||||
data.protocol = eProtocolUDP;
|
|
||||||
data.parameter = 1234;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void cIptvMenuEditChannel::SetChannelData(cChannel *Channel)
|
|
||||||
{
|
|
||||||
if (Channel) {
|
|
||||||
cString param;
|
|
||||||
char alangs[MAXAPIDS][MAXLANGCODE2] = { "" };
|
|
||||||
char dlangs[MAXDPIDS][MAXLANGCODE2] = { "" };
|
|
||||||
switch (data.protocol) {
|
|
||||||
case eProtocolEXT:
|
|
||||||
param = cString::sprintf("IPTV|S%dP%d|EXT|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
|
||||||
break;
|
|
||||||
case eProtocolFILE:
|
|
||||||
param = cString::sprintf("IPTV|S%dP%d|FILE|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
|
||||||
break;
|
|
||||||
case eProtocolHTTP:
|
|
||||||
param = cString::sprintf("IPTV|S%dP%d|HTTP|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
case eProtocolUDP:
|
|
||||||
param = cString::sprintf("IPTV|S%dP%d|UDP|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
char slangs[MAXSPIDS][MAXLANGCODE2] = { "" };
|
|
||||||
Channel->SetPids(data.vpid, data.ppid, data.apid, alangs, data.dpid, dlangs, data.spid, slangs, data.tpid);
|
|
||||||
Channel->SetCaIds(data.caids);
|
|
||||||
Channel->SetId(data.nid, data.tid, data.sid, data.rid);
|
|
||||||
Channel->SetName(data.name, "", "IPTV");
|
|
||||||
Channel->SetPlugTransponderData(cSource::stPlug, data.frequency, param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void cIptvMenuEditChannel::Setup(void)
|
|
||||||
{
|
|
||||||
int current = Current();
|
|
||||||
Clear();
|
|
||||||
// IPTV specific settings
|
|
||||||
Add(new cMenuEditStraItem(tr("Protocol"), &data.protocol,
|
|
||||||
eProtocolCount, protocols));
|
|
||||||
switch (data.protocol) {
|
|
||||||
case eProtocolFILE:
|
|
||||||
Add(new cMenuEditStrItem(trVDR("File"), data.location, sizeof(data.location)));
|
|
||||||
Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.parameter, 0, 0xFFFF));
|
|
||||||
break;
|
|
||||||
case eProtocolEXT:
|
|
||||||
Add(new cMenuEditStrItem(tr("Script"), data.location, sizeof(data.location)));
|
|
||||||
Add(new cMenuEditIntItem(tr("Parameter"), &data.parameter, 0, 0xFFFF));
|
|
||||||
break;
|
|
||||||
case eProtocolHTTP:
|
|
||||||
case eProtocolUDP:
|
|
||||||
default:
|
|
||||||
Add(new cMenuEditStrItem(tr("Address"), data.location, sizeof(data.location)));
|
|
||||||
Add(new cMenuEditIntItem(tr("Port"), &data.parameter, 0, 0xFFFF));
|
|
||||||
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
|
|
||||||
Add(new cMenuEditStrItem(trVDR("Name"), data.name, sizeof(data.name)));
|
|
||||||
Add(new cMenuEditIntItem(trVDR("Frequency"), &data.frequency));
|
|
||||||
Add(new cMenuEditIntItem(trVDR("Vpid"), &data.vpid, 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("Apid2"), &data.apid[1], 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("Spid1"), &data.spid[0], 0, 0x1FFF));
|
|
||||||
Add(new cMenuEditIntItem(trVDR("Spid2"), &data.spid[1], 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("Sid"), &data.sid, 1, 0xFFFF));
|
|
||||||
Add(new cMenuEditIntItem(tr ("Nid"), &data.nid, 0, 0xFFFF));
|
|
||||||
Add(new cMenuEditIntItem(tr ("Tid"), &data.tid, 0, 0xFFFF));
|
|
||||||
Add(new cMenuEditIntItem(tr ("Rid"), &data.rid, 0, 0x1FFF));
|
|
||||||
SetCurrent(Get(current));
|
|
||||||
Display();
|
|
||||||
}
|
|
||||||
|
|
||||||
eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
|
|
||||||
{
|
|
||||||
int oldProtocol = data.protocol;
|
|
||||||
eOSState state = cOsdMenu::ProcessKey(Key);
|
|
||||||
if (state == osUnknown) {
|
|
||||||
if (Key == kOk) {
|
|
||||||
cChannel newchannel;
|
|
||||||
SetChannelData(&newchannel);
|
|
||||||
bool uniquityFailed = false;
|
|
||||||
bool firstIncrement = true;
|
|
||||||
// Search for identical channels as these will be ignored by vdr
|
|
||||||
for (cChannel *iteratorChannel = Channels.First(); iteratorChannel;
|
|
||||||
iteratorChannel = Channels.Next(iteratorChannel)) {
|
|
||||||
// This is one of the channels cause the uniquity check to fail
|
|
||||||
if (!iteratorChannel->GroupSep() && iteratorChannel != channel &&
|
|
||||||
iteratorChannel->GetChannelID() == newchannel.GetChannelID()) {
|
|
||||||
// See if it has unique Plugin param. If yes then increment
|
|
||||||
// the corresponding Rid until it is unique
|
|
||||||
if (strcmp(iteratorChannel->PluginParam(),
|
|
||||||
newchannel.PluginParam())) {
|
|
||||||
// If the channel RID is already at maximum, then fail the
|
|
||||||
// channel modification
|
|
||||||
if (iteratorChannel->Rid() >= 0x1FFF) {
|
|
||||||
debug("Cannot increment RID over maximum value\n");
|
|
||||||
uniquityFailed = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
debug("Incrementing conflicting channel RID\n");
|
|
||||||
iteratorChannel->SetId(iteratorChannel->Nid(),
|
|
||||||
iteratorChannel->Tid(),
|
|
||||||
iteratorChannel->Sid(),
|
|
||||||
firstIncrement ?
|
|
||||||
0 : iteratorChannel->Rid() + 1);
|
|
||||||
|
|
||||||
// Try zero Rid:s at first increment. Prevents them from
|
|
||||||
// creeping slowly towards their maximum value
|
|
||||||
firstIncrement = false;
|
|
||||||
|
|
||||||
// Re-set the search and start again
|
|
||||||
iteratorChannel = Channels.First();
|
|
||||||
continue;
|
|
||||||
// Cannot work around by incrementing rid because channels
|
|
||||||
// are actually copies of each other
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
uniquityFailed = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!uniquityFailed) {
|
|
||||||
if (channel) {
|
|
||||||
SetChannelData(channel);
|
|
||||||
isyslog("edited channel %d %s", channel->Number(), *channel->ToText());
|
|
||||||
state = osBack;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
channel = new cChannel;
|
|
||||||
SetChannelData(channel);
|
|
||||||
Channels.Add(channel);
|
|
||||||
Channels.ReNumber();
|
|
||||||
isyslog("added channel %d %s", channel->Number(), *channel->ToText());
|
|
||||||
state = osUser1;
|
|
||||||
}
|
|
||||||
Channels.SetModified(true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Skins.Message(mtError, tr("Cannot find unique channel settings!"));
|
|
||||||
state = osContinue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((Key != kNone) && (data.protocol != oldProtocol)) {
|
|
||||||
switch (data.protocol) {
|
|
||||||
case eProtocolEXT:
|
|
||||||
strn0cpy(data.location, "iptvstream.sh", sizeof(data.location));
|
|
||||||
data.parameter = 0;
|
|
||||||
break;
|
|
||||||
case eProtocolFILE:
|
|
||||||
strn0cpy(data.location, "/video/stream.ts", sizeof(data.location));
|
|
||||||
data.parameter = 0;
|
|
||||||
break;
|
|
||||||
case eProtocolHTTP:
|
|
||||||
strn0cpy(data.location, "127.0.0.1/TS/1", sizeof(data.location));
|
|
||||||
data.parameter = 3000;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
case eProtocolUDP:
|
|
||||||
strn0cpy(data.location, "127.0.0.1", sizeof(data.location));
|
|
||||||
data.parameter = 1234;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Setup();
|
|
||||||
}
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- cIptvMenuChannelItem --------------------------------------------------
|
|
||||||
|
|
||||||
class cIptvMenuChannelItem : public cOsdItem
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
cChannel *channel;
|
|
||||||
|
|
||||||
public:
|
|
||||||
cIptvMenuChannelItem(cChannel *Channel);
|
|
||||||
virtual void Set(void);
|
|
||||||
cChannel *Channel(void) { return channel; }
|
|
||||||
};
|
|
||||||
|
|
||||||
cIptvMenuChannelItem::cIptvMenuChannelItem(cChannel *Channel)
|
|
||||||
{
|
|
||||||
channel = Channel;
|
|
||||||
Set();
|
|
||||||
}
|
|
||||||
|
|
||||||
void cIptvMenuChannelItem::Set(void)
|
|
||||||
{
|
|
||||||
SetText(cString::sprintf("%d\t%s", channel->Number(), channel->Name()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- cIptvMenuChannels -----------------------------------------------------
|
|
||||||
|
|
||||||
class cIptvMenuChannels : public cOsdMenu
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
void Setup(void);
|
|
||||||
cChannel *GetChannel(int Index);
|
|
||||||
void Propagate(void);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
eOSState Edit(void);
|
|
||||||
eOSState New(void);
|
|
||||||
eOSState Delete(void);
|
|
||||||
eOSState Switch(void);
|
|
||||||
|
|
||||||
public:
|
|
||||||
cIptvMenuChannels();
|
|
||||||
~cIptvMenuChannels();
|
|
||||||
virtual eOSState ProcessKey(eKeys Key);
|
|
||||||
};
|
|
||||||
|
|
||||||
cIptvMenuChannels::cIptvMenuChannels(void)
|
|
||||||
:cOsdMenu(tr("IPTV Channels"), numdigits(Channels.MaxNumber()) + 1)
|
|
||||||
{
|
|
||||||
Setup();
|
|
||||||
Channels.IncBeingEdited();
|
|
||||||
}
|
|
||||||
|
|
||||||
cIptvMenuChannels::~cIptvMenuChannels()
|
|
||||||
{
|
|
||||||
Channels.DecBeingEdited();
|
|
||||||
}
|
|
||||||
|
|
||||||
void cIptvMenuChannels::Setup(void)
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
|
|
||||||
if (!channel->GroupSep() && channel->IsPlug() && !strncasecmp(channel->PluginParam(), "IPTV", 4)) {
|
|
||||||
cIptvMenuChannelItem *item = new cIptvMenuChannelItem(channel);
|
|
||||||
Add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SetHelp(trVDR("Button$Edit"), trVDR("Button$New"), trVDR("Button$Delete"), NULL);
|
|
||||||
Display();
|
|
||||||
}
|
|
||||||
|
|
||||||
cChannel *cIptvMenuChannels::GetChannel(int Index)
|
|
||||||
{
|
|
||||||
cIptvMenuChannelItem *p = (cIptvMenuChannelItem *)Get(Index);
|
|
||||||
return p ? (cChannel *)p->Channel() : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cIptvMenuChannels::Propagate(void)
|
|
||||||
{
|
|
||||||
Channels.ReNumber();
|
|
||||||
for (cIptvMenuChannelItem *ci = (cIptvMenuChannelItem *)First(); ci; ci = (cIptvMenuChannelItem *)ci->Next())
|
|
||||||
ci->Set();
|
|
||||||
Display();
|
|
||||||
Channels.SetModified(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
eOSState cIptvMenuChannels::Switch(void)
|
|
||||||
{
|
|
||||||
if (HasSubMenu() || Count() == 0)
|
|
||||||
return osContinue;
|
|
||||||
cChannel *ch = GetChannel(Current());
|
|
||||||
if (ch)
|
|
||||||
return cDevice::PrimaryDevice()->SwitchChannel(ch, true) ? osEnd : osContinue;
|
|
||||||
return osEnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
eOSState cIptvMenuChannels::Edit(void)
|
|
||||||
{
|
|
||||||
if (HasSubMenu() || Count() == 0)
|
|
||||||
return osContinue;
|
|
||||||
cChannel *ch = GetChannel(Current());
|
|
||||||
if (ch)
|
|
||||||
return AddSubMenu(new cIptvMenuEditChannel(ch));
|
|
||||||
return osContinue;
|
|
||||||
}
|
|
||||||
|
|
||||||
eOSState cIptvMenuChannels::New(void)
|
|
||||||
{
|
|
||||||
if (HasSubMenu())
|
|
||||||
return osContinue;
|
|
||||||
return AddSubMenu(new cIptvMenuEditChannel(GetChannel(Current()), true));
|
|
||||||
}
|
|
||||||
|
|
||||||
eOSState cIptvMenuChannels::Delete(void)
|
|
||||||
{
|
|
||||||
if (!HasSubMenu() && Count() > 0) {
|
|
||||||
int CurrentChannelNr = cDevice::CurrentChannel();
|
|
||||||
cChannel *CurrentChannel = Channels.GetByNumber(CurrentChannelNr);
|
|
||||||
int Index = Current();
|
|
||||||
cChannel *channel = GetChannel(Current());
|
|
||||||
int DeletedChannel = channel->Number();
|
|
||||||
// Check if there is a timer using this channel:
|
|
||||||
if (channel->HasTimer()) {
|
|
||||||
Skins.Message(mtError, trVDR("Channel is being used by a timer!"));
|
|
||||||
return osContinue;
|
|
||||||
}
|
|
||||||
if (Interface->Confirm(trVDR("Delete channel?"))) {
|
|
||||||
if (CurrentChannel && channel == CurrentChannel) {
|
|
||||||
int n = Channels.GetNextNormal(CurrentChannel->Index());
|
|
||||||
if (n < 0)
|
|
||||||
n = Channels.GetPrevNormal(CurrentChannel->Index());
|
|
||||||
CurrentChannel = Channels.Get(n);
|
|
||||||
CurrentChannelNr = 0; // triggers channel switch below
|
|
||||||
}
|
|
||||||
Channels.Del(channel);
|
|
||||||
cOsdMenu::Del(Index);
|
|
||||||
Propagate();
|
|
||||||
isyslog("channel %d deleted", DeletedChannel);
|
|
||||||
if (CurrentChannel && CurrentChannel->Number() != CurrentChannelNr) {
|
|
||||||
if (!cDevice::PrimaryDevice()->Replaying() || cDevice::PrimaryDevice()->Transferring())
|
|
||||||
Channels.SwitchTo(CurrentChannel->Number());
|
|
||||||
else
|
|
||||||
cDevice::SetCurrentChannel(CurrentChannel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return osContinue;
|
|
||||||
}
|
|
||||||
|
|
||||||
eOSState cIptvMenuChannels::ProcessKey(eKeys Key)
|
|
||||||
{
|
|
||||||
eOSState state = cOsdMenu::ProcessKey(Key);
|
|
||||||
|
|
||||||
switch (state) {
|
|
||||||
case osUser1: {
|
|
||||||
cChannel *channel = Channels.Last();
|
|
||||||
if (channel) {
|
|
||||||
Add(new cIptvMenuChannelItem(channel), true);
|
|
||||||
return CloseSubMenu();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (state == osUnknown) {
|
|
||||||
switch (Key) {
|
|
||||||
case kOk: return Switch();
|
|
||||||
case kRed: return Edit();
|
|
||||||
case kGreen: return New();
|
|
||||||
case kYellow: return Delete();
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- cIptvMenuInfo ---------------------------------------------------------
|
// --- cIptvMenuInfo ---------------------------------------------------------
|
||||||
|
|
||||||
class cIptvMenuInfo : public cOsdMenu
|
class cIptvMenuInfo : public cOsdMenu
|
||||||
@@ -602,7 +66,7 @@ void cIptvMenuInfo::Display(void)
|
|||||||
|
|
||||||
eOSState cIptvMenuInfo::ProcessKey(eKeys Key)
|
eOSState cIptvMenuInfo::ProcessKey(eKeys Key)
|
||||||
{
|
{
|
||||||
switch (Key) {
|
switch (int(Key)) {
|
||||||
case kUp|k_Repeat:
|
case kUp|k_Repeat:
|
||||||
case kUp:
|
case kUp:
|
||||||
case kDown|k_Repeat:
|
case kDown|k_Repeat:
|
||||||
@@ -631,7 +95,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())
|
||||||
@@ -660,7 +124,7 @@ cIptvPluginSetup::cIptvPluginSetup()
|
|||||||
disabledFilterNames[i] = tr(section_filter_table[i].description);
|
disabledFilterNames[i] = tr(section_filter_table[i].description);
|
||||||
}
|
}
|
||||||
Setup();
|
Setup();
|
||||||
SetHelp(trVDR("Channels"), NULL, NULL, trVDR("Button$Info"));
|
SetHelp(NULL, NULL, NULL, trVDR("Button$Info"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cIptvPluginSetup::Setup(void)
|
void cIptvPluginSetup::Setup(void)
|
||||||
@@ -697,14 +161,6 @@ void cIptvPluginSetup::Setup(void)
|
|||||||
Display();
|
Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
eOSState cIptvPluginSetup::EditChannel(void)
|
|
||||||
{
|
|
||||||
debug("cIptvPluginSetup::EditChannel()\n");
|
|
||||||
if (HasSubMenu())
|
|
||||||
return osContinue;
|
|
||||||
return AddSubMenu(new cIptvMenuChannels());
|
|
||||||
}
|
|
||||||
|
|
||||||
eOSState cIptvPluginSetup::ShowInfo(void)
|
eOSState cIptvPluginSetup::ShowInfo(void)
|
||||||
{
|
{
|
||||||
debug("cIptvPluginSetup::ShowInfo()\n");
|
debug("cIptvPluginSetup::ShowInfo()\n");
|
||||||
@@ -721,11 +177,10 @@ eOSState cIptvPluginSetup::ProcessKey(eKeys Key)
|
|||||||
|
|
||||||
if (state == osUnknown) {
|
if (state == osUnknown) {
|
||||||
switch (Key) {
|
switch (Key) {
|
||||||
case kRed: return EditChannel();
|
|
||||||
case kBlue: return ShowInfo();
|
case kBlue: return ShowInfo();
|
||||||
case kInfo: if (Current() < help.Size())
|
case kInfo: if (Current() < help.Size())
|
||||||
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), help[Current()]));
|
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), help[Current()]));
|
||||||
default: state = osContinue;
|
default: state = osContinue; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
51
setup.h
51
setup.h
@@ -3,15 +3,61 @@
|
|||||||
*
|
*
|
||||||
* 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.21 2008/02/19 22:29:02 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_SETUP_H
|
#ifndef __IPTV_SETUP_H
|
||||||
#define __IPTV_SETUP_H
|
#define __IPTV_SETUP_H
|
||||||
|
|
||||||
#include <vdr/menuitems.h>
|
#include <vdr/menuitems.h>
|
||||||
|
#include <vdr/sourceparams.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
class cIptvTransponderParameters
|
||||||
|
{
|
||||||
|
friend class cIptvSourceParam;
|
||||||
|
private:
|
||||||
|
int sidscan;
|
||||||
|
int pidscan;
|
||||||
|
int protocol;
|
||||||
|
char address[MaxFileName];
|
||||||
|
int parameter;
|
||||||
|
public:
|
||||||
|
cIptvTransponderParameters(const char *Parameters = NULL);
|
||||||
|
int SidScan(void) const { return sidscan; }
|
||||||
|
int PidScan(void) const { return pidscan; }
|
||||||
|
int Protocol(void) const { return protocol; }
|
||||||
|
const char *Address(void) const { return address; }
|
||||||
|
int Parameter(void) const { return parameter; }
|
||||||
|
void SetSidScan(int SidScan) { sidscan = SidScan; }
|
||||||
|
void SetPidScan(int PidScan) { pidscan = PidScan; }
|
||||||
|
void SetProtocol(int Protocol) { protocol = Protocol; }
|
||||||
|
void SetAddress(const char *Address) { strncpy(address, Address, sizeof(address)); }
|
||||||
|
void SetParameter(int Parameter) { parameter = Parameter; }
|
||||||
|
cString ToString(char Type) const;
|
||||||
|
bool Parse(const char *s);
|
||||||
|
};
|
||||||
|
|
||||||
|
class cIptvSourceParam : public cSourceParam
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
enum {
|
||||||
|
eProtocolUDP,
|
||||||
|
eProtocolHTTP,
|
||||||
|
eProtocolFILE,
|
||||||
|
eProtocolEXT,
|
||||||
|
eProtocolCount
|
||||||
|
};
|
||||||
|
int param;
|
||||||
|
cChannel data;
|
||||||
|
cIptvTransponderParameters itp;
|
||||||
|
const char *protocols[eProtocolCount];
|
||||||
|
public:
|
||||||
|
cIptvSourceParam(char Source, const char *Description);
|
||||||
|
virtual void SetData(cChannel *Channel);
|
||||||
|
virtual void GetData(cChannel *Channel);
|
||||||
|
virtual cOsdItem *GetOsdItem(void);
|
||||||
|
};
|
||||||
|
|
||||||
class cIptvPluginSetup : public cMenuSetupPage
|
class cIptvPluginSetup : public cMenuSetupPage
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -24,9 +70,8 @@ private:
|
|||||||
const char *disabledFilterNames[SECTION_FILTER_TABLE_SIZE];
|
const char *disabledFilterNames[SECTION_FILTER_TABLE_SIZE];
|
||||||
cVector<const char*> help;
|
cVector<const char*> help;
|
||||||
|
|
||||||
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:
|
||||||
|
|||||||
98
sidscanner.c
98
sidscanner.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: sidscanner.c,v 1.1 2007/10/01 18:14:57 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libsi/section.h>
|
#include <libsi/section.h>
|
||||||
@@ -12,10 +11,19 @@
|
|||||||
#include "sidscanner.h"
|
#include "sidscanner.h"
|
||||||
|
|
||||||
cSidScanner::cSidScanner(void)
|
cSidScanner::cSidScanner(void)
|
||||||
|
: channelId(tChannelID::InvalidID),
|
||||||
|
sidFound(false),
|
||||||
|
nidFound(false),
|
||||||
|
tidFound(false)
|
||||||
{
|
{
|
||||||
debug("cSidScanner::cSidScanner()\n");
|
debug("cSidScanner::cSidScanner()\n");
|
||||||
channel = cChannel();
|
|
||||||
Set(0x00, 0x00); // PAT
|
Set(0x00, 0x00); // PAT
|
||||||
|
Set(0x10, 0x40); // NIT
|
||||||
|
}
|
||||||
|
|
||||||
|
cSidScanner::~cSidScanner()
|
||||||
|
{
|
||||||
|
debug("cSidScanner::~cSidScanner()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSidScanner::SetStatus(bool On)
|
void cSidScanner::SetStatus(bool On)
|
||||||
@@ -24,42 +32,70 @@ void cSidScanner::SetStatus(bool On)
|
|||||||
cFilter::SetStatus(On);
|
cFilter::SetStatus(On);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSidScanner::SetChannel(const cChannel *Channel)
|
void cSidScanner::SetChannel(const tChannelID &ChannelId)
|
||||||
{
|
{
|
||||||
if (Channel) {
|
debug("cSidScanner::SetChannel(): %s\n", *ChannelId.ToString());
|
||||||
debug("cSidScanner::SetChannel(): %s\n", Channel->PluginParam());
|
channelId = ChannelId;
|
||||||
channel = *Channel;
|
sidFound = false;
|
||||||
}
|
nidFound = false;
|
||||||
else {
|
tidFound = false;
|
||||||
debug("cSidScanner::SetChannel()\n");
|
|
||||||
channel = cChannel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSidScanner::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
|
void cSidScanner::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
|
||||||
{
|
{
|
||||||
|
int newSid = -1, newNid = -1, newTid = -1;
|
||||||
|
|
||||||
//debug("cSidScanner::Process()\n");
|
//debug("cSidScanner::Process()\n");
|
||||||
if ((Pid == 0x00) && (Tid == 0x00) && channel.GetChannelID().Valid()) {
|
if (channelId.Valid()) {
|
||||||
debug("cSidScanner::Process(): Pid=%d Tid=%02X\n", Pid, Tid);
|
if ((Pid == 0x00) && (Tid == 0x00)) {
|
||||||
SI::PAT pat(Data, false);
|
debug("cSidScanner::Process(): Pid=%d Tid=%02X\n", Pid, Tid);
|
||||||
if (!pat.CheckCRCAndParse())
|
SI::PAT pat(Data, false);
|
||||||
return;
|
if (!pat.CheckCRCAndParse())
|
||||||
SI::PAT::Association assoc;
|
return;
|
||||||
for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) {
|
SI::PAT::Association assoc;
|
||||||
if (!assoc.isNITPid()) {
|
for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) {
|
||||||
if (assoc.getServiceId() != channel.Sid()) {
|
if (!assoc.isNITPid()) {
|
||||||
debug("cSidScanner::Process(): Sid=%d\n", assoc.getServiceId());
|
if (assoc.getServiceId() != channelId.Sid()) {
|
||||||
if (!Channels.Lock(true, 10))
|
debug("cSidScanner::Process(): Sid=%d\n", assoc.getServiceId());
|
||||||
return;
|
newSid = assoc.getServiceId();
|
||||||
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
|
}
|
||||||
IptvChannel->SetId(IptvChannel->Nid(), IptvChannel->Tid(),
|
sidFound = true;
|
||||||
assoc.getServiceId(), IptvChannel->Rid());
|
break;
|
||||||
Channels.Unlock();
|
|
||||||
}
|
}
|
||||||
SetChannel(NULL);
|
|
||||||
SetStatus(false);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ((Pid == 0x10) && (Tid == 0x40)) {
|
||||||
|
debug("cSidScanner::Process(): Pid=%d Tid=%02X\n", Pid, Tid);
|
||||||
|
SI::NIT nit(Data, false);
|
||||||
|
if (!nit.CheckCRCAndParse())
|
||||||
|
return;
|
||||||
|
SI::NIT::TransportStream ts;
|
||||||
|
for (SI::Loop::Iterator it; nit.transportStreamLoop.getNext(ts, it); ) {
|
||||||
|
if (ts.getTransportStreamId() != channelId.Tid()) {
|
||||||
|
debug("cSidScanner::Process(): TSid=%d\n", ts.getTransportStreamId());
|
||||||
|
newTid = ts.getTransportStreamId();
|
||||||
|
}
|
||||||
|
tidFound = true;
|
||||||
|
break; // default to the first one
|
||||||
|
}
|
||||||
|
if (nit.getNetworkId() != channelId.Nid()) {
|
||||||
|
debug("cSidScanner::Process(): Nid=%d\n", ts.getTransportStreamId());
|
||||||
|
newNid = nit.getNetworkId();
|
||||||
|
}
|
||||||
|
nidFound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) {
|
||||||
|
if (!Channels.Lock(true, 10))
|
||||||
|
return;
|
||||||
|
cChannel *IptvChannel = Channels.GetByChannelID(channelId);
|
||||||
|
if (IptvChannel)
|
||||||
|
IptvChannel->SetId((newNid < 0) ? IptvChannel->Nid() : newNid, (newTid < 0) ? IptvChannel->Tid() : newTid,
|
||||||
|
(newSid < 0) ? IptvChannel->Sid() : newSid, IptvChannel->Rid());
|
||||||
|
Channels.Unlock();
|
||||||
|
}
|
||||||
|
if (sidFound && nidFound && tidFound) {
|
||||||
|
SetChannel(tChannelID::InvalidID);
|
||||||
|
SetStatus(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
sidscanner.h
13
sidscanner.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: sidscanner.h,v 1.1 2007/10/01 18:14:57 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SIDSCANNER_H
|
#ifndef __SIDSCANNER_H
|
||||||
@@ -14,15 +13,21 @@
|
|||||||
|
|
||||||
class cSidScanner : public cFilter {
|
class cSidScanner : public cFilter {
|
||||||
private:
|
private:
|
||||||
cChannel channel;
|
tChannelID channelId;
|
||||||
|
bool sidFound;
|
||||||
|
bool nidFound;
|
||||||
|
bool tidFound;
|
||||||
|
|
||||||
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);
|
~cSidScanner();
|
||||||
void SetChannel(const cChannel *Channel);
|
void SetChannel(const tChannelID &ChannelId);
|
||||||
|
void Open() { SetStatus(true); }
|
||||||
|
void Close() { SetStatus(false); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __SIDSCANNER_H
|
#endif // __SIDSCANNER_H
|
||||||
|
|||||||
254
socket.c
254
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.7 2008/01/30 21:57:33 rahrenbe Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -21,14 +20,10 @@
|
|||||||
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
|
memset(&sockAddr, '\0', sizeof(sockAddr));
|
||||||
readBuffer = MALLOC(unsigned char, readBufferLen);
|
|
||||||
if (!readBuffer)
|
|
||||||
error("ERROR: MALLOC() failed in socket()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cIptvSocket::~cIptvSocket()
|
cIptvSocket::~cIptvSocket()
|
||||||
@@ -36,8 +31,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 +44,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,14 +52,18 @@ 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(O_NONBLOCK)",
|
||||||
|
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(SO_REUSEADDR)",
|
||||||
sizeof(yes)) < 0, "setsockopt()", CloseSocket(), return false);
|
CloseSocket(), return false);
|
||||||
|
// Allow packet information to be fetched
|
||||||
|
ERROR_IF_FUNC(setsockopt(socketDesc, SOL_IP, IP_PKTINFO, &yes, sizeof(yes)) < 0, "setsockopt(IP_PKTINFO)",
|
||||||
|
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));
|
||||||
@@ -85,11 +82,14 @@ void cIptvSocket::CloseSocket(void)
|
|||||||
if (socketDesc >= 0) {
|
if (socketDesc >= 0) {
|
||||||
close(socketDesc);
|
close(socketDesc);
|
||||||
socketDesc = -1;
|
socketDesc = -1;
|
||||||
|
socketPort = 0;
|
||||||
|
memset(&sockAddr, 0, sizeof(sockAddr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UDP socket class
|
// UDP socket class
|
||||||
cIptvUdpSocket::cIptvUdpSocket()
|
cIptvUdpSocket::cIptvUdpSocket()
|
||||||
|
: streamAddr(INADDR_ANY)
|
||||||
{
|
{
|
||||||
debug("cIptvUdpSocket::cIptvUdpSocket()\n");
|
debug("cIptvUdpSocket::cIptvUdpSocket()\n");
|
||||||
}
|
}
|
||||||
@@ -99,64 +99,123 @@ cIptvUdpSocket::~cIptvUdpSocket()
|
|||||||
debug("cIptvUdpSocket::~cIptvUdpSocket()\n");
|
debug("cIptvUdpSocket::~cIptvUdpSocket()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvUdpSocket::OpenSocket(const int Port)
|
bool cIptvUdpSocket::OpenSocket(const int Port, const in_addr_t StreamAddr)
|
||||||
{
|
{
|
||||||
debug("cIptvUdpSocket::OpenSocket()\n");
|
debug("cIptvUdpSocket::OpenSocket()\n");
|
||||||
|
streamAddr = StreamAddr;
|
||||||
return cIptvSocket::OpenSocket(Port, true);
|
return cIptvSocket::OpenSocket(Port, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvUdpSocket::Read(unsigned char* *BufferAddr)
|
void cIptvUdpSocket::CloseSocket(void)
|
||||||
|
{
|
||||||
|
debug("cIptvUdpSocket::CloseSocket()\n");
|
||||||
|
streamAddr = INADDR_ANY;
|
||||||
|
cIptvSocket::CloseSocket();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cIptvUdpSocket::JoinMulticast(void)
|
||||||
|
{
|
||||||
|
debug("cIptvUdpSocket::JoinMulticast()\n");
|
||||||
|
// Check if socket exists
|
||||||
|
if (!isActive && (socketDesc >= 0)) {
|
||||||
|
// Join a new multicast group
|
||||||
|
struct ip_mreq mreq;
|
||||||
|
mreq.imr_multiaddr.s_addr = streamAddr;
|
||||||
|
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
||||||
|
ERROR_IF_RET(setsockopt(socketDesc, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0, "setsockopt(IP_ADD_MEMBERSHIP)", return false);
|
||||||
|
// Update multicasting flag
|
||||||
|
isActive = true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cIptvUdpSocket::DropMulticast(void)
|
||||||
|
{
|
||||||
|
debug("cIptvUdpSocket::DropMulticast()\n");
|
||||||
|
// Check if socket exists
|
||||||
|
if (isActive && (socketDesc >= 0)) {
|
||||||
|
// Drop the existing multicast group
|
||||||
|
struct ip_mreq mreq;
|
||||||
|
mreq.imr_multiaddr.s_addr = streamAddr;
|
||||||
|
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
||||||
|
ERROR_IF_RET(setsockopt(socketDesc, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)) < 0, "setsockopt(IP_DROP_MEMBERSHIP)", return false);
|
||||||
|
// Update multicasting flag
|
||||||
|
isActive = false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
struct msghdr msgh;
|
||||||
// Wait 500ms for data
|
struct cmsghdr *cmsg;
|
||||||
int retval = select_single_desc(socketDesc, 500000, false);
|
struct iovec iov;
|
||||||
// Check if error
|
char cbuf[256];
|
||||||
if (retval < 0)
|
// Initialize iov and msgh structures
|
||||||
return retval;
|
memset(&msgh, 0, sizeof(struct msghdr));
|
||||||
// Check if data available
|
iov.iov_base = BufferAddr;
|
||||||
else if (retval) {
|
iov.iov_len = BufferLen;
|
||||||
int len = 0;
|
msgh.msg_control = cbuf;
|
||||||
// Read data from socket
|
msgh.msg_controllen = sizeof(cbuf);
|
||||||
if (isActive)
|
msgh.msg_name = &sockAddr;
|
||||||
len = recvfrom(socketDesc, readBuffer, readBufferLen, MSG_DONTWAIT,
|
msgh.msg_namelen = addrlen;
|
||||||
(struct sockaddr *)&sockAddr, &addrlen);
|
msgh.msg_iov = &iov;
|
||||||
ERROR_IF_RET(len < 0, "recvfrom()", return len);
|
msgh.msg_iovlen = 1;
|
||||||
if ((len > 0) && (readBuffer[0] == 0x47)) {
|
msgh.msg_flags = 0;
|
||||||
// Set argument point to read buffer
|
// Read data from socket
|
||||||
*BufferAddr = &readBuffer[0];
|
if (isActive && socketDesc && BufferAddr && (BufferLen > 0))
|
||||||
|
len = (int)recvmsg(socketDesc, &msgh, MSG_DONTWAIT);
|
||||||
|
if (len < 0) {
|
||||||
|
ERROR_IF(errno != EAGAIN, "recvmsg()");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else if (len > 0) {
|
||||||
|
// Process auxiliary received data and validate source address
|
||||||
|
for (cmsg = CMSG_FIRSTHDR(&msgh); (streamAddr != INADDR_ANY) && (cmsg != NULL); cmsg = CMSG_NXTHDR(&msgh, cmsg)) {
|
||||||
|
if ((cmsg->cmsg_level == SOL_IP) && (cmsg->cmsg_type == IP_PKTINFO)) {
|
||||||
|
struct in_pktinfo *i = (struct in_pktinfo *)CMSG_DATA(cmsg);
|
||||||
|
if (i->ipi_addr.s_addr != streamAddr) {
|
||||||
|
//debug("Discard packet due to invalid source address: %s", inet_ntoa(i->ipi_addr));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (BufferAddr[0] == TS_SYNC_BYTE)
|
||||||
return len;
|
return len;
|
||||||
}
|
|
||||||
else if (len > 3) {
|
else if (len > 3) {
|
||||||
// http://www.networksorcery.com/enp/rfc/rfc2250.txt
|
// http://www.networksorcery.com/enp/rfc/rfc2250.txt
|
||||||
// version
|
// version
|
||||||
unsigned int v = (readBuffer[0] >> 6) & 0x03;
|
unsigned int v = (BufferAddr[0] >> 6) & 0x03;
|
||||||
// extension bit
|
// extension bit
|
||||||
unsigned int x = (readBuffer[0] >> 4) & 0x01;
|
unsigned int x = (BufferAddr[0] >> 4) & 0x01;
|
||||||
// cscr count
|
// cscr count
|
||||||
unsigned int cc = readBuffer[0] & 0x0F;
|
unsigned int cc = BufferAddr[0] & 0x0F;
|
||||||
// payload type: MPEG2 TS = 33
|
// payload type: MPEG2 TS = 33
|
||||||
//unsigned int pt = readBuffer[1] & 0x7F;
|
//unsigned int pt = readBuffer[1] & 0x7F;
|
||||||
// header lenght
|
// header lenght
|
||||||
unsigned int headerlen = (3 + cc) * sizeof(uint32_t);
|
unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t);
|
||||||
// check if extension
|
// check if extension
|
||||||
if (x) {
|
if (x) {
|
||||||
// extension header length
|
// extension header length
|
||||||
unsigned int ehl = (((readBuffer[headerlen + 2] & 0xFF) << 8) | (readBuffer[headerlen + 3] & 0xFF));
|
unsigned int ehl = (((BufferAddr[headerlen + 2] & 0xFF) << 8) |
|
||||||
|
(BufferAddr[headerlen + 3] & 0xFF));
|
||||||
// update header length
|
// update header length
|
||||||
headerlen += (ehl + 1) * sizeof(uint32_t);
|
headerlen += (ehl + 1) * (unsigned int)sizeof(uint32_t);
|
||||||
}
|
}
|
||||||
// Check that rtp is version 2 and payload contains multiple of TS packet data
|
// 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)) {
|
if ((v == 2) && (((len - headerlen) % TS_SIZE) == 0) &&
|
||||||
|
(BufferAddr[headerlen] == TS_SYNC_BYTE)) {
|
||||||
// Set argument point to payload in read buffer
|
// Set argument point to payload in read buffer
|
||||||
*BufferAddr = &readBuffer[headerlen];
|
memmove(BufferAddr, &BufferAddr[headerlen], (len - headerlen));
|
||||||
return (len - headerlen);
|
return (len - headerlen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,34 +234,117 @@ cIptvTcpSocket::~cIptvTcpSocket()
|
|||||||
debug("cIptvTcpSocket::~cIptvTcpSocket()\n");
|
debug("cIptvTcpSocket::~cIptvTcpSocket()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cIptvTcpSocket::OpenSocket(const int Port)
|
bool cIptvTcpSocket::OpenSocket(const int Port, const char *StreamAddr)
|
||||||
{
|
{
|
||||||
debug("cIptvTcpSocket::OpenSocket()\n");
|
debug("cIptvTcpSocket::OpenSocket()\n");
|
||||||
return cIptvSocket::OpenSocket(Port, false);
|
|
||||||
|
// Socket must be opened before setting the host address
|
||||||
|
bool retval = cIptvSocket::OpenSocket(Port, false);
|
||||||
|
|
||||||
|
// First try only the IP address
|
||||||
|
sockAddr.sin_addr.s_addr = inet_addr(StreamAddr);
|
||||||
|
|
||||||
|
if (sockAddr.sin_addr.s_addr == INADDR_NONE) {
|
||||||
|
debug("Cannot convert %s directly to internet address\n", StreamAddr);
|
||||||
|
|
||||||
|
// It may be a host name, get the name
|
||||||
|
struct hostent *host;
|
||||||
|
host = gethostbyname(StreamAddr);
|
||||||
|
if (!host) {
|
||||||
|
char tmp[64];
|
||||||
|
error("gethostbyname() failed: %s is not valid address: %s", StreamAddr, strerror_r(h_errno, tmp, sizeof(tmp)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sockAddr.sin_addr.s_addr = inet_addr(*host->h_addr_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cIptvTcpSocket::Read(unsigned char* *BufferAddr)
|
void cIptvTcpSocket::CloseSocket(void)
|
||||||
|
{
|
||||||
|
debug("cIptvTcpSocket::CloseSocket()\n");
|
||||||
|
cIptvSocket::CloseSocket();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cIptvTcpSocket::ConnectSocket(void)
|
||||||
|
{
|
||||||
|
debug("cIptvTcpSocket::ConnectSocket()\n");
|
||||||
|
if (!isActive && (socketDesc >= 0)) {
|
||||||
|
int retval = connect(socketDesc, (struct sockaddr *)&sockAddr, sizeof(sockAddr));
|
||||||
|
// Non-blocking sockets always report in-progress error when connected
|
||||||
|
ERROR_IF_RET(retval < 0 && errno != EINPROGRESS, "connect()", return false);
|
||||||
|
// Select with 800ms timeout on the socket completion, check if it is writable
|
||||||
|
retval = select_single_desc(socketDesc, 800000, true);
|
||||||
|
if (retval < 0)
|
||||||
|
return retval;
|
||||||
|
// Select has returned. Get socket errors if there are any
|
||||||
|
retval = 0;
|
||||||
|
socklen_t len = sizeof(retval);
|
||||||
|
getsockopt(socketDesc, SOL_SOCKET, SO_ERROR, &retval, &len);
|
||||||
|
// If not any errors, then socket must be ready and connected
|
||||||
|
if (retval != 0) {
|
||||||
|
char tmp[64];
|
||||||
|
error("Connect() failed: %s", strerror_r(retval, tmp, sizeof(tmp)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
int len = 0;
|
||||||
|
socklen_t addrlen = sizeof(sockAddr);
|
||||||
|
// Read data from socket
|
||||||
|
if (isActive && socketDesc && BufferAddr && (BufferLen > 0))
|
||||||
|
len = (int)recvfrom(socketDesc, BufferAddr, BufferLen, MSG_DONTWAIT,
|
||||||
|
(struct sockaddr *)&sockAddr, &addrlen);
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cIptvTcpSocket::ReadChar(char* BufferAddr, unsigned int TimeoutMs)
|
||||||
|
{
|
||||||
|
//debug("cIptvTcpSocket::ReadChar()\n");
|
||||||
|
// Error out if socket not initialized
|
||||||
|
if (socketDesc <= 0) {
|
||||||
|
error("Invalid socket in %s\n", __FUNCTION__);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
socklen_t addrlen = sizeof(sockAddr);
|
socklen_t addrlen = sizeof(sockAddr);
|
||||||
// Set argument point to read buffer
|
|
||||||
*BufferAddr = readBuffer;
|
|
||||||
// Wait 500ms for data
|
// Wait 500ms for data
|
||||||
int retval = select_single_desc(socketDesc, 500000, false);
|
int retval = select_single_desc(socketDesc, 1000 * TimeoutMs, false);
|
||||||
// Check if error
|
// Check if error
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
return retval;
|
return false;
|
||||||
// Check if data available
|
// Check if data available
|
||||||
else if (retval) {
|
else if (retval) {
|
||||||
// Read data from socket
|
retval = (int)recvfrom(socketDesc, BufferAddr, 1, MSG_DONTWAIT,
|
||||||
if (isActive)
|
(struct sockaddr *)&sockAddr, &addrlen);
|
||||||
return recvfrom(socketDesc, readBuffer, readBufferLen, MSG_DONTWAIT,
|
if (retval <= 0)
|
||||||
(struct sockaddr *)&sockAddr, &addrlen);
|
return false;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cIptvTcpSocket::Write(const char* BufferAddr, unsigned int BufferLen)
|
||||||
|
{
|
||||||
|
//debug("cIptvTcpSocket::Write()\n");
|
||||||
|
// Error out if socket not initialized
|
||||||
|
if (socketDesc <= 0) {
|
||||||
|
error("Invalid socket in %s\n", __FUNCTION__);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ERROR_IF_RET(send(socketDesc, BufferAddr, BufferLen, 0) < 0, "send()", return false);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
25
socket.h
25
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
|
||||||
@@ -12,11 +11,11 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
class cIptvSocket {
|
class cIptvSocket {
|
||||||
protected:
|
private:
|
||||||
int socketPort;
|
int socketPort;
|
||||||
|
|
||||||
|
protected:
|
||||||
int socketDesc;
|
int socketDesc;
|
||||||
unsigned char* readBuffer;
|
|
||||||
unsigned int readBufferLen;
|
|
||||||
struct sockaddr_in sockAddr;
|
struct sockaddr_in sockAddr;
|
||||||
bool isActive;
|
bool isActive;
|
||||||
|
|
||||||
@@ -30,19 +29,29 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class cIptvUdpSocket : public cIptvSocket {
|
class cIptvUdpSocket : public cIptvSocket {
|
||||||
|
private:
|
||||||
|
in_addr_t streamAddr;
|
||||||
|
|
||||||
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, const in_addr_t StreamAddr = INADDR_ANY);
|
||||||
|
void CloseSocket(void);
|
||||||
|
bool JoinMulticast(void);
|
||||||
|
bool DropMulticast(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
class cIptvTcpSocket : public cIptvSocket {
|
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, const char *StreamAddr);
|
||||||
|
void CloseSocket(void);
|
||||||
|
bool ConnectSocket(void);
|
||||||
|
bool ReadChar(char* BufferAddr, unsigned int TimeoutMs);
|
||||||
|
bool Write(const char* BufferAddr, unsigned int BufferLen);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __IPTV_SOCKET_H
|
#endif // __IPTV_SOCKET_H
|
||||||
|
|||||||
176
source.c
Normal file
176
source.c
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
/*
|
||||||
|
* source.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 "source.h"
|
||||||
|
|
||||||
|
// --- cIptvTransponderParameters --------------------------------------------
|
||||||
|
|
||||||
|
cIptvTransponderParameters::cIptvTransponderParameters(const char *Parameters)
|
||||||
|
: sidscan(0),
|
||||||
|
pidscan(0),
|
||||||
|
protocol(eProtocolUDP),
|
||||||
|
parameter(0)
|
||||||
|
{
|
||||||
|
debug("cIptvTransponderParameters::cIptvTransponderParameters(): Parameters=%s\n", Parameters);
|
||||||
|
|
||||||
|
memset(&address, 0, sizeof(address));
|
||||||
|
Parse(Parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
cString cIptvTransponderParameters::ToString(char Type) const
|
||||||
|
{
|
||||||
|
debug("cIptvTransponderParameters::ToString() Type=%c\n", Type);
|
||||||
|
|
||||||
|
const char *protocolstr;
|
||||||
|
|
||||||
|
switch (protocol) {
|
||||||
|
case eProtocolEXT:
|
||||||
|
protocolstr = "EXT";
|
||||||
|
break;
|
||||||
|
case eProtocolHTTP:
|
||||||
|
protocolstr = "HTTP";
|
||||||
|
break;
|
||||||
|
case eProtocolFILE:
|
||||||
|
protocolstr = "FILE";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case eProtocolUDP:
|
||||||
|
protocolstr = "UDP";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return cString::sprintf("S=%d|P=%d|F=%s|U=%s|A=%d", sidscan, pidscan, protocolstr, address, parameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cIptvTransponderParameters::Parse(const char *s)
|
||||||
|
{
|
||||||
|
debug("cIptvTransponderParameters::Parse(): s=%s\n", s);
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
if (s && *s) {
|
||||||
|
const char *delim = "|";
|
||||||
|
char *str = strdup(s);
|
||||||
|
char *saveptr = NULL;
|
||||||
|
char *token = NULL;
|
||||||
|
bool found_s = false;
|
||||||
|
bool found_p = false;
|
||||||
|
bool found_f = false;
|
||||||
|
bool found_u = false;
|
||||||
|
bool found_a = false;
|
||||||
|
|
||||||
|
while ((token = strtok_r(str, delim, &saveptr)) != NULL) {
|
||||||
|
char *data = token;
|
||||||
|
++data;
|
||||||
|
if (data && (*data == '=')) {
|
||||||
|
++data;
|
||||||
|
switch (*token) {
|
||||||
|
case 'S':
|
||||||
|
sidscan = (int)strtol(data, (char **)NULL, 10);
|
||||||
|
found_s = true;
|
||||||
|
break;
|
||||||
|
case 'P':
|
||||||
|
pidscan = (int)strtol(data, (char **)NULL, 10);
|
||||||
|
found_p = true;
|
||||||
|
break;
|
||||||
|
case 'F':
|
||||||
|
if (strstr(data, "UDP")) {
|
||||||
|
protocol = eProtocolUDP;
|
||||||
|
found_f = true;
|
||||||
|
}
|
||||||
|
else if (strstr(data, "HTTP")) {
|
||||||
|
protocol = eProtocolHTTP;
|
||||||
|
found_f = true;
|
||||||
|
}
|
||||||
|
else if (strstr(data, "FILE")) {
|
||||||
|
protocol = eProtocolFILE;
|
||||||
|
found_f = true;
|
||||||
|
}
|
||||||
|
else if (strstr(data, "EXT")) {
|
||||||
|
protocol = eProtocolEXT;
|
||||||
|
found_f = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'U':
|
||||||
|
strn0cpy(address, data, sizeof(address));
|
||||||
|
found_u = true;
|
||||||
|
break;
|
||||||
|
case 'A':
|
||||||
|
parameter = (int)strtol(data, (char **)NULL, 10);
|
||||||
|
found_a = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found_s && found_p && found_f && found_u && found_a)
|
||||||
|
result = true;
|
||||||
|
else
|
||||||
|
error("Invalid channel parameters: %s\n", str);
|
||||||
|
|
||||||
|
free(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- cIptvSourceParam ------------------------------------------------------
|
||||||
|
|
||||||
|
cIptvSourceParam::cIptvSourceParam(char Source, const char *Description)
|
||||||
|
: cSourceParam(Source, Description),
|
||||||
|
param(0),
|
||||||
|
nid(0),
|
||||||
|
tid(0),
|
||||||
|
rid(0),
|
||||||
|
data(),
|
||||||
|
itp()
|
||||||
|
{
|
||||||
|
debug("cIptvSourceParam::cIptvSourceParam(): Source=%c Description=%s\n", Source, Description);
|
||||||
|
|
||||||
|
protocols[cIptvTransponderParameters::eProtocolUDP] = tr("UDP");
|
||||||
|
protocols[cIptvTransponderParameters::eProtocolHTTP] = tr("HTTP");
|
||||||
|
protocols[cIptvTransponderParameters::eProtocolFILE] = tr("FILE");
|
||||||
|
protocols[cIptvTransponderParameters::eProtocolEXT] = tr("EXT");
|
||||||
|
}
|
||||||
|
|
||||||
|
void cIptvSourceParam::SetData(cChannel *Channel)
|
||||||
|
{
|
||||||
|
debug("cIptvSourceParam::SetData(): Channel=%s)\n", Channel->Parameters());
|
||||||
|
data = *Channel;
|
||||||
|
nid = data.Nid();
|
||||||
|
tid = data.Tid();
|
||||||
|
rid = data.Rid();
|
||||||
|
itp.Parse(data.Parameters());
|
||||||
|
param = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cIptvSourceParam::GetData(cChannel *Channel)
|
||||||
|
{
|
||||||
|
debug("cIptvSourceParam::GetData(): Channel=%s\n", Channel->Parameters());
|
||||||
|
data.SetTransponderData(Channel->Source(), Channel->Frequency(), data.Srate(), itp.ToString(Source()), true);
|
||||||
|
data.SetId(nid, tid, Channel->Sid(), rid);
|
||||||
|
*Channel = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
cOsdItem *cIptvSourceParam::GetOsdItem(void)
|
||||||
|
{
|
||||||
|
debug("cIptvSourceParam::GetOsdItem()\n");
|
||||||
|
switch (param++) {
|
||||||
|
case 0: return new cMenuEditIntItem( tr("Nid"), &nid, 0);
|
||||||
|
case 1: return new cMenuEditIntItem( tr("Tid"), &tid, 0);
|
||||||
|
case 2: return new cMenuEditIntItem( tr("Rid"), &rid, 0);
|
||||||
|
case 3: return new cMenuEditBoolItem(tr("Scan section ids"), &itp.sidscan);
|
||||||
|
case 4: return new cMenuEditBoolItem(tr("Scan pids"), &itp.pidscan);
|
||||||
|
case 5: return new cMenuEditStraItem(tr("Protocol"), &itp.protocol, ELEMENTS(protocols), protocols);
|
||||||
|
case 6: return new cMenuEditStrItem( tr("Address"), itp.address, sizeof(itp.address));
|
||||||
|
case 7: return new cMenuEditIntItem( tr("Parameter"), &itp.parameter, 0, 0xFFFF);
|
||||||
|
default: return NULL;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
67
source.h
Normal file
67
source.h
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* source.h: IPTV plugin for the Video Disk Recorder
|
||||||
|
*
|
||||||
|
* See the README file for copyright information and how to reach the author.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __IPTV_SOURCE_H
|
||||||
|
#define __IPTV_SOURCE_H
|
||||||
|
|
||||||
|
#include <vdr/menuitems.h>
|
||||||
|
#include <vdr/sourceparams.h>
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
class cIptvTransponderParameters
|
||||||
|
{
|
||||||
|
friend class cIptvSourceParam;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int sidscan;
|
||||||
|
int pidscan;
|
||||||
|
int protocol;
|
||||||
|
char address[MaxFileName];
|
||||||
|
int parameter;
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum {
|
||||||
|
eProtocolUDP,
|
||||||
|
eProtocolHTTP,
|
||||||
|
eProtocolFILE,
|
||||||
|
eProtocolEXT,
|
||||||
|
eProtocolCount
|
||||||
|
};
|
||||||
|
cIptvTransponderParameters(const char *Parameters = NULL);
|
||||||
|
int SidScan(void) const { return sidscan; }
|
||||||
|
int PidScan(void) const { return pidscan; }
|
||||||
|
int Protocol(void) const { return protocol; }
|
||||||
|
const char *Address(void) const { return address; }
|
||||||
|
int Parameter(void) const { return parameter; }
|
||||||
|
void SetSidScan(int SidScan) { sidscan = SidScan; }
|
||||||
|
void SetPidScan(int PidScan) { pidscan = PidScan; }
|
||||||
|
void SetProtocol(int Protocol) { protocol = Protocol; }
|
||||||
|
void SetAddress(const char *Address) { strncpy(address, Address, sizeof(address)); }
|
||||||
|
void SetParameter(int Parameter) { parameter = Parameter; }
|
||||||
|
cString ToString(char Type) const;
|
||||||
|
bool Parse(const char *s);
|
||||||
|
};
|
||||||
|
|
||||||
|
class cIptvSourceParam : public cSourceParam
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
int param;
|
||||||
|
int nid;
|
||||||
|
int tid;
|
||||||
|
int rid;
|
||||||
|
cChannel data;
|
||||||
|
cIptvTransponderParameters itp;
|
||||||
|
const char *protocols[cIptvTransponderParameters::eProtocolCount];
|
||||||
|
|
||||||
|
public:
|
||||||
|
cIptvSourceParam(char Source, const char *Description);
|
||||||
|
virtual void SetData(cChannel *Channel);
|
||||||
|
virtual void GetData(cChannel *Channel);
|
||||||
|
virtual cOsdItem *GetOsdItem(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __IPTV_SOURCE_H
|
||||||
14
statistics.c
14
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.22 2008/01/19 21:08:03 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +32,7 @@ cString cIptvSectionStatistics::GetSectionStatistic()
|
|||||||
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!
|
||||||
@@ -76,7 +75,7 @@ cString cIptvPidStatistics::GetPidStatistic()
|
|||||||
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,
|
||||||
@@ -120,7 +119,7 @@ void cIptvPidStatistics::AddPidStatistic(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,10 +145,10 @@ cString cIptvStreamerStatistics::GetStreamerStatistic()
|
|||||||
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("%ld k%s/s", bitrate, IptvConfig.GetUseBytes() ? "B" : "bit");
|
||||||
dataBytes = 0;
|
dataBytes = 0;
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
@@ -165,6 +164,7 @@ void cIptvStreamerStatistics::AddStreamerStatistic(long Bytes)
|
|||||||
// Buffer statistic class
|
// Buffer statistic class
|
||||||
cIptvBufferStatistics::cIptvBufferStatistics()
|
cIptvBufferStatistics::cIptvBufferStatistics()
|
||||||
: dataBytes(0),
|
: dataBytes(0),
|
||||||
|
freeSpace(0),
|
||||||
usedSpace(0),
|
usedSpace(0),
|
||||||
timer(),
|
timer(),
|
||||||
mutex()
|
mutex()
|
||||||
@@ -183,7 +183,7 @@ cString cIptvBufferStatistics::GetBufferStatistic()
|
|||||||
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);
|
||||||
|
|||||||
@@ -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.11 2008/01/19 21:08:03 ajhseppa Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_STATISTICS_H
|
#ifndef __IPTV_STATISTICS_H
|
||||||
|
|||||||
79
streamer.c
79
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.30 2008/01/30 21:57:33 rahrenbe 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);
|
||||||
AddStreamerStatistic(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");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,18 +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.
|
|
||||||
// Taking a mutex serializes the Close() and Action() -calls.
|
|
||||||
if (mutex)
|
|
||||||
mutex->Lock();
|
|
||||||
if (protocol)
|
if (protocol)
|
||||||
protocol->Close();
|
protocol->Close();
|
||||||
if (mutex)
|
|
||||||
mutex->Unlock();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,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;
|
||||||
@@ -107,8 +108,8 @@ bool cIptvStreamer::Set(const char* Location, const int Parameter, const int Ind
|
|||||||
cString cIptvStreamer::GetInformation(void)
|
cString cIptvStreamer::GetInformation(void)
|
||||||
{
|
{
|
||||||
//debug("cIptvStreamer::GetInformation()");
|
//debug("cIptvStreamer::GetInformation()");
|
||||||
cString info("Stream:");
|
cString info;
|
||||||
if (protocol)
|
if (protocol)
|
||||||
info = cString::sprintf("%s %s", *info, *protocol->GetInformation());
|
info = protocol->GetInformation();
|
||||||
return cString::sprintf("%s\n", *info);
|
return info;
|
||||||
}
|
}
|
||||||
|
|||||||
15
streamer.h
15
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.14 2008/01/30 21:57:33 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user