From 4e22b621927c7c17e2cb5d77ee1bf52335f4ba5b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Wed, 25 Dec 2013 13:36:51 +0100 Subject: [PATCH] cDevice::TrickSpeed() now has an additional parameter named Forward --- CONTRIBUTORS | 1 + HISTORY | 6 ++++++ PLUGINS.html | 2 +- PLUGINS/src/dvbsddevice/HISTORY | 4 ++++ PLUGINS/src/dvbsddevice/dvbsddevice.c | 4 ++-- PLUGINS/src/dvbsddevice/dvbsdffdevice.c | 4 ++-- PLUGINS/src/dvbsddevice/dvbsdffdevice.h | 4 ++-- device.c | 4 ++-- device.h | 7 ++++--- dvbplayer.c | 4 ++-- player.h | 4 ++-- 11 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 0f7ebe4b..4d74bf9f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3225,3 +3225,4 @@ Guido Cordaro Thomas Reufer for making it clear that the Data parameter in cDevice::StillPicture() may point to a series of packets, not just a single one + for suggesting to add an additional parameter named Forward to cDevice::TrickSpeed() diff --git a/HISTORY b/HISTORY index 2bfb1f10..bdc1251c 100644 --- a/HISTORY +++ b/HISTORY @@ -8078,3 +8078,9 @@ Video Disk Recorder Revision History - Added handling UTF-8 'umlaut' characters to cKbdRemote (thanks to Lars Hanisch). - Made it clear that the Data parameter in cDevice::StillPicture() may point to a series of packets, not just a single one (thanks to Thomas Reufer). +- cDevice::TrickSpeed() now has an additional parameter named Forward, which indicates + the direction in which replay is being done (suggested by Thomas Reufer). This + information may be necessary for some output devices in order to properly implement + trick modes. Authors of plugins that implement output devices will need to add this + parameter to their derived cDevice class, regardless of whether they will make use + of it or not. diff --git a/PLUGINS.html b/PLUGINS.html index 71d840ea..b912301f 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -1877,7 +1877,7 @@ virtual bool SetPlayMode(ePlayMode PlayMode); virtual int64_t GetSTC(void); virtual bool IsPlayingVideo(void) const; virtual bool HasIBPTrickSpeed(void); -virtual void TrickSpeed(int Speed); +virtual void TrickSpeed(int Speed, bool Forward); virtual void Clear(void); virtual void Play(void); virtual void Freeze(void); diff --git a/PLUGINS/src/dvbsddevice/HISTORY b/PLUGINS/src/dvbsddevice/HISTORY index cb6753ab..a374dc35 100644 --- a/PLUGINS/src/dvbsddevice/HISTORY +++ b/PLUGINS/src/dvbsddevice/HISTORY @@ -50,3 +50,7 @@ VDR Plugin 'dvbsddevice' Revision History - Fixed handling the -o option (short form of --outputonly; problem reported by Mario Edelmann). + +2014-01-01: Version 2.1.1 + +- cDevice::TrickSpeed() now has an additional parameter named Forward. diff --git a/PLUGINS/src/dvbsddevice/dvbsddevice.c b/PLUGINS/src/dvbsddevice/dvbsddevice.c index 3f57f23b..d398b152 100644 --- a/PLUGINS/src/dvbsddevice/dvbsddevice.c +++ b/PLUGINS/src/dvbsddevice/dvbsddevice.c @@ -3,14 +3,14 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: dvbsddevice.c 3.1 2013/08/22 08:20:18 kls Exp $ + * $Id: dvbsddevice.c 3.2 2013/12/25 13:27:00 kls Exp $ */ #include #include #include "dvbsdffdevice.h" -static const char *VERSION = "2.0.1"; +static const char *VERSION = "2.1.1"; static const char *DESCRIPTION = "SD Full Featured DVB device"; class cPluginDvbsddevice : public cPlugin { diff --git a/PLUGINS/src/dvbsddevice/dvbsdffdevice.c b/PLUGINS/src/dvbsddevice/dvbsdffdevice.c index 4e98cdda..1f197b4d 100644 --- a/PLUGINS/src/dvbsddevice/dvbsdffdevice.c +++ b/PLUGINS/src/dvbsddevice/dvbsdffdevice.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: dvbsdffdevice.c 2.35 2013/02/17 13:16:18 kls Exp $ + * $Id: dvbsdffdevice.c 3.1 2013/12/25 13:27:00 kls Exp $ */ #include "dvbsdffdevice.h" @@ -593,7 +593,7 @@ int64_t cDvbSdFfDevice::GetSTC(void) return -1; } -void cDvbSdFfDevice::TrickSpeed(int Speed) +void cDvbSdFfDevice::TrickSpeed(int Speed, bool Forward) { if (fd_video >= 0) CHECK(ioctl(fd_video, VIDEO_SLOWMOTION, Speed)); diff --git a/PLUGINS/src/dvbsddevice/dvbsdffdevice.h b/PLUGINS/src/dvbsddevice/dvbsdffdevice.h index bbf2ec21..0611cab3 100644 --- a/PLUGINS/src/dvbsddevice/dvbsdffdevice.h +++ b/PLUGINS/src/dvbsddevice/dvbsdffdevice.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: dvbsdffdevice.h 2.16 2013/02/17 13:16:29 kls Exp $ + * $Id: dvbsdffdevice.h 3.1 2013/12/25 13:27:00 kls Exp $ */ #ifndef __DVBSDFFDEVICE_H @@ -94,7 +94,7 @@ protected: virtual int PlayTsAudio(const uchar *Data, int Length); public: virtual int64_t GetSTC(void); - virtual void TrickSpeed(int Speed); + virtual void TrickSpeed(int Speed, bool Forward); virtual void Clear(void); virtual void Play(void); virtual void Freeze(void); diff --git a/device.c b/device.c index a5afcfcc..a028b8a6 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 3.3 2013/08/22 10:28:55 kls Exp $ + * $Id: device.c 3.4 2013/12/25 13:20:19 kls Exp $ */ #include "device.h" @@ -1121,7 +1121,7 @@ int64_t cDevice::GetSTC(void) return -1; } -void cDevice::TrickSpeed(int Speed) +void cDevice::TrickSpeed(int Speed, bool Forward) { } diff --git a/device.h b/device.h index 16aa59df..acfe0b4b 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 3.4 2013/12/25 13:08:44 kls Exp $ + * $Id: device.h 3.5 2013/12/25 13:19:58 kls Exp $ */ #ifndef __DEVICE_H @@ -698,10 +698,11 @@ public: virtual bool HasIBPTrickSpeed(void) { return false; } ///< Returns true if this device can handle all frames in 'fast forward' ///< trick speeds. - virtual void TrickSpeed(int Speed); + virtual void TrickSpeed(int Speed, bool Forward); ///< Sets the device into a mode where replay is done slower. ///< Every single frame shall then be displayed the given number of - ///< times. + ///< times. Forward is true if replay is done in the normal (forward) + ///< direction, false if it is done reverse. ///< The cDvbPlayer uses the following values for the various speeds: ///< 1x 2x 3x ///< Fast Forward 6 3 1 diff --git a/dvbplayer.c b/dvbplayer.c index dc206a39..1858cb98 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 2.35 2013/03/08 13:44:19 kls Exp $ + * $Id: dvbplayer.c 3.1 2013/12/25 13:24:07 kls Exp $ */ #include "dvbplayer.h" @@ -324,7 +324,7 @@ void cDvbPlayer::TrickSpeed(int Increment) int sp = (Speeds[nts] > 0) ? Mult / Speeds[nts] : -Speeds[nts] * Mult; if (sp > MAX_VIDEO_SLOWMOTION) sp = MAX_VIDEO_SLOWMOTION; - DeviceTrickSpeed(sp); + DeviceTrickSpeed(sp, playDir == pdForward); } } diff --git a/player.h b/player.h index 01bc958c..9ec47faa 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 2.6 2012/04/28 13:04:17 kls Exp $ + * $Id: player.h 3.1 2013/12/25 13:25:02 kls Exp $ */ #ifndef __PLAYER_H @@ -27,7 +27,7 @@ protected: bool DeviceFlush(int TimeoutMs = 0) { return device ? device->Flush(TimeoutMs) : true; } bool DeviceHasIBPTrickSpeed(void) { return device ? device->HasIBPTrickSpeed() : false; } bool DeviceIsPlayingVideo(void) { return device ? device->IsPlayingVideo() : false; } - void DeviceTrickSpeed(int Speed) { if (device) device->TrickSpeed(Speed); } + void DeviceTrickSpeed(int Speed, bool Forward) { if (device) device->TrickSpeed(Speed, Forward); } void DeviceClear(void) { if (device) device->Clear(); } void DevicePlay(void) { if (device) device->Play(); } void DeviceFreeze(void) { if (device) device->Freeze(); }