diff options
| author | Carlos J. Puga Medina <cpm@FreeBSD.org> | 2017-12-25 18:00:52 +0000 |
|---|---|---|
| committer | Carlos J. Puga Medina <cpm@FreeBSD.org> | 2017-12-25 18:00:52 +0000 |
| commit | ef24e94f8962beafe6703fde5a5534b7a3afc5b7 (patch) | |
| tree | 80c0097783ff8c3ccc886932d0678d8219373a6f /multimedia | |
| parent | 03948507f8a772d5a9f325ec379cf8c2b6d3d195 (diff) | |
Notes
Diffstat (limited to 'multimedia')
| -rw-r--r-- | multimedia/mpv/Makefile | 10 | ||||
| -rw-r--r-- | multimedia/mpv/files/patch-video_vaapi.c | 26 |
2 files changed, 19 insertions, 17 deletions
diff --git a/multimedia/mpv/Makefile b/multimedia/mpv/Makefile index 403c3fcff2ab..0812e75aae81 100644 --- a/multimedia/mpv/Makefile +++ b/multimedia/mpv/Makefile @@ -36,7 +36,6 @@ CONFIGURE_ARGS= --docdir="${EXAMPLESDIR}" \ --disable-optimize \ --disable-pdf \ --disable-rubberband \ - --disable-vaapi-wayland \ --disable-vapoursynth \ --disable-vapoursynth-lazy \ --enable-libmpv-shared @@ -153,6 +152,15 @@ ZSH_USE= PERL5=build ZSH_CONFIGURE_ENV= BIN_PERL="${PERL}" ZSH_CONFIGURE_ENABLE= zsh-comp +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MVAAPI} && ${PORT_OPTIONS:MWAYLAND} +CONFIGURE_ARGS+= --enable-vaapi-wayland +LIB_DEPENDS+= libva-wayland.so:multimedia/libva +.else +CONFIGURE_ARGS+= --disable-vaapi-wayland +.endif + post-patch: @${REINPLACE_CMD} -e 's|/pkgconfig/mpv.pc|data/pkgconfig/mpv.pc|g' \ ${WRKSRC}/wscript_build.py diff --git a/multimedia/mpv/files/patch-video_vaapi.c b/multimedia/mpv/files/patch-video_vaapi.c index 559665d1b0fe..ed8f5d98f2e1 100644 --- a/multimedia/mpv/files/patch-video_vaapi.c +++ b/multimedia/mpv/files/patch-video_vaapi.c @@ -4,16 +4,10 @@ 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 ---- video/vaapi.c +--- video/vaapi.c.orig 2017-09-13 01:40:14 UTC +++ video/vaapi.c -@@ -40,9 +40,27 @@ int va_get_colorspace_flag(enum mp_csp csp) - return 0; +@@ -112,9 +112,27 @@ static void va_get_formats(struct mp_vaa + ctx->image_formats = formats; } -// VA message callbacks are global and do not have a context parameter, so it's @@ -43,7 +37,7 @@ index 6bedbbaa18..3b1cb9cc41 100644 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) +@@ -149,6 +167,7 @@ static void va_info_callback(const char { va_message_callback(msg, MSGL_V); } @@ -51,7 +45,7 @@ index 6bedbbaa18..3b1cb9cc41 100644 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, +@@ -181,6 +200,10 @@ struct mp_vaapi_ctx *va_initialize(VADis }, }; @@ -62,15 +56,15 @@ index 6bedbbaa18..3b1cb9cc41 100644 pthread_mutex_lock(&va_log_mutex); MP_TARRAY_APPEND(NULL, va_mpv_clients, num_va_mpv_clients, res); pthread_mutex_unlock(&va_log_mutex); -@@ -118,6 +141,7 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog, +@@ -191,6 +214,7 @@ struct mp_vaapi_ctx *va_initialize(VADis vaSetErrorCallback(va_error_callback); vaSetInfoCallback(va_info_callback); #endif +#endif - int major, minor; - int status = vaInitialize(display, &major, &minor); -@@ -154,6 +178,7 @@ void va_destroy(struct mp_vaapi_ctx *ctx) + int major_version, minor_version; + int status = vaInitialize(display, &major_version, &minor_version); +@@ -231,6 +255,7 @@ void va_destroy(struct mp_vaapi_ctx *ctx if (ctx->destroy_native_ctx) ctx->destroy_native_ctx(ctx->native_ctx); @@ -78,7 +72,7 @@ index 6bedbbaa18..3b1cb9cc41 100644 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) +@@ -241,6 +266,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); |
