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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B0279139084 for ; Sun, 17 Dec 2017 03:30:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E6DD4E0C5F; Sun, 17 Dec 2017 03:30:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B59FAE0C5F for ; Sun, 17 Dec 2017 03:30:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1AE0233BEB4 for ; Sun, 17 Dec 2017 03:30:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 851CDADCA for ; Sun, 17 Dec 2017 03:30:42 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1513481320.3e0c93bdde8b684243f8abcdf69fe15f1dcaea55.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/mpv/, media-video/mpv/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/mpv/files/mpv-libva2.patch media-video/mpv/mpv-0.27.0.ebuild X-VCS-Directories: media-video/mpv/ media-video/mpv/files/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: 3e0c93bdde8b684243f8abcdf69fe15f1dcaea55 X-VCS-Branch: master Date: Sun, 17 Dec 2017 03:30:42 +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-Archives-Salt: cf7a0278-de2e-40ec-8a3a-4f32127ae21b X-Archives-Hash: 8f1b1f9b54302f26a0740dcf8b73c40e commit: 3e0c93bdde8b684243f8abcdf69fe15f1dcaea55 Author: Lars Wendler gentoo org> AuthorDate: Sun Dec 17 03:26:33 2017 +0000 Commit: Lars Wendler gentoo org> CommitDate: Sun Dec 17 03:28:40 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e0c93bd media-video/mpv: Fixed compilation against libva2. Closes: https://bugs.gentoo.org/641384 Package-Manager: Portage-2.3.19, Repoman-2.3.6 media-video/mpv/files/mpv-libva2.patch | 88 ++++++++++++++++++++++++++++++++++ media-video/mpv/mpv-0.27.0.ebuild | 3 +- 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/media-video/mpv/files/mpv-libva2.patch b/media-video/mpv/files/mpv-libva2.patch new file mode 100644 index 00000000000..843e8449454 --- /dev/null +++ b/media-video/mpv/files/mpv-libva2.patch @@ -0,0 +1,88 @@ +From 2ecf240b1cd20875991a5b18efafbe799864ff7f Mon Sep 17 00:00:00 2001 +From: Mark Thompson +Date: Mon, 9 Oct 2017 20:10:26 +0100 +Subject: [PATCH] vaapi: Use libva2 message callbacks + +They are no longer global, so they work vaguely sensibly. +--- + video/vaapi.c | 32 +++++++++++++++++++++++++++++--- + 1 file changed, 29 insertions(+), 3 deletions(-) + +diff --git a/video/vaapi.c b/video/vaapi.c +index 6bedbbaa18..3b1cb9cc41 100644 +--- a/video/vaapi.c ++++ b/video/vaapi.c +@@ -40,9 +40,27 @@ int va_get_colorspace_flag(enum mp_csp csp) + return 0; + } + +-// VA message callbacks are global and do not have a context parameter, so it's +-// impossible to know from which VADisplay they originate. Try to route them +-// to existing mpv/libmpv instances within this process. ++#if VA_CHECK_VERSION(1, 0, 0) ++static void va_message_callback(void *context, const char *msg, int mp_level) ++{ ++ struct mp_vaapi_ctx *res = context; ++ mp_msg(res->log, mp_level, "libva: %s", msg); ++} ++ ++static void va_error_callback(void *context, const char *msg) ++{ ++ va_message_callback(context, msg, MSGL_ERR); ++} ++ ++static void va_info_callback(void *context, const char *msg) ++{ ++ va_message_callback(context, msg, MSGL_V); ++} ++#else ++// Pre-libva2 VA message callbacks are global and do not have a context ++// parameter, so it's impossible to know from which VADisplay they ++// originate. Try to route them to existing mpv/libmpv instances within ++// this process. + static pthread_mutex_t va_log_mutex = PTHREAD_MUTEX_INITIALIZER; + static struct mp_vaapi_ctx **va_mpv_clients; + static int num_va_mpv_clients; +@@ -77,6 +95,7 @@ static void va_info_callback(const char *msg) + { + va_message_callback(msg, MSGL_V); + } ++#endif + + static void open_lavu_vaapi_device(struct mp_vaapi_ctx *ctx) + { +@@ -108,6 +127,10 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog, + }, + }; + ++#if VA_CHECK_VERSION(1, 0, 0) ++ vaSetErrorCallback(display, va_error_callback, res); ++ vaSetInfoCallback(display, va_info_callback, res); ++#else + pthread_mutex_lock(&va_log_mutex); + MP_TARRAY_APPEND(NULL, va_mpv_clients, num_va_mpv_clients, res); + pthread_mutex_unlock(&va_log_mutex); +@@ -117,6 +140,7 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog, + #ifdef VA_FOURCC_I010 + vaSetErrorCallback(va_error_callback); + vaSetInfoCallback(va_info_callback); ++#endif + #endif + + int major, minor; +@@ -154,6 +178,7 @@ void va_destroy(struct mp_vaapi_ctx *ctx) + if (ctx->destroy_native_ctx) + ctx->destroy_native_ctx(ctx->native_ctx); + ++#if !VA_CHECK_VERSION(1, 0, 0) + pthread_mutex_lock(&va_log_mutex); + for (int n = 0; n < num_va_mpv_clients; n++) { + if (va_mpv_clients[n] == ctx) { +@@ -164,6 +189,7 @@ void va_destroy(struct mp_vaapi_ctx *ctx) + if (num_va_mpv_clients == 0) + TA_FREEP(&va_mpv_clients); // avoid triggering leak detectors + pthread_mutex_unlock(&va_log_mutex); ++#endif + + talloc_free(ctx); + } diff --git a/media-video/mpv/mpv-0.27.0.ebuild b/media-video/mpv/mpv-0.27.0.ebuild index 6981ed0d09a..0edb3df22f3 100644 --- a/media-video/mpv/mpv-0.27.0.ebuild +++ b/media-video/mpv/mpv-0.27.0.ebuild @@ -141,6 +141,7 @@ RDEPEND="${COMMON_DEPEND} PATCHES=( "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch" "${FILESDIR}/${PN}-0.23.0-make-libavdevice-check-accept-libav.patch" + "${FILESDIR}/${PN}-libva2.patch" #641384 ) pkg_setup() { @@ -151,7 +152,7 @@ src_prepare() { cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die chmod +x "${S}"/waf || die eapply "${FILESDIR}/${PV}" - default_src_prepare + default } src_configure() {