Skip to content

Commit

Permalink
Added support for AC3 replay over the DVB device
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Schmidinger committed Dec 17, 2004
1 parent 69ecb6a commit c77989e
Show file tree
Hide file tree
Showing 18 changed files with 517 additions and 364 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 263,8 @@ Werner Fink <[email protected]>
for suggesting to add more checks and polling when getting frontend events
for setting the VPID before the APID in live mode to avoid unnecessary
overhead in the firmware
for a patch that was used as a base for implementing a modified PES packet
handling in order to play AC3 audio over full featured DVB cards

Rolf Hakenes <[email protected]>
for providing 'libdtv' and adapting the EIT mechanisms to it
Expand Down
24 changes: 23 additions & 1 deletion HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 3160,7 @@ Video Disk Recorder Revision History
right day of week for timers in the future.
- Some improvements to cPoller (thanks to Marco Schl��ler).

2004-11-27: Version 1.3.18
2004-12-17: Version 1.3.18

- Removed an unused variable from cTimer::GetWDayFromMDay() (thanks to Wayne Keer
for reporting this one).
Expand All @@ -3171,3 3171,25 @@ Video Disk Recorder Revision History
picture mode (thanks to Reinhard Nissl for reporting this one).
- Fixed a possible race condition in generating the DVB device names (thanks to
Rainer Zocholl for reporting this one).
- Changed the way PES packets are played to allow replay of AC3 sound over the
full featured DVB cards (partially based on a patch from Werner Fink).
The new function cDevice::PlayPes() is now called with the complete PES data
stream and calls PlayVideo() and PlayAudio() as necessary.
cDevice::PlayVideo() is now only called with actual video PES packets.
cDevice::PlayAudio() is now called with the actual audio PES packets, which
can be either "normal" audio or AC3 data. You need at least firmware version
0x261d to replay AC3 sound over a full featured DVB card. This function now
has an 'int' return value.
PlayAudio() of derived cDevice classes shall no longer call the base class
function. It shall just play the given data as audio.
cPlayer::PlayVideo() and cPlayer::PlayAudio() are now obsolete and have been
replaced with cPlayer::PlayPes().
All StripAudioPackets() functions are now obsolete. The functionality has been
moved into cDevice::PlayPes(), where only the video and audio packets that are
actually required will be processed.
All audio track handling is now done by cDevice; cTransfer and cDvbPlayer no
longer care about audio tracks. cPlayer, however, still has the virtual hooks
for audio track handling in order to allow plugins to implement players that
have their own idea about this.
cChannel::[AD]pid[12]() have been replaced with cChannel::[AD]pid(int i) to
allow access to all available PIDs.
62 changes: 33 additions & 29 deletions PLUGINS.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 14,18 @@
<a href="http://www.cadsoft.de/vdr">www.cadsoft.de/vdr</a>
</center>
<p>
<!--X1.2.6--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.2.6 are marked like this.
<!--X1.2.6--></td></tr></table>
<!--X1.3.0--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.3.0--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.3.0 are marked like this.
<!--X1.3.0--></td></tr></table>
<!--X1.3.7--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.3.7--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.3.7 are marked like this.
<!--X1.3.7--></td></tr></table>
<!--X1.3.8--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.3.8--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.3.8 are marked like this.
<!--X1.3.8--></td></tr></table>
<!--X1.3.18--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.3.18 are marked like this.
<!--X1.3.18--></td></tr></table>
<p>
VDR provides an easy to use plugin interface that allows additional functionality
to be added to the program by implementing a dynamically loadable library file.
Expand Down Expand Up @@ -73,11 73,11 @@ <h1>Table Of Contents</h1>
<li><a href="#Status monitor">Status monitor</a>
<li><a href="#Players">Players</a>
<li><a href="#Receivers">Receivers</a>
<!--X1.3.0--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.3.0--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<li><a href="#Filters">Filters</a>
<!--X1.3.0--></td></tr></table>
<li><a href="#The On Screen Display">The On Screen Display</a>
<!--X1.3.7--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.3.7--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<li><a href="#Skins">Skins</a>
<li><a href="#Themes">Themes</a>
<!--X1.3.7--></td></tr></table>
Expand Down Expand Up @@ -1023,17 1023,21 @@ <h1>Table Of Contents</h1>
Take a look at the files <tt>player.h</tt> and <tt>dvbplayer.c</tt> to see how VDR implements
its own player for the VDR recordings.
<p>
To play the video data, the player needs to call its member function
<!--X1.3.18--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
To play the actual data, the player needs to call its member function

<p><table><tr><td bgcolor=#F0F0F0><pre>
int PlayVideo(const uchar *Data, int Length);
int PlayPes(const uchar *Data, int Length, bool VideoOnly);
</pre></td></tr></table><p>

where <tt>Data</tt> points to a block of <tt>Length</tt> bytes of a PES data
stream. There are no prerequisites regarding the length or alignment of an
stream containing any combination of video, audio or dolby tracks. Which audio
or dolby track will actually be played is controlled by the device the player
is attached to. There are no prerequisites regarding the length or alignment of an
individual block of data. The sum of all blocks must simply result in the
desired video data stream, and it must be delivered fast enough so that the
desired data stream, and it must be delivered fast enough so that the
DVB device doesn't run out of data.
<!--X1.3.18--></td></tr></table>
To avoid busy loops the player should call its member function

<p><table><tr><td bgcolor=#F0F0F0><pre>
Expand All @@ -1042,24 1046,26 @@ <h1>Table Of Contents</h1>

to determine whether the device is ready for further data.
<p>
If the player can provide more than a single audio track, it can implement the
following functions to make them available:
<!--X1.3.18--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
By default all audio track handling is done by the device a player is
attached to.
If the player can provide more than a single audio track, and has special
requirements in order to set a given track, it can implement the
following function to allow the device to set a specific track:

<p><table><tr><td bgcolor=#F0F0F0><pre>
virtual int NumAudioTracks(void) const;
virtual const char **GetAudioTracks(int *CurrentTrack = NULL);
virtual void SetAudioTrack(int Index);
virtual void SetAudioTrack(eTrackType Type, const tTrackId *TrackId)
</pre></td></tr></table><p>

<p>
If there is an additional audio track that has to be replayed with external hardware,
the player shall call its member function
A player that has special requirements about audio tracks should announce its
available audio tracks by calling

<p><table><tr><td bgcolor=#F0F0F0><pre>
void PlayAudio(const uchar *Data, int Length);
bool DeviceSetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language = NULL, uint32_t Flags = 0)
</pre></td></tr></table><p>

where <tt>Data</tt> points to a complete audio PES packet of <tt>Length</tt> bytes.
See <tt>device.h</tt> for details about the parameters for track handling.
<!--X1.3.18--></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:
Expand Down Expand Up @@ -1217,7 1223,7 @@ <h1>Table Of Contents</h1>
If the <tt>cReceiver</tt> isn't needed any more, it may simply be <i>deleted</i>
and will automatically detach itself from the <tt>cDevice</tt>.

<!--X1.3.0--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.3.0--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<a name="Filters"><hr><h2>Filters</h2>

<center><i><b>A Fistful of Datas</b></i></center><p>
Expand Down Expand Up @@ -1263,7 1269,7 @@ <h1>Table Of Contents</h1>
See VDR/eit.c or VDR/pat.c to learn how to process filter data.
<!--X1.3.0--></td></tr></table>

<!--X1.3.7--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.3.7--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<a name="The On Screen Display"><hr><h2>The On Screen Display</h2>

<center><i><b>Window to the world</b></i></center><p>
Expand Down Expand Up @@ -1375,7 1381,7 @@ <h1>Table Of Contents</h1>
in the <a href="#Getting started"><tt>Start()</tt></a> function of your plugin.
Do not delete this object, it will be automatically deleted when the program ends.
<p>
<!--X1.3.8--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.3.8--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
In order to be able to easily identify plugins that implement a skin it is recommended
that the name of such a plugin should be

Expand Down Expand Up @@ -1527,9 1533,7 @@ <h1>Table Of Contents</h1>
virtual bool HasDecoder(void) const;
virtual bool CanReplay(void) const;
virtual bool SetPlayMode(ePlayMode PlayMode);
<!--X1.2.6--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
virtual int64_t GetSTC(void);
<!--X1.2.6--></td></tr></table>
virtual void TrickSpeed(int Speed);
virtual void Clear(void);
virtual void Play(void);
Expand All @@ -1549,7 1553,7 @@ <h1>Table Of Contents</h1>
virtual void SetVolumeDevice(int Volume);
</pre></td></tr></table><p>

<!--X1.3.0--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.3.0--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<p>
<b>Section Filtering</b>
<p>
Expand Down Expand Up @@ -1579,7 1583,7 @@ <h1>Table Of Contents</h1>
<p>
<b>On Screen Display</b>
<p>
<!--X1.3.7--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.3.7--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
If your device provides On Screen Display (OSD) capabilities (which every device
that is supposed to be used as a primary device should do), it shall implement
an "OSD provider" class, derived from <tt>cOsdProvider</tt>, which, when its <tt>CreateOsd()</tt>
Expand Down
4 changes: 4 additions & 0 deletions PLUGINS/src/sky/HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 28,7 @@ VDR Plugin 'sky' Revision History
2004-10-16: Version 0.3.1

- Improved buffer handling.

2004-12-12: Version 0.3.2

- Changed Apid access in cChannel.
6 changes: 3 additions & 3 deletions PLUGINS/src/sky/sky.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: sky.c 1.7 2004/10/16 09:10:06 kls Exp $
* $Id: sky.c 1.8 2004/12/12 14:27:33 kls Exp $
*/

#include <sys/socket.h>
Expand All @@ -14,7 14,7 @@
#include <vdr/plugin.h>
#include <vdr/sources.h>

static const char *VERSION = "0.3.1";
static const char *VERSION = "0.3.2";
static const char *DESCRIPTION = "Sky Digibox interface";

// --- cDigiboxDevice --------------------------------------------------------
Expand Down Expand Up @@ -213,7 213,7 @@ bool cDigiboxDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
cSkyChannel *SkyChannel = SkyChannels.GetSkyChannel(Channel);
if (SkyChannel) {
digiboxChannelNumber = SkyChannel->digiboxChannelNumber;
apid = Channel->Apid1();
apid = Channel->Apid(0);
vpid = Channel->Vpid();
//XXX only when recording??? -> faster channel switching!
LircSend("SKY"); // makes sure the Digibox is "on"
Expand Down
10 changes: 5 additions & 5 deletions channels.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: channels.h 1.22 2004/10/31 12:54:26 kls Exp $
* $Id: channels.h 1.23 2004/12/05 13:49:04 kls Exp $
*/

#ifndef __CHANNELS_H
Expand Down Expand Up @@ -145,10 145,10 @@ class cChannel : public cListObject {
int Srate(void) const { return srate; }
int Vpid(void) const { return vpid; }
int Ppid(void) const { return ppid; }
int Apid1(void) const { return apids[0]; }
int Apid2(void) const { return apids[1]; }
int Dpid1(void) const { return dpids[0]; }
int Dpid2(void) const { return dpids[1]; }
int Apid(int i) const { return (0 <= i && i < MAXAPIDS) ? apids[i] : 0; }
int Dpid(int i) const { return (0 <= i && i < MAXAPIDS) ? dpids[i] : 0; }
const char *Alang(int i) const { return (0 <= i && i < MAXAPIDS) ? alangs[i] : ""; }
const char *Dlang(int i) const { return (0 <= i && i < MAXAPIDS) ? dlangs[i] : ""; }
int Tpid(void) const { return tpid; }
int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; }
int Nid(void) const { return nid; }
Expand Down
Loading

0 comments on commit c77989e

Please sign in to comment.