From: Sebastian Dröge Date: Thu, 24 Nov 2011 11:38:54 +0000 (+0100) Subject: playsinkconvertbin: Reconfigure if we switch from raw to incompatible raw caps X-Git-Tag: 1.19.3~511^2~6555^2~309 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=683735a01e077e4f8082dd9a87664544058a3cf4;p=platform%2Fupstream%2Fgstreamer.git playsinkconvertbin: Reconfigure if we switch from raw to incompatible raw caps We might need to add converters and worked in passthrough mode before. --- diff --git a/gst/playback/gstplaysinkconvertbin.c b/gst/playback/gstplaysinkconvertbin.c index 50b1d6d..d49224d 100644 --- a/gst/playback/gstplaysinkconvertbin.c +++ b/gst/playback/gstplaysinkconvertbin.c @@ -319,13 +319,25 @@ gst_play_sink_convert_bin_sink_setcaps (GstPad * pad, GstCaps * caps) GST_DEBUG_OBJECT (self, "raw %d, self->raw %d, blocked %d", raw, self->raw, gst_pad_is_blocked (self->sink_proxypad)); + if (raw) { - if (!self->raw && !gst_pad_is_blocked (self->sink_proxypad)) { - GST_DEBUG_OBJECT (self, "Changing caps from non-raw to raw"); - reconfigure = TRUE; - gst_pad_set_blocked_async_full (self->sink_proxypad, TRUE, - (GstPadBlockCallback) pad_blocked_cb, gst_object_ref (self), - (GDestroyNotify) gst_object_unref); + if (!gst_pad_is_blocked (self->sink_proxypad)) { + GstPad *target = gst_ghost_pad_get_target (GST_GHOST_PAD (self->sinkpad)); + + if (!self->raw || (target && !gst_pad_accept_caps (target, caps))) { + if (!self->raw) + GST_DEBUG_OBJECT (self, "Changing caps from non-raw to raw"); + else + GST_DEBUG_OBJECT (self, "Changing caps in an incompatible way"); + + reconfigure = TRUE; + gst_pad_set_blocked_async_full (self->sink_proxypad, TRUE, + (GstPadBlockCallback) pad_blocked_cb, gst_object_ref (self), + (GDestroyNotify) gst_object_unref); + } + + if (target) + gst_object_unref (target); } } else { if (self->raw && !gst_pad_is_blocked (self->sink_proxypad)) {