[FFmpeg-cvslog] configure: improve check for POSIX ioctl

Ramiro Polla git at videolan.org
Mon Sep 2 04:17:35 EEST 2024


ffmpeg | branch: release/4.3 | Ramiro Polla <ramiro.polla at gmail.com> | Thu Aug 29 15:40:00 2024 +0200| [4af46cabf6996d177ab7f52ca85066463d040e82] | committer: Brad Smith

configure: improve check for POSIX ioctl

Instead of relying on system #ifdefs which may or may not be correct,
detect the POSIX ioctl signature at configure time.

(cherry picked from commit 00b64fca55a3a009c9d0e391c85f4fd3291e5d12)
Signed-off-by: Brad Smith <brad at comstyle.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4af46cabf6996d177ab7f52ca85066463d040e82
---

 configure          | 2 ++
 libavdevice/v4l2.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 7cd490a5ca..6c843ad682 100755
--- a/configure
+++ b/configure
@@ -2330,6 +2330,7 @@ HAVE_LIST="
     opencl_vaapi_intel_media
     perl
     pod2man
+    posix_ioctl
     texi2html
 "
 
@@ -6544,6 +6545,7 @@ rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || d
 check_headers linux/fb.h
 check_headers linux/videodev2.h
 test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
+test_code cc sys/ioctl.h "int ioctl(int, int, ...)" && enable posix_ioctl
 
 # check V4L2 codecs available in the API
 if enabled v4l2_m2m; then
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 1dcbe04bb1..f90490eebf 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -95,7 +95,7 @@ struct video_data {
     int (*open_f)(const char *file, int oflag, ...);
     int (*close_f)(int fd);
     int (*dup_f)(int fd);
-#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /* POSIX-like */
+#if HAVE_POSIX_IOCTL
     int (*ioctl_f)(int fd, int request, ...);
 #else
     int (*ioctl_f)(int fd, unsigned long int request, ...);



More information about the ffmpeg-cvslog mailing list