From 784348235a82ac7222f3df1b30d5dc611bfd4660 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Tue, 19 Dec 2017 17:37:58 +0800 Subject: [PATCH] v4l2object: Check for mmap64 before using it mmap64 is not available on FreeBSD. https://bugzilla.gnome.org/show_bug.cgi?id=791779 --- configure.ac | 1 + meson.build | 1 + sys/v4l2/gstv4l2object.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 3846303bc8..6e3e57738e 100644 --- a/configure.ac +++ b/configure.ac @@ -197,6 +197,7 @@ fi dnl Check for mmap (needed by electricfence plugin) AC_FUNC_MMAP +AC_CHECK_FUNCS([mmap64]) AM_CONDITIONAL(GST_HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes") dnl Check for mmap (needed by electricfence plugin) diff --git a/meson.build b/meson.build index 61f0077621..ebae8cb576 100644 --- a/meson.build +++ b/meson.build @@ -105,6 +105,7 @@ check_functions = [ ['HAVE_ISINF', 'isinf', '#include'], # check token HAVE_LIBV4L2 ['HAVE_MMAP', 'mmap', '#include'], + ['HAVE_MMAP64', 'mmap64', '#include'], # check token HAVE_OSX_AUDIO # check token HAVE_OSX_VIDEO # check token HAVE_RDTSC diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index bf1a88c3c3..c2400d156d 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -515,7 +515,11 @@ gst_v4l2_object_new (GstElement * element, v4l2object->dup = dup; v4l2object->ioctl = ioctl; v4l2object->read = read; +#ifdef HAVE_MMAP64 v4l2object->mmap = mmap64; +#else + v4l2object->mmap = mmap; +#endif v4l2object->munmap = munmap; }