diff options
| author | Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> | 2025-10-12 18:08:04 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-13 18:01:04 +0100 |
| commit | 2d844e061aa37f699046a336dfc264a55d39bda1 (patch) | |
| tree | 23d1b081e80d140b9b239abae7f06bfc7a3442a8 | |
| parent | f897ff7da3074fed57531bb4d7218fe9f9e94662 (diff) | |
| download | poky-2d844e061aa37f699046a336dfc264a55d39bda1.tar.gz | |
x264: switch to PACKAGECONFIG
Switch to PACKAGECONFIG in order to make x264 options configurable.
Enable FFmpeg (by default) and OpenCL (if enabled by the distro). Pick
up the patch to fix building with the latest FFmpeg.
(From OE-Core rev: 4339bf44faa11bf5933f23ac5b0b6ecaa5a1afab)
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-multimedia/x264/x264/32c3b801191522961102d4bea292cdb61068d0dd.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-multimedia/x264/x264_git.bb | 11 |
2 files changed, 47 insertions, 3 deletions
diff --git a/meta/recipes-multimedia/x264/x264/32c3b801191522961102d4bea292cdb61068d0dd.patch b/meta/recipes-multimedia/x264/x264/32c3b801191522961102d4bea292cdb61068d0dd.patch new file mode 100644 index 0000000000..fb0f313cdb --- /dev/null +++ b/meta/recipes-multimedia/x264/x264/32c3b801191522961102d4bea292cdb61068d0dd.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 32c3b801191522961102d4bea292cdb61068d0dd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st> | ||
| 3 | Date: Fri, 4 Apr 2025 16:59:34 +0300 | ||
| 4 | Subject: [PATCH] lavf: Update the code to work with the latest libavutil API | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://code.videolan.org/videolan/x264/-/commit/32c3b801191522961102d4bea292cdb61068d0dd] | ||
| 7 | --- | ||
| 8 | input/lavf.c | 6 ++++++ | ||
| 9 | 1 file changed, 6 insertions(+) | ||
| 10 | |||
| 11 | diff --git a/input/lavf.c b/input/lavf.c | ||
| 12 | index 90f4cec5..e2489963 100644 | ||
| 13 | --- a/input/lavf.c | ||
| 14 | +++ b/input/lavf.c | ||
| 15 | @@ -33,6 +33,7 @@ | ||
| 16 | #include <libavutil/error.h> | ||
| 17 | #include <libavutil/mem.h> | ||
| 18 | #include <libavutil/pixdesc.h> | ||
| 19 | +#include <libavutil/version.h> | ||
| 20 | |||
| 21 | #define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, "lavf", __VA_ARGS__ ) | ||
| 22 | |||
| 23 | @@ -141,8 +142,13 @@ static int read_frame_internal( cli_pic_t *p_pic, lavf_hnd_t *h, int i_frame, vi | ||
| 24 | if( info ) | ||
| 25 | { | ||
| 26 | info->fullrange = is_fullrange; | ||
| 27 | +#if LIBAVUTIL_VERSION_MAJOR < 60 | ||
| 28 | info->interlaced = h->frame->interlaced_frame; | ||
| 29 | info->tff = h->frame->top_field_first; | ||
| 30 | +#else | ||
| 31 | + info->interlaced = !!(h->frame->flags & AV_FRAME_FLAG_INTERLACED); | ||
| 32 | + info->tff = !!(h->frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST); | ||
| 33 | +#endif | ||
| 34 | } | ||
| 35 | |||
| 36 | if( h->vfr_input ) | ||
| 37 | -- | ||
| 38 | GitLab | ||
| 39 | |||
diff --git a/meta/recipes-multimedia/x264/x264_git.bb b/meta/recipes-multimedia/x264/x264_git.bb index 3cc3392593..eb72ba006a 100644 --- a/meta/recipes-multimedia/x264/x264_git.bb +++ b/meta/recipes-multimedia/x264/x264_git.bb | |||
| @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | |||
| 9 | DEPENDS = "nasm-native" | 9 | DEPENDS = "nasm-native" |
| 10 | 10 | ||
| 11 | SRC_URI = "git://code.videolan.org/videolan/x264.git;branch=stable;protocol=https \ | 11 | SRC_URI = "git://code.videolan.org/videolan/x264.git;branch=stable;protocol=https \ |
| 12 | file://32c3b801191522961102d4bea292cdb61068d0dd.patch \ | ||
| 12 | " | 13 | " |
| 13 | UPSTREAM_CHECK_COMMITS = "1" | 14 | UPSTREAM_CHECK_COMMITS = "1" |
| 14 | 15 | ||
| @@ -25,6 +26,13 @@ X264_DISABLE_ASM:armv5 = "--disable-asm" | |||
| 25 | X264_DISABLE_ASM:powerpc = "${@bb.utils.contains("TUNE_FEATURES", "spe", "--disable-asm", "", d)}" | 26 | X264_DISABLE_ASM:powerpc = "${@bb.utils.contains("TUNE_FEATURES", "spe", "--disable-asm", "", d)}" |
| 26 | X264_DISABLE_ASM:mipsarch = "${@bb.utils.contains("TUNE_FEATURES", "r6", "", "--disable-asm", d)}" | 27 | X264_DISABLE_ASM:mipsarch = "${@bb.utils.contains("TUNE_FEATURES", "r6", "", "--disable-asm", d)}" |
| 27 | 28 | ||
| 29 | PACKAGECONFIG ?= " \ | ||
| 30 | ffmpeg \ | ||
| 31 | ${@bb.utils.filter("DISTRO_FEATURES", "opencl", d)} \ | ||
| 32 | " | ||
| 33 | PACKAGECONFIG[ffmpeg] = "--enable-lavf --enable-swscale,--disable-lavf --disable-swscale,ffmpeg" | ||
| 34 | PACKAGECONFIG[opencl] = "--enable-opencl,--disable-opencl," | ||
| 35 | |||
| 28 | EXTRA_OECONF = '--prefix=${prefix} \ | 36 | EXTRA_OECONF = '--prefix=${prefix} \ |
| 29 | --host=${HOST_SYS} \ | 37 | --host=${HOST_SYS} \ |
| 30 | --libdir=${libdir} \ | 38 | --libdir=${libdir} \ |
| @@ -32,9 +40,6 @@ EXTRA_OECONF = '--prefix=${prefix} \ | |||
| 32 | --sysroot=${STAGING_DIR_TARGET} \ | 40 | --sysroot=${STAGING_DIR_TARGET} \ |
| 33 | --enable-shared \ | 41 | --enable-shared \ |
| 34 | --enable-static \ | 42 | --enable-static \ |
| 35 | --disable-lavf \ | ||
| 36 | --disable-swscale \ | ||
| 37 | --disable-opencl \ | ||
| 38 | --enable-pic \ | 43 | --enable-pic \ |
| 39 | ${X264_DISABLE_ASM} \ | 44 | ${X264_DISABLE_ASM} \ |
| 40 | --extra-cflags="${TUNE_CCARGS}" \ | 45 | --extra-cflags="${TUNE_CCARGS}" \ |
