diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2003-05-11 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2003-05-11 18:00:00 +0200 |
commit | c84022554aaacc9b1c3d9627501cdbb8276871f6 (patch) | |
tree | c26b34a2d420d52b1f88dae9323b1b975373571f /PLUGINS.html | |
parent | af2a135212088f0cba6bd8f98544b271c2f71bef (diff) | |
download | vdr-patch-lnbsharing-c84022554aaacc9b1c3d9627501cdbb8276871f6.tar.gz vdr-patch-lnbsharing-c84022554aaacc9b1c3d9627501cdbb8276871f6.tar.bz2 |
Version 1.1.31vdr-1.1.31
- Introduced the new function cPlugin::Initialize(), in order to be able to separate
the startup of a plugin into an "early" (Initialize()) and "late" (Start()) phase
(suggested by Andreas Schultz). Plugin authors should please read the section
about "Getting started" in PLUGINS.html and adapt their code if applicable.
- Implemented the CableDeliverySystemDescriptor and TerrestrialDeliverySystemDescriptor
in libdtv (thanks to Sven Grothklags and Andreas Schultz).
- Fixed keeping live video active in case the primary device doesn't have an MPEG
decoder (thanks to Wolfgang Goeller for reporting this one).
- Implemented cDevice::ActualDevice(), which returns the actual receiving device in
case of 'Transfer Mode', or the primary device otherwise. This may be useful for
plugins that want to attach a cReceiver to the device where the current live video
is actually coming from.
- Added VDRVERSNUM to config.h, which can be used by the preprocessor to check the
actual VDR version (suggested by Stefan Huelswitt).
- Removed the WaitForPut/WaitForGet stuff from cRingBuffer, since it appears to
no longer be necessary due to the implementation of cNonBlockingFileReader in
dvbplayer.c. Also, the long timeout in WaitForPut caused problems with cReceivers
that use a ring buffer and didn't immediately return from their Receive() function
if the buffer runs full (thanks to Sascha Volkenandt for reporting this one).
- Fixed handling EPG data where the "extended event descriptor" comes before the
"short event" or a "time shifted event" (thanks to Jonan Santiago).
- Disabled the "Received stuffing section in EIT" log message.
- Updated 'channels.conf.terr' for Berlin (thanks to Juri Haberland).
- Avoiding short display of the "Main" menu when pressing the "Recordings" button
or the "Back" button during replay.
- Further increased the timeout until an index file is considerd no longer to be
written.
- Implemented separate PausePriority and PauseLifetime parameters for the recordings
created when pausing live video (suggested by Alfred Zastrow).
- Changed C++ style comments in libdtv into C style to avoid warnings in gcc 3.x
(thanks to Andreas Schultz).
Diffstat (limited to 'PLUGINS.html')
-rw-r--r-- | PLUGINS.html | 76 |
1 files changed, 51 insertions, 25 deletions
diff --git a/PLUGINS.html b/PLUGINS.html index d6c3776..bd1a0d0 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -21,18 +21,18 @@ VDR program and present itself to the user. The <i>internal</i> interface provides the plugin code access to VDR's internal data structures and allows it to hook itself into specific areas to perform special actions. <p> -<!--X1.1.14--><table width=100%><tr><td bgcolor=#0000AA> </td><td width=100%> -Important modifications introduced in version 1.1.14 are marked like this. -<!--X1.1.14--></td></tr></table> -<!--X1.1.15--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> +<!--X1.1.15--><table width=100%><tr><td bgcolor=#0000AA> </td><td width=100%> Important modifications introduced in version 1.1.15 are marked like this. <!--X1.1.15--></td></tr></table> -<!--X1.1.17--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> +<!--X1.1.17--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> Important modifications introduced in version 1.1.17 are marked like this. <!--X1.1.17--></td></tr></table> -<!--X1.1.27--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +<!--X1.1.27--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> Important modifications introduced in version 1.1.27 are marked like this. <!--X1.1.27--></td></tr></table> +<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +Important modifications introduced in version 1.1.31 are marked like this. +<!--X1.1.31--></td></tr></table> <hr> <h1>Table Of Contents</h1> @@ -283,7 +283,12 @@ virtual ~cPlugin(); The <b>constructor</b> shall initialize any member variables the plugin defines, but <b>must not access any global structures of VDR</b>. It also must not create any threads or other large data structures. These things -are done in the <a href="#Getting started"><tt>Start()</tt></a> function later. +are done in the +<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +<a href="#Getting started"><tt>Initialize()</tt></a> or +<a href="#Getting started"><tt>Start()</tt></a> +<!--X1.1.31--></td></tr></table> +function later. Constructing a plugin object shall not have any side effects or produce any output, since VDR, for instance, has to create the plugin objects in order to get their command line help - and after that immediately destroys them again. @@ -452,13 +457,28 @@ be shorter than 80 characters. 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 +it needs to implement one of the functions <p><table><tr><td bgcolor=#F0F0F0><pre><br> +<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%><pre> +virtual bool Initialize(void); +<!--X1.1.31--></pre></td></tr></table> virtual bool Start(void); </pre></td></tr></table><p> -which is called once for each plugin at program startup. +which are called once for each plugin at program startup. +<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +The difference between these two functions is that <tt>Initialize()</tt> is +called early at program startup, while <tt>Start()</tt> is called after everything +else has been set up, right before the main program loop is entered. Inside the +<tt>Start()</tt> function of any plugin it is guaranteed that the <tt>Initialize()</tt> +functions of all plugins have already been called. For many plugins it probably +doesn't matter which of these functions they implement, but it may be of importance +for, e.g., plugins that implement devices. Such plugins should create their cDevice +derived objects in <tt>Initialize()</tt>, so that other plugins can use them in their +<tt>Start()</tt> functions. +<!--X1.1.31--></td></tr></table> +<p> Inside this function the plugin must set up everything necessary to perform 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 @@ -467,10 +487,11 @@ from the main menu. 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 -<i>false</i> from its <tt>Start()</tt> function will cause VDR to exit. +<i>false</i> from its <tt>Initialize()</tt> or <tt>Start()</tt> function will cause +VDR to exit. <p> If the plugin doesn't implement any background functionality or internationalized -texts, it doesn't need to implement this function. +texts, it doesn't need to implement either of these functions. <a name="Main menu entry"><hr><h2>Main menu entry</h2> @@ -506,7 +527,7 @@ in the call to VDR. If the user selects the main menu entry of a plugin, VDR calls the function -<!--X1.1.17--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> +<!--X1.1.17--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> <p><table><tr><td bgcolor=#F0F0F0><pre><br> virtual cOsdObject *MainMenuAction(void); </pre></td></tr></table><p> @@ -759,7 +780,8 @@ void RegisterI18n(const tI18nPhrase * const Phrases); to register them with VDR's internationalization mechanism. <p> -The call to this function must be done in the <a href="#Getting started"><tt>Start()</tt></a> function of the plugin: +The call to this function must be done in the <a href="#Getting started"><tt>Initialize()</tt></a> +or <a href="#Getting started"><tt>Start()</tt></a> function of the plugin: <p><table><tr><td bgcolor=#F0F0F0><pre><br> const tI18nPhrase Phrases[] = { @@ -1022,7 +1044,7 @@ virtual void SetAudioTrack(int Index); </pre></td></tr></table><p> <p> -<!--X1.1.15--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> +<!--X1.1.15--><table width=100%><tr><td bgcolor=#0000AA> </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 @@ -1178,9 +1200,16 @@ a <tt>cDevice</tt>: <p><table><tr><td bgcolor=#F0F0F0><pre><br> cMyReceiver *Receiver = new cMyReceiver(123); -cDevice::PrimaryDevice()->AttachReceiver(Receiver); +<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +cDevice::ActualDevice()->AttachReceiver(Receiver); +<!--X1.1.31--></td></tr></table> </pre></td></tr></table><p> +Noteh the use of <tt>cDevice::ActualDevice()</tt> here, which makes sure that +the receiver is attached to the device that actually receives the current live +video stream (this may be different from the primary device in case of <i>Transfer +Mode</i>). +<p> 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>. @@ -1303,9 +1332,7 @@ The functions to implement replaying capabilites are <p><table><tr><td bgcolor=#F0F0F0><pre><br> virtual bool HasDecoder(void) const; -<!--X1.1.14--><table width=100%><tr><td bgcolor=#0000AA> </td><td width=100%> virtual bool CanReplay(void) const; -<!--X1.1.14--></td></tr></table> virtual bool SetPlayMode(ePlayMode PlayMode); virtual void TrickSpeed(int Speed); virtual void Clear(void); @@ -1345,20 +1372,19 @@ needed. <p> <b>Initializing new devices</b> <p> +<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> A derived cDevice class shall implement a static function - -<p><table><tr><td bgcolor=#F0F0F0><pre><br> -static bool Initialize(void); -</pre></td></tr></table><p> - in which it determines whether the necessary hardware to run this sort of device is actually present in this machine (or whatever other prerequisites might be important), and then creates as many device objects as necessary. See <tt>VDR/dvbdevice.c</tt> for the implementation of the <tt>cDvbDevice</tt> initialize function. <p> -A plugin that adds devices to a VDR instance shall call this initializing -function from its <a href="#Getting started"><tt>Start()</tt></a> function. +A plugin that adds devices to a VDR instance shall call this +function from its <a href="#Getting started"><tt>Initialize()</tt></a> function +to make sure other plugins that may need to have access to all available devices +will see them in their <a href="#Getting started"><tt>Start()</tt></a> function. +<!--X1.1.31--></td></tr></table> <p> Nothing needs to be done to shut down the devices. VDR will automatically shut down (delete) all devices when the program terminates. It is therefore @@ -1476,7 +1502,7 @@ the incoming data (by calling your <tt>Action()</tt> function). In case you need to do any other setup steps, like opening a file or initializing member variables, you should do so before calling <tt>Start()</tt>. <p> -<!--X1.1.27--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +<!--X1.1.27--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> If your remote control for some reason can't work (maybe because it was unable to open some file handle it requires) it can implement the virtual function |