#11570(avdevice:new): v4l2 1.30 breaks build of 7.1.1
#11570: v4l2 1.30 breaks build of 7.1.1 ----------------------------------+--------------------------------------- Reporter: bbhtt | Type: defect Status: new | Priority: normal Component: avdevice | Version: unspecified Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ----------------------------------+--------------------------------------- Summary of the bug: 7.1.1 build is broken with v4l2 1.30 {{{ libavdevice/v4l2.c: In function ‘device_open’: libavdevice/v4l2.c:141:17: error: assignment to ‘int (*)(int, long unsigned int, ...)’ from incompatible pointer type ‘int (*)(int, int, ...)’ [-Wincompatible-pointer-types] 141 | s->ioctl_f = prefix ## ioctl; \ | ^ libavdevice/v4l2.c:149:9: note: in expansion of macro ‘SET_WRAPPERS’ 149 | SET_WRAPPERS(v4l2_); | ^~~~~~~~~~~~ In file included from libavdevice/v4l2.c:52: /usr/include/libv4l2.h:67:19: note: ‘v4l2_ioctl’ declared here 67 | LIBV4L_PUBLIC int v4l2_ioctl(int fd, int request, ...); | ^~~~~~~~~~ }}} See the attached file for the full build log. How to reproduce: Build with v4l2 1.30 -- Ticket URL: <https://trac.ffmpeg.org/ticket/11570> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11570: v4l2 1.30 breaks build of 7.1.1 -------------------------------------+------------------------------------ Reporter: bbhtt | Owner: (none) Type: defect | Status: new Priority: normal | Component: avdevice Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by bbhtt): * Attachment "8de07b11-build.20250501-170943.log" added. Full build log -- Ticket URL: <https://trac.ffmpeg.org/ticket/11570> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11570: v4l2 1.30 breaks build of 7.1.1 -------------------------------------+------------------------------------ Reporter: bbhtt | Owner: (none) Type: defect | Status: new Priority: normal | Component: avdevice Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by bbhtt): The posix ioctl check https://github.com/FFmpeg/FFmpeg/commit/00b64fca55a3a009c9d0e391c85f4fd3291e... seems broken to me. On systems that do support it, the code will cause an error due to conflicting types causing it to report "posix ioctl not supported" ``` 4:9: error: conflicting types for ‘ioctl’; have ‘int(int, int, ...)’ 4 | int ioctl(int, int, ...); | ^~~~~ In file included from test.c:1: /usr/include/sys/ioctl.h:42:12: note: previous declaration of ‘ioctl’ with type ‘int(int, long unsigned int, ...)’ 42 | extern int ioctl (int __fd, unsigned long int __request, ...) __THROW; | ^~~~~ ``` -- Ticket URL: <https://trac.ffmpeg.org/ticket/11570#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11570: v4l2 1.30 breaks build of 7.1.1 -------------------------------------+------------------------------------ Reporter: bbhtt | Owner: (none) Type: defect | Status: new Priority: normal | Component: avdevice Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by bbhtt): Ok I think I see what is happening, ffmpeg is setting HAVE_POSIX_IOCTL to 0 in config.h which is triggering the wrong v4l2_ioctl definition to get chosen. There is an clash in the macro names. It's debatable who should fix it, but I temporarily patched it like so: {{{ diff --git a/configure b/configure index ffa407d53d..aa73b1c067 100755 --- a/configure +++ b/configure @@ -2522,7 +2522,7 @@ HAVE_LIST=" opencl_videotoolbox perl pod2man - posix_ioctl + ffmpeg_posix_ioctl texi2html xmllint zlib_gzip @@ -7181,7 +7181,7 @@ xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint 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 +test_code cc sys/ioctl.h "int ioctl(int, int, ...)" && enable ffmpeg_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 0ae6872338..be42aaaf88 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -111,7 +111,7 @@ struct video_data { int (*open_f)(const char *file, int oflag, ...); int (*close_f)(int fd); int (*dup_f)(int fd); -#if HAVE_POSIX_IOCTL +#if HAVE_FFMPEG_POSIX_IOCTL int (*ioctl_f)(int fd, int request, ...); #else int (*ioctl_f)(int fd, unsigned long int request, ...); }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/11570#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11570: v4l2 1.30 breaks build of 7.1.1 ------------------------------------+------------------------------------ Reporter: bbhtt | Owner: (none) Type: defect | Status: new Priority: normal | Component: avdevice Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by bbhtt): * version: unspecified => git-master -- Ticket URL: <https://trac.ffmpeg.org/ticket/11570#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11570: v4l2 1.30 breaks build of 7.1.1 ------------------------------------+------------------------------------ Reporter: bbhtt | Owner: (none) Type: defect | Status: new Priority: normal | Component: avdevice Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by bbhtt): This was fixed via https://github.com/FFmpeg/FFmpeg/commit/5fea5e3e11d6ff425db48f44489916399822... would've been nice to mention or close this bug, anyways... -- Ticket URL: <https://trac.ffmpeg.org/ticket/11570#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11570: v4l2 1.30 breaks build of 7.1.1 ------------------------------------+------------------------------------ Reporter: bbhtt | Owner: (none) Type: defect | Status: closed Priority: normal | Component: avdevice Version: git-master | Resolution: fixed Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by bbhtt): * resolution: => fixed * status: new => closed -- Ticket URL: <https://trac.ffmpeg.org/ticket/11570#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg