diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 647fee9..7f3dddc 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -12,14 +12,14 @@ The Metzler Brothers
as a lot of code has been taken from their libdvbmpeg package
Angelus (DOm)
- for providing italian language texts
+ for providing Italian language texts
for reporting problems with the Elchi-Patch
Michal
for sending a patch to select the HTTP streamtype via remote
Rolf Ahrenberg
- for providing finnish language texts
+ for providing Finnish language texts
for adding externremux.sh commandline parameter
for silencing compiler warnings
for adding PAT, PMT, PCR and EIT to HTTP TS streams
@@ -35,6 +35,9 @@ Rolf Ahrenberg
for improving externremux script termination
for fixing PAT repacker version field
for improving LIMIKUUTIO and PARENTALRATING patch detection
+ for suggesting to include the charset in HTTP replies
+ for requesting replacement of asprintf calls
+ for suggesting to change the URL path from EXTERN to EXT
Rantanen Teemu
for providing vdr-incompletesections.diff
@@ -54,6 +57,7 @@ Udo Richter
for speeding up cPluginStreamdevServer::Active()
for adapting to VDR 1.5.0 API
for adapting to VDR 1.7.1
+ for proper tsplay-0.2 patch detection
greenman
for reporting that the log could get flooded on connection failures.
@@ -88,10 +92,10 @@ tobi
for pointing to unused files in the libdvbmpeg directory
Diego Pierotto
- for providing italian language texts
+ for providing Italian language texts
micky979
- for providing french language texts
+ for providing French language texts
Tiroler
for reporting a problem when switching between encrypted channels
@@ -100,10 +104,12 @@ Pixelpeter
for an initial fix to the "switching between ecncrypted channels" problem
Anssi Hannula
- for the vdr-1.6.0-ignore_missing_cam.diff patch
+ for the vdr-1.6.0-intcamdevices patch
+ for fixing insecure format strings in LSTX handlers
wirbel
for pointing out that section filtering is optional for VDR devices
+ for reporting a problem with Makefile defines in VDR 1.7.4+
Jori Hamalainen
for extensive testing while making stream compatible to Network Media Tank
@@ -111,6 +117,7 @@ Jori Hamalainen
owagner
for pointing out a problem with the encrypted channel switching fix
+ for suggesting use of SO_KEEPALIVE socket option to detect dead sockets
Joachim Knig-Baltes
for fixing Min/MaxPriority parsing
@@ -120,3 +127,23 @@ Artem Makhutov
Alwin Esch
for adding XBMC support by extending VTP capabilities
+ for adding VDR 1.7.11 parental rating support for VTP LSTE command
+ for adding the DELT FORCE option to delete running timers
+
+BBlack
+ for reporting that updating recordings list on CmdPLAY is a bad idea
+
+Milan Hrala
+ for providing Slovak language texts
+
+Valdemaras Pipiras
+ for providing Lithuanian language texts
+
+sk8ter
+ for fixing failures when switching between two encrypted channels
+
+lhanisch
+ for fixing a memory leak in cStreamdevPatFilter::GetPid
+
+Eric Valette
+ for adding support for EnhancedAC3
diff --git a/HISTORY b/HISTORY
index 7752f8d..5bfe74e 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,51 @@
VDR Plugin 'streamdev' Revision History
---------------------------------------
+- config option "client may suspend" hidden if not applicable
+- updated and enhanced README
+- separated language resources of client and server
+- restructured build process
+- added support for HTTP method HEAD
+- rewrite of externremux.sh, including support for various URL parameters,
+ logging and improved shutdown
+- start externremux script in a separate process group
+- changed HTTP URL path for externremux from EXTERN to EXT (suggested by
+ Rolf Ahrenberg)
+- HTTP headers now have to be emitted by externremux script
+- pass channel related information and URL parameters to externremux script
+ through environment
+- implement CGI like interface for externremux script
+- dropped "Synchronize EPG" feature. Please use epgsync-plugin instead
+ (available from http://vdr.schmirler.de)
+- proper tsplay-0.2 patch detection. tsplay-0.1 is no longer recognized
+ (thanks to Udo Richter)
+- added compatibility with VDR 1.6 tsplay-0.1 patch
+- added support for EnhancedAC3 (thanks to Eric Valette)
+- fixed a memory leak in cStreamdevPatFilter::GetPid (thanks to lhanisch)
+- length -1 is the correct value for streams in M3U playlists
+- switching between two encrypted channels on the same transponder didn't
+ always work (thanks to sk8ter@vdrportal)
+- added DELT FORCE option to delete running timers (thanks to Alwin Esch)
+- added VDR 1.7.11 parental rating support for VTP LSTE command (thanks to
+ Alwin Esch)
+- added Lithuanian translation (thanks to Valdemaras Pipiras)
+- fixed missing virtual destructor for cTSRemux
+- added defines for large file support to Makefile as required by VDR 1.7.4+
+ (reported by wirbel@vdrportal)
+- added Slovak translation (thanks to Milan Hrala)
+- fixed regression from fix for switching between encrypted channels. It was
+ no longer possible to receive multiple (FTA) streams from the same
+ transponder
+- silenced warnings concerning asprintf (requested by Rolf Ahrenberg)
+- don't update recordings list on CmdPLAY (reported by BBlack)
+- cleaned up common.h / common.c
+- dropped cStreamdevMenuSetupPage
+- report charset in HTTP replies (suggested by Rolf Ahrenberg)
+- use SO_KEEPALIVE option on all sockets do detect dead sockets (thanks to
+ owagner)
+- enable PatFilter for externremux, so VLC can be used as remuxer or client
+- fixed insecure format strings in LSTX handlers (thanks to Anssi Hannula)
+- updated Finish translation (thanks to Rolf Ahrenberg)
- removed redefinitions in includes - caused problems in older compilers
- fixed ts2ps.h defines
- fixed missing virtual for cTS2PESRemux destructor
diff --git a/Makefile b/Makefile
index 2b6e959..25410b4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,36 +1,57 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile,v 1.19 2009/07/01 10:46:15 schmirl Exp $
+# $Id: Makefile,v 1.21.2.1 2010/06/14 10:40:11 schmirl Exp $
-# The official name of this plugin.
-# This name will be used in the '-P...' option of VDR to load the plugin.
-# By default the main source file also carries this name.
+# The main source file name.
#
PLUGIN = streamdev
+### The C/C++ compiler and options:
+
+CC ?= gcc
+CFLAGS ?= -g -O2 -Wall
+
+CXX ?= g++
+CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+
### The version number of this plugin (taken from the main source file):
VERSION = $(shell grep 'const char \*VERSION *=' common.c | awk '{ print $$5 }' | sed -e 's/[";]//g')
-### The C++ compiler and options:
-
-CXX ?= g++
-CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
-
### The directory environment:
VDRDIR = ../../..
LIBDIR = ../../lib
TMPDIR = /tmp
-### Allow user defined options to overwrite defaults:
-
--include $(VDRDIR)/Make.config
-
### The version number of VDR (taken from VDR's "config.h"):
APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
+APIVERSNUM = $(shell grep 'define APIVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
+TSPLAYVERSNUM = $(shell grep 'define TSPLAY_PATCH_VERSION ' $(VDRDIR)/device.h | awk '{ print $$3 }')
+
+### Allow user defined options to overwrite defaults:
+
+ifeq ($(shell test $(APIVERSNUM) -ge 10713; echo $$?),0)
+include $(VDRDIR)/Make.global
+else ifeq ($(shell test $(APIVERSNUM) -ge 10704 -o -n "$(TSPLAYVERSNUM)" ; echo $$?),0)
+DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS += -fPIC
+CXXFLAGS += -fPIC
+else
+CFLAGS += -fPIC
+CXXFLAGS += -fPIC
+endif
+
+-include $(VDRDIR)/Make.config
+
+### export all vars for sub-makes, using absolute paths
+
+VDRDIR := $(abspath $(VDRDIR))
+LIBDIR := $(abspath $(LIBDIR))
+export
+unexport PLUGIN
### The name of the distribution archive:
@@ -39,98 +60,33 @@ PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here):
-INCLUDES += -I$(VDRDIR)/include -I.
+INCLUDES += -I$(VDRDIR)/include -I..
-DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+DEFINES += -D_GNU_SOURCE
-### The object files (add further files here):
-
-COMMONOBJS = common.o \
- \
- tools/source.o tools/select.o tools/socket.o tools/tools.o
-
-CLIENTOBJS = $(PLUGIN)-client.o \
- \
- client/socket.o client/device.o client/setup.o \
- client/filter.o
-
-
-SERVEROBJS = $(PLUGIN)-server.o \
- \
- server/server.o server/component.o server/connection.o \
- server/componentVTP.o server/componentHTTP.o server/componentIGMP.o \
- server/connectionVTP.o server/connectionHTTP.o server/connectionIGMP.o \
- server/streamer.o server/livestreamer.o server/livefilter.o \
- server/suspend.o server/setup.o server/menuHTTP.o server/recplayer.o \
- remux/tsremux.o remux/ts2pes.o remux/ts2ps.o remux/ts2es.o remux/extern.o
-
ifdef DEBUG
- DEFINES += -DDEBUG
+DEFINES += -DDEBUG
+endif
+ifdef STREAMDEV_DEBUG
+DEFINES += -DDEBUG
endif
### The main target:
-.PHONY: all i18n dist clean
-all: libvdr-$(PLUGIN)-client.so libvdr-$(PLUGIN)-server.so i18n
-
-### Implicit rules:
-
-%.o: %.c
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
-
-# Dependencies:
-
-MAKEDEP = $(CXX) -MM -MG
-DEPFILE = .dependencies
-ifdef GCC3
-$(DEPFILE): Makefile
- @rm -f $@
- @for i in $(CLIENTOBJS:%.o=%.c) $(SERVEROBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) ; do \
- $(MAKEDEP) $(DEFINES) $(INCLUDES) -MT "`dirname $$i`/`basename $$i .c`.o" $$i >>$@ ; \
- done
-else
-$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(CLIENTOBJS:%.o=%.c) $(SERVEROBJS:%.o=%.c) \
- $(COMMONOBJS:%.o=%.c) > $@
-endif
-
--include $(DEPFILE)
-
-### Internationalization (I18N):
-
-PODIR = po
-LOCALEDIR = $(VDRDIR)/locale
-I18Npo = $(wildcard $(PODIR)/*.po)
-I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
-I18Npot = $(PODIR)/$(PLUGIN).pot
-
-%.mo: %.po
- msgfmt -c -o $@ $<
-
-$(I18Npot): $(CLIENTOBJS:%.o=%.c) $(SERVEROBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c)
- xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='' -o $@ $^
-
-%.po: $(I18Npot)
- msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
- @touch $@
-
-$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
- @mkdir -p $(dir $@)
- cp $< $@
-
-i18n: $(I18Nmsgs)
+.PHONY: all client server dist clean
+all: client server
### Targets:
-libdvbmpeg/libdvbmpegtools.a: libdvbmpeg/*.c libdvbmpeg/*.h
- $(MAKE) -C ./libdvbmpeg libdvbmpegtools.a
+client:
+ $(MAKE) -C ./tools
+ $(MAKE) -C ./client
-libvdr-$(PLUGIN)-client.so: $(CLIENTOBJS) $(COMMONOBJS) libdvbmpeg/libdvbmpegtools.a
-libvdr-$(PLUGIN)-server.so: $(SERVEROBJS) $(COMMONOBJS) libdvbmpeg/libdvbmpegtools.a
-
-%.so:
- $(CXX) $(CXXFLAGS) -shared $^ -o $@
- @cp $@ $(LIBDIR)/$@.$(APIVERSION)
+server:
+ $(MAKE) -C ./tools
+ $(MAKE) -C ./libdvbmpeg
+ $(MAKE) -C ./remux
+ $(MAKE) -C ./server
dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@@ -141,5 +97,8 @@ dist: clean
@echo Distribution package created as $(PACKAGE).tgz
clean:
- @-rm -f $(COMMONOBJS) $(CLIENTOBJS) $(SERVEROBJS) $(DEPFILE) $(PODIR)/*.mo $(PODIR)/*.pot *.so *.tgz core* *~
+ $(MAKE) -C ./tools clean
$(MAKE) -C ./libdvbmpeg clean
+ $(MAKE) -C ./remux clean
+ $(MAKE) -C ./client clean
+ $(MAKE) -C ./server clean
diff --git a/README b/README
index cd03c58..e1597f5 100644
--- a/README
+++ b/README
@@ -15,9 +15,9 @@ Contents:
1. Description
2. Installation
-2.1 VDR 1.4.x and older
-2.2 VDR 1.6.0 and above
-2.3 Updating from streamdev 0.3.x
+2.1 Compatibility
+2.2 Compiling
+2.3 Updating
3. Usage
3.1 Usage HTTP server
3.2 Usage IGMP multicast server
@@ -27,7 +27,8 @@ Contents:
4.1 Plugins for VDR-to-VDR clients
4.2 Plugins for Server
4.3 Alternatives
-5. Known Problems
+5. externremux.sh
+6. Known Problems
1. Description:
@@ -62,7 +63,7 @@ the PROTOCOL file.
2. Installation:
----------------
-Let's say streamdev's version is 0.4.0 and vdr's version is 1.X.X. If you
+Let's say streamdev's version is 0.5.0 and vdr's version is 1.X.X. If you
use anything else please exchange the version numbers appropriately (this
way I don't have to update this section all the times;) ).
@@ -79,54 +80,71 @@ If you want to drive additional Input-Devices (with different sources) on the
client, you can merge the channels.conf files. VDR will detect if the local
device or the network device can receive the channels.
-Last, but not least you have to copy the streamdev folder into the
-"plugins/streamdev" subfolder of VDR's config-directory (which is equal to your
-video-directory if not specified otherwise). For example, if you didn't specify
-a separate config-directory, and specified your video directory as "/video0",
-the directory has to be copied to /video0/plugins/streamdev.
+Last, but not least you have to copy the streamdev-server folder into the
+"plugins/streamdev-server" subfolder of VDR's config-directory (which is equal
+to your video-directory if not specified otherwise). For example, if you didn't
+specify a separate config-directory, and set your video directory to "/video0",
+the directory has to be copied to /video0/plugins/streamdev-server.
The directory contains a file named streamdevhosts.conf which you must adjust
to your needs. The syntax is the same as for svdrphosts.conf, so please consult
VDR's documentation on how to fill that file, if you can't do it on-the-fly.
There's also a sample externremux.sh script in this directory. It is used by
-streamdev's external remux feature. The sample script uses mencoder. Please
-check the script for further information. You can specify a different script
-location with the -r parameter. The VDR commandline would then include a
+streamdev's external remux feature. The sample script uses mencoder by default.
+Please check the script for further information. You can specify a different
+script location with the -r parameter. The VDR commandline would then include a
"-P 'streamdev-server -r /usr/local/bin/remux.sh'". Note the additional quotes,
as otherwise -r will be passed to VDR and not to streamdev.
-2.1 VDR 1.4.x and older:
-------------------------
+2.1 Compatibility:
+------------------
This version is not compatible to VDR releases older than 1.5.9. Take one of
the streamdev-0.4.x releases if you are running at least VDR 1.4.x. For older
VDRs you will probably need one of the streamdev-0.3.x releases.
-2.2 VDR 1.6.0 and above:
-------------------------
+2.2 Compiling:
+--------------
-cd vdr-1.X.X/PLUGINS/src
-tar xvfz vdr-streamdev-0.4.0.tgz
-ln -s streamdev-0.4.0 streamdev
-cp -r streamdev/streamdev VDRCONFDIR/plugins/
-cd ../..
-make [options, if necessary] vdr
-make [options, if necessary] plugins
+ cd vdr-1.X.X/PLUGINS/src
+ tar xvfz vdr-streamdev-0.5.0.tgz
+ ln -s streamdev-0.5.0 streamdev
+ cp -r streamdev/streamdev-server VDRCONFDIR/plugins/
+ cd ../..
+ make [options, if necessary] vdr
+ make [options, if necessary] plugins
-2.3 Updating from streamdev 0.3.x
-----------------------------------
+To build only the plugin, change into the streamdev source folder and issue
+ make
-Starting with streamdev 0.4.0, all additional files are kept in a directory
-called "streamdev" inside VDR's plugin config directory. It is the new default
-location of externremux.sh and the new place where streamdev-server expects the
-file "streamdevhosts.conf". You will have to move this file to its new location:
+To build only streamdev-server or only streamdev-client, use
+ make server
+ make client
-mv VDRCONFDIR/plugins/streamdevhosts.conf VDRCONFDIR/plugins/streamdev/
+2.3 Updating:
+--------------
-(Directory VDRCONFDIR/plugins/streamdev already exists, as you copied the
-whole folder from the sources directory as suggested above, right?)
+If you are updating streamdev from an earlier release, you might have to
+perform some additional steps. Check which version you've been running before,
+then read below for the necessary changes.
+
+* Location of files:
+--------------------
+(Affected: 0.3.x, 0.4.x, 0.4.0pre, 0.5.0pre)
+
+Starting with streamdev 0.5.0, all additional files are kept in a directory
+called "streamdev-server" inside VDR's plugin config directory. It is the new
+default location of externremux.sh and the new place where streamdev-server
+expects the file "streamdevhosts.conf". You will have to move this file to its
+new location:
+
+streamdev 0.3.x:
+ mv VDRCONFDIR/plugins/streamdevhosts.conf VDRCONFDIR/plugins/streamdev-server/
+
+streamdev 0.4.x, 0.4.0pre and 0.5.0pre:
+ mv VDRCONFDIR/plugins/streamdev VDRCONFDIR/plugins/streamdev-server/
Now check the contents of streamdevhosts.conf. Does it contain a "0.0.0.0/0"
entry? If your VDR machine is connected to the Internet, this line gives
@@ -134,6 +152,21 @@ entry? If your VDR machine is connected to the Internet, this line gives
prevent this (e.g. firewall). You might want to remove this line and enable
HTTP authentication instead.
+* Handling of externremux script:
+---------------------------------
+(Affected: 0.3.x, 0.4.0pre, 0.5.0pre)
+
+Streamdev server's externremux script became responsible for emitting all HTTP
+headers. A quick and dirty extension to your current script would be:
+
+ echo -ne 'Content-type: video/mpeg\r\n'
+ echo -ne '\r\n'
+
+However I encourage you to try the new externremux.sh script shipped with the
+streamdev source distribution.
+
+To emphasize the required change in externremux, the URL path for passing the
+stream through externremux has changed from EXTERN to EXT.
3. Usage:
---------
@@ -172,15 +205,15 @@ listen to with the parameter "HTTP Server Port". The parameter "HTTP Streamtype"
allows you to specify a default stream type, which is used if no specific type
has been requested in the URL (see below). The supported stream types are:
-TS Transport Stream (i.e. a dump from the device)
-PES Packetized Elemetary Stream (VDR's native recording format)
-PS Program Stream (SVCD, DVD like stream)
-ES Elementary Stream (only Video, if available, otherwise only Audio)
-EXTERN Pass stream through external script (e.g. for converting with mencoder)
+ TS Transport Stream (i.e. a dump from the device)
+ PES Packetized Elemetary Stream (VDR's native recording format)
+ PS Program Stream (SVCD, DVD like stream)
+ ES Elementary Stream (only Video, if available, otherwise only Audio)
+ EXT Pass stream through external script (e.g. for converting with mencoder)
Assuming that you leave the default port (3000), point your web browser to
-http://hostname:3000/
+ http://hostname:3000/
You will be presented a menu with links to various channel lists, including M3U
playlist formats.
@@ -188,27 +221,28 @@ playlist formats.
If you don't want to use the HTML menu or the M3U playlists, you can access the
streams directly like this:
-http://hostname:3000/3
-http://hostname:3000/S19.2E-0-12480-898
+ http://hostname:3000/3
+ http://hostname:3000/S19.2E-0-12480-898
The first one will deliver a channel by number on the server, the second one
will request the channel by unique channel id. In addition, you can specify
the desired stream type as a path to the channel.
-http://hostname:3000/TS/3
-http://hostname:3000/PES/S19.2E-0-12480-898
+ http://hostname:3000/TS/3
+ http://hostname:3000/PES/S19.2E-0-12480-898
The first one would deliver the stream in TS, the second one in PES format.
-Possible values are 'PES', 'TS', 'PS', 'ES' and 'EXTERN'. You need to specify
+Possible values are 'PES', 'TS', 'PS', 'ES' and 'EXT'. You need to specify
the ES format explicitly if you want to listen to radio channels. Play them
back i.e. with mpg123.
-mpg123 http://hostname:3000/ES/200
+ mpg123 http://hostname:3000/ES/200
-With 'EXTERN' you can also add a parameter which is passed as argument to the
-externremux script.
-
-http://hostname:3000/EXTERN;some_parameter/3
+With 'EXT' you can also add parameters which are passed as arguments to the
+externremux script (e.g. http://hostname:3000/EXT;param1=value1;param2=value2/3)
+Check your externremux.sh script for the parameters it understands. For details
+on how to modify or write your own externremux.sh, please see the chapter upon
+externremux.sh further down.
If you want to access streamdev's HTTP server from the Internet, do *not* grant
access for anyone by allowing any IP in "streamdevhosts.conf". Instead, pass the
@@ -216,7 +250,7 @@ access for anyone by allowing any IP in "streamdevhosts.conf". Instead, pass the
as argument. Clients with an IP not accepted by "streamdevhosts.conf" will then
have to login. The VDR commandline will have to look like this:
-vdr ... -P 'streamdev-server -a vdr:secret' ...
+ vdr ... -P 'streamdev-server -a vdr:secret' ...
Note the single quotes, as otherwise "-a" will be passed to VDR and not to
streamdev-server. The login ("vdr" in the example above) doesn't have to exist
@@ -267,11 +301,11 @@ You might want to increase this up to "number_of_channels + 1". Note that it's
"number_of_channels", not "maximum_channel_number".
#First 100 channels:
- bash# sysctl -w sys.net.ipv4.igmp_max_memberships=101
+ bash# sysctl -w net.ipv4.igmp_max_memberships=101
#All channels:
bash# COUNT=$(grep -c '^[^:]' PATH_TO_YOUR/channels.conf)
- bash# sysctl -w sys.net.ipv4.igmp_max_memberships=$COUNT
+ bash# sysctl -w net.ipv4.igmp_max_memberships=$COUNT
A multicast server never knows how many clients are actually receiving a stream.
If a client signals that it leaves a multicast group, the server has to query
@@ -337,15 +371,6 @@ With "Filter Streaming" enabled, the client will receive meta information like
EPG data and service information, just as if the client had its own DVB card.
Link channels and even a client-side EPG scan have been reported to work.
-The next parameter, "Synchronize EPG", will have the client synchronize it's
-program table with the server every now and then, but not regularly. This
-happens when starting the client, and everytime VDR does its housekeeping
-tasks. The only thing that's guaranteed is, that there will be a minimum
-interval of ten seconds between each EPG synchronization. With "Filter
-Streaming" this option has been obsoleted. If you still need to synchronize
-EPG as additional information is available from the server, you should use the
-epgsync-plugin instead (http://vdr.schmirler.de).
-
Finally with the maximum and minimum priority, you can keep VDR from considering
streamdev in certain cases. If for instance you have a streamdev client with its
own DVB card, VDR would normally use streamdev for recording. If this is not
@@ -356,6 +381,21 @@ which streamdev will accept to tune. Setting the minimum priority to a higher
value than the maximum, you will get two ranges: "up to maximum" and "minimum
and above".
+Note that streamdev-client acts similar to a DVB card. It is possible to receive
+multiple channels simultaneously, but only from the same transponder. Just add
+additional instances of streamdev-client and you will be able to receive as many
+transponders at a time. The same trick allows a client to receive channels from
+different servers. To create an additional instance, copy the streamdev-client
+binary to a different name (e.g. streamdev-client2):
+
+ cd VDRPLUGINLIBDIR
+ cp libvdr-streamdev-client.so.1.X.X libvdr-streamdev-client2.so.1.X.X
+
+Now add -Pstreamdev-client2 to the VDR commandline. In the VDR plugin setup
+a second streamdev-client entry should show up. Both instances have to be
+configured individually.
+
+
4. Other useful Plugins:
------------------------
@@ -398,7 +438,58 @@ With its networking option, xineliboutput provides an alternative to streamdev.
You will get the picture of the server VDR, including its OSD. However you
won't get independent clients, as they all share the same output.
-5. Known Problems:
+5. externremux.sh:
+------------------
+
+When selecting streamtype "EXT", the TS stream from VDR is passed through an
+external program for further processing. By default a script installed at
+VDRCONFDIR/plugins/streamdev/externremux.sh is expected, however you may
+specify a different location as parameter -r to the streamdev-server plugin
+(see chapter upon Installation above).
+
+The TS stream is passed to the script on stdin, the resulting stream is expected
+on stdout. The following parameters are passed to the script in the environment:
+
+* Information on the channel:
+ REMUX_CHANNEL_ID VDR channel ID
+ REMUX_CHANNEL_NAME Channel name
+ REMUX_VTYPE Video type (2 for MPEG-2)
+ REMUX_VPID Video PID (undefined if audio only)
+ REMUX_PPID PCR PID (undefined if equal to VPID)
+ REMUX_TPID Teletext PID (undefined if not available)
+ REMUX_APID Space separated list of audio pids
+ REMUX_ALANG Space separated list of audio languages
+ REMUX_DPID Space separated list of dolby pids
+ REMUX_DLANG Space separated list of dolby languages
+ REMUX_SPID Space separated list of subtitle pids
+ REMUX_SLANG Space separated list of subtitle languages
+ REMUX_PARAM_* All (user supplied) parameters (e.g. REMUX_PARAM_x)
+
+* Information on the connection (CGI like)
+ REMOTE_ADDR Client IP
+ SERVER_NAME Local IP
+ SERVER_PORT Local port
+ SERVER_PROTOCOL Streamdev protocol (HTTP, VTP, IGMP)
+ SERVER_SOFTWARE Streamdev version
+ All HTTP headers converted to uppercase, '-' replaced by '_' (e.g. USER_AGENT)
+
+The script should perform the following steps (pseudocode):
+
+ if (SERVER_PROTOCOL == HTTP)
+ write headers (including Content-Type) to STDOUT
+ write empty line to STDOUT
+ if (REQUEST_METHOD == HEAD)
+ exit
+ endif
+ endif
+ while (read STDIN)
+ remux to STDOUT
+ wend
+
+ onSIGINT/SIGKILL: cleanup and exit
+
+
+6. Known Problems:
------------------
* In VDR-to-VDR setup, the availability of a channel is checked with a different
@@ -424,15 +515,9 @@ up. So please consider the logs for the correct value. Remember to fill in
hexadecimal values if you are using an editor to modify your channels.conf
(number 10 becomes an "a", number 11 a "b", ...).
-2. Turn encrypted channels into Free-to-Air channels on the client. Again,
-either enter the channels menu or edit the client's channels.conf. You will
-also have to disable automatic channel updates on the client or (if streamdev
-is the only DVB source) disable streamdev's filter streaming feature. Otherwise
-VDR will revert the channel into an encrypted one.
-
-3. Apply either patch "patches/vdr-1.6.0-intcamdevices.patch" or patch
+2. Apply either patch "patches/vdr-1.6.0-intcamdevices.patch" or patch
"patches/vdr-1.6.0-ignore_missing_cam.diff" to your client VDR. Intcamdevices
-is the clean solution. But as it modifies the VDR API, so you will need to
+is the clean solution, but it modifies the VDR API. So you will need to
recompile all of your plugins. The ignore_missing_cam patch is trivial, no need
to recompile other plugins. However it is not suitable for clients with a DVB
card of their own.
diff --git a/client/Makefile b/client/Makefile
new file mode 100644
index 0000000..8c3e565
--- /dev/null
+++ b/client/Makefile
@@ -0,0 +1,84 @@
+#
+# Makefile for a Video Disk Recorder plugin
+#
+# $Id: Makefile,v 1.1.2.1 2010/06/14 10:40:11 schmirl Exp $
+
+# The official name of this plugin.
+# This name will be used in the '-P...' option of VDR to load the plugin.
+# By default the main source file also carries this name.
+#
+PLUGIN = streamdev-client
+
+### Includes and Defines (add further entries here):
+
+DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+
+### The object files (add further files here):
+
+COMMONOBJS = ../common.o
+
+CLIENTOBJS = $(PLUGIN).o \
+ device.o filter.o setup.o socket.o
+
+### The main target:
+
+.PHONY: all i18n dist clean
+all: libvdr-$(PLUGIN).so i18n
+
+### Implicit rules:
+
+%.o: %.c
+ $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+
+### Dependencies:
+
+MAKEDEP = $(CXX) -MM -MG
+DEPFILE = .dependencies
+
+$(DEPFILE): Makefile
+ @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(CLIENTOBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) > $@
+
+-include $(DEPFILE)
+
+### Internationalization (I18N):
+
+PODIR = po
+LOCALEDIR = $(VDRDIR)/locale
+I18Npo = $(wildcard $(PODIR)/*.po)
+I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+I18Npot = $(PODIR)/$(PLUGIN).pot
+
+%.mo: %.po
+ msgfmt -c -o $@ $<
+
+$(I18Npot): $(CLIENTOBJS:%.o=%.c)
+ xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='' -o $@ $^
+
+%.po: $(I18Npot)
+ msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+ @touch $@
+
+$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+ @mkdir -p $(dir $@)
+ cp $< $@
+
+i18n: $(I18Nmsgs)
+
+### Targets:
+
+libvdr-$(PLUGIN).so: $(CLIENTOBJS) $(COMMONOBJS) ../tools/sockettools.a
+
+%.so:
+ $(CXX) $(CXXFLAGS) -shared $^ -o $@
+ @cp $@ $(LIBDIR)/$@.$(APIVERSION)
+
+dist: clean
+ @-rm -rf $(TMPDIR)/$(ARCHIVE)
+ @mkdir $(TMPDIR)/$(ARCHIVE)
+ @cp -a * $(TMPDIR)/$(ARCHIVE)
+ @tar czf $(PACKAGE).tgz --exclude CVS -C $(TMPDIR) $(ARCHIVE)
+ @-rm -rf $(TMPDIR)/$(ARCHIVE)
+ @echo Distribution package created as $(PACKAGE).tgz
+
+clean:
+ @-rm -f $(COMMONOBJS) $(CLIENTOBJS) $(DEPFILE) $(PODIR)/*.mo $(PODIR)/*.pot *.so *.tgz core* *~
diff --git a/client/device.c b/client/device.c
index 4b6c3c5..d53bde1 100644
--- a/client/device.c
+++ b/client/device.c
@@ -1,5 +1,5 @@
/*
- * $Id: device.c,v 1.23 2009/04/06 06:48:59 schmirl Exp $
+ * $Id: device.c,v 1.26 2010/06/08 05:55:17 schmirl Exp $
*/
#include "client/device.h"
@@ -33,9 +33,6 @@ cStreamdevDevice::cStreamdevDevice(void) {
m_Device = this;
m_Pids = 0;
m_DvrClosed = true;
-
- if (StreamdevClientSetup.SyncEPG)
- ClientSocket.SynchronizeEPG();
}
cStreamdevDevice::~cStreamdevDevice() {
@@ -72,7 +69,9 @@ bool cStreamdevDevice::IsTunedToTransponder(const cChannel *Channel)
{
bool res = false;
if (ClientSocket.DataSocket(siLive) != NULL
- && TRANSPONDER(Channel, m_Channel))
+ && TRANSPONDER(Channel, m_Channel)
+ && Channel->Ca() == CA_FTA
+ && m_Channel->Ca() == CA_FTA)
res = true;
return res;
}
@@ -123,12 +122,11 @@ bool cStreamdevDevice::SetChannelDevice(const cChannel *Channel,
if (LiveView)
return false;
-#if 0
if (ClientSocket.DataSocket(siLive) != NULL
&& TRANSPONDER(Channel, m_Channel)
- && Channel->Ca() < CA_ENCRYPTED_MIN)
+ && Channel->Ca() == CA_FTA
+ && m_Channel->Ca() == CA_FTA)
return true;
-#endif
DetachAllReceivers();
m_Channel = Channel;
diff --git a/client/po/de_DE.po b/client/po/de_DE.po
new file mode 100644
index 0000000..1e481a2
--- /dev/null
+++ b/client/po/de_DE.po
@@ -0,0 +1,50 @@
+# VDR streamdev plugin language source file.
+# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org
+# This file is distributed under the same license as the VDR streamdev package.
+# Frank Schmirler , 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: streamdev 0.5.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-14 13:05+0200\n"
+"PO-Revision-Date: 2008-03-30 02:11+0200\n"
+"Last-Translator: Frank Schmirler \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "VTP Streaming Client"
+msgstr "VTP Streaming Client"
+
+msgid "Suspend Server"
+msgstr "Server pausieren"
+
+msgid "Server is suspended"
+msgstr "Server ist pausiert"
+
+msgid "Couldn't suspend Server!"
+msgstr "Konnte Server nicht pausieren!"
+
+msgid "Hide Mainmenu Entry"
+msgstr "Hauptmeneintrag verstecken"
+
+msgid "Start Client"
+msgstr "Client starten"
+
+msgid "Remote IP"
+msgstr "IP der Gegenseite"
+
+msgid "Remote Port"
+msgstr "Port der Gegenseite"
+
+msgid "Filter Streaming"
+msgstr "Filter-Daten streamen"
+
+msgid "Minimum Priority"
+msgstr "Minimale Prioritt"
+
+msgid "Maximum Priority"
+msgstr "Maximale Prioritt"
+
diff --git a/client/po/fi_FI.po b/client/po/fi_FI.po
new file mode 100644
index 0000000..2091680
--- /dev/null
+++ b/client/po/fi_FI.po
@@ -0,0 +1,50 @@
+# VDR streamdev plugin language source file.
+# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org
+# This file is distributed under the same license as the VDR streamdev package.
+# Rolf Ahrenberg , 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: streamdev 0.5.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-14 13:05+0200\n"
+"PO-Revision-Date: 2008-03-30 02:11+0200\n"
+"Last-Translator: Rolf Ahrenberg \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "VTP Streaming Client"
+msgstr "VTP-suoratoistoasiakas"
+
+msgid "Suspend Server"
+msgstr "Pysyt palvelin"
+
+msgid "Server is suspended"
+msgstr "Palvelin on pysytetty"
+
+msgid "Couldn't suspend Server!"
+msgstr "Palvelinta ei onnistuttu pysyttmn!"
+
+msgid "Hide Mainmenu Entry"
+msgstr "Piilota valinta pvalikosta"
+
+msgid "Start Client"
+msgstr "Kynnist VDR-asiakas"
+
+msgid "Remote IP"
+msgstr "Etkoneen IP-osoite"
+
+msgid "Remote Port"
+msgstr "Etkoneen portti"
+
+msgid "Filter Streaming"
+msgstr "Suodatetun tiedon suoratoisto"
+
+msgid "Minimum Priority"
+msgstr "Pienin prioriteetti"
+
+msgid "Maximum Priority"
+msgstr "Suurin prioriteetti"
+
diff --git a/client/po/fr_FR.po b/client/po/fr_FR.po
new file mode 100644
index 0000000..5c3e756
--- /dev/null
+++ b/client/po/fr_FR.po
@@ -0,0 +1,50 @@
+# VDR streamdev plugin language source file.
+# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org
+# This file is distributed under the same license as the VDR streamdev package.
+# Frank Schmirler , 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: streamdev 0.5.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-14 13:05+0200\n"
+"PO-Revision-Date: 2008-03-30 02:11+0200\n"
+"Last-Translator: micky979 \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "VTP Streaming Client"
+msgstr "Client de streaming VTP"
+
+msgid "Suspend Server"
+msgstr "Suspendre le serveur"
+
+msgid "Server is suspended"
+msgstr "Le serveur est suspendu"
+
+msgid "Couldn't suspend Server!"
+msgstr "Impossible de suspendre le serveur!"
+
+msgid "Hide Mainmenu Entry"
+msgstr "Masquer dans le menu principal"
+
+msgid "Start Client"
+msgstr "Dmarrage du client"
+
+msgid "Remote IP"
+msgstr "Adresse IP du serveur"
+
+msgid "Remote Port"
+msgstr "Port du serveur"
+
+msgid "Filter Streaming"
+msgstr "Filtre streaming"
+
+msgid "Minimum Priority"
+msgstr ""
+
+msgid "Maximum Priority"
+msgstr ""
+
diff --git a/client/po/it_IT.po b/client/po/it_IT.po
new file mode 100644
index 0000000..068be7c
--- /dev/null
+++ b/client/po/it_IT.po
@@ -0,0 +1,52 @@
+# VDR streamdev plugin language source file.
+# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org
+# This file is distributed under the same license as the VDR streamdev package.
+# Alberto Carraro , 2001
+# Antonio Ospite , 2003
+# Sean Carlos , 2005
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: streamdev 0.5.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-14 13:05+0200\n"
+"PO-Revision-Date: 2008-04-13 23:42+0100\n"
+"Last-Translator: Diego Pierotto \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "VTP Streaming Client"
+msgstr "Client trasmissione VTP"
+
+msgid "Suspend Server"
+msgstr "Sospendi Server"
+
+msgid "Server is suspended"
+msgstr "Server sospeso"
+
+msgid "Couldn't suspend Server!"
+msgstr "Impossibile sospendere il server!"
+
+msgid "Hide Mainmenu Entry"
+msgstr "Nascondi voce menu principale"
+
+msgid "Start Client"
+msgstr "Avvia Client"
+
+msgid "Remote IP"
+msgstr "Indirizzo IP del Server"
+
+msgid "Remote Port"
+msgstr "Porta Server Remoto"
+
+msgid "Filter Streaming"
+msgstr "Filtra trasmissione"
+
+msgid "Minimum Priority"
+msgstr ""
+
+msgid "Maximum Priority"
+msgstr ""
+
diff --git a/client/po/lt_LT.po b/client/po/lt_LT.po
new file mode 100644
index 0000000..f6a7d5c
--- /dev/null
+++ b/client/po/lt_LT.po
@@ -0,0 +1,50 @@
+# VDR streamdev plugin language source file.
+# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org
+# This file is distributed under the same license as the VDR streamdev package.
+# Frank Schmirler , 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: streamdev 0.5.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-14 13:05+0200\n"
+"PO-Revision-Date: 2009-11-26 21:57+0200\n"
+"Last-Translator: Valdemaras Pipiras \n"
+"Language-Team: Lietuvių\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "VTP Streaming Client"
+msgstr "VTP transliavimo standartas"
+
+msgid "Suspend Server"
+msgstr "Sustabdyti serverį"
+
+msgid "Server is suspended"
+msgstr "Serveris sustabdytas"
+
+msgid "Couldn't suspend Server!"
+msgstr "Negali sustabdyti serverio!"
+
+msgid "Hide Mainmenu Entry"
+msgstr "Paslėpti pagrindinio meniu įrašą"
+
+msgid "Start Client"
+msgstr "Paleisti klientą"
+
+msgid "Remote IP"
+msgstr "Nuotolinis IP adresas"
+
+msgid "Remote Port"
+msgstr "Nuotolinis portas"
+
+msgid "Filter Streaming"
+msgstr "Filtruoti transliavimą"
+
+msgid "Minimum Priority"
+msgstr "Minimalus prioritetas"
+
+msgid "Maximum Priority"
+msgstr "Maksimalus prioritetas"
+
diff --git a/client/po/ru_RU.po b/client/po/ru_RU.po
new file mode 100644
index 0000000..c09d3f1
--- /dev/null
+++ b/client/po/ru_RU.po
@@ -0,0 +1,50 @@
+# VDR streamdev plugin language source file.
+# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org
+# This file is distributed under the same license as the VDR streamdev package.
+# Frank Schmirler , 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: streamdev 0.5.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-14 13:05+0200\n"
+"PO-Revision-Date: 2008-06-26 15:36+0100\n"
+"Last-Translator: Oleg Roitburd \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-5\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "VTP Streaming Client"
+msgstr "VTP Streaming "
+
+msgid "Suspend Server"
+msgstr " "
+
+msgid "Server is suspended"
+msgstr " "
+
+msgid "Couldn't suspend Server!"
+msgstr " "
+
+msgid "Hide Mainmenu Entry"
+msgstr " "
+
+msgid "Start Client"
+msgstr " "
+
+msgid "Remote IP"
+msgstr " IP"
+
+msgid "Remote Port"
+msgstr " "
+
+msgid "Filter Streaming"
+msgstr " "
+
+msgid "Minimum Priority"
+msgstr ""
+
+msgid "Maximum Priority"
+msgstr ""
+
diff --git a/client/po/sk_SK.po b/client/po/sk_SK.po
new file mode 100644
index 0000000..e3dbf6b
--- /dev/null
+++ b/client/po/sk_SK.po
@@ -0,0 +1,52 @@
+# VDR streamdev plugin language source file.
+# Copyright (C) 2009 streamdev development team. See http://streamdev.vdr-developer.org
+# This file is distributed under the same license as the VDR streamdev package.
+# Milan Hrala , 2009
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: streamdev_SK\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-14 13:05+0200\n"
+"PO-Revision-Date: \n"
+"Last-Translator: Milan Hrala \n"
+"Language-Team: Slovak \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Slovak\n"
+"X-Poedit-Country: SLOVAKIA\n"
+
+msgid "VTP Streaming Client"
+msgstr "VTP prdov klient"
+
+msgid "Suspend Server"
+msgstr "Server pozastaven"
+
+msgid "Server is suspended"
+msgstr "Server je doasne preruen"
+
+msgid "Couldn't suspend Server!"
+msgstr "Nepodarilo sa pozastavi Server!"
+
+msgid "Hide Mainmenu Entry"
+msgstr "Schova poloku v hlavnom menu"
+
+msgid "Start Client"
+msgstr "Spusti Klienta"
+
+msgid "Remote IP"
+msgstr "Vzdialen IP"
+
+msgid "Remote Port"
+msgstr "Vzdialen port"
+
+msgid "Filter Streaming"
+msgstr "filtrova prdy"
+
+msgid "Minimum Priority"
+msgstr "minimlna priorita"
+
+msgid "Maximum Priority"
+msgstr "maximlna priorita"
+
diff --git a/client/setup.c b/client/setup.c
index bf050b3..dd337c8 100644
--- a/client/setup.c
+++ b/client/setup.c
@@ -1,5 +1,5 @@
/*
- * $Id: setup.c,v 1.8 2009/02/03 10:26:21 schmirl Exp $
+ * $Id: setup.c,v 1.10 2010/06/08 05:55:17 schmirl Exp $
*/
#include
@@ -13,7 +13,6 @@ cStreamdevClientSetup::cStreamdevClientSetup(void) {
StartClient = false;
RemotePort = 2004;
StreamFilters = false;
- SyncEPG = false;
HideMenuEntry = false;
MinPriority = -1;
MaxPriority = MAXPRIORITY;
@@ -30,7 +29,6 @@ bool cStreamdevClientSetup::SetupParse(const char *Name, const char *Value) {
}
else if (strcmp(Name, "RemotePort") == 0) RemotePort = atoi(Value);
else if (strcmp(Name, "StreamFilters") == 0) StreamFilters = atoi(Value);
- else if (strcmp(Name, "SyncEPG") == 0) SyncEPG = atoi(Value);
else if (strcmp(Name, "HideMenuEntry") == 0) HideMenuEntry = atoi(Value);
else if (strcmp(Name, "MinPriority") == 0) MinPriority = atoi(Value);
else if (strcmp(Name, "MaxPriority") == 0) MaxPriority = atoi(Value);
@@ -41,14 +39,13 @@ bool cStreamdevClientSetup::SetupParse(const char *Name, const char *Value) {
cStreamdevClientMenuSetupPage::cStreamdevClientMenuSetupPage(void) {
m_NewSetup = StreamdevClientSetup;
- AddBoolEdit (tr("Hide Mainmenu Entry"),m_NewSetup.HideMenuEntry);
- AddBoolEdit (tr("Start Client"), m_NewSetup.StartClient);
- AddIpEdit (tr("Remote IP"), m_NewSetup.RemoteIp);
- AddShortEdit(tr("Remote Port"), m_NewSetup.RemotePort);
- AddBoolEdit (tr("Filter Streaming"), m_NewSetup.StreamFilters);
- AddBoolEdit (tr("Synchronize EPG"), m_NewSetup.SyncEPG);
- AddRangeEdit (tr("Minimum Priority"), m_NewSetup.MinPriority, -1, MAXPRIORITY);
- AddRangeEdit (tr("Maximum Priority"), m_NewSetup.MaxPriority, -1, MAXPRIORITY);
+ Add(new cMenuEditBoolItem(tr("Hide Mainmenu Entry"), &m_NewSetup.HideMenuEntry));
+ Add(new cMenuEditBoolItem(tr("Start Client"), &m_NewSetup.StartClient));
+ Add(new cMenuEditIpItem (tr("Remote IP"), m_NewSetup.RemoteIp));
+ Add(new cMenuEditIntItem (tr("Remote Port"), &m_NewSetup.RemotePort, 0, 65535));
+ Add(new cMenuEditBoolItem(tr("Filter Streaming"), &m_NewSetup.StreamFilters));
+ Add(new cMenuEditIntItem (tr("Minimum Priority"), &m_NewSetup.MinPriority, -1, MAXPRIORITY));
+ Add(new cMenuEditIntItem (tr("Maximum Priority"), &m_NewSetup.MaxPriority, -1, MAXPRIORITY));
SetCurrent(Get(0));
}
@@ -68,7 +65,6 @@ void cStreamdevClientMenuSetupPage::Store(void) {
SetupStore("RemoteIp", m_NewSetup.RemoteIp);
SetupStore("RemotePort", m_NewSetup.RemotePort);
SetupStore("StreamFilters", m_NewSetup.StreamFilters);
- SetupStore("SyncEPG", m_NewSetup.SyncEPG);
SetupStore("HideMenuEntry", m_NewSetup.HideMenuEntry);
SetupStore("MinPriority", m_NewSetup.MinPriority);
SetupStore("MaxPriority", m_NewSetup.MaxPriority);
diff --git a/client/setup.h b/client/setup.h
index 9f4d11b..6049967 100644
--- a/client/setup.h
+++ b/client/setup.h
@@ -1,5 +1,5 @@
/*
- * $Id: setup.h,v 1.5 2009/01/29 07:48:59 schmirl Exp $
+ * $Id: setup.h,v 1.7 2010/06/08 05:55:17 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_SETUPCLIENT_H
@@ -16,7 +16,6 @@ struct cStreamdevClientSetup {
char RemoteIp[20];
int RemotePort;
int StreamFilters;
- int SyncEPG;
int HideMenuEntry;
int MinPriority;
int MaxPriority;
@@ -24,7 +23,7 @@ struct cStreamdevClientSetup {
extern cStreamdevClientSetup StreamdevClientSetup;
-class cStreamdevClientMenuSetupPage: public cStreamdevMenuSetupPage {
+class cStreamdevClientMenuSetupPage: public cMenuSetupPage {
private:
cStreamdevClientSetup m_NewSetup;
diff --git a/client/socket.c b/client/socket.c
index 02f501d..bd2f9ba 100644
--- a/client/socket.c
+++ b/client/socket.c
@@ -1,5 +1,5 @@
/*
- * $Id: socket.c,v 1.12 2008/04/08 14:18:16 schmirl Exp $
+ * $Id: socket.c,v 1.13 2010/06/08 05:55:17 schmirl Exp $
*/
#include
@@ -300,52 +300,6 @@ bool cClientSocket::CloseDvr(void) {
return true;
}
-bool cClientSocket::SynchronizeEPG(void) {
- std::string buffer;
- bool result;
- FILE *epgfd;
-
- if (!CheckConnection()) return false;
-
- isyslog("Streamdev: Synchronizing EPG from server\n");
-
- CMD_LOCK;
-
- if (!Command("LSTE"))
- return false;
-
- if ((epgfd = tmpfile()) == NULL) {
- esyslog("ERROR: Streamdev: Error while processing EPG data: %s",
- strerror(errno));
- return false;
- }
-
- while ((result = Expect(215, &buffer))) {
- if (buffer[3] == ' ') break;
- fputs(buffer.c_str() + 4, epgfd);
- fputc('\n', epgfd);
- }
-
- if (!result) {
- if (errno == 0)
- esyslog("ERROR: Streamdev: Couldn't fetch EPG data from %s:%d",
- RemoteIp().c_str(), RemotePort());
- fclose(epgfd);
- return false;
- }
-
- rewind(epgfd);
- if (cSchedules::Read(epgfd))
- cSchedules::Cleanup(true);
- else {
- esyslog("ERROR: Streamdev: Parsing EPG data failed");
- fclose(epgfd);
- return false;
- }
- fclose(epgfd);
- return true;
-}
-
bool cClientSocket::Quit(void) {
bool res;
diff --git a/client/socket.h b/client/socket.h
index a0400e6..7ad9a80 100644
--- a/client/socket.h
+++ b/client/socket.h
@@ -1,5 +1,5 @@
/*
- * $Id: socket.h,v 1.6 2008/04/07 14:40:40 schmirl Exp $
+ * $Id: socket.h,v 1.7 2010/06/08 05:55:17 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_CLIENT_CONNECTION_H
@@ -48,7 +48,6 @@ public:
bool SetPid(int Pid, bool On);
bool SetFilter(ushort Pid, uchar Tid, uchar Mask, bool On);
bool CloseDvr(void);
- bool SynchronizeEPG(void);
bool SuspendServer(void);
bool Quit(void);
diff --git a/streamdev-client.c b/client/streamdev-client.c
similarity index 86%
rename from streamdev-client.c
rename to client/streamdev-client.c
index bc9403c..79c3d74 100644
--- a/streamdev-client.c
+++ b/client/streamdev-client.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: streamdev-client.c,v 1.6 2008/04/08 14:18:15 schmirl Exp $
+ * $Id: streamdev-client.c,v 1.1.2.1 2010/06/14 10:40:11 schmirl Exp $
*/
#include "streamdev-client.h"
@@ -32,11 +32,6 @@ bool cPluginStreamdevClient::Start(void) {
return true;
}
-void cPluginStreamdevClient::Housekeeping(void) {
- if (StreamdevClientSetup.StartClient && StreamdevClientSetup.SyncEPG)
- ClientSocket.SynchronizeEPG();
-}
-
const char *cPluginStreamdevClient::MainMenuEntry(void) {
return StreamdevClientSetup.StartClient && !StreamdevClientSetup.HideMenuEntry ? tr("Suspend Server") : NULL;
}
diff --git a/streamdev-client.h b/client/streamdev-client.h
similarity index 85%
rename from streamdev-client.h
rename to client/streamdev-client.h
index b01e0d7..07befe3 100644
--- a/streamdev-client.h
+++ b/client/streamdev-client.h
@@ -1,5 +1,5 @@
/*
- * $Id: streamdev-client.h,v 1.1.1.1 2004/12/30 22:43:59 lordjaxom Exp $
+ * $Id: streamdev-client.h,v 1.1.2.1 2010/06/14 10:40:11 schmirl Exp $
*/
#ifndef VDR_STREAMDEVCLIENT_H
@@ -19,7 +19,6 @@ public:
virtual const char *Version(void) { return VERSION; }
virtual const char *Description(void);
virtual bool Start(void);
- virtual void Housekeeping(void);
virtual const char *MainMenuEntry(void);
virtual cOsdObject *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void);
diff --git a/common.c b/common.c
index 021583a..47834fd 100644
--- a/common.c
+++ b/common.c
@@ -1,5 +1,5 @@
/*
- * $Id: common.c,v 1.10 2009/06/19 06:32:38 schmirl Exp $
+ * $Id: common.c,v 1.11.2.1 2010/06/08 07:47:45 schmirl Exp $
*/
#include
@@ -10,142 +10,9 @@
using namespace std;
-const char *VERSION = "0.5.0-pre-20090706";
+const char *VERSION = "0.5.0-rc1";
-const char *StreamTypes[st_Count] = {
- "TS",
- "PES",
- "PS",
- "ES",
- "Extern",
- "", // used internally only
-};
-
-const char *SuspendModes[sm_Count] = {
- trNOOP("Offer suspend mode"),
- trNOOP("Always suspended"),
- trNOOP("Never suspended")
-};
-
-const char IpCharacters[] = "0123456789.";
-
-char *GetNextLine(char *String, uint Length, uint &Offset) {
- char *last, *first;
-
- first = String + Offset;
- for (last = first; last < String + Length; ++last) {
- if (*last == '\012') {
- if (*(last - 1) == '\015')
- *(last - 1) = '\0';
-
- *last++ = '\0';
- Dprintf("IN: |%s|\n", first);
- Offset = last - String;
- return first;
- }
- }
- return NULL;
-}
-
-const cChannel *ChannelFromString(const char *String, int *Apid) {
- const cChannel *channel = NULL;
- char *string = strdup(String);
- char *ptr, *end;
- int apididx = 0;
-
- if ((ptr = strrchr(string, '+')) != NULL) {
- *(ptr++) = '\0';
- apididx = strtoul(ptr, &end, 10);
- Dprintf("found apididx: %d\n", apididx);
- }
-
- if (isnumber(string)) {
- int temp = strtol(String, NULL, 10);
- if (temp >= 1 && temp <= Channels.MaxNumber())
- channel = Channels.GetByNumber(temp);
- } else {
- channel = Channels.GetByChannelID(tChannelID::FromString(string));
-
- if (channel == NULL) {
- int i = 1;
- while ((channel = Channels.GetByNumber(i, 1)) != NULL) {
- if (String == channel->Name())
- break;
-
- i = channel->Number() + 1;
- }
- }
- }
-
- if (channel != NULL && apididx > 0) {
- int apid = 0, index = 1;
-
- for (int i = 0; channel->Apid(i) != 0; ++i, ++index) {
- if (index == apididx) {
- apid = channel->Apid(i);
- break;
- }
- }
-
- if (apid == 0) {
- for (int i = 0; channel->Dpid(i) != 0; ++i, ++index) {
- if (index == apididx) {
- apid = channel->Dpid(i);
- break;
- }
- }
- }
-
- if (Apid != NULL)
- *Apid = apid;
- }
-
- free(string);
- return channel;
-}
-
-void cStreamdevMenuSetupPage::AddCategory(const char *Title) {
- char *buffer = NULL;
-
- asprintf(&buffer, "--- %s -------------------------------------------------"
- "---------------", Title );
-
- cOsdItem *item = new cOsdItem(buffer);
- free(buffer);
- item->SetSelectable(false);
- Add(item);
-}
-
-void cStreamdevMenuSetupPage::AddBoolEdit(const char *Title, int &Value) {
- Add(new cMenuEditBoolItem(Title, &Value));
-}
-
-void cStreamdevMenuSetupPage::AddIpEdit(const char *Title, char *Value) {
- Add(new cMenuEditIpItem(Title, Value));
-}
-
-void cStreamdevMenuSetupPage::AddShortEdit(const char *Title, int &Value) {
- AddRangeEdit(Title, Value, 0, 65535);
-}
-
-void cStreamdevMenuSetupPage::AddRangeEdit(const char *Title, int &Value,
- int Min, int Max) {
- Add(new cMenuEditIntItem(Title, &Value, Min, Max));
-}
-
-void cStreamdevMenuSetupPage::AddSuspEdit(const char *Title, int &Value) {
- static const char *SuspendModesTR[sm_Count] = { NULL };
-
- if (SuspendModesTR[0] == NULL) {
- for (int i = 0; i < sm_Count; ++i)
- SuspendModesTR[i] = tr(SuspendModes[i]);
- }
-
- Add(new cMenuEditStraItem(Title, &Value, sm_Count, SuspendModesTR));
-}
-void cStreamdevMenuSetupPage::AddTypeEdit(const char *Title, int &Value) {
- Add(new cMenuEditStraItem(Title, &Value, st_CountSetup, StreamTypes));
-}
+const char cMenuEditIpItem::IpCharacters[] = "0123456789.";
cMenuEditIpItem::cMenuEditIpItem(const char *Name, char *Value):
cMenuEditItem(Name) {
diff --git a/common.h b/common.h
index f7b894a..a8830bd 100644
--- a/common.h
+++ b/common.h
@@ -1,5 +1,5 @@
/*
- * $Id: common.h,v 1.14 2009/07/01 10:46:16 schmirl Exp $
+ * $Id: common.h,v 1.15.2.1 2010/06/11 06:06:01 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_COMMON_H
@@ -23,42 +23,23 @@
# define Dprintf(x...)
#endif
-# define TRANSPONDER(c1, c2) (c1->Transponder() == c2->Transponder())
+#define TRANSPONDER(c1, c2) (c1->Transponder() == c2->Transponder())
-# define MAXPARSEBUFFER KILOBYTE(16)
+#define MAXPARSEBUFFER KILOBYTE(16)
/* Check if a channel is a radio station. */
#define ISRADIO(x) ((x)->Vpid()==0||(x)->Vpid()==1||(x)->Vpid()==0x1fff)
class cChannel;
-char *GetNextLine(char *String, uint Length, uint &Offset);
-
-const cChannel *ChannelFromString(const char *String, int *Apid = NULL);
-
-/* Disable logging if BUFCOUNT buffer overflows occur within BUFOVERTIME
- milliseconds. Enable logging again if there is no error within BUFOVERTIME
- milliseconds. */
-#define BUFOVERTIME 5000
-#define BUFOVERCOUNT 100
-
-#define POLLFAIL esyslog("Streamdev: Polling failed: %s", strerror(errno))
-#define WRITEFAIL esyslog("Streamdev: Writing failed: %s", strerror(errno))
-#define READFAIL esyslog("Streamdev: Reading failed: %s", strerror(errno))
-#define CHECKPOLL(x) if ((x)<0){POLLFAIL; return false;}
-#define CHECKWRITE(x) if ((x)<0) { WRITEFAIL; return false; }
-#define CHECKREAD(x) if ((x)<0) { READFAIL; return false; }
-
enum eStreamType {
stTS,
stPES,
stPS,
stES,
- stExtern,
+ stEXT,
stTSPIDS,
-
-#define st_CountSetup (stExtern+1)
-#define st_Count (stTSPIDS+1)
+ st_Count
};
enum eSuspendMode {
@@ -77,25 +58,10 @@ enum eSocketId {
};
extern const char *VERSION;
-extern const char *StreamTypes[st_Count];
-extern const char *SuspendModes[sm_Count];
-extern const char IpCharacters[];
-
-class cStreamdevMenuSetupPage: public cMenuSetupPage {
-protected:
- void AddCategory(const char *Title);
- virtual void Store(void) = 0;
-
- void AddBoolEdit(const char *Title, int &Value);
- void AddIpEdit(const char *Title, char *Value);
- void AddShortEdit(const char *Title, int &Value);
- void AddRangeEdit(const char *Title, int &Value, int Min, int Max);
- void AddSuspEdit(const char *Title, int &Value);
- void AddTypeEdit(const char *Title, int &Value);
-};
class cMenuEditIpItem: public cMenuEditItem {
private:
+ static const char IpCharacters[];
char *value;
int curNum;
int pos;
diff --git a/libdvbmpeg/Makefile b/libdvbmpeg/Makefile
index a586182..481d9c9 100644
--- a/libdvbmpeg/Makefile
+++ b/libdvbmpeg/Makefile
@@ -1,25 +1,34 @@
-INCS = -I.
-CFLAGS = -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fPIC
-MFLAG = -M
-OBJS = ctools.o ringbuffy.o remux.o transform.o
-SRC = $(wildcard *.c)
+#
+# Makefile for a Video Disk Recorder plugin
+#
+# $Id: Makefile,v 1.3.4.1 2010/06/14 10:40:13 schmirl Exp $
-DESTDIR = /usr/local
+### The object files (add further files here):
+
+OBJS = ctools.o remux.o ringbuffy.o transform.o
+
+### The main target:
.PHONY: clean
-
-clean:
- - rm -f *.o *~ *.a .depend
-
libdvbmpegtools.a: $(OBJS)
ar -rcs libdvbmpegtools.a $(OBJS)
-%.o: %.c
- $(CC) -c $(CFLAGS) $(INCS) $(DEFINES) $<
+### Implicit rules:
-.depend:
- $(CXX) $(DEFINES) $(MFLAG) $(SRC) $(INCS)> .depend
+%.o: %.c
+ $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+### Dependencies:
+MAKEDEP = $(CC) -MM -MG
+DEPFILE = .dependencies
--include .depend
+$(DEPFILE): Makefile
+ @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+
+-include $(DEPFILE)
+
+### Targets:
+
+clean:
+ @-rm -f $(OBJS) $(DEPFILE) *.a core* *~
diff --git a/po/fi_FI.po.bak b/po/fi_FI.po.bak
deleted file mode 100644
index f96a406..0000000
--- a/po/fi_FI.po.bak
+++ /dev/null
@@ -1,106 +0,0 @@
-# VDR streamdev plugin language source file.
-# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org
-# This file is distributed under the same license as the VDR streamdev package.
-# Rolf Ahrenberg , 2008
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: streamdev 0.5.0\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-31 13:34+0200\n"
-"PO-Revision-Date: 2008-03-30 02:11+0200\n"
-"Last-Translator: Rolf Ahrenberg \n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-msgid "VTP Streaming Client"
-msgstr "VTP-suoratoistoasiakas"
-
-msgid "Suspend Server"
-msgstr "Pysäytä palvelin"
-
-msgid "Server is suspended"
-msgstr "Palvelin on pysäytetty"
-
-msgid "Couldn't suspend Server!"
-msgstr "Palvelinta ei onnistuttu pysäyttämään!"
-
-msgid "Hide Mainmenu Entry"
-msgstr "Piilota valinta päävalikosta"
-
-msgid "Start Client"
-msgstr "Käynnistä VDR-asiakas"
-
-msgid "Remote IP"
-msgstr "Etäkoneen IP-osoite"
-
-msgid "Remote Port"
-msgstr "Etäkoneen portti"
-
-msgid "Filter Streaming"
-msgstr "Suodatetun tiedon suoratoisto"
-
-msgid "Synchronize EPG"
-msgstr "Päivitä ohjelmaopas"
-
-msgid "Minimum Priority"
-msgstr "Pienin prioriteetti"
-
-msgid "Maximum Priority"
-msgstr "Suurin prioriteetti"
-
-msgid "VDR Streaming Server"
-msgstr "VDR-suoratoistopalvelin"
-
-msgid "Streaming active"
-msgstr "Suoratoistopalvelin aktiivinen"
-
-msgid "Suspend Live TV"
-msgstr "Pysäytä suora TV-lähetys"
-
-msgid "Common Settings"
-msgstr "Yleiset asetukset"
-
-msgid "Maximum Number of Clients"
-msgstr "Suurin sallittu asiakkaiden määrä"
-
-msgid "Suspend behaviour"
-msgstr "Pysäytystoiminto"
-
-msgid "Client may suspend"
-msgstr "Asiakas saa pysäyttää palvelimen"
-
-msgid "VDR-to-VDR Server"
-msgstr "VDR-palvelin"
-
-msgid "Start VDR-to-VDR Server"
-msgstr "Käynnistä VDR-palvelin"
-
-msgid "VDR-to-VDR Server Port"
-msgstr "VDR-palvelimen portti"
-
-msgid "Bind to IP"
-msgstr "Sido osoitteeseen"
-
-msgid "HTTP Server"
-msgstr "HTTP-palvelin"
-
-msgid "Start HTTP Server"
-msgstr "Käynnistä HTTP-palvelin"
-
-msgid "HTTP Server Port"
-msgstr "HTTP-palvelimen portti"
-
-msgid "HTTP Streamtype"
-msgstr "HTTP-lähetysmuoto"
-
-msgid "Offer suspend mode"
-msgstr "tyrkytä"
-
-msgid "Always suspended"
-msgstr "aina"
-
-msgid "Never suspended"
-msgstr "ei koskaan"
diff --git a/remux/Makefile b/remux/Makefile
new file mode 100644
index 0000000..8adfb89
--- /dev/null
+++ b/remux/Makefile
@@ -0,0 +1,34 @@
+#
+# Makefile for a Video Disk Recorder plugin
+#
+# $Id: Makefile,v 1.1.2.1 2010/06/14 10:40:18 schmirl Exp $
+
+### The object files (add further files here):
+
+OBJS = tsremux.o ts2es.o ts2pes.o ts2ps.o extern.o
+
+### The main target:
+
+.PHONY: clean
+remux.a: $(OBJS)
+ ar -rcs remux.a $^
+
+### Implicit rules:
+
+%.o: %.c
+ $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+
+### Dependencies:
+
+MAKEDEP = $(CXX) -MM -MG
+DEPFILE = .dependencies
+
+$(DEPFILE): Makefile
+ @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+
+-include $(DEPFILE)
+
+### Targets:
+
+clean:
+ @-rm -f $(OBJS) $(DEPFILE) *.a core* *~
diff --git a/remux/extern.c b/remux/extern.c
index 3791d10..ce76883 100644
--- a/remux/extern.c
+++ b/remux/extern.c
@@ -1,14 +1,19 @@
#include "remux/extern.h"
#include "server/server.h"
+#include "server/connection.h"
#include "server/streamer.h"
+#include
#include
#include
#include
#include
#include
+#include
namespace Streamdev {
+#define MAXENV 63
+
class cTSExt: public cThread {
private:
cRingBufferLinear *m_ResultBuffer;
@@ -20,7 +25,7 @@ protected:
virtual void Action(void);
public:
- cTSExt(cRingBufferLinear *ResultBuffer, std::string Parameter);
+ cTSExt(cRingBufferLinear *ResultBuffer, const cServerConnection *Connection, const cChannel *Channel, const int *Apids, const int *Dpids);
virtual ~cTSExt();
void Put(const uchar *Data, int Count);
@@ -29,7 +34,7 @@ public:
} // namespace Streamdev
using namespace Streamdev;
-cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, std::string Parameter):
+cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, const cServerConnection *Connection, const cChannel *Channel, const int *Apids, const int *Dpids):
m_ResultBuffer(ResultBuffer),
m_Active(false),
m_Process(-1),
@@ -62,6 +67,115 @@ cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, std::string Parameter):
if (m_Process == 0) {
// child process
+ char *env[MAXENV + 1];
+ int i = 0;
+
+#define ADDENV(x...) if (asprintf(&env[i++], x) < 0) i--
+
+ // add channel ID, name and pids to environment
+ ADDENV("REMUX_CHANNEL_ID=%s", *Channel->GetChannelID().ToString());
+ ADDENV("REMUX_CHANNEL_NAME=%s", Channel->Name());
+#if APIVERSNUM >= 10701
+ ADDENV("REMUX_VTYPE=%d", Channel->Vtype());
+#endif
+ if (Channel->Vpid())
+ ADDENV("REMUX_VPID=%d", Channel->Vpid());
+ if (Channel->Ppid() != Channel->Vpid())
+ ADDENV("REMUX_PPID=%d", Channel->Ppid());
+ if (Channel->Tpid())
+ ADDENV("REMUX_TPID=%d", Channel->Tpid());
+
+ std::string buffer;
+ if (Apids && *Apids) {
+ for (const int *pid = Apids; *pid; pid++)
+ (buffer += (const char *) itoa(*pid)) += (*(pid + 1) ? " " : "");
+ ADDENV("REMUX_APID=%s", buffer.c_str());
+
+ buffer.clear();
+ for (const int *pid = Apids; *pid; pid++) {
+ int j;
+ for (j = 0; Channel->Apid(j) && Channel->Apid(j) != *pid; j++)
+ ;
+ (buffer += Channel->Alang(j)) += (*(pid + 1) ? " " : "");
+ }
+ ADDENV("REMUX_ALANG=%s", buffer.c_str());
+ }
+
+ if (Dpids && *Dpids) {
+ buffer.clear();
+ for (const int *pid = Dpids; *pid; pid++)
+ (buffer += (const char *) itoa(*pid)) += (*(pid + 1) ? " " : "");
+ ADDENV("REMUX_DPID=%s", buffer.c_str());
+
+ buffer.clear();
+ for (const int *pid = Dpids; *pid; pid++) {
+ int j;
+ for (j = 0; Channel->Dpid(j) && Channel->Dpid(j) != *pid; j++)
+ ;
+ (buffer += Channel->Dlang(j)) += (*(pid + 1) ? " " : "");
+ }
+ ADDENV("REMUX_DLANG=%s", buffer.c_str());
+ }
+
+ if (Channel->Spid(0)) {
+ buffer.clear();
+ for (const int *pid = Channel->Spids(); *pid; pid++)
+ (buffer += (const char *) itoa(*pid)) += (*(pid + 1) ? " " : "");
+ ADDENV("REMUX_SPID=%s", buffer.c_str());
+
+ buffer.clear();
+ for (int j = 0; Channel->Spid(j); j++)
+ (buffer += Channel->Slang(j)) += (Channel->Spid(j + 1) ? " " : "");
+ ADDENV("REMUX_SLANG=%s", buffer.c_str());
+ }
+
+ if (Connection) {
+ // add vars for a CGI like interface
+ // the following vars are not implemented:
+ // REMOTE_HOST, REMOTE_IDENT, REMOTE_USER
+ // CONTENT_TYPE, CONTENT_LENGTH,
+ // SCRIPT_NAME, PATH_TRANSLATED, GATEWAY_INTERFACE
+ ADDENV("REMOTE_ADDR=%s", Connection->RemoteIp().c_str());
+ ADDENV("SERVER_NAME=%s", Connection->LocalIp().c_str());
+ ADDENV("SERVER_PORT=%d", Connection->LocalPort());
+ ADDENV("SERVER_PROTOCOL=%s", Connection->Protocol());
+ ADDENV("SERVER_SOFTWARE=%s", VERSION);
+
+ for (tStrStrMap::const_iterator it = Connection->Headers().begin(); it != Connection->Headers().end(); it++) {
+ if (i >= MAXENV) {
+ esyslog("streamdev-server: Too many headers for externremux.sh");
+ break;
+ }
+ ADDENV("%s=%s", it->first.c_str(), it->second.c_str());
+ }
+
+ // look for section parameters: /path;param1=value1;param2=value2/
+ std::string::size_type begin, end;
+ std::string path = Connection->Headers().at("PATH_INFO");
+ begin = path.find(';', 0);
+ begin = path.find_first_not_of(';', begin);
+ end = path.find_first_of(";/", begin);
+ while (begin != std::string::npos && path[begin] != '/') {
+ std::string param = path.substr(begin, end - begin);
+ std::string::size_type e = param.find('=');
+
+ if (i >= MAXENV) {
+ esyslog("streamdev-server: Too many parameters for externremux.sh");
+ break;
+ }
+ else if (e > 0 && e != std::string::npos) {
+ ADDENV("REMUX_PARAM_%s", param.c_str());
+ }
+ else
+ esyslog("streamdev-server: Invalid externremux.sh parameter %s", param.c_str());
+
+ begin = path.find_first_not_of(';', end);
+ end = path.find_first_of(";/", begin);
+ }
+ }
+
+ env[i] = NULL;
+
dup2(inpipe[0], STDIN_FILENO);
close(inpipe[1]);
dup2(outpipe[1], STDOUT_FILENO);
@@ -71,9 +185,11 @@ cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, std::string Parameter):
for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
close(i); //close all dup'ed filedescriptors
- std::string cmd = std::string(opt_remux) + " " + Parameter;
- if (execl("/bin/sh", "sh", "-c", cmd.c_str(), NULL) == -1) {
- esyslog("streamdev-server: externremux script '%s' execution failed: %m", cmd.c_str());
+ if (setpgid(0, 0) == -1)
+ esyslog("streamdev-server: externremux setpgid failed: %m");
+
+ if (execle("/bin/sh", "sh", "-c", opt_remux, NULL, env) == -1) {
+ esyslog("streamdev-server: externremux script '%s' execution failed: %m", opt_remux);
_exit(-1);
}
// should never be reached
@@ -172,9 +288,9 @@ void cTSExt::Put(const uchar *Data, int Count)
}
}
-cExternRemux::cExternRemux(int VPid, const int *APids, const int *Dpids, const int *SPids, std::string Parameter):
+cExternRemux::cExternRemux(const cServerConnection *Connection, const cChannel *Channel, const int *Apids, const int *Dpids):
m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE, TS_SIZE * 2)),
- m_Remux(new cTSExt(m_ResultBuffer, Parameter))
+ m_Remux(new cTSExt(m_ResultBuffer, Connection, Channel, Apids, Dpids))
{
m_ResultBuffer->SetTimeouts(500, 100);
}
diff --git a/remux/extern.h b/remux/extern.h
index ff4ddec..070e4f6 100644
--- a/remux/extern.h
+++ b/remux/extern.h
@@ -5,6 +5,9 @@
#include
#include
+class cChannel;
+class cServerConnection;
+
namespace Streamdev {
class cTSExt;
@@ -15,7 +18,7 @@ private:
cTSExt *m_Remux;
public:
- cExternRemux(int VPid, const int *APids, const int *Dpids, const int *SPids, std::string Parameter);
+ cExternRemux(const cServerConnection *Connection, const cChannel *Channel, const int *APids, const int *Dpids);
virtual ~cExternRemux();
int Put(const uchar *Data, int Count);
diff --git a/remux/tsremux.h b/remux/tsremux.h
index dbcd5de..8f22b1d 100644
--- a/remux/tsremux.h
+++ b/remux/tsremux.h
@@ -11,6 +11,8 @@ namespace Streamdev {
class cTSRemux {
public:
+ virtual ~cTSRemux() {};
+
virtual int Put(const uchar *Data, int Count) = 0;
virtual uchar *Get(int &Count) = 0;
virtual void Del(int Count) = 0;
diff --git a/server/Makefile b/server/Makefile
new file mode 100644
index 0000000..91c2a93
--- /dev/null
+++ b/server/Makefile
@@ -0,0 +1,82 @@
+#
+# Makefile for a Video Disk Recorder plugin
+#
+# $Id: Makefile,v 1.1.2.1 2010/06/14 10:40:20 schmirl Exp $
+
+# The official name of this plugin.
+# This name will be used in the '-P...' option of VDR to load the plugin.
+# By default the main source file also carries this name.
+#
+PLUGIN = streamdev-server
+
+### Includes and Defines (add further entries here):
+
+DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+
+### The object files (add further files here):
+
+COMMONOBJS = ../common.o
+
+SERVEROBJS = $(PLUGIN).o \
+ server.o component.o connection.o \
+ componentVTP.o connectionVTP.o \
+ componentHTTP.o connectionHTTP.o menuHTTP.o \
+ componentIGMP.o connectionIGMP.o \
+ streamer.o livestreamer.o livefilter.o recplayer.o \
+ suspend.o setup.o
+
+### The main target:
+
+.PHONY: all i18n clean
+all: libvdr-$(PLUGIN).so i18n
+
+### Implicit rules:
+
+%.o: %.c
+ $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+
+### Dependencies:
+
+MAKEDEP = $(CXX) -MM -MG
+DEPFILE = .dependencies
+
+$(DEPFILE): Makefile
+ @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(SERVEROBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) > $@
+
+-include $(DEPFILE)
+
+### Internationalization (I18N):
+
+PODIR = po
+LOCALEDIR = $(VDRDIR)/locale
+I18Npo = $(wildcard $(PODIR)/*.po)
+I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+I18Npot = $(PODIR)/$(PLUGIN).pot
+
+%.mo: %.po
+ msgfmt -c -o $@ $<
+
+$(I18Npot): $(SERVEROBJS:%.o=%.c)
+ xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='' -o $@ $^
+
+%.po: $(I18Npot)
+ msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+ @touch $@
+
+$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+ @mkdir -p $(dir $@)
+ cp $< $@
+
+i18n: $(I18Nmsgs)
+
+### Targets:
+
+libvdr-$(PLUGIN).so: $(SERVEROBJS) $(COMMONOBJS) \
+ ../tools/sockettools.a ../remux/remux.a ../libdvbmpeg/libdvbmpegtools.a
+
+%.so:
+ $(CXX) $(CXXFLAGS) -shared $^ -o $@
+ @cp $@ $(LIBDIR)/$@.$(APIVERSION)
+
+clean:
+ @-rm -f $(COMMONOBJS) $(SERVEROBJS) $(DEPFILE) $(PODIR)/*.mo $(PODIR)/*.pot *.so *.tgz core* *~
diff --git a/server/connection.c b/server/connection.c
index 74b2783..6121b7a 100644
--- a/server/connection.c
+++ b/server/connection.c
@@ -1,5 +1,5 @@
/*
- * $Id: connection.c,v 1.12 2009/02/13 10:39:22 schmirl Exp $
+ * $Id: connection.c,v 1.13.2.1 2010/06/11 06:06:02 schmirl Exp $
*/
#include "server/connection.h"
@@ -27,6 +27,66 @@ cServerConnection::~cServerConnection()
{
}
+const cChannel* cServerConnection::ChannelFromString(const char *String, int *Apid, int *Dpid) {
+ const cChannel *channel = NULL;
+ char *string = strdup(String);
+ char *ptr, *end;
+ int apididx = 0;
+
+ if ((ptr = strrchr(string, '+')) != NULL) {
+ *(ptr++) = '\0';
+ apididx = strtoul(ptr, &end, 10);
+ Dprintf("found apididx: %d\n", apididx);
+ }
+
+ if (isnumber(string)) {
+ int temp = strtol(String, NULL, 10);
+ if (temp >= 1 && temp <= Channels.MaxNumber())
+ channel = Channels.GetByNumber(temp);
+ } else {
+ channel = Channels.GetByChannelID(tChannelID::FromString(string));
+
+ if (channel == NULL) {
+ int i = 1;
+ while ((channel = Channels.GetByNumber(i, 1)) != NULL) {
+ if (String == channel->Name())
+ break;
+
+ i = channel->Number() + 1;
+ }
+ }
+ }
+
+ if (channel != NULL && apididx > 0) {
+ int apid = 0, dpid = 0;
+ int index = 1;
+
+ for (int i = 0; channel->Apid(i) != 0; ++i, ++index) {
+ if (index == apididx) {
+ apid = channel->Apid(i);
+ break;
+ }
+ }
+
+ if (apid == 0) {
+ for (int i = 0; channel->Dpid(i) != 0; ++i, ++index) {
+ if (index == apididx) {
+ dpid = channel->Dpid(i);
+ break;
+ }
+ }
+ }
+
+ if (Apid != NULL)
+ *Apid = apid;
+ if (Dpid != NULL)
+ *Dpid = dpid;
+ }
+
+ free(string);
+ return channel;
+}
+
bool cServerConnection::Read(void)
{
int b;
diff --git a/server/connection.h b/server/connection.h
index 2c28a09..dfaff91 100644
--- a/server/connection.h
+++ b/server/connection.h
@@ -1,5 +1,5 @@
/*
- * $Id: connection.h,v 1.7 2009/02/13 10:39:22 schmirl Exp $
+ * $Id: connection.h,v 1.8.2.1 2010/06/11 06:06:02 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_SERVER_CONNECTION_H
@@ -8,6 +8,11 @@
#include "tools/socket.h"
#include "common.h"
+#include