[gst-cvs] gst-plugins-good: v4l2: Define V4L2_FMT_FLAG_EMULATED if it' s not defined yet

Sebastian Dröge slomo at kemper.freedesktop.org
Fri Sep 4 00:33:34 PDT 2009


Module: gst-plugins-good
Branch: master
Commit: 686f8376a833bbf12749198111a1e24fb9781e78
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=686f8376a833bbf12749198111a1e24fb9781e78

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Fri Sep  4 09:32:42 2009 +0200

v4l2: Define V4L2_FMT_FLAG_EMULATED if it's not defined yet

libv4l2 already uses this flag, even on Linux kernel versions
before 2.6.32.

---

 sys/v4l2/gstv4l2object.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index cae86ce..81fabfd 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -719,15 +719,18 @@ gst_v4l2_object_get_format_from_fourcc (GstV4l2Object * v4l2object,
 #define GREY_BASE_RANK       5
 #define PWC_BASE_RANK        1
 
+/* This flag is already used by libv4l2 although
+ * it was added to the Linux kernel in 2.6.32
+ */
+#ifndef V4L2_FMT_FLAG_EMULATED
+#define V4L2_FMT_FLAG_EMULATED 0x0002
+#endif
+
 static gint
 gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
 {
   guint32 fourcc = fmt->pixelformat;
-#ifdef V4L2_FMT_FLAG_EMULATED
   gboolean emulated = ((fmt->flags & V4L2_FMT_FLAG_EMULATED) != 0);
-#else
-  gboolean emulated = FALSE;
-#endif
   gint rank = 0;
 
   switch (fourcc) {





More information about the Gstreamer-commits mailing list