···53535454 If you are unsure as to whether this is required, answer Y.55555656-config VIDEO_V4L1_COMPAT5757- bool "Enable Video For Linux API 1 compatible Layer" if !VIDEO_ALLOW_V4L15858- depends on VIDEO_DEV5959- default y6060- ---help---6161- Enables a compatibility API used by most V4L2 devices to allow6262- its usage with legacy applications that supports only V4L1 api.6363-6464- Documentation for the original API is included in the file6565- <Documentation/video4linux/API.html>.6666-6767- User tools for this are available from6868- <ftp://ftp.uk.linux.org/pub/linux/video4linux/>.6969-7070- If you are unsure as to whether this is required, answer Y.71567257#7358# DVB Core
-32
drivers/media/common/saa7146_video.c
···11291129 core, g_chip_ident, chip);11301130}1131113111321132-#ifdef CONFIG_VIDEO_V4L1_COMPAT11331133-static int vidiocgmbuf(struct file *file, void *__fh, struct video_mbuf *mbuf)11341134-{11351135- struct saa7146_fh *fh = __fh;11361136- struct videobuf_queue *q = &fh->video_q;11371137- int err, i;11381138-11391139- /* fixme: number of capture buffers and sizes for v4l apps */11401140- int gbuffers = 2;11411141- int gbufsize = 768 * 576 * 4;11421142-11431143- DEB_D(("VIDIOCGMBUF \n"));11441144-11451145- q = &fh->video_q;11461146- err = videobuf_mmap_setup(q, gbuffers, gbufsize,11471147- V4L2_MEMORY_MMAP);11481148- if (err < 0)11491149- return err;11501150-11511151- gbuffers = err;11521152- memset(mbuf, 0, sizeof(*mbuf));11531153- mbuf->frames = gbuffers;11541154- mbuf->size = gbuffers * gbufsize;11551155- for (i = 0; i < gbuffers; i++)11561156- mbuf->offsets[i] = i * gbufsize;11571157- return 0;11581158-}11591159-#endif11601160-11611132const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {11621133 .vidioc_querycap = vidioc_querycap,11631134 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,···11571186 .vidioc_streamon = vidioc_streamon,11581187 .vidioc_streamoff = vidioc_streamoff,11591188 .vidioc_g_parm = vidioc_g_parm,11601160-#ifdef CONFIG_VIDEO_V4L1_COMPAT11611161- .vidiocgmbuf = vidiocgmbuf,11621162-#endif11631189};1164119011651191/*********************************************************************************/
-4
drivers/media/video/Makefile
···22222323obj-$(CONFIG_VIDEO_V4L2_COMMON) += v4l2-common.o24242525-ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y)2626- obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o2727-endif2828-2925# All i2c modules must come first:30263127obj-$(CONFIG_VIDEO_TUNER) += tuner.o
···852852#endif853853854854 default :855855- ret = v4l_compat_translate_ioctl(file, cmd,856856- arg, pvr2_v4l2_do_ioctl);855855+ ret = -EINVAL;856856+ break;857857 }858858859859 pvr2_hdw_commit_ctl(hdw);
-17
drivers/media/video/pwc/pwc-v4l.c
···362362363363364364 switch (cmd) {365365-#ifdef CONFIG_VIDEO_V4L1_COMPAT366366- /* mmap() functions */367367- case VIDIOCGMBUF:368368- {369369- /* Tell the user program how much memory is needed for a mmap() */370370- struct video_mbuf *vm = arg;371371- int i;372372-373373- memset(vm, 0, sizeof(*vm));374374- vm->size = pwc_mbufs * pdev->len_per_image;375375- vm->frames = pwc_mbufs; /* double buffering should be enough for most applications */376376- for (i = 0; i < pwc_mbufs; i++)377377- vm->offsets[i] = i * pdev->len_per_image;378378- break;379379- }380380-#endif381381-382365 /* V4L2 Layer */383366 case VIDIOC_QUERYCAP:384367 {