[FFmpeg-devel] [RFC]Autodetect VA-API

Carl Eugen Hoyos cehoyos at ag.or.at
Tue May 7 11:26:15 CEST 2013


On Monday 06 May 2013 12:05:40 pm Michael Niedermayer wrote:
> On Fri, May 03, 2013 at 05:22:10PM +0200, Carl Eugen Hoyos wrote:
> > Hi!
> >
> > In FFmpeg revisions 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 1.0 and 1.1, VA-API
> > was autodetected by configure, default compilation always produced ffmpeg
> > executables that depend on libva and I do not remember any user
> > protesting about it.
> > Since 1.2 (and without any documentation afaict), VA-API is not
> > auto-detected anymore, this was quickly reported by users (see also
> > ticket #2368).
> >
> > On my system, a default FFmpeg compilation (./configure && make ffmpeg)
> > produces a binary that depends, apart from the typical system libraries
> > and libz and libbz2, on libsdl, libasound and libjack (which depends on
> > libstdc++), libva has no further dependencies afaict.
> >
> > I don't use VA-API (and I don't care much) but I suggest attached patch
> > that I would also backport to release/1.2.
> >
> > Please comment, Carl Eugen
> >
> >  configure |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > b0d1a88ff2c6fc526eaa5673e0c6d30379ea46d3  patchvaapi.diff
> > diff --git a/configure b/configure
> > index f646d55..508e88c 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2247,7 +2247,7 @@ enable static
> >  enable swscale_alpha
> >
> >  # By default, enable only those hwaccels that have no external
> > dependencies. -enable dxva2 vdpau
> > +enable dxva2 vaapi vdpau
>
> have you tested dependancies ?

New, tested patch attached that also responds to Hendriks comment.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/configure b/configure
index 5a5cbc2..b701d89 100755
--- a/configure
+++ b/configure
@@ -142,7 +142,7 @@ Component options:
 
 Hardware accelerators:
   --enable-dxva2           enable DXVA2 code
-  --enable-vaapi           enable VAAPI code
+  --disable-vaapi          disable VAAPI code [autodetect]
   --enable-vda             enable VDA code
   --enable-vdpau           enable VDPAU code
 
@@ -2246,8 +2246,8 @@ enable safe_bitstream_reader
 enable static
 enable swscale_alpha
 
-# By default, enable only those hwaccels that have no external dependencies.
-enable dxva2 vdpau
+# Enable hwaccels by default.
+enable dxva2 vaapi vdpau
 
 # build settings
 SHFLAGS='-shared -Wl,-soname,$$(@F)'
@@ -3974,7 +3974,6 @@ enabled MemoryBarrier && enable atomics_win32
 
 check_lib math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
-enabled vaapi && require vaapi va/va.h vaInitialize -lva
 
 atan2f_args=2
 ldexpf_args=2
@@ -4153,12 +4152,9 @@ require X11 X11/Xlib.h XOpenDisplay -lX11                 &&
 require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
 require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
 
-if ! disabled vaapi; then
-    check_lib va/va.h vaInitialize -lva && {
-        check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
-        warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
-    } || disable vaapi
-fi
+enabled vaapi &&
+    check_lib va/va.h vaInitialize -lva ||
+    disable vaapi
 
 enabled vdpau &&
     check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||


More information about the ffmpeg-devel mailing list