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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5795>
This commit is contained in:
Víctor Manuel Jáquez Leal 2023-12-11 10:49:39 +01:00
parent fac9fb2174
commit 4f27b50c2e
2 changed files with 5 additions and 3 deletions

View file

@ -7766,7 +7766,7 @@
"long-name": "Gtk GL Video Sink", "long-name": "Gtk GL Video Sink",
"pad-templates": { "pad-templates": {
"sink": { "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", "direction": "sink",
"presence": "always" "presence": "always"
} }

View file

@ -57,10 +57,12 @@ static GstStaticPadTemplate gst_gtk_gl_sink_template =
GST_PAD_SINK, GST_PAD_SINK,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES 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_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY ", " (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 #define gst_gtk_gl_sink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstGtkGLSink, gst_gtk_gl_sink, G_DEFINE_TYPE_WITH_CODE (GstGtkGLSink, gst_gtk_gl_sink,