summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-07-21 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-07-21 18:00:00 +0200
commita4112a96a67dbeb1cd6a63d2b4fa4b837462f467 (patch)
tree5542f0478dbba7715da703b2864fbfda640d6612
parent54d069c95c546d6b12f6effc1af7a0274b7c31e4 (diff)
downloadvdr-patch-lnbsharing-a4112a96a67dbeb1cd6a63d2b4fa4b837462f467.tar.gz
vdr-patch-lnbsharing-a4112a96a67dbeb1cd6a63d2b4fa4b837462f467.tar.bz2
Version 1.1.5vdr-1.1.5
- Added direct access to the index data of cPalette (needed for displaying SPUs, thanks to Andreas Schultz). - The status monitor function cStatus::Replaying() now gets a 'cControl *' argument instead of a 'cDvbPlayerControl *' in order to allow additional players to call this function. cPlayer and cControl have been given the functions GetIndex() and GetReplayMode() to allow access to the player's status. - Added cOsd::OpenRaw() to create a raw OSD (needed for displaying SPUs). - Changed the symantics of the Name parameter in cStatus::Recording() and cStatus::Replaying(). It is no longer the full directory name of the recording, but rather just the basic name. This has been changed to allow players that can't provide a name to simply use a string that describes the player type (like, e.g., "DVD"). - Fixed a hangup when switching to the next file during replay. - Fixed a possible race condition in the cDvbPlayer (thanks to Andreas Schultz for pointing out this one). - Disabled channels on Transponder 12070 in 'channels.conf', which apparently no longer transmits.
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY19
-rw-r--r--PLUGINS.html70
-rw-r--r--PLUGINS/SRC/status/HISTORY4
-rw-r--r--PLUGINS/SRC/status/Makefile2
-rw-r--r--PLUGINS/SRC/status/status.c8
-rw-r--r--channels.conf12
-rw-r--r--config.h4
-rw-r--r--dvbplayer.c17
-rw-r--r--menu.c7
-rw-r--r--osd.c16
-rw-r--r--osd.h10
-rw-r--r--osdbase.c13
-rw-r--r--osdbase.h6
-rw-r--r--player.h13
-rw-r--r--status.c6
-rw-r--r--status.h19
-rw-r--r--tmp.dif118
18 files changed, 161 insertions, 185 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index f886624..58fc676 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -155,6 +155,8 @@ Andreas Schultz <aschultz@warp10.net>
for fixing a crash in case there is no 'epg.data' at program start
for fixing a bug in the EPG bugfix mechanism if the extended description is shorter
than 3 characters
+ for adding direct access to the index data of cPalette (needed for displaying SPUs)
+ for pointing out a possible race condition in the cDvbPlayer
Aaron Holtzman
for writing 'ac3dec'
diff --git a/HISTORY b/HISTORY
index 4b4eee9..225e8d8 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1359,3 +1359,22 @@ Video Disk Recorder Revision History
- The following limitations apply to this version:
+ The '-a' option (for Dolby Digital audio) doesn't work yet.
+ Switching between different language tracks doesn't work yet.
+
+2002-07-21: Version 1.1.5
+
+- Added direct access to the index data of cPalette (needed for displaying SPUs,
+ thanks to Andreas Schultz).
+- The status monitor function cStatus::Replaying() now gets a 'cControl *' argument instead
+ of a 'cDvbPlayerControl *' in order to allow additional players to call this function.
+ cPlayer and cControl have been given the functions GetIndex() and GetReplayMode() to
+ allow access to the player's status.
+- Added cOsd::OpenRaw() to create a raw OSD (needed for displaying SPUs).
+- Changed the symantics of the Name parameter in cStatus::Recording() and
+ cStatus::Replaying(). It is no longer the full directory name of the recording,
+ but rather just the basic name. This has been changed to allow players that can't
+ provide a name to simply use a string that describes the player type (like, e.g.,
+ "DVD").
+- Fixed a hangup when switching to the next file during replay.
+- Fixed a possible race condition in the cDvbPlayer (thanks to Andreas Schultz
+ for pointing out this one).
+- Disabled channels on Transponder 12070 in 'channels.conf', which apparently no longer transmits.
diff --git a/PLUGINS.html b/PLUGINS.html
index 59a2f18..2535c68 100644
--- a/PLUGINS.html
+++ b/PLUGINS.html
@@ -12,7 +12,7 @@ This interface allows programmers to develop additional functionality for VDR co
separate from the core VDR source, without the need of patching the original
VDR code (and all the problems of correlating various patches).
<p>
-<!--X1.1.3--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.1.3--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
This document is divided into two parts, the first one describing the
<a href="#Part I - The Outside Interface"><i>outside</i> interface</a>
of the plugin system, and the second one describing the
@@ -23,18 +23,18 @@ The <i>inside</i> interface provides the plugin code access to VDR's internal da
structures and allows it to hook itself into specific areas to perform special actions.
<!--X1.1.3--></td></tr></table>
<p>
-<!--X1.1.1--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
-Important modifications introduced in version 1.1.1 are marked like this.
-<!--X1.1.1--></td></tr></table>
-<!--X1.1.2--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.2--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.2 are marked like this.
<!--X1.1.2--></td></tr></table>
-<!--X1.1.3--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.1.3--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.3 are marked like this.
<!--X1.1.3--></td></tr></table>
-<!--X1.1.4--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<!--X1.1.4--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.4 are marked like this.
<!--X1.1.4--></td></tr></table>
+<!--X1.1.5--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+Important modifications introduced in version 1.1.5 are marked like this.
+<!--X1.1.5--></td></tr></table>
<a name="Part I - The Outside Interface"><hr><center><h1>Part I - The Outside Interface</h1></center>
@@ -131,7 +131,7 @@ from the web, it will typically have a name like
<p>
and will unpack into a directory named
<p>
-<!--X1.1.2--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.2--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<tt>hello-0.0.1</tt>
<!--X1.1.2--></td></tr></table>
<p>
@@ -139,7 +139,7 @@ To use the <tt>plugins</tt> and <tt>plugins-clean</tt> targets from the VDR <tt>
you need to unpack such an archive into the <tt>VDR/PLUGINS/SRC</tt> directory and
create a symbolic link with the basic plugin name, as in
-<!--X1.1.2--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.2--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
ln -s hello-0.0.1 hello
</pre></td></tr></table><p>
@@ -205,7 +205,6 @@ its memory. You don't need to worry about the details behind all this.
If your plugin requires additional source files, simply add them to your plugin's
source directory and adjust the <tt>Makefile</tt> accordingly.
<p>
-<!--X1.1.1--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Header files usually contain preprocessor statements that prevent the same
file (or rather its contents, to be precise) from being included more than once, like
@@ -237,7 +236,6 @@ The 'hello' example that comes with VDR makes use of <a href="#Internationalizat
and implements a file named <tt>i18n.h</tt>. To make sure it won't clash with VDR's
<tt>i18n.h</tt> it uses the macro <tt>_I18N__H</tt> (one underline at the beginning
and two replacing the dot).
-<!--X1.1.1--></td></tr></table>
<hr><h2>Construction and Destruction</h2>
@@ -424,7 +422,7 @@ If a plugin implements a function that runs in the background (presumably in a
thread of its own), or wants to make use of <a href="#Internationalization">internationalization</a>,
it needs to implement the function
-<!--X1.1.2--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.2--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
virtual bool Start(void);
</pre></td></tr></table><p>
@@ -436,7 +434,7 @@ its task. This may, for instance, be a thread that collects data from the DVB
stream, which is later presented to the user via a function that is available
from the main menu.
<p>
-<!--X1.1.2--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.2--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
A return value of <i>false</i> indicates that something has gone wrong and the
plugin will not be able to perform its task. In that case, the plugin should
write a proper error message to the log file. The first plugin that returns
@@ -500,7 +498,7 @@ interaction is possible. If a specific action takes longer than a few seconds,
the plugin should launch a separate thread to do this.
</b>
-<!--X1.1.2--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.2--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<hr><h2>Housekeeping</h2>
<center><i><b>Chores, chores...</b></i></center><p>
@@ -547,7 +545,6 @@ previously stored in the global setup data (see below). It shall return
<i>true</i> if the parameter was parsed correctly, <i>false</i> in case of
an error. If <i>false</i> is returned, an error message will be written to
the log file (and program execution will continue).
-<!--X1.1.1--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
A possible implementation of <tt>SetupParse()</tt> could look like this:
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
@@ -563,7 +560,6 @@ bool cPluginHello::SetupParse(const char *Name, const char *Value)
It is important to make sure that the parameter names are exactly the same as
used in the <a href="#The Setup menu"><i>Setup</i> menu</a>'s <tt>Store()</tt> function.
-<!--X1.1.1--></td></tr></table>
<p>
The plugin's setup parameters are stored in the same file as VDR's parameters.
In order to allow each plugin (and VDR itself) to have its own set of parameters,
@@ -602,7 +598,6 @@ needs setup parameters that are not directly user adjustable. It can use
<tt>SetupStore()</tt> and <tt>SetupParse()</tt> without presenting these
parameters to the user.
-<!--X1.1.1--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<a name="The Setup menu"><hr><h2>The Setup menu</h2>
<center><i><b>Have it your way!</b></i></center><p>
@@ -660,9 +655,8 @@ You can first assign the temporary values to the global variables and then do th
<tt>SetupStore()</tt> calls, or you can define a class or struct that contains all
your setup parameters and use that one to copy all parameters with one single statement
(like VDR does with its cSetup class).
-<!--X1.1.1--></td></tr></table>
-<!--X1.1.2--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.1.2--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<hr><h2>Configuration files</h2>
<center><i><b>I want my own stuff!</b></i></center><p>
@@ -832,7 +826,7 @@ and display their help and/or version information in addition to its own output.
If you want to make your plugin available to other VDR users, you'll need to
make a package that can be easily distributed.
-<!--X1.1.3--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.1.3--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
The <tt>Makefile</tt> that has been created by the call to
<a href="#Initializing a new plugin directory"><tt>newplugin</tt></a>
provides the target <tt>dist</tt>, which does this for you.
@@ -854,7 +848,7 @@ vdr-hello-0.0.1.tgz
in your source directory, where <tt>hello</tt> will be replaced with your actual
plugin's name, and <tt>0.0.1</tt> will be your plugin's current version number.
-<!--X1.1.3--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.1.3--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<a name="Part II - The Inside Interface"><hr><center><h1>Part II - The Inside Interface</h1></center>
<hr><h2>Status monitor</h2>
@@ -931,7 +925,7 @@ member functions are available in <tt>cStatus</tt>. You only need to implement
the functions you actually want to use.
<!--X1.1.3--></td></tr></table>
-<!--X1.1.4--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<!--X1.1.4--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<hr><h2>Players</h2>
<center><i><b>Play it again, Sam!</b></i></center><p>
@@ -1082,5 +1076,37 @@ that they already know. If you absolutely want to do things differently, just go
ahead - it's your show...
<!--X1.1.4--></td></tr></table>
+<!--X1.1.5--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<hr><h2>The On Screen Display</h2>
+
+<center><i><b>Express yourself</b></i></center><p>
+
+Most of the time a plugin should be able to access the OSD through the
+standard mechanisms also used by VDR itself. However, these set up the OSD in
+a manner of textual rows and columns, and automatically set the various
+windows and color depths.
+<p>
+If a plugin needs to have total control over the OSD, it can call the
+static function
+
+<p><table><tr><td bgcolor=#F0F0F0><pre><br>
+#include &lt;vdr/osd.h&gt;
+
+cOsdBase *MyOsd = cOsd::OpenRaw(x, y);
+</pre></td></tr></table><p>
+
+where <tt>x</tt> and <tt>y</tt> are the coordinates of the upper left corner
+of the OSD area on the screen. Such a "raw" OSD doesn't display anything
+yet, so you need to at least call the function
+
+<p><table><tr><td bgcolor=#F0F0F0><pre><br>
+MyOsd-&gt;Create(...);
+</pre></td></tr></table><p>
+
+to define an actual OSD drawing area (see VDR/osdbase.h for the declarations
+of these functions, and VDR/osd.c to see how VDR opens the OSD and sets up
+its windows and color depths).
+<!--X1.1.5--></td></tr></table>
+
</body>
</html>
diff --git a/PLUGINS/SRC/status/HISTORY b/PLUGINS/SRC/status/HISTORY
index 2792936..f0c208f 100644
--- a/PLUGINS/SRC/status/HISTORY
+++ b/PLUGINS/SRC/status/HISTORY
@@ -4,3 +4,7 @@ VDR Plugin 'status' Revision History
2002-05-18: Version 0.0.1
- Initial revision.
+
+2002-07-13: Version 0.0.2
+
+- Changed the interface of cStatus::Replaying().
diff --git a/PLUGINS/SRC/status/Makefile b/PLUGINS/SRC/status/Makefile
index a0dbbc0..2d5a0e7 100644
--- a/PLUGINS/SRC/status/Makefile
+++ b/PLUGINS/SRC/status/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id$
+# $Id: Makefile 1.1 2002/06/10 16:24:09 kls Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
diff --git a/PLUGINS/SRC/status/status.c b/PLUGINS/SRC/status/status.c
index c9c494a..dc274e8 100644
--- a/PLUGINS/SRC/status/status.c
+++ b/PLUGINS/SRC/status/status.c
@@ -3,13 +3,13 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id$
+ * $Id: status.c 1.2 2002/07/13 10:55:55 kls Exp $
*/
#include <vdr/plugin.h>
#include <vdr/status.h>
-static const char *VERSION = "0.0.1";
+static const char *VERSION = "0.0.2";
static const char *DESCRIPTION = "Status monitor test";
static const char *MAINMENUENTRY = NULL;
@@ -19,7 +19,7 @@ class cStatusTest : public cStatus {
protected:
virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);
virtual void Recording(const cDevice *Device, const char *Name);
- virtual void Replaying(const cDvbPlayerControl *DvbPlayerControl, const char *Name);
+ virtual void Replaying(const cControl *Control, const char *Name);
virtual void SetVolume(int Volume, bool Absolute);
virtual void OsdClear(void);
virtual void OsdTitle(const char *Title);
@@ -41,7 +41,7 @@ void cStatusTest::Recording(const cDevice *Device, const char *Name)
dsyslog("status: cStatusTest::Recording %d %s", Device->CardIndex(), Name);
}
-void cStatusTest::Replaying(const cDvbPlayerControl *DvbPlayerControl, const char *Name)
+void cStatusTest::Replaying(const cControl *Control, const char *Name)
{
dsyslog("status: cStatusTest::Replaying %s", Name);
}
diff --git a/channels.conf b/channels.conf
index fef4774..bd47e04 100644
--- a/channels.conf
+++ b/channels.conf
@@ -78,7 +78,7 @@ Premiere Direkt 2B:11719:h:0:27500:767:768;769:0:101:181
Premiere Direkt 3A:11719:h:0:27500:511:512;515:0:101:180
Premiere Direkt 3B:11719:h:0:27500:1279:1280;1283:0:101:183
Premiere Direkt 4A:12031:h:0:27500:2815:2816:0:101:18
-Premiere Direkt 4B:12070:h:0:27500:1535:1536:0:101:216
+:#Premiere Direkt 4B:12070:h:0:27500:1535:1536:0:101:216
:PW Erotic
Beate-Uhse.TV:11758:h:0:27500:1023:1024:0:101:21
Premiere Erotik 1:12031:h:0:27500:1279:1280:0:101:513
@@ -89,11 +89,11 @@ Premiere Erotik 4:11719:h:0:27500:3583:3584:0:101:780
Premiere Sport 1:11720:h:0:27500:255:256,257:0:101:17
Premiere Sport 2:12031:h:0:27500:3839:3840:0:101:27
:Formel 1
-Supersignal:12070:h:0:27500:255:256:0:101:211
-Cockpitkanal:12070:h:0:27500:511:512:0:101:212
-Boxengasse:12070:h:0:27500:767:768:0:101:213
-Verfolgerfeld:12070:h:0:27500:1023:1024:0:101:214
-Infokanal:12070:h:0:27500:1279:1280:0:101:215
+:#Supersignal:12070:h:0:27500:255:256:0:101:211
+:#Cockpitkanal:12070:h:0:27500:511:512:0:101:212
+:#Boxengasse:12070:h:0:27500:767:768:0:101:213
+:#Verfolgerfeld:12070:h:0:27500:1023:1024:0:101:214
+:#Infokanal:12070:h:0:27500:1279:1280:0:101:215
Multikanal:11720:h:0:27500:255:256:0:101:17
:Beta Digital
N24:12480:v:0:27500:2047:2048:0:0:47
diff --git a/config.h b/config.h
index 601b6fd..f10b83d 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.119 2002/06/16 14:49:52 kls Exp $
+ * $Id: config.h 1.120 2002/07/13 09:46:59 kls Exp $
*/
#ifndef __CONFIG_H
@@ -19,7 +19,7 @@
#include "eit.h"
#include "tools.h"
-#define VDRVERSION "1.1.4"
+#define VDRVERSION "1.1.5"
#define MAXPRIORITY 99
#define MAXLIFETIME 99
diff --git a/dvbplayer.c b/dvbplayer.c
index 9ea8eb1..af6b28d 100644
--- a/dvbplayer.c
+++ b/dvbplayer.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbplayer.c 1.4 2002/06/23 10:52:51 kls Exp $
+ * $Id: dvbplayer.c 1.7 2002/07/14 14:30:36 kls Exp $
*/
#include "dvbplayer.h"
@@ -116,8 +116,8 @@ public:
int SkipFrames(int Frames);
void SkipSeconds(int Seconds);
void Goto(int Position, bool Still = false);
- void GetIndex(int &Current, int &Total, bool SnapToIFrame = false);
- bool GetReplayMode(bool &Play, bool &Forward, int &Speed);
+ virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false);
+ virtual bool GetReplayMode(bool &Play, bool &Forward, int &Speed);
};
#define MAX_VIDEO_SLOWMOTION 63 // max. arg to pass to VIDEO_SLOWMOTION // TODO is this value correct?
@@ -132,7 +132,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName)
backTrace = NULL;
index = NULL;
eof = false;
- active = false;
+ active = true;
playMode = pmPlay;
playDir = pdForward;
trickSpeed = NORMAL_SPEED;
@@ -292,7 +292,6 @@ void cDvbPlayer::Activate(bool On)
void cDvbPlayer::Action(void)
{
- active = true;
dsyslog("dvbplayer thread started (pid=%d)", getpid());
uchar b[MAXFRAMESIZE];
@@ -310,6 +309,7 @@ void cDvbPlayer::Action(void)
isyslog("resuming replay at index %d (%s)", readIndex, IndexToHMSF(readIndex, true));
while (active && NextFile()) {
+ pfd[1].fd = replayFile; // NextFile() may have returned a new file handle!
{
LOCK_THREAD;
@@ -593,7 +593,7 @@ void cDvbPlayer::Goto(int Index, bool Still)
}
}
-void cDvbPlayer::GetIndex(int &Current, int &Total, bool SnapToIFrame)
+bool cDvbPlayer::GetIndex(int &Current, int &Total, bool SnapToIFrame)
{
if (index) {
if (playMode == pmStill)
@@ -607,9 +607,10 @@ void cDvbPlayer::GetIndex(int &Current, int &Total, bool SnapToIFrame)
}
}
Total = index->Last();
+ return true;
}
- else
- Current = Total = -1;
+ Current = Total = -1;
+ return false;
}
bool cDvbPlayer::GetReplayMode(bool &Play, bool &Forward, int &Speed)
diff --git a/menu.c b/menu.c
index 2a5f2fe..0404b87 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.201 2002/06/23 11:07:19 kls Exp $
+ * $Id: menu.c 1.202 2002/07/14 10:55:37 kls Exp $
*/
#include "menu.h"
@@ -2442,7 +2442,7 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer)
recorder = new cRecorder(fileName, ch->ca, timer->priority, ch->vpid, ch->apid1, ch->apid2, ch->dpid1, ch->dpid2);
if (device->AttachReceiver(recorder)) {
Recording.WriteSummary();
- cStatus::MsgRecording(device, fileName);
+ cStatus::MsgRecording(device, Recording.Name());
Interface->DisplayRecording(device->CardIndex(), true);
}
else
@@ -2688,7 +2688,8 @@ cReplayControl::cReplayControl(void)
timeoutShow = 0;
timeSearchActive = false;
marks.Load(fileName);
- cStatus::MsgReplaying(this, fileName);
+ cRecording Recording(fileName);
+ cStatus::MsgReplaying(this, Recording.Name());
}
cReplayControl::~cReplayControl()
diff --git a/osd.c b/osd.c
index 1092187..4bf9927 100644
--- a/osd.c
+++ b/osd.c
@@ -4,12 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c 1.29 2002/06/16 13:24:00 kls Exp $
+ * $Id: osd.c 1.31 2002/07/14 10:57:45 kls Exp $
*/
#include "osd.h"
#include <string.h>
#include "device.h"
+#include "dvbosd.h"
#include "i18n.h"
#include "status.h"
@@ -19,7 +20,7 @@
WINDOW *cOsd::window = NULL;
int cOsd::colorPairs[MaxColorPairs] = { 0 };
#else
- cDvbOsd *cOsd::osd = NULL;
+ cOsdBase *cOsd::osd = NULL;
#endif
int cOsd::cols = 0;
int cOsd::rows = 0;
@@ -67,6 +68,15 @@ void cOsd::SetColor(eDvbColor colorFg, eDvbColor colorBg)
}
#endif
+cOsdBase *cOsd::OpenRaw(int x, int y)
+{
+#ifdef DEBUG_OSD
+ return NULL;
+#else
+ return osd ? NULL : new cDvbOsd(cDevice::PrimaryDevice()->OsdDeviceHandle(), x, y);
+#endif
+}
+
void cOsd::Open(int w, int h)
{
int d = (h < 0) ? Setup.OSDheight + h : 0;
@@ -95,7 +105,7 @@ void cOsd::Open(int w, int h)
int x = (720 - w + charWidth) / 2; //TODO PAL vs. NTSC???
int y = (576 - Setup.OSDheight * lineHeight) / 2 + d;
//XXX
- osd = new cDvbOsd(cDevice::PrimaryDevice()->OsdDeviceHandle(), x, y);
+ osd = OpenRaw(x, y);
//XXX TODO this should be transferred to the places where the individual windows are requested (there's too much detailed knowledge here!)
if (h / lineHeight == 5) { //XXX channel display
osd->Create(0, 0, w, h, 4);
diff --git a/osd.h b/osd.h
index c062157..dac4b27 100644
--- a/osd.h
+++ b/osd.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.h 1.32 2002/06/23 09:13:17 kls Exp $
+ * $Id: osd.h 1.33 2002/07/13 12:47:06 kls Exp $
*/
#ifndef __OSD_H
@@ -14,7 +14,7 @@
#include <ncurses.h>
#endif
#include "config.h"
-#include "dvbosd.h"
+#include "osdbase.h"
#include "interface.h"
#include "osdbase.h"
#include "tools.h"
@@ -62,12 +62,16 @@ private:
static int colorPairs[MaxColorPairs];
static void SetColor(eDvbColor colorFg, eDvbColor colorBg = clrBackground);
#else
- static cDvbOsd *osd;
+ static cOsdBase *osd;
#endif
static int cols, rows;
public:
static void Initialize(void);
static void Shutdown(void);
+ static cOsdBase *OpenRaw(int x, int y);
+ // Returns a raw OSD without any predefined windows or colors.
+ // If the "normal" OSD is currently in use, NULL will be returned.
+ // The caller must delete this object before the "normal" OSD is used again!
static void Open(int w, int h);
static void Close(void);
static void Clear(void);
diff --git a/osdbase.c b/osdbase.c
index e7486a7..0d6e2a3 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 1.4 2002/05/18 12:39:16 kls Exp $
+ * $Id: osdbase.c 1.5 2002/07/13 14:42:47 kls Exp $
*/
#include "osdbase.h"
@@ -23,6 +23,17 @@ cPalette::cPalette(int Bpp)
full = false;
}
+void cPalette::SetColor(int Index, eDvbColor Color)
+{
+ if (Index < maxColors) {
+ if (numColors < Index)
+ numColors = Index + 1;
+ used[Index] = true;
+ color[Index] = Color;
+ fetched[Index] = false;
+ }
+}
+
int cPalette::Index(eDvbColor Color)
{
#if __BYTE_ORDER == __BIG_ENDIAN
diff --git a/osdbase.h b/osdbase.h
index a20dfc4..1800482 100644
--- a/osdbase.h
+++ b/osdbase.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.h 1.2 2002/05/18 12:38:17 kls Exp $
+ * $Id: osdbase.h 1.4 2002/07/13 14:45:55 kls Exp $
*/
#ifndef __OSDBASE_H
@@ -50,6 +50,8 @@ private:
bool full;
protected:
typedef unsigned char tIndexes[MAXNUMCOLORS];
+ void SetColor(int Index, eDvbColor Color);
+ eDvbColor GetColor(int Index) { return color[Index]; }
public:
cPalette(int Bpp);
int Index(eDvbColor Color);
@@ -62,7 +64,6 @@ class cBitmap : public cPalette {
private:
cFont *font;
eDvbFont fontType;
- void SetIndex(int x, int y, char Index);
char *bitmap;
bool clearWithBackground;
protected:
@@ -74,6 +75,7 @@ public:
bool ClearWithBackground(void) { return clearWithBackground; }
eDvbFont SetFont(eDvbFont Font);
bool Dirty(int &x1, int &y1, int &x2, int &y2);
+ void SetIndex(int x, int y, char Index);
void SetPixel(int x, int y, eDvbColor Color);
void SetBitmap(int x, int y, const cBitmap &Bitmap);
int Width(void) { return width; }
diff --git a/player.h b/player.h
index 51265f3..1bf6d37 100644
--- a/player.h
+++ b/player.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: player.h 1.4 2002/06/23 12:56:38 kls Exp $
+ * $Id: player.h 1.5 2002/07/13 11:12:26 kls Exp $
*/
#ifndef __PLAYER_H
@@ -41,6 +41,15 @@ public:
cPlayer(void);
virtual ~cPlayer();
bool IsAttached(void) { return device != NULL; }
+ virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) { return false; }
+ // Returns the current and total frame index, optionally snapped to the
+ // nearest I-frame.
+ virtual bool GetReplayMode(bool &Play, bool &Forward, int &Speed) { return false; }
+ // Returns the current replay mode (if applicable).
+ // 'Play' tells whether we are playing or pausing, 'Forward' tells whether
+ // we are going forward or backward and 'Speed' is -1 if this is normal
+ // play/pause mode, 0 if it is single speed fast/slow forward/back mode
+ // and >0 if this is multi speed mode.
};
class cControl : public cOsdObject {
@@ -54,6 +63,8 @@ public:
cControl(cPlayer *Player, bool Hidden = false);
virtual ~cControl();
virtual void Hide(void) = 0;
+ bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) { return player->GetIndex(Current, Total, SnapToIFrame); }
+ bool GetReplayMode(bool &Play, bool &Forward, int &Speed) { return player->GetReplayMode(Play, Forward, Speed); }
static void Launch(cControl *Control);
static void Attach(void);
static void Shutdown(void);
diff --git a/status.c b/status.c
index 76dc840..0bc4dd8 100644
--- a/status.c
+++ b/status.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: status.c 1.3 2002/06/16 13:24:36 kls Exp $
+ * $Id: status.c 1.4 2002/07/13 10:49:34 kls Exp $
*/
#include "status.h"
@@ -35,10 +35,10 @@ void cStatus::MsgRecording(const cDevice *Device, const char *Name)
sm->Recording(Device, Name);
}
-void cStatus::MsgReplaying(const cDvbPlayerControl *DvbPlayerControl, const char *Name)
+void cStatus::MsgReplaying(const cControl *Control, const char *Name)
{
for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
- sm->Replaying(DvbPlayerControl, Name);
+ sm->Replaying(Control, Name);
}
void cStatus::MsgSetVolume(int Volume, bool Absolute)
diff --git a/status.h b/status.h
index d68f23a..8041f8c 100644
--- a/status.h
+++ b/status.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: status.h 1.3 2002/06/16 13:24:50 kls Exp $
+ * $Id: status.h 1.5 2002/07/14 10:54:39 kls Exp $
*/
#ifndef __STATUS_H
@@ -12,7 +12,7 @@
#include "config.h"
#include "device.h"
-#include "dvbplayer.h"
+#include "player.h"
#include "tools.h"
class cStatus : public cListObject {
@@ -25,11 +25,14 @@ protected:
// If ChannelNumber is 0, this is before the channel is being switched,
// otherwise ChannelNumber is the number of the channel that has been switched to.
virtual void Recording(const cDevice *Device, const char *Name) {}
- // The given DVB device has started recording Name. Name is the full directory
- // name of the recording. If Name is NULL, the recording has ended.
- virtual void Replaying(const cDvbPlayerControl *DvbPlayerControl, const char *Name) {}
- // The given player control has started replaying Name. Name is the full directory
- // name of the recording. If Name is NULL, the replay has ended.
+ // The given DVB device has started recording Name. Name is the name of the
+ // recording, without any directory path.
+ // If Name is NULL, the recording has ended.
+ virtual void Replaying(const cControl *Control, const char *Name) {}
+ // The given player control has started replaying Name. Name is the name of the
+ // recording, without any directory path. In case of a player that can't provide
+ // a name, Name can be a string that identifies the player type (like, e.g., "DVD").
+ // If Name is NULL, the replay has ended.
virtual void SetVolume(int Volume, bool Absolute) {}
// The volume has been set to the given value, either
// absolutely or relative to the current volume.
@@ -60,7 +63,7 @@ public:
// These functions are called whenever the related status information changes:
static void MsgChannelSwitch(const cDevice *Device, int ChannelNumber);
static void MsgRecording(const cDevice *Device, const char *Name);
- static void MsgReplaying(const cDvbPlayerControl *DvbPlayerControl, const char *Name);
+ static void MsgReplaying(const cControl *Control, const char *Name);
static void MsgSetVolume(int Volume, bool Absolute);
static void MsgOsdClear(void);
static void MsgOsdTitle(const char *Title);
diff --git a/tmp.dif b/tmp.dif
deleted file mode 100644
index 87c57b7..0000000
--- a/tmp.dif
+++ /dev/null
@@ -1,118 +0,0 @@
---- dvb.c
-+++ dvb.c Wed May 29 17:41:53 2002
-@@ -444,6 +444,8 @@
- break;
- if (!dvb->arm_ready)
- continue;
-+ if (down_interruptible(&dvb->dcomlock))
-+ continue;
- newloops=rdebi(dvb, DEBINOSWAP, STATUS_LOOPS, 0, 2);
- if (newloops==dvb->arm_loops) {
- printk("dvb%d: ARM crashed!\n", dvb->num);
-@@ -451,6 +453,7 @@
- newloops=rdebi(dvb, DEBINOSWAP, STATUS_LOOPS, 0, 2)-1;
- }
- dvb->arm_loops=newloops;
-+ up(&dvb->dcomlock);
- }
- dvb->arm_thread = NULL;
- return 0;
-@@ -1158,6 +1161,31 @@
- return blen;
- }
-
-+/* Timer to avoid broken data transfer in gpioirq() */
-+
-+#define GPIO_RXTIME_FRAME ((32*HZ)/1000)
-+
-+static void gpio_receive_timeout(unsigned long data)
-+{
-+ struct dvb_struct *dvb = (struct dvb_struct *)data;
-+ dvb->debitimer.expires = 0;
-+}
-+
-+static void gpio_receive_timer(struct dvb_struct *dvb, unsigned long ticks)
-+{
-+ dvb_demux_filter_t *dvbdmxfilter = dvb->handle2filter[((dvb->debitype)>>8)&0x1f];
-+
-+ if (!dvbdmxfilter || dvbdmxfilter->type != DMX_TYPE_TS)
-+ return;
-+ mod_timer(&dvb->debitimer, jiffies + ticks);
-+}
-+
-+static inline int gpio_rx_pending(struct dvb_struct *dvb)
-+{
-+ return !timer_pending(&dvb->debitimer) && \
-+ dvb->debitimer.expires == 0;
-+}
-+
- static void
- gpioirq(struct saa7146* saa, void *data)
- {
-@@ -1313,6 +1341,7 @@
- iwdebi(dvb, DEBINOSWAP, RX_BUFF, 0, 2);
- break;
- } /* yes, fall through */
-+ gpio_receive_timer(dvb, GPIO_RXTIME_FRAME);
- case DATA_TS_RECORD:
- case DATA_PES_RECORD:
- saa7146_write(dvb->saa_mem, IER,
-@@ -1843,7 +1872,7 @@
- bpp=dvb->osdbpp[dvb->osdwin]+1;
- bpl=((w*bpp+7)&~7)/8;
- size=h*bpl;
-- lpb=(32*1024)/bpl;
-+ lpb=(16*1024)/bpl;
- bnum=size/(lpb*bpl);
- brest=size-bnum*lpb*bpl;
-
-@@ -1851,6 +1880,10 @@
- LoadBitmap(dvb, bpp2bit[dvb->osdbpp[dvb->osdwin]], w, lpb, inc, data);
- BlitBitmap(dvb, dvb->osdwin, x0, y0+i*lpb, 0);
- data+=lpb*inc;
-+ if (gpio_rx_pending(dvb)) {
-+ set_current_state(TASK_INTERRUPTIBLE);
-+ schedule_timeout(GPIO_RXTIME_FRAME);
-+ }
- }
- if (brest) {
- LoadBitmap(dvb, bpp2bit[dvb->osdbpp[dvb->osdwin]], w, brest/bpl, inc, data);
-@@ -3819,6 +3852,7 @@
- return TTBStop(dvb);
-
- if (dvbdmxfeed->type == DMX_TYPE_TS) {
-+ del_timer(&dvb->debitimer);
- if (dvbdmxfeed->ts_type & TS_DECODER) {
- if (dvbdmxfeed->pes_type>=DMX_TS_PES_OTHER ||
- !dvbdmx->pesfilter[dvbdmxfeed->pes_type])
-@@ -5472,8 +5506,12 @@
- spin_lock_init (&dvb->debilock);
- sema_init(&dvb->dcomlock, 1);
- init_waitqueue_head(&dvb->debiq);
-+ init_timer(&dvb->debitimer);
- dvb->debilock=SPIN_LOCK_UNLOCKED;
- dvb->debitype=-1;
-+ dvb->debitimer.function = gpio_receive_timeout;
-+ dvb->debitimer.data = (unsigned long) dvb;
-+ dvb->debitimer.expires = jiffies;
-
- dvb->num=num;
- dvb->i2cbus=adap;
-@@ -5741,6 +5779,7 @@
-
- /* release the saa7146s */
- for( i = 0; i < num_dvb; i++) {
-+ del_timer_sync(&(dvbs[i].debitimer));
- dvbs[i].arm_rmmod=1;
- wake_up_interruptible(&dvbs[i].arm_wait);
- while (dvbs[i].arm_thread)
---- dvb.h
-+++ dvb.h Wed May 29 17:41:08 2002
-@@ -566,6 +566,7 @@
- spinlock_t debilock;
- struct semaphore dcomlock;
- WAIT_QUEUE debiq;
-+ struct timer_list debitimer;
- int debitype;
- int debilen;
- int debibuf;