[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xf86XVRegisterOffscreenImages()



Hi,

from what I've gathered reading the code,
xf86XVRegisterOffscreenImages(pScreen, offscrenImages, num) should be
called with the array of images formats supported by the driver, and the
size of that array. Currently, the code doing that
(*InitOffscreenImages) seems to be a blatant copy/paste from on driver
to the other, and calls this function with num = 1 even when they have
several image formats available.
The only place where num is used later is this code in v4l.c:

    pPPriv->format = xf86XVQueryOffscreenImages(pScreen,&pPPriv->nformat);
    for (fmt = 0; yuvlist[fmt].v4l_palette != 0; fmt++) {
        /* check v4l ... */
        ioctl(fd,VIDIOCGPICT,&pPPriv->pict);
        pPPriv->pict.palette = yuvlist[fmt].v4l_palette;
        pPPriv->pict.depth   = yuvlist[fmt].v4l_depth;
        if (-1 == ioctl(fd,VIDIOCSPICT,&pPPriv->pict))
            continue;
        ioctl(fd,VIDIOCGPICT,&pPPriv->pict);
        if (pPPriv->pict.palette != yuvlist[fmt].v4l_palette)
            continue;
        /* ... works, check available offscreen image formats now ... */
        for (i = 0; i < pPPriv->nformat; i++) {
            if (pPPriv->format[i].image->id     == yuvlist[fmt].xv_id &&
                pPPriv->format[i].image->format == yuvlist[fmt].xv_format) {
                /* ... match found, good. */
                pPPriv->yuv_format = yuvlist[fmt].v4l_palette;
                pPPriv->myfmt = pPPriv->format+i;
                xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                           "v4l[%s]: using hw video scaling [%4.4s].\n",
                           dev,(char*)&(pPPriv->format[i].image->id));
                return;
            }
        }
    }


So apparently, not too much harm, it just means v4l won't find all
required image formats. Still, it looks like a bug to me.

So, did I understand correctly ? Or is there some subtility that escaped
my mind ?

	Xav



Reply to: