From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A3EA915813A for ; Wed, 15 Jan 2025 20:31:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E3DC9E0769; Wed, 15 Jan 2025 20:31:43 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C47F1E0769 for ; Wed, 15 Jan 2025 20:31:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2D593430F4 for ; Wed, 15 Jan 2025 20:31:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2DDD62078 for ; Wed, 15 Jan 2025 20:31:41 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1736973089.46ba3724fb99c3c0ff8cabf14487c1e8a5d2a0cc.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/vlc/, media-video/vlc/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/vlc/files/vlc-3.0.21-vaapi-w-ffmpeg5.patch media-video/vlc/vlc-3.0.21-r3.ebuild media-video/vlc/vlc-3.0.9999.ebuild X-VCS-Directories: media-video/vlc/ media-video/vlc/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 46ba3724fb99c3c0ff8cabf14487c1e8a5d2a0cc X-VCS-Branch: master Date: Wed, 15 Jan 2025 20:31:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9b74df21-6f13-48ba-ae68-997d8c7b92d9 X-Archives-Hash: b0eb5ae49a43492d008014acb916d8e1 commit: 46ba3724fb99c3c0ff8cabf14487c1e8a5d2a0cc Author: Andreas Sturmlechner gentoo org> AuthorDate: Wed Jan 15 20:24:19 2025 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Wed Jan 15 20:31:29 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46ba3724 media-video/vlc: Use upstream patch to fix USE=vaapi w/ >=ffmpeg-5 Bug: https://bugs.gentoo.org/864721 Signed-off-by: Andreas Sturmlechner gentoo.org> .../vlc/files/vlc-3.0.21-vaapi-w-ffmpeg5.patch | 149 +++++++++++++++++++++ .../{vlc-3.0.9999.ebuild => vlc-3.0.21-r3.ebuild} | 28 +--- media-video/vlc/vlc-3.0.9999.ebuild | 1 - 3 files changed, 156 insertions(+), 22 deletions(-) diff --git a/media-video/vlc/files/vlc-3.0.21-vaapi-w-ffmpeg5.patch b/media-video/vlc/files/vlc-3.0.21-vaapi-w-ffmpeg5.patch new file mode 100644 index 000000000000..322818b348b7 --- /dev/null +++ b/media-video/vlc/files/vlc-3.0.21-vaapi-w-ffmpeg5.patch @@ -0,0 +1,149 @@ +From ba5dc03aecc1d96f81b76838f845ebde7348cf62 Mon Sep 17 00:00:00 2001 +From: David Rosca +Date: Fri, 20 Dec 2024 20:24:36 +0100 +Subject: [PATCH] avcodec: vaapi: Support VAAPI with latest FFmpeg + +--- + configure.ac | 20 +------------ + modules/codec/Makefile.am | 2 +- + modules/codec/avcodec/avcommon_compat.h | 3 ++ + modules/codec/avcodec/vaapi.c | 38 +++++++++++++++++++++++-- + 4 files changed, 41 insertions(+), 22 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 00afb063c455..089339e10e0b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2550,25 +2550,7 @@ AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"]) + AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"]) + AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"]) + AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"]) +- +-have_avcodec_vaapi="no" +-AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [ +- VLC_SAVE_FLAGS +- CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" +- CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}" +- AC_CHECK_HEADERS([libavcodec/vaapi.h], [ +- AC_MSG_NOTICE([VA API acceleration activated]) +- have_avcodec_vaapi="yes" +- ],[ +- AS_IF([test -n "${enable_libva}"], [ +- AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing]) +- ], [ +- AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ]) +- ]) +- ]) +- VLC_RESTORE_FLAGS +-]) +-AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"]) ++AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"]) + + dnl + dnl dxva2 needs avcodec +diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am +index 6d9465fdaef9..dd04391c1bf7 100644 +--- a/modules/codec/Makefile.am ++++ b/modules/codec/Makefile.am +@@ -416,7 +416,7 @@ libvaapi_plugin_la_SOURCES = \ + codec/avcodec/vaapi.c hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h + libvaapi_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) + libvaapi_plugin_la_CFLAGS = $(AM_CFLAGS) $(AVCODEC_CFLAGS) +-libvaapi_plugin_la_LIBADD = $(LIBVA_LIBS) ++libvaapi_plugin_la_LIBADD = $(LIBVA_LIBS) $(AVCODEC_LIBS) + if HAVE_AVCODEC_VAAPI + if HAVE_VAAPI_DRM + codec_LTLIBRARIES += libvaapi_drm_plugin.la +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index ac02c06d2339..8ab6910f3250 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -84,6 +84,9 @@ + #ifndef FF_API_AVIO_WRITE_NONCONST // removed in ffmpeg 7 + # define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61) + #endif ++#ifndef FF_API_STRUCT_VAAPI_CONTEXT ++# define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59) ++#endif + + #endif /* HAVE_LIBAVCODEC_AVCODEC_H */ + +diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c +index c83269e43f30..e203baaf9ee2 100644 +--- a/modules/codec/avcodec/vaapi.c ++++ b/modules/codec/avcodec/vaapi.c +@@ -42,12 +42,25 @@ + # include + #endif + #include ++#if FF_API_STRUCT_VAAPI_CONTEXT + #include ++#else ++#include ++#endif + + #include "avcodec.h" + #include "va.h" + #include "../../hw/vaapi/vlc_vaapi.h" + ++#if !FF_API_STRUCT_VAAPI_CONTEXT ++struct vaapi_context ++{ ++ VADisplay display; ++ VAConfigID config_id; ++ VAContextID context_id; ++}; ++#endif ++ + struct vlc_va_sys_t + { + struct vlc_vaapi_instance *va_inst; +@@ -145,8 +158,10 @@ static void Delete(vlc_va_t *va, void **hwctx) + + (void) hwctx; + +- vlc_vaapi_DestroyContext(o, sys->hw_ctx.display, sys->hw_ctx.context_id); +- vlc_vaapi_DestroyConfig(o, sys->hw_ctx.display, sys->hw_ctx.config_id); ++ if (sys->hw_ctx.context_id != VA_INVALID_ID) ++ vlc_vaapi_DestroyContext(o, sys->hw_ctx.display, sys->hw_ctx.context_id); ++ if (sys->hw_ctx.config_id != VA_INVALID_ID) ++ vlc_vaapi_DestroyConfig(o, sys->hw_ctx.display, sys->hw_ctx.config_id); + vlc_vaapi_ReleaseInstance(sys->va_inst); + free(sys); + } +@@ -196,6 +211,7 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *d + sys->hw_ctx.config_id = VA_INVALID_ID; + sys->hw_ctx.context_id = VA_INVALID_ID; + ++#if FF_API_STRUCT_VAAPI_CONTEXT + sys->hw_ctx.config_id = + vlc_vaapi_CreateConfigChecked(o, sys->hw_ctx.display, i_profile, + VAEntrypointVLD, i_vlc_chroma); +@@ -211,6 +227,24 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *d + goto error; + + ctx->hwaccel_context = &sys->hw_ctx; ++#else ++ AVBufferRef *hwdev_ref = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VAAPI); ++ if (hwdev_ref == NULL) ++ goto error; ++ ++ AVHWDeviceContext *hwdev_ctx = (void *) hwdev_ref->data; ++ AVVAAPIDeviceContext *vadev_ctx = hwdev_ctx->hwctx; ++ vadev_ctx->display = va_dpy; ++ ++ if (av_hwdevice_ctx_init(hwdev_ref) < 0) ++ { ++ av_buffer_unref(&hwdev_ref); ++ goto error; ++ } ++ ++ ctx->hw_device_ctx = hwdev_ref; ++#endif ++ + va->sys = sys; + va->description = vaQueryVendorString(sys->hw_ctx.display); + va->get = Get; +-- +GitLab + diff --git a/media-video/vlc/vlc-3.0.9999.ebuild b/media-video/vlc/vlc-3.0.21-r3.ebuild similarity index 95% copy from media-video/vlc/vlc-3.0.9999.ebuild copy to media-video/vlc/vlc-3.0.21-r3.ebuild index 73417535b63d..540d7d7a940b 100644 --- a/media-video/vlc/vlc-3.0.9999.ebuild +++ b/media-video/vlc/vlc-3.0.21-r3.ebuild @@ -1,35 +1,19 @@ -# Copyright 2000-2024 Gentoo Authors +# Copyright 2000-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 LUA_COMPAT=( lua5-{1..2} ) - -MY_PV="${PV/_/-}" -MY_PV="${MY_PV/-beta/-test}" -MY_P="${PN}-${MY_PV}" -if [[ ${PV} = *9999 ]] ; then - if [[ ${PV%.9999} != ${PV} ]] ; then - EGIT_BRANCH="3.0.x" - fi - EGIT_REPO_URI="https://code.videolan.org/videolan/vlc.git" - inherit git-r3 -else - if [[ ${MY_P} = ${P} ]] ; then - SRC_URI="https://download.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.xz" - else - SRC_URI="https://download.videolan.org/pub/videolan/testing/${MY_P}/${MY_P}.tar.xz" - fi - S="${WORKDIR}/${MY_P}" - KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv -sparc ~x86" -fi inherit autotools flag-o-matic lua-single toolchain-funcs virtualx xdg DESCRIPTION="Media player and framework with support for most multimedia files and streaming" HOMEPAGE="https://www.videolan.org/vlc/" +SRC_URI="https://download.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.xz + https://dev.gentoo.org/~asturm/distfiles/${P}-taglib2.tar.xz" LICENSE="LGPL-2.1 GPL-2" SLOT="0/5-9" # vlc - vlccore +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv -sparc ~x86" IUSE="a52 alsa aom archive aribsub bidi bluray cddb chromaprint chromecast dav1d dbus dc1394 debug directx dts +dvbpsi dvd +encode faad fdk +ffmpeg flac fluidsynth @@ -233,7 +217,9 @@ PATCHES=( "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch "${FILESDIR}"/${PN}-3.0.18-drop-minizip-dep.patch "${FILESDIR}"/${PN}-3.0.21-freerdp-2.patch # bug 919296, 590164 - "${FILESDIR}"/${PN}-3.0.21-vaapi-without-ffmpeg4.patch # bug 864721, thx Fedora + "${WORKDIR}"/${P}-taglib2 # bug 938946, in 3.0.x branch + "${FILESDIR}"/${PN}-3.0.2.1-vdpau.patch # bug 946178 + "${FILESDIR}"/${P}-vaapi-w-ffmpeg5.patch # bug 864721, in 3.0.x branch ) DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt ) diff --git a/media-video/vlc/vlc-3.0.9999.ebuild b/media-video/vlc/vlc-3.0.9999.ebuild index 73417535b63d..c3e406c30347 100644 --- a/media-video/vlc/vlc-3.0.9999.ebuild +++ b/media-video/vlc/vlc-3.0.9999.ebuild @@ -233,7 +233,6 @@ PATCHES=( "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch "${FILESDIR}"/${PN}-3.0.18-drop-minizip-dep.patch "${FILESDIR}"/${PN}-3.0.21-freerdp-2.patch # bug 919296, 590164 - "${FILESDIR}"/${PN}-3.0.21-vaapi-without-ffmpeg4.patch # bug 864721, thx Fedora ) DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt )