* PATCH: gspca-add-driver-get_buf_size-method.patch saved
@ 2008-07-04 7:52 Hans de Goede
0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2008-07-04 7:52 UTC (permalink / raw)
To: Jean-Francois Moine; +Cc: video4linux-list
[-- Attachment #1: Type: text/plain, Size: 847 bytes --]
Hi All,
This patch adds a get_buff_size op to the driver desc struct, and modifies
gspca_get_buff_size to call this (if defined) instead of calculating the
buff_size itself.
This is needed for the pac207 with decoding removed, as the pac207 does
line by line compression prefixing each line with a header indicating wether
or not it is compressed, and only does compression when needed to meet
bandwidth constraints. In half resolution mode, when there are no
bandwidth constraints, the imagesize is actually larger (due to the line
headers) then the raw bayer, so in this case gspca_get_buff_size does the
wrong thing. The best solution in special cases like this is to allow the
driver to provide its own get_buff_size, overriding gspca_get_buff_size's
normal calculations.
Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Regards,
Hans
[-- Attachment #2: gspca-add-driver-get_buf_size-method.patch --]
[-- Type: text/plain, Size: 1985 bytes --]
This patch adds a get_buff_size op to the driver desc struct, and modifies
gspca_get_buff_size to call this (if defined) instead of calculating the
buff_size itself.
This is needed for the pac207 with decoding removed, as the pac207 does
line by line compression prefixing each line with a header indicating wether
or not it is compressed, and only does compression when needed to meet
bandwidth constraints. In half resolution mode, when there are no
bandwidth constraints, the imagesize is actually larger (due to the line
headers) then the raw bayer, so in this case gspca_get_buff_size does the
wrong thing. The best solution in special cases like this is to allow the
driver to provide its own get_buff_size, overriding gspca_get_buff_size's
normal calculations.
Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
diff -r b8dc1b84f3c5 linux/drivers/media/video/gspca/gspca.c
--- a/linux/drivers/media/video/gspca/gspca.c Fri Jul 04 09:36:32 2008 +0200
+++ b/linux/drivers/media/video/gspca/gspca.c Fri Jul 04 09:44:31 2008 +0200
@@ -400,6 +400,9 @@
static int gspca_get_buff_size(struct gspca_dev *gspca_dev, int mode)
{
unsigned int size;
+
+ if (gspca_dev->sd_desc->get_buff_size)
+ return gspca_dev->sd_desc->get_buff_size(gspca_dev, mode);
size = gspca_dev->cam.cam_mode[mode].width *
gspca_dev->cam.cam_mode[mode].height *
diff -r b8dc1b84f3c5 linux/drivers/media/video/gspca/gspca.h
--- a/linux/drivers/media/video/gspca/gspca.h Fri Jul 04 09:36:32 2008 +0200
+++ b/linux/drivers/media/video/gspca/gspca.h Fri Jul 04 09:44:31 2008 +0200
@@ -100,6 +100,7 @@
struct gspca_frame *frame,
__u8 *data,
int len);
+typedef int (*cam_get_buff_size_op) (struct gspca_dev *gspca_dev, int mode);
struct ctrl {
struct v4l2_queryctrl qctrl;
@@ -126,6 +127,7 @@
cam_jpg_op get_jcomp;
cam_jpg_op set_jcomp;
cam_qmnu_op querymenu;
+ cam_get_buff_size_op get_buff_size; /* optional */
};
/* packet types when moving from iso buf to frame buf */
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-07-04 7:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-04 7:52 PATCH: gspca-add-driver-get_buf_size-method.patch saved Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox