From c03a5b0c1b8248c08b8c88a32d970f1e2744f23f Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Sat, 26 Apr 2025 15:04:01 +0200 Subject: [PATCH] glupload: Only add texture-target field to GL caps So far we simply ignored it for MEMORY_DMABUF passthrough caps without known negative cosequences, but with upcoming more complicated caps negotiations it's becoming an issue, thus fix it. Fixes: 7e71d4f753 ("gl: upload: Add DMA_DRM passthrough upload") Part-of: --- .../gst-plugins-base/gst-libs/gst/gl/gstglupload.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c index 562cee0e12..9527bfd38e 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c @@ -3430,14 +3430,22 @@ gst_gl_upload_fixate_caps (GstGLUpload * upload, GstPadDirection direction, /* If the target is found, fixate the other fields */ if (i < n) { + GstCapsFeatures *features; + + features = gst_caps_get_features (othercaps, i); + ret_caps = gst_caps_new_empty (); gst_caps_append_structure_full (ret_caps, gst_structure_copy (gst_caps_get_structure (othercaps, i)), - gst_caps_features_copy (gst_caps_get_features (othercaps, i))); + gst_caps_features_copy (features)); ret_caps = gst_caps_fixate (ret_caps); - gst_caps_set_simple (ret_caps, "texture-target", G_TYPE_STRING, - gst_gl_texture_target_to_string (target), NULL); + + if (gst_caps_features_contains (features, + GST_CAPS_FEATURE_MEMORY_GL_MEMORY)) { + gst_caps_set_simple (ret_caps, "texture-target", G_TYPE_STRING, + gst_gl_texture_target_to_string (target), NULL); + } gst_caps_unref (othercaps);