[MPlayer-dev-eng] [PATCH] Pivoting

Paweł Sakowski pawel at sakowski.pl
Fri Aug 19 16:40:29 CEST 2005


I've recently played with the screen rotation feature of RandR X server
extension. A quick introduction to the concept: you get a 1024x1280 (in
my case) X display, which is rotated 90 degrees before being sent to the
monitor. You can invoke it with `xrandr -o 1` if supported by your X
server (I had to add Option "RandRRotation" "true" to xorg.conf to make
it work on my nvidia). It is pretty useful with pivoted TFT displays.

While such rotation is meant to be transparent to X clients, it turns
out that MPlayer doesn't cope well with a rotated display on full screen
(with -vo xv and a few others).

Problem #1: XF86VidModeGetModeLine returns the physical monitor's
dimensions (1280x1024) as opposed to the logical ones returned by
Display{Width,Height} (1024x1280). Attaching a patch that makes mplayer
use the latter even if xf86vm is available. Note: I'm not sure if this
change is valid for all setups. Is there a situation where the modeline
dimensions are more reliable than Display{Width,Height}? No other
modeline information is being retrieved from the call to
XF86VidModeGetModeLine. Note #2: I don't have Xinerama available, so I
don't know how XineramaQueryScreens copes with rotated screens.

Problem #2: aspect.c sets monitor_aspect to the fixed value of 4:3,
unless overridden by command line or config file. It's a pretty
arbitrary value, and it's wrong for my monitor (which has aspect ratio
5:4, when rotated: 4:5). This problem isn't strictly related to
pivoting, basically 4:3 is not the right aspect ratio for some monitors
(including mine, even if not rotated). I believe it would be a better
heuristics to precalculate monitor_aspect by dividing width/height (thus
pressuming that pixels are squares). This should give a satisfactory
ratio for most displays; if it doesn't, there's always the possibility
to override it manually. If you believe such behavior is reasonable, I
will be happy to prepare a patch implementing it.

With the attached patch and -monitoraspect 4:5 the videos get properly
centered and scaled on a rotated monitor.

-- 
+----------------------------------------------------------------------+
| Paweł Sakowski <pawel at sakowski.pl>                Never trust a man  |
|                            who can count up to 1023 on his fingers.  |
+----------------------------------------------------------------------+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-pivot.patch
Type: text/x-patch
Size: 776 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050819/84c9f055/attachment.bin>


More information about the MPlayer-dev-eng mailing list