diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 0183579cf1..568c42e7a1 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 81b5f4eddb..b58fdbea86 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