[MPlayer-dev-eng] [PATCH] factor out panscan etc. calculation from xv, xvmc and direct3d

Ivan Kalvachev ikalvachev at gmail.com
Wed Feb 11 22:30:49 CET 2009


On 2/11/09, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> Hello,
> this is mostly due to vo_direct3d and because vo_vdpau needs the same
> code.
> It adds a function calc_src_dst_rects that returns two rectangles that
> specify which part of the video (source) must be scaled onto which part of
> the window (destination).
> The reason for doing this for xvmc is that it is trivial to add
> support for cropping (and xv is changed to keep them at least somewhat
> consistent).
> After this patch, the only thing that is missing to support cropping is:
> a way for the vo to get cropping values (I'd be in favour of a VOCTRL),
> fixing up aspect due to the cropping,
> fixing the OSD so it does not get cropped as well and
> passing the cropping values to calc_src_dst_rects

The idea is good.

However why are you using 2d array when the rectangles
are actually never used in loop?
It's much simpler to use struct with some meaningful names.
It may even make code smaller.
Alll the [0][0][1][0][0][1][1][1] are just making all the code look
really funny.

About xvmc cropping, mpi have unused x,y,w,h parameters.



More information about the MPlayer-dev-eng mailing list