v4l2object: Check for mmap64 before using it

mmap64 is not available on FreeBSD.

https://bugzilla.gnome.org/show_bug.cgi?id=791779
This commit is contained in:
Ting-Wei Lan 2017-12-19 17:37:58 +08:00 committed by Nicolas Dufresne
parent 8b814f6351
commit 784348235a
3 changed files with 6 additions and 0 deletions

View file

@ -197,6 +197,7 @@ fi
dnl Check for mmap (needed by electricfence plugin) dnl Check for mmap (needed by electricfence plugin)
AC_FUNC_MMAP AC_FUNC_MMAP
AC_CHECK_FUNCS([mmap64])
AM_CONDITIONAL(GST_HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes") AM_CONDITIONAL(GST_HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
dnl Check for mmap (needed by electricfence plugin) dnl Check for mmap (needed by electricfence plugin)

View file

@ -105,6 +105,7 @@ check_functions = [
['HAVE_ISINF', 'isinf', '#include<math.h>'], ['HAVE_ISINF', 'isinf', '#include<math.h>'],
# check token HAVE_LIBV4L2 # check token HAVE_LIBV4L2
['HAVE_MMAP', 'mmap', '#include<sys/mman.h>'], ['HAVE_MMAP', 'mmap', '#include<sys/mman.h>'],
['HAVE_MMAP64', 'mmap64', '#include<sys/mman.h>'],
# check token HAVE_OSX_AUDIO # check token HAVE_OSX_AUDIO
# check token HAVE_OSX_VIDEO # check token HAVE_OSX_VIDEO
# check token HAVE_RDTSC # check token HAVE_RDTSC

View file

@ -515,7 +515,11 @@ gst_v4l2_object_new (GstElement * element,
v4l2object->dup = dup; v4l2object->dup = dup;
v4l2object->ioctl = ioctl; v4l2object->ioctl = ioctl;
v4l2object->read = read; v4l2object->read = read;
#ifdef HAVE_MMAP64
v4l2object->mmap = mmap64; v4l2object->mmap = mmap64;
#else
v4l2object->mmap = mmap;
#endif
v4l2object->munmap = munmap; v4l2object->munmap = munmap;
} }