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.
This commit is contained in:
Klaus Schmidinger 2002-11-03 18:00:00 +01:00
parent 57bd7eeed1
commit 1a8a081629
38 changed files with 481 additions and 431 deletions

View File

@ -47,6 +47,7 @@ Martin Hammerschmid <martin@hammerschmid.com>
for detecting a deadlock when switching channels via Schedule/Now|Next/Switch for detecting a deadlock when switching channels via Schedule/Now|Next/Switch
for adding a missing #include to ringbuffer.c for adding a missing #include to ringbuffer.c
for adding a missing 'public' keyword in device.h 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> Bastian Guse <bastian@nocopy.de>
for writing the FORMATS entry for timers.conf 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 reporting a problem with plugin Makefiles and the NEWSTRUCT driver
for pointing out some unnecessary #includes in eit.c and a problem with for pointing out some unnecessary #includes in eit.c and a problem with
cMenuRecordings::Del(), which caused warnings with gcc-3.2 cMenuRecordings::Del(), which caused warnings with gcc-3.2
for suggesting a Make.config file
Aaron Holtzman Aaron Holtzman
for writing 'ac3dec' for writing 'ac3dec'
@ -426,6 +428,10 @@ Oliver Endriss <o.endriss@gmx.de>
one remote control one remote control
for reporting a crash when learning the keys of several remote controls and for reporting a crash when learning the keys of several remote controls and
pressing buttons of those that have already been learned 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> Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf' for adding some satellites to 'sources.conf'

51
HISTORY
View File

@ -1670,3 +1670,54 @@ Video Disk Recorder Revision History
- Fixed a crash when learning the keys of several remote controls and pressing - 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 buttons of those that have already been learned (thanks to Oliver Endriss for
reporting this one). 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.

17
INSTALL
View File

@ -13,9 +13,9 @@ extracted into the directory /home/kls/vdr/DVB, then this
package should be extracted into /home/kls/vdr/VDR. package should be extracted into /home/kls/vdr/VDR.
If you have the DVB driver source in a different location If you have the DVB driver source in a different location
you will have to change the definition of DVBDIR in the 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. to work properly.
After extracting the package, change into the VDR directory 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 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" 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 parameter to "on". You also need to set up the file 'diseqc.conf' to properly
and set them to the necessary values. access your DiSEqC equipment (see man vdr(5) for details).
Running VDR with DVB-C (cable) or DVB-T (terrestrial): 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', archive contains a default 'channels.conf.cable' and 'channels.conf.terr',
respectively, which users of such cards can rename or copy to 'channels.conf' 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 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 files is mostly the same as for satellite channels, however, some fields have
"Polarization" and "Diseqc" data are ignored in case of DVB-C and DVB-T, and different or extended meanings (see man vdr(5) for details).
the "Frequency" is in kHz in case of DVB-T).
You can even use a mixture of DVB-S, DVB-C and DVB-T cards in the same system. 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 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 'channels.conf' file. VDR will automatically know which channels can be
of the card that can receive it. received with which card(s) by evaluating the 'source' parameter.
Learning the remote control keys: Learning the remote control keys:
--------------------------------- ---------------------------------

25
Make.config.template Normal file
View File

@ -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

View File

@ -4,7 +4,7 @@
# See the main source file 'vdr.c' for copyright information and # See the main source file 'vdr.c' for copyright information and
# how to reach the author. # 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: .DELETE_ON_ERROR:
@ -23,12 +23,9 @@ PLUGINDIR= ./PLUGINS
VIDEODIR = /video VIDEODIR = /video
ifdef NEWSTRUCT -include Make.config
INCLUDES = -I$(DVBDIR)/include INCLUDES = -I$(DVBDIR)/include
DEFINES += -DNEWSTRUCT
else
INCLUDES = -I$(DVBDIR)/ost/include
endif
DTVLIB = $(DTVDIR)/libdtv.a DTVLIB = $(DTVDIR)/libdtv.a

View File

@ -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 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. structures and allows it to hook itself into specific areas to perform special actions.
<p> <p>
<!--X1.1.11--><table width=100%><tr><td bgcolor=#0000AA>&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.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%>
Important modifications introduced in version 1.1.12 are marked like this. Important modifications introduced in version 1.1.12 are marked like this.
<!--X1.1.12--></td></tr></table> <!--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. Important modifications introduced in version 1.1.13 are marked like this.
<!--X1.1.13--></td></tr></table> <!--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. Important modifications introduced in version 1.1.14 are marked like this.
<!--X1.1.14--></td></tr></table> <!--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> <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> </pre></td></tr></table><p>
to determine whether the device is ready for further data. 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> <p>
If the player can provide more than a single audio track, it can implement the If the player can provide more than a single audio track, it can implement the
following functions to make them available: following functions to make them available:
@ -977,7 +977,16 @@ virtual void SetAudioTrack(int Index);
<!--X1.1.13--></td></tr></table> <!--X1.1.13--></td></tr></table>
<p> <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> <p>
The second part needed here is a control object that receives user input from the main 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: 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: selecting which channel it shall tune to:
<p><table><tr><td bgcolor=#F0F0F0><pre><br> <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; virtual bool ProvidesSource(int Source) const;
<!--X1.1.12--></td></tr></table> <!--X1.1.12--></td></tr></table>
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL); 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 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, this device can provide the requested source or channel and whether tuning to it was successful,
repectively. 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> <p>
<b>Audio selection</b> <b>Audio selection</b>
<p> <p>
@ -1253,7 +1262,7 @@ The functions to implement replaying capabilites are
<p><table><tr><td bgcolor=#F0F0F0><pre><br> <p><table><tr><td bgcolor=#F0F0F0><pre><br>
virtual bool HasDecoder(void) const; 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; virtual bool CanReplay(void) const;
<!--X1.1.14--></td></tr></table> <!--X1.1.14--></td></tr></table>
virtual bool SetPlayMode(ePlayMode PlayMode); 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> important that the devices are created on the heap, using the <tt>new</tt>
operator! 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> <hr><h2>Remote Control</h2>
<center><i><b>The joy of zapping!</b></i></center><p> <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> </pre></td></tr></table><p>
The other parameters have the same meaning as in the first version of this function. The other parameters have the same meaning as in the first version of this function.
<!--X1.1.11--></td></tr></table>
</body> </body>
</html> </html>

View File

@ -30,3 +30,10 @@ VDR Plugin 'hello' Revision History
2002-10-26: Version 0.0.7 2002-10-26: Version 0.0.7
- Fixed a typo. - 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.

View File

@ -1,7 +1,7 @@
# #
# Makefile for a Video Disk Recorder plugin # 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. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
@ -13,19 +13,22 @@ PLUGIN = hello
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') 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: ### The directory environment:
ifdef NEWSTRUCT DVBDIR = ../../../../DVB
DVBDIR = ../../../../DVB/include
DEFINES += -DNEWSTRUCT
else
DVBDIR = ../../../../DVB/ost/include
endif
VDRDIR = ../../.. VDRDIR = ../../..
VDRINC = $(VDRDIR)/include
LIBDIR = ../../lib LIBDIR = ../../lib
TMPDIR = /tmp TMPDIR = /tmp
### Allow user defined options to overwrite defaults:
-include $(VDRDIR)/Make.config
### The version number of VDR (taken from VDR's "config.h"): ### 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') 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 and Defines (add further entries here):
INCLUDES = -I$(VDRINC) -I$(DVBDIR) INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
@ -45,11 +48,6 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
OBJS = $(PLUGIN).o i18n.o OBJS = $(PLUGIN).o i18n.o
### The C++ compiler and options:
CXX = g++
CXXFLAGS = -O2 -Wall -Woverloaded-virtual
### Implicit rules: ### Implicit rules:
%.o: %.c %.o: %.c

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: 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> #include <getopt.h>
@ -12,7 +12,7 @@
#include <vdr/plugin.h> #include <vdr/plugin.h>
#include "i18n.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 *DESCRIPTION = "A friendly greeting";
static const char *MAINMENUENTRY = "Hello"; static const char *MAINMENUENTRY = "Hello";

View File

@ -16,3 +16,10 @@ VDR Plugin 'status' Revision History
2002-10-26: Version 0.0.4 2002-10-26: Version 0.0.4
- Fixed a typo. - 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.

View File

@ -1,7 +1,7 @@
# #
# Makefile for a Video Disk Recorder plugin # 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. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
@ -13,19 +13,22 @@ PLUGIN = status
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') 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: ### The directory environment:
ifdef NEWSTRUCT DVBDIR = ../../../../DVB
DVBDIR = ../../../../DVB/include
DEFINES += -DNEWSTRUCT
else
DVBDIR = ../../../../DVB/ost/include
endif
VDRDIR = ../../.. VDRDIR = ../../..
VDRINC = $(VDRDIR)/include
LIBDIR = ../../lib LIBDIR = ../../lib
TMPDIR = /tmp TMPDIR = /tmp
### Allow user defined options to overwrite defaults:
-include $(VDRDIR)/Make.config
### The version number of VDR (taken from VDR's "config.h"): ### 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') 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 and Defines (add further entries here):
INCLUDES = -I$(VDRINC) -I$(DVBDIR) INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
@ -45,11 +48,6 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
OBJS = $(PLUGIN).o OBJS = $(PLUGIN).o
### The C++ compiler and options:
CXX = g++
CXXFLAGS = -O2 -Wall -Woverloaded-virtual
### Implicit rules: ### Implicit rules:
%.o: %.c %.o: %.c

View File

@ -3,13 +3,13 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: 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/plugin.h>
#include <vdr/status.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 *DESCRIPTION = "Status monitor test";
static const char *MAINMENUENTRY = NULL; static const char *MAINMENUENTRY = NULL;

89
audio.c
View File

@ -4,8 +4,95 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 "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();
}

44
audio.h
View File

@ -4,10 +4,52 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __AUDIO_H
#define __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 #endif //__AUDIO_H

View File

@ -4,15 +4,11 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "channels.h"
#ifdef NEWSTRUCT
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
#else
#include <ost/frontend.h>
#endif
#include <ctype.h> #include <ctype.h>
// IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d' // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
@ -32,9 +28,7 @@ const tChannelParameterMap BandwidthValues[] = {
{ 6, BANDWIDTH_6_MHZ }, { 6, BANDWIDTH_6_MHZ },
{ 7, BANDWIDTH_7_MHZ }, { 7, BANDWIDTH_7_MHZ },
{ 8, BANDWIDTH_8_MHZ }, { 8, BANDWIDTH_8_MHZ },
#ifdef NEWSTRUCT
{ 999, BANDWIDTH_AUTO }, { 999, BANDWIDTH_AUTO },
#endif
{ -1 } { -1 }
}; };
@ -43,17 +37,11 @@ const tChannelParameterMap CoderateValues[] = {
{ 12, FEC_1_2 }, { 12, FEC_1_2 },
{ 23, FEC_2_3 }, { 23, FEC_2_3 },
{ 34, FEC_3_4 }, { 34, FEC_3_4 },
#ifdef NEWSTRUCT
{ 45, FEC_4_5 }, { 45, FEC_4_5 },
#endif
{ 56, FEC_5_6 }, { 56, FEC_5_6 },
#ifdef NEWSTRUCT
{ 67, FEC_6_7 }, { 67, FEC_6_7 },
#endif
{ 78, FEC_7_8 }, { 78, FEC_7_8 },
#ifdef NEWSTRUCT
{ 89, FEC_8_9 }, { 89, FEC_8_9 },
#endif
{ 999, FEC_AUTO }, { 999, FEC_AUTO },
{ -1 } { -1 }
}; };
@ -65,18 +53,14 @@ const tChannelParameterMap ModulationValues[] = {
{ 64, QAM_64 }, { 64, QAM_64 },
{ 128, QAM_128 }, { 128, QAM_128 },
{ 256, QAM_256 }, { 256, QAM_256 },
#ifdef NEWSTRUCT
{ 999, QAM_AUTO }, { 999, QAM_AUTO },
#endif
{ -1 } { -1 }
}; };
const tChannelParameterMap TransmissionValues[] = { const tChannelParameterMap TransmissionValues[] = {
{ 2, TRANSMISSION_MODE_2K }, { 2, TRANSMISSION_MODE_2K },
{ 8, TRANSMISSION_MODE_8K }, { 8, TRANSMISSION_MODE_8K },
#ifdef NEWSTRUCT
{ 999, TRANSMISSION_MODE_AUTO }, { 999, TRANSMISSION_MODE_AUTO },
#endif
{ -1 } { -1 }
}; };
@ -85,9 +69,7 @@ const tChannelParameterMap GuardValues[] = {
{ 8, GUARD_INTERVAL_1_8 }, { 8, GUARD_INTERVAL_1_8 },
{ 16, GUARD_INTERVAL_1_16 }, { 16, GUARD_INTERVAL_1_16 },
{ 32, GUARD_INTERVAL_1_32 }, { 32, GUARD_INTERVAL_1_32 },
#ifdef NEWSTRUCT
{ 999, GUARD_INTERVAL_AUTO }, { 999, GUARD_INTERVAL_AUTO },
#endif
{ -1 } { -1 }
}; };
@ -96,9 +78,7 @@ const tChannelParameterMap HierarchyValues[] = {
{ 1, HIERARCHY_1 }, { 1, HIERARCHY_1 },
{ 2, HIERARCHY_2 }, { 2, HIERARCHY_2 },
{ 4, HIERARCHY_4 }, { 4, HIERARCHY_4 },
#ifdef NEWSTRUCT
{ 999, HIERARCHY_AUTO }, { 999, HIERARCHY_AUTO },
#endif
{ -1 } { -1 }
}; };
@ -160,16 +140,15 @@ cChannel::cChannel(void)
sid = 0; sid = 0;
number = 0; number = 0;
groupSep = false; groupSep = false;
//XXX
polarization = 'v'; polarization = 'v';
inversion = INVERSION_AUTO; inversion = INVERSION_AUTO;
bandwidth = BANDWIDTH_8_MHZ; bandwidth = BANDWIDTH_AUTO;
coderateH = FEC_AUTO;//XXX FEC_2_3 coderateH = FEC_AUTO;
coderateL = FEC_1_2;//XXX coderateL = FEC_AUTO;
modulation = QAM_64; modulation = QAM_AUTO;
transmission = TRANSMISSION_MODE_2K; transmission = TRANSMISSION_MODE_AUTO;
guard = GUARD_INTERVAL_1_32; guard = GUARD_INTERVAL_AUTO;
hierarchy = HIERARCHY_NONE; hierarchy = HIERARCHY_AUTO;
} }
cChannel::cChannel(const cChannel *Channel) cChannel::cChannel(const cChannel *Channel)
@ -187,24 +166,20 @@ cChannel::cChannel(const cChannel *Channel)
ca = Channel ? Channel->ca : 0; ca = Channel ? Channel->ca : 0;
sid = Channel ? Channel->sid : 0; sid = Channel ? Channel->sid : 0;
groupSep = Channel ? Channel->groupSep : false; groupSep = Channel ? Channel->groupSep : false;
//XXX
polarization = Channel ? Channel->polarization : 'v'; polarization = Channel ? Channel->polarization : 'v';
inversion = Channel ? Channel->inversion : INVERSION_AUTO; inversion = Channel ? Channel->inversion : INVERSION_AUTO;
bandwidth = Channel ? Channel->bandwidth : BANDWIDTH_8_MHZ; bandwidth = Channel ? Channel->bandwidth : BANDWIDTH_AUTO;
coderateH = Channel ? Channel->coderateH : FEC_AUTO;//XXX FEC_2_3 coderateH = Channel ? Channel->coderateH : FEC_AUTO;
coderateL = Channel ? Channel->coderateL : FEC_1_2;//XXX coderateL = Channel ? Channel->coderateL : FEC_AUTO;
modulation = Channel ? Channel->modulation : QAM_64; modulation = Channel ? Channel->modulation : QAM_AUTO;
transmission = Channel ? Channel->transmission : TRANSMISSION_MODE_2K; transmission = Channel ? Channel->transmission : TRANSMISSION_MODE_AUTO;
guard = Channel ? Channel->guard : GUARD_INTERVAL_1_32; guard = Channel ? Channel->guard : GUARD_INTERVAL_AUTO;
hierarchy = Channel ? Channel->hierarchy : HIERARCHY_NONE; hierarchy = Channel ? Channel->hierarchy : HIERARCHY_AUTO;
} }
static int PrintParameter(char *p, char Name, int Value) static int PrintParameter(char *p, char Name, int Value)
{ {
//XXX return Value >= 0 && Value != 999 ? sprintf(p, "%c%d", Name, Value) : 0; 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;
} }
const char *cChannel::ParametersToString(void) const char *cChannel::ParametersToString(void)
@ -233,17 +208,8 @@ static const char *ParseParameter(const char *s, int &Value, const tChannelParam
errno = 0; errno = 0;
int n = strtol(s, &p, 10); int n = strtol(s, &p, 10);
if (!errno && p != s) { if (!errno && p != s) {
//XXX let's tolerate 999 for the moment, until we generally switch to the NEWSTRUCT Value = MapToDriver(n, Map);
//XXX driver (where the defaults will all be AUTO) if (Value >= 0)
//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)
return p; return p;
} }
} }

View File

@ -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 BBC Knowledge:505833:0:0:0:630:631:0:0:4607
Shop!:561833:0:0:0:6049:6050:0:0:13120 Shop!:561833:0:0:0:6049:6050:0:0:13120
: DVB-T Berlin Germany : DVB-T Berlin Germany
PRO 7:714000:I0C23D0M16B8T8G8Y0:T:27500:161:82:83:0:19 PRO 7:658000:I0C23D0M16B8T8G8Y0:T:27500:305:306;307:0:0:16403
SAT 1:714000:I0C23D0M16B8T8G8Y0:T:27500:160:80:81:0:18 SAT 1:658000:I0C23D0M16B8T8G8Y0:T:27500:385:386:0:0:16408
RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:160:80:0:0:1 RTL:658000:I0C23D0M16B8T8G8Y0:T:27500:337:338:0:0:16405
RTL 2:778000:I0C23D0M16B8T8G8Y0:T:27500:161:82:0:0:2 RTL 2:658000:I0C23D0M16B8T8G8Y0:T:27500:353:354:0:0:16406
Super RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:162:84:0:0:3 Super RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:433:434:0:0:16411
VOX:778000:I0C23D0M16B8T8G8Y0:T:27500:163:86:0:0:4 VOX:778000:I0C23D0M16B8T8G8Y0:T:27500:545:546:0:0:16418
KABEL 1:714000:I0C23D0M16B8T8G8Y0:T:27500:162:84:0:0:20 KABEL 1:778000:I0C23D0M16B8T8G8Y0:T:27500:161:162:0:0:16394
MTV:674000:I0C23D0M16B8T2G8Y0:T:27500:161:82:83:0:27 MTV:650000:I0C23D0M16B8T2G8Y0:T:27500:193:194:0:0:16396
VIVA/arte:674000:I0C23D0M16B8T2G8Y0:T:27500:163:86:87:0:29 N-TV:650000:I0C23D0M16B8T2G8Y0:T:27500:273:274:0:0:16401
N-TV:650000:I0C12D0M16B8T2G8Y0:T:27500:160:80:81:0:6 N24:778000:I0C23D0M16B8T8G8Y0:T:27500:225:226:0:0:16398
N24:714000:I0C23D0M16B8T8G8Y0:T:27500:163:86:0:0:21 FAB:650000:I0C23D0M16B8T2G8Y0:T:27500:3073:3074:0:0:16576
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

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "config.h"
@ -210,7 +210,6 @@ bool cSetupLine::operator< (const cListObject &ListObject)
bool cSetupLine::Parse(char *s) bool cSetupLine::Parse(char *s)
{ {
//dsyslog("cSetupLine::Parse '%s'", s);//XXX-
char *p = strchr(s, '='); char *p = strchr(s, '=');
if (p) { if (p) {
*p = 0; *p = 0;
@ -228,7 +227,6 @@ bool cSetupLine::Parse(char *s)
} }
name = strdup(Name); name = strdup(Name);
value = strdup(Value); value = strdup(Value);
//dsyslog("cSetupLine::Parse '%s' = '%s'", name, value);//XXX-
return true; return true;
} }
} }
@ -237,7 +235,6 @@ bool cSetupLine::Parse(char *s)
bool cSetupLine::Save(FILE *f) 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; return fprintf(f, "%s%s%s = %s\n", plugin ? plugin : "", plugin ? "." : "", name, value) > 0;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __CONFIG_H
@ -20,7 +20,7 @@
#include "eit.h" #include "eit.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.1.14" #define VDRVERSION "1.1.15"
#define MAXPRIORITY 99 #define MAXPRIORITY 99
#define MAXLIFETIME 99 #define MAXLIFETIME 99

View File

@ -4,13 +4,14 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 "device.h"
#include <errno.h> #include <errno.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "audio.h"
#include "channels.h" #include "channels.h"
#include "eit.h" #include "eit.h"
#include "i18n.h" #include "i18n.h"
@ -416,6 +417,7 @@ bool cDevice::ToggleMute(void)
mute = !mute; mute = !mute;
SetVolume(0, mute); SetVolume(0, mute);
volume = OldVolume; volume = OldVolume;
Audios.MuteAudio(mute);
return mute; return mute;
} }
@ -424,8 +426,10 @@ void cDevice::SetVolume(int Volume, bool Absolute)
volume = min(max(Absolute ? Volume : volume + Volume, 0), MAXVOLUME); volume = min(max(Absolute ? Volume : volume + Volume, 0), MAXVOLUME);
SetVolumeDevice(volume); SetVolumeDevice(volume);
cStatus::MsgSetVolume(volume, Absolute); cStatus::MsgSetVolume(volume, Absolute);
if (volume > 0) if (volume > 0) {
mute = false; mute = false;
Audios.MuteAudio(mute);
}
} }
int cDevice::NumAudioTracks(void) const int cDevice::NumAudioTracks(void) const
@ -462,6 +466,7 @@ void cDevice::TrickSpeed(int Speed)
void cDevice::Clear(void) void cDevice::Clear(void)
{ {
Audios.ClearAudio();
} }
void cDevice::Play(void) void cDevice::Play(void)
@ -474,6 +479,7 @@ void cDevice::Freeze(void)
void cDevice::Mute(void) void cDevice::Mute(void)
{ {
Audios.MuteAudio(true);
} }
void cDevice::StillPicture(const uchar *Data, int Length) void cDevice::StillPicture(const uchar *Data, int Length)
@ -529,9 +535,9 @@ int cDevice::PlayVideo(const uchar *Data, int Length)
return -1; 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 int cDevice::Ca(void) const
@ -608,10 +614,10 @@ int cDevice::ProvidesCa(int Ca) const
return result ? result + others : 0; return result ? result + others : 0;
} }
bool cDevice::Receiving(void) const bool cDevice::Receiving(bool CheckAny) const
{ {
for (int i = 0; i < MAXRECEIVERS; i++) { 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 true;
} }
return false; return false;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DEVICE_H
@ -290,6 +290,8 @@ public:
// times. // times.
virtual void Clear(void); virtual void Clear(void);
// Clears all video and audio data from the device. // 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); virtual void Play(void);
// Sets the device into play mode (after a previous trick // Sets the device into play mode (after a previous trick
// mode). // mode).
@ -297,6 +299,8 @@ public:
// Puts the device into "freeze frame" mode. // Puts the device into "freeze frame" mode.
virtual void Mute(void); virtual void Mute(void);
// Turns off audio while replaying. // 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); virtual void StillPicture(const uchar *Data, int Length);
// Displays the given I-frame as a still picture. // Displays the given I-frame as a still picture.
virtual bool Poll(cPoller &Poller, int TimeoutMs = 0); 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 // Actually plays the given data block as video. The data must be
// part of a PES (Packetized Elementary Stream) which can contain // part of a PES (Packetized Elementary Stream) which can contain
// one video and one audio strem. // 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. // 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; bool Replaying(void) const;
// Returns true if we are currently replaying. // Returns true if we are currently replaying.
void StopReplay(void); void StopReplay(void);
@ -347,7 +353,7 @@ protected:
public: public:
int Ca(void) const; int Ca(void) const;
// Returns the ca of the current receiving session(s). // 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. // Returns true if we are currently receiving.
bool AttachReceiver(cReceiver *Receiver); bool AttachReceiver(cReceiver *Receiver);
// Attaches the given receiver to this device. // Attaches the given receiver to this device.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbdevice.h"
@ -18,17 +18,10 @@ extern "C" {
} }
#include <limits.h> #include <limits.h>
#include <linux/videodev.h> #include <linux/videodev.h>
#ifdef NEWSTRUCT
#include <linux/dvb/audio.h> #include <linux/dvb/audio.h>
#include <linux/dvb/dmx.h> #include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
#include <linux/dvb/video.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/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "channels.h" #include "channels.h"
@ -39,8 +32,9 @@ extern "C" {
#include "status.h" #include "status.h"
#include "transfer.h" #include "transfer.h"
#define DO_REC_AND_PLAY_ON_PRIMARY_DEVICE 1
#define DEV_VIDEO "/dev/video" #define DEV_VIDEO "/dev/video"
#ifdef NEWSTRUCT
#define DEV_DVB_ADAPTER "/dev/dvb/adapter" #define DEV_DVB_ADAPTER "/dev/dvb/adapter"
#define DEV_DVB_OSD "osd" #define DEV_DVB_OSD "osd"
#define DEV_DVB_FRONTEND "frontend" #define DEV_DVB_FRONTEND "frontend"
@ -48,24 +42,11 @@ extern "C" {
#define DEV_DVB_DEMUX "demux" #define DEV_DVB_DEMUX "demux"
#define DEV_DVB_VIDEO "video" #define DEV_DVB_VIDEO "video"
#define DEV_DVB_AUDIO "audio" #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 const char *DvbName(const char *Name, int n)
{ {
static char buffer[PATH_MAX]; static char buffer[PATH_MAX];
#ifdef NEWSTRUCT
snprintf(buffer, sizeof(buffer), "%s%d/%s%d", DEV_DVB_ADAPTER, n, Name, 0); 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; return buffer;
} }
@ -80,11 +61,7 @@ static int DvbOpen(const char *Name, int n, int Mode, bool ReportError = false)
cDvbDevice::cDvbDevice(int n) cDvbDevice::cDvbDevice(int n)
{ {
#ifdef NEWSTRUCT
frontendType = fe_type_t(-1); // don't know how else to initialize this - there is no FE_UNKNOWN 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; siProcessor = NULL;
spuDecoder = NULL; spuDecoder = NULL;
playMode = pmNone; playMode = pmNone;
@ -99,12 +76,6 @@ cDvbDevice::cDvbDevice(int n)
fd_video = DvbOpen(DEV_DVB_VIDEO, n, O_RDWR | O_NONBLOCK); fd_video = DvbOpen(DEV_DVB_VIDEO, n, O_RDWR | O_NONBLOCK);
fd_audio = DvbOpen(DEV_DVB_AUDIO, 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): // The DVR device (will be opened and closed as needed):
fd_dvr = -1; 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 // We only check the devices that must be present - the others will be checked before accessing them://XXX
if (fd_frontend >= 0) { if (fd_frontend >= 0) {
#ifdef NEWSTRUCT
dvb_frontend_info feinfo; dvb_frontend_info feinfo;
#else
FrontendInfo feinfo;
#endif
siProcessor = new cSIProcessor(DvbName(DEV_DVB_DEMUX, n)); siProcessor = new cSIProcessor(DvbName(DEV_DVB_DEMUX, n));
if (ioctl(fd_frontend, FE_GET_INFO, &feinfo) >= 0) if (ioctl(fd_frontend, FE_GET_INFO, &feinfo) >= 0)
frontendType = feinfo.type; frontendType = feinfo.type;
@ -312,20 +279,12 @@ void cDvbDevice::SetVideoFormat(bool VideoFormat16_9)
} }
// ptAudio ptVideo ptTeletext ptDolby ptOther // 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 }; 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) bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{ {
if (Handle->pid) { if (Handle->pid) {
#ifdef NEWSTRUCT
dmx_pes_filter_params pesFilterParams; dmx_pes_filter_params pesFilterParams;
#else
dmxPesFilterParams pesFilterParams;
#endif
memset(&pesFilterParams, 0, sizeof(pesFilterParams)); memset(&pesFilterParams, 0, sizeof(pesFilterParams));
if (On) { if (On) {
if (Handle->handle < 0) { if (Handle->handle < 0) {
@ -336,11 +295,7 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
pesFilterParams.pid = Handle->pid; pesFilterParams.pid = Handle->pid;
pesFilterParams.input = DMX_IN_FRONTEND; pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = (Type <= ptTeletext && Handle->used <= 1) ? DMX_OUT_DECODER : DMX_OUT_TS_TAP; pesFilterParams.output = (Type <= ptTeletext && Handle->used <= 1) ? DMX_OUT_DECODER : DMX_OUT_TS_TAP;
#ifdef NEWSTRUCT
pesFilterParams.pes_type= PesTypes[Type < ptOther ? Type : ptOther]; pesFilterParams.pes_type= PesTypes[Type < ptOther ? Type : ptOther];
#else
pesFilterParams.pesType = PesTypes[Type < ptOther ? Type : ptOther];
#endif
pesFilterParams.flags = DMX_IMMEDIATE_START; pesFilterParams.flags = DMX_IMMEDIATE_START;
if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) { if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
LOG_ERROR; LOG_ERROR;
@ -353,11 +308,7 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
pesFilterParams.pid = 0x1FFF; pesFilterParams.pid = 0x1FFF;
pesFilterParams.input = DMX_IN_FRONTEND; pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_DECODER; pesFilterParams.output = DMX_OUT_DECODER;
#ifdef NEWSTRUCT
pesFilterParams.pes_type= PesTypes[Type]; pesFilterParams.pes_type= PesTypes[Type];
#else
pesFilterParams.pesType = PesTypes[Type];
#endif
pesFilterParams.flags = DMX_IMMEDIATE_START; pesFilterParams.flags = DMX_IMMEDIATE_START;
CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams)); CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams));
close(Handle->handle); close(Handle->handle);
@ -402,17 +353,10 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne
} }
else if (!IsPrimaryDevice()) else if (!IsPrimaryDevice())
result = true; result = true;
else { #ifdef DO_REC_AND_PLAY_ON_PRIMARY_DEVICE
#define DVB_DRIVER_VERSION 2002090101 //XXX+ else
#define MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT 2002090101 result = Priority >= Setup.PrimaryLimit;
#ifdef DVB_DRIVER_VERSION
#if (DVB_DRIVER_VERSION >= MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT)
result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
#endif #endif
#else
#warning "DVB_DRIVER_VERSION not defined - time shift with only one DVB device disabled!"
#endif
}
} }
else else
result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit; result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
@ -437,7 +381,7 @@ static unsigned int FrequencyToHz(unsigned int f)
bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) 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()) if (HasDecoder())
LiveView = true; LiveView = true;
#endif #endif
@ -491,11 +435,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (DoTune) { if (DoTune) {
#ifdef NEWSTRUCT
dvb_frontend_parameters Frontend; dvb_frontend_parameters Frontend;
#else
FrontendParameters Frontend;
#endif
memset(&Frontend, 0, sizeof(Frontend)); 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()); cDiseqc *diseqc = Diseqcs.Get(Channel->Source(), Channel->Frequency(), Channel->Polarization());
if (diseqc) { if (diseqc) {
if (diseqc->Commands() && (!diseqcCommands || strcmp(diseqcCommands, diseqc->Commands()) != 0)) { 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; cDiseqc::eDiseqcActions da;
for (bool Start = true; (da = diseqc->Execute(Start)) != cDiseqc::daNone; Start = false) { for (bool Start = true; (da = diseqc->Execute(Start)) != cDiseqc::daNone; Start = false) {
switch (da) { switch (da) {
#ifdef NEWSTRUCT
case cDiseqc::daNone: break; case cDiseqc::daNone: break;
case cDiseqc::daToneOff: CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); 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; 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; 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(); diseqcCommands = diseqc->Commands();
@ -600,56 +492,31 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
tone = SEC_TONE_ON; tone = SEC_TONE_ON;
} }
int volt = (Channel->Polarization() == 'v' || Channel->Polarization() == 'V') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; 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_VOLTAGE, volt));
CHECK(ioctl(fd_frontend, FE_SET_TONE, tone)); 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.frequency = frequency * 1000UL;
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion()); Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.qpsk.symbol_rate = Channel->Srate() * 1000UL; Frontend.u.qpsk.symbol_rate = Channel->Srate() * 1000UL;
Frontend.u.qpsk.fec_inner = fe_code_rate_t(Channel->CoderateH()); 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; break;
case FE_QAM: { // DVB-C case FE_QAM: { // DVB-C
// Frequency and symbol rate: // Frequency and symbol rate:
#ifdef NEWSTRUCT
Frontend.frequency = FrequencyToHz(Channel->Frequency()); Frontend.frequency = FrequencyToHz(Channel->Frequency());
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion()); Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.qam.symbol_rate = Channel->Srate() * 1000UL; Frontend.u.qam.symbol_rate = Channel->Srate() * 1000UL;
Frontend.u.qam.fec_inner = fe_code_rate_t(Channel->CoderateH()); Frontend.u.qam.fec_inner = fe_code_rate_t(Channel->CoderateH());
Frontend.u.qam.modulation = fe_modulation_t(Channel->Modulation()); 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; break;
case FE_OFDM: { // DVB-T case FE_OFDM: { // DVB-T
// Frequency and OFDM paramaters: // Frequency and OFDM paramaters:
#ifdef NEWSTRUCT
Frontend.frequency = FrequencyToHz(Channel->Frequency()); Frontend.frequency = FrequencyToHz(Channel->Frequency());
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion()); Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.ofdm.bandwidth = fe_bandwidth_t(Channel->Bandwidth()); 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.transmission_mode = fe_transmit_mode_t(Channel->Transmission());
Frontend.u.ofdm.guard_interval = fe_guard_interval_t(Channel->Guard()); Frontend.u.ofdm.guard_interval = fe_guard_interval_t(Channel->Guard());
Frontend.u.ofdm.hierarchy_information = fe_hierarchy_t(Channel->Hierarchy()); 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; break;
default: default:
@ -677,7 +533,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
return false; return false;
} }
#ifdef NEWSTRUCT
// Discard stale events: // Discard stale events:
for (;;) { for (;;) {
@ -685,7 +540,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (ioctl(fd_frontend, FE_GET_EVENT, &event) < 0) if (ioctl(fd_frontend, FE_GET_EVENT, &event) < 0)
break; break;
} }
#endif
// Tuning: // Tuning:
@ -693,7 +547,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// Wait for channel lock: // Wait for channel lock:
#ifdef NEWSTRUCT
fe_status_t status = fe_status_t(0); fe_status_t status = fe_status_t(0);
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
CHECK(ioctl(fd_frontend, FE_READ_STATUS, &status)); CHECK(ioctl(fd_frontend, FE_READ_STATUS, &status));
@ -707,23 +560,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
cThread::RaisePanic(); cThread::RaisePanic();
return false; 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(); source = Channel->Source();
frequency = Channel->Frequency(); frequency = Channel->Frequency();
@ -757,11 +593,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
void cDvbDevice::SetVolumeDevice(int Volume) void cDvbDevice::SetVolumeDevice(int Volume)
{ {
if (HasDecoder()) { if (HasDecoder()) {
#ifdef NEWSTRUCT
audio_mixer_t am; audio_mixer_t am;
#else
audioMixer_t am;
#endif
am.volume_left = am.volume_right = Volume; am.volume_left = am.volume_right = Volume;
CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am)); CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am));
} }
@ -779,21 +611,19 @@ int cDvbDevice::NumAudioTracksDevice(void) const
const char **cDvbDevice::GetAudioTracksDevice(int *CurrentTrack) const const char **cDvbDevice::GetAudioTracksDevice(int *CurrentTrack) const
{ {
if (Ca()) if (NumAudioTracksDevice()) {
return NULL; // a Ca recording session blocks switching live audio tracks
if (NumAudioTracks()) {
if (CurrentTrack) if (CurrentTrack)
*CurrentTrack = (pidHandles[ptAudio].pid == aPid1) ? 0 : 1; *CurrentTrack = (pidHandles[ptAudio].pid == aPid1) ? 0 : 1;
static const char *audioTracks1[] = { "Audio 1", NULL }; static const char *audioTracks1[] = { "Audio 1", NULL };
static const char *audioTracks2[] = { "Audio 1", "Audio 2", NULL }; static const char *audioTracks2[] = { "Audio 1", "Audio 2", NULL };
return NumAudioTracks() > 1 ? audioTracks2 : audioTracks1; return NumAudioTracksDevice() > 1 ? audioTracks2 : audioTracks1;
} }
return NULL; return NULL;
} }
void cDvbDevice::SetAudioTrackDevice(int Index) 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 int vpid = pidHandles[ptVideo].pid; // need to turn video PID off/on to restart demux
DelPid(vpid); DelPid(vpid);
DelPid(pidHandles[ptAudio].pid); DelPid(pidHandles[ptAudio].pid);
@ -957,10 +787,10 @@ int cDvbDevice::PlayVideo(const uchar *Data, int Length)
return -1; return -1;
} }
int cDvbDevice::PlayAudio(const uchar *Data, int Length) void cDvbDevice::PlayAudio(const uchar *Data, int Length)
{ {
//XXX+ //XXX actually this function will only be needed to implement replaying AC3 over the DVB card's S/PDIF
return -1; cDevice::PlayAudio(Data, Length);
} }
bool cDvbDevice::OpenDvr(void) bool cDvbDevice::OpenDvr(void)
@ -991,11 +821,7 @@ bool cDvbDevice::GetTSPacket(uchar *&Data)
return true; return true;
} }
else if (FATALERRNO) { else if (FATALERRNO) {
#ifdef NEWSTRUCT
if (errno == EOVERFLOW) 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); esyslog("ERROR: DVB driver buffer overflow on device %d", CardIndex() + 1);
else { else {
LOG_ERROR; LOG_ERROR;

View File

@ -4,21 +4,22 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DVBDEVICE_H
#define __DVBDEVICE_H #define __DVBDEVICE_H
#ifdef NEWSTRUCT
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
#else #include <linux/dvb/version.h>
#include <ost/frontend.h>
#endif
#include "device.h" #include "device.h"
#include "dvbspu.h" #include "dvbspu.h"
#include "eit.h" #include "eit.h"
#if DVB_API_VERSION != 3
#error VDR requires Linux DVB driver API version 3!
#endif
#define MAXDVBDEVICES 4 #define MAXDVBDEVICES 4
class cDvbDevice : public cDevice { class cDvbDevice : public cDevice {
@ -31,13 +32,8 @@ public:
// Initializes the DVB devices. // Initializes the DVB devices.
// Must be called before accessing any DVB functions. // Must be called before accessing any DVB functions.
private: private:
#ifdef NEWSTRUCT
fe_type_t frontendType; fe_type_t frontendType;
int fd_osd, fd_frontend, fd_audio, fd_video, fd_dvr; 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; } int OsdDeviceHandle(void) const { return fd_osd; }
protected: protected:
virtual void MakePrimaryDevice(bool On); virtual void MakePrimaryDevice(bool On);
@ -112,7 +108,7 @@ public:
virtual void StillPicture(const uchar *Data, int Length); virtual void StillPicture(const uchar *Data, int Length);
virtual bool Poll(cPoller &Poller, int TimeoutMs = 0); virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
virtual int PlayVideo(const uchar *Data, int Length); 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 // Receiver facilities

View File

@ -4,17 +4,13 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DVBOSD_H
#define __DVBOSD_H #define __DVBOSD_H
#ifdef NEWSTRUCT
#include <linux/dvb/osd.h> #include <linux/dvb/osd.h>
#else
#include <ost/osd.h>
#endif
#include "dvbdevice.h" #include "dvbdevice.h"
#include "osdbase.h" #include "osdbase.h"

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbplayer.h"
@ -219,7 +219,7 @@ void cDvbPlayer::StripAudioPackets(uchar *b, int Length, uchar Except)
switch (c) { switch (c) {
case 0xBD: // dolby case 0xBD: // dolby
if (Except) if (Except)
;//XXX+ PlayExternalDolby(&b[i], Length - i); PlayAudio(&b[i], l);
// continue with deleting the data - otherwise it disturbs DVB replay // continue with deleting the data - otherwise it disturbs DVB replay
case 0xC0 ... 0xC1: // audio case 0xC0 ... 0xC1: // audio
if (c == 0xC1) if (c == 0xC1)

34
eit.c
View File

@ -16,18 +16,14 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (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 "eit.h"
#include <ctype.h> #include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#ifdef NEWSTRUCT
#include <linux/dvb/dmx.h> #include <linux/dvb/dmx.h>
#else
#include <ost/dmx.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -757,7 +753,7 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules)
if (*s == 'C') { if (*s == 'C') {
unsigned int uServiceID; unsigned int uServiceID;
if (1 == sscanf(s + 1, "%u", &uServiceID)) { if (1 == sscanf(s + 1, "%u", &uServiceID)) {
cSchedule *p = (cSchedule *)Schedules->SetCurrentServiceID(uServiceID); cSchedule *p = (cSchedule *)Schedules->AddServiceID(uServiceID);
if (p) { if (p) {
if (!cEventInfo::Read(f, p)) if (!cEventInfo::Read(f, p))
return false; return false;
@ -786,19 +782,21 @@ 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) const cSchedule *cSchedules::SetCurrentServiceID(unsigned short servid)
{ {
pCurrentSchedule = GetSchedule(servid); pCurrentSchedule = AddServiceID(servid);
if (pCurrentSchedule == NULL) if (pCurrentSchedule)
{
Add(new cSchedule(servid));
pCurrentSchedule = GetSchedule(servid);
if (pCurrentSchedule == NULL)
return NULL;
}
uCurrentServiceID = servid; uCurrentServiceID = servid;
return pCurrentSchedule; return pCurrentSchedule;
} }
/** */ /** */
@ -1196,11 +1194,7 @@ void cSIProcessor::Action()
table identifer tid */ table identifer tid */
bool cSIProcessor::AddFilter(u_char pid, u_char tid) bool cSIProcessor::AddFilter(u_char pid, u_char tid)
{ {
#ifdef NEWSTRUCT
dmx_sct_filter_params sctFilterParams; dmx_sct_filter_params sctFilterParams;
#else
dmxSctFilterParams sctFilterParams;
#endif
memset(&sctFilterParams, 0, sizeof(sctFilterParams)); memset(&sctFilterParams, 0, sizeof(sctFilterParams));
sctFilterParams.pid = pid; sctFilterParams.pid = pid;
sctFilterParams.timeout = 0; sctFilterParams.timeout = 0;

3
eit.h
View File

@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (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 #ifndef __EIT_H
@ -112,6 +112,7 @@ private:
const cSchedule *pCurrentSchedule; const cSchedule *pCurrentSchedule;
unsigned short uCurrentServiceID; unsigned short uCurrentServiceID;
protected: protected:
const cSchedule *AddServiceID(unsigned short servid);
const cSchedule *SetCurrentServiceID(unsigned short servid); const cSchedule *SetCurrentServiceID(unsigned short servid);
void Cleanup(); void Cleanup();
public: public:

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "eitscan.h"
@ -55,7 +55,7 @@ void cEITScanner::Process(void)
cDevice *Device = cDevice::GetDevice(i); cDevice *Device = cDevice::GetDevice(i);
if (Device && Device->CardIndex() < MAXDVBDEVICES) { if (Device && Device->CardIndex() < MAXDVBDEVICES) {
if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) { 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 oldCh = lastChannel;
int ch = oldCh + 1; int ch = oldCh + 1;
while (ch != oldCh) { while (ch != oldCh) {

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "interface.h"
@ -418,9 +418,9 @@ void cInterface::LearnKeys(void)
Clear(); Clear();
cRemote::Clear(); cRemote::Clear();
WriteText(1, 1, Headline); WriteText(1, 1, Headline);
cRemote::SetLearning(true); cRemote::SetLearning(Remote);
QueryKeys(Remote); QueryKeys(Remote);
cRemote::SetLearning(false); cRemote::SetLearning(NULL);
Clear(); Clear();
WriteText(1, 1, Headline); WriteText(1, 1, Headline);
WriteText(1, 3, tr("Phase 3: Saving key codes")); WriteText(1, 3, tr("Phase 3: Saving key codes"));

8
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "menu.h"
@ -2378,10 +2378,10 @@ void cDisplayChannel::DisplayChannel(const cChannel *Channel)
char buffer[BufSize]; char buffer[BufSize];
*buffer = 0; *buffer = 0;
if (Channel) { if (Channel) {
if (Channel->Number() > 0) if (Channel->GroupSep())
snprintf(buffer, BufSize, "%d%s %s", Channel->Number(), number ? "-" : "", Channel->Name());
else if (Channel->Name())
snprintf(buffer, BufSize, "%s", Channel->Name()); snprintf(buffer, BufSize, "%s", Channel->Name());
else
snprintf(buffer, BufSize, "%d%s %s", Channel->Number(), number ? "-" : "", Channel->Name());
} }
else if (number) else if (number)
snprintf(buffer, BufSize, "%d-", number); snprintf(buffer, BufSize, "%d-", number);

View File

@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and # See the main source file 'vdr.c' for copyright information and
# how to reach the author. # 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"; $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') 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: ### The directory environment:
ifdef NEWSTRUCT DVBDIR = ../../../../DVB
DVBDIR = ../../../../DVB/include
DEFINES += -DNEWSTRUCT
else
DVBDIR = ../../../../DVB/ost/include
endif
VDRDIR = ../../.. VDRDIR = ../../..
VDRINC = \$(VDRDIR)/include
LIBDIR = ../../lib LIBDIR = ../../lib
TMPDIR = /tmp TMPDIR = /tmp
### Allow user defined options to overwrite defaults:
-include \$(VDRDIR)/Make.config
### The version number of VDR (taken from VDR's "config.h"): ### 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') 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 and Defines (add further entries here):
INCLUDES = -I\$(VDRINC) -I\$(DVBDIR) INCLUDES += -I\$(VDRDIR)/include -I\$(DVBDIR)/include
DEFINES += -DPLUGIN_NAME_I18N='"\$(PLUGIN)"' DEFINES += -DPLUGIN_NAME_I18N='"\$(PLUGIN)"'
@ -100,11 +103,6 @@ DEFINES += -DPLUGIN_NAME_I18N='"\$(PLUGIN)"'
OBJS = \$(PLUGIN).o OBJS = \$(PLUGIN).o
### The C++ compiler and options:
CXX = g++
CXXFLAGS = -O2 -Wall -Woverloaded-virtual
### Implicit rules: ### Implicit rules:
%.o: %.c %.o: %.c

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "player.h"
@ -31,12 +31,13 @@ int cPlayer::PlayVideo(const uchar *Data, int Length)
return -1; return -1;
} }
int cPlayer::PlayAudio(const uchar *Data, int Length) void cPlayer::PlayAudio(const uchar *Data, int Length)
{ {
if (device) if (device) {
return device->PlayAudio(Data, Length); device->PlayAudio(Data, Length);
return;
}
esyslog("ERROR: attempt to use cPlayer::PlayAudio() without attaching to a cDevice!"); esyslog("ERROR: attempt to use cPlayer::PlayAudio() without attaching to a cDevice!");
return -1;
} }
void cPlayer::Detach(void) void cPlayer::Detach(void)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __PLAYER_H
@ -35,8 +35,8 @@ protected:
// Sends the given Data to the video device and returns the number of // 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 // bytes that have actually been accepted by the video device (or a
// negative value in case of an error). // negative value in case of an error).
int PlayAudio(const uchar *Data, int Length); void PlayAudio(const uchar *Data, int Length);
// XXX+ TODO // Plays additional audio streams, like Dolby Digital.
public: public:
cPlayer(ePlayMode PlayMode = pmAudioVideo); cPlayer(ePlayMode PlayMode = pmAudioVideo);
virtual ~cPlayer(); virtual ~cPlayer();

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "remote.h"
@ -27,7 +27,7 @@
eKeys cRemote::keys[MaxKeys]; eKeys cRemote::keys[MaxKeys];
int cRemote::in = 0; int cRemote::in = 0;
int cRemote::out = 0; int cRemote::out = 0;
bool cRemote::learning = false; cRemote *cRemote::learning = NULL;
char *cRemote::unknownCode = NULL; char *cRemote::unknownCode = NULL;
cMutex cRemote::mutex; cMutex cRemote::mutex;
cCondVar cRemote::keyPressed; 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) bool cRemote::Put(const char *Code, bool Repeat, bool Release)
{ {
if (learning && this != learning)
return false;
eKeys Key = Keys.Get(Name(), Code); eKeys Key = Keys.Get(Name(), Code);
if (Key != kNone) { if (Key != kNone) {
if (Repeat) if (Repeat)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __REMOTE_H
@ -24,7 +24,7 @@ private:
static eKeys keys[MaxKeys]; static eKeys keys[MaxKeys];
static int in; static int in;
static int out; static int out;
static bool learning; static cRemote *learning;
static char *unknownCode; static char *unknownCode;
static cMutex mutex; static cMutex mutex;
static cCondVar keyPressed; static cCondVar keyPressed;
@ -39,7 +39,7 @@ public:
virtual ~cRemote(); virtual ~cRemote();
virtual bool Initialize(void) { return true; } virtual bool Initialize(void) { return true; }
const char *Name(void) { return name; } 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 void Clear(void);
static bool Put(eKeys Key); static bool Put(eKeys Key);
static bool PutMacro(eKeys Key); static bool PutMacro(eKeys Key);

View File

@ -4,18 +4,14 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __REMUX_H
#define __REMUX_H #define __REMUX_H
#include <time.h> //XXX FIXME: DVB/linux/dvb/dmx.h should include <time.h> itself!!! #include <time.h> //XXX FIXME: DVB/linux/dvb/dmx.h should include <time.h> itself!!!
#ifdef NEWSTRUCT
#include <linux/dvb/dmx.h> #include <linux/dvb/dmx.h>
#else
#include <ost/dmx.h>
#endif
#include "tools.h" #include "tools.h"
// Picture types: // Picture types:

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "thread.h"
@ -331,11 +331,9 @@ bool cPipe::Open(const char *Command, const char *Mode)
_exit(-1); _exit(-1);
} }
else { else {
for (int i = 0; i <= fd[1]; i++) { int MaxPossibleFileDescriptors = getdtablesize();
if (i == STDIN_FILENO || i == STDOUT_FILENO || i == STDERR_FILENO) for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
continue;
close(i); //close all dup'ed filedescriptors close(i); //close all dup'ed filedescriptors
}
if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1) { if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1) {
LOG_ERROR_STR(Command); LOG_ERROR_STR(Command);
close(fd[1 - iopipe]); close(fd[1 - iopipe]);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "transfer.h"
@ -123,7 +123,7 @@ void cTransfer::StripAudioPackets(uchar *b, int Length, uchar Except)
switch (c) { switch (c) {
case 0xBD: // dolby case 0xBD: // dolby
if (Except) if (Except)
;//XXX+ PlayExternalDolby(&b[i], Length - i); PlayAudio(&b[i], l);
// continue with deleting the data - otherwise it disturbs DVB replay // continue with deleting the data - otherwise it disturbs DVB replay
case 0xC0 ... 0xC1: // audio case 0xC0 ... 0xC1: // audio
if (c == 0xC1) if (c == 0xC1)

18
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * 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> #include <getopt.h>
@ -30,6 +30,7 @@
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "audio.h"
#include "channels.h" #include "channels.h"
#include "config.h" #include "config.h"
#include "cutter.h" #include "cutter.h"
@ -87,6 +88,7 @@ int main(int argc, char *argv[])
#define DEFAULTPLUGINDIR "./PLUGINS/lib" #define DEFAULTPLUGINDIR "./PLUGINS/lib"
int SVDRPport = DEFAULTSVDRPPORT; int SVDRPport = DEFAULTSVDRPPORT;
const char *AudioCommand = NULL;
const char *ConfigDirectory = NULL; const char *ConfigDirectory = NULL;
bool DisplayHelp = false; bool DisplayHelp = false;
bool DisplayVersion = false; bool DisplayVersion = false;
@ -121,10 +123,8 @@ int main(int argc, char *argv[])
int c; 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) { 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) { switch (c) {
/*XXX+ case 'a': AudioCommand = optarg;
case 'a': cDevice::SetAudioCommand(optarg);
break; break;
XXX*/
case 'c': ConfigDirectory = optarg; case 'c': ConfigDirectory = optarg;
break; break;
case 'd': DaemonMode = true; break; case 'd': DaemonMode = true; break;
@ -365,6 +365,11 @@ int main(int argc, char *argv[])
#endif #endif
Interface->LearnKeys(); Interface->LearnKeys();
// External audio:
if (AudioCommand)
new cExternalAudio(AudioCommand);
// Channel: // Channel:
Channels.SwitchTo(Setup.CurrentChannel); Channels.SwitchTo(Setup.CurrentChannel);
@ -519,7 +524,7 @@ int main(int argc, char *argv[])
case osRecord: DELETENULL(Menu); case osRecord: DELETENULL(Menu);
Temp = NULL; Temp = NULL;
if (cRecordControls::Start()) if (cRecordControls::Start())
Interface->Info(tr("Recording")); ;//XXX Interface->Info(tr("Recording"));
else else
Interface->Error(tr("No free DVB device to record!")); Interface->Error(tr("No free DVB device to record!"));
break; break;
@ -589,7 +594,7 @@ int main(int argc, char *argv[])
// Instant recording: // Instant recording:
case kRecord: case kRecord:
if (cRecordControls::Start()) if (cRecordControls::Start())
Interface->Info(tr("Recording")); ;//XXX Interface->Info(tr("Recording"));
else else
Interface->Error(tr("No free DVB device to record!")); Interface->Error(tr("No free DVB device to record!"));
break; break;
@ -676,6 +681,7 @@ int main(int argc, char *argv[])
delete Interface; delete Interface;
cOsd::Shutdown(); cOsd::Shutdown();
Remotes.Clear(); Remotes.Clear();
Audios.Clear();
Setup.CurrentChannel = cDevice::CurrentChannel(); Setup.CurrentChannel = cDevice::CurrentChannel();
Setup.CurrentVolume = cDevice::CurrentVolume(); Setup.CurrentVolume = cDevice::CurrentVolume();
Setup.Save(); Setup.Save();