Re: Xv and v4l device

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



>  So there doesn't seem to be a big difference. Is there something a v4l
>  driver has to implement, so that xv scaling will work.
>  Both drivers deliver YUV422 and can write into video memory.

Hmm, should have worked, the v4l module tries to use yuv422 for
hardware-scaled overlay.  Below is the piece of code which the
v4l module uses to check whenever it can do hw scaling or not.

  Gerd

--------------------------- cut here ------------------------
        /* test v4l device for yuv support:  check if the driver
           accepts VIDEO_PALETTE_YUV422 */
        ioctl(fd,VIDIOCGPICT,&pPPriv->pict);
        pPPriv->pict.palette = VIDEO_PALETTE_YUV422;
        pPPriv->pict.depth   = 16;
        if (0 == ioctl(fd,VIDIOCSPICT,&pPPriv->pict)) {
            ioctl(fd,VIDIOCGPICT,&pPPriv->pict);    
            if (VIDEO_PALETTE_YUV422 == pPPriv->pict.palette) {
                /* works, check screen capabilities */
                DEBUG(xf86Msg(X_INFO, "v4l: kernel driver supports yuv422.\n"));
                pPPriv->format = xf86XVQueryOffscreenImages
                    (pScreen,&pPPriv->nformat);
                DEBUG(xf86Msg(X_INFO, "v4l: screen driver supports %d yuv format
s (%p)\n",
                              pPPriv->nformat,pPPriv->format));
                for (j = 0; j < pPPriv->nformat; j++) {
                    DEBUG(xf86Msg(X_INFO, "v4l: yuv format: %4.4s\n",
                                  (char*)&(pPPriv->format[j].image->id)));
                    if (pPPriv->format[j].image->id     == 0x32595559 &&
                        pPPriv->format[j].image->format == XvPacked) {
                        pPPriv->have_yuv = 1;
                        pPPriv->myfmt = pPPriv->format+j;
                        DEBUG(xf86Msg(X_INFO,  "v4l: matching format found, offs
creen yuv enabled.\n"));
                    }
                }
            }
        }





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux