From ed643353b100bee75459c4ef2d0330e7a04e1f2a Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 16 Aug 2002 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.1.7=20-=20Adapted=20VDR=20to=20the=20NEWSTR?= =?UTF-8?q?UCT=20driver.=20To=20use=20the=20new=20driver,=20compile=20VDR?= =?UTF-8?q?=20with=20=20=20'make=20NEWSTRUCT=3D1'=20(thanks=20to=20Holger?= =?UTF-8?q?=20W=C3=A4chtler=20for=20some=20valuable=20advice).=20=20=20By?= =?UTF-8?q?=20default=20it=20currently=20still=20uses=20the=20old=20driver?= =?UTF-8?q?.=20-=20Added=20some=20missing=20#includes=20(thanks=20to=20Mar?= =?UTF-8?q?tin=20Hammerschmid).=20-=20Changed=20the=20log=20error=20messag?= =?UTF-8?q?e=20"can't=20record=20MPEG1!"=20to=20"error=20in=20data=20strea?= =?UTF-8?q?m!",=20=20=20since=20the=20mentioning=20of=20MPEG1=20has=20irri?= =?UTF-8?q?tated=20many=20people.=20-=20Consistently=20using=20malloc/free?= =?UTF-8?q?=20and=20new/delete=20(thanks=20to=20Andreas=20Schultz).=20-=20?= =?UTF-8?q?Temporarily=20made=20cDevice::ProvidesCa()=20virtual=20(Andreas?= =?UTF-8?q?=20Schultz=20needs=20this=20=20=20in=20his=20DXR3=20plugin).=20?= =?UTF-8?q?-=20cDevice=20no=20longer=20exposes=20a=20file=20handle=20to=20?= =?UTF-8?q?cPlayer.=20A=20derived=20cPlayer=20class=20=20=20can=20now=20ca?= =?UTF-8?q?ll=20DevicePoll()=20to=20see=20whether=20the=20replay=20device?= =?UTF-8?q?=20is=20ready=20for=20=20=20further=20data.=20A=20derived=20cDe?= =?UTF-8?q?vice=20class=20must=20implement=20Poll()=20and=20shall=20=20=20?= =?UTF-8?q?check=20if=20any=20of=20its=20file=20handles=20is=20ready=20for?= =?UTF-8?q?=20data.=20-=20Implemented=20several=20replay=20modes=20to=20al?= =?UTF-8?q?low=20players=20that=20play=20only=20audio=20(thanks=20=20=20to?= =?UTF-8?q?=20Stefan=20Huelswitt).=20-=20Improved=20cCondVar::Wait()=20and?= =?UTF-8?q?=20implemented=20cCondVar::TimedWait()=20(thanks=20to=20=20=20S?= =?UTF-8?q?tefan=20Huelswitt).=20-=20VDR=20no=20longer=20gives=20up=20if?= =?UTF-8?q?=20there=20is=20no=20DVB=20device.=20It=20continues=20to=20work?= =?UTF-8?q?=20if=20=20=20there=20is=20at=20least=20one=20device,=20either?= =?UTF-8?q?=20a=20DVB=20device=20found=20by=20the=20core=20VDR=20code=20?= =?UTF-8?q?=20=20itself,=20or=20a=20device=20implemented=20by=20a=20plugin?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device.h | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'device.h') 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 -- cgit v1.2.3