summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-18 08:17:29 +0100
committerwm4 <wm4@nowhere>2017-01-18 08:17:29 +0100
commitda8011c5df76ea79d939aaa4f6f4ddd927f51b5d (patch)
treec2bdb97a5999fa4e8244b33830ce1d39bc31a1dc /wscript
parent398e2d5d4278f89601cac0e031d3535cfc610df0 (diff)
downloadmpv-da8011c5df76ea79d939aaa4f6f4ddd927f51b5d.tar.bz2
mpv-da8011c5df76ea79d939aaa4f6f4ddd927f51b5d.tar.xz
vaapi: detect new API on FFmpeg too, and disable it by default
Since the only way to detect the API is by a version check, this had to wait until the patches were actually pushed to FFmpeg git (which now happened). Since this does not include the new magic GPU memcpy libavutil function yet, the new vaapi code would be slower if copy mode (like vaapi-copy) is used. This would be quite bad to use by default, so check for the function, and if not present, disable the new vaapi code. This effectively disables it by default on FFmpeg. (We assume that if the new GPU memcpy exists, vaapi's AVHWFramesContext implementation will use it.)
Diffstat (limited to 'wscript')
-rw-r--r--wscript13
1 files changed, 11 insertions, 2 deletions
diff --git a/wscript b/wscript
index b05f4e67c6..f6a5081ffd 100644
--- a/wscript
+++ b/wscript
@@ -475,6 +475,12 @@ FFmpeg/Libav libraries. You need at least {0}. Aborting.".format(libav_versions_
'func': check_statement('libavutil/frame.h',
'AV_FRAME_DATA_MASTERING_DISPLAY_METADATA',
use='libav'),
+ }, {
+ 'name': 'avutil-imgcpy-uc',
+ 'desc': 'libavutil GPU memcpy for hardware decoding',
+ 'func': check_statement('libavutil/imgutils.h',
+ 'av_image_copy_uc_from(0,0,0,0,0,0,0)',
+ use='libav'),
},
]
@@ -842,10 +848,13 @@ hwaccel_features = [
}, {
'name': '--vaapi-hwaccel-new',
'desc': 'libavcodec VAAPI hwaccel (new)',
- 'deps': [ 'vaapi-hwaccel' ],
+ 'deps': [ 'vaapi-hwaccel', 'avutil-imgcpy-uc' ],
'func': check_statement('libavcodec/version.h',
'int x[(LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 26, 0) && '
- ' LIBAVCODEC_VERSION_MICRO < 100) ? 1 : -1]',
+ ' LIBAVCODEC_VERSION_MICRO < 100) ||'
+ ' (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 74, 100) && '
+ ' LIBAVCODEC_VERSION_MICRO >= 100)'
+ ' ? 1 : -1]',
use='libav'),
}, {
'name': '--vaapi-hwaccel-old',