summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-09-02 14:20:22 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-04 12:38:44 +0100
commitd4f765cb16109ea2f1d806ea94f51860f2f58d54 (patch)
tree3c25da30fc193216f944e1582bea8b2ea9fe8858
parent03264307a917faeaa682fb740a4937ae774b180b (diff)
downloadpoky-d4f765cb16109ea2f1d806ea94f51860f2f58d54.tar.gz
ffmpeg: Fix build on musl linux systems
Improved detection of ioctl API makes it easier to use the right implementation rather than bunch of ifdef condition checks. (From OE-Core rev: a81fa08cada35a1b1163a56b80fa72110dcf1e7f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/0001-configure-improve-check-for-POSIX-ioctl.patch48
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg_7.0.2.bb1
2 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-configure-improve-check-for-POSIX-ioctl.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-configure-improve-check-for-POSIX-ioctl.patch
new file mode 100644
index 0000000000..b7c8cb2135
--- /dev/null
+++ b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-configure-improve-check-for-POSIX-ioctl.patch
@@ -0,0 +1,48 @@
1From 82b5617b8197246cf5b2af98a28f2aa37b8c8aa1 Mon Sep 17 00:00:00 2001
2From: Ramiro Polla <ramiro.polla@gmail.com>
3Date: Thu, 29 Aug 2024 15:40:00 +0200
4Subject: [PATCH] configure: improve check for POSIX ioctl
5
6Instead of relying on system #ifdefs which may or may not be correct,
7detect the POSIX ioctl signature at configure time.
8
9Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/00b64fca55a3a009c9d0e391c85f4fd3291e5d12]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 configure | 2 ++
13 libavdevice/v4l2.c | 2 +-
14 2 files changed, 3 insertions(+), 1 deletion(-)
15
16diff --git a/configure b/configure
17index 8642513..d70b0bb 100755
18--- a/configure
19+++ b/configure
20@@ -2517,6 +2517,7 @@ HAVE_LIST="
21 opencl_videotoolbox
22 perl
23 pod2man
24+ posix_ioctl
25 texi2html
26 xmllint
27 zlib_gzip
28@@ -7131,6 +7132,7 @@ perl -v > /dev/null 2>&1 && enable perl || disable perl
29 pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
30 rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
31 xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
32+test_code cc sys/ioctl.h "int ioctl(int, int, ...)" && enable posix_ioctl
33
34 # check V4L2 codecs available in the API
35 if enabled v4l2_m2m; then
36diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
37index 50ac47e..ee01711 100644
38--- a/libavdevice/v4l2.c
39+++ b/libavdevice/v4l2.c
40@@ -107,7 +107,7 @@ struct video_data {
41 int (*open_f)(const char *file, int oflag, ...);
42 int (*close_f)(int fd);
43 int (*dup_f)(int fd);
44-#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /* POSIX-like */
45+#if HAVE_POSIX_IOCTL
46 int (*ioctl_f)(int fd, int request, ...);
47 #else
48 int (*ioctl_f)(int fd, unsigned long int request, ...);
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_7.0.2.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_7.0.2.bb
index 1dbb7e04ef..9e60b5cd23 100644
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg_7.0.2.bb
+++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_7.0.2.bb
@@ -25,6 +25,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
25SRC_URI = " \ 25SRC_URI = " \
26 https://www.ffmpeg.org/releases/${BP}.tar.xz \ 26 https://www.ffmpeg.org/releases/${BP}.tar.xz \
27 file://0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch \ 27 file://0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch \
28 file://0001-configure-improve-check-for-POSIX-ioctl.patch \
28" 29"
29 30
30SRC_URI[sha256sum] = "8646515b638a3ad303e23af6a3587734447cb8fc0a0c064ecdb8e95c4fd8b389" 31SRC_URI[sha256sum] = "8646515b638a3ad303e23af6a3587734447cb8fc0a0c064ecdb8e95c4fd8b389"