summaryrefslogtreecommitdiff
path: root/device.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-08-16 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-08-16 18:00:00 +0200
commited643353b100bee75459c4ef2d0330e7a04e1f2a (patch)
tree8a424eba464677a71309e1125ce4e7acef58607e /device.h
parent527748826c8d3cfacff8a7ab3fda9551c1182590 (diff)
downloadvdr-patch-lnbsharing-ed643353b100bee75459c4ef2d0330e7a04e1f2a.tar.gz
vdr-patch-lnbsharing-ed643353b100bee75459c4ef2d0330e7a04e1f2a.tar.bz2
Version 1.1.7vdr-1.1.7
- Adapted VDR to the NEWSTRUCT driver. To use the new driver, compile VDR with 'make NEWSTRUCT=1' (thanks to Holger Wächtler for some valuable advice). By default it currently still uses the old driver. - Added some missing #includes (thanks to Martin Hammerschmid). - Changed the log error message "can't record MPEG1!" to "error in data stream!", since the mentioning of MPEG1 has irritated many people. - Consistently using malloc/free and new/delete (thanks to Andreas Schultz). - Temporarily made cDevice::ProvidesCa() virtual (Andreas Schultz needs this in his DXR3 plugin). - cDevice no longer exposes a file handle to cPlayer. A derived cPlayer class can now call DevicePoll() to see whether the replay device is ready for further data. A derived cDevice class must implement Poll() and shall check if any of its file handles is ready for data. - Implemented several replay modes to allow players that play only audio (thanks to Stefan Huelswitt). - Improved cCondVar::Wait() and implemented cCondVar::TimedWait() (thanks to Stefan Huelswitt). - VDR no longer gives up if there is no DVB device. It continues to work if there is at least one device, either a DVB device found by the core VDR code itself, or a device implemented by a plugin.
Diffstat (limited to 'device.h')
-rw-r--r--device.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/device.h b/device.h
index 4610988..14d8ec5 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.5 2002/08/04 14:02:19 kls Exp $
+ * $Id: device.h 1.9 2002/08/16 08:52:27 kls Exp $
*/
#ifndef __DEVICE_H
@@ -26,6 +26,23 @@
enum eSetChannelResult { scrOk, scrNoTransfer, scrFailed };
+enum ePlayMode { pmNone, // audio/video from decoder
+ pmAudioVideo, // audio/video from player
+ pmAudioOnly, // audio only from player, video from decoder
+ pmExtern_THIS_SHOULD_BE_AVOIDED
+ // external player (e.g. MPlayer), release the device
+ // WARNING: USE THIS MODE ONLY AS A LAST RESORT, IF YOU
+ // ABSOLUTELY, POSITIVELY CAN'T IMPLEMENT YOUR PLAYER
+ // THE WAY IT IS SUPPOSED TO WORK. FORCING THE DEVICE
+ // TO RELEASE ITS FILES HANDLES (OR WHATEVER RESOURCES
+ // IT MAY USE) TO ALLOW AN EXTERNAL PLAYER TO ACCESS
+ // THEM MEANS THAT SUCH A PLAYER WILL NEED TO HAVE
+ // DETAILED KNOWLEDGE ABOUT THE INTERNALS OF THE DEVICE
+ // IN USE. AS A CONSEQUENCE, YOUR PLAYER MAY NOT WORK
+ // IF A PARTICULAR VDR INSTALLATION USES A DEVICE NOT
+ // KNOWN TO YOUR PLAYER.
+ };
+
class cChannel;
class cPlayer;
class cReceiver;
@@ -97,7 +114,9 @@ public:
bool IsPrimaryDevice(void) const { return this == primaryDevice; }
int CardIndex(void) const { return cardIndex; }
// Returns the card index of this device (0 ... MAXDEVICES - 1).
- int ProvidesCa(int Ca);
+ virtual int ProvidesCa(int Ca);
+ //XXX TODO temporarily made this function virtual - until a general
+ //XXX mechanism has been implemented
// Checks whether this device provides the given value in its
// caCaps. Returns 0 if the value is not provided, 1 if only this
// value is provided, and > 1 if this and other values are provided.
@@ -188,11 +207,9 @@ public:
private:
cPlayer *player;
protected:
- virtual int SetPlayMode(bool On);
- // Sets the device into play mode (On = true) or normal
- // viewing mode (On = false). If On is true, it may return a file
- // handle that a player can use to poll this device when replaying.
- //XXX TODO should be implemented differently
+ virtual bool SetPlayMode(ePlayMode PlayMode);
+ // Sets the device into the given play mode.
+ // Returns true if the operation was successful.
public:
virtual void TrickSpeed(int Speed);
// Sets the device into a mode where replay is done slower.
@@ -209,6 +226,12 @@ public:
// Turns off audio while replaying.
virtual void StillPicture(const uchar *Data, int Length);
// Displays the given I-frame as a still picture.
+ virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
+ // Returns true if the device itself or any of the file handles in
+ // Poller is ready for further action.
+ // If TimeoutMs is not zero, the device will wait up to the given number
+ // of milleseconds before returning in case there is no immediate
+ // need for data.
virtual int PlayVideo(const uchar *Data, int Length);
// Actually plays the given data block as video. The data must be
// part of a PES (Packetized Elementary Stream) which can contain