From 4f27b50c2e85a48f076d9f89c44d5d5992cc022e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 11 Dec 2023 10:49:39 +0100 Subject: [PATCH] gtkglsink: template caps to only 2D & rectangle texture targets Apparently external-oes is not supported by the plugin as texture target, while DMABuf uploading prefers it because it's zero copy. This patch enables DMABuf uploading and rendering by using either 2D or rectangle texture targets. Part-of: --- subprojects/gst-plugins-good/docs/gst_plugins_cache.json | 2 +- subprojects/gst-plugins-good/ext/gtk/gstgtkglsink.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/docs/gst_plugins_cache.json b/subprojects/gst-plugins-good/docs/gst_plugins_cache.json index efd2772377..c68c3f2b39 100644 --- a/subprojects/gst-plugins-good/docs/gst_plugins_cache.json +++ b/subprojects/gst-plugins-good/docs/gst_plugins_cache.json @@ -7766,7 +7766,7 @@ "long-name": "Gtk GL Video Sink", "pad-templates": { "sink": { - "caps": "video/x-raw(memory:GLMemory):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", + "caps": "video/x-raw(memory:GLMemory):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n texture-target: { (string)2D, (string)rectangle }\n\nvideo/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n texture-target: { (string)2D, (string)rectangle }\n", "direction": "sink", "presence": "always" } diff --git a/subprojects/gst-plugins-good/ext/gtk/gstgtkglsink.c b/subprojects/gst-plugins-good/ext/gtk/gstgtkglsink.c index 8c6605359a..c8511a3733 100644 --- a/subprojects/gst-plugins-good/ext/gtk/gstgtkglsink.c +++ b/subprojects/gst-plugins-good/ext/gtk/gstgtkglsink.c @@ -57,10 +57,12 @@ static GstStaticPadTemplate gst_gtk_gl_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES - (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, "RGBA") "; " + (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, "RGBA") + ", texture-target = { 2D, rectangle }; " GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY ", " - GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, "RGBA"))); + GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, "RGBA") + ", texture-target = { 2D, rectangle }")); #define gst_gtk_gl_sink_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGtkGLSink, gst_gtk_gl_sink,