1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed scaling SPU bitmaps in Letterbox mode when playing NTSC material

This commit is contained in:
Klaus Schmidinger 2003-08-15 13:05:50 +02:00
parent 71283dbeb1
commit 26ffdd1c83
6 changed files with 37 additions and 7 deletions

View File

@ -2291,3 +2291,5 @@ Video Disk Recorder Revision History
the "Channels" menu (thanks to Mirko Günther for reporting this one). the "Channels" menu (thanks to Mirko Günther for reporting this one).
- Made the plugin library directory configurable via Make.config (thanks to - Made the plugin library directory configurable via Make.config (thanks to
Ludwig Nussel). 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().

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #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) { 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) #define PRINTPIDS(s)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DEVICE_H
@ -45,6 +45,10 @@ enum ePlayMode { pmNone, // audio/video from decoder
// KNOWN TO YOUR PLAYER. // KNOWN TO YOUR PLAYER.
}; };
enum eVideoSystem { vsPAL,
vsNTSC
};
class cOsdBase; class cOsdBase;
class cChannel; class cChannel;
class cPlayer; class cPlayer;
@ -248,6 +252,9 @@ public:
virtual void SetVideoFormat(bool VideoFormat16_9); virtual void SetVideoFormat(bool VideoFormat16_9);
///< Sets the output video format to either 16:9 or 4:3 (only useful ///< Sets the output video format to either 16:9 or 4:3 (only useful
///< if this device has an MPEG decoder). ///< 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 // Audio facilities

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #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)); 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 // 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 }; dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_PCR, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER };

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DVBDEVICE_H
@ -80,6 +80,7 @@ public:
public: public:
virtual void SetVideoFormat(bool VideoFormat16_9); virtual void SetVideoFormat(bool VideoFormat16_9);
virtual eVideoSystem GetVideoSystem(void);
// Audio facilities // Audio facilities

View File

@ -8,7 +8,7 @@
* *
* parts of this file are derived from the OMS program. * 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> #include <assert.h>
@ -301,8 +301,10 @@ void cDvbSpuDecoder::clearHighlight(void)
int cDvbSpuDecoder::ScaleYcoord(int value) int cDvbSpuDecoder::ScaleYcoord(int value)
{ {
if (scaleMode == eSpuLetterBox) if (scaleMode == eSpuLetterBox) {
return lround((value * 3.0) / 4.0 + 72.0); int offset = cDevice::PrimaryDevice()->GetVideoSystem() == vsPAL ? 72 : 60;
return lround((value * 3.0) / 4.0) + offset;
}
else else
return value; return value;
} }