diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2018-02-15 19:29:51 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2018-02-20 10:57:12 -0600 |
commit | 5842e9cf879c8efb03a3e61d833be6627c8ad737 (patch) | |
tree | 5524202b3045407b4470acba1b65c88f13851f88 /gst | |
parent | f0fd2aeb0469fa15bd2932aedf3e682004107890 (diff) |
plugins: add COPY_OUTPUT_FRAME flag
This patch add the member copy_output_frame and set it TRUE when
when downstream didn't request GstVideoMeta API, the caps are raw
and the internal allocator is the VA-API one.
https://bugzilla.gnome.org/show_bug.cgi?id=785054
Diffstat (limited to 'gst')
-rw-r--r-- | gst/vaapi/gstvaapipluginbase.c | 6 | ||||
-rw-r--r-- | gst/vaapi/gstvaapipluginbase.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 0183579c..568c42e7 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -1015,6 +1015,12 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin, g_clear_object (&plugin->srcpad_buffer_pool); plugin->srcpad_buffer_pool = pool; + + /* if downstream doesn't support GstVideoMeta, and the negotiated + * caps are raw video, and the used allocator is the VA-API one, we + * should copy the VA-API frame into a dumb buffer */ + plugin->copy_output_frame = gst_vaapi_video_buffer_pool_copy_buffer (pool); + return TRUE; /* ERRORS */ diff --git a/gst/vaapi/gstvaapipluginbase.h b/gst/vaapi/gstvaapipluginbase.h index 81b5f4ed..b58fdbea 100644 --- a/gst/vaapi/gstvaapipluginbase.h +++ b/gst/vaapi/gstvaapipluginbase.h @@ -85,6 +85,8 @@ typedef struct _GstVaapiPluginBaseClass GstVaapiPluginBaseClass; (&GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_info) #define GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF(plugin) \ (GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_can_dmabuf) +#define GST_VAAPI_PLUGIN_BASE_COPY_OUTPUT_FRAME(plugin) \ + (GST_VAAPI_PLUGIN_BASE(plugin)->copy_output_frame) #define GST_VAAPI_PLUGIN_BASE_DISPLAY(plugin) \ (GST_VAAPI_PLUGIN_BASE(plugin)->display) @@ -147,8 +149,10 @@ struct _GstVaapiPluginBase gboolean srcpad_can_dmabuf; gboolean enable_direct_rendering; + GstAllocator *other_srcpad_allocator; GstAllocationParams other_allocator_params; + gboolean copy_output_frame; }; struct _GstVaapiPluginBaseClass |