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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7061>
This commit is contained in:
Chao Guo 2024-08-02 15:41:51 +09:00 committed by GStreamer Marge Bot
parent 3f2ed552fb
commit cf30e875de

View file

@ -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;