[MPlayer-G2-dev] [?] hit 3 flies - aspect ratio, resize, query_format
Felix Buenemann
atmosfear at users.sourceforge.net
Mon Sep 15 16:15:20 CEST 2003
On Friday 22 August 2003 21:48, Arpi wrote:
> I would extend vf's query_format() by a int p[6] parameter.
> (actually int* size, which points to an array of 6 integers)
> these 6 values are:
>
> buff_w, buff_h - w/h of the image buffer (real pixels)
> disp_w, disp_h - pre-scaled w/h (recommended display size) [for startup]
> want_w, want_h - wanted output size [for window resizing]
>
>
> query_format() of 'normal' filters (which dont alter aspect ratio nor
> buffer size) would just pass thru the pointer to next filter.
> other filters shoudl implement it this way:
> query_format(...){
> - change buff_w/h (only filters which chaneg buffer dimensios)
> - change disp_w/h (only filters which change aspect ratio)
> - call next filter's query_format()
> - change want_w/h (only filters which change buffer dimensios)
> }
hmm, I see something missing here: Where do you account for the
aspect-discrepancy of Screen-Resolution-Aspect vs.
Physical-Displaydevice-Aspect. Eg. think of the case where displaying video
at 1280x1024 on a 4:3 19" CRT, which is a very common case. In this case we
have to do slight aspect correction in order to retain correct aspect ratio.
Another place is TV-Out, often the display-area from the graphics card doesn't
fill the whole visible area of the TV's CRT, so that there are black areas
above and below (sometimes also at the sides). With mplayer G1 id'd simply
measure the display area from the graphics card, with a ruler or sth. and
give that to MPlayer, eg: mplayer -monitoraspect 40:27 movie.avi
In most cases it would then make the black bars above and below the movie
smaller, so aspect would be correct again and I'd be happy.
Maybe I've kinda lamely coded the aspect code in G1, but at least it works as
expected =)
> also, the scaling flags of vfcap.h shoudl be reviewed: merging HSWSCALE_UP
> and HWSCALE_DOWN, it ha sno sence to keep them separated.
> query_format() implementations can now check source and dest resolution so
> can decide if sw/hw scaling is possible or not. if they can do the scaling
> (or resize), they should change the want_w/h values. otherwise left
> unchanged.
hmm, I'm not sure about this. The bad thing about eg. XV is that you can tell
it to scale down in most cases but then if the adapter can't do it, it'll
simply crop away part of the image to get the desired size. So the idea was
to be able to specify if the card can do hw downsizing/upsizing using the
selected vo, so we can downsize/upsize by swscaler if needed whilst using the
faster hw scaler for upscaling/downscaling. But maybe I misunderstood you
Arpi.
--
Best Regards,
Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________
More information about the MPlayer-G2-dev
mailing list