From: Sebastian Dröge Date: Tue, 17 May 2011 10:25:22 +0000 (+0200) Subject: base: Update for caps/pad template related API changes X-Git-Tag: RELEASE-0.11.0~287 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f2cd2b0a35ae7725b36c2ee00fd05d4f69e2258;p=platform%2Fupstream%2Fgstreamer.git base: Update for caps/pad template related API changes --- diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 8310e07..f5472d4 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -586,7 +586,7 @@ gst_base_sink_pad_getcaps (GstPad * pad, GstCaps * filter) gst_element_class_get_pad_template (GST_ELEMENT_CLASS (bclass), "sink"); if (pad_template != NULL) { - caps = gst_caps_ref (gst_pad_template_get_caps (pad_template)); + caps = gst_pad_template_get_caps (pad_template); if (filter) { GstCaps *intersection; diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 11461c0..f2d8a44 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -802,7 +802,7 @@ gst_base_src_getcaps (GstPad * pad, GstCaps * filter) pad_template = gst_element_class_get_pad_template (GST_ELEMENT_CLASS (bclass), "src"); if (pad_template != NULL) { - caps = gst_caps_ref (gst_pad_template_get_caps (pad_template)); + caps = gst_pad_template_get_caps (pad_template); if (filter) { GstCaps *intersection; diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index f6944a7..9fbaedc 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -646,8 +646,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter) /* we can do what the peer can */ if (filter) { - GstCaps *temp; - const GstCaps *templ; + GstCaps *temp, *templ; GST_DEBUG_OBJECT (pad, "filter caps %" GST_PTR_FORMAT, filter); @@ -656,6 +655,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter) GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ); temp = gst_caps_intersect_full (filter, templ, GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp); + gst_caps_unref (templ); /* then see what we can transform this to */ peerfilter = gst_base_transform_transform_caps (trans, @@ -671,6 +671,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter) gst_caps_intersect_full (peerfilter, templ, GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp); gst_caps_unref (peerfilter); + gst_caps_unref (templ); peerfilter = temp; } @@ -680,8 +681,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter) gst_caps_unref (peerfilter); if (peercaps && !gst_caps_is_any (peercaps)) { - GstCaps *temp; - const GstCaps *templ; + GstCaps *temp, *templ; GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, peercaps); @@ -690,6 +690,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter) GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ); temp = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp); + gst_caps_unref (templ); /* then see what we can transform this to */ caps = gst_base_transform_transform_caps (trans, @@ -706,6 +707,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter) temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp); gst_caps_unref (caps); + gst_caps_unref (templ); caps = temp; /* Now try if we can put the untransformed downstream caps first */ @@ -718,7 +720,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter) } } else { /* no peer or the peer can do anything, our padtemplate is enough then */ - caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); + caps = gst_pad_get_pad_template_caps (pad); if (filter) { GstCaps *temp; @@ -827,8 +829,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad, /* The caps we can actually output is the intersection of the transformed * caps with the pad template for the pad */ if (othercaps) { - GstCaps *intersect; - const GstCaps *templ_caps; + GstCaps *intersect, *templ_caps; templ_caps = gst_pad_get_pad_template_caps (otherpad); GST_DEBUG_OBJECT (trans, @@ -839,6 +840,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (othercaps); + gst_caps_unref (templ_caps); othercaps = intersect; } @@ -857,8 +859,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad, /* Now let's see what the peer suggests based on our transformed caps */ if (otherpeer) { - GstCaps *peercaps, *intersection; - const GstCaps *templ_caps; + GstCaps *peercaps, *intersection, *templ_caps; GST_DEBUG_OBJECT (trans, "Checking peer caps with filter %" GST_PTR_FORMAT, othercaps); @@ -876,6 +877,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad, GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (trans, "Intersection: %" GST_PTR_FORMAT, intersection); gst_caps_unref (peercaps); + gst_caps_unref (templ_caps); peercaps = intersection; GST_DEBUG_OBJECT (trans,