ports/153842: [patch] multimedia/mplayer: add VAAPI option
Anonymous
swell.k at gmail.com
Mon Jan 10 13:10:12 UTC 2011
>Number: 153842
>Category: ports
>Synopsis: [patch] multimedia/mplayer: add VAAPI option
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Jan 10 13:10:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Anonymous
>Release: FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
depends on ports/153725
>Description:
Provide a way to play files with VAAPI acceleration. Currently, it
requires an external patch. If it's too much of a burden to maintain
then get a formal rejection.
>How-To-Repeat:
$ mplayer -vo vaapi -va vaapi foo.mkv # VAAPI
$ mplayer -vo vdpau -va vdpau foo.mkv # VDPAU
In case the latter is not desired one can exclude 'vdpau' from
VAAPI_PATCHES and use ffblahvdpau codecs like before, e.g.
$ make install VAAPI_PATCHES='vaapi vaapi-0.29 vaapi-gma500-workaround'
$ mplayer -vo vdpau -vc ffh264vdpau foo.mkv
>Fix:
--- a.diff begins here ---
Index: multimedia/mplayer/Makefile
===================================================================
RCS file: /a/.cvsup/ports/multimedia/mplayer/Makefile,v
retrieving revision 1.200
diff -u -p -r1.200 Makefile
--- multimedia/mplayer/Makefile 2 Dec 2010 09:18:00 -0000 1.200
+++ multimedia/mplayer/Makefile 10 Jan 2011 12:40:57 -0000
@@ -23,6 +23,7 @@ OPTIONS+= X11GL "X11 video drivers: Open
OPTIONS+= X11XIN "X11 video drivers: Xinerama" on
OPTIONS+= X11VM "X11 VidMode support" on
OPTIONS+= X11XVMC "Enable XvMC acceleration" off
+OPTIONS+= VAAPI "Enable VAAPI acceleration" off
OPTIONS+= VDPAU "Enable Nvidia VDPAU acceleration" off
OPTIONS+= GUI "Enable GTK2 graphical user interface with X11" on
OPTIONS+= SDL "Enable SDL video output" off
@@ -145,6 +146,19 @@ CONFIGURE_ARGS+=--disable-x11 \
--disable-fontconfig
.endif
+.if defined(WITH_VAAPI) && !defined(WITH_VDPAU)
+BROKEN= VAAPI fails to link without VDPAU
+.endif
+
+.if defined(WITH_VAAPI)
+VAAPI_VERSION= 20101115
+VAAPI_PATCHES?= vaapi vaapi-0.29 vaapi-gma500-workaround vdpau
+MASTER_SITES+= http://www.splitted-desktop.com/~gbeauchesne/${PORTNAME}-vaapi/:vaapi
+DISTFILES+= ${PORTNAME}-vaapi-${VAAPI_VERSION}${EXTRACT_SUFX}:vaapi
+EXTRA_PATCHES+= ${PATCHDIR}/extra-vaapi-patch-libvo-stats.c
+LIB_DEPENDS+= va.1:${PORTSDIR}/multimedia/libva
+.endif
+
.if defined(WITH_VDPAU)
LIB_DEPENDS+= vdpau.1:${PORTSDIR}/multimedia/libvdpau
.else
@@ -231,6 +245,14 @@ pre-everything::
@${ECHO_MSG} "http://www.mplayerhq.hu/homepage/dload.html"
.endif
+pre-patch:
+.if defined(WITH_VAAPI)
+ @${ECHO_MSG} '===> Applying VAAPI patches: ${VAAPI_PATCHES}'
+. for f in ${VAAPI_PATCHES}
+ @${PATCH} -Efsp1 -d ${WRKSRC} -i ${WRKDIR}/${PORTNAME}-vaapi-${VAAPI_VERSION}/patches/${PORTNAME}-${f}.patch
+. endfor
+.endif
+
post-patch:
.if ${OSVERSION} >= 900010
@${REINPLACE_CMD} -e \
Index: multimedia/mplayer/Makefile.shared
===================================================================
RCS file: /a/.cvsup/ports/multimedia/mplayer/Makefile.shared,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile.shared
--- multimedia/mplayer/Makefile.shared 2 Dec 2010 09:18:00 -0000 1.10
+++ multimedia/mplayer/Makefile.shared 9 Jan 2011 22:57:25 -0000
@@ -7,7 +7,7 @@ MPLAYER_PORT_VERSION= 1.0.r${MPLAYER_SNA
CATEGORIES?= multimedia audio
MASTER_SITES= http://freebsd.unixfreunde.de/sources/ \
http://www.rrr.de/~riggs/mplayer/
-DISTNAME= mplayer-${MPLAYER_PORT_VERSION:S/.r/rc/g}
+DISTFILES= mplayer-${MPLAYER_PORT_VERSION:S/.r/rc/g}${EXTRACT_SUFX}
WRKSRC= ${WRKDIR}/mplayer-export-${MPLAYER_SNAPSHOT_DATE}
MAINTAINER?= riggs at rrr.de
Index: multimedia/mplayer/distinfo
===================================================================
RCS file: /a/.cvsup/ports/multimedia/mplayer/distinfo,v
retrieving revision 1.39
diff -u -p -r1.39 distinfo
--- multimedia/mplayer/distinfo 2 Dec 2010 09:18:00 -0000 1.39
+++ multimedia/mplayer/distinfo 9 Jan 2011 22:57:47 -0000
@@ -1,2 +1,4 @@
SHA256 (mplayer-1.0rc20101106.tar.bz2) = 00ea68f869435b1a5e363d87cf35fd6711f703aaa05a93f9e4d03a52f3ec8751
SIZE (mplayer-1.0rc20101106.tar.bz2) = 10014975
+SHA256 (mplayer-vaapi-20101115.tar.bz2) = 1e680592059b39b789c4252c6fe469a093b60e5174eab0485155d6358b72d243
+SIZE (mplayer-vaapi-20101115.tar.bz2) = 44944
Index: multimedia/mplayer/files/extra-vaapi-patch-libvo-stats.c
===================================================================
RCS file: multimedia/mplayer/files/extra-vaapi-patch-libvo-stats.c
diff -N multimedia/mplayer/files/extra-vaapi-patch-libvo-stats.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ multimedia/mplayer/files/extra-vaapi-patch-libvo-stats.c 9 Jan 2011 23:13:58 -0000
@@ -0,0 +1,14 @@
+--- libvo/stats.c~
++++ libvo/stats.c
+@@ -13,6 +13,11 @@
+ #include <glibtop/procstate.h>
+ #endif
+
++#if !defined __linux__
++#define __environ environ
++extern char **environ;
++#endif
++
+ // Process statistics
+ struct proc_stats {
+ uint64_t utime;
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list