The current manner in transform_caps() for src direction is not very correct. For example,
when the src caps is:
video/x-raw(memory:DMABuf); video/x-raw; video/x-raw(memory:GLMemory)
this function returns:
video/x-raw(memory:DMABuf); video/x-raw; video/x-raw(memory:GLMemory)
as the sink caps. This is not correct, because DMABuf feature is not even in the sink pad's
caps template. The correct answer should be:
video/x-raw(memory:GLMemory); video/x-raw
only.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1058>
GstCaps *result, *tmp;
if (direction == GST_PAD_SRC) {
- tmp = _set_caps_features (caps, GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
- tmp = gst_caps_merge (gst_caps_ref (caps), tmp);
+ GstCaps *sys_caps = gst_caps_simplify (_set_caps_features (caps,
+ GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY));
+
+ tmp = _set_caps_features (sys_caps, GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
+ tmp = gst_caps_merge (tmp, sys_caps);
} else {
GstCaps *newcaps;
tmp = gst_caps_ref (caps);