GNOME Bugzilla – Bug 105467
Check for V4L2 is not robust enough
Last modified: 2004-12-22 21:47:04 UTC
The check for V4L2 is not robust enough. Currently it just checks if "videodev2.h" was found on the system, and if so, attempts to build the V4L2 plugins. However, the videodev2.h file varies widely depending on the version. For example, on my Mandrake 9.0 box, the v4l2_clip and 4l2_capability structs in videodev2.h are completely different from what gstreamer expects, breaking compilation So, the check for V4L2 needs a version check as well. I dunno what version is necessary, just that mine isn't recent enough. Mine has: #define V4L2_MAJOR_VERSION 0 #define V4L2_MINOR_VERSION 20
I just checked and v4l2 doesn't have versions anymore. I guess Gerd removed them for some reason... I could check for absence of this variable and only continue compiling if it's not there... Would that be ok?
I dunno. Were the versions removed when the API was deemed stable and unchanging? If that's the case, it seems like your idea is a reasonable check to make. However, I think the most robust solution is to have one of them "./configure checks" that attempts to compile a small program that includes the videodev2.h file and manipulates the questionable structs. If the compilation fails, then the videodev2.h is too old. At the very least, these issues should be documented in the README. :-)
Ronald,Loban: is there any unresolved issues in this bug? Or can it be closed?
I actually need thomas to help me out here and suggest the best way to do this. Let's discuss this tonight on IRC, ok?
Reply from Gerd: "Easiest way is to ship a private copy of that header file." So, should we do that? (It's evil, but...).
Current CVS should work. It checks for V4L2_{MAJOR,MINOR}_VERSION not being defined. Also, it checks for struct timeval/timespec duplicate definitions and does a crappy fix to solve that. Please try it out and reopen if anything is wrong.