On Sonntag, 1. August 2004 23:47, Ville Syrj�l� wrote:
> On Sun, Aug 01, 2004 at 11:19:42PM +0200, Stefan Lucke wrote:
> > On Sonntag, 1. August 2004 22:03, Ville Syrj�l� wrote:
> > > On Sun, Aug 01, 2004 at 09:37:11PM +0200, Stefan Lucke wrote:
> >
> > [ .. ]
> >
> > > > I get (1st call):
> > > > [dfb] (re)configuring Videolayer to 720 x 576 (720x576)
> > > > area = 0 0 720 576 Caught:
> > > > action=IDirectFBDisplayLayer::SetSourceRectangle(int, int, int, int),
> > > > result=Invalid area present!
> > >
> > > The INVAREA must come from dfb_layer_context_set_sourcerectangle() in
> > > src/core/layer_context.c. Check the used source and config.{width,height}
> > > values in that function.
> >
> > Grr, so doing this call AFTER "videoLayer->SetConfiguration(dlc);" is better :-).
>
> Indeed. SetConfiguration() with DLCONF_WIDTH or DLCONF_HEIGHT resets the
> source rectangle.
>
> > But now I'm fighting with the same visible error as I falsly cried in my
> > "BUG in stretchblit" mail. Or are there some side effects between
> > SetSourceRectangle
> > and SetScreenLocation ?
>
> SetScreenLocation affects the area configured by SetSourceRectangle().
Add some trace code to matrox_bes.c and I think cropright values is not correct.
(720x576)area = 90 0 540 576 dest :(0,32 1280x960)
source:(90,0 540x288)
crop A:(0,0) (0,0)
crop B:(5898240,0) (0,0)
OK !!
0 / 1280; 32 / 1024; 1280 / 1280; 960 / 1024
from my modified matrox_bes.c (line 469):
/* destination box */
dstBox.x1 = dest.x + cropleft;
dstBox.y1 = dest.y + croptop;
dstBox.x2 = dest.x + dest.w - 1 - cropright;
dstBox.y2 = dest.y + dest.h - 1 - cropbot;
fprintf(stderr,"dest :(%d,%d %dx%d)\n",dest.x,dest.y,dest.w,dest.h);
fprintf(stderr,"source:(%d,%d %dx%d)\n",source.x,source.y,source.w,source.h);
/* scale crop values to source dimensions */
if (cropleft)
cropleft = ((__u64) (source.w << 16) * cropleft / dest.w) & ~0x3;
if (croptop)
croptop = ((__u64) (source.h << 16) * croptop / dest.h) & ~0x3;
if (cropright)
cropright = ((__u64) (source.w << 16) * cropright / dest.w) & ~0x3;
if (cropbot)
cropbot = ((__u64) (source.h << 16) * cropbot / dest.h) & ~0x3;
if (croptop_uv)
croptop_uv = ((__u64) ((source.h/2) << 16) * croptop_uv / dest.h) & ~0x3;
fprintf(stderr,"crop A:(%d,%d) (%d,%d)\n",cropleft,croptop,cropright,cropbot);
/* add source cropping */
cropleft += config->source.x << 16;
croptop += config->source.y << 16;
croptop_uv += (config->source.y/2) << 16;
fprintf(stderr,"crop B:(%d,%d) (%d,%d)\n",cropleft,croptop,cropright,cropbot);
>
> I just noticed that the matrox code had a bug with vertical cropping. Fix
> is already in cvs...
>
> --
> Ville Syrj�l�
> [EMAIL PROTECTED]
> http://www.sci.fi/~syrjala/
>
>
>
--
Stefan Lucke