static void
gst_vaapisink_destroy(GstVaapiSink *sink)
{
+ gst_buffer_replace(&sink->video_buffer, NULL);
g_clear_object(&sink->texture);
g_clear_object(&sink->display);
{
GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
+ gst_buffer_replace(&sink->video_buffer, NULL);
g_clear_object(&sink->window);
g_clear_object(&sink->display);
success = FALSE;
break;
}
- return success ? GST_FLOW_OK : GST_FLOW_UNEXPECTED;
+ if (!success)
+ return GST_FLOW_UNEXPECTED;
+
+ /* Retain VA surface until the next one is displayed */
+ gst_buffer_replace(&sink->video_buffer, buffer);
+ return GST_FLOW_OK;
}
static gboolean
sink->window_width = 0;
sink->window_height = 0;
sink->texture = NULL;
+ sink->video_buffer = NULL;
sink->video_width = 0;
sink->video_height = 0;
sink->video_par_n = 1;