From da8011c5df76ea79d939aaa4f6f4ddd927f51b5d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Jan 2017 08:17:29 +0100 Subject: 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.) --- wscript | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'wscript') 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', -- cgit v1.2.3