On Tue, Mar 04, 2014 at 05:41:27PM +0000, William Manley wrote: > --- > Makefile.am | 1 + > defs.h | 1 + > ioctl.c | 2 + > v4l2.c | 529 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 533 insertions(+) > create mode 100644 v4l2.c
I cannot say I've thoroughly read the patch, but I like it anyway.
There is a portability issue that has to be addressed, though.
> +#include "defs.h"
> +#include <sys/ioctl.h>
> +#include <linux/videodev2.h>
What if <linux/videodev2.h> is not installed?
> +static const struct xlat v4l2_control_classes[] = {
> + XLAT(V4L2_CTRL_CLASS_USER),
> + XLAT(V4L2_CTRL_CLASS_MPEG),
> + XLAT(V4L2_CTRL_CLASS_CAMERA),
> + XLAT(V4L2_CTRL_CLASS_FM_TX),
> + XLAT(V4L2_CTRL_CLASS_FLASH),
> + XLAT(V4L2_CTRL_CLASS_JPEG),
> + XLAT(V4L2_CTRL_CLASS_IMAGE_SOURCE),
> + XLAT(V4L2_CTRL_CLASS_IMAGE_PROC),
> + XLAT(V4L2_CTRL_CLASS_FM_RX),
> + XLAT_END
> +};
What if linux headers are not fresh enough?
This code expects linux 3.10 or newer.
> +#define PRINTF_FOURCC "%c%c%c%c"
> +#define FOURCC(x) (char) (x), (char) (x>>8), (char) (x>>16), (char) (x>>24)
> +
> +#define PRINTF_FRACT "%u/%u"
> +#define FRACT(x) ((x).numerator), ((x).denominator)
> +
> +#define PRINTF_RECT "{left=%i, top=%i, width=%i, height=%i}"
> +#define RECT(x) (x).left, (x).top, (x).width, (x).height
Let's rename them to FMT_xxx/ARGS_xxx pairs for clarity.
--
ldv
pgph6NKx0AUoy.pgp
Description: PGP signature
------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
