glfilter: prepend intersection to src caps
authorJulien Isorce <julien.isorce@collabora.co.uk>
Tue, 24 Jun 2014 18:23:01 +0000 (19:23 +0100)
committerJulien Isorce <julien.isorce@collabora.co.uk>
Wed, 25 Jun 2014 05:56:25 +0000 (06:56 +0100)
Prefer to stay in the same memory space if possible.
Also it let a chance to do passthrough.

See https://bugzilla.gnome.org/show_bug.cgi?id=732178

gst-libs/gst/gl/gstglfilter.c

index 250ae39..c0c79f3 100644 (file)
@@ -757,6 +757,12 @@ gst_gl_filter_transform_caps (GstBaseTransform * bt,
     result = tmp;
   }
 
+  /* if output still intersects input then prefer the intersection */
+  if (direction == GST_PAD_SINK) {
+    tmp = gst_caps_intersect_full (result, caps, GST_CAPS_INTERSECT_FIRST);
+    result = gst_caps_merge (tmp, result);
+  }
+
   GST_DEBUG_OBJECT (bt, "returning caps: %" GST_PTR_FORMAT, result);
 
   return result;