diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-10-31 13:10:50 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-10-31 18:26:42 +0100 |
commit | 72362e10632fe46adafa92290b2480511eaecb29 (patch) | |
tree | f0ba1909d21df13221f453229ed05097c38a1b83 /gst | |
parent | 0a36a707ba1161cb5adfe7f364ca95d3a1ad61a9 (diff) |
plugins: direct rendering on memory:VASurface
As buffers negotiated with memory:VASurface caps feature can also be
mapped, they can also be configured to use VA derived images, in other
words "direct rendering".
Also, because of the changes in dmabuf allocator as default allocator,
the code for configuring the direct rendering was not clear.
This patch cleans up the code and enables direct rendering when the
environment variable GST_VAAPI_ENABLE_DIRECT_RENDERING is defined,
even then the memory:VASurface cap feature is negotiated.
https://bugzilla.gnome.org/show_bug.cgi?id=786054
Diffstat (limited to 'gst')
-rw-r--r-- | gst/vaapi/gstvaapipluginbase.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 36f8af98..6194c305 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -600,8 +600,6 @@ ensure_srcpad_allocator (GstVaapiPluginBase * plugin, GstVideoInfo * vinfo, { gboolean different_caps; const GstVideoInfo *image_info; - GstVaapiImageUsageFlags usage_flag = - GST_VAAPI_IMAGE_USAGE_FLAG_NATIVE_FORMATS; if (!reset_allocator (plugin->srcpad_allocator, vinfo)) goto valid_allocator; @@ -610,10 +608,6 @@ ensure_srcpad_allocator (GstVaapiPluginBase * plugin, GstVideoInfo * vinfo, if (caps && gst_caps_is_video_raw (caps)) { GstAllocator *allocator = create_dmabuf_srcpad_allocator (plugin, vinfo, !plugin->srcpad_can_dmabuf); - if (!allocator && plugin->enable_direct_rendering) { - usage_flag = GST_VAAPI_IMAGE_USAGE_FLAG_DIRECT_RENDER; - GST_INFO_OBJECT (plugin, "enabling direct rendering in source allocator"); - } plugin->srcpad_allocator = allocator; } else if (caps && gst_vaapi_caps_feature_contains (caps, GST_VAAPI_CAPS_FEATURE_DMABUF)) { @@ -624,6 +618,14 @@ ensure_srcpad_allocator (GstVaapiPluginBase * plugin, GstVideoInfo * vinfo, } if (!plugin->srcpad_allocator) { + GstVaapiImageUsageFlags usage_flag = + GST_VAAPI_IMAGE_USAGE_FLAG_NATIVE_FORMATS; + + if (plugin->enable_direct_rendering) { + usage_flag = GST_VAAPI_IMAGE_USAGE_FLAG_DIRECT_RENDER; + GST_INFO_OBJECT (plugin, "enabling direct rendering in source allocator"); + } + plugin->srcpad_allocator = gst_vaapi_video_allocator_new (plugin->display, vinfo, 0, usage_flag); } |