index 1c595611647f21190cf3d1b458f1f30415fee6e3..31bbc5d107b2bb9b38c41095a440b39f2aca02e1 100644 (file)
GstBaseTransform *trans;
GstPad *otherpad;
const GstCaps *templ;
- GstCaps *peercaps, *caps, *temp;
+ GstCaps *caps, *temp;
gboolean samecaps;
int cache_index;
cache_index = (pad == trans->srcpad) ? 0 : 1;
/* we can do what the peer can */
- peercaps = gst_pad_peer_get_caps_reffed (otherpad);
+ caps = gst_pad_peer_get_caps_reffed (otherpad);
GST_OBJECT_LOCK (trans);
- samecaps = (peercaps && trans->priv->cached_peer_caps[cache_index]
- && gst_caps_is_strictly_equal (peercaps,
+ samecaps = (caps && trans->priv->cached_peer_caps[cache_index]
+ && gst_caps_is_strictly_equal (caps,
trans->priv->cached_peer_caps[cache_index]));
if (!samecaps) {
if (trans->priv->cached_peer_caps[cache_index]) {
}
GST_OBJECT_UNLOCK (trans);
- if (peercaps) {
- GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, peercaps);
+ if (caps) {
+ GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, caps);
/* filtered against our padtemplate on the other side */
templ = gst_pad_get_pad_template_caps (otherpad);
GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ);
- temp = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
+ temp = gst_caps_intersect (caps, templ);
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
+ gst_caps_unref (caps);
} else {
temp = gst_caps_copy (gst_pad_get_pad_template_caps (otherpad));
GST_DEBUG_OBJECT (pad, "no peer, using our template caps %" GST_PTR_FORMAT,
gst_caps_unref (caps);
caps = temp;
- if (peercaps) {
- /* Now try if we can put the untransformed downstream caps first */
- temp = gst_caps_intersect_full (peercaps, caps, GST_CAPS_INTERSECT_FIRST);
- if (!gst_caps_is_empty (temp)) {
- gst_caps_merge (temp, caps);
- caps = temp;
- } else {
- gst_caps_unref (temp);
- }
- }
-
done_update_cache:
GST_DEBUG_OBJECT (trans, "returning %" GST_PTR_FORMAT, caps);
GST_OBJECT_LOCK (trans);
- if (peercaps) {
- trans->priv->cached_peer_caps[cache_index] = gst_caps_ref (peercaps);
- }
if (caps) {
trans->priv->cached_transformed_caps[cache_index] = gst_caps_ref (caps);
}
done:
GST_OBJECT_UNLOCK (trans);
- if (peercaps)
- gst_caps_unref (peercaps);
-
gst_object_unref (trans);
return caps;