Hi,
for vdr-softdevice I'm trying to stretchblit on mga. When bliting the
whole surface everything is ok. aspect-ration handling is ok too.
But when doing croping there is a part on the right side missing.
I'm calling stretchblit like this:
if (useStretchBlit)
{
DFBRectangle src, dst;
src.x = sxoff;
src.y = syoff;
src.w = swidth;
src.h = sheight;
dst.x = lxoff;
dst.y = lyoff;
dst.w = lwidth;
dst.h = lheight;
fprintf (stderr, "src (%d,%d %dx%d)\n", sxoff,syoff,swidth,sheight);
fprintf (stderr, "dst (%d,%d %dx%d)\n", lxoff,lyoff,lwidth,lheight);
osdMutex.Lock();
if (aspect_changed || osdClrBack)
scrSurface->Clear(0,0,0,0);
scrSurface->SetBlittingFlags(DSBLIT_NOFX);
scrSurface->StretchBlit(videoSurface, &src, &dst);
For debuging I placed some printfs in matrox.c "matroxDoBlitTMU"
__s32 startx, starty, incx, incy;
fprintf(stderr,"doblit: sx = %d sy = %d sw = %d sh = %d\n",sx,sy,sw,sh);
fprintf(stderr,"doblit: dx = %d dy = %d dw = %d dh = %d\n",dx,dy,dw,dh);
So I'm getting the following trace:
first 4:3 stream:
src (0,0 704x576)
dst (0,0 1024x768)
doblit: sx = 0 sy = 0 sw = 704 sh = 576
doblit: dx = 0 dy = 0 dw = 1024 dh = 768
src (0,0 704x576)
dst (0,0 1024x768)
doblit: sx = 0 sy = 0 sw = 704 sh = 576
doblit: dx = 0 dy = 0 dw = 1024 dh = 768
Now switching to 16:9 stream with AFD information which tells that
it is 4:3 frame. This should be displayed in fullscreen too.
[dfb] (re)configuring Videolayer to 720 x 576 (540x576)
[dfb] creating new surface
[dfb] (re)configured 0x00200806
src (90,0 540x576)
dst (0,0 1024x768)
doblit: sx = 90 sy = 0 sw = 450 sh = 576
doblit: dx = 0 dy = 0 dw = 854 dh = 768
src (90,0 540x576)
dst (0,0 1024x768)
doblit: sx = 90 sy = 0 sw = 450 sh = 576
doblit: dx = 0 dy = 0 dw = 854 dh = 768
So someone does a clip on the source width (540 - 90 = 450) and
adjusts dest with (or the other way round).
I looked through the sources but didn't find an obvious clipping error,
but since there are several clip functions it is possible that I did not
find the bad one.
--
Stefan Lucke