gst-plugins-good: v4l2: Add run-time environment to enable libv4l2

Kirill Novichikhin kirill.novichikhin at sarov-itc.ru
Fri Jul 28 08:13:57 UTC 2017


+ v4l2object->mmap = mmap;
This change breaks build on arm/32 (probably other 32bit targets)
Since last arg of mmap is __off_t and last arg of v4l2_mmap is  uint64_t, a wrapper is probably needed. 

I worked around it with the following patch:

diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index c6886b1..9364c83 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -454,6 +454,10 @@ gst_v4l2_object_install_m2m_properties_helper (GObjectClass * gobject_class)
           GST_TYPE_STRUCTURE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 }
 
+static void* mmap_stub(void *addr, gsize length, gint prot, gint flags, gint fd, gint64 offset) {
+  return mmap(addr, (size_t)length, prot, flags, fd, (__off_t)offset);
+}
+
 GstV4l2Object *
 gst_v4l2_object_new (GstElement * element,
     enum v4l2_buf_type type,
@@ -509,9 +513,9 @@ gst_v4l2_object_new (GstElement * element,
     v4l2object->dup = dup;
     v4l2object->ioctl = ioctl;
     v4l2object->read = read;
-    v4l2object->mmap = mmap;
+    v4l2object->mmap = mmap_stub;
     v4l2object->munmap = munmap;
   }
 
   return v4l2object;
 }



More information about the gstreamer-devel mailing list