Bug 153725 - [new port] multimedia/libva: VAAPI wrapper and dummy driver
Summary: [new port] multimedia/libva: VAAPI wrapper and dummy driver
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Max Brazhnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-06 13:00 UTC by swell.k
Modified: 2011-01-13 11:10 UTC (History)
0 users

See Also:


Attachments
a.diff (4.54 KB, patch)
2011-01-06 13:00 UTC, swell.k
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description swell.k 2011-01-06 13:00:24 UTC
From pkg-descr:

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

How-To-Repeat: $ vainfo
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
vainfo: VA API version: 0.31
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.3.pre2
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD

$ LIBVA_DRIVER_NAME=dummy vainfo
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
vainfo: VA API version: 0.31
vainfo: Driver version: Dummy Driver 1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointMoComp
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointMoComp
      VAProfileMPEG4Simple            : VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    : VAEntrypointVLD
      VAProfileMPEG4Main              : VAEntrypointVLD
      VAProfileH264Baseline           : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD

Let's try multimedia/vlc now. It's unlikely that CPU usage would drop to
around 2% for 1080p like when using mplayer-uau + vdpau.

$ cvlc --ffmpeg-hw foo.mkv
VLC media player 1.1.5 The Luggage (revision exported)
[...]
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
[0x82796b770] avcodec decoder: Using VA API version 0.31 for hardware decoding.

The dummy driver obviously not gonna work.

$ LIBVA_DRIVER_NAME=dummy cvlc --ffmpeg-hw foo.mkv
VLC media player 1.1.5 The Luggage (revision exported)
[...]
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
[0x82756c170] avcodec decoder error: vlc_va_Setup failed


One can also try to run tests, e.g.

$ for tn in $(jot -w%02d 11 01); do LIBVA_DRIVER_NAME=dummy vatest_$tn; done
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_01: Initialize & Terminate
--- XOpenDisplay: dpy = 01851000
--- vaGetDisplay: va_dpy = 018d0040
--- vaInitialize: major = 0 minor = 31
--- vaTerminate
--- XCloseDisplay
*** vatest_01: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_02: Query profiles
--- vaMaxNumProfiles = 11
--- vaQueryConfigProfiles reports 11 profiles
---   profile 0 [VAProfileMPEG2Simple]
---   profile 1 [VAProfileMPEG2Main]
---   profile 2 [VAProfileMPEG4Simple]
---   profile 3 [VAProfileMPEG4AdvancedSimple]
---   profile 4 [VAProfileMPEG4Main]
---   profile 5 [VAProfileH264Baseline]
---   profile 6 [VAProfileH264Main]
---   profile 7 [VAProfileH264High]
---   profile 8 [VAProfileVC1Simple]
---   profile 9 [VAProfileVC1Main]
---   profile 10 [VAProfileVC1Advanced]
*** vatest_02: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_03: Query entrypoints for all profiles
--- vaMaxEntryPoints = 5
--- vaQueryConfigEntryPoints(VAProfileMPEG2Simple) reports 2 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
---   entrypoint 4 [VAEntrypointMoComp]
--- vaQueryConfigEntryPoints(VAProfileMPEG2Main) reports 2 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
---   entrypoint 4 [VAEntrypointMoComp]
--- vaQueryConfigEntryPoints(VAProfileMPEG4Simple) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileMPEG4AdvancedSimple) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileMPEG4Main) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileH264Baseline) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileH264Main) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileH264High) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileVC1Simple) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileVC1Main) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
--- vaQueryConfigEntryPoints(VAProfileVC1Advanced) reports 1 entrypoints
---   entrypoint 1 [VAEntrypointVLD]
*** vatest_03: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_04: Get config attributes for all profiles / entrypoints
--- vaGetConfigAttributes for VAProfileMPEG2Simple, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileMPEG2Simple, VAEntrypointMoComp
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileMPEG2Main, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileMPEG2Main, VAEntrypointMoComp
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileMPEG4Simple, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileMPEG4AdvancedSimple, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileMPEG4Main, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileH264Baseline, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileH264Main, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileH264High, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileVC1Simple, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileVC1Main, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
--- vaGetConfigAttributes for VAProfileVC1Advanced, VAEntrypointVLD
---   0 -> 00000001
---   1 -> 80000000
---   2 -> 80000000
---   3 -> 80000000
---   4 -> 80000000
*** vatest_04: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_05: Create/destroy configs for all profiles / entrypoints
--- vaCreateConfig for VAProfileMPEG2Simple, VAEntrypointVLD
--- vaCreateConfig returns 01000000
--- vaCreateConfig for VAProfileMPEG2Simple, VAEntrypointMoComp
--- vaCreateConfig returns 01000001
--- vaCreateConfig for VAProfileMPEG2Main, VAEntrypointVLD
--- vaCreateConfig returns 01000002
--- vaCreateConfig for VAProfileMPEG2Main, VAEntrypointMoComp
--- vaCreateConfig returns 01000003
--- vaCreateConfig for VAProfileMPEG4Simple, VAEntrypointVLD
--- vaCreateConfig returns 01000004
--- vaCreateConfig for VAProfileMPEG4AdvancedSimple, VAEntrypointVLD
--- vaCreateConfig returns 01000005
--- vaCreateConfig for VAProfileMPEG4Main, VAEntrypointVLD
--- vaCreateConfig returns 01000006
--- vaCreateConfig for VAProfileH264Baseline, VAEntrypointVLD
--- vaCreateConfig returns 01000007
--- vaCreateConfig for VAProfileH264Main, VAEntrypointVLD
--- vaCreateConfig returns 01000008
--- vaCreateConfig for VAProfileH264High, VAEntrypointVLD
--- vaCreateConfig returns 01000009
--- vaCreateConfig for VAProfileVC1Simple, VAEntrypointVLD
--- vaCreateConfig returns 0100000a
--- vaCreateConfig for VAProfileVC1Main, VAEntrypointVLD
--- vaCreateConfig returns 0100000b
--- vaCreateConfig for VAProfileVC1Advanced, VAEntrypointVLD
--- vaCreateConfig returns 0100000c
--- vaDestroyConfig for config 01000000
--- vaDestroyConfig for config 01000001
--- vaDestroyConfig for config 01000002
--- vaDestroyConfig for config 01000003
--- vaDestroyConfig for config 01000004
--- vaDestroyConfig for config 01000005
--- vaDestroyConfig for config 01000006
--- vaDestroyConfig for config 01000007
--- vaDestroyConfig for config 01000008
--- vaDestroyConfig for config 01000009
--- vaDestroyConfig for config 0100000a
--- vaDestroyConfig for config 0100000b
--- vaDestroyConfig for config 0100000c
*** vatest_05: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_06: Get config attributes from configs
--- Checking vaQueryConfigAttributes for VAProfileMPEG2Simple, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileMPEG2Simple, VAEntrypointMoComp
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileMPEG2Main, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileMPEG2Main, VAEntrypointMoComp
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileMPEG4Simple, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileMPEG4AdvancedSimple, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileMPEG4Main, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileH264Baseline, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileH264Main, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileH264High, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileVC1Simple, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileVC1Main, VAEntrypointVLD
---   0 -> 00000001
--- Checking vaQueryConfigAttributes for VAProfileVC1Advanced, VAEntrypointVLD
---   0 -> 00000001
*** vatest_06: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_07: Create and destory surfaces
--- vaCreateSurfaces 1 surface
--- vaCreateSurfaces 4 surfaces
--- vaCreateSurfaces 16 surfaces
--- vaDestroySurface 4 surfaces
--- vaCreateSurfaces 6 surfaces
--- vaDestroySurface 16 surfaces
--- vaDestroySurface 1 surface
--- vaDestroySurface 6 surfaces
*** vatest_07: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_08: Create and destory surfaces of different sizes
--- vaCreateSurfaces create 10x10 surface
--- vaCreateSurfaces create 128x128 surface
--- vaCreateSurfaces create 176x144 surface
--- vaCreateSurfaces create 144x176 surface
--- vaCreateSurfaces create 352x288 surface
--- vaCreateSurfaces create 399x299 surface
--- vaCreateSurfaces create 640x480 surface
--- vaCreateSurfaces create 1280x720 surface
--- vaDestroySurface all surfaces
*** vatest_08: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_09: Create/destroy contexts for all profiles / entrypoints
--- vaCreateConfig for VAProfileMPEG2Simple, VAEntrypointVLD
--- vaCreateConfig returns 01000000
--- vaCreateConfig for VAProfileMPEG2Simple, VAEntrypointMoComp
--- vaCreateConfig returns 01000001
--- vaCreateConfig for VAProfileMPEG2Main, VAEntrypointVLD
--- vaCreateConfig returns 01000002
--- vaCreateConfig for VAProfileMPEG2Main, VAEntrypointMoComp
--- vaCreateConfig returns 01000003
--- vaCreateConfig for VAProfileMPEG4Simple, VAEntrypointVLD
--- vaCreateConfig returns 01000004
--- vaCreateConfig for VAProfileMPEG4AdvancedSimple, VAEntrypointVLD
--- vaCreateConfig returns 01000005
--- vaCreateConfig for VAProfileMPEG4Main, VAEntrypointVLD
--- vaCreateConfig returns 01000006
--- vaCreateConfig for VAProfileH264Baseline, VAEntrypointVLD
--- vaCreateConfig returns 01000007
--- vaCreateConfig for VAProfileH264Main, VAEntrypointVLD
--- vaCreateConfig returns 01000008
--- vaCreateConfig for VAProfileH264High, VAEntrypointVLD
--- vaCreateConfig returns 01000009
--- vaCreateConfig for VAProfileVC1Simple, VAEntrypointVLD
--- vaCreateConfig returns 0100000a
--- vaCreateConfig for VAProfileVC1Main, VAEntrypointVLD
--- vaCreateConfig returns 0100000b
--- vaCreateConfig for VAProfileVC1Advanced, VAEntrypointVLD
--- vaCreateConfig returns 0100000c
--- vaCreateContext with config 01000000
--- vaCreateContext with config 01000001
--- vaCreateContext with config 01000002
--- vaCreateContext with config 01000003
--- vaCreateContext with config 01000004
--- vaCreateContext with config 01000005
--- vaCreateContext with config 01000006
--- vaCreateContext with config 01000007
--- vaCreateContext with config 01000008
--- vaCreateContext with config 01000009
--- vaCreateContext with config 0100000a
--- vaCreateContext with config 0100000b
--- vaCreateContext with config 0100000c
--- vaDestroyContext for context 02000000
--- vaDestroyContext for context 02000001
--- vaDestroyContext for context 02000002
--- vaDestroyContext for context 02000003
--- vaDestroyContext for context 02000004
--- vaDestroyContext for context 02000005
--- vaDestroyContext for context 02000006
--- vaDestroyContext for context 02000007
--- vaDestroyContext for context 02000008
--- vaDestroyContext for context 02000009
--- vaDestroyContext for context 0200000a
--- vaDestroyContext for context 0200000b
--- vaDestroyContext for context 0200000c
--- vaDestroyConfig for config 01000000
--- vaDestroyConfig for config 01000001
--- vaDestroyConfig for config 01000002
--- vaDestroyConfig for config 01000003
--- vaDestroyConfig for config 01000004
--- vaDestroyConfig for config 01000005
--- vaDestroyConfig for config 01000006
--- vaDestroyConfig for config 01000007
--- vaDestroyConfig for config 01000008
--- vaDestroyConfig for config 01000009
--- vaDestroyConfig for config 0100000a
--- vaDestroyConfig for config 0100000b
--- vaDestroyConfig for config 0100000c
*** vatest_09: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_10: Create and destroy buffers
*** vatest_10: Finished
libva: libva version 0.31.1
libva: User requested driver 'dummy'
libva: Trying to open /usr/local/lib/va/dummy_drv_video.so
libva: va_openDriver() returns 0
*** vatest_11: Map and unmap buffers
--- vaCreateBuffer created buffer 08000000 of type 0
--- vaCreateBuffer created buffer 08000001 of type 1
--- vaCreateBuffer created buffer 08000002 of type 2
--- vaCreateBuffer created buffer 08000003 of type 3
--- vaCreateBuffer created buffer 08000004 of type 4
--- vaCreateBuffer created buffer 08000005 of type 5
--- vaCreateBuffer created buffer 08000006 of type 6
--- vaCreateBuffer created buffer 08000007 of type 7
--- vaCreateBuffer created buffer 08000008 of type 8
--- vaMapBuffer mapped buffer 08000000
--- vaMapBuffer mapped buffer 08000001
--- vaMapBuffer mapped buffer 08000002
--- vaMapBuffer mapped buffer 08000003
--- vaMapBuffer mapped buffer 08000004
--- vaMapBuffer mapped buffer 08000005
--- vaMapBuffer mapped buffer 08000006
--- vaMapBuffer mapped buffer 08000007
--- vaMapBuffer mapped buffer 08000008
*** vatest_11: Finished
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-01-06 13:00:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

pgollucci@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 swell.k 2011-01-06 13:31:35 UTC
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 ---
Comment 3 swell.k 2011-01-06 23:02:27 UTC
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 ---
Comment 4 swell.k 2011-01-08 03:33:12 UTC
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 ---
Comment 5 mickael.maillot 2011-01-08 11:31:30 UTC
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.
Comment 6 swell.k 2011-01-08 12:45:54 UTC
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 ---
Comment 7 swell.k 2011-01-08 13:03:30 UTC
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 ---
Comment 8 swell.k 2011-01-08 20:29:00 UTC
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)
Comment 9 Philip M. Gollucci freebsd_committer freebsd_triage 2011-01-12 00:58:43 UTC
Responsible Changed
From-To: pgollucci->freebsd-ports-bugs

E-NO-TIME right now, back to pool
Comment 10 Max Brazhnikov freebsd_committer freebsd_triage 2011-01-12 21:32:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->makc

I'll take it.
Comment 11 dfilter service freebsd_committer freebsd_triage 2011-01-13 11:02:08 UTC
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"
Comment 12 Max Brazhnikov freebsd_committer freebsd_triage 2011-01-13 11:03:26 UTC
State Changed
From-To: open->closed

New port added. Thanks!