diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2003-05-24 10:20:31 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2003-05-24 10:20:31 +0000 |
commit | ecbb3f88ca5a1e53d5e4e4d3d33cde6ff8dde77d (patch) | |
tree | 1ea8973cc76eaf53fe5d6f6dc3f2c71dbeba8acd | |
parent | 940740d32a58201798c47729771178b18316dd23 (diff) | |
download | gst-plugins-bad-ecbb3f88ca5a1e53d5e4e4d3d33cde6ff8dde77d.tar.gz gst-plugins-bad-ecbb3f88ca5a1e53d5e4e4d3d33cde6ff8dde77d.tar.bz2 gst-plugins-bad-ecbb3f88ca5a1e53d5e4e4d3d33cde6ff8dde77d.zip |
better state change/link function
Original commit message from CVS:
better state change/link function
-rw-r--r-- | ext/hermes/gstcolorspace.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/ext/hermes/gstcolorspace.c b/ext/hermes/gstcolorspace.c index f99525e8..aeb66450 100644 --- a/ext/hermes/gstcolorspace.c +++ b/ext/hermes/gstcolorspace.c @@ -336,6 +336,7 @@ gst_colorspace_srcconnect_func (GstPad *pad, GstCaps *caps, gboolean newcaps) GstColorspace *space; GstCaps *peercaps; GstCaps *ourcaps, *to_intersect, *try_peercaps; + GstPadLinkReturn res = GST_PAD_LINK_REFUSED; space = GST_COLORSPACE (gst_pad_get_parent (pad)); @@ -357,7 +358,8 @@ gst_colorspace_srcconnect_func (GstPad *pad, GstCaps *caps, gboolean newcaps) space->type = GST_COLORSPACE_NONE; space->disabled = FALSE; gst_caps_unref (peercaps); - return GST_PAD_LINK_DONE; + res = GST_PAD_LINK_DONE; + goto success; } gst_caps_unref (peercaps); } @@ -385,17 +387,28 @@ gst_colorspace_srcconnect_func (GstPad *pad, GstCaps *caps, gboolean newcaps) if (gst_pad_try_set_caps (space->srcpad, peercaps) > 0) { space->disabled = FALSE; gst_caps_unref (try_peercaps); - return GST_PAD_LINK_DONE; + res = GST_PAD_LINK_DONE; + goto success; } } peercaps = peercaps->next; } gst_caps_unref (try_peercaps); + + if (gst_pad_recover_caps_error (space->srcpad, NULL)) { + res = GST_PAD_LINK_DONE; + goto success; + } /* we disable ourself here */ space->disabled = TRUE; + goto done; - return GST_PAD_LINK_REFUSED; +success: + space->pool = gst_pad_get_bufferpool (space->srcpad); +done: + + return res; } GType @@ -554,7 +567,6 @@ gst_colorspace_change_state (GstElement *element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_PAUSED_TO_PLAYING: - space->pool = gst_pad_get_bufferpool (space->srcpad); break; case GST_STATE_PLAYING_TO_PAUSED: if (space->pool) @@ -570,9 +582,7 @@ gst_colorspace_change_state (GstElement *element) break; } - parent_class->change_state (element); - - return GST_STATE_SUCCESS; + return parent_class->change_state (element); } static void |