diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-09-30 21:21:46 +0200 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2016-11-13 20:39:49 +0000 |
commit | 775a8477b74bb2fa95ca2b13c08f3fd8d6c617b6 (patch) | |
tree | 4f5d7dd11b889a00b0d24ab7b7eb146d8c12b883 /libavutil | |
parent | 8d47d8407569aade0c0d564600919349789dc38b (diff) | |
download | ffmpeg-775a8477b74bb2fa95ca2b13c08f3fd8d6c617b6.tar.gz |
hwcontext_vaapi: add a quirk for the missing MemoryType attribute
The Intel binary iHD driver does not support the
VASurfaceAttribMemoryType, so surface allocation will fail when using
it.
(cherry picked from commit 2124711b950b03c582a119c75f52a87acc32d6ec)
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/hwcontext_vaapi.c | 8 | ||||
-rw-r--r-- | libavutil/hwcontext_vaapi.h | 6 | ||||
-rw-r--r-- | libavutil/version.h | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 06836a7156..605e465e2d 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -275,6 +275,11 @@ static const struct { "i965", AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS, }, + { + "Intel iHD", + "ubit", + AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE, + }, }; static int vaapi_device_init(AVHWDeviceContext *hwdev) @@ -449,7 +454,8 @@ static int vaapi_frames_init(AVHWFramesContext *hwfc) } if (!hwfc->pool) { - int need_memory_type = 1, need_pixel_format = 1; + int need_memory_type = !(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE); + int need_pixel_format = 1; for (i = 0; i < avfc->nb_attributes; i++) { if (ctx->attributes[i].type == VASurfaceAttribMemoryType) need_memory_type = 0; diff --git a/libavutil/hwcontext_vaapi.h b/libavutil/hwcontext_vaapi.h index 8bd8031b9d..da1d4fe6c2 100644 --- a/libavutil/hwcontext_vaapi.h +++ b/libavutil/hwcontext_vaapi.h @@ -45,6 +45,12 @@ enum { * separately afterwards. */ AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1), + + /** + * The driver does not support the VASurfaceAttribMemoryType attribute, + * so the surface allocation code will not try to use it. + */ + AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2), }; /** diff --git a/libavutil/version.h b/libavutil/version.h index 81c51815a4..6d68051999 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 38 +#define LIBAVUTIL_VERSION_MINOR 39 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |