[mythtv] [PATCH] Video display resolution override
John Patrick Poet
john at BlueSkyTours.com
Sat Jul 3 23:58:21 EDT 2004
This is my first Myth patch with more than a couple of lines. It is
against the CVS as of July 3, 2004.
It takes a patch by Doug Larrick to the next level. His patch allowed
for a separate video display resolution from that used by the GUI. As
with Doug's patch, this one places the user options under the main
Appearances setup menu.
This patch allows for up to two alternate display resolutions to be
specified, which are triggered by the resolution of the source video.
For example, my default "display resolution" is 1920x1080, but if a
720x480 "video resolution" is detected, then the display is switched to
It also allows for the display aspect ratio to be overridden. This is
merely a toggle. If X's DisplaySize indicates an aspect of 4:3, and
this toggle is enabled, then a display aspect ratio of 16:9 will
actually be used -- and visa-versa. This allows proper display of 4:3
material when the display is switched to a 4:3 mode.
The code itself can actually accommodate an unlimited number of
"alternate resolutions", but I could not figure out a clean way of
allowing the user to specify more than two on a single options screen.
Two new files are included in the patch: DisplayRes.cpp & DisplayRes.h.
These define a class which manages the resolution switching.
I personally rarely watch live TV, however, when watching live TV with
this patch, the display resolution can end up changing between every
channel. I originally had it coded just to make a system call to
xrandr, but that added a noticeable delay. I re-coded it to use the
xrandr library, which improved the performance. Since it now uses
library calls, I have protected the code with a config option in
settings.pro. I don't know how many people are using an old version of
X which does not include xrandr. Those using Macs or Microsoft boxes
probably cannot use it either.
I have tested it with Xv and XvMC.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9959 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20040703/1101c15a/DisplayRes.diff.bin
More information about the mythtv-dev