Skip to contentSkip to conversation

package/libplacebo: add libplacebo package

PATCH Applied Bernd Kuhls 2 participants 4 messages Oct 3, 2025 – Jan 1 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/libplacebo: add libplacebo package

From: Javad Rahimipetroudi <[email protected]>

This patch adds libplacebo package that is used by mpv player.
libplacebo is the core rendering algorithms and ideas of mpv rewritten as an independent library and contains a large assortment of video processing shaders, focusing on both quality and performance.

[Bernd:
- bumped to v7.351.0
- moved Kconfig option to Multimedia (Sen)
- rebased patch 0001 after version bump
- added project URL to Config.in helptext
- removed redundancy in Config.in comment
- added comment to hash file
- switched _SITE to official repo
- added patch to fix build error with latest python3]

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...ild-fix-linker-error-in-uclibc-sparc.patch | 45 +++++++++++++++++++
 ...h-add-static_assert-define-for-ulibc.patch | 36 +++++++++++++++
 ...vulkan-utils_gen-fix-for-python-3.14.patch | 31 +++++++++++++
 package/libplacebo/Config.in                  | 20 +++++++++
 package/libplacebo/libplacebo.hash            |  3 ++
 package/libplacebo/libplacebo.mk              | 15 +++++++
 8 files changed, 152 insertions(+)
 create mode 100644 package/libplacebo/0001-meson.build-fix-linker-error-in-uclibc-sparc.patch
 create mode 100644 package/libplacebo/0002-src-pl_assert.h-add-static_assert-define-for-ulibc.patch
 create mode 100644 package/libplacebo/0003-vulkan-utils_gen-fix-for-python-3.14.patch
 create mode 100644 package/libplacebo/Config.in
 create mode 100644 package/libplacebo/libplacebo.hash
 create mode 100644 package/libplacebo/libplacebo.mk
DEVELOPERS +1 -0
index c2c867263a..b4bcda651c 100644
@@ -428,6 +428,7 @@ F:	package/libnpth/
 F:	package/libogg/
 F:	package/libopenh264/
 F:	package/libpciaccess/
+F:	package/libplacebo/
 F:	package/libplatform/
 F:	package/libpng/
 F:	package/libsidplay2/
package/Config.in +1 -0
index acc1c8258b..a88f254be5 100644
@@ -1993,6 +1993,7 @@ menu "Multimedia"
 	source "package/libopenaptx/Config.in"
 	source "package/libopenh264/Config.in"
 	source "package/libopusenc/Config.in"
+	source "package/libplacebo/Config.in"
 	source "package/libtheora/Config.in"
 	source "package/libudfread/Config.in"
 	source "package/libvpx/Config.in"
package/libplacebo/0001-meson.build-fix-linker-error-in-uclibc-sparc.patch new file +45 -0

45 lines not on this page · raw message

package/libplacebo/0002-src-pl_assert.h-add-static_assert-define-for-ulibc.patch new file +36 -0
new file mode 100644
index 0000000000..6960c2f219
@@ -0,0 +1,36 @@
+From 0182e2b94bbc6bb964f96527d18e93c9b4709a3a Mon Sep 17 00:00:00 2001
+From: Javad Rahimipetroudi <[email protected]>
+Date: Fri, 19 Jul 2024 07:57:45 +0200
+Subject: [PATCH] src/pl_assert.h:add static_assert define for ulibc
+
+This PR adds the static_assert macro defination for uClibc that is
+missed in some platforms. However, it is limited to C versions lower
+than C23. From C23, static_assert is not defined as macro anymore:
+https://en.cppreference.com/w/c/language/_Static_assert
+
+Signed-off-by: Javad Rahimipetroudi <[email protected]>
+Upstream: https://github.com/haasn/libplacebo/commit/0182e2b94bbc6bb964f96527d18e93c9b4709a3a
+---
+ src/pl_assert.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/pl_assert.h b/src/pl_assert.h
+index b4c6656c..de9d3547 100644
+--- a/src/pl_assert.h
++++ b/src/pl_assert.h
+@@ -20,6 +20,12 @@
+ #include <stdio.h>
+ #include <assert.h>
+ 
++#if !defined (__cplusplus)
++#if (__STDC_VERSION__ < 202301L)
++#define static_assert _Static_assert
++#endif
++#endif
++
+ #ifndef NDEBUG
+ # define pl_assert assert
+ #else
+-- 
+2.45.2
+
package/libplacebo/0003-vulkan-utils_gen-fix-for-python-3.14.patch new file +31 -0
new file mode 100644
index 0000000000..86f7c00856
@@ -0,0 +1,31 @@
+From a22f0dff5fe89385155743a1735b146babfdb131 Mon Sep 17 00:00:00 2001
+From: Nicolas Chauvet <[email protected]>
+Date: Tue, 29 Jul 2025 11:42:35 +0200
+Subject: [PATCH] vulkan/utils_gen: fix for python 3.14
+
+Python 3.14+ has added more type checking. This patch fixes usage
+
+Fixes: https://github.com/haasn/libplacebo/issues/335
+
+Upstream: https://code.videolan.org/videolan/libplacebo/-/commit/12509c0f1ee8c22ae163017f0a5e7b8a9d983a17
+
+Signed-off-by: Nicolas Chauvet <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ src/vulkan/utils_gen.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/vulkan/utils_gen.py b/src/vulkan/utils_gen.py
+index 9a97d35f..9b803d82 100644
+--- a/src/vulkan/utils_gen.py
++++ b/src/vulkan/utils_gen.py
+@@ -202,7 +202,8 @@ def find_registry_xml(datadir):
+     if not xmlfile or xmlfile == '':
+         xmlfile = find_registry_xml(datadir)
+ 
+-    registry = VkXML(ET.parse(xmlfile))
++    tree = ET.parse(xmlfile)
++    registry = VkXML(tree.getroot())
+     with open(outfile, 'w') as f:
+         f.write(TEMPLATE.render(
+             vkresults = get_vkenum(registry, 'VkResult'),
package/libplacebo/Config.in new file +20 -0
new file mode 100644
index 0000000000..739de5c05c
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBPLACEBO
+	bool "libplacebo"
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_10 # C++20
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
+	depends on !BR2_STATIC_LIBS # needs <dlfcn.h>
+	help
+	  libplacebo is, in a nutshell, the core rendering
+	  algorithms and ideas of mpv rewritten as an
+	  independent library. As of today, libplacebo
+	  contains a large assortment of video processing
+	  shaders, focusing on both quality and performance.
+
+	  https://libplacebo.org
+
+comment "libplacebo needs a toolchain w/ dynamic library, threads, gcc >= 10"
+	depends on BR2_USE_MMU
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_10
package/libplacebo/libplacebo.hash new file +3 -0
new file mode 100644
index 0000000000..302afcca16
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  46b501842e5b18867c6b7dd5c901e65ad6396608ad76309c366d8ace8be0d0d7  libplacebo-v7.351.0-git4.tar.gz
+sha256  b3aa400aca6d2ba1f0bd03bd98d03d1fe7489a3bbb26969d72016360af8a5c9d  LICENSE
package/libplacebo/libplacebo.mk new file +15 -0
new file mode 100644
index 0000000000..67bf0f00fb
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libplacebo
+#
+################################################################################
+
+LIBPLACEBO_VERSION = v7.351.0
+LIBPLACEBO_SITE = https://code.videolan.org/videolan/libplacebo.git
+LIBPLACEBO_SITE_METHOD = git
+LIBPLACEBO_GIT_SUBMODULES = YES
+LIBPLACEBO_LICENSE = LGPL-2.1
+LIBPLACEBO_LICENSE_FILES = LICENSE
+LIBPLACEBO_INSTALL_STAGING = YES
+
+$(eval $(meson-package))
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/mpv: bump version to 0.4.0

Added upstream patch to fix build with ffmpeg 8.0.

Added dependency to libplacebo:
https://github.com/mpv-player/mpv/commit/f5ca11e12bc55d14bd6895b619c4abfd470c6452

Added optional dependency to libdisplay-info when libdrm is enabled:
https://github.com/mpv-player/mpv/commit/a4d9bdd262b808d0c8663d28023ff21fef862803

Removed rpi-specific code:
https://github.com/mpv-player/mpv/commit/343a5fd345a84572ea5693a805119067d5b0fbc8

Removed configure options for atomic support:
https://github.com/mpv-player/mpv/commit/2fa695c3f9d4164344228ef4083e87369de3bb33

---
 ...mpilation-after-deprecated-definitio.patch | 39 +++++++++++++++++++
 package/mpv/Config.in                         | 12 ++++--
 package/mpv/mpv.hash                          |  4 +-
 package/mpv/mpv.mk                            | 22 +++--------
 4 files changed, 55 insertions(+), 22 deletions(-)
 create mode 100644 package/mpv/0001-demux_mkv-fix-compilation-after-deprecated-definitio.patch
package/mpv/0001-demux_mkv-fix-compilation-after-deprecated-definitio.patch new file +39 -0
new file mode 100644
index 0000000000..8e216497f4
@@ -0,0 +1,39 @@
+From 26b29fba02a2782f68e2906f837d21201fc6f1b9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
+Date: Fri, 28 Mar 2025 19:12:01 +0100
+Subject: [PATCH] demux_mkv: fix compilation after deprecated definitions
+ removal
+
+See: https://github.com/FFmpeg/FFmpeg/commit/822432769868da325ba03774df1084aa78b9a5a0
+
+Upstream: https://github.com/mpv-player/mpv/commit/26b29fba02a2782f68e2906f837d21201fc6f1b9
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ demux/demux_mkv.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
+index 135edcc23d82b..cc7ce3e98f4f6 100644
+--- a/demux/demux_mkv.c
++++ b/demux/demux_mkv.c
+@@ -2200,16 +2200,16 @@ static int demux_mkv_open_sub(demuxer_t *demuxer, mkv_track_t *track)
+             // [0x30..0x37] are component tags utilized for
+             // non-mobile captioning service ("profile A").
+             if (component_tag >= 0x30 && component_tag <= 0x37)
+-                lav->profile = FF_PROFILE_ARIB_PROFILE_A;
++                lav->profile = AV_PROFILE_ARIB_PROFILE_A;
+             break;
+         case 0x0012:
+             // component tag 0x87 signifies a mobile/partial reception
+             // (1seg) captioning service ("profile C").
+             if (component_tag == 0x87)
+-                lav->profile = FF_PROFILE_ARIB_PROFILE_C;
++                lav->profile = AV_PROFILE_ARIB_PROFILE_C;
+             break;
+         }
+-        if (lav->profile == FF_PROFILE_UNKNOWN)
++        if (lav->profile == AV_PROFILE_UNKNOWN)
+             MP_WARN(demuxer, "ARIB caption profile %02x / %04x not supported.\n",
+                     component_tag, data_component_id);
+     }
package/mpv/Config.in +8 -4
index 5c32f593fe..a4515a97e0 100644
@@ -6,18 +6,21 @@ config BR2_PACKAGE_MPV_SUPPORTS_VAAPI
 
 config BR2_PACKAGE_MPV
 	bool "mpv"
-	depends on BR2_INSTALL_LIBSTDCPP # libass
+	depends on BR2_INSTALL_LIBSTDCPP # libass, libplacebo
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libass
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
-	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C11/stdatomic.h
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_10 # libplacebo
 	depends on BR2_TOOLCHAIN_HAS_ATOMIC
+	depends on !BR2_STATIC_LIBS # libplacebo
 	select BR2_PACKAGE_ALSA_LIB_MIXER if BR2_PACKAGE_ALSA_LIB
 	select BR2_PACKAGE_ALSA_LIB_PCM if BR2_PACKAGE_ALSA_LIB
+	select BR2_PACKAGE_LIBDISPLAY_INFO if BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	select BR2_PACKAGE_FFMPEG
 	select BR2_PACKAGE_FFMPEG_SWSCALE
 	select BR2_PACKAGE_LIBASS
+	select BR2_PACKAGE_LIBPLACEBO
 	select BR2_PACKAGE_ZLIB
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS if BR2_PACKAGE_WAYLAND
 	# Select xkbcommon for wayland to avoid being mysterious
@@ -35,10 +38,11 @@ config BR2_PACKAGE_MPV
 
 	  https://mpv.io/
 
-comment "mpv needs a toolchain w/ C++, NPTL, gcc >= 4.9"
+comment "mpv needs a toolchain w/ C++, NPTL, gcc >= 10, dynamic library"
 	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
 		!BR2_INSTALL_LIBSTDCPP || \
-		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_10 || \
+		BR2_STATIC_LIBS
package/mpv/mpv.hash +2 -2
index a09015619d..55011bf339 100644
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256  41df981b7b84e33a2ef4478aaf81d6f4f5c8b9cd2c0d337ac142fc20b387d1a9  mpv-0.35.1.tar.gz
-sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  LICENSE.GPL
+sha256  10a0f4654f62140a6dd4d380dcf0bbdbdcf6e697556863dc499c296182f081a3  mpv-0.40.0.tar.gz
+sha256  edaef632cbb643e4e7a221717a6c441a4c1a7c918e6e4d56debc3d8739b233f6  LICENSE.GPL
package/mpv/mpv.mk +6 -16
index 8832b68ece..29d4ebfaf7 100644
@@ -4,10 +4,10 @@
 #
 ################################################################################
 
-MPV_VERSION = 0.35.1
+MPV_VERSION = 0.40.0
 MPV_SITE = $(call github,mpv-player,mpv,v$(MPV_VERSION))
 MPV_DEPENDENCIES = \
-	host-pkgconf ffmpeg libass zlib \
+	host-pkgconf ffmpeg libass libplacebo zlib \
 	$(if $(BR2_PACKAGE_LIBICONV),libiconv)
 MPV_LICENSE = GPL-2.0+
 MPV_LICENSE_FILES = LICENSE.GPL
@@ -37,6 +37,10 @@ else
 MPV_CONF_OPTS += -Dalsa=disabled
 endif
 
+ifeq ($(BR2_PACKAGE_LIBDISPLAY_INFO),y)
+MPV_DEPENDENCIES += libdisplay-info
+endif
+
 ifeq ($(BR2_PACKAGE_MESA3D_GBM),y)
 MPV_CONF_OPTS += -Dgbm=enabled
 MPV_DEPENDENCIES += mesa3d
@@ -162,14 +166,6 @@ else
 MPV_CONF_OPTS += -Dsdl2=disabled
 endif
 
-# Raspberry Pi support
-ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
-MPV_CONF_OPTS += -Drpi=enabled -Dgl=enabled
-MPV_DEPENDENCIES += rpi-userland
-else
-MPV_CONF_OPTS += -Drpi=disabled
-endif
-
 # va-api support
 ifeq ($(BR2_PACKAGE_LIBVA)$(BR2_PACKAGE_MPV_SUPPORTS_VAAPI),yy)
 MPV_CONF_OPTS += -Dvaapi=enabled
@@ -214,10 +210,4 @@ else
 MPV_CONF_OPTS += -Dx11=disabled
 endif
 
-ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-MPV_CONF_OPTS += -Dstdatomic=enabled
-else
-MPV_CONF_OPTS += -Dstdatomic=disabled
-endif
-
 $(eval $(meson-package))
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/2] package/mpv: bump version to 0.4.0

Hello,

Quoted 14 lines · On Fri, 3 Oct 2025 16:30:43 +0200 Bernd Kuhls <[email protected]> wrote:

Added upstream patch to fix build with ffmpeg 8.0.

Added dependency to libplacebo:
https://github.com/mpv-player/mpv/commit/f5ca11e12bc55d14bd6895b619c4abfd470c6452

Added optional dependency to libdisplay-info when libdrm is enabled:
https://github.com/mpv-player/mpv/commit/a4d9bdd262b808d0c8663d28023ff21fef862803

Removed rpi-specific code:
https://github.com/mpv-player/mpv/commit/343a5fd345a84572ea5693a805119067d5b0fbc8

Removed configure options for atomic support:
https://github.com/mpv-player/mpv/commit/2fa695c3f9d4164344228ef4083e87369de3bb33

Quoted 8 lines
---
 ...mpilation-after-deprecated-definitio.patch | 39 +++++++++++++++++++
 package/mpv/Config.in                         | 12 ++++--
 package/mpv/mpv.hash                          |  4 +-
 package/mpv/mpv.mk                            | 22 +++--------
 4 files changed, 55 insertions(+), 22 deletions(-)
 create mode 100644 package/mpv/0001-demux_mkv-fix-compilation-after-deprecated-definitio.patch

Applied to master after fixing the conflict caused by the recent removal of rpi-userland.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
In reply to Bernd Kuhls

Hello,

Quoted 10 lines · On Fri, 3 Oct 2025 16:30:42 +0200 Bernd Kuhls <[email protected]> wrote:

From: Javad Rahimipetroudi <[email protected]>

This patch adds libplacebo package that is used by mpv player.
libplacebo is the core rendering algorithms and ideas of mpv rewritten as an independent library and contains a large assortment of video processing shaders, focusing on both quality and performance.

[...]

Thanks for the patch, I've applied, after doing a few tweaks.

Quoted 9 lines
package/libplacebo/Config.in new file +3 -0
new file mode 100644
index 0000000000..739de5c05c
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBPLACEBO
+	bool "libplacebo"
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL

package/libplacebo/Config.in line 13

Quoted 10 lines
package/libplacebo/Config.in new file +10 -0
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_10 # C++20
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
+	depends on !BR2_STATIC_LIBS # needs <dlfcn.h>
+	help
+	  libplacebo is, in a nutshell, the core rendering
+	  algorithms and ideas of mpv rewritten as an
+	  independent library. As of today, libplacebo
+	  contains a large assortment of video processing
+	  shaders, focusing on both quality and performance.

Lines were a bit too short, rewrapped.

package/libplacebo/Config.in line 20

Quoted 7 lines
package/libplacebo/Config.in new file +7 -0
+
+	  https://libplacebo.org
+
+comment "libplacebo needs a toolchain w/ dynamic library, threads, gcc >= 10"
+	depends on BR2_USE_MMU
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_10

This comment didn't match the actual dependencies.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot