Original commit message from CVS:
patch by: Wim Taymans
* gst/gstpad.c: (gst_pad_init), (gst_pad_configure_sink),
(gst_pad_configure_src), (gst_pad_push):
* gst/gstpipeline.c: (gst_pipeline_init):
Fix internal data flow errors. Fixes #338711.
+2006-04-22 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ patch by: Wim Taymans
+
+ * gst/gstpad.c: (gst_pad_init), (gst_pad_configure_sink),
+ (gst_pad_configure_src), (gst_pad_push):
+ * gst/gstpipeline.c: (gst_pipeline_init):
+ Fix internal data flow errors. Fixes #338711.
+
2006-04-12 Wim Taymans <wim@fluendo.com>
* tests/check/gst/gstelement.c: (GST_START_TEST):
2006-04-12 Wim Taymans <wim@fluendo.com>
* tests/check/gst/gstelement.c: (GST_START_TEST):
pad->querytypefunc = GST_DEBUG_FUNCPTR (gst_pad_get_query_types_default);
pad->queryfunc = GST_DEBUG_FUNCPTR (gst_pad_query_default);
pad->intlinkfunc = GST_DEBUG_FUNCPTR (gst_pad_get_internal_links_default);
pad->querytypefunc = GST_DEBUG_FUNCPTR (gst_pad_get_query_types_default);
pad->queryfunc = GST_DEBUG_FUNCPTR (gst_pad_query_default);
pad->intlinkfunc = GST_DEBUG_FUNCPTR (gst_pad_get_internal_links_default);
GST_PAD_ACCEPTCAPSFUNC (pad) = GST_DEBUG_FUNCPTR (gst_pad_acceptcaps_default);
GST_PAD_ACCEPTCAPSFUNC (pad) = GST_DEBUG_FUNCPTR (gst_pad_acceptcaps_default);
pad->do_buffer_signals = 0;
pad->do_event_signals = 0;
pad->do_buffer_signals = 0;
pad->do_event_signals = 0;
* @acceptcaps: the #GstPadAcceptCapsFunction to set.
*
* Sets the given acceptcaps function for the pad. The acceptcaps function
* @acceptcaps: the #GstPadAcceptCapsFunction to set.
*
* Sets the given acceptcaps function for the pad. The acceptcaps function
- * will be called to check if the pad can accept the given caps. Setting the
+ * will be called to check if the pad can accept the given caps.
+ */
+/* Setting the
* acceptcaps function to NULL restores the default behaviour of allowing
* any caps that matches the caps from gst_pad_get_caps.
*/
* acceptcaps function to NULL restores the default behaviour of allowing
* any caps that matches the caps from gst_pad_get_caps.
*/
static gboolean
gst_pad_configure_sink (GstPad * pad, GstCaps * caps)
{
static gboolean
gst_pad_configure_sink (GstPad * pad, GstCaps * caps)
{
+ GstPadAcceptCapsFunction acceptcaps;
GstPadSetCapsFunction setcaps;
gboolean res;
GstPadSetCapsFunction setcaps;
gboolean res;
+ acceptcaps = GST_PAD_ACCEPTCAPSFUNC (pad);
setcaps = GST_PAD_SETCAPSFUNC (pad);
/* See if pad accepts the caps - only needed if
* no setcaps function */
setcaps = GST_PAD_SETCAPSFUNC (pad);
/* See if pad accepts the caps - only needed if
* no setcaps function */
- if (setcaps == NULL)
- if (!gst_pad_accept_caps (pad, caps))
+ if (setcaps == NULL && acceptcaps != NULL)
+ if (!acceptcaps (pad, caps))
goto not_accepted;
/* set caps on pad if call succeeds */
goto not_accepted;
/* set caps on pad if call succeeds */
static gboolean
gst_pad_configure_src (GstPad * pad, GstCaps * caps, gboolean dosetcaps)
{
static gboolean
gst_pad_configure_src (GstPad * pad, GstCaps * caps, gboolean dosetcaps)
{
+ GstPadAcceptCapsFunction acceptcaps;
GstPadSetCapsFunction setcaps;
gboolean res;
GstPadSetCapsFunction setcaps;
gboolean res;
+ acceptcaps = GST_PAD_ACCEPTCAPSFUNC (pad);
setcaps = GST_PAD_SETCAPSFUNC (pad);
/* See if pad accepts the caps - only needed if
* no setcaps function */
setcaps = GST_PAD_SETCAPSFUNC (pad);
/* See if pad accepts the caps - only needed if
* no setcaps function */
- if (setcaps == NULL)
- if (!gst_pad_accept_caps (pad, caps))
+ if (setcaps == NULL && acceptcaps != NULL)
+ if (!acceptcaps (pad, caps))
goto not_accepted;
if (dosetcaps)
goto not_accepted;
if (dosetcaps)
{
GstPad *peer;
GstFlowReturn ret;
{
GstPad *peer;
GstFlowReturn ret;
GstCaps *caps;
gboolean caps_changed;
GstCaps *caps;
gboolean caps_changed;
g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SRC, GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SRC, GST_FLOW_ERROR);
goto not_linked;
gst_object_ref (peer);
goto not_linked;
gst_object_ref (peer);
+#if 0
+ /* FIXME, disabled for 0.10.5 release because it caused to much
+ * regressions */
/* Before pushing the buffer to the peer pad, ensure that caps
* are set on this pad */
caps = GST_BUFFER_CAPS (buffer);
caps_changed = caps && caps != GST_PAD_CAPS (pad);
/* Before pushing the buffer to the peer pad, ensure that caps
* are set on this pad */
caps = GST_BUFFER_CAPS (buffer);
caps_changed = caps && caps != GST_PAD_CAPS (pad);
/* we got a new datatype from the pad, it had better handle it */
if (G_UNLIKELY (caps_changed)) {
GST_DEBUG_OBJECT (pad, "caps changed to %" GST_PTR_FORMAT, caps);
if (G_UNLIKELY (!gst_pad_configure_src (pad, caps, TRUE)))
goto not_negotiated;
}
/* we got a new datatype from the pad, it had better handle it */
if (G_UNLIKELY (caps_changed)) {
GST_DEBUG_OBJECT (pad, "caps changed to %" GST_PTR_FORMAT, caps);
if (G_UNLIKELY (!gst_pad_configure_src (pad, caps, TRUE)))
goto not_negotiated;
}
ret = gst_pad_chain (peer, buffer);
ret = gst_pad_chain (peer, buffer);
GST_OBJECT_UNLOCK (pad);
return GST_FLOW_NOT_LINKED;
}
GST_OBJECT_UNLOCK (pad);
return GST_FLOW_NOT_LINKED;
}
not_negotiated:
{
gst_buffer_unref (buffer);
not_negotiated:
{
gst_buffer_unref (buffer);
"element pushed buffer then refused to accept the caps");
return GST_FLOW_NOT_NEGOTIATED;
}
"element pushed buffer then refused to accept the caps");
return GST_FLOW_NOT_NEGOTIATED;
}
/* create and set a default bus */
bus = gst_bus_new ();
/* create and set a default bus */
bus = gst_bus_new ();
+#if 0
+ /* FIXME, disabled for 0.10.5 release as it caused to many regressions */
/* Start our bus in flushing if appropriate */
if (pipeline->priv->auto_flush_bus)
gst_bus_set_flushing (bus, TRUE);
/* Start our bus in flushing if appropriate */
if (pipeline->priv->auto_flush_bus)
gst_bus_set_flushing (bus, TRUE);
gst_element_set_bus (GST_ELEMENT_CAST (pipeline), bus);
GST_DEBUG_OBJECT (pipeline, "set bus %" GST_PTR_FORMAT " on pipeline", bus);
gst_element_set_bus (GST_ELEMENT_CAST (pipeline), bus);
GST_DEBUG_OBJECT (pipeline, "set bus %" GST_PTR_FORMAT " on pipeline", bus);