From: Vincent Penquerc'h Date: Mon, 17 Oct 2011 18:06:00 +0000 (+0000) Subject: playsink: consider both passthrough and converter caps in getcaps X-Git-Tag: 1.19.3~511^2~6555^2~369 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3939457b00f3ae81833c41b8fbab2bed5099aee9;p=platform%2Fupstream%2Fgstreamer.git playsink: consider both passthrough and converter caps in getcaps Since we can switch between both modes. https://bugzilla.gnome.org/show_bug.cgi?id=661262 --- diff --git a/gst/playback/gstplaysinkconvertbin.c b/gst/playback/gstplaysinkconvertbin.c index 8754449..349c0a5 100644 --- a/gst/playback/gstplaysinkconvertbin.c +++ b/gst/playback/gstplaysinkconvertbin.c @@ -343,33 +343,28 @@ gst_play_sink_convert_bin_getcaps (GstPad * pad) GstPad *otherpad, *peer; GST_PLAY_SINK_CONVERT_BIN_LOCK (self); - otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad)); - if (!otherpad) { - if (pad == self->srcpad) { - otherpad = self->sink_proxypad; - } else if (pad == self->sinkpad) { - otherpad = - GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD - (self->sinkpad))); - } else { - GST_ERROR_OBJECT (pad, "Not one of our pads"); - } + if (pad == self->srcpad) { + otherpad = self->sinkpad; + } else if (pad == self->sinkpad) { + otherpad = self->srcpad; + } else { + GST_ERROR_OBJECT (pad, "Not one of our pads"); + otherpad = NULL; } - GST_PLAY_SINK_CONVERT_BIN_UNLOCK (self); if (otherpad) { peer = gst_pad_get_peer (otherpad); if (peer) { - ret = gst_pad_get_caps_reffed (peer); + GstCaps *peer_caps = gst_pad_get_caps_reffed (peer); gst_object_unref (peer); + ret = gst_caps_union (peer_caps, self->converter_caps); + gst_caps_unref (peer_caps); } else { - ret = gst_caps_new_any (); + ret = gst_caps_ref (self->converter_caps); } - gst_object_unref (otherpad); - } else { - GST_WARNING_OBJECT (self, "Could not traverse bin"); - ret = gst_caps_new_any (); } + GST_PLAY_SINK_CONVERT_BIN_UNLOCK (self); + gst_object_unref (self); return ret;