+2007-01-12 Andy Wingo <wingo@pobox.com>
+
+ * gst/gstpad.c (gst_pad_activate_pull): Refuse to activate unlinked
+ sink pads in pull mode. In addition to being correct, fixes
+ filesrc ! decodebin ! identity ! fakesink.
+ (gst_pad_get_range, gst_pad_pull_range): Don't call
+ gst_pad_set_caps() if the caps changes; instead error out with
+ GST_FLOW_NOT_NEGOTIATED, as discussed in part-negotiation.txt.
+
2007-01-12 Andy Wingo <wingo@pobox.com>
* docs/design/part-negotiation.txt: Update with more policy.
if (G_UNLIKELY (!gst_pad_activate_pull (peer, active)))
goto peer_failed;
gst_object_unref (peer);
+ } else {
+ goto not_linked;
}
} else {
if (G_UNLIKELY (GST_PAD_GETRANGEFUNC (pad) == NULL))
gst_object_unref (peer);
return FALSE;
}
+not_linked:
+ {
+ GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "can't activate unlinked sink "
+ "pad in pull mode");
+ return FALSE;
+ }
failure:
{
GST_OBJECT_LOCK (pad);
* installed (see gst_pad_set_getrange_function()) this function returns
* #GST_FLOW_NOT_SUPPORTED.
*
- * This function will call gst_pad_set_caps() on @pad if the pull is successful
- * and the caps on @buffer differ from what is already set on @pad, as is done
- * in gst_pad_push(). This could cause the function to return
- * #GST_FLOW_NOT_NEGOTIATED if the caps could not be set.
+ * @buffer's caps must either be unset or the same as what is already configured
+ * on @pad. Renegotiation within a running pull-mode pipeline is not supported.
*
* Returns: a #GstFlowReturn from the pad.
*
caps_changed = caps && caps != GST_PAD_CAPS (pad);
GST_OBJECT_UNLOCK (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 %p %" GST_PTR_FORMAT, caps, caps);
- if (G_UNLIKELY (!gst_pad_configure_src (pad, caps, TRUE)))
- goto not_negotiated;
- }
+ /* we got a new datatype from the pad not supported in a running pull-mode
+ * pipeline */
+ if (G_UNLIKELY (caps_changed))
+ goto not_negotiated;
}
return ret;
{
gst_buffer_unref (*buffer);
*buffer = NULL;
- GST_CAT_DEBUG_OBJECT (GST_CAT_SCHEDULING, pad,
- "getrange returned buffer then refused to accept the caps");
+ GST_CAT_WARNING_OBJECT (GST_CAT_SCHEDULING, pad,
+ "getrange returned buffer of different caps");
return GST_FLOW_NOT_NEGOTIATED;
}
}
* See gst_pad_get_range() for a list of return values and for the
* semantics of the arguments of this function.
*
- * This function will call gst_pad_set_caps() on @pad if the pull is successful
- * and the caps on @buffer differ from what is already set on @pad, as is done
- * in gst_pad_chain(). This could cause the function to return
- * #GST_FLOW_NOT_NEGOTIATED if the caps could not be set.
+ * @buffer's caps must either be unset or the same as what is already configured
+ * on @pad. Renegotiation within a running pull-mode pipeline is not supported.
*
* Returns: a #GstFlowReturn from the peer pad.
* When this function returns #GST_FLOW_OK, @buffer will contain a valid
GST_OBJECT_UNLOCK (pad);
/* we got a new datatype on the pad, see if it can handle it */
- if (G_UNLIKELY (caps_changed)) {
- GST_DEBUG_OBJECT (pad, "caps changed to %p %" GST_PTR_FORMAT, caps, caps);
- if (G_UNLIKELY (!gst_pad_configure_sink (pad, caps)))
- goto not_negotiated;
- }
+ if (G_UNLIKELY (caps_changed))
+ goto not_negotiated;
}
return ret;
{
gst_buffer_unref (*buffer);
*buffer = NULL;
- GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
- "pulled buffer but pad did not accept the caps");
+ GST_CAT_WARNING_OBJECT (GST_CAT_SCHEDULING, pad,
+ "pullrange returned buffer of different caps");
return GST_FLOW_NOT_NEGOTIATED;
}
}