summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-11 16:27:58 +0100
committerwm4 <wm4@nowhere>2017-01-11 16:34:18 +0100
commit2afef344fb76f534426c047a3d5077e761a2e00a (patch)
treead30baa2982f00f4cc11397104def8d4be5570d8 /wscript
parentf4263922c7a251ac429aa0e023bbd81ac6888c54 (diff)
downloadmpv-2afef344fb76f534426c047a3d5077e761a2e00a.tar.bz2
mpv-2afef344fb76f534426c047a3d5077e761a2e00a.tar.xz
vaapi: support new libavcodec vaapi API
The old API is deprecated, and libavcodec prints a warning at runtime. The new API is a bit nicer and does many things for you, such as managing the underlying hwaccel decoder. libavutil also provides code for managing surfaces (we use their surface pool). The new code does not contain any code from the original MPlayer VAAPI patch (that was used as base for some of the vaapi code in mpv). Thus the new code is LGPL. The new API actually does not add any visible symbols, so the only way to detect it is a version check. Of course, the versions overlap between FFmpeg and Libav, which requires additional care. The new API did not get merged into FFmpeg yet, so there's no check for FFmpeg.
Diffstat (limited to 'wscript')
-rw-r--r--wscript21
1 files changed, 21 insertions, 0 deletions
diff --git a/wscript b/wscript
index 086b84fd28..891f975027 100644
--- a/wscript
+++ b/wscript
@@ -420,6 +420,13 @@ libav_dependencies = [
'fmsg': "Unable to find development files for some of the required \
FFmpeg/Libav libraries. You need at least {0}. Aborting.".format(libav_versions_string)
}, {
+ 'name': 'is_ffmpeg',
+ 'desc': 'libav* is FFmpeg',
+ # FFmpeg <=> LIBAVUTIL_VERSION_MICRO>=100
+ 'func': check_statement('libavutil/version.h',
+ 'int x[LIBAVUTIL_VERSION_MICRO >= 100 ? 1 : -1]',
+ use='libav')
+ }, {
'name': '--libswresample',
'desc': 'libswresample',
'func': check_pkg_config('libswresample', '>= 2.3.100'),
@@ -834,6 +841,20 @@ hwaccel_features = [
'deps': [ 'vaapi' ],
'func': check_headers('libavcodec/vaapi.h', use='libav'),
}, {
+ 'name': '--vaapi-hwaccel-new',
+ 'desc': 'libavcodec VAAPI hwaccel (new)',
+ 'deps': [ 'vaapi-hwaccel' ],
+ 'deps_neg': [ 'is_ffmpeg' ],
+ 'func': check_statement('libavcodec/version.h',
+ 'int x[LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 26, 0) ? 1 : -1]',
+ use='libav'),
+ }, {
+ 'name': '--vaapi-hwaccel-old',
+ 'desc': 'libavcodec VAAPI hwaccel (old)',
+ 'deps': [ 'vaapi-hwaccel' ],
+ 'deps_neg': [ 'vaapi-hwaccel-new' ],
+ 'func': check_true,
+ }, {
'name': '--videotoolbox-hwaccel',
'desc': 'libavcodec videotoolbox hwaccel',
'func': compose_checks(