History

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)

Anton Khirnov committed 10 years ago

Commit 775a8471 parent 8d47d844 files · +17 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/hwcontext_vaapi.c +7 −1
  3. libavutil/hwcontext_vaapi.h +6 −0
  4. libavutil/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182016-xx-xx - xxxxxxx - lavu 55.39.100 - hwcontext_vaapi.h
19 Add AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE.
20
182016-xx-xx - xxxxxxx - lavu 55.38.100 - hwcontext_vaapi.h212016-xx-xx - xxxxxxx - lavu 55.38.100 - hwcontext_vaapi.h
19 Add driver quirks field to VAAPI-specific hwdevice and enum with22 Add driver quirks field to VAAPI-specific hwdevice and enum with
20 members AV_VAAPI_DRIVER_QUIRK_* to represent its values.23 members AV_VAAPI_DRIVER_QUIRK_* to represent its values.
libavutil/hwcontext_vaapi.c+7−1
@@ -275,6 +275,11 @@ static const struct { · 274 unmodified lines
275 "i965",275 "i965",
276 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,276 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,
277 },277 },
278 {
279 "Intel iHD",
280 "ubit",
281 AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE,
282 },
278};283};
279 284
280static int vaapi_device_init(AVHWDeviceContext *hwdev)285static int vaapi_device_init(AVHWDeviceContext *hwdev)
@@ -449,7 +454,8 @@ static int vaapi_frames_init(AVHWFramesContext *hwfc) · 168 unmodified lines
449 }454 }
450 455
451 if (!hwfc->pool) {456 if (!hwfc->pool) {
452 int need_memory_type = 1, need_pixel_format = 1;457 int need_memory_type = !(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE);
458 int need_pixel_format = 1;
453 for (i = 0; i < avfc->nb_attributes; i++) {459 for (i = 0; i < avfc->nb_attributes; i++) {
454 if (ctx->attributes[i].type == VASurfaceAttribMemoryType)460 if (ctx->attributes[i].type == VASurfaceAttribMemoryType)
455 need_memory_type = 0;461 need_memory_type = 0;
libavutil/hwcontext_vaapi.h+6−0
@@ -45,6 +45,12 @@ enum { · 44 unmodified lines
45 * separately afterwards.45 * separately afterwards.
46 */46 */
47 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1),47 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1),
48
49 /**
50 * The driver does not support the VASurfaceAttribMemoryType attribute,
51 * so the surface allocation code will not try to use it.
52 */
53 AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2),
48};54};
49 55
50/**56/**
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
79 */79 */
80 80
81#define LIBAVUTIL_VERSION_MAJOR 5581#define LIBAVUTIL_VERSION_MAJOR 55
82#define LIBAVUTIL_VERSION_MINOR 3882#define LIBAVUTIL_VERSION_MINOR 39
83#define LIBAVUTIL_VERSION_MICRO 10083#define LIBAVUTIL_VERSION_MICRO 100
84 84
85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t