Summary: | [new port] multimedia/libva: VAAPI wrapper and dummy driver | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | swell.k <swell.k> | ||||
Component: | Individual Port(s) | Assignee: | Max Brazhnikov <makc> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | ||||||
Priority: | Normal | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
swell.k
2011-01-06 13:00:24 UTC
Responsible Changed From-To: freebsd-ports-bugs->pgollucci pgollucci@ wants his PRs (via the GNATS Auto Assign Tool) Oops, forgot to $ cvs add files files/* after using `git reset --hard'. --- a.diff begins here --- Index: multimedia/libva/files/patch-i965_drv_video-Makefile.am =================================================================== RCS file: multimedia/libva/files/patch-i965_drv_video-Makefile.am diff -N multimedia/libva/files/patch-i965_drv_video-Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/files/patch-i965_drv_video-Makefile.am 5 Jan 2011 13:34:27 -0000 @@ -0,0 +1,13 @@ +--- i965_drv_video/Makefile.am~ ++++ i965_drv_video/Makefile.am +@@ -26,8 +26,8 @@ AM_CFLAGS = -Wall -I$(top_srcdir) -I$(to + + i965_drv_video_la_LTLIBRARIES = i965_drv_video.la + i965_drv_video_ladir = @LIBVA_DRIVERS_PATH@ +-i965_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,--no-undefined @DRM_LIBS@ -ldrm_intel +-i965_drv_video_la_LIBADD = ../va/libva-x11.la -lpthread ++i965_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,--no-undefined @DRM_LIBS@ -ldrm_intel -pthread ++i965_drv_video_la_LIBADD = ../va/libva-x11.la + + i965_drv_video_la_SOURCES = \ + object_heap.c \ Index: multimedia/libva/files/patch-test-putsurface-Makefile.am =================================================================== RCS file: multimedia/libva/files/patch-test-putsurface-Makefile.am diff -N multimedia/libva/files/patch-test-putsurface-Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/files/patch-test-putsurface-Makefile.am 5 Jan 2011 13:34:27 -0000 @@ -0,0 +1,13 @@ +--- test/putsurface/Makefile.am~ 2011-01-05 02:07:32.000000000 +0300 ++++ test/putsurface/Makefile.am 2011-01-05 02:07:54.000000000 +0300 +@@ -23,8 +23,9 @@ + bin_PROGRAMS = putsurface + + AM_CFLAGS = -I$(top_srcdir)/va -I$(top_srcdir)/src/x11 ++AM_LDFLAGS = -pthread + +-TEST_LIBS = $(top_builddir)/va/$(libvabackendlib) -lpthread ++TEST_LIBS = $(top_builddir)/va/$(libvabackendlib) + + putsurface_LDADD = $(TEST_LIBS) + putsurface_SOURCES = putsurface.c --- a.diff ends here --- Update, mostly for intel va driver, see http://www.phoronix.com/scan.php?page=news_item&px=ODk4OA which is unused in the port. --- a.diff begins here --- diff --git multimedia/libva/Makefile multimedia/libva/Makefile index f9f576e..a7dd0f5 100644 --- multimedia/libva/Makefile +++ multimedia/libva/Makefile @@ -6,7 +6,7 @@ # PORTNAME= libva -PORTVERSION= 1.0.6 +PORTVERSION= 1.0.7 CATEGORIES= multimedia MASTER_SITES= http://cgit.freedesktop.org/${PORTNAME}/snapshot/ diff --git multimedia/libva/distinfo multimedia/libva/distinfo index 1010d22..4bdb962 100644 --- multimedia/libva/distinfo +++ multimedia/libva/distinfo @@ -1,2 +1,2 @@ -SHA256 (libva-1.0.6.tar.bz2) = becba4898fe4286eeefbd23f044639362c4f6066e74d3e2990999c27776d6e60 -SIZE (libva-1.0.6.tar.bz2) = 453303 +SHA256 (libva-1.0.7.tar.bz2) = 4c33ceb3cef3a7be542ed0f87f3cb75838b5d0c1246a39319138ca4df98c73fb +SIZE (libva-1.0.7.tar.bz2) = 462067 --- a.diff ends here --- Make sure -L${LOCALBASE}/lib is passed to LDFLAGS. So, ld(1) from devel/binutils looks under LOCALBASE/lib by default... --- a.diff begins here --- diff --git multimedia/libva/Makefile multimedia/libva/Makefile index a7dd0f5..5bac739 100644 --- multimedia/libva/Makefile +++ multimedia/libva/Makefile @@ -25,11 +25,12 @@ USE_GL= gl USE_AUTOTOOLS= aclocal autoheader automake autoconf libtoolize ACLOCAL_ARGS= -I. AUTOMAKE_ARGS= --add-missing -CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" +CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" CONFIGURE_ARGS= --program-prefix=va USE_LDCONFIG= yes CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib # prevent types conflict: videodev2.h vs. drm.h CFLAGS+= -DHAVE_LINUX_INTEGER_TYPES --- a.diff ends here --- Does not compile with libGL-7.6.1: In file included from va_glx.c:26: va_glx_private.h:44: error: redefinition of typedef 'PFNGLXCREATEPIXMAPPROC' /usr/local/include/GL/glx.h:300: error: previous declaration of 'PFNGLXCREATEPIXMAPPROC' was here va_glx_private.h:45: error: redefinition of typedef 'PFNGLXDESTROYPIXMAPPROC' /usr/local/include/GL/glx.h:301: error: previous declaration of 'PFNGLXDESTROYPIXMAPPROC' was here the problem is in va_glx_private.h:#if GLX_GLXEXT_VERSION < 27 and with libGL-7.6.1: GLX_GLXEXT_VERSION = 25 if i just replace < 27 by < 25, all seems to be fine. Micka=C3=ABl Maillot <mickael.maillot@gmail.com> writes: > Does not compile with libGL-7.6.1: > In file included from va_glx.c:26: > va_glx_private.h:44: error: redefinition of typedef 'PFNGLXCREATEPIXMAPPR= OC' > /usr/local/include/GL/glx.h:300: error: previous declaration of > 'PFNGLXCREATEPIXMAPPROC' was here > va_glx_private.h:45: error: redefinition of typedef 'PFNGLXDESTROYPIXMAPP= ROC' > /usr/local/include/GL/glx.h:301: error: previous declaration of > 'PFNGLXDESTROYPIXMAPPROC' was here > > > the problem is in va_glx_private.h:#if GLX_GLXEXT_VERSION < 27 > and with libGL-7.6.1: GLX_GLXEXT_VERSION =3D 25 > > if i just replace < 27 by < 25, all seems to be fine. Thanks. My testing on libGL-7.6.1 and libGL-7.4.4 was flawed. I forget that the *order* of includes for lang/gcc45 is different from base gcc, e.g. in order to see the difference try to replace -I${LOCALBASE}/include with -isystem${LOCALBASE}/include It's same issue that also affects -DHAVE_LINUX_INTEGER_TYPES. So, just in case I'm including your patch along with -isystem. --- a.diff begins here --- diff --git multimedia/libva/Makefile multimedia/libva/Makefile index 5bac739..9292679 100644 --- multimedia/libva/Makefile +++ multimedia/libva/Makefile @@ -29,7 +29,7 @@ CONFIGURE_ENV=3D CPPFLAGS=3D"${CPPFLAGS}" LDFLAGS=3D"${LD= FLAGS}" CONFIGURE_ARGS=3D --program-prefix=3Dva USE_LDCONFIG=3D yes =20 -CPPFLAGS+=3D -I${LOCALBASE}/include +CPPFLAGS+=3D -isystem${LOCALBASE}/include LDFLAGS+=3D -L${LOCALBASE}/lib # prevent types conflict: videodev2.h vs. drm.h CFLAGS+=3D -DHAVE_LINUX_INTEGER_TYPES diff --git multimedia/libva/files/patch-va-glx-va_glx_private.h multimedia/= libva/files/patch-va-glx-va_glx_private.h new file mode 100644 index 0000000..86851df --- /dev/null +++ multimedia/libva/files/patch-va-glx-va_glx_private.h @@ -0,0 +1,11 @@ +--- va/glx/va_glx_private.h~ ++++ va/glx/va_glx_private.h +@@ -38,7 +38,7 @@ typedef void (*PFNGLXBINDTEXIMAGEEXTPROC + typedef void (*PFNGLXRELEASETEXIMAGEEXTPROC)(Display *, GLXDrawable, int); + #endif +=20 +-#if GLX_GLXEXT_VERSION < 27 ++#if GLX_GLXEXT_VERSION < 21 + /* XXX: this is not exactly that version but this is the only means to + make sure we have the correct <GL/glx.h> with those signatures */ + typedef GLXPixmap (*PFNGLXCREATEPIXMAPPROC)(Display *, GLXFBConfig, Pixma= p, const int *); --- a.diff ends here --- quoted-printable ruined previous patch. It's about time for a cumululative diff, anyway. --- a.diff begins here --- Index: multimedia/Makefile =================================================================== RCS file: /a/.cvsup/ports/multimedia/Makefile,v retrieving revision 1.402 diff -u -p -r1.402 Makefile --- multimedia/Makefile 3 Jan 2011 14:37:53 -0000 1.402 +++ multimedia/Makefile 5 Jan 2011 00:19:44 -0000 @@ -163,6 +163,7 @@ SUBDIR += libtheora SUBDIR += libtuner SUBDIR += libv4l + SUBDIR += libva SUBDIR += libvdpau SUBDIR += libvpx SUBDIR += libxine Index: multimedia/libva/Makefile =================================================================== RCS file: multimedia/libva/Makefile diff -N multimedia/libva/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/Makefile 8 Jan 2011 12:38:07 -0000 @@ -0,0 +1,61 @@ +# New ports collection makefile for: libva +# Date created: 5 Jan 2011 +# Whom: Anonymous +# +# $FreeBSD$ +# + +PORTNAME= libva +PORTVERSION= 1.0.7 +CATEGORIES= multimedia +MASTER_SITES= http://cgit.freedesktop.org/${PORTNAME}/snapshot/ + +MAINTAINER= swell.k@gmail.com +COMMENT= VAAPI wrapper and dummy driver + +BUILD_DEPENDS= ${LOCALBASE}/include/linux/videodev2.h:${PORTSDIR}/multimedia/v4l_compat +LIB_DEPENDS= drm.2:${PORTSDIR}/graphics/libdrm + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/COPYING + +USE_BZIP2= yes +USE_XORG= xext xfixes +USE_GL= gl +USE_AUTOTOOLS= aclocal autoheader automake autoconf libtoolize +ACLOCAL_ARGS= -I. +AUTOMAKE_ARGS= --add-missing +CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +CONFIGURE_ARGS= --program-prefix=va +USE_LDCONFIG= yes + +CPPFLAGS+= -isystem${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +# prevent types conflict: videodev2.h vs. drm.h +CFLAGS+= -DHAVE_LINUX_INTEGER_TYPES + +.include <bsd.port.pre.mk> + +.if !defined(WITH_DEBUG) +CFLAGS+= -DNDEBUG +.else +CFLAGS+= -D_DEBUG +.endif + +.if defined(STRIP) && ${STRIP} != "" +INSTALL_TARGET= install-strip +.endif + +post-patch: .SILENT + ${REINPLACE_CMD} -e 's|\($$libdir\)/dri|\1/va|' \ + -e 's|$${libdir}/\(pkgconfig\)|$${prefix}/libdata/\1|' \ + ${WRKSRC}/configure.ac + ${REINPLACE_CMD} 's/va\(info\)/\1/' ${WRKSRC}/test/Makefile.am + ${REINPLACE_CMD} 's/-ldl//' ${WRKSRC}/va/Makefile.am + ${REINPLACE_CMD} 's/dummy.*LDFLAGS.*/& -Wl,-lc/' \ + ${WRKSRC}/dummy_drv_video/Makefile.am + ${REINPLACE_CMD} 's/-pthread/${PTHREAD_LIBS}/' \ + ${WRKSRC}/i965_drv_video/Makefile.am \ + ${WRKSRC}/test/putsurface/Makefile.am + +.include <bsd.port.post.mk> Index: multimedia/libva/distinfo =================================================================== RCS file: multimedia/libva/distinfo diff -N multimedia/libva/distinfo --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/distinfo 8 Jan 2011 03:05:07 -0000 @@ -0,0 +1,2 @@ +SHA256 (libva-1.0.7.tar.bz2) = 4c33ceb3cef3a7be542ed0f87f3cb75838b5d0c1246a39319138ca4df98c73fb +SIZE (libva-1.0.7.tar.bz2) = 462067 Index: multimedia/libva/pkg-descr =================================================================== RCS file: multimedia/libva/pkg-descr diff -N multimedia/libva/pkg-descr --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/pkg-descr 4 Jan 2011 21:25:41 -0000 @@ -0,0 +1,6 @@ +The main motivation for VAAPI (Video Acceleration API) is to enable +hardware accelerated video decode/encode at various entry-points (VLD, +IDCT, Motion Compensation etc.) for the prevailing coding standards +today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3). + +WWW: http://freedesktop.org/wiki/Software/vaapi Index: multimedia/libva/pkg-plist =================================================================== RCS file: multimedia/libva/pkg-plist diff -N multimedia/libva/pkg-plist --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/pkg-plist 5 Jan 2011 18:46:38 -0000 @@ -0,0 +1,47 @@ +bin/vah264encode +bin/vainfo +bin/vampeg2vldemo +bin/vaputsurface +bin/vatest_01 +bin/vatest_02 +bin/vatest_03 +bin/vatest_04 +bin/vatest_05 +bin/vatest_06 +bin/vatest_07 +bin/vatest_08 +bin/vatest_09 +bin/vatest_10 +bin/vatest_11 +include/va/va.h +include/va/va_backend.h +include/va/va_backend_glx.h +include/va/va_backend_tpi.h +include/va/va_dri.h +include/va/va_dri2.h +include/va/va_dricommon.h +include/va/va_dummy.h +include/va/va_glx.h +include/va/va_tpi.h +include/va/va_version.h +include/va/va_x11.h +lib/libva-glx.la +lib/libva-glx.so +lib/libva-glx.so.1 +lib/libva-tpi.la +lib/libva-tpi.so +lib/libva-tpi.so.1 +lib/libva-x11.la +lib/libva-x11.so +lib/libva-x11.so.1 +lib/libva.la +lib/libva.so +lib/libva.so.1 +lib/va/dummy_drv_video.la +lib/va/dummy_drv_video.so +libdata/pkgconfig/libva-glx.pc +libdata/pkgconfig/libva-tpi.pc +libdata/pkgconfig/libva-x11.pc +libdata/pkgconfig/libva.pc +@dirrm include/va +@dirrmtry lib/va Index: multimedia/libva/files/patch-i965_drv_video-Makefile.am =================================================================== RCS file: multimedia/libva/files/patch-i965_drv_video-Makefile.am diff -N multimedia/libva/files/patch-i965_drv_video-Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/files/patch-i965_drv_video-Makefile.am 5 Jan 2011 13:34:27 -0000 @@ -0,0 +1,13 @@ +--- i965_drv_video/Makefile.am~ ++++ i965_drv_video/Makefile.am +@@ -26,8 +26,8 @@ AM_CFLAGS = -Wall -I$(top_srcdir) -I$(to + + i965_drv_video_la_LTLIBRARIES = i965_drv_video.la + i965_drv_video_ladir = @LIBVA_DRIVERS_PATH@ +-i965_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,--no-undefined @DRM_LIBS@ -ldrm_intel +-i965_drv_video_la_LIBADD = ../va/libva-x11.la -lpthread ++i965_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,--no-undefined @DRM_LIBS@ -ldrm_intel -pthread ++i965_drv_video_la_LIBADD = ../va/libva-x11.la + + i965_drv_video_la_SOURCES = \ + object_heap.c \ Index: multimedia/libva/files/patch-test-putsurface-Makefile.am =================================================================== RCS file: multimedia/libva/files/patch-test-putsurface-Makefile.am diff -N multimedia/libva/files/patch-test-putsurface-Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/files/patch-test-putsurface-Makefile.am 5 Jan 2011 13:34:27 -0000 @@ -0,0 +1,13 @@ +--- test/putsurface/Makefile.am~ 2011-01-05 02:07:32.000000000 +0300 ++++ test/putsurface/Makefile.am 2011-01-05 02:07:54.000000000 +0300 +@@ -23,8 +23,9 @@ + bin_PROGRAMS = putsurface + + AM_CFLAGS = -I$(top_srcdir)/va -I$(top_srcdir)/src/x11 ++AM_LDFLAGS = -pthread + +-TEST_LIBS = $(top_builddir)/va/$(libvabackendlib) -lpthread ++TEST_LIBS = $(top_builddir)/va/$(libvabackendlib) + + putsurface_LDADD = $(TEST_LIBS) + putsurface_SOURCES = putsurface.c Index: multimedia/libva/files/patch-va-glx-va_glx_private.h =================================================================== RCS file: multimedia/libva/files/patch-va-glx-va_glx_private.h diff -N multimedia/libva/files/patch-va-glx-va_glx_private.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/libva/files/patch-va-glx-va_glx_private.h 8 Jan 2011 12:25:41 -0000 @@ -0,0 +1,11 @@ +--- va/glx/va_glx_private.h~ ++++ va/glx/va_glx_private.h +@@ -38,7 +38,7 @@ typedef void (*PFNGLXBINDTEXIMAGEEXTPROC + typedef void (*PFNGLXRELEASETEXIMAGEEXTPROC)(Display *, GLXDrawable, int); + #endif + +-#if GLX_GLXEXT_VERSION < 27 ++#if GLX_GLXEXT_VERSION < 21 + /* XXX: this is not exactly that version but this is the only means to + make sure we have the correct <GL/glx.h> with those signatures */ + typedef GLXPixmap (*PFNGLXCREATEPIXMAPPROC)(Display *, GLXFBConfig, Pixmap, const int *); --- a.diff ends here --- I've tested multimedia/mplayer with vaapi patches from 20101115 and libva/vdpau-video ports work without issues. $ mplayer -vo vaapi:gl -va vaapi -msglevel all=3:decvideo=6:vo=6:cplayer=5 foo.mkv MPlayer SVN-r32577-snapshot-4.5.3 (C) 2000-2010 MPlayer Team Playing foo.mkv [matroska,webm @ 0x80aa09010] Estimating duration from bitrate, this may be inaccurate [vo_vaapi] Using OpenGL rendering X11 opening display: :0.0 vo: X11 color mask: FFFFFF (R:FF0000 G:FF00 B:FF) vo: X11 running at 1600x1200 with depth 24 and 32 bpp (":0.0" => local display) [x11] Detected wm supports NetWM. [x11] Detected wm supports FULLSCREEN state. [x11] Current fstype setting honours FULLSCREEN X atoms libva: libva version 0.31.1 Xlib: extension "XFree86-DRI" missing on display ":0.0". libva: va_getDriverName() returns 0 libva: Trying to open /usr/local/lib/va/nvidia_drv_video.so libva: va_openDriver() returns 0 ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family [VD_FFMPEG] VA API accelerated codec. INFO: libavcodec init OK! Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264) ========================================================================== ========================================================================== ========================================================================== AO: [oss] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Unsupported PixelFormat 61 [VD_FFMPEG] Trying pixfmt=1. [ffmpeg] aspect_ratio: 1.777778 VDec: vo config request - 1920 x 1080 (preferred colorspace: H.264 VA-API Acceleration) Trying filter chain: vo Movie-Aspect is 1.78:1 - prescaling to correct movie aspect. VO: [vaapi] 1920x1080 => 1920x1080 H.264 VA-API Acceleration [vo_vaapi] Using 1:1 VA surface mapping [VD_FFMPEG] XVMC-accelerated MPEG-2. *** [vo] Direct Rendering mp_image_t, 1920x1082x0bpp RGB packed, 0 bytes [h264 @ 0xbd6dc0]no picture *** [vo] Direct Rendering mp_image_t, 1920x1082x0bpp RGB packed, 0 bytes [h264 @ 0xbd6dc0]no picture *** [vo] Direct Rendering mp_image_t, 1920x1082x0bpp RGB packed, 0 bytes *** [vo] Direct Rendering mp_image_t, 1920x1082x0bpp RGB packed, 0 bytes *** [vo] Direct Rendering mp_image_t, 1920x1082x0bpp RGB packed, 0 bytes Uninit video: ffmpeg vo: uninit ... Exiting... (Quit) Responsible Changed From-To: pgollucci->freebsd-ports-bugs E-NO-TIME right now, back to pool Responsible Changed From-To: freebsd-ports-bugs->makc I'll take it. makc 2011-01-13 11:02:02 UTC FreeBSD ports repository Added files: multimedia/libva Makefile distinfo pkg-descr pkg-plist multimedia/libva/files patch-i965_drv_video-Makefile.am patch-test-putsurface-Makefile.am patch-va-glx-va_glx_private.h Log: Add new port multimedia/libva: The main motivation for VAAPI (Video Acceleration API) is to enable hardware accelerated video decode/encode at various entry-points (VLD, IDCT, Motion Compensation etc.) for the prevailing coding standards today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3). WWW: http://freedesktop.org/wiki/Software/vaapi PR: ports/153725 Submitted by: Anonymous <swell.k at gmail.com> Feature safe: yes Revision Changes Path 1.1 +61 -0 ports/multimedia/libva/Makefile (new) 1.1 +2 -0 ports/multimedia/libva/distinfo (new) 1.1 +13 -0 ports/multimedia/libva/files/patch-i965_drv_video-Makefile.am (new) 1.1 +13 -0 ports/multimedia/libva/files/patch-test-putsurface-Makefile.am (new) 1.1 +11 -0 ports/multimedia/libva/files/patch-va-glx-va_glx_private.h (new) 1.1 +6 -0 ports/multimedia/libva/pkg-descr (new) 1.1 +47 -0 ports/multimedia/libva/pkg-plist (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" State Changed From-To: open->closed New port added. Thanks! |