videofilter: Use new GstBaseTransform::transform_caps API
authorEdward Hervey <edward.hervey@collabora.co.uk>
Tue, 7 Jun 2011 09:25:18 +0000 (11:25 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Tue, 7 Jun 2011 09:25:18 +0000 (11:25 +0200)
gst/videofilter/gstvideoflip.c

index adeea45..8e249ae 100644 (file)
@@ -135,7 +135,7 @@ G_DEFINE_TYPE (GstVideoFlip, gst_video_flip, GST_TYPE_VIDEO_FILTER);
 
 static GstCaps *
 gst_video_flip_transform_caps (GstBaseTransform * trans,
-    GstPadDirection direction, GstCaps * caps)
+    GstPadDirection direction, GstCaps * caps, GstCaps * filter)
 {
   GstVideoFlip *videoflip = GST_VIDEO_FLIP (trans);
   GstCaps *ret;
@@ -186,6 +186,17 @@ gst_video_flip_transform_caps (GstBaseTransform * trans,
   GST_DEBUG_OBJECT (videoflip, "transformed %" GST_PTR_FORMAT " to %"
       GST_PTR_FORMAT, caps, ret);
 
+  if (filter) {
+    GstCaps *intersection;
+
+    GST_DEBUG_OBJECT (videoflip, "Using filter caps %" GST_PTR_FORMAT, filter);
+    intersection =
+        gst_caps_intersect_full (filter, ret, GST_CAPS_INTERSECT_FIRST);
+    gst_caps_unref (ret);
+    ret = intersection;
+    GST_DEBUG_OBJECT (videoflip, "Intersection %" GST_PTR_FORMAT, ret);
+  }
+
   return ret;
 }