Re: [yavta PATCH 1/3] Support integer menus.

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

 



Le vendredi 13 avril 2012 22:47:14 Laurent Pinchart, vous avez écrit :
> Hi Sakari,
> 
> Thanks for the patch.
> 
> The code looks fine, but unfortunately breaks compilation when using kernel
> headers < v3.5 (which is a pretty common case as of today ;-)).
> 
> V4L2_CTRL_TYPE_INTEGER_MENU is an enumerated value, not a pre-processor
> #define, so it's difficult to test for it using conditional compilation.

Same problem with BITMASK already.

The most common solution to this problem, although not found in V4L consists 
of defining the enumeration members in the header <linux/videodev2.h>:

#define V4L2_CTRL_TYPE_INTEGER_MENU V4L2_CTRL_TYPE_INTEGER_MENU

Then #ifdef works fine. libc has plenty of these, e.g. <bits/socket.h>. Or per 
package, autoconf can be used:

AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h])
AC_CHECK_DECLS([V4L2_CTRL_TYPE_INTEGER_MENU],,, [
#ifdef HAVE_LINUX_VIDEODEV2_H
# include <linux/videodev2.h>
#endif
#ifdef HAVE_SYS_VIDEOIO_H
# include <sys/videoio.h>
#endif
])

Then this works:

#if HAVE_DECL_V4L2_CTRL_TYPE_INTEGER_MENU



-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux