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
1515
1616 API changes, most recent first:
1717
18+2016-xx-xx - xxxxxxx - lavu 55.39.100 - hwcontext_vaapi.h
19+ Add AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE.
20+
1821 2016-xx-xx - xxxxxxx - lavu 55.38.100 - hwcontext_vaapi.h
1922 Add driver quirks field to VAAPI-specific hwdevice and enum with
2023 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
275275 "i965",
276276 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,
277277 },
278+ {
279+ "Intel iHD",
280+ "ubit",
281+ AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE,
282+ },
278283 };
279284
280285 static int vaapi_device_init(AVHWDeviceContext *hwdev)
@@ -449,7 +454,8 @@ static int vaapi_frames_init(AVHWFramesContext *hwfc) · 168 unmodified lines
449454 }
450455
451456 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;
453459 for (i = 0; i < avfc->nb_attributes; i++) {
454460 if (ctx->attributes[i].type == VASurfaceAttribMemoryType)
455461 need_memory_type = 0;
libavutil/hwcontext_vaapi.h+6−0
@@ -45,6 +45,12 @@ enum { · 44 unmodified lines
4545 * separately afterwards.
4646 */
4747 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),
4854 };
4955
5056 /**
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 */
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 55
82−#define LIBAVUTIL_VERSION_MINOR 38
82+#define LIBAVUTIL_VERSION_MINOR 39
8383 #define LIBAVUTIL_VERSION_MICRO 100
8484
8585 #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