summaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_vaapi.h
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2016-06-12 17:20:25 +0100
committerMark Thompson <sw@jkqxz.net>2016-11-13 20:39:48 +0000
commita8d51bb42474b1641f45b5b3815864ea323a3e59 (patch)
tree15dbe9a7a3fcd7b76b745d8b20c02ad2db0efd4c /libavutil/hwcontext_vaapi.h
parent25012c56448a48487cdc9699465e640871dbcd60 (diff)
downloadffmpeg-streaming-a8d51bb42474b1641f45b5b3815864ea323a3e59.zip
ffmpeg-streaming-a8d51bb42474b1641f45b5b3815864ea323a3e59.tar.gz
hwcontext_vaapi: Add driver quirks to the hwdevice
The driver being used is detected inside av_hwdevice_ctx_init() and the quirks field then set from a table of known device. If this behaviour is unwanted, the user can also set the quirks field manually. Also adds the Intel i965 driver quirk (it does not destroy parameter buffers used in a call to vaRenderPicture()) and detects that driver to set it. (cherry picked from commit 4926fa9a4aa03f3b751f52e900b9efb87fea0591)
Diffstat (limited to 'libavutil/hwcontext_vaapi.h')
-rw-r--r--libavutil/hwcontext_vaapi.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vaapi.h b/libavutil/hwcontext_vaapi.h
index 7fd1a36..8bd8031 100644
--- a/libavutil/hwcontext_vaapi.h
+++ b/libavutil/hwcontext_vaapi.h
@@ -33,6 +33,20 @@
* with the data pointer set to a VASurfaceID.
*/
+enum {
+ /**
+ * The quirks field has been set by the user and should not be detected
+ * automatically by av_hwdevice_ctx_init().
+ */
+ AV_VAAPI_DRIVER_QUIRK_USER_SET = (1 << 0),
+ /**
+ * The driver does not destroy parameter buffers when they are used by
+ * vaRenderPicture(). Additional code will be required to destroy them
+ * separately afterwards.
+ */
+ AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1),
+};
+
/**
* VAAPI connection details.
*
@@ -43,6 +57,14 @@ typedef struct AVVAAPIDeviceContext {
* The VADisplay handle, to be filled by the user.
*/
VADisplay display;
+ /**
+ * Driver quirks to apply - this is filled by av_hwdevice_ctx_init(),
+ * with reference to a table of known drivers, unless the
+ * AV_VAAPI_DRIVER_QUIRK_USER_SET bit is already present. The user
+ * may need to refer to this field when performing any later
+ * operations using VAAPI with the same VADisplay.
+ */
+ unsigned int driver_quirks;
} AVVAAPIDeviceContext;
/**
OpenPOWER on IntegriCloud