Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
Re: multimedia/vlc: enable VA-API on amd64
To:
Klemens Nanni <kn@openbsd.org>
Cc:
ports <ports@openbsd.org>, Brad Smith <brad@comstyle.com>
Date:
Mon, 15 Jul 2024 23:58:53 +0100

Download raw body.

Thread
On 2024/07/15 21:49, Klemens Nanni wrote:
> Keeping it actively disabled on !amd64 should not be needed as feature detection
> should gracefully fail, but doing it explicitly conveys meaning, so...

Untested and may need tweaking, but can I interest you in something
like this instead? It moves the existing i386/amd64 PFRAGs (which are
identical) to PFRAG.x86-main, and adds a new PFRAG.va-main for the
extra files for VA-API. Seems conceptually a little cleaner to me,
slightly easier to update PLISTs, and easier if another arch were to get
VA-API.

Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/vlc/Makefile,v
diff -u -p -r1.271 Makefile
--- Makefile	15 Jul 2024 21:04:48 -0000	1.271
+++ Makefile	15 Jul 2024 22:55:42 -0000
@@ -8,7 +8,7 @@ PKGNAME-jack=	vlc-jack-${V}
 CATEGORIES=	x11
 SITES=		https://download.videolan.org/pub/videolan/vlc/${V}/
 EXTRACT_SUFX=	.tar.xz
-REVISION-main=	0
+REVISION-main=	1
 
 USE_NOBTCFI=	Yes
 
@@ -65,11 +65,12 @@ WANTLIB-main += pcre2-16 pcre2-8 pixman-
 WANTLIB-main += rsvg-2 sharpyuv smb2 sndio soxr speex speexdsp ssl
 WANTLIB-main += swresample swscale tag tar tasn1 theoradec theoraenc
 WANTLIB-main += tiff udfread unibreak unistring usbhid utf8_range utf8_validity
-WANTLIB-main += vorbis vorbisenc vpx wayland-client wayland-cursor
-WANTLIB-main += wayland-egl webp x264 x265 xcb xcb-composite xcb-dri2
-WANTLIB-main += xcb-dri3 xcb-glx xcb-keysyms xcb-present xcb-randr
+WANTLIB-main += vorbis vorbisenc va va-drm va-x11 vpx wayland-client
+WANTLIB-main += wayland-cursor wayland-egl webp x264 x265 xcb xcb-composite
+WANTLIB-main += xcb-dri2 xcb-dri3 xcb-glx xcb-keysyms xcb-present xcb-randr
 WANTLIB-main += xcb-render xcb-shm xcb-sync xcb-xfixes xcb-xv xkbcommon
 WANTLIB-main += xml2 xshmfence xvidcore z zstd
+
 # v4l2 is dlopen'd
 WANTLIB-main+=	v4l2
 
@@ -175,7 +176,6 @@ CONFIGURE_ARGS+=--disable-a52 \
 		--disable-kwallet \
 		--disable-libmpeg2 \
 		--disable-libplacebo \
-		--disable-libva \
 		--disable-linsys \
 		--disable-live555 \
 		--disable-mad \
@@ -239,15 +239,16 @@ CONFIGURE_ARGS+=--disable-jack
 .endif
 
 .if ${MACHINE_ARCH} == "amd64"
-PKG_ARGS+=-Damd64=1
+PKG_ARGS+=-Dva=1
 .else
-PKG_ARGS+=-Damd64=0
+CONFIGURE_ARGS+=--disable-libva
+PKG_ARGS+=-Dva=0
 .endif
 
-.if ${MACHINE_ARCH} == "i386"
-PKG_ARGS+=-Di386=1
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+PKG_ARGS+=-Dx86=1
 .else
-PKG_ARGS+=-Di386=0
+PKG_ARGS+=-Dx86=0
 .endif
 
 post-extract:
Index: pkg/PFRAG.amd64-main
===================================================================
RCS file: pkg/PFRAG.amd64-main
diff -N pkg/PFRAG.amd64-main
--- pkg/PFRAG.amd64-main	11 Mar 2022 20:17:31 -0000	1.9
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,6 +0,0 @@
-@so lib/vlc/plugins/video_chroma/libi420_rgb_mmx_plugin.so
-@so lib/vlc/plugins/video_chroma/libi420_rgb_sse2_plugin.so
-@so lib/vlc/plugins/video_chroma/libi420_yuy2_mmx_plugin.so
-@so lib/vlc/plugins/video_chroma/libi420_yuy2_sse2_plugin.so
-@so lib/vlc/plugins/video_chroma/libi422_yuy2_mmx_plugin.so
-@so lib/vlc/plugins/video_chroma/libi422_yuy2_sse2_plugin.so
Index: pkg/PFRAG.i386-main
===================================================================
RCS file: pkg/PFRAG.i386-main
diff -N pkg/PFRAG.i386-main
--- pkg/PFRAG.i386-main	11 Mar 2022 20:17:31 -0000	1.8
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,6 +0,0 @@
-@so lib/vlc/plugins/video_chroma/libi420_rgb_mmx_plugin.so
-@so lib/vlc/plugins/video_chroma/libi420_rgb_sse2_plugin.so
-@so lib/vlc/plugins/video_chroma/libi420_yuy2_mmx_plugin.so
-@so lib/vlc/plugins/video_chroma/libi420_yuy2_sse2_plugin.so
-@so lib/vlc/plugins/video_chroma/libi422_yuy2_mmx_plugin.so
-@so lib/vlc/plugins/video_chroma/libi422_yuy2_sse2_plugin.so
Index: pkg/PFRAG.va-main
===================================================================
RCS file: pkg/PFRAG.va-main
diff -N pkg/PFRAG.va-main
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg/PFRAG.va-main	15 Jul 2024 22:55:42 -0000
@@ -0,0 +1,6 @@
+@so lib/vlc/plugins/codec/libvaapi_drm_plugin.so
+@so lib/vlc/plugins/codec/libvaapi_plugin.so
+lib/vlc/plugins/vaapi/
+@so lib/vlc/plugins/vaapi/libvaapi_filters_plugin.so
+@so lib/vlc/plugins/video_output/libglconv_vaapi_drm_plugin.so
+@so lib/vlc/plugins/video_output/libglconv_vaapi_x11_plugin.so
Index: pkg/PFRAG.x86-main
===================================================================
RCS file: pkg/PFRAG.x86-main
diff -N pkg/PFRAG.x86-main
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg/PFRAG.x86-main	15 Jul 2024 22:55:42 -0000
@@ -0,0 +1,6 @@
+@so lib/vlc/plugins/video_chroma/libi420_rgb_mmx_plugin.so
+@so lib/vlc/plugins/video_chroma/libi420_rgb_sse2_plugin.so
+@so lib/vlc/plugins/video_chroma/libi420_yuy2_mmx_plugin.so
+@so lib/vlc/plugins/video_chroma/libi420_yuy2_sse2_plugin.so
+@so lib/vlc/plugins/video_chroma/libi422_yuy2_mmx_plugin.so
+@so lib/vlc/plugins/video_chroma/libi422_yuy2_sse2_plugin.so
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/x11/vlc/pkg/PLIST-main,v
diff -u -p -r1.53 PLIST-main
--- pkg/PLIST-main	15 Jul 2024 21:04:48 -0000	1.53
+++ pkg/PLIST-main	15 Jul 2024 22:55:42 -0000
@@ -1,6 +1,6 @@
 @pkgpath x11/vlc
-%%amd64%%
-%%i386%%
+%%va%%
+%%x86%%
 bin/cvlc
 bin/qvlc
 bin/rvlc