diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2003-08-15 13:05:50 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2003-08-15 13:05:50 +0200 |
commit | 26ffdd1c8361f714fff78fd746f209f386e6b997 (patch) | |
tree | 8ba5c9cd172cb4c93a17e4ca1c0b3d84d64e7689 | |
parent | 71283dbeb112e182a39a59734a5ce451934ac581 (diff) | |
download | vdr-26ffdd1c8361f714fff78fd746f209f386e6b997.tar.gz vdr-26ffdd1c8361f714fff78fd746f209f386e6b997.tar.bz2 |
Fixed scaling SPU bitmaps in Letterbox mode when playing NTSC material
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | device.c | 7 | ||||
-rw-r--r-- | device.h | 9 | ||||
-rw-r--r-- | dvbdevice.c | 15 | ||||
-rw-r--r-- | dvbdevice.h | 3 | ||||
-rw-r--r-- | dvbspu.c | 8 |
6 files changed, 37 insertions, 7 deletions
@@ -2291,3 +2291,5 @@ Video Disk Recorder Revision History the "Channels" menu (thanks to Mirko Günther for reporting this one). - Made the plugin library directory configurable via Make.config (thanks to Ludwig Nussel). +- Fixed scaling SPU bitmaps in Letterbox mode when playing NTSC material. + In order to do this, the cDevice was given a new member function GetVideoSystem(). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.46 2003/08/02 11:44:28 kls Exp $ + * $Id: device.c 1.47 2003/08/15 12:34:36 kls Exp $ */ #include "device.h" @@ -216,6 +216,11 @@ void cDevice::SetVideoFormat(bool VideoFormat16_9) { } +eVideoSystem cDevice::GetVideoSystem(void) +{ + return vsPAL; +} + //#define PRINTPIDS(s) { char b[500]; char *q = b; q += sprintf(q, "%d %s ", CardIndex(), s); for (int i = 0; i < MAXPIDHANDLES; i++) q += sprintf(q, " %s%4d %d", i == ptOther ? "* " : "", pidHandles[i].pid, pidHandles[i].used); dsyslog(b); } #define PRINTPIDS(s) @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 1.33 2003/05/11 08:50:04 kls Exp $ + * $Id: device.h 1.34 2003/08/15 13:05:50 kls Exp $ */ #ifndef __DEVICE_H @@ -45,6 +45,10 @@ enum ePlayMode { pmNone, // audio/video from decoder // KNOWN TO YOUR PLAYER. }; +enum eVideoSystem { vsPAL, + vsNTSC + }; + class cOsdBase; class cChannel; class cPlayer; @@ -248,6 +252,9 @@ public: virtual void SetVideoFormat(bool VideoFormat16_9); ///< Sets the output video format to either 16:9 or 4:3 (only useful ///< if this device has an MPEG decoder). + virtual eVideoSystem GetVideoSystem(void); + ///< Returns the video system of the currently displayed material + ///< (default is PAL). // Audio facilities diff --git a/dvbdevice.c b/dvbdevice.c index 7fc50a71..34d55829 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.60 2003/05/24 13:23:51 kls Exp $ + * $Id: dvbdevice.c 1.61 2003/08/15 13:03:41 kls Exp $ */ #include "dvbdevice.h" @@ -525,6 +525,19 @@ void cDvbDevice::SetVideoFormat(bool VideoFormat16_9) CHECK(ioctl(fd_video, VIDEO_SET_FORMAT, VideoFormat16_9 ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3)); } +eVideoSystem cDvbDevice::GetVideoSystem(void) +{ + eVideoSystem VideoSytem = vsPAL; + video_size_t vs; + if (ioctl(fd_video, VIDEO_GET_SIZE, &vs) == 0) { + if (vs.h == 480 || vs.h == 240) + VideoSytem = vsNTSC; + } + else + LOG_ERROR; + return VideoSytem; +} + // ptAudio ptVideo ptPcr ptTeletext ptDolby ptOther dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_PCR, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER }; diff --git a/dvbdevice.h b/dvbdevice.h index 6bcbc724..aab20fdd 100644 --- a/dvbdevice.h +++ b/dvbdevice.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.h 1.21 2003/05/02 12:21:51 kls Exp $ + * $Id: dvbdevice.h 1.22 2003/08/15 12:34:55 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -80,6 +80,7 @@ public: public: virtual void SetVideoFormat(bool VideoFormat16_9); + virtual eVideoSystem GetVideoSystem(void); // Audio facilities @@ -8,7 +8,7 @@ * * parts of this file are derived from the OMS program. * - * $Id: dvbspu.c 1.3 2002/10/26 10:46:49 kls Exp $ + * $Id: dvbspu.c 1.4 2003/08/15 13:04:39 kls Exp $ */ #include <assert.h> @@ -301,8 +301,10 @@ void cDvbSpuDecoder::clearHighlight(void) int cDvbSpuDecoder::ScaleYcoord(int value) { - if (scaleMode == eSpuLetterBox) - return lround((value * 3.0) / 4.0 + 72.0); + if (scaleMode == eSpuLetterBox) { + int offset = cDevice::PrimaryDevice()->GetVideoSystem() == vsPAL ? 72 : 60; + return lround((value * 3.0) / 4.0) + offset; + } else return value; } |