Navigation Menu

Skip to content

Commit

Permalink
gl: download: Fix the wrong transformed result from src direction in …
Browse files Browse the repository at this point in the history
…transform_caps().

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>
  • Loading branch information
HeJunyan authored and GStreamer Marge Bot committed Mar 3, 2021
1 parent ccebcaa commit 2f3033c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ext/gl/gstgldownloadelement.c
Expand Up @@ -209,8 +209,11 @@ gst_gl_download_element_transform_caps (GstBaseTransform * bt,
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);
Expand Down

0 comments on commit 2f3033c

Please sign in to comment.