Re:[PATCH 1 of 2] gspca: allow subdrivers to handle v4l2_streamparm requests

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


 
 


在2008-12-10,"Jim Paris" <jim@xxxxxxxx> 写道:
># HG changeset patch
># User jim@xxxxxxxx
># Date 1228860341 18000
># Node ID c3eafdd5ba7cb667ed301e7feed6b02b57f1aa7a
># Parent  51458dbe1fdab9f2463a49772fb8be39eabe520c
>gspca: allow subdrivers to handle v4l2_streamparm requests
>
>Add get_streamparm and set_streamparm operations so subdrivers can
>get/set stream parameters such as framerate.
>
>Signed-off-by: Jim Paris <jim@xxxxxxxx>
>
>diff -r 51458dbe1fda -r c3eafdd5ba7c linux/drivers/media/video/gspca/gspca.c
>--- a/linux/drivers/media/video/gspca/gspca.c	Tue Dec 09 16:55:39 2008 -0500
>+++ b/linux/drivers/media/video/gspca/gspca.c	Tue Dec 09 17:05:41 2008 -0500
>@@ -1337,6 +1337,16 @@
> 	memset(parm, 0, sizeof *parm);
> 	parm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
> 	parm->parm.capture.readbuffers = gspca_dev->nbufread;
>+
>+	if (gspca_dev->sd_desc->get_streamparm) {
>+		int ret;
>+		if (mutex_lock_interruptible(&gspca_dev->usb_lock))
>+			return -ERESTARTSYS;
>+		ret = gspca_dev->sd_desc->get_streamparm(gspca_dev, parm);
>+		mutex_unlock(&gspca_dev->usb_lock);
>+		return ret;
>+	}
>+
> 	return 0;
> }
> 
>@@ -1351,6 +1361,16 @@
> 		parm->parm.capture.readbuffers = gspca_dev->nbufread;
> 	else
> 		gspca_dev->nbufread = n;
>+
>+	if (gspca_dev->sd_desc->set_streamparm) {
>+		int ret;
>+		if (mutex_lock_interruptible(&gspca_dev->usb_lock))
>+			return -ERESTARTSYS;
>+		ret = gspca_dev->sd_desc->set_streamparm(gspca_dev, parm);
>+		mutex_unlock(&gspca_dev->usb_lock);
>+		return ret;
>+	}
>+
> 	return 0;
> }
> 
>diff -r 51458dbe1fda -r c3eafdd5ba7c linux/drivers/media/video/gspca/gspca.h
>--- a/linux/drivers/media/video/gspca/gspca.h	Tue Dec 09 16:55:39 2008 -0500
>+++ b/linux/drivers/media/video/gspca/gspca.h	Tue Dec 09 17:05:41 2008 -0500
>@@ -74,6 +74,8 @@
> typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *);
> typedef int (*cam_jpg_op) (struct gspca_dev *,
> 				struct v4l2_jpegcompression *);
>+typedef int (*cam_streamparm_op) (struct gspca_dev *, 
>+				  struct v4l2_streamparm *);
> typedef int (*cam_qmnu_op) (struct gspca_dev *,
> 			struct v4l2_querymenu *);
> typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev,
>@@ -106,6 +108,8 @@
> 	cam_jpg_op get_jcomp;
> 	cam_jpg_op set_jcomp;
> 	cam_qmnu_op querymenu;
>+	cam_streamparm_op get_streamparm;
>+	cam_streamparm_op set_streamparm;
> };
> 
> /* packet types when moving from iso buf to frame buf */
>
>--
>video4linux-list mailing list
>Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
>https://www.redhat.com/mailman/listinfo/video4linux-list
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subjecthttps://www.redhat.com/mailman/listinfo/video4linux-list


[Linux Media]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Linux Kernel]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [SSH]     [DVB Maintainers]     [Linux USB]     [Yosemite Information]

Add to Google Powered by Linux