[vlc-devel] [PATCH] v4l2: check if kernel headers are recent enough

Rafaël Carré funman at videolan.org
Thu Jan 19 08:40:23 CET 2012


Le 2012-01-19 02:11, Rémi Denis-Courmont a écrit :
> On Wed, 18 Jan 2012 20:06:21 -0500, Rafaël Carré <funman at videolan.org>
> wrote:
>> V4L2_FIELD_INTERLACED_BT was introduced in v2.6.25-3581-g26d507f
> 
> Stictly speaking, VLC requires kernel header version 3.1, so that
> V4L2_CTRL_TYPE_BITMASK is in enum v4l2_ctrl_type. Oh wait... it actually
> depends on version 3.2 as enum v4l2_power_line_frequency was modified. This
> can actually be a real problem: the compiler can perform optimization
> assuming that only defined values are used in enums. This affects
> switch/case blocks especially.
> 
> I do not feel like supporting pre-2.6.26. This is really old now. And
> builders do ignore warnings. Next thing, they will come and complain that
> v4l2:// stopped working silently.

Yes the point is to not support those.
I'm not sure what's the exact version which will work with your
workarounds but 2.6.25 for sure won't work.


 I'd rather have the build system explode
> in their face really.
> 
> Furthermore I am not a fan of patching configure.ac as it is slow as hell.

I don't see where else?

>> ---
>>  configure.ac |   13 ++++++++++++-
>>  1 files changed, 12 insertions(+), 1 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 8489a90..557ffe1 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -1845,7 +1845,18 @@ AC_ARG_ENABLE(pvr,
> [AS_HELP_STRING([--enable-pvr],
>>    [support PVR V4L2 cards (default disabled)])])
>>  have_v4l2="no"
>>  AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
>> -  have_v4l2="yes"
>> +  AC_PREPROC_IFELSE([
>> +  #ifdef __linux__
>> +  # include <linux/version.h>
>> +  # if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
>> +  #  error Kernel headers too old
>> +  # endif
>> +  #endif
>> +    ], [
>> +      have_v4l2="yes"
>> +      ], [
>> +      AC_MSG_WARN([Kernel headers too old for V4L2 module. You need at
>> least 2.6.22])
> 
> This    ^^^^^^ is inconsistent.

Oops sorry I missed that one,
I had mistyped 2.6.22 everywhere but only fixed the check.

>> +  ])
>>  ])
>>  AS_IF([test "$have_v4l2" = "yes"], [
>>    AS_IF([test "${enable_libv4l2}" != "no"], [
> 




More information about the vlc-devel mailing list