From 53fe7513717b983143331b89db2e029300bb08f8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 1 Jan 2021 11:31:49 -0500 Subject: [PATCH] media: Convince gstreamer to deliver GL memory Use a glsinkbin to make gstreamer deliver GL memory. --- modules/media/gtkgstpaintable.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/media/gtkgstpaintable.c b/modules/media/gtkgstpaintable.c index 500997f75b..fcc5a4f1d2 100644 --- a/modules/media/gtkgstpaintable.c +++ b/modules/media/gtkgstpaintable.c @@ -115,11 +115,18 @@ gtk_gst_paintable_video_renderer_create_video_sink (GstPlayerVideoRenderer *rend GstPlayer *player) { GtkGstPaintable *self = GTK_GST_PAINTABLE (renderer); + GstElement *sink, *glsinkbin; - return g_object_new (GTK_TYPE_GST_SINK, + sink = g_object_new (GTK_TYPE_GST_SINK, "paintable", self, "gl-context", self->context, NULL); + + glsinkbin = gst_element_factory_make ("glsinkbin", NULL); + + g_object_set (glsinkbin, "sink", sink, NULL); + + return glsinkbin; } static void