From 9371bf437243811b3e5a8cf0da5c87d311555674 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Wed, 13 Sep 2023 18:36:41 +0000 Subject: [PATCH] Fix mpv video playback across devices. --- packages/graphics/mesa/package.mk | 3 ++- packages/multimedia/ffmpeg/package.mk | 18 ++++++++++++++++-- packages/multimedia/libplacebo/package.mk | 17 +++++++++++++++++ packages/multimedia/mpv/package.mk | 21 ++++++++++++++------- 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 packages/multimedia/libplacebo/package.mk diff --git a/packages/graphics/mesa/package.mk b/packages/graphics/mesa/package.mk index 8ba1b3f51..b07f5bd63 100644 --- a/packages/graphics/mesa/package.mk +++ b/packages/graphics/mesa/package.mk @@ -76,7 +76,8 @@ fi if [ "${VAAPI_SUPPORT}" = "yes" ] && listcontains "${GRAPHIC_DRIVERS}" "(r600|radeonsi)"; then PKG_DEPENDS_TARGET+=" libva" - PKG_MESON_OPTS_TARGET+=" -Dgallium-va=enabled" + PKG_MESON_OPTS_TARGET+=" -Dgallium-va=enabled \ + -Dvideo-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc" else PKG_MESON_OPTS_TARGET+=" -Dgallium-va=disabled" fi diff --git a/packages/multimedia/ffmpeg/package.mk b/packages/multimedia/ffmpeg/package.mk index 21582a473..199046fe7 100644 --- a/packages/multimedia/ffmpeg/package.mk +++ b/packages/multimedia/ffmpeg/package.mk @@ -39,6 +39,20 @@ if [ "${V4L2_SUPPORT}" = "yes" ]; then PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm)" PKG_FFMPEG_V4L2="--enable-v4l2_m2m --enable-libdrm" + if [ "${PROJECT}" = "Amlogic" -o "${PROJECT}" = "PC" -o "${DEVICE}" = "Rockchip" ]; then + PKG_V4L2_REQUEST="yes" + else + PKG_V4L2_REQUEST="no" + fi + + if [ "${PKG_V4L2_REQUEST}" = "yes" ]; then + PKG_DEPENDS_TARGET+=" systemd" + PKG_NEED_UNPACK+=" $(get_pkg_directory systemd)" + PKG_FFMPEG_V4L2+=" --enable-libudev --enable-v4l2-request" + else + PKG_FFMPEG_V4L2+=" --disable-libudev --disable-v4l2-request" + fi + if [ "${PKG_V4L2_REQUEST}" = "yes" ]; then PKG_DEPENDS_TARGET+=" systemd" PKG_NEED_UNPACK+=" $(get_pkg_directory systemd)" @@ -58,13 +72,13 @@ else PKG_FFMPEG_VAAPI="--disable-vaapi" fi -if [ "${DISPLAYSERVER}" != "x11" ]; then +if [ "${DISPLAYSERVER}" != "wl" ]; then PKG_DEPENDS_TARGET+=" libdrm" PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm)" PKG_FFMPEG_VAAPI=" --enable-libdrm" fi -if [ "${VDPAU_SUPPORT}" = "yes" -a "${DISPLAYSERVER}" = "x11" ]; then +if [ "${VDPAU_SUPPORT}" = "yes" -a "${DISPLAYSERVER}" = "wl" ]; then PKG_DEPENDS_TARGET+=" libvdpau" PKG_NEED_UNPACK+=" $(get_pkg_directory libvdpau)" PKG_FFMPEG_VDPAU="--enable-vdpau" diff --git a/packages/multimedia/libplacebo/package.mk b/packages/multimedia/libplacebo/package.mk new file mode 100644 index 000000000..6d901669b --- /dev/null +++ b/packages/multimedia/libplacebo/package.mk @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2023-present Fewtarius + +PKG_NAME="libplacebo" +PKG_VERSION="839e847e32ff0b6bb0a0c033b700245de6a333dc" +PKG_LICENSE="GPLv2+" +PKG_SITE="https://code.videolan.org/videolan/libplacebo" +PKG_URL="${PKG_SITE}.git" +PKG_DEPENDS_TARGET="toolchain ffmpeg SDL2 luajit libass waf:host" +PKG_LONGDESC="The core rendering algorithms and ideas of mpv rewritten as an independent library." + +if [ "${VULKAN_SUPPORT}" = "yes" ]; then + PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers" + PKG_MESON_OPTS_TARGET+=" -Dvulkan=enabled" +else + PKG_MESON_OPTS_TARGET+=" -Dvulkan=disabled" +fi diff --git a/packages/multimedia/mpv/package.mk b/packages/multimedia/mpv/package.mk index 21617c702..1e7cca6e0 100644 --- a/packages/multimedia/mpv/package.mk +++ b/packages/multimedia/mpv/package.mk @@ -3,20 +3,27 @@ # Copyright (C) 2022-present Fewtarius PKG_NAME="mpv" -PKG_VERSION="af9b53f3a3831531504906882efce0d979506ed3" +PKG_VERSION="662650bde319a57733bb4ea80f709a018d247f1d" PKG_LICENSE="GPLv2+" PKG_SITE="https://github.com/mpv-player/mpv" PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.tar.gz" -PKG_DEPENDS_TARGET="toolchain ffmpeg SDL2 luajit libass waf:host" +PKG_DEPENDS_TARGET="toolchain ffmpeg SDL2 luajit libass waf:host libplacebo" PKG_LONGDESC="Video player based on MPlayer/mplayer2 https://mpv.io" -if [ ! "${OPENGL}" = "no" ]; then - PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd" - PKG_MESON_OPTS_TARGET+=" -Dgl=enabled -Degl=disabled" -fi - if [ "${OPENGLES_SUPPORT}" = yes ]; then PKG_DEPENDS_TARGET+=" ${OPENGLES}" PKG_MESON_OPTS_TARGET+=" -Dgl=disabled -Degl=enabled" fi +if [ "${OPENGL_SUPPORT}" = "yes" ]; then + PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd" + PKG_MESON_OPTS_TARGET+=" -Dgl=enabled -Degl=disabled" +fi + +if [ "${DISPLAYSERVER}" = "wl" ]; then + PKG_MESON_OPTS_TARGET+=" -Dwayland=enabled" +else + PKG_MESON_OPTS_TARGET+=" -Dwayland=disabled" +fi + +PKG_MESON_OPTS_TARGET+=" -Dsdl2=enabled"