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

Improved cDvbDevice::GetOsdSize()

This commit is contained in:
Klaus Schmidinger 2009-06-01 14:56:28 +02:00
parent 78d2fd3d0e
commit e639e3a76a
6 changed files with 37 additions and 21 deletions

View File

@ -673,6 +673,7 @@ Oliver Endriss <o.endriss@gmx.de>
for reporting chirping sound disturbences at editing points in TS recordings for reporting chirping sound disturbences at editing points in TS recordings
for reporting broken index generation in TS recordings after a buffer overflow for reporting broken index generation in TS recordings after a buffer overflow
for fixing the way the OSD size is determined on full featured DVB cards for fixing the way the OSD size is determined on full featured DVB cards
for his input on calculating the Aspect factor in GetOsdSize()
Reinhard Walter Buchner <rw.buchner@freenet.de> Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf' for adding some satellites to 'sources.conf'
@ -1221,6 +1222,8 @@ Reinhard Nissl <rnissl@gmx.de>
for reporting a call to close(-1) in cUnbufferedFile::Close() for reporting a call to close(-1) in cUnbufferedFile::Close()
for reporting a possible problem in handling the length of DiSEqC command sequences for reporting a possible problem in handling the length of DiSEqC command sequences
for fixing cOsdMenu::Display() in case the menu size has changed for fixing cOsdMenu::Display() in case the menu size has changed
for suggesting to change the type of the Aspect parameter of GetVideoSize()
to 'double'
Richard Robson <richard_robson@beeb.net> Richard Robson <richard_robson@beeb.net>
for reporting freezing replay if a timer starts while in Transfer Mode from the for reporting freezing replay if a timer starts while in Transfer Mode from the

View File

@ -6084,7 +6084,11 @@ Video Disk Recorder Revision History
been introduced (suggested by Rolf Ahrenberg). Plugin authors should been introduced (suggested by Rolf Ahrenberg). Plugin authors should
implement this function in classes derived from cDevice, if they are able implement this function in classes derived from cDevice, if they are able
to replay video. cDevice::GetVideoSize() still exists and should return the to replay video. cDevice::GetVideoSize() still exists and should return the
actual size of the video material that is currently replayed. actual size of the video material that is currently replayed. Note that
because of the many possible aspect ratios for video material, the type
of the Aspect parameter of GetVideoSize() has been changed to 'double'
(suggested by Reinhard Nissl). Thanks to Oliver Endriss for his input on
calculating the Aspect factor in GetOsdSize().
- Fixed the way the OSD size is determined on full featured DVB cards (thanks - Fixed the way the OSD size is determined on full featured DVB cards (thanks
to Oliver Endriss). to Oliver Endriss).
- Increased MAXOSDHEIGHT to 1200 (suggested by Nicolas Huillard). - Increased MAXOSDHEIGHT to 1200 (suggested by Nicolas Huillard).

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 2.19 2009/05/09 10:02:58 kls Exp $ * $Id: device.c 2.20 2009/06/01 14:08:45 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -389,11 +389,11 @@ eVideoSystem cDevice::GetVideoSystem(void)
return vsPAL; return vsPAL;
} }
void cDevice::GetVideoSize(int &Width, int &Height, eVideoAspect &Aspect) void cDevice::GetVideoSize(int &Width, int &Height, double &Aspect)
{ {
Width = 0; Width = 0;
Height = 0; Height = 0;
Aspect = va4_3; Aspect = 1.0;
} }
void cDevice::GetOsdSize(int &Width, int &Height, double &Aspect) void cDevice::GetOsdSize(int &Width, int &Height, double &Aspect)

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 2.12 2009/05/08 13:39:08 kls Exp $ * $Id: device.h 2.13 2009/06/01 14:07:55 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -56,11 +56,6 @@ enum eVideoSystem { vsPAL,
vsNTSC vsNTSC
}; };
enum eVideoAspect { va4_3,
va16_9,
va221_1
};
extern const char *VideoAspectString[]; extern const char *VideoAspectString[];
enum eVideoDisplayFormat { vdfPanAndScan, enum eVideoDisplayFormat { vdfPanAndScan,
@ -384,17 +379,20 @@ public:
virtual eVideoSystem GetVideoSystem(void); virtual eVideoSystem GetVideoSystem(void);
///< Returns the video system of the currently displayed material ///< Returns the video system of the currently displayed material
///< (default is PAL). ///< (default is PAL).
virtual void GetVideoSize(int &Width, int &Height, eVideoAspect &Aspect); virtual void GetVideoSize(int &Width, int &Height, double &Aspect);
///< Returns the With, Height and Aspect ratio of the currently ///< Returns the With, Height and Aspect ratio of the currently
///< displayed material. The data returned by this function is ///< displayed material. The data returned by this function is
///< only used for informational purposes (if any). ///< only used for informational purposes (if any). Width and
///< The default implementation returns 0 for Width and Height. ///< Height are given in pixel (e.g. 720x576) and Aspect is
///< e.g. 1.3333x33 for a 4:3 broadcast, or 1.77778 for 16:9.
///< The default implementation returns 0 for Width and Height
///< and 1.0 for Aspect.
virtual void GetOsdSize(int &Width, int &Height, double &Aspect); virtual void GetOsdSize(int &Width, int &Height, double &Aspect);
///< Returns the With, Height and Aspect ratio the OSD should use ///< Returns the With, Height and Aspect ratio the OSD should use
///< to best fit the resolution of the output device. If Aspect ///< to best fit the resolution of the output device. If Aspect
///< is not 1.0, the OSD may take this as a hint to stretch its ///< is not 1.0, the OSD may take this as a hint to stretch its
///< graphics in a way that, e.g., a square area will actually ///< graphics in a way that, e.g., a circle will actually
///< show up as a square on the screen, and not as a rectangle. ///< show up as a circle on the screen, and not as an ellipse.
///< Values greater than 1.0 will stretch the graphics in the ///< Values greater than 1.0 will stretch the graphics in the
///< vertical direction. Note that the OSD is not guaranteed to ///< vertical direction. Note that the OSD is not guaranteed to
///< actually use this hint. ///< actually use this hint.

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 2.19 2009/06/01 11:42:06 kls Exp $ * $Id: dvbdevice.c 2.20 2009/06/01 14:44:54 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -748,14 +748,19 @@ eVideoSystem cDvbDevice::GetVideoSystem(void)
return VideoSystem; return VideoSystem;
} }
void cDvbDevice::GetVideoSize(int &Width, int &Height, eVideoAspect &Aspect) void cDvbDevice::GetVideoSize(int &Width, int &Height, double &Aspect)
{ {
if (fd_video >= 0) { if (fd_video >= 0) {
video_size_t vs; video_size_t vs;
if (ioctl(fd_video, VIDEO_GET_SIZE, &vs) == 0) { if (ioctl(fd_video, VIDEO_GET_SIZE, &vs) == 0) {
Width = vs.w; Width = vs.w;
Height = vs.h; Height = vs.h;
Aspect = eVideoAspect(vs.aspect_ratio); switch (vs.aspect_ratio) {
default:
case VIDEO_FORMAT_4_3: Aspect = 4.0 / 3.0; break;
case VIDEO_FORMAT_16_9: Aspect = 16.0 / 9.0; break;
case VIDEO_FORMAT_221_1: Aspect = 2.21; break;
}
return; return;
} }
else else
@ -774,7 +779,13 @@ void cDvbDevice::GetOsdSize(int &Width, int &Height, double &Aspect)
Height = 576; // PAL Height = 576; // PAL
else else
Height = 480; // NTSC Height = 480; // NTSC
Aspect = 1.0; switch (Setup.VideoFormat ? vs.aspect_ratio : VIDEO_FORMAT_4_3) {
default:
case VIDEO_FORMAT_4_3: Aspect = 4.0 / 3.0; break;
case VIDEO_FORMAT_221_1: // FF DVB cards only distinguish between 4:3 and 16:9
case VIDEO_FORMAT_16_9: Aspect = 16.0 / 9.0; break;
}
Aspect /= double(Width) / Height;
return; return;
} }
else else

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 2.6 2009/06/01 11:20:32 kls Exp $ * $Id: dvbdevice.h 2.7 2009/06/01 14:09:05 kls Exp $
*/ */
#ifndef __DVBDEVICE_H #ifndef __DVBDEVICE_H
@ -108,7 +108,7 @@ public:
virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat); virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat);
virtual void SetVideoFormat(bool VideoFormat16_9); virtual void SetVideoFormat(bool VideoFormat16_9);
virtual eVideoSystem GetVideoSystem(void); virtual eVideoSystem GetVideoSystem(void);
virtual void GetVideoSize(int &Width, int &Height, eVideoAspect &Aspect); virtual void GetVideoSize(int &Width, int &Height, double &Aspect);
virtual void GetOsdSize(int &Width, int &Height, double &Aspect); virtual void GetOsdSize(int &Width, int &Height, double &Aspect);
// Track facilities // Track facilities