* [PATCH v2 0/4] Sensor orientation reporting @ 2009-03-29 22:09 Adam Baker 2009-03-29 22:17 ` [PATCH v2 1/4] " Adam Baker 0 siblings, 1 reply; 10+ messages in thread From: Adam Baker @ 2009-03-29 22:09 UTC (permalink / raw) To: linux-media, Hans de Goede; +Cc: kilgota, Hans Verkuil Hi, Based on the limited feedback from last time I'm assuming people are generally happy with this so I've updated according to Jean-Francois Moine's comments and added documentation. Again this features only the minimum changes in libv4l to make some use of the info. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/4] Sensor orientation reporting 2009-03-29 22:09 [PATCH v2 0/4] Sensor orientation reporting Adam Baker @ 2009-03-29 22:17 ` Adam Baker 2009-03-29 22:22 ` [PATCH v2 2/4] Specify SHELL in documentation Makefile Adam Baker 2009-03-29 22:55 ` [PATCH v2 1/4] Sensor orientation reporting Hans Verkuil 0 siblings, 2 replies; 10+ messages in thread From: Adam Baker @ 2009-03-29 22:17 UTC (permalink / raw) To: linux-media, Hans de Goede, Mauro Carvalho Chehab, Jean-Francois Moine Cc: kilgota, Hans Verkuil Add support to the SQ-905 driver to pass back to user space the sensor orientation information obtained from the camera during init. Modifies gspca and the videodev2.h header to create the necessary API. Signed-off-by: Adam Baker <linux@baker-net.org.uk> --- diff -r d8d701594f71 linux/drivers/media/video/gspca/gspca.c --- a/linux/drivers/media/video/gspca/gspca.c Sun Mar 29 08:45:36 2009 +0200 +++ b/linux/drivers/media/video/gspca/gspca.c Sun Mar 29 23:00:08 2009 +0100 @@ -1147,6 +1147,7 @@ if (input->index != 0) return -EINVAL; input->type = V4L2_INPUT_TYPE_CAMERA; + input->status = gspca_dev->cam.input_flags; strncpy(input->name, gspca_dev->sd_desc->name, sizeof input->name); return 0; diff -r d8d701594f71 linux/drivers/media/video/gspca/gspca.h --- a/linux/drivers/media/video/gspca/gspca.h Sun Mar 29 08:45:36 2009 +0200 +++ b/linux/drivers/media/video/gspca/gspca.h Sun Mar 29 23:00:08 2009 +0100 @@ -56,6 +56,7 @@ * - cannot be > MAX_NURBS * - when 0 and bulk_size != 0 means * 1 URB and submit done by subdriver */ + u32 input_flags; /* value for ENUM_INPUT status flags */ }; struct gspca_dev; diff -r d8d701594f71 linux/drivers/media/video/gspca/sq905.c --- a/linux/drivers/media/video/gspca/sq905.c Sun Mar 29 08:45:36 2009 +0200 +++ b/linux/drivers/media/video/gspca/sq905.c Sun Mar 29 23:00:08 2009 +0100 @@ -360,6 +360,12 @@ gspca_dev->cam.nmodes = ARRAY_SIZE(sq905_mode); if (!(ident & SQ905_HIRES_MASK)) gspca_dev->cam.nmodes--; + + if (ident & SQ905_ORIENTATION_MASK) + gspca_dev->cam.input_flags = V4L2_IN_ST_VFLIP; + else + gspca_dev->cam.input_flags = V4L2_IN_ST_VFLIP | + V4L2_IN_ST_HFLIP; return 0; } diff -r d8d701594f71 linux/include/linux/videodev2.h --- a/linux/include/linux/videodev2.h Sun Mar 29 08:45:36 2009 +0200 +++ b/linux/include/linux/videodev2.h Sun Mar 29 23:00:08 2009 +0100 @@ -737,6 +737,11 @@ #define V4L2_IN_ST_NO_SIGNAL 0x00000002 #define V4L2_IN_ST_NO_COLOR 0x00000004 +/* field 'status' - sensor orientation */ +/* If sensor is mounted upside down set both bits */ +#define V4L2_IN_ST_HFLIP 0x00000010 /* Output is flipped horizontally */ +#define V4L2_IN_ST_VFLIP 0x00000020 /* Output is flipped vertically */ + /* field 'status' - analog */ #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 2/4] Specify SHELL in documentation Makefile 2009-03-29 22:17 ` [PATCH v2 1/4] " Adam Baker @ 2009-03-29 22:22 ` Adam Baker 2009-03-29 22:25 ` [PATCH v2 3/4] Document the orientation flags in ENUMINPUT Adam Baker 2009-03-29 22:55 ` [PATCH v2 1/4] Sensor orientation reporting Hans Verkuil 1 sibling, 1 reply; 10+ messages in thread From: Adam Baker @ 2009-03-29 22:22 UTC (permalink / raw) To: linux-media, Mauro Carvalho Chehab Cc: Hans de Goede, Jean-Francois Moine, kilgota, Hans Verkuil The Makefile for the V4L2 spec uses bash extensions but was using the default system shell, change it to explicitly request bash. Signed-off-by: Adam Baker <linux@baker-net.org.uk> --- diff -r d8d701594f71 v4l2-spec/Makefile --- a/v4l2-spec/Makefile Sun Mar 29 08:45:36 2009 +0200 +++ b/v4l2-spec/Makefile Sun Mar 29 22:59:16 2009 +0100 @@ -1,5 +1,6 @@ # Also update in v4l2.sgml! VERSION = 0.25 +SHELL=/bin/bash SGMLS = \ biblio.sgml \ ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 3/4] Document the orientation flags in ENUMINPUT 2009-03-29 22:22 ` [PATCH v2 2/4] Specify SHELL in documentation Makefile Adam Baker @ 2009-03-29 22:25 ` Adam Baker 2009-03-29 22:28 ` [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT Adam Baker 0 siblings, 1 reply; 10+ messages in thread From: Adam Baker @ 2009-03-29 22:25 UTC (permalink / raw) To: linux-media Cc: Mauro Carvalho Chehab, Hans de Goede, Jean-Francois Moine, kilgota, Hans Verkuil Add documentation for the flags that have been added to VIDIOC_ENUMINPUT to specify the sensor orientation. Signed-off-by: Adam Baker <linux@baker-net.org.uk> --- diff -r d8d701594f71 v4l2-spec/vidioc-enuminput.sgml --- a/v4l2-spec/vidioc-enuminput.sgml Sun Mar 29 08:45:36 2009 +0200 +++ b/v4l2-spec/vidioc-enuminput.sgml Sun Mar 29 22:59:44 2009 +0100 @@ -119,7 +119,7 @@ <entry><structfield>status</structfield></entry> <entry>This field provides status information about the input. See <xref linkend="input-status"> for flags. -<structfield>status</structfield> is only valid when this is the +With the exception of the sensor orientation bits <structfield>status</structfield> is only valid when this is the current input.</entry> </row> <row> @@ -188,6 +188,23 @@ detect color modulation in the signal.</entry> </row> <row> + <entry spanname="hspan">Sensor Orientation</entry> + </row> + <row> + <entry><constant>V4L2_IN_ST_HFLIP</constant></entry> + <entry>0x00000010</entry> + <entry>The input is connected to a device that produces a signal +that is flipped horizontally and does not correct this before passing the +signal to userspace.</entry> + </row> + <row> + <entry><constant>V4L2_IN_ST_VFLIP</constant></entry> + <entry>0x00000020</entry> + <entry>The input is connected to a device that produces a signal +that is flipped vertically and does not correct this before passing the +signal to userspace. Note that a 180 degree rotation is the same as HFLIP | VFLIP</entry> + </row> + <row> <entry spanname="hspan">Analog Video</entry> </row> <row> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT 2009-03-29 22:25 ` [PATCH v2 3/4] Document the orientation flags in ENUMINPUT Adam Baker @ 2009-03-29 22:28 ` Adam Baker 2009-03-30 8:30 ` Hans de Goede 2009-04-10 11:34 ` Hans de Goede 0 siblings, 2 replies; 10+ messages in thread From: Adam Baker @ 2009-03-29 22:28 UTC (permalink / raw) To: linux-media, Hans de Goede Cc: Mauro Carvalho Chehab, Jean-Francois Moine, kilgota, Hans Verkuil Add check to libv4l of the sensor orientation as reported by VIDIOC_ENUMINPUT Signed-off-by: Adam Baker <linux@baker-net.org.uk> --- diff -r a647c2dfa989 v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c --- a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c Tue Jan 20 11:25:54 2009 +0100 +++ b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c Sun Mar 29 22:59:56 2009 +0100 @@ -29,6 +29,11 @@ #define MIN(a,b) (((a)<(b))?(a):(b)) #define ARRAY_SIZE(x) ((int)sizeof(x)/(int)sizeof((x)[0])) +/* Workaround this potentially being missing from videodev2.h */ +#ifndef V4L2_IN_ST_VFLIP +#define V4L2_IN_ST_VFLIP 0x00000020 /* Output is flipped vertically */ +#endif + /* Note for proper functioning of v4lconvert_enum_fmt the first entries in supported_src_pixfmts must match with the entries in supported_dst_pixfmts */ #define SUPPORTED_DST_PIXFMTS \ @@ -134,6 +139,7 @@ int i, j; struct v4lconvert_data *data = calloc(1, sizeof(struct v4lconvert_data)); struct v4l2_capability cap; + struct v4l2_input input; if (!data) return NULL; @@ -161,6 +167,13 @@ /* Check if this cam has any special flags */ data->flags = v4lconvert_get_flags(data->fd); + if ((syscall(SYS_ioctl, fd, VIDIOC_G_INPUT, &input.index) == 0) && + (syscall(SYS_ioctl, fd, VIDIOC_ENUMINPUT, &input) == 0)) { + /* Don't yet support independent HFLIP and VFLIP so getting + * image the right way up is highest priority. */ + if (input.status & V4L2_IN_ST_VFLIP) + data->flags |= V4LCONVERT_ROTATE_180; + } if (syscall(SYS_ioctl, fd, VIDIOC_QUERYCAP, &cap) == 0) { if (!strcmp((char *)cap.driver, "uvcvideo")) data->flags |= V4LCONVERT_IS_UVC; ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT 2009-03-29 22:28 ` [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT Adam Baker @ 2009-03-30 8:30 ` Hans de Goede 2009-04-05 12:12 ` Mauro Carvalho Chehab 2009-04-10 11:34 ` Hans de Goede 1 sibling, 1 reply; 10+ messages in thread From: Hans de Goede @ 2009-03-30 8:30 UTC (permalink / raw) To: Adam Baker Cc: linux-media, Mauro Carvalho Chehab, Jean-Francois Moine, kilgota, Hans Verkuil On 03/30/2009 12:28 AM, Adam Baker wrote: > Add check to libv4l of the sensor orientation as reported by > VIDIOC_ENUMINPUT > > Signed-off-by: Adam Baker<linux@baker-net.org.uk> > Looks good, thanks. I'll apply this to my libv4l tree, as soon as its certain that the matching kernel changes will go in to the kernel without any API changes. Thanks & Regards, Hans > --- > diff -r a647c2dfa989 v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c > --- a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c Tue Jan 20 11:25:54 2009 +0100 > +++ b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c Sun Mar 29 22:59:56 2009 +0100 > @@ -29,6 +29,11 @@ > #define MIN(a,b) (((a)<(b))?(a):(b)) > #define ARRAY_SIZE(x) ((int)sizeof(x)/(int)sizeof((x)[0])) > > +/* Workaround this potentially being missing from videodev2.h */ > +#ifndef V4L2_IN_ST_VFLIP > +#define V4L2_IN_ST_VFLIP 0x00000020 /* Output is flipped vertically */ > +#endif > + > /* Note for proper functioning of v4lconvert_enum_fmt the first entries in > supported_src_pixfmts must match with the entries in supported_dst_pixfmts */ > #define SUPPORTED_DST_PIXFMTS \ > @@ -134,6 +139,7 @@ > int i, j; > struct v4lconvert_data *data = calloc(1, sizeof(struct v4lconvert_data)); > struct v4l2_capability cap; > + struct v4l2_input input; > > if (!data) > return NULL; > @@ -161,6 +167,13 @@ > > /* Check if this cam has any special flags */ > data->flags = v4lconvert_get_flags(data->fd); > + if ((syscall(SYS_ioctl, fd, VIDIOC_G_INPUT,&input.index) == 0)&& > + (syscall(SYS_ioctl, fd, VIDIOC_ENUMINPUT,&input) == 0)) { > + /* Don't yet support independent HFLIP and VFLIP so getting > + * image the right way up is highest priority. */ > + if (input.status& V4L2_IN_ST_VFLIP) > + data->flags |= V4LCONVERT_ROTATE_180; > + } > if (syscall(SYS_ioctl, fd, VIDIOC_QUERYCAP,&cap) == 0) { > if (!strcmp((char *)cap.driver, "uvcvideo")) > data->flags |= V4LCONVERT_IS_UVC; > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT 2009-03-30 8:30 ` Hans de Goede @ 2009-04-05 12:12 ` Mauro Carvalho Chehab 0 siblings, 0 replies; 10+ messages in thread From: Mauro Carvalho Chehab @ 2009-04-05 12:12 UTC (permalink / raw) To: Hans de Goede Cc: Adam Baker, linux-media, Jean-Francois Moine, kilgota, Hans Verkuil On Mon, 30 Mar 2009 10:30:22 +0200 Hans de Goede <j.w.r.degoede@hhs.nl> wrote: > On 03/30/2009 12:28 AM, Adam Baker wrote: > > Add check to libv4l of the sensor orientation as reported by > > VIDIOC_ENUMINPUT > > > > Signed-off-by: Adam Baker<linux@baker-net.org.uk> > > > > Looks good, thanks. I'll apply this to my libv4l tree, as soon > as its certain that the matching kernel changes will go in to > the kernel without any API changes. kernel patches merged. As per your request, I'm letting the libv4l one for you to take care. Cheers, Mauro ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT 2009-03-29 22:28 ` [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT Adam Baker 2009-03-30 8:30 ` Hans de Goede @ 2009-04-10 11:34 ` Hans de Goede 1 sibling, 0 replies; 10+ messages in thread From: Hans de Goede @ 2009-04-10 11:34 UTC (permalink / raw) To: Adam Baker Cc: linux-media, Hans de Goede, Mauro Carvalho Chehab, Jean-Francois Moine, kilgota, Hans Verkuil Thanks, I've applied this to my tree, it will be part of the next libv4l release. Regards, Hans On 03/30/2009 12:28 AM, Adam Baker wrote: > Add check to libv4l of the sensor orientation as reported by > VIDIOC_ENUMINPUT > > Signed-off-by: Adam Baker<linux@baker-net.org.uk> > > --- > diff -r a647c2dfa989 v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c > --- a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c Tue Jan 20 11:25:54 2009 +0100 > +++ b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c Sun Mar 29 22:59:56 2009 +0100 > @@ -29,6 +29,11 @@ > #define MIN(a,b) (((a)<(b))?(a):(b)) > #define ARRAY_SIZE(x) ((int)sizeof(x)/(int)sizeof((x)[0])) > > +/* Workaround this potentially being missing from videodev2.h */ > +#ifndef V4L2_IN_ST_VFLIP > +#define V4L2_IN_ST_VFLIP 0x00000020 /* Output is flipped vertically */ > +#endif > + > /* Note for proper functioning of v4lconvert_enum_fmt the first entries in > supported_src_pixfmts must match with the entries in supported_dst_pixfmts */ > #define SUPPORTED_DST_PIXFMTS \ > @@ -134,6 +139,7 @@ > int i, j; > struct v4lconvert_data *data = calloc(1, sizeof(struct v4lconvert_data)); > struct v4l2_capability cap; > + struct v4l2_input input; > > if (!data) > return NULL; > @@ -161,6 +167,13 @@ > > /* Check if this cam has any special flags */ > data->flags = v4lconvert_get_flags(data->fd); > + if ((syscall(SYS_ioctl, fd, VIDIOC_G_INPUT,&input.index) == 0)&& > + (syscall(SYS_ioctl, fd, VIDIOC_ENUMINPUT,&input) == 0)) { > + /* Don't yet support independent HFLIP and VFLIP so getting > + * image the right way up is highest priority. */ > + if (input.status& V4L2_IN_ST_VFLIP) > + data->flags |= V4LCONVERT_ROTATE_180; > + } > if (syscall(SYS_ioctl, fd, VIDIOC_QUERYCAP,&cap) == 0) { > if (!strcmp((char *)cap.driver, "uvcvideo")) > data->flags |= V4LCONVERT_IS_UVC; > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/4] Sensor orientation reporting 2009-03-29 22:17 ` [PATCH v2 1/4] " Adam Baker 2009-03-29 22:22 ` [PATCH v2 2/4] Specify SHELL in documentation Makefile Adam Baker @ 2009-03-29 22:55 ` Hans Verkuil 2009-03-29 23:58 ` Theodore Kilgore 1 sibling, 1 reply; 10+ messages in thread From: Hans Verkuil @ 2009-03-29 22:55 UTC (permalink / raw) To: Adam Baker Cc: linux-media, Hans de Goede, Mauro Carvalho Chehab, Jean-Francois Moine, kilgota On Monday 30 March 2009 00:17:10 Adam Baker wrote: > Add support to the SQ-905 driver to pass back to user space the > sensor orientation information obtained from the camera during init. > Modifies gspca and the videodev2.h header to create the necessary > API. > > Signed-off-by: Adam Baker <linux@baker-net.org.uk> > --- > diff -r d8d701594f71 linux/drivers/media/video/gspca/gspca.c > --- a/linux/drivers/media/video/gspca/gspca.c Sun Mar 29 08:45:36 2009 > +0200 +++ b/linux/drivers/media/video/gspca/gspca.c Sun Mar 29 23:00:08 > 2009 +0100 @@ -1147,6 +1147,7 @@ > if (input->index != 0) > return -EINVAL; > input->type = V4L2_INPUT_TYPE_CAMERA; > + input->status = gspca_dev->cam.input_flags; > strncpy(input->name, gspca_dev->sd_desc->name, > sizeof input->name); > return 0; > diff -r d8d701594f71 linux/drivers/media/video/gspca/gspca.h > --- a/linux/drivers/media/video/gspca/gspca.h Sun Mar 29 08:45:36 2009 > +0200 +++ b/linux/drivers/media/video/gspca/gspca.h Sun Mar 29 23:00:08 > 2009 +0100 @@ -56,6 +56,7 @@ > * - cannot be > MAX_NURBS > * - when 0 and bulk_size != 0 means > * 1 URB and submit done by subdriver */ > + u32 input_flags; /* value for ENUM_INPUT status flags */ > }; > > struct gspca_dev; > diff -r d8d701594f71 linux/drivers/media/video/gspca/sq905.c > --- a/linux/drivers/media/video/gspca/sq905.c Sun Mar 29 08:45:36 2009 > +0200 +++ b/linux/drivers/media/video/gspca/sq905.c Sun Mar 29 23:00:08 > 2009 +0100 @@ -360,6 +360,12 @@ > gspca_dev->cam.nmodes = ARRAY_SIZE(sq905_mode); > if (!(ident & SQ905_HIRES_MASK)) > gspca_dev->cam.nmodes--; > + > + if (ident & SQ905_ORIENTATION_MASK) > + gspca_dev->cam.input_flags = V4L2_IN_ST_VFLIP; > + else > + gspca_dev->cam.input_flags = V4L2_IN_ST_VFLIP | > + V4L2_IN_ST_HFLIP; > return 0; > } > > diff -r d8d701594f71 linux/include/linux/videodev2.h > --- a/linux/include/linux/videodev2.h Sun Mar 29 08:45:36 2009 +0200 > +++ b/linux/include/linux/videodev2.h Sun Mar 29 23:00:08 2009 +0100 > @@ -737,6 +737,11 @@ > #define V4L2_IN_ST_NO_SIGNAL 0x00000002 > #define V4L2_IN_ST_NO_COLOR 0x00000004 > > +/* field 'status' - sensor orientation */ > +/* If sensor is mounted upside down set both bits */ > +#define V4L2_IN_ST_HFLIP 0x00000010 /* Output is flipped > horizontally */ > +#define V4L2_IN_ST_VFLIP 0x00000020 /* Output is flipped > vertically */ + > /* field 'status' - analog */ > #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ > #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ Hi Adam, I've only one small comment: the V4L2_IN_ST_H/VFLIP comments talk about 'Output' while these flags deal with an input. I know you mean the output from the sensor, but the point of view in this API is the application, and for the application it is an input. Other than that I'm happy with it. Regards, Hans -- Hans Verkuil - video4linux developer - sponsored by TANDBERG ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/4] Sensor orientation reporting 2009-03-29 22:55 ` [PATCH v2 1/4] Sensor orientation reporting Hans Verkuil @ 2009-03-29 23:58 ` Theodore Kilgore 0 siblings, 0 replies; 10+ messages in thread From: Theodore Kilgore @ 2009-03-29 23:58 UTC (permalink / raw) To: Hans Verkuil Cc: Adam Baker, linux-media, Hans de Goede, Mauro Carvalho Chehab, Jean-Francois Moine On Mon, 30 Mar 2009, Hans Verkuil wrote: > On Monday 30 March 2009 00:17:10 Adam Baker wrote: >> Add support to the SQ-905 driver to pass back to user space the >> sensor orientation information obtained from the camera during init. >> Modifies gspca and the videodev2.h header to create the necessary >> API. >> >> Signed-off-by: Adam Baker <linux@baker-net.org.uk> >> --- >> diff -r d8d701594f71 linux/drivers/media/video/gspca/gspca.c >> --- a/linux/drivers/media/video/gspca/gspca.c Sun Mar 29 08:45:36 2009 >> +0200 +++ b/linux/drivers/media/video/gspca/gspca.c Sun Mar 29 23:00:08 >> 2009 +0100 @@ -1147,6 +1147,7 @@ >> if (input->index != 0) >> return -EINVAL; >> input->type = V4L2_INPUT_TYPE_CAMERA; >> + input->status = gspca_dev->cam.input_flags; >> strncpy(input->name, gspca_dev->sd_desc->name, >> sizeof input->name); >> return 0; >> diff -r d8d701594f71 linux/drivers/media/video/gspca/gspca.h >> --- a/linux/drivers/media/video/gspca/gspca.h Sun Mar 29 08:45:36 2009 >> +0200 +++ b/linux/drivers/media/video/gspca/gspca.h Sun Mar 29 23:00:08 >> 2009 +0100 @@ -56,6 +56,7 @@ >> * - cannot be > MAX_NURBS >> * - when 0 and bulk_size != 0 means >> * 1 URB and submit done by subdriver */ >> + u32 input_flags; /* value for ENUM_INPUT status flags */ >> }; >> >> struct gspca_dev; >> diff -r d8d701594f71 linux/drivers/media/video/gspca/sq905.c >> --- a/linux/drivers/media/video/gspca/sq905.c Sun Mar 29 08:45:36 2009 >> +0200 +++ b/linux/drivers/media/video/gspca/sq905.c Sun Mar 29 23:00:08 >> 2009 +0100 @@ -360,6 +360,12 @@ >> gspca_dev->cam.nmodes = ARRAY_SIZE(sq905_mode); >> if (!(ident & SQ905_HIRES_MASK)) >> gspca_dev->cam.nmodes--; >> + >> + if (ident & SQ905_ORIENTATION_MASK) >> + gspca_dev->cam.input_flags = V4L2_IN_ST_VFLIP; >> + else >> + gspca_dev->cam.input_flags = V4L2_IN_ST_VFLIP | >> + V4L2_IN_ST_HFLIP; >> return 0; >> } >> >> diff -r d8d701594f71 linux/include/linux/videodev2.h >> --- a/linux/include/linux/videodev2.h Sun Mar 29 08:45:36 2009 +0200 >> +++ b/linux/include/linux/videodev2.h Sun Mar 29 23:00:08 2009 +0100 >> @@ -737,6 +737,11 @@ >> #define V4L2_IN_ST_NO_SIGNAL 0x00000002 >> #define V4L2_IN_ST_NO_COLOR 0x00000004 >> >> +/* field 'status' - sensor orientation */ >> +/* If sensor is mounted upside down set both bits */ >> +#define V4L2_IN_ST_HFLIP 0x00000010 /* Output is flipped >> horizontally */ >> +#define V4L2_IN_ST_VFLIP 0x00000020 /* Output is flipped >> vertically */ + >> /* field 'status' - analog */ >> #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ >> #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ > > Hi Adam, > > I've only one small comment: the V4L2_IN_ST_H/VFLIP comments talk > about 'Output' while these flags deal with an input. I know you mean the > output from the sensor, but the point of view in this API is the > application, and for the application it is an input. > > Other than that I'm happy with it. > > Regards, > > Hans Hmmm. These two comments? >> +#define V4L2_IN_ST_HFLIP 0x00000010 /* Output is flipped >> horizontally */ >> +#define V4L2_IN_ST_VFLIP 0x00000020 /* Output is flipped >> vertically */ + Perhaps one could change them to say /* Frames must be flipped ... instead. Theodore Kilgore ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-04-10 11:31 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-03-29 22:09 [PATCH v2 0/4] Sensor orientation reporting Adam Baker 2009-03-29 22:17 ` [PATCH v2 1/4] " Adam Baker 2009-03-29 22:22 ` [PATCH v2 2/4] Specify SHELL in documentation Makefile Adam Baker 2009-03-29 22:25 ` [PATCH v2 3/4] Document the orientation flags in ENUMINPUT Adam Baker 2009-03-29 22:28 ` [PATCH v2 4/4] Add support to libv4l to use orientation from VIDIOC_ENUMINPUT Adam Baker 2009-03-30 8:30 ` Hans de Goede 2009-04-05 12:12 ` Mauro Carvalho Chehab 2009-04-10 11:34 ` Hans de Goede 2009-03-29 22:55 ` [PATCH v2 1/4] Sensor orientation reporting Hans Verkuil 2009-03-29 23:58 ` Theodore Kilgore
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox