Workaround for missing struct v4l2_buffer declaration in Suse 9 and Mandrake 10 linux...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sat, 10 Apr 2004 13:27:16 +0000 (13:27 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sat, 10 Apr 2004 13:27:16 +0000 (13:27 +0000)
Original commit message from CVS:
* configure.ac:
* sys/v4l2/gstv4l2element.h:
Workaround for missing struct v4l2_buffer declaration in Suse 9
and Mandrake 10 linux/videodev2.h header file (#135919).

ChangeLog
configure.ac
sys/v4l2/gstv4l2element.h

index 9b2bf0cb76c4e3cdb2dd055d684801ae1fa063ec..79e4c0123411e4361ad720a5350cd54b67542ef5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-10  Ronald Bultje  <rbultje@ronald.bitfreak.net>
+
+       * configure.ac:
+       * sys/v4l2/gstv4l2element.h:
+         Workaround for missing struct v4l2_buffer declaration in Suse 9
+         and Mandrake 10 linux/videodev2.h header file (#135919).
+
 2004-04-10  Ronald Bultje  <rbultje@ronald.bitfreak.net>
 
        * ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_open_file):
index 7311bc78896bbdfa9e0b22e886e944d898047ef4..b83f5bf629d73dd37665be0a2d1454c378197fe7 100644 (file)
@@ -635,6 +635,23 @@ return 0;
                          [ AC_MSG_WARN([video4linux2 was not found])])
        ])
   fi
+  dnl check for missing v4l2_buffer declaration (see #135919)
+  if [ test x$HAVE_V4L2 = xyes ]; then
+    MISSING_DECL=0
+    AC_MSG_CHECKING(struct v4l2_buffer declaration)
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <linux/types.h>
+#define _LINUX_TIME_H
+#include <linux/videodev2.h>
+    ],[
+struct v4l2_buffer buf;
+return 0;
+    ], [ AC_MSG_RESULT(yes) ], [ MISSING_DECL=1 && AC_MSG_RESULT(no) ])
+    if [ test x$MISSING_DECL = x1 ]; then
+      AC_DEFINE(GST_V4L2_MISSING_BUFDECL, 1, [struct v4l2_buffer missing])
+    fi
+  fi
 ])
 
 dnl Next, check for the optional libraries:
index e46b24402c2f8f2fe5ebdab92e75e4dc4ce0b705..61442aff8333d373a94a665dffd8b603629a7f18 100644 (file)
 #define _LINUX_TIME_H
 #include <linux/videodev2.h>
 
+/*
+ * See bug #135919, the Suse9 (and Mandrake10) videodev2 headers
+ * contain a bug where (for userspace applications) the v4l2_buffer
+ * struct is not declared, so applications have to declare it.
+ * Declaration straightly ripped out from <linux/videodev2.h>.
+ */
+#ifdef GST_V4L2_MISSING_BUFDECL
+struct v4l2_buffer
+{
+       __u32                   index;
+       enum v4l2_buf_type      type;
+       __u32                   bytesused;
+       __u32                   flags;
+       enum v4l2_field         field;
+       struct timeval          timestamp;
+       struct v4l2_timecode    timecode;
+       __u32                   sequence;
+
+       /* memory location */
+       enum v4l2_memory        memory;
+       union {
+               __u32           offset;
+               unsigned long   userptr;
+       } m;
+       __u32                   length;
+
+       __u32                   reserved[2];
+};
+#endif /* GST_V4L2_MISSING_BUFDECL */
+
 
 #define GST_TYPE_V4L2ELEMENT \
                (gst_v4l2element_get_type())