diff options
author | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2016-12-08 18:51:54 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2017-04-12 20:39:06 +0200 |
commit | 24af97a7d106c1ba7cd1fe607e427f728ab9cf9c (patch) | |
tree | 374a32b34cd50319afc858e74c068a8ec50f6e85 | |
parent | ebca86dcc7fc9b54632f6e0a398caa7516f40659 (diff) |
plugins: enable direct rendering with envvar
Direct rendering (use vaDeriveImage rather than vaPutImage) has better
performance in some Intel platforms (Haswell, for example) but in others
(Skylake) is the opposite.
In order to have some control, the patch enables the direct rendering
through the environment variable GST_VAAPI_ENABLE_DIRECT_RENDERING.
Also it seems to generating some problems with gallium/radeon backend.
See bug #779642.
https://bugzilla.gnome.org/show_bug.cgi?id=775848
-rw-r--r-- | gst/vaapi/gstvaapipluginbase.c | 5 | ||||
-rw-r--r-- | gst/vaapi/gstvaapipluginbase.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index a60498df..8c2b84aa 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -247,6 +247,9 @@ gst_vaapi_plugin_base_init (GstVaapiPluginBase * plugin, if (!(GST_OBJECT_FLAGS (plugin) & GST_ELEMENT_FLAG_SINK)) plugin->srcpad = gst_element_get_static_pad (GST_ELEMENT (plugin), "src"); gst_video_info_init (&plugin->srcpad_info); + + plugin->enable_direct_rendering = + (g_getenv ("GST_VAAPI_ENABLE_DIRECT_RENDERING") != NULL); } void @@ -592,7 +595,7 @@ ensure_srcpad_allocator (GstVaapiPluginBase * plugin, GstVideoInfo * vinfo, gst_vaapi_dmabuf_allocator_new (plugin->display, vinfo, get_dmabuf_surface_allocation_flags (), GST_PAD_SRC); } - } else { + } else if (plugin->enable_direct_rendering) { usage_flag = GST_VAAPI_IMAGE_USAGE_FLAG_DIRECT_RENDER; GST_INFO_OBJECT (plugin, "enabling direct rendering in source allocator"); } diff --git a/gst/vaapi/gstvaapipluginbase.h b/gst/vaapi/gstvaapipluginbase.h index bfeeb107..3346ed40 100644 --- a/gst/vaapi/gstvaapipluginbase.h +++ b/gst/vaapi/gstvaapipluginbase.h @@ -149,6 +149,8 @@ struct _GstVaapiPluginBase GstAllocator *sinkpad_allocator; GstAllocator *srcpad_allocator; gboolean srcpad_can_dmabuf; + + gboolean enable_direct_rendering; }; struct _GstVaapiPluginBaseClass |