Hi All,
This is an improved version of my patch to fix problems with rounding
errors caused by the X-Servers rounding of the DisplaySize configuration
parameter.
I have tidied us some more of the Aspect setting code so that:
1. Fill mode works the same from the Global settings and the "W" key.
The fill mode is especially useful when using a 4:3 TV as
output device.
2. The Global settings now match the "W" keys operation.
3. The OSD size is set corectly in Fill and other modes.
4. I have included Robert Clark's patch to snap to display size.
5. Aspect setting now remains inforce when changing channel.
Pevious info on the patch:
This patch fixes problems with rounding errors caused by the X-Servers
rounding of the DisplaySize configuration parameter.
The patch also adds a new Aspect setting "Fill" which will take the
incoming Video and "fill" the display with the picture cropping as
necessary.
In the current MythTv, the Aspect rounding errors, cause the display
size to not exactly match the incomming picture size, even when the
display has the same aspect and number of pixels as the Video being
displayed. This results in some scaling being applied to the Video
stream even when un-necessary.
On my system I am trying to set MythTv to not scale the incoming 720x576
DVB DTV image when displaying on my 720x576 TV display to improve the
display quality. This is especially necessary as an interlaced TV is
being used for output and if any scaling is used motion artifacts start
to appear.
For information the XServer rounds the DisplaySize configuration
parameter as thus:
Displaysize is set in mi/miscrinit.c
pScreen->mmWidth = (xsize * 254 + dpix * 5) / (dpix * 10);
pScreen->mmHeight = (ysize * 254 + dpiy * 5) / (dpiy * 10);
After using this patch the xorg.conf file's DisplaySize parameter can be
set to: "300 225" for 4:3 and "400 225" for 16:9.
Could someone check this code to make sure it will not break anything ?
The patch works well for me, I now have a good quality picture on my
Via EPIA M10K box with a digital TV source.
Cheers
Terry
--
Dr Terry Barnaby BEAM Ltd
Phone: +44 1454 324512 Northavon Business Center, Dean Rd
Fax: +44 1454 313172 Yate, Bristol, BS37 5NH, UK
Email: [EMAIL PROTECTED] Web: www.beam.ltd.uk
BEAM for: Visually Impaired X-Terminals, Parallel Processing,
Software Dev
"Tandems are twice the fun !"
Index: libs/libmythtv/NuppelVideoPlayer.cpp
===
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp,v
retrieving revision 1.401
diff -u -r1.401 NuppelVideoPlayer.cpp
--- libs/libmythtv/NuppelVideoPlayer.cpp 8 Dec 2004 04:23:16 - 1.401
+++ libs/libmythtv/NuppelVideoPlayer.cpp 10 Jan 2005 18:17:13 -
@@ -1692,7 +1692,7 @@
if (!disablevideo)
{
int dispx = 0, dispy = 0, dispw = video_width, disph = video_height;
-videoOutput->GetDrawSize(dispx, dispy, dispw, disph);
+videoOutput->GetVisibleSize(dispx, dispy, dispw, disph);
osd = new OSD(video_width, video_height, frame_interval,
osdfontname, osdccfontname, osdprefix, osdtheme,
dispx, dispy, dispw, disph);
Index: libs/libmythtv/tv_play.cpp
===
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.232
diff -u -r1.232 tv_play.cpp
--- libs/libmythtv/tv_play.cpp 29 Nov 2004 22:04:35 - 1.232
+++ libs/libmythtv/tv_play.cpp 10 Jan 2005 18:17:17 -
@@ -3381,11 +3381,13 @@
switch (letterbox)
{
-case kLetterbox_4_3: default: text = tr("4:3"); break;
+case kLetterbox_4_3: text = tr("4:3"); break;
case kLetterbox_16_9: text = tr("16:9"); break;
case kLetterbox_4_3_Zoom: text = tr("4:3 Zoom"); break;
case kLetterbox_16_9_Zoom:text = tr("16:9 Zoom"); break;
case kLetterbox_16_9_Stretch: text = tr("16:9 Stretch"); break;
+case kLetterbox_Fill: text = tr("Fill"); break;
+default: text = tr("Off"); break;
}
if (osd && !browsemode && !osd->IsRunningTreeMenu())
Index: libs/libmythtv/videooutbase.cpp
===
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/videooutbase.cpp,v
retrieving revision 1.65
diff -u -r1.65 videooutbase.cpp
--- libs/libmythtv/videooutbase.cpp 2 Dec 2004 06:29:11 - 1.65
+++ libs/libmythtv/videooutbase.cpp 10 Jan 2005 18:17:18 -
@@ -75,7 +75,7 @@
VideoOutput::VideoOutput()
{
-letterbox = -1;
+letterbox = kLetterbox_Off;
rpos = 0;
vpos = 0;
@@ -138,8 +138,8 @@
XJ_width = width;
XJ_height = height;
-XJ_aspect = aspect;
-
+AspectSet(aspect);
+
QString HorizScanMode = gConte