mocm@xxxxxxxxxxxxxx wrote: > Gerd Knorr writes: > > > I added a query for UYVY in the v4l and the Xv driver if the > > > YUV422 query failed. This way it works with bttv and dvb driver, but > > > if I turn it around the bttv colors are wrong because UYVY would be > > > chosen. > > > > Oops? Which bttv version? bttv should either refuse to accept UYVY > > (0.7.x) or get the byteswapping right (0.8.x) ... > > > > I am using the kernel driver in 2.4.17 (version 0.7.83). > I can't find a check for UYVY in that driver in the VIDIOCSPICT ioctl. Oops. It does check that for capture in vgrab(), but the same check is missing in VIDIOCSPICT ioctl. The patch below should fix that. Gerd --------------------------- cut here ----------------------- --- bttv-driver.c~ Fri Feb 1 09:13:05 2002 +++ bttv-driver.c Fri Feb 1 11:11:23 2002 @@ -1212,7 +1212,7 @@ if (mp->height*mp->width*fmtbppx2[palette2fmt[mp->format]&0x0f]/2 > gbufsize) return -EINVAL; - if(-1 == palette2fmt[mp->format]) + if (-1 == palette2fmt[mp->format]) return -EINVAL; /* @@ -1666,9 +1666,11 @@ case VIDIOCSPICT: { struct video_picture p; - if(copy_from_user(&p, arg,sizeof(p))) + if (copy_from_user(&p, arg,sizeof(p))) return -EFAULT; if (p.palette > PALETTEFMT_MAX) + return -EINVAL; + if (-1 == palette2fmt[p.palette]) return -EINVAL; down(&btv->lock); /* We want -128 to 127 we get 0-65535 */