summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-05-11 09:01:51 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-05-11 09:01:51 +0200
commit7a0054abbd50149874823cae3f234b00fd87ca70 (patch)
tree160768042c922b61ffc95b0e9838b4ff929666b6
parent823945204cbf8e70c36ceab03ed6be37e5345338 (diff)
downloadvdr-7a0054abbd50149874823cae3f234b00fd87ca70.tar.gz
vdr-7a0054abbd50149874823cae3f234b00fd87ca70.tar.bz2
Implemented cDevice::ActualDevice()
-rw-r--r--HISTORY4
-rw-r--r--PLUGINS.html9
-rw-r--r--device.c10
-rw-r--r--device.h5
-rw-r--r--transfer.c6
-rw-r--r--transfer.h4
6 files changed, 33 insertions, 5 deletions
diff --git a/HISTORY b/HISTORY
index 4ad777f5..c9be86da 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2118,3 +2118,7 @@ Video Disk Recorder Revision History
- Implemented the CableDeliverySystemDescriptor in libdtv (thanks to Sven Grothklags)
- 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.
diff --git a/PLUGINS.html b/PLUGINS.html
index 4a2571c6..bd1a0d0f 100644
--- a/PLUGINS.html
+++ b/PLUGINS.html
@@ -1200,9 +1200,16 @@ a <tt>cDevice</tt>:
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
cMyReceiver *Receiver = new cMyReceiver(123);
-cDevice::PrimaryDevice()-&gt;AttachReceiver(Receiver);
+<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+cDevice::ActualDevice()-&gt;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>.
diff --git a/device.c b/device.c
index 9346d3b5..b248114a 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.41 2003/05/03 13:40:15 kls Exp $
+ * $Id: device.c 1.42 2003/05/11 08:53:09 kls Exp $
*/
#include "device.h"
@@ -130,6 +130,14 @@ cSpuDecoder *cDevice::GetSpuDecoder(void)
return NULL;
}
+cDevice *cDevice::ActualDevice(void)
+{
+ cDevice *d = cTransferControl::ReceiverDevice();
+ if (!d)
+ d = PrimaryDevice();
+ return d;
+}
+
cDevice *cDevice::GetDevice(int Index)
{
return (0 <= Index && Index < numDevices) ? device[Index] : NULL;
diff --git a/device.h b/device.h
index d2cc4f83..a41312a2 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h 1.32 2003/05/03 13:35:55 kls Exp $
+ * $Id: device.h 1.33 2003/05/11 08:50:04 kls Exp $
*/
#ifndef __DEVICE_H
@@ -75,6 +75,9 @@ public:
///< \return true if this was possible.
static cDevice *PrimaryDevice(void) { return primaryDevice; }
///< Returns the primary device.
+ static cDevice *ActualDevice(void);
+ ///< Returns the actual receiving device in case of Transfer Mode, or the
+ ///< primary device otherwise.
static cDevice *GetDevice(int Index);
///< Gets the device with the given Index.
///< \param Index must be in the range 0..numDevices-1.
diff --git a/transfer.c b/transfer.c
index 9354e58f..cdde5520 100644
--- a/transfer.c
+++ b/transfer.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: transfer.c 1.11 2003/03/30 12:52:11 kls Exp $
+ * $Id: transfer.c 1.12 2003/05/11 08:48:05 kls Exp $
*/
#include "transfer.h"
@@ -179,13 +179,17 @@ void cTransfer::SetAudioTrack(int Index)
// --- cTransferControl ------------------------------------------------------
+cDevice *cTransferControl::receiverDevice = NULL;
+
cTransferControl::cTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2)
:cControl(transfer = new cTransfer(VPid, APid1, APid2, DPid1, DPid2), true)
{
ReceiverDevice->AttachReceiver(transfer);
+ receiverDevice = ReceiverDevice;
}
cTransferControl::~cTransferControl()
{
+ receiverDevice = NULL;
delete transfer;
}
diff --git a/transfer.h b/transfer.h
index d94c85ab..5ecb96ad 100644
--- a/transfer.h
+++ b/transfer.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: transfer.h 1.3 2002/10/12 12:59:05 kls Exp $
+ * $Id: transfer.h 1.4 2003/05/11 08:48:36 kls Exp $
*/
#ifndef __TRANSFER_H
@@ -40,10 +40,12 @@ public:
class cTransferControl : public cControl {
private:
cTransfer *transfer;
+ static cDevice *receiverDevice;
public:
cTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2);
~cTransferControl();
virtual void Hide(void) {}
+ static cDevice *ReceiverDevice(void) { return receiverDevice; }
};
#endif //__TRANSFER_H