Skip to content

Commit

Permalink
V4L/DVB (5569): Fix: v4l1_compat should be called only if V4L1_COMPAT
Browse files Browse the repository at this point in the history
Added also some explanations about V4L1 handling

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mauro Carvalho Chehab committed May 9, 2007
1 parent 1088b13 commit 452c0fb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/media/video/videodev.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
}

#ifdef CONFIG_VIDEO_V4L1_COMPAT
/***********************************************************
Handles calls to the obsoleted V4L1 API
Due to the nature of VIDIOCGMBUF, each driver that supports
V4L1 should implement its own handler for this ioctl.
***********************************************************/

/* --- streaming capture ------------------------------------- */
if (cmd == VIDIOCGMBUF) {
struct video_mbuf *p=arg;
Expand All @@ -453,11 +459,17 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
(unsigned long)p->offsets);
return ret;
}
#endif

/********************************************************
All other V4L1 calls are handled by v4l1_compat module.
Those calls will be translated into V4L2 calls, and
__video_do_ioctl will be called again, with one or more
V4L2 ioctls.
********************************************************/
if (_IOC_TYPE(cmd)=='v')
return v4l_compat_translate_ioctl(inode,file,cmd,arg,
__video_do_ioctl);
#endif

switch(cmd) {
/* --- capabilities ------------------------------------------ */
Expand Down

0 comments on commit 452c0fb

Please sign in to comment.