Commit bb556409 authored by Simon Evans's avatar Simon Evans Committed by Greg Kroah-Hartman

[PATCH] add callback for VIDIOCSWIN ioctl to usbvideo

This patch adds a callback for VIDIOCSWIN ioctl to usbvideo so
the webcam miniport drivers can implement handling for the ioctl.

It also makes VIDIOCGWIN return the frame size for the current
mode rather than the canvas size. For current drivers
uvd->canvas == uvd->videosize since the frame size is set
when the module is loaded.
parent b2d5a3f3
......@@ -1468,6 +1468,10 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
{
struct video_window *vw = arg;
if(VALID_CALLBACK(uvd, setVideoMode)) {
return GET_CALLBACK(uvd, setVideoMode)(uvd, vw);
}
if (vw->flags)
return -EINVAL;
if (vw->clipcount)
......@@ -1485,8 +1489,8 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
vw->x = 0;
vw->y = 0;
vw->width = VIDEOSIZE_X(uvd->canvas);
vw->height = VIDEOSIZE_Y(uvd->canvas);
vw->width = VIDEOSIZE_X(uvd->videosize);
vw->height = VIDEOSIZE_Y(uvd->videosize);
vw->chromakey = 0;
if (VALID_CALLBACK(uvd, getFPS))
vw->flags = GET_CALLBACK(uvd, getFPS)(uvd);
......
......@@ -272,6 +272,7 @@ typedef struct {
int (*procfs_write)(struct file *file,const char *buffer,unsigned long count,void *data);
int (*startDataPump)(uvd_t *uvd);
void (*stopDataPump)(uvd_t *uvd);
int (*setVideoMode)(uvd_t *uvd, struct video_window *vw);
} usbvideo_cb_t;
struct s_usbvideo_t {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment