[FFmpeg-devel] [PATCH 2/2] v4l2: allow to set device controls.

Nicolas George nicolas.george at normalesup.org
Mon Apr 1 18:06:09 CEST 2013


L'octidi 8 germinal, an CCXXI, Giorgio Vazzana a écrit :
> >      int list_format;    /**< Set by a private option. */
> >      int list_standard;  /**< Set by a private option. */
> >      char *framerate;    /**< Set by a private option. */
> > +    char *controls;
> nit: maybe use the same comment as above? "/**< Set by a private option. */"

The comment seemed a bit useless to me, but I have no strong objection.

> "v4l2_ioctl" instead of "ioctl" to make libv4l2 happy :)

Locally changed.

> V4L2_CTRL_TYPE_BITMASK was added in linux 3.1, I get an error here on
> 2.6.32. Maybe add something like:
> 
> #ifdef V4L2_CTRL_TYPE_BITMASK
>         case V4L2_CTRL_TYPE_BITMASK:
> #endif

It will not work: V4L2_CTRL_TYPE_* are enums, not macros. I do not find a
relevant VERSION macro that could be used for testing :(

> The rest would LGTM, except that I cannot compile it:
> 
> holden at rye:~/src/ffmpeg$ uname -a
> Linux rye 2.6.32-46-generic #105-Ubuntu SMP Fri Mar 1 00:04:17 UTC
> 2013 x86_64 GNU/Linux
> 
> holden at rye:~/src/ffmpeg$ gcc --version
> gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3
> Copyright (C) 2009 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
<snip error>
> 
> I see we're using -std=c99, but I think anonymous unions are not
> supported in c99?
> 
> holden at rye:~/tmp$ cat v4l2_control.c
> #include <stdio.h>
> #include <linux/videodev2.h>
> 
> int main()
> {
> 	struct v4l2_ext_control ec;
> 
> 	ec.id      = 0;
> 	ec.size    = 0;
> 	ec.value   = 0;
> 	ec.value64 = 0;
> 	ec.string  = NULL;
> 
> 	return 0;
> }
> 
> holden at rye:~/tmp$ gcc -Wall -std=c99 v4l2_control.c
> v4l2_control.c: In function ‘main’:
> v4l2_control.c:10: error: ‘struct v4l2_ext_control’ has no member named ‘value’
> v4l2_control.c:11: error: ‘struct v4l2_ext_control’ has no member
> named ‘value64’
> v4l2_control.c:12: error: ‘struct v4l2_ext_control’ has no member named ‘string’
> 
> holden at rye:~/tmp$ gcc -Wall -std=gnu89 v4l2_control.c

That works for me with -std=c99 and gcc (Debian 4.7.2-5) 4.7.2. I wonder
which version is right, and if there is an easy way of solving the issue.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130401/715e2131/attachment.asc>


More information about the ffmpeg-devel mailing list