From cf30e875de7b8f04730753fb35869d0f7338b6e5 Mon Sep 17 00:00:00 2001 From: Chao Guo Date: Fri, 2 Aug 2024 15:41:51 +0900 Subject: [PATCH] glupload: Add formats supported by #GstGLMemory to raw caps when generating sink pad caps When glupload generates sink caps based on src caps after determining upload method, src caps may only contain RGBA format. In this case, the raw caps on the sink pad generated by glupload will only contain the RGBA format, which will cause caps negotiation fail, because the filter caps used for negotiation by the upstream element may only contain other formats, such as xBGR, etc. Add the formats supported by #GstGLMemory to raw caps to ensure that caps negotiation succeeds. Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c | 5 +++-- 1 file changed, 3 insertions(+), 2 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 f5cec60a68..c1a0a295bb 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c @@ -1818,11 +1818,12 @@ _direct_dma_buf_upload_transform_caps (gpointer impl, GstGLContext * context, ret = _dma_buf_upload_transform_caps_common (tmp_caps, context, direction, flags, 1 << dmabuf->target, GST_CAPS_FEATURE_MEMORY_GL_MEMORY, GST_CAPS_FEATURE_MEMORY_DMABUF); - gst_caps_unref (tmp_caps); - tmp = _dma_buf_upload_transform_caps_common (caps, context, direction, + + tmp = _dma_buf_upload_transform_caps_common (tmp_caps, context, direction, flags, 1 << dmabuf->target, GST_CAPS_FEATURE_MEMORY_GL_MEMORY, GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); + gst_caps_unref (tmp_caps); if (!ret) { ret = tmp;