From bedb0bef2b149d8391cc2a080a23a4932032d397 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 11 Oct 2004 05:23:40 +0000 Subject: [PATCH] gst/gstpad.c: allow renegotiation of unconnected pads (as inside spider). Simply return OK if unconnected - mimic try... Original commit message from CVS: * gst/gstpad.c: (gst_pad_renegotiate), (gst_pad_try_set_caps), (gst_pad_try_set_caps_nonfixed): allow renegotiation of unconnected pads (as inside spider). Simply return OK if unconnected - mimic try_set_caps there. --- ChangeLog | 8 ++++++++ gst/gstpad.c | 14 ++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69fe474cb2..7f2e152daa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-10-11 Benjamin Otte + + * gst/gstpad.c: (gst_pad_renegotiate), (gst_pad_try_set_caps), + (gst_pad_try_set_caps_nonfixed): + allow renegotiation of unconnected pads (as inside spider). Simply + return OK if unconnected - mimic try_set_caps there. + 2004-10-09 Ronald S. Bultje * gst/gstbin.c: (gst_bin_sync_children_state): @@ -197,6 +204,7 @@ * gst/elements/gstidentity.h: Added datarate properties to limit the datarate. +>>>>>>> 1.808 2004-08-25 Benjamin Otte * gst/autoplug/gstspider.c: (plugin_init): diff --git a/gst/gstpad.c b/gst/gstpad.c index d6e4270be8..f801cbc31e 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1430,8 +1430,8 @@ gst_pad_renegotiate (GstPad * pad) GstPadLink *link; g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_LINK_REFUSED); - g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED); - g_return_val_if_fail (GST_PAD_LINK_SINK (pad), GST_PAD_LINK_REFUSED); + if (!GST_PAD_PEER (pad)) + return GST_PAD_LINK_OK; link = gst_pad_link_new (); @@ -1503,8 +1503,9 @@ gst_pad_try_set_caps (GstPad * pad, const GstCaps * caps) return GST_PAD_LINK_OK; } - g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED); - g_return_val_if_fail (GST_PAD_LINK_SINK (pad), GST_PAD_LINK_REFUSED); + /* we just checked that a peer exists */ + g_assert (GST_PAD_LINK_SRC (pad)); + g_assert (GST_PAD_LINK_SINK (pad)); /* if the desired caps are already there, it's trivially ok */ if (GST_PAD_CAPS (pad) && gst_caps_is_equal (caps, GST_PAD_CAPS (pad))) { @@ -1567,8 +1568,9 @@ gst_pad_try_set_caps_nonfixed (GstPad * pad, const GstCaps * caps) return GST_PAD_LINK_OK; } - g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED); - g_return_val_if_fail (GST_PAD_LINK_SINK (pad), GST_PAD_LINK_REFUSED); + /* we just checked that a peer exists */ + g_assert (GST_PAD_LINK_SRC (pad)); + g_assert (GST_PAD_LINK_SINK (pad)); /* if the link is already negotiated and the caps are compatible * with what we're setting, it's trivially OK. */