summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-11-03 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-11-03 18:00:00 +0100
commit1a8a081629b736572a8f6489428975cf54448e67 (patch)
tree89e4a13947bfd3cfd8ee4c0fd9fad9ffbe29497f
parent57bd7eeed1c1aa84316f8299e1528b3bc63d7623 (diff)
downloadvdr-patch-lnbsharing-1a8a081629b736572a8f6489428975cf54448e67.tar.gz
vdr-patch-lnbsharing-1a8a081629b736572a8f6489428975cf54448e67.tar.bz2
Version 1.1.15vdr-1.1.15
- Completely switched to the new CVS HEAD version of the linux-dvb driver. The NEWSTRUCT compile time switch is now obsolete. The required driver is now the CVS HEAD version dated 2002-11-01 or later. - Adjusted the INSTALL file to the 1.1.x version. - Only accepting key presses from the current remote control when learning (thanks to Oliver Endriss). - Fixed the EPG scanner, which broke 'Transfer Mode' as soon as it kicked in (thanks to Oliver Endriss for reporting this one). - Fixed handling audio tracks in cDvbDevice. - Updated channels.conf.terr (thanks to Uwe Scheffler). - Fixed displaying the group separators in the channel display (thanks to Martin Hammerschmid for pointing out this one). - The Makefile now includes the file Make.config (if present in the VDR source directory), which allows the user to overwrite several settings with individual values (suggested by Andreas Schultz). The VDR distribution archive does not contain this file in order to not overwrite a user defined file. There is a Make.config.template which contains the default values of the macros the user can overwrite. - Since there have been changes to the 'newplugin' script authors of plugins may want to newly create their plugins' Makefiles with the new version of this script, and adapt them to their individual needs (make sure you don't overwrite your existing plugin directory - make a backup copy first!). - Fixed reading EPG data via the SVDRP command PUTE (it changed the current service ID). - Fixed closing all dup'ed file descriptors in cPipe. - Implemented a plugin interface for additional audio processing (see PLUGINS.html under "Dolby Digital"). The functionality of the '-a' command line option has been reactivated. Since the author doesn't have any Dolby Digital equipment this may or may not work as expected. There may still be some places where a call to cAudios::Clear() or cAudios::Mute() is necessary. Those with Dolby Digital equipment should please take a look at this and maybe send patches. Replaying Dolby Digital in ways other than through VDR's '-a' option will have to be implemented as plugins. Those who have written patches for VDR version 1.0.x should convert their work into the proper plugins for version 1.1.x. Note to authors of cPlayer derived plugins: please read the modified comments in device.h regarding the member functions cDevice::Clear(), cDevice::Mute() and cDevice::PlayAudio(). Derived classes must call these base class member functions to make sure all registered cAudio objects are properly handled. Also note that the return type of cDevice::PlayAudio() has been changed to 'void', since this function always has to accept the entire data block immediately and there is nothing that could be reasonably done in case an error occurs in one of the cAudio objects. - Now checking the driver's DVB_API_VERSION in dvbdevice.h. Since VDR now requires a driver dated 2002-11-01 or later the MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT and DVB_DRIVER_VERSION stuff has been replaced with DO_REC_AND_PLAY_ON_PRIMARY_DEVICE, which can be used to disable simultaneous recording and replaying on the primary DVB device in case there are problems with this.
-rw-r--r--CONTRIBUTORS6
-rw-r--r--HISTORY51
-rw-r--r--INSTALL17
-rw-r--r--Make.config.template25
-rw-r--r--Makefile9
-rw-r--r--PLUGINS.html78
-rw-r--r--PLUGINS/SRC/hello/HISTORY7
-rw-r--r--PLUGINS/SRC/hello/Makefile26
-rw-r--r--PLUGINS/SRC/hello/hello.c4
-rw-r--r--PLUGINS/SRC/status/HISTORY7
-rw-r--r--PLUGINS/SRC/status/Makefile26
-rw-r--r--PLUGINS/SRC/status/status.c4
-rw-r--r--audio.c89
-rw-r--r--audio.h44
-rw-r--r--channels.c70
-rw-r--r--channels.conf.terr30
-rw-r--r--config.c5
-rw-r--r--config.h4
-rw-r--r--device.c18
-rw-r--r--device.h12
-rw-r--r--dvbdevice.c200
-rw-r--r--dvbdevice.h18
-rw-r--r--dvbosd.h6
-rw-r--r--dvbplayer.c4
-rw-r--r--eit.c38
-rw-r--r--eit.h3
-rw-r--r--eitscan.c4
-rw-r--r--interface.c6
-rw-r--r--menu.c8
-rwxr-xr-xnewplugin26
-rw-r--r--player.c11
-rw-r--r--player.h6
-rw-r--r--remote.c6
-rw-r--r--remote.h6
-rw-r--r--remux.h6
-rw-r--r--thread.c10
-rw-r--r--transfer.c4
-rw-r--r--vdr.c18
38 files changed, 481 insertions, 431 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 7b75ac8..399ba30 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -47,6 +47,7 @@ Martin Hammerschmid <martin@hammerschmid.com>
for detecting a deadlock when switching channels via Schedule/Now|Next/Switch
for adding a missing #include to ringbuffer.c
for adding a missing 'public' keyword in device.h
+ for pointing out a bug in displaying the group separators in the channel display
Bastian Guse <bastian@nocopy.de>
for writing the FORMATS entry for timers.conf
@@ -184,6 +185,7 @@ Andreas Schultz <aschultz@warp10.net>
for reporting a problem with plugin Makefiles and the NEWSTRUCT driver
for pointing out some unnecessary #includes in eit.c and a problem with
cMenuRecordings::Del(), which caused warnings with gcc-3.2
+ for suggesting a Make.config file
Aaron Holtzman
for writing 'ac3dec'
@@ -426,6 +428,10 @@ Oliver Endriss <o.endriss@gmx.de>
one remote control
for reporting a crash when learning the keys of several remote controls and
pressing buttons of those that have already been learned
+ for making the remote control learn procedure accept key presses only from the
+ current remote control
+ for reporting a bug in the EPG scanner, which broke 'Transfer Mode' as soon as
+ it kicked in
Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf'
diff --git a/HISTORY b/HISTORY
index 536ea28..dc276f5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1670,3 +1670,54 @@ Video Disk Recorder Revision History
- Fixed a crash when learning the keys of several remote controls and pressing
buttons of those that have already been learned (thanks to Oliver Endriss for
reporting this one).
+
+2002-11-03: Version 1.1.15
+
+- Completely switched to the new CVS HEAD version of the linux-dvb driver.
+ The NEWSTRUCT compile time switch is now obsolete. The required driver is now
+ the CVS HEAD version dated 2002-11-01 or later.
+- Adjusted the INSTALL file to the 1.1.x version.
+- Only accepting key presses from the current remote control when learning (thanks to
+ Oliver Endriss).
+- Fixed the EPG scanner, which broke 'Transfer Mode' as soon as it kicked in
+ (thanks to Oliver Endriss for reporting this one).
+- Fixed handling audio tracks in cDvbDevice.
+- Updated channels.conf.terr (thanks to Uwe Scheffler).
+- Fixed displaying the group separators in the channel display (thanks to Martin
+ Hammerschmid for pointing out this one).
+- The Makefile now includes the file Make.config (if present in the VDR source
+ directory), which allows the user to overwrite several settings with individual
+ values (suggested by Andreas Schultz). The VDR distribution archive does not
+ contain this file in order to not overwrite a user defined file. There is a
+ Make.config.template which contains the default values of the macros the user
+ can overwrite.
+- Since there have been changes to the 'newplugin' script authors of plugins
+ may want to newly create their plugins' Makefiles with the new version of this
+ script, and adapt them to their individual needs (make sure you don't overwrite
+ your existing plugin directory - make a backup copy first!).
+- Fixed reading EPG data via the SVDRP command PUTE (it changed the current
+ service ID).
+- Fixed closing all dup'ed file descriptors in cPipe.
+- Implemented a plugin interface for additional audio processing (see PLUGINS.html
+ under "Dolby Digital").
+ The functionality of the '-a' command line option has been reactivated.
+ Since the author doesn't have any Dolby Digital equipment this may or may not
+ work as expected. There may still be some places where a call to cAudios::Clear()
+ or cAudios::Mute() is necessary. Those with Dolby Digital equipment should please
+ take a look at this and maybe send patches.
+ Replaying Dolby Digital in ways other than through VDR's '-a' option will have to
+ be implemented as plugins. Those who have written patches for VDR version 1.0.x
+ should convert their work into the proper plugins for version 1.1.x.
+ Note to authors of cPlayer derived plugins: please read the modified comments
+ in device.h regarding the member functions cDevice::Clear(), cDevice::Mute() and
+ cDevice::PlayAudio(). Derived classes must call these base class member functions
+ to make sure all registered cAudio objects are properly handled. Also note that
+ the return type of cDevice::PlayAudio() has been changed to 'void', since this
+ function always has to accept the entire data block immediately and there is
+ nothing that could be reasonably done in case an error occurs in one of the
+ cAudio objects.
+- Now checking the driver's DVB_API_VERSION in dvbdevice.h. Since VDR now requires
+ a driver dated 2002-11-01 or later the MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT and
+ DVB_DRIVER_VERSION stuff has been replaced with DO_REC_AND_PLAY_ON_PRIMARY_DEVICE,
+ which can be used to disable simultaneous recording and replaying on the primary
+ DVB device in case there are problems with this.
diff --git a/INSTALL b/INSTALL
index 2ceda92..da99593 100644
--- a/INSTALL
+++ b/INSTALL
@@ -13,9 +13,9 @@ extracted into the directory /home/kls/vdr/DVB, then this
package should be extracted into /home/kls/vdr/VDR.
If you have the DVB driver source in a different location
you will have to change the definition of DVBDIR in the
-Makefile.
+Makefile (see the file Make.config.template).
-VDR requires the Linux-DVB card driver version dated 2001-09-14 or higher
+VDR requires the Linux-DVB card driver version dated 2002-11-01 or higher
to work properly.
After extracting the package, change into the VDR directory
@@ -306,8 +306,8 @@ Setting up DiSEqC:
If you are using a DVB-S card with a satellite equipment that needs to be
accessed using DiSEqC, you have to go to the "Setup" menu and set the "DiSEqC"
-parameter to "on". Also check the "DiSEqC" parameters for the various channels
-and set them to the necessary values.
+parameter to "on". You also need to set up the file 'diseqc.conf' to properly
+access your DiSEqC equipment (see man vdr(5) for details).
Running VDR with DVB-C (cable) or DVB-T (terrestrial):
------------------------------------------------------
@@ -318,14 +318,13 @@ cable or terrestrial reception is the 'channels.conf' file. The distribution
archive contains a default 'channels.conf.cable' and 'channels.conf.terr',
respectively, which users of such cards can rename or copy to 'channels.conf'
in order to receive digital cable or terrestrial channels. The format of these
-files is exactly the same as for satellite channels (the fields containing
-"Polarization" and "Diseqc" data are ignored in case of DVB-C and DVB-T, and
-the "Frequency" is in kHz in case of DVB-T).
+files is mostly the same as for satellite channels, however, some fields have
+different or extended meanings (see man vdr(5) for details).
You can even use a mixture of DVB-S, DVB-C and DVB-T cards in the same system.
All you need to do is to put all the channel definitions into one big
-'channels.conf' file and set the 'Ca' parameter of each channel to the number
-of the card that can receive it.
+'channels.conf' file. VDR will automatically know which channels can be
+received with which card(s) by evaluating the 'source' parameter.
Learning the remote control keys:
---------------------------------
diff --git a/Make.config.template b/Make.config.template
new file mode 100644
index 0000000..774abbf
--- /dev/null
+++ b/Make.config.template
@@ -0,0 +1,25 @@
+#
+# User defined Makefile options for the Video Disk Recorder
+#
+# Copy this file to 'Make.config' and change the parameters as necessary.
+#
+# See the main source file 'vdr.c' for copyright information and
+# how to reach the author.
+#
+# $Id: Make.config.template 1.1 2002/11/01 14:05:36 kls Exp $
+
+### The C compiler and options:
+
+CC = gcc
+CFLAGS = -O2
+
+CXX = g++
+CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual
+
+### The directory environment:
+
+DVBDIR = ../DVB
+MANDIR = /usr/local/man
+BINDIR = /usr/local/bin
+
+VIDEODIR = /video
diff --git a/Makefile b/Makefile
index 6b88356..c6e891f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
-# $Id: Makefile 1.49 2002/10/19 15:46:08 kls Exp $
+# $Id: Makefile 1.51 2002/11/01 13:11:53 kls Exp $
.DELETE_ON_ERROR:
@@ -23,12 +23,9 @@ PLUGINDIR= ./PLUGINS
VIDEODIR = /video
-ifdef NEWSTRUCT
+-include Make.config
+
INCLUDES = -I$(DVBDIR)/include
-DEFINES += -DNEWSTRUCT
-else
-INCLUDES = -I$(DVBDIR)/ost/include
-endif
DTVLIB = $(DTVDIR)/libdtv.a
diff --git a/PLUGINS.html b/PLUGINS.html
index 3a26783..ccd3fcf 100644
--- a/PLUGINS.html
+++ b/PLUGINS.html
@@ -21,18 +21,18 @@ VDR program and present itself to the user.
The <i>inside</i> interface provides the plugin code access to VDR's internal data
structures and allows it to hook itself into specific areas to perform special actions.
<p>
-<!--X1.1.11--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
-Important modifications introduced in version 1.1.11 are marked like this.
-<!--X1.1.11--></td></tr></table>
-<!--X1.1.12--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.12--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.12 are marked like this.
<!--X1.1.12--></td></tr></table>
-<!--X1.1.13--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.1.13--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.13 are marked like this.
<!--X1.1.13--></td></tr></table>
-<!--X1.1.14--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<!--X1.1.14--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.14 are marked like this.
<!--X1.1.14--></td></tr></table>
+<!--X1.1.15--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+Important modifications introduced in version 1.1.15 are marked like this.
+<!--X1.1.15--></td></tr></table>
<a name="Part I - The Outside Interface"><hr><center><h1>Part I - The Outside Interface</h1></center>
@@ -964,7 +964,7 @@ bool DevicePoll(cPoller &amp;Poller, int TimeoutMs = 0);
</pre></td></tr></table><p>
to determine whether the device is ready for further data.
-<!--X1.1.13--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.1.13--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<p>
If the player can provide more than a single audio track, it can implement the
following functions to make them available:
@@ -977,7 +977,16 @@ virtual void SetAudioTrack(int Index);
<!--X1.1.13--></td></tr></table>
<p>
-TODO: PlayAudio()???
+<!--X1.1.15--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+If there is an additional audio track that has to be replayed with external hardware,
+the player shall call its member function
+
+<p><table><tr><td bgcolor=#F0F0F0><pre><br>
+void PlayAudio(const uchar *Data, int Length);
+</pre></td></tr></table><p>
+
+where <tt>Data</tt> points to a complete audio PES packet of <tt>Length</tt> bytes.
+<!--X1.1.15--></td></tr></table>
<p>
The second part needed here is a control object that receives user input from the main
program loop and reacts on this by telling the player what to do:
@@ -1196,7 +1205,7 @@ If the new device can receive, it most likely needs to provide a way of
selecting which channel it shall tune to:
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
-<!--X1.1.12--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.12--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
virtual bool ProvidesSource(int Source) const;
<!--X1.1.12--></td></tr></table>
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL);
@@ -1206,7 +1215,7 @@ virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
These functions will be called with the desired source or channel and shall return whether
this device can provide the requested source or channel and whether tuning to it was successful,
repectively.
-<!--X1.1.13--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.1.13--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<p>
<b>Audio selection</b>
<p>
@@ -1253,7 +1262,7 @@ The functions to implement replaying capabilites are
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
virtual bool HasDecoder(void) const;
-<!--X1.1.14--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<!--X1.1.14--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
virtual bool CanReplay(void) const;
<!--X1.1.14--></td></tr></table>
virtual bool SetPlayMode(ePlayMode PlayMode);
@@ -1315,7 +1324,51 @@ shut down (delete) all devices when the program terminates. It is therefore
important that the devices are created on the heap, using the <tt>new</tt>
operator!
-<!--X1.1.11--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
+<!--X1.1.15--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<hr><h2>Dolby Digital</h2>
+
+<center><i><b>"The stereo effect may only be experienced if stereo equipment is used!"</b></i></center><p>
+
+There are many different ways to replay additional audio tracks, like Dolby Digital.
+So VDR offers a plugin interface that allows for the implementation of any kind of
+audio replay facility.
+<p>
+To implement a new audio output facility, simply derive a class from <tt>cAudio</tt>,
+as in
+
+<p><table><tr><td bgcolor=#F0F0F0><pre><br>
+#include &lt;vdr/audio.h&gt;
+#include &lt;vdr/thread.h&gt;
+
+class cMyAudio : public cAudio, private cThread {
+private:
+ virtual void Action(void);
+public:
+ cMyAudio(void);
+ virtual void Play(const uchar *Data, int Length);
+ virtual void Mute(bool On);
+ virtual void Clear(void);
+ };
+</pre></td></tr></table><p>
+
+You should create your derived audio object in the
+<a href="#Getting started"><tt>Start()</tt></a> function of your plugin.
+Note that the object has to be created on the heap (using <tt>new</tt>),
+and you shall not delete it at any point (it will be deleted automatically
+when the program ends).
+<p>
+The <tt>Play()</tt> function will be offered complete audio PES packets
+and has to accept each packet immediately. It must return as soon as possible,
+in order to not delay the overall replay process. Therefore you may want to
+also derive your class from <tt>cThread</tt> and run the actual audio processing
+as a separate thread. Note that the offered data is only valid within the call
+to <tt>Play()</tt>, so if you can't process the entire block immediately, you
+will need to copy it for later processing in your thread.
+<p>
+The <tt>Mute()</tt> and <tt>Clear()</tt> functions will be called whenever the audio shall
+be muted, or any buffered data shall be cleared, respectively.
+<!--X1.1.15--></td></tr></table>
+
<hr><h2>Remote Control</h2>
<center><i><b>The joy of zapping!</b></i></center><p>
@@ -1427,7 +1480,6 @@ Put(uint64 Code, bool Repeat = false, bool Release = false);
</pre></td></tr></table><p>
The other parameters have the same meaning as in the first version of this function.
-<!--X1.1.11--></td></tr></table>
</body>
</html>
diff --git a/PLUGINS/SRC/hello/HISTORY b/PLUGINS/SRC/hello/HISTORY
index 10d905e..8639e05 100644
--- a/PLUGINS/SRC/hello/HISTORY
+++ b/PLUGINS/SRC/hello/HISTORY
@@ -30,3 +30,10 @@ VDR Plugin 'hello' Revision History
2002-10-26: Version 0.0.7
- Fixed a typo.
+
+2002-11-01: Version 0.0.8
+
+- Completely switched to the new CVS HEAD version of the linux-dvb driver.
+ The NEWSTRUCT compile time switch is now obsolete. The required driver is now
+ the CVS HEAD version dated 2002-11-01 or later.
+- Introduced Make.config.
diff --git a/PLUGINS/SRC/hello/Makefile b/PLUGINS/SRC/hello/Makefile
index 802889b..92ac45f 100644
--- a/PLUGINS/SRC/hello/Makefile
+++ b/PLUGINS/SRC/hello/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile 1.5 2002/09/17 15:36:36 kls Exp $
+# $Id: Makefile 1.7 2002/11/01 13:44:11 kls Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
@@ -13,19 +13,22 @@ PLUGIN = hello
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
+### The C++ compiler and options:
+
+CXX = g++
+CXXFLAGS = -O2 -Wall -Woverloaded-virtual
+
### The directory environment:
-ifdef NEWSTRUCT
-DVBDIR = ../../../../DVB/include
-DEFINES += -DNEWSTRUCT
-else
-DVBDIR = ../../../../DVB/ost/include
-endif
+DVBDIR = ../../../../DVB
VDRDIR = ../../..
-VDRINC = $(VDRDIR)/include
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"):
VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
@@ -37,7 +40,7 @@ PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here):
-INCLUDES = -I$(VDRINC) -I$(DVBDIR)
+INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
@@ -45,11 +48,6 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
OBJS = $(PLUGIN).o i18n.o
-### The C++ compiler and options:
-
-CXX = g++
-CXXFLAGS = -O2 -Wall -Woverloaded-virtual
-
### Implicit rules:
%.o: %.c
diff --git a/PLUGINS/SRC/hello/hello.c b/PLUGINS/SRC/hello/hello.c
index 5073e30..6583285 100644
--- a/PLUGINS/SRC/hello/hello.c
+++ b/PLUGINS/SRC/hello/hello.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: hello.c 1.8 2002/10/26 14:34:48 kls Exp $
+ * $Id: hello.c 1.9 2002/11/01 10:16:53 kls Exp $
*/
#include <getopt.h>
@@ -12,7 +12,7 @@
#include <vdr/plugin.h>
#include "i18n.h"
-static const char *VERSION = "0.0.7";
+static const char *VERSION = "0.0.8";
static const char *DESCRIPTION = "A friendly greeting";
static const char *MAINMENUENTRY = "Hello";
diff --git a/PLUGINS/SRC/status/HISTORY b/PLUGINS/SRC/status/HISTORY
index b66f654..45d42fb 100644
--- a/PLUGINS/SRC/status/HISTORY
+++ b/PLUGINS/SRC/status/HISTORY
@@ -16,3 +16,10 @@ VDR Plugin 'status' Revision History
2002-10-26: Version 0.0.4
- Fixed a typo.
+
+2002-11-01: Version 0.0.5
+
+- Completely switched to the new CVS HEAD version of the linux-dvb driver.
+ The NEWSTRUCT compile time switch is now obsolete. The required driver is now
+ the CVS HEAD version dated 2002-11-01 or later.
+- Introduced Make.config.
diff --git a/PLUGINS/SRC/status/Makefile b/PLUGINS/SRC/status/Makefile
index f08f22c..00fd97b 100644
--- a/PLUGINS/SRC/status/Makefile
+++ b/PLUGINS/SRC/status/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile 1.3 2002/09/21 08:38:39 kls Exp $
+# $Id: Makefile 1.5 2002/11/01 13:44:25 kls Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
@@ -13,19 +13,22 @@ PLUGIN = status
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
+### The C++ compiler and options:
+
+CXX = g++
+CXXFLAGS = -O2 -Wall -Woverloaded-virtual
+
### The directory environment:
-ifdef NEWSTRUCT
-DVBDIR = ../../../../DVB/include
-DEFINES += -DNEWSTRUCT
-else
-DVBDIR = ../../../../DVB/ost/include
-endif
+DVBDIR = ../../../../DVB
VDRDIR = ../../..
-VDRINC = $(VDRDIR)/include
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"):
VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
@@ -37,7 +40,7 @@ PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here):
-INCLUDES = -I$(VDRINC) -I$(DVBDIR)
+INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
@@ -45,11 +48,6 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
OBJS = $(PLUGIN).o
-### The C++ compiler and options:
-
-CXX = g++
-CXXFLAGS = -O2 -Wall -Woverloaded-virtual
-
### Implicit rules:
%.o: %.c
diff --git a/PLUGINS/SRC/status/status.c b/PLUGINS/SRC/status/status.c
index 15a3ee9..12e64b7 100644
--- a/PLUGINS/SRC/status/status.c
+++ b/PLUGINS/SRC/status/status.c
@@ -3,13 +3,13 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: status.c 1.4 2002/10/26 14:34:53 kls Exp $
+ * $Id: status.c 1.5 2002/11/01 10:16:59 kls Exp $
*/
#include <vdr/plugin.h>
#include <vdr/status.h>
-static const char *VERSION = "0.0.4";
+static const char *VERSION = "0.0.5";
static const char *DESCRIPTION = "Status monitor test";
static const char *MAINMENUENTRY = NULL;
diff --git a/audio.c b/audio.c
index 226505b..c958256 100644
--- a/audio.c
+++ b/audio.c
@@ -4,8 +4,95 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: audio.c 1.1 2002/05/30 11:08:54 kls Exp $
+ * $Id: audio.c 1.2 2002/11/03 11:53:34 kls Exp $
*/
#include "audio.h"
+#include "stdlib.h"
+// --- cAudio ----------------------------------------------------------------
+
+cAudio::cAudio(void)
+{
+ Audios.Add(this);
+}
+
+cAudio::~cAudio()
+{
+}
+
+// --- cAudios ---------------------------------------------------------------
+
+cAudios Audios;
+
+void cAudios::PlayAudio(const uchar *Data, int Length)
+{
+ for (cAudio *audio = First(); audio; audio = Next(audio))
+ audio->Play(Data, Length);
+}
+
+void cAudios::MuteAudio(bool On)
+{
+ for (cAudio *audio = First(); audio; audio = Next(audio))
+ audio->Mute(On);
+}
+
+void cAudios::ClearAudio(void)
+{
+ for (cAudio *audio = First(); audio; audio = Next(audio))
+ audio->Clear();
+}
+
+// --- cExternalAudio --------------------------------------------------------
+
+cExternalAudio::cExternalAudio(const char *Command)
+{
+ command = strdup(Command);
+ mute = false;
+}
+
+cExternalAudio::~cExternalAudio()
+{
+ free(command);
+}
+
+void cExternalAudio::Play(const uchar *Data, int Length)
+{
+ if (command && !mute) {
+ if (pipe || pipe.Open(command, "w")) {
+ if (Data[0] == 0x00 && Data[1] == 0x00 && Data[2] == 0x01) {
+ if (Data[3] == 0xBD) { // dolby
+ //XXX??? int written = Data[8] + (skipAC3bytes ? 13 : 9); // skips the PES header
+ int written = Data[8] + 9; // skips the PES header
+ Length -= written;
+ while (Length > 0) {
+ int w = fwrite(Data + written, 1, Length, pipe);
+ if (w < 0) {
+ LOG_ERROR;
+ break;
+ }
+ Length -= w;
+ written += w;
+ }
+ }
+ }
+ }
+ else {
+ esyslog("ERROR: can't open pipe to audio command '%s'", command);
+ free(command);
+ command = NULL;
+ }
+ }
+}
+
+void cExternalAudio::Mute(bool On)
+{
+ mute = On;
+ if (mute)
+ Clear();
+}
+
+void cExternalAudio::Clear(void)
+{
+ pipe.Close();
+}
diff --git a/audio.h b/audio.h
index 545a0af..565bd97 100644
--- a/audio.h
+++ b/audio.h
@@ -4,10 +4,52 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: audio.h 1.1 2002/05/30 11:07:28 kls Exp $
+ * $Id: audio.h 1.2 2002/11/03 11:50:02 kls Exp $
*/
#ifndef __AUDIO_H
#define __AUDIO_H
+#include "thread.h"
+#include "tools.h"
+
+class cAudio : public cListObject {
+protected:
+ cAudio(void);
+public:
+ virtual ~cAudio();
+ virtual void Play(const uchar *Data, int Length) = 0;
+ // Plays the given block of audio Data. Must return as soon as possible.
+ // If the entire block of data can't be processed immediately, it must
+ // be copied and processed in a separate thread. The Data is always a
+ // complete PES audio packet.
+ virtual void Mute(bool On) = 0;
+ // Immediately sets the audio device to be silent (On==true) or to
+ // normal replay (On==false).
+ virtual void Clear(void) = 0;
+ // Clears all data that might still be awaiting processing.
+ };
+
+class cAudios : public cList<cAudio> {
+public:
+ void PlayAudio(const uchar *Data, int Length);
+ void MuteAudio(bool On);
+ void ClearAudio(void);
+ };
+
+extern cAudios Audios;
+
+class cExternalAudio : public cAudio {
+private:
+ char *command;
+ cPipe pipe;
+ bool mute;
+public:
+ cExternalAudio(const char *Command);
+ virtual ~cExternalAudio();
+ virtual void Play(const uchar *Data, int Length);
+ virtual void Mute(bool On);
+ virtual void Clear(void);
+ };
+
#endif //__AUDIO_H
diff --git a/channels.c b/channels.c
index e142a28..4f1bcec 100644
--- a/channels.c
+++ b/channels.c
@@ -4,15 +4,11 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: channels.c 1.5 2002/10/20 11:50:47 kls Exp $
+ * $Id: channels.c 1.6 2002/11/01 10:26:45 kls Exp $
*/
#include "channels.h"
-#ifdef NEWSTRUCT
#include <linux/dvb/frontend.h>
-#else
-#include <ost/frontend.h>
-#endif
#include <ctype.h>
// IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
@@ -32,9 +28,7 @@ const tChannelParameterMap BandwidthValues[] = {
{ 6, BANDWIDTH_6_MHZ },
{ 7, BANDWIDTH_7_MHZ },
{ 8, BANDWIDTH_8_MHZ },
-#ifdef NEWSTRUCT
{ 999, BANDWIDTH_AUTO },
-#endif
{ -1 }
};
@@ -43,17 +37,11 @@ const tChannelParameterMap CoderateValues[] = {
{ 12, FEC_1_2 },
{ 23, FEC_2_3 },
{ 34, FEC_3_4 },
-#ifdef NEWSTRUCT
{ 45, FEC_4_5 },
-#endif
{ 56, FEC_5_6 },
-#ifdef NEWSTRUCT
{ 67, FEC_6_7 },
-#endif
{ 78, FEC_7_8 },
-#ifdef NEWSTRUCT
{ 89, FEC_8_9 },
-#endif
{ 999, FEC_AUTO },
{ -1 }
};
@@ -65,18 +53,14 @@ const tChannelParameterMap ModulationValues[] = {
{ 64, QAM_64 },
{ 128, QAM_128 },
{ 256, QAM_256 },
-#ifdef NEWSTRUCT
{ 999, QAM_AUTO },
-#endif
{ -1 }
};
const tChannelParameterMap TransmissionValues[] = {
{ 2, TRANSMISSION_MODE_2K },
{ 8, TRANSMISSION_MODE_8K },
-#ifdef NEWSTRUCT
{ 999, TRANSMISSION_MODE_AUTO },
-#endif
{ -1 }
};
@@ -85,9 +69,7 @@ const tChannelParameterMap GuardValues[] = {
{ 8, GUARD_INTERVAL_1_8 },
{ 16, GUARD_INTERVAL_1_16 },
{ 32, GUARD_INTERVAL_1_32 },
-#ifdef NEWSTRUCT
{ 999, GUARD_INTERVAL_AUTO },
-#endif
{ -1 }
};
@@ -96,9 +78,7 @@ const tChannelParameterMap HierarchyValues[] = {
{ 1, HIERARCHY_1 },
{ 2, HIERARCHY_2 },
{ 4, HIERARCHY_4 },
-#ifdef NEWSTRUCT
{ 999, HIERARCHY_AUTO },
-#endif
{ -1 }
};
@@ -160,16 +140,15 @@ cChannel::cChannel(void)
sid = 0;
number = 0;
groupSep = false;
- //XXX
polarization = 'v';
inversion = INVERSION_AUTO;
- bandwidth = BANDWIDTH_8_MHZ;
- coderateH = FEC_AUTO;//XXX FEC_2_3
- coderateL = FEC_1_2;//XXX
- modulation = QAM_64;
- transmission = TRANSMISSION_MODE_2K;
- guard = GUARD_INTERVAL_1_32;
- hierarchy = HIERARCHY_NONE;
+ bandwidth = BANDWIDTH_AUTO;
+ coderateH = FEC_AUTO;
+ coderateL = FEC_AUTO;
+ modulation = QAM_AUTO;
+ transmission = TRANSMISSION_MODE_AUTO;
+ guard = GUARD_INTERVAL_AUTO;
+ hierarchy = HIERARCHY_AUTO;
}
cChannel::cChannel(const cChannel *Channel)
@@ -187,24 +166,20 @@ cChannel::cChannel(const cChannel *Channel)
ca = Channel ? Channel->ca : 0;
sid = Channel ? Channel->sid : 0;
groupSep = Channel ? Channel->groupSep : false;
- //XXX
polarization = Channel ? Channel->polarization : 'v';
inversion = Channel ? Channel->inversion : INVERSION_AUTO;
- bandwidth = Channel ? Channel->bandwidth : BANDWIDTH_8_MHZ;
- coderateH = Channel ? Channel->coderateH : FEC_AUTO;//XXX FEC_2_3
- coderateL = Channel ? Channel->coderateL : FEC_1_2;//XXX
- modulation = Channel ? Channel->modulation : QAM_64;
- transmission = Channel ? Channel->transmission : TRANSMISSION_MODE_2K;
- guard = Channel ? Channel->guard : GUARD_INTERVAL_1_32;
- hierarchy = Channel ? Channel->hierarchy : HIERARCHY_NONE;
+ bandwidth = Channel ? Channel->bandwidth : BANDWIDTH_AUTO;
+ coderateH = Channel ? Channel->coderateH : FEC_AUTO;
+ coderateL = Channel ? Channel->coderateL : FEC_AUTO;
+ modulation = Channel ? Channel->modulation : QAM_AUTO;
+ transmission = Channel ? Channel->transmission : TRANSMISSION_MODE_AUTO;
+ guard = Channel ? Channel->guard : GUARD_INTERVAL_AUTO;
+ hierarchy = Channel ? Channel->hierarchy : HIERARCHY_AUTO;
}
static int PrintParameter(char *p, char Name, int Value)
{
- //XXX return Value >= 0 && Value != 999 ? sprintf(p, "%c%d", Name, Value) : 0;
- //XXX let's store 999 for the moment, until we generally switch to the NEWSTRUCT
- //XXX driver (where the defaults will all be AUTO)
- return Value >= 0 && (Value != 999 || (Name != 'I' && Name != 'C')) ? sprintf(p, "%c%d", Name, Value) : 0;
+ return Value >= 0 && Value != 999 ? sprintf(p, "%c%d", Name, Value) : 0;
}
const char *cChannel::ParametersToString(void)
@@ -233,17 +208,8 @@ static const char *ParseParameter(const char *s, int &Value, const tChannelParam
errno = 0;
int n = strtol(s, &p, 10);
if (!errno && p != s) {
- //XXX let's tolerate 999 for the moment, until we generally switch to the NEWSTRUCT
- //XXX driver (where the defaults will all be AUTO)
- //XXX Value = MapToDriver(n, Map);
- //XXX if (Value >= 0)
- //XXX return p;
- int v = MapToDriver(n, Map);
- if (v >= 0) {
- Value = v;
- return p;
- }
- else if (v == 999)
+ Value = MapToDriver(n, Map);
+ if (Value >= 0)
return p;
}
}
diff --git a/channels.conf.terr b/channels.conf.terr
index 14362a1..62b110c 100644
--- a/channels.conf.terr
+++ b/channels.conf.terr
@@ -10,22 +10,14 @@ BBC NEWS 24:505833:0:0:0:640:641:0:0:4415
BBC Knowledge:505833:0:0:0:630:631:0:0:4607
Shop!:561833:0:0:0:6049:6050:0:0:13120
: DVB-T Berlin Germany
-PRO 7:714000:I0C23D0M16B8T8G8Y0:T:27500:161:82:83:0:19
-SAT 1:714000:I0C23D0M16B8T8G8Y0:T:27500:160:80:81:0:18
-RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:160:80:0:0:1
-RTL 2:778000:I0C23D0M16B8T8G8Y0:T:27500:161:82:0:0:2
-Super RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:162:84:0:0:3
-VOX:778000:I0C23D0M16B8T8G8Y0:T:27500:163:86:0:0:4
-KABEL 1:714000:I0C23D0M16B8T8G8Y0:T:27500:162:84:0:0:20
-MTV:674000:I0C23D0M16B8T2G8Y0:T:27500:161:82:83:0:27
-VIVA/arte:674000:I0C23D0M16B8T2G8Y0:T:27500:163:86:87:0:29
-N-TV:650000:I0C12D0M16B8T2G8Y0:T:27500:160:80:81:0:6
-N24:714000:I0C23D0M16B8T8G8Y0:T:27500:163:86:0:0:21
-Eurosport:674000:I0C23D0M16B8T2G8Y0:T:27500:160:80:81:0:26
-FAB:674000:I0C23D0M16B8T2G8Y0:T:27500:162:84:84:0:28
-ARD:602000:I0C23D0M16B8T8G8Y0:T:27500:208:209:667:0:4
-ZDF:730000:I0C23D0M16B8T2G8Y0:T:27500:110:120:130:0:22
-ZDF-docukanal:730000:I0C23D0M16B8T2G8Y0:T:27500:660:670:130:0:24
-ZDF-info:730000:I0C23D0M16B8T2G8Y0:T:27500:610:620:130:0:23
-EinsMuXx:650000:I0C12D0M16B8T2G8Y0:T:27500:161:82:0:0:7
-EinsFestival:602000:I0C23D0M16B8T8G8Y0:T:27500:80:81:0:0:2
+PRO 7:658000:I0C23D0M16B8T8G8Y0:T:27500:305:306;307:0:0:16403
+SAT 1:658000:I0C23D0M16B8T8G8Y0:T:27500:385:386:0:0:16408
+RTL:658000:I0C23D0M16B8T8G8Y0:T:27500:337:338:0:0:16405
+RTL 2:658000:I0C23D0M16B8T8G8Y0:T:27500:353:354:0:0:16406
+Super RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:433:434:0:0:16411
+VOX:778000:I0C23D0M16B8T8G8Y0:T:27500:545:546:0:0:16418
+KABEL 1:778000:I0C23D0M16B8T8G8Y0:T:27500:161:162:0:0:16394
+MTV:650000:I0C23D0M16B8T2G8Y0:T:27500:193:194:0:0:16396
+N-TV:650000:I0C23D0M16B8T2G8Y0:T:27500:273:274:0:0:16401
+N24:778000:I0C23D0M16B8T8G8Y0:T:27500:225:226:0:0:16398
+FAB:650000:I0C23D0M16B8T2G8Y0:T:27500:3073:3074:0:0:16576
diff --git a/config.c b/config.c
index 7cea98e..e1d982a 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c 1.111 2002/10/19 15:49:51 kls Exp $
+ * $Id: config.c 1.112 2002/11/02 13:13:49 kls Exp $
*/
#include "config.h"
@@ -210,7 +210,6 @@ bool cSetupLine::operator< (const cListObject &ListObject)
bool cSetupLine::Parse(char *s)
{
- //dsyslog("cSetupLine::Parse '%s'", s);//XXX-
char *p = strchr(s, '=');
if (p) {
*p = 0;
@@ -228,7 +227,6 @@ bool cSetupLine::Parse(char *s)
}
name = strdup(Name);
value = strdup(Value);
- //dsyslog("cSetupLine::Parse '%s' = '%s'", name, value);//XXX-
return true;
}
}
@@ -237,7 +235,6 @@ bool cSetupLine::Parse(char *s)
bool cSetupLine::Save(FILE *f)
{
- //dsyslog("cSetupLine::Save '%s' = '%s'", name, value);//XXX-
return fprintf(f, "%s%s%s = %s\n", plugin ? plugin : "", plugin ? "." : "", name, value) > 0;
}
diff --git a/config.h b/config.h
index 0cac7b9..22eb9ec 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.137 2002/10/19 15:43:31 kls Exp $
+ * $Id: config.h 1.138 2002/11/01 09:27:17 kls Exp $
*/
#ifndef __CONFIG_H
@@ -20,7 +20,7 @@
#include "eit.h"
#include "tools.h"
-#define VDRVERSION "1.1.14"
+#define VDRVERSION "1.1.15"
#define MAXPRIORITY 99
#define MAXLIFETIME 99
diff --git a/device.c b/device.c
index 2d3d1d9..69178a9 100644
--- a/device.c
+++ b/device.c
@@ -4,13 +4,14 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.32 2002/10/26 11:43:52 kls Exp $
+ * $Id: device.c 1.34 2002/11/03 11:51:24 kls Exp $
*/
#include "device.h"
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include "audio.h"
#include "channels.h"
#include "eit.h"
#include "i18n.h"
@@ -416,6 +417,7 @@ bool cDevice::ToggleMute(void)
mute = !mute;
SetVolume(0, mute);
volume = OldVolume;
+ Audios.MuteAudio(mute);
return mute;
}
@@ -424,8 +426,10 @@ void cDevice::SetVolume(int Volume, bool Absolute)
volume = min(max(Absolute ? Volume : volume + Volume, 0), MAXVOLUME);
SetVolumeDevice(volume);
cStatus::MsgSetVolume(volume, Absolute);
- if (volume > 0)
+ if (volume > 0) {
mute = false;
+ Audios.MuteAudio(mute);
+ }
}
int cDevice::NumAudioTracks(void) const
@@ -462,6 +466,7 @@ void cDevice::TrickSpeed(int Speed)
void cDevice::Clear(void)
{
+ Audios.ClearAudio();
}
void cDevice::Play(void)
@@ -474,6 +479,7 @@ void cDevice::Freeze(void)
void cDevice::Mute(void)
{
+ Audios.MuteAudio(true);
}
void cDevice::StillPicture(const uchar *Data, int Length)
@@ -529,9 +535,9 @@ int cDevice::PlayVideo(const uchar *Data, int Length)
return -1;
}
-int cDevice::PlayAudio(const uchar *Data, int Length)
+void cDevice::PlayAudio(const uchar *Data, int Length)
{
- return -1;
+ Audios.PlayAudio(Data, Length);
}
int cDevice::Ca(void) const
@@ -608,10 +614,10 @@ int cDevice::ProvidesCa(int Ca) const
return result ? result + others : 0;
}
-bool cDevice::Receiving(void) const
+bool cDevice::Receiving(bool CheckAny) const
{
for (int i = 0; i < MAXRECEIVERS; i++) {
- if (receiver[i] && receiver[i]->priority >= 0) // cReceiver with priority < 0 doesn't count
+ if (receiver[i] && (CheckAny || receiver[i]->priority >= 0)) // cReceiver with priority < 0 doesn't count
return true;
}
return false;
diff --git a/device.h b/device.h
index 1070c52..cc2be79 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h 1.25 2002/10/26 11:33:42 kls Exp $
+ * $Id: device.h 1.27 2002/11/03 11:16:11 kls Exp $
*/
#ifndef __DEVICE_H
@@ -290,6 +290,8 @@ public:
// times.
virtual void Clear(void);
// Clears all video and audio data from the device.
+ // A derived class must call the base class function to make sure
+ // all registered cAudio objects are notified.
virtual void Play(void);
// Sets the device into play mode (after a previous trick
// mode).
@@ -297,6 +299,8 @@ public:
// Puts the device into "freeze frame" mode.
virtual void Mute(void);
// Turns off audio while replaying.
+ // A derived class must call the base class function to make sure
+ // all registered cAudio objects are notified.
virtual void StillPicture(const uchar *Data, int Length);
// Displays the given I-frame as a still picture.
virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
@@ -309,8 +313,10 @@ public:
// Actually plays the given data block as video. The data must be
// part of a PES (Packetized Elementary Stream) which can contain
// one video and one audio strem.
- virtual int PlayAudio(const uchar *Data, int Length);
+ virtual void PlayAudio(const uchar *Data, int Length);
// Plays additional audio streams, like Dolby Digital.
+ // A derived class must call the base class function to make sure data
+ // is distributed to all registered cAudio objects.
bool Replaying(void) const;
// Returns true if we are currently replaying.
void StopReplay(void);
@@ -347,7 +353,7 @@ protected:
public:
int Ca(void) const;
// Returns the ca of the current receiving session(s).
- bool Receiving(void) const;
+ bool Receiving(bool CheckAny = false) const;
// Returns true if we are currently receiving.
bool AttachReceiver(cReceiver *Receiver);
// Attaches the given receiver to this device.
diff --git a/dvbdevice.c b/dvbdevice.c
index a1a8913..30d5658 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.c 1.30 2002/10/26 11:37:03 kls Exp $
+ * $Id: dvbdevice.c 1.34 2002/11/03 12:31:11 kls Exp $
*/
#include "dvbdevice.h"
@@ -18,17 +18,10 @@ extern "C" {
}
#include <limits.h>
#include <linux/videodev.h>
-#ifdef NEWSTRUCT
#include <linux/dvb/audio.h>
#include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h>
#include <linux/dvb/video.h>
-#else
-#include <ost/audio.h>
-#include <ost/dmx.h>
-#include <ost/sec.h>
-#include <ost/video.h>
-#endif
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "channels.h"
@@ -39,8 +32,9 @@ extern "C" {
#include "status.h"
#include "transfer.h"
+#define DO_REC_AND_PLAY_ON_PRIMARY_DEVICE 1
+
#define DEV_VIDEO "/dev/video"
-#ifdef NEWSTRUCT
#define DEV_DVB_ADAPTER "/dev/dvb/adapter"
#define DEV_DVB_OSD "osd"
#define DEV_DVB_FRONTEND "frontend"
@@ -48,24 +42,11 @@ extern "C" {
#define DEV_DVB_DEMUX "demux"
#define DEV_DVB_VIDEO "video"
#define DEV_DVB_AUDIO "audio"
-#else
-#define DEV_DVB_OSD "/dev/ost/osd"
-#define DEV_DVB_FRONTEND "/dev/ost/frontend"
-#define DEV_DVB_SEC "/dev/ost/sec"
-#define DEV_DVB_DVR "/dev/ost/dvr"
-#define DEV_DVB_DEMUX "/dev/ost/demux"
-#define DEV_DVB_VIDEO "/dev/ost/video"
-#define DEV_DVB_AUDIO "/dev/ost/audio"
-#endif
static const char *DvbName(const char *Name, int n)
{
static char buffer[PATH_MAX];
-#ifdef NEWSTRUCT
snprintf(buffer, sizeof(buffer), "%s%d/%s%d", DEV_DVB_ADAPTER, n, Name, 0);
-#else
- snprintf(buffer, sizeof(buffer), "%s%d", Name, n);
-#endif
return buffer;
}
@@ -80,11 +61,7 @@ static int DvbOpen(const char *Name, int n, int Mode, bool ReportError = false)
cDvbDevice::cDvbDevice(int n)
{
-#ifdef NEWSTRUCT
frontendType = fe_type_t(-1); // don't know how else to initialize this - there is no FE_UNKNOWN
-#else
- frontendType = FrontendType(-1); // don't know how else to initialize this - there is no FE_UNKNOWN
-#endif
siProcessor = NULL;
spuDecoder = NULL;
playMode = pmNone;
@@ -99,12 +76,6 @@ cDvbDevice::cDvbDevice(int n)
fd_video = DvbOpen(DEV_DVB_VIDEO, n, O_RDWR | O_NONBLOCK);
fd_audio = DvbOpen(DEV_DVB_AUDIO, n, O_RDWR | O_NONBLOCK);
-#ifndef NEWSTRUCT
- // Devices that are only present on DVB-S cards:
-
- fd_sec = DvbOpen(DEV_DVB_SEC, n, O_RDWR);
-#endif
-
// The DVR device (will be opened and closed as needed):
fd_dvr = -1;
@@ -116,11 +87,7 @@ cDvbDevice::cDvbDevice(int n)
// We only check the devices that must be present - the others will be checked before accessing them://XXX
if (fd_frontend >= 0) {
-#ifdef NEWSTRUCT
dvb_frontend_info feinfo;
-#else
- FrontendInfo feinfo;
-#endif
siProcessor = new cSIProcessor(DvbName(DEV_DVB_DEMUX, n));
if (ioctl(fd_frontend, FE_GET_INFO, &feinfo) >= 0)
frontendType = feinfo.type;
@@ -312,20 +279,12 @@ void cDvbDevice::SetVideoFormat(bool VideoFormat16_9)
}
// ptAudio ptVideo ptTeletext ptDolby ptOther
-#ifdef NEWSTRUCT
dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER };
-#else
-dmxPesType_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER };
-#endif
bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{
if (Handle->pid) {
-#ifdef NEWSTRUCT
dmx_pes_filter_params pesFilterParams;
-#else
- dmxPesFilterParams pesFilterParams;
-#endif
memset(&pesFilterParams, 0, sizeof(pesFilterParams));
if (On) {
if (Handle->handle < 0) {
@@ -336,11 +295,7 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
pesFilterParams.pid = Handle->pid;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = (Type <= ptTeletext && Handle->used <= 1) ? DMX_OUT_DECODER : DMX_OUT_TS_TAP;
-#ifdef NEWSTRUCT
pesFilterParams.pes_type= PesTypes[Type < ptOther ? Type : ptOther];
-#else
- pesFilterParams.pesType = PesTypes[Type < ptOther ? Type : ptOther];
-#endif
pesFilterParams.flags = DMX_IMMEDIATE_START;
if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
LOG_ERROR;
@@ -353,11 +308,7 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
pesFilterParams.pid = 0x1FFF;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_DECODER;
-#ifdef NEWSTRUCT
pesFilterParams.pes_type= PesTypes[Type];
-#else
- pesFilterParams.pesType = PesTypes[Type];
-#endif
pesFilterParams.flags = DMX_IMMEDIATE_START;
CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams));
close(Handle->handle);
@@ -402,17 +353,10 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne
}
else if (!IsPrimaryDevice())
result = true;
- else {
-#define DVB_DRIVER_VERSION 2002090101 //XXX+
-#define MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT 2002090101
-#ifdef DVB_DRIVER_VERSION
-#if (DVB_DRIVER_VERSION >= MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT)
- result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
+#ifdef DO_REC_AND_PLAY_ON_PRIMARY_DEVICE
+ else
+ result = Priority >= Setup.PrimaryLimit;
#endif
-#else
-#warning "DVB_DRIVER_VERSION not defined - time shift with only one DVB device disabled!"
-#endif
- }
}
else
result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
@@ -437,7 +381,7 @@ static unsigned int FrequencyToHz(unsigned int f)
bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
{
-#if (DVB_DRIVER_VERSION < MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT)
+#ifndef DO_REC_AND_PLAY_ON_PRIMARY_DEVICE
if (HasDecoder())
LiveView = true;
#endif
@@ -491,11 +435,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (DoTune) {
-#ifdef NEWSTRUCT
dvb_frontend_parameters Frontend;
-#else
- FrontendParameters Frontend;
-#endif
memset(&Frontend, 0, sizeof(Frontend));
@@ -508,14 +448,9 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
cDiseqc *diseqc = Diseqcs.Get(Channel->Source(), Channel->Frequency(), Channel->Polarization());
if (diseqc) {
if (diseqc->Commands() && (!diseqcCommands || strcmp(diseqcCommands, diseqc->Commands()) != 0)) {
-#ifndef NEWSTRUCT
- int SecTone = SEC_TONE_OFF;
- int SecVolt = SEC_VOLTAGE_13;
-#endif
cDiseqc::eDiseqcActions da;
for (bool Start = true; (da = diseqc->Execute(Start)) != cDiseqc::daNone; Start = false) {
switch (da) {
-#ifdef NEWSTRUCT
case cDiseqc::daNone: break;
case cDiseqc::daToneOff: CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); break;
case cDiseqc::daToneOn: CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)); break;
@@ -534,49 +469,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
}
}
break;
-#else
- // This may not work very good with the old driver.
- // Let's try to emulate the NEWSTRUCT driver's behaviour as good as possible...
- case cDiseqc::daNone: break;
- case cDiseqc::daToneOff: CHECK(ioctl(fd_sec, SEC_SET_TONE, SecTone = SEC_TONE_OFF)); break;
- case cDiseqc::daToneOn: CHECK(ioctl(fd_sec, SEC_SET_TONE, SecTone = SEC_TONE_ON)); break;
- case cDiseqc::daVoltage13: CHECK(ioctl(fd_sec, SEC_SET_VOLTAGE, SecVolt = SEC_VOLTAGE_13)); break;
- case cDiseqc::daVoltage18: CHECK(ioctl(fd_sec, SEC_SET_VOLTAGE, SecVolt = SEC_VOLTAGE_18)); break;
- case cDiseqc::daMiniA:
- case cDiseqc::daMiniB: {
- secCmdSequence scmds;
- memset(&scmds, 0, sizeof(scmds));
- scmds.voltage = SecVolt;
- scmds.miniCommand = (da == cDiseqc::daMiniA) ? SEC_MINI_A : SEC_MINI_B;
- scmds.continuousTone = SecTone;
- CHECK(ioctl(fd_sec, SEC_SEND_SEQUENCE, &scmds));
- }
- break;
- case cDiseqc::daCodes: {
- int n = 0;
- uchar *codes = diseqc->Codes(n);
- if (codes && n >= 3 && codes[0] == 0xE0) {
- secCommand scmd;
- memset(&scmd, 0, sizeof(scmd));
- scmd.type = SEC_CMDTYPE_DISEQC;
- scmd.u.diseqc.addr = codes[1];
- scmd.u.diseqc.cmd = codes[2];
- scmd.u.diseqc.numParams = n - 3;
- memcpy(scmd.u.diseqc.params, &codes[3], min(n - 3, int(sizeof(scmd.u.diseqc.params))));
-
- secCmdSequence scmds;
- memset(&scmds, 0, sizeof(scmds));
- scmds.voltage = SecVolt;
- scmds.miniCommand = SEC_MINI_NONE;
- scmds.continuousTone = SecTone;
- scmds.numCommands = 1;
- scmds.commands = &scmd;
-
- CHECK(ioctl(fd_sec, SEC_SEND_SEQUENCE, &scmds));
- }
- }
- break;
-#endif
}
}
diseqcCommands = diseqc->Commands();
@@ -600,56 +492,31 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
tone = SEC_TONE_ON;
}
int volt = (Channel->Polarization() == 'v' || Channel->Polarization() == 'V') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
-#ifdef NEWSTRUCT
CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, volt));
CHECK(ioctl(fd_frontend, FE_SET_TONE, tone));
-#else
- secCmdSequence scmds;
- memset(&scmds, 0, sizeof(scmds));
- scmds.voltage = volt;
- scmds.miniCommand = SEC_MINI_NONE;
- scmds.continuousTone = tone;
- CHECK(ioctl(fd_sec, SEC_SEND_SEQUENCE, &scmds));
-#endif
}
-#ifdef NEWSTRUCT
Frontend.frequency = frequency * 1000UL;
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.qpsk.symbol_rate = Channel->Srate() * 1000UL;
Frontend.u.qpsk.fec_inner = fe_code_rate_t(Channel->CoderateH());
-#else
- Frontend.Frequency = frequency * 1000UL;
- Frontend.Inversion = SpectralInversion(Channel->Inversion());
- Frontend.u.qpsk.SymbolRate = Channel->Srate() * 1000UL;
- Frontend.u.qpsk.FEC_inner = CodeRate(Channel->CoderateH());
-#endif
}
break;
case FE_QAM: { // DVB-C
// Frequency and symbol rate:
-#ifdef NEWSTRUCT
Frontend.frequency = FrequencyToHz(Channel->Frequency());
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.qam.symbol_rate = Channel->Srate() * 1000UL;
Frontend.u.qam.fec_inner = fe_code_rate_t(Channel->CoderateH());
Frontend.u.qam.modulation = fe_modulation_t(Channel->Modulation());
-#else
- Frontend.Frequency = FrequencyToHz(Channel->Frequency());
- Frontend.Inversion = SpectralInversion(Channel->Inversion());
- Frontend.u.qam.SymbolRate = Channel->Srate() * 1000UL;
- Frontend.u.qam.FEC_inner = CodeRate(Channel->CoderateH());
- Frontend.u.qam.QAM = Modulation(Channel->Modulation());
-#endif
}
break;
case FE_OFDM: { // DVB-T
// Frequency and OFDM paramaters:
-#ifdef NEWSTRUCT
Frontend.frequency = FrequencyToHz(Channel->Frequency());
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.ofdm.bandwidth = fe_bandwidth_t(Channel->Bandwidth());
@@ -659,17 +526,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
Frontend.u.ofdm.transmission_mode = fe_transmit_mode_t(Channel->Transmission());
Frontend.u.ofdm.guard_interval = fe_guard_interval_t(Channel->Guard());
Frontend.u.ofdm.hierarchy_information = fe_hierarchy_t(Channel->Hierarchy());
-#else
- Frontend.Frequency = FrequencyToHz(Channel->Frequency());
- Frontend.Inversion = SpectralInversion(Channel->Inversion());
- Frontend.u.ofdm.bandWidth = BandWidth(Channel->Bandwidth());
- Frontend.u.ofdm.HP_CodeRate = CodeRate(Channel->CoderateH());
- Frontend.u.ofdm.LP_CodeRate = CodeRate(Channel->CoderateL());
- Frontend.u.ofdm.Constellation = Modulation(Channel->Modulation());
- Frontend.u.ofdm.TransmissionMode = TransmitMode(Channel->Transmission());
- Frontend.u.ofdm.guardInterval = GuardInterval(Channel->Guard());
- Frontend.u.ofdm.HierarchyInformation = Hierarchy(Channel->Hierarchy());
-#endif
}
break;
default:
@@ -677,7 +533,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
return false;
}
-#ifdef NEWSTRUCT
// Discard stale events:
for (;;) {
@@ -685,7 +540,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (ioctl(fd_frontend, FE_GET_EVENT, &event) < 0)
break;
}
-#endif
// Tuning:
@@ -693,7 +547,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// Wait for channel lock:
-#ifdef NEWSTRUCT
fe_status_t status = fe_status_t(0);
for (int i = 0; i < 100; i++) {
CHECK(ioctl(fd_frontend, FE_READ_STATUS, &status));
@@ -707,23 +560,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
cThread::RaisePanic();
return false;
}
-#else
- if (cFile::FileReady(fd_frontend, 5000)) {
- FrontendEvent event;
- if (ioctl(fd_frontend, FE_GET_EVENT, &event) >= 0) {
- if (event.type != FE_COMPLETION_EV) {
- esyslog("ERROR: channel %d not sync'ed on DVB card %d!", Channel->Number(), CardIndex() + 1);
- if (LiveView && IsPrimaryDevice())
- cThread::RaisePanic();
- return false;
- }
- }
- else
- esyslog("ERROR in frontend get event (channel %d, card %d): %m", Channel->Number(), CardIndex() + 1);
- }
- else
- esyslog("ERROR: timeout while tuning on DVB card %d", CardIndex() + 1);
-#endif
source = Channel->Source();
frequency = Channel->Frequency();
@@ -757,11 +593,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
void cDvbDevice::SetVolumeDevice(int Volume)
{
if (HasDecoder()) {
-#ifdef NEWSTRUCT
audio_mixer_t am;
-#else
- audioMixer_t am;
-#endif
am.volume_left = am.volume_right = Volume;
CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am));
}
@@ -779,21 +611,19 @@ int cDvbDevice::NumAudioTracksDevice(void) const
const char **cDvbDevice::GetAudioTracksDevice(int *CurrentTrack) const
{
- if (Ca())
- return NULL; // a Ca recording session blocks switching live audio tracks
- if (NumAudioTracks()) {
+ if (NumAudioTracksDevice()) {
if (CurrentTrack)
*CurrentTrack = (pidHandles[ptAudio].pid == aPid1) ? 0 : 1;
static const char *audioTracks1[] = { "Audio 1", NULL };
static const char *audioTracks2[] = { "Audio 1", "Audio 2", NULL };
- return NumAudioTracks() > 1 ? audioTracks2 : audioTracks1;
+ return NumAudioTracksDevice() > 1 ? audioTracks2 : audioTracks1;
}
return NULL;
}
void cDvbDevice::SetAudioTrackDevice(int Index)
{
- if (0 <= Index && Index < NumAudioTracks()) {
+ if (0 <= Index && Index < NumAudioTracksDevice()) {
int vpid = pidHandles[ptVideo].pid; // need to turn video PID off/on to restart demux
DelPid(vpid);
DelPid(pidHandles[ptAudio].pid);
@@ -957,10 +787,10 @@ int cDvbDevice::PlayVideo(const uchar *Data, int Length)
return -1;
}
-int cDvbDevice::PlayAudio(const uchar *Data, int Length)
+void cDvbDevice::PlayAudio(const uchar *Data, int Length)
{
- //XXX+
- return -1;
+ //XXX actually this function will only be needed to implement replaying AC3 over the DVB card's S/PDIF
+ cDevice::PlayAudio(Data, Length);
}
bool cDvbDevice::OpenDvr(void)
@@ -991,11 +821,7 @@ bool cDvbDevice::GetTSPacket(uchar *&Data)
return true;
}
else if (FATALERRNO) {
-#ifdef NEWSTRUCT
if (errno == EOVERFLOW)
-#else
- if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
-#endif
esyslog("ERROR: DVB driver buffer overflow on device %d", CardIndex() + 1);
else {
LOG_ERROR;
diff --git a/dvbdevice.h b/dvbdevice.h
index 8784c74..709790c 100644
--- a/dvbdevice.h
+++ b/dvbdevice.h
@@ -4,21 +4,22 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.h 1.15 2002/10/26 11:35:04 kls Exp $
+ * $Id: dvbdevice.h 1.18 2002/11/03 12:31:15 kls Exp $
*/
#ifndef __DVBDEVICE_H
#define __DVBDEVICE_H
-#ifdef NEWSTRUCT
#include <linux/dvb/frontend.h>
-#else
-#include <ost/frontend.h>
-#endif
+#include <linux/dvb/version.h>
#include "device.h"
#include "dvbspu.h"
#include "eit.h"
+#if DVB_API_VERSION != 3
+#error VDR requires Linux DVB driver API version 3!
+#endif
+
#define MAXDVBDEVICES 4
class cDvbDevice : public cDevice {
@@ -31,13 +32,8 @@ public:
// Initializes the DVB devices.
// Must be called before accessing any DVB functions.
private:
-#ifdef NEWSTRUCT
fe_type_t frontendType;
int fd_osd, fd_frontend, fd_audio, fd_video, fd_dvr;
-#else
- FrontendType frontendType;
- int fd_osd, fd_frontend, fd_sec, fd_audio, fd_video, fd_dvr;
-#endif
int OsdDeviceHandle(void) const { return fd_osd; }
protected:
virtual void MakePrimaryDevice(bool On);
@@ -112,7 +108,7 @@ public:
virtual void StillPicture(const uchar *Data, int Length);
virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
virtual int PlayVideo(const uchar *Data, int Length);
- virtual int PlayAudio(const uchar *Data, int Length);
+ virtual void PlayAudio(const uchar *Data, int Length);
// Receiver facilities
diff --git a/dvbosd.h b/dvbosd.h
index e35aab6..cbc7901 100644
--- a/dvbosd.h
+++ b/dvbosd.h
@@ -4,17 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbosd.h 1.15 2002/08/09 16:16:48 kls Exp $
+ * $Id: dvbosd.h 1.16 2002/11/01 10:05:47 kls Exp $
*/
#ifndef __DVBOSD_H
#define __DVBOSD_H
-#ifdef NEWSTRUCT
#include <linux/dvb/osd.h>
-#else
-#include <ost/osd.h>
-#endif
#include "dvbdevice.h"
#include "osdbase.h"
diff --git a/dvbplayer.c b/dvbplayer.c
index 0bc75c0..2d9cc1c 100644
--- a/dvbplayer.c
+++ b/dvbplayer.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbplayer.c 1.15 2002/10/13 16:08:40 kls Exp $
+ * $Id: dvbplayer.c 1.16 2002/11/03 11:23:47 kls Exp $
*/
#include "dvbplayer.h"
@@ -219,7 +219,7 @@ void cDvbPlayer::StripAudioPackets(uchar *b, int Length, uchar Except)
switch (c) {
case 0xBD: // dolby
if (Except)
- ;//XXX+ PlayExternalDolby(&b[i], Length - i);
+ PlayAudio(&b[i], l);
// continue with deleting the data - otherwise it disturbs DVB replay
case 0xC0 ... 0xC1: // audio
if (c == 0xC1)
diff --git a/eit.c b/eit.c
index 40ae874..12045d6 100644
--- a/eit.c
+++ b/eit.c
@@ -16,18 +16,14 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: eit.c 1.57 2002/10/13 09:29:05 kls Exp $
+ * $Id: eit.c 1.59 2002/11/02 12:46:53 kls Exp $
***************************************************************************/
#include "eit.h"
#include <ctype.h>
#include <fcntl.h>
#include <limits.h>
-#ifdef NEWSTRUCT
#include <linux/dvb/dmx.h>
-#else
-#include <ost/dmx.h>
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -757,7 +753,7 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules)
if (*s == 'C') {
unsigned int uServiceID;
if (1 == sscanf(s + 1, "%u", &uServiceID)) {
- cSchedule *p = (cSchedule *)Schedules->SetCurrentServiceID(uServiceID);
+ cSchedule *p = (cSchedule *)Schedules->AddServiceID(uServiceID);
if (p) {
if (!cEventInfo::Read(f, p))
return false;
@@ -786,20 +782,22 @@ cSchedules::~cSchedules()
{
}
/** */
+const cSchedule *cSchedules::AddServiceID(unsigned short servid)
+{
+ const cSchedule *p = GetSchedule(servid);
+ if (!p) {
+ Add(new cSchedule(servid));
+ p = GetSchedule(servid);
+ }
+ return p;
+}
+/** */
const cSchedule *cSchedules::SetCurrentServiceID(unsigned short servid)
{
- pCurrentSchedule = GetSchedule(servid);
- if (pCurrentSchedule == NULL)
- {
- Add(new cSchedule(servid));
- pCurrentSchedule = GetSchedule(servid);
- if (pCurrentSchedule == NULL)
- return NULL;
- }
-
- uCurrentServiceID = servid;
-
- return pCurrentSchedule;
+ pCurrentSchedule = AddServiceID(servid);
+ if (pCurrentSchedule)
+ uCurrentServiceID = servid;
+ return pCurrentSchedule;
}
/** */
const cSchedule * cSchedules::GetSchedule() const
@@ -1196,11 +1194,7 @@ void cSIProcessor::Action()
table identifer tid */
bool cSIProcessor::AddFilter(u_char pid, u_char tid)
{
-#ifdef NEWSTRUCT
dmx_sct_filter_params sctFilterParams;
-#else
- dmxSctFilterParams sctFilterParams;
-#endif
memset(&sctFilterParams, 0, sizeof(sctFilterParams));
sctFilterParams.pid = pid;
sctFilterParams.timeout = 0;
diff --git a/eit.h b/eit.h
index 6ebd48f..5374003 100644
--- a/eit.h
+++ b/eit.h
@@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: eit.h 1.19 2002/10/13 09:28:06 kls Exp $
+ * $Id: eit.h 1.20 2002/11/02 12:36:36 kls Exp $
***************************************************************************/
#ifndef __EIT_H
@@ -112,6 +112,7 @@ private:
const cSchedule *pCurrentSchedule;
unsigned short uCurrentServiceID;
protected:
+ const cSchedule *AddServiceID(unsigned short servid);
const cSchedule *SetCurrentServiceID(unsigned short servid);
void Cleanup();
public:
diff --git a/eitscan.c b/eitscan.c
index 2a89cec..fdcd8c3 100644
--- a/eitscan.c
+++ b/eitscan.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: eitscan.c 1.9 2002/10/19 11:48:02 kls Exp $
+ * $Id: eitscan.c 1.10 2002/11/01 11:04:49 kls Exp $
*/
#include "eitscan.h"
@@ -55,7 +55,7 @@ void cEITScanner::Process(void)
cDevice *Device = cDevice::GetDevice(i);
if (Device && Device->CardIndex() < MAXDVBDEVICES) {
if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) {
- if (!(Device->Receiving() || Device->Replaying())) {
+ if (!(Device->Receiving(true) || Device->Replaying())) {
int oldCh = lastChannel;
int ch = oldCh + 1;
while (ch != oldCh) {
diff --git a/interface.c b/interface.c
index a9f0d9a..804747a 100644
--- a/interface.c
+++ b/interface.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: interface.c 1.59 2002/10/27 15:54:05 kls Exp $
+ * $Id: interface.c 1.60 2002/11/01 10:50:38 kls Exp $
*/
#include "interface.h"
@@ -418,9 +418,9 @@ void cInterface::LearnKeys(void)
Clear();
cRemote::Clear();
WriteText(1, 1, Headline);
- cRemote::SetLearning(true);
+ cRemote::SetLearning(Remote);
QueryKeys(Remote);
- cRemote::SetLearning(false);
+ cRemote::SetLearning(NULL);
Clear();
WriteText(1, 1, Headline);
WriteText(1, 3, tr("Phase 3: Saving key codes"));
diff --git a/menu.c b/menu.c
index 0bd24be..47ad091 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.221 2002/10/27 14:06:02 kls Exp $
+ * $Id: menu.c 1.222 2002/11/01 12:15:45 kls Exp $
*/
#include "menu.h"
@@ -2378,10 +2378,10 @@ void cDisplayChannel::DisplayChannel(const cChannel *Channel)
char buffer[BufSize];
*buffer = 0;
if (Channel) {
- if (Channel->Number() > 0)
- snprintf(buffer, BufSize, "%d%s %s", Channel->Number(), number ? "-" : "", Channel->Name());
- else if (Channel->Name())
+ if (Channel->GroupSep())
snprintf(buffer, BufSize, "%s", Channel->Name());
+ else
+ snprintf(buffer, BufSize, "%d%s %s", Channel->Number(), number ? "-" : "", Channel->Name());
}
else if (number)
snprintf(buffer, BufSize, "%d-", number);
diff --git a/newplugin b/newplugin
index 3a4586c..a5004dc 100755
--- a/newplugin
+++ b/newplugin
@@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
-# $Id: newplugin 1.9 2002/10/26 14:32:12 kls Exp $
+# $Id: newplugin 1.11 2002/11/01 13:43:50 kls Exp $
$PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin <name>\n";
@@ -68,19 +68,22 @@ PLUGIN = $PLUGIN_NAME
VERSION = \$(shell grep 'static const char \\*VERSION *=' \$(PLUGIN).c | awk '{ print \$\$6 }' | sed -e 's/[";]//g')
+### The C++ compiler and options:
+
+CXX = g++
+CXXFLAGS = -O2 -Wall -Woverloaded-virtual
+
### The directory environment:
-ifdef NEWSTRUCT
-DVBDIR = ../../../../DVB/include
-DEFINES += -DNEWSTRUCT
-else
-DVBDIR = ../../../../DVB/ost/include
-endif
+DVBDIR = ../../../../DVB
VDRDIR = ../../..
-VDRINC = \$(VDRDIR)/include
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"):
VDRVERSION = \$(shell grep 'define VDRVERSION ' \$(VDRDIR)/config.h | awk '{ print \$\$3 }' | sed -e 's/"//g')
@@ -92,7 +95,7 @@ PACKAGE = vdr-\$(ARCHIVE)
### Includes and Defines (add further entries here):
-INCLUDES = -I\$(VDRINC) -I\$(DVBDIR)
+INCLUDES += -I\$(VDRDIR)/include -I\$(DVBDIR)/include
DEFINES += -DPLUGIN_NAME_I18N='"\$(PLUGIN)"'
@@ -100,11 +103,6 @@ DEFINES += -DPLUGIN_NAME_I18N='"\$(PLUGIN)"'
OBJS = \$(PLUGIN).o
-### The C++ compiler and options:
-
-CXX = g++
-CXXFLAGS = -O2 -Wall -Woverloaded-virtual
-
### Implicit rules:
%.o: %.c
diff --git a/player.c b/player.c
index 3eecc2d..a88c501 100644
--- a/player.c
+++ b/player.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: player.c 1.5 2002/08/15 10:29:17 kls Exp $
+ * $Id: player.c 1.6 2002/11/02 14:55:37 kls Exp $
*/
#include "player.h"
@@ -31,12 +31,13 @@ int cPlayer::PlayVideo(const uchar *Data, int Length)
return -1;
}
-int cPlayer::PlayAudio(const uchar *Data, int Length)
+void cPlayer::PlayAudio(const uchar *Data, int Length)
{
- if (device)
- return device->PlayAudio(Data, Length);
+ if (device) {
+ device->PlayAudio(Data, Length);
+ return;
+ }
esyslog("ERROR: attempt to use cPlayer::PlayAudio() without attaching to a cDevice!");
- return -1;
}
void cPlayer::Detach(void)
diff --git a/player.h b/player.h
index 1e1fabf..faeab1a 100644
--- a/player.h
+++ b/player.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: player.h 1.9 2002/10/12 11:17:02 kls Exp $
+ * $Id: player.h 1.10 2002/11/03 11:27:30 kls Exp $
*/
#ifndef __PLAYER_H
@@ -35,8 +35,8 @@ protected:
// Sends the given Data to the video device and returns the number of
// bytes that have actually been accepted by the video device (or a
// negative value in case of an error).
- int PlayAudio(const uchar *Data, int Length);
- // XXX+ TODO
+ void PlayAudio(const uchar *Data, int Length);
+ // Plays additional audio streams, like Dolby Digital.
public:
cPlayer(ePlayMode PlayMode = pmAudioVideo);
virtual ~cPlayer();
diff --git a/remote.c b/remote.c
index 6078c26..415e37e 100644
--- a/remote.c
+++ b/remote.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.c 1.30 2002/10/27 15:15:58 kls Exp $
+ * $Id: remote.c 1.31 2002/11/01 10:50:13 kls Exp $
*/
#include "remote.h"
@@ -27,7 +27,7 @@
eKeys cRemote::keys[MaxKeys];
int cRemote::in = 0;
int cRemote::out = 0;
-bool cRemote::learning = false;
+cRemote *cRemote::learning = NULL;
char *cRemote::unknownCode = NULL;
cMutex cRemote::mutex;
cCondVar cRemote::keyPressed;
@@ -109,6 +109,8 @@ bool cRemote::Put(uint64 Code, bool Repeat, bool Release)
bool cRemote::Put(const char *Code, bool Repeat, bool Release)
{
+ if (learning && this != learning)
+ return false;
eKeys Key = Keys.Get(Name(), Code);
if (Key != kNone) {
if (Repeat)
diff --git a/remote.h b/remote.h
index 2bb9ea5..35cf62e 100644
--- a/remote.h
+++ b/remote.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.h 1.18 2002/10/27 15:16:50 kls Exp $
+ * $Id: remote.h 1.19 2002/11/01 10:48:11 kls Exp $
*/
#ifndef __REMOTE_H
@@ -24,7 +24,7 @@ private:
static eKeys keys[MaxKeys];
static int in;
static int out;
- static bool learning;
+ static cRemote *learning;
static char *unknownCode;
static cMutex mutex;
static cCondVar keyPressed;
@@ -39,7 +39,7 @@ public:
virtual ~cRemote();
virtual bool Initialize(void) { return true; }
const char *Name(void) { return name; }
- static void SetLearning(bool On) { learning = On; }
+ static void SetLearning(cRemote *Learning) { learning = Learning; }
static void Clear(void);
static bool Put(eKeys Key);
static bool PutMacro(eKeys Key);
diff --git a/remux.h b/remux.h
index 8312618..638a3f9 100644
--- a/remux.h
+++ b/remux.h
@@ -4,18 +4,14 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remux.h 1.8 2002/10/12 13:30:24 kls Exp $
+ * $Id: remux.h 1.9 2002/11/01 10:06:46 kls Exp $
*/
#ifndef __REMUX_H
#define __REMUX_H
#include <time.h> //XXX FIXME: DVB/linux/dvb/dmx.h should include <time.h> itself!!!
-#ifdef NEWSTRUCT
#include <linux/dvb/dmx.h>
-#else
-#include <ost/dmx.h>
-#endif
#include "tools.h"
// Picture types:
diff --git a/thread.c b/thread.c
index 0f42e56..e52771d 100644
--- a/thread.c
+++ b/thread.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: thread.c 1.22 2002/08/15 11:44:48 kls Exp $
+ * $Id: thread.c 1.23 2002/11/03 11:00:03 kls Exp $
*/
#include "thread.h"
@@ -331,11 +331,9 @@ bool cPipe::Open(const char *Command, const char *Mode)
_exit(-1);
}
else {
- for (int i = 0; i <= fd[1]; i++) {
- if (i == STDIN_FILENO || i == STDOUT_FILENO || i == STDERR_FILENO)
- continue;
- close(i); // close all dup'ed filedescriptors
- }
+ int MaxPossibleFileDescriptors = getdtablesize();
+ for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
+ close(i); //close all dup'ed filedescriptors
if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1) {
LOG_ERROR_STR(Command);
close(fd[1 - iopipe]);
diff --git a/transfer.c b/transfer.c
index ddfb28c..6d3ed78 100644
--- a/transfer.c
+++ b/transfer.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: transfer.c 1.6 2002/10/26 10:17:17 kls Exp $
+ * $Id: transfer.c 1.7 2002/11/03 11:24:02 kls Exp $
*/
#include "transfer.h"
@@ -123,7 +123,7 @@ void cTransfer::StripAudioPackets(uchar *b, int Length, uchar Except)
switch (c) {
case 0xBD: // dolby
if (Except)
- ;//XXX+ PlayExternalDolby(&b[i], Length - i);
+ PlayAudio(&b[i], l);
// continue with deleting the data - otherwise it disturbs DVB replay
case 0xC0 ... 0xC1: // audio
if (c == 0xC1)
diff --git a/vdr.c b/vdr.c
index 41d2047..1285ae7 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.130 2002/10/27 15:20:56 kls Exp $
+ * $Id: vdr.c 1.132 2002/11/03 13:54:39 kls Exp $
*/
#include <getopt.h>
@@ -30,6 +30,7 @@
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
+#include "audio.h"
#include "channels.h"
#include "config.h"
#include "cutter.h"
@@ -87,6 +88,7 @@ int main(int argc, char *argv[])
#define DEFAULTPLUGINDIR "./PLUGINS/lib"
int SVDRPport = DEFAULTSVDRPPORT;
+ const char *AudioCommand = NULL;
const char *ConfigDirectory = NULL;
bool DisplayHelp = false;
bool DisplayVersion = false;
@@ -121,10 +123,8 @@ int main(int argc, char *argv[])
int c;
while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:L:mp:P:r:s:t:v:Vw:", long_options, NULL)) != -1) {
switch (c) {
- /*XXX+
- case 'a': cDevice::SetAudioCommand(optarg);
+ case 'a': AudioCommand = optarg;
break;
- XXX*/
case 'c': ConfigDirectory = optarg;
break;
case 'd': DaemonMode = true; break;
@@ -365,6 +365,11 @@ int main(int argc, char *argv[])
#endif
Interface->LearnKeys();
+ // External audio:
+
+ if (AudioCommand)
+ new cExternalAudio(AudioCommand);
+
// Channel:
Channels.SwitchTo(Setup.CurrentChannel);
@@ -519,7 +524,7 @@ int main(int argc, char *argv[])
case osRecord: DELETENULL(Menu);
Temp = NULL;
if (cRecordControls::Start())
- Interface->Info(tr("Recording"));
+ ;//XXX Interface->Info(tr("Recording"));
else
Interface->Error(tr("No free DVB device to record!"));
break;
@@ -589,7 +594,7 @@ int main(int argc, char *argv[])
// Instant recording:
case kRecord:
if (cRecordControls::Start())
- Interface->Info(tr("Recording"));
+ ;//XXX Interface->Info(tr("Recording"));
else
Interface->Error(tr("No free DVB device to record!"));
break;
@@ -676,6 +681,7 @@ int main(int argc, char *argv[])
delete Interface;
cOsd::Shutdown();
Remotes.Clear();
+ Audios.Clear();
Setup.CurrentChannel = cDevice::CurrentChannel();
Setup.CurrentVolume = cDevice::CurrentVolume();
Setup.Save();