From f8feed18a021732ecaa1744079e62fe2fc046f66 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 21 Dec 2002 14:21:15 +0000 Subject: [PATCH] - queue can change state only when not connected Original commit message from CVS: - queue can change state only when not connected - bufferpools can only be requested from srcpads --- gst/gstpad.c | 14 +++++++++----- gst/gstqueue.c | 2 +- plugins/elements/gstqueue.c | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gst/gstpad.c b/gst/gstpad.c index 451e0ed..edc292e 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -377,13 +377,13 @@ gst_pad_set_active (GstPad *pad, gboolean active) g_return_if_fail (GST_IS_PAD (pad)); - if (GST_PAD_IS_ACTIVE (pad) == active) + old = GST_PAD_IS_ACTIVE (pad); + + if (old == active) return; realpad = GST_PAD_REALIZE (pad); - old = GST_FLAG_IS_SET (realpad, GST_PAD_DISABLED); - if (active) { GST_DEBUG (GST_CAT_PADS, "activating pad %s:%s", GST_DEBUG_PAD_NAME (realpad)); @@ -803,7 +803,8 @@ gst_pad_set_getcaps_function (GstPad *pad, * @pad: a #GstPad to set the bufferpool function for. * @bufpool: the #GstPadBufferPoolFunction to set. * - * Sets the given bufferpool function for the pad. + * Sets the given bufferpool function for the pad. Note that the + * bufferpool function can only be set on sinkpads. */ void gst_pad_set_bufferpool_function (GstPad *pad, @@ -811,6 +812,7 @@ gst_pad_set_bufferpool_function (GstPad *pad, { g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_REAL_PAD (pad)); + g_return_if_fail (GST_PAD_IS_SINK (pad)); GST_RPAD_BUFFERPOOLFUNC (pad) = bufpool; GST_DEBUG (GST_CAT_PADS, "bufferpoolfunc for %s:%s set to %s", @@ -1926,7 +1928,8 @@ gst_pad_recalc_allowed_caps (GstPad *pad) * gst_pad_get_bufferpool: * @pad: a #GstPad to get the bufferpool from. * - * Gets the bufferpool of the peer pad of the given pad. + * Gets the bufferpool of the peer pad of the given pad.Note that + * a bufferpool can only be obtained from a srcpad. * * Returns: the #GstBufferPool, or NULL in case of an error. */ @@ -1937,6 +1940,7 @@ gst_pad_get_bufferpool (GstPad *pad) g_return_val_if_fail (pad != NULL, NULL); g_return_val_if_fail (GST_IS_PAD (pad), NULL); + g_return_val_if_fail (GST_PAD_IS_SRC (pad), NULL); peer = GST_RPAD_PEER (pad); diff --git a/gst/gstqueue.c b/gst/gstqueue.c index 5da77a2..c9fff22 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -644,7 +644,7 @@ gst_queue_change_state (GstElement *element) gst_queue_locked_flush (queue); } else if (new_state == GST_STATE_PLAYING) { - if (!GST_PAD_IS_USABLE (queue->sinkpad)) { + if (!GST_PAD_IS_CONNECTED (queue->sinkpad)) { GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not connected", GST_ELEMENT_NAME (queue)); /* FIXME can this be? */ if (queue->reader) diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 5da77a2..c9fff22 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -644,7 +644,7 @@ gst_queue_change_state (GstElement *element) gst_queue_locked_flush (queue); } else if (new_state == GST_STATE_PLAYING) { - if (!GST_PAD_IS_USABLE (queue->sinkpad)) { + if (!GST_PAD_IS_CONNECTED (queue->sinkpad)) { GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not connected", GST_ELEMENT_NAME (queue)); /* FIXME can this be? */ if (queue->reader) -- 2.7.4