gst/gstbin.c: The message src can be NULL, don't try to print the object names in that case.

Original commit message from CVS:
* gst/gstbin.c: (gst_bin_remove_func), (update_degree),
(gst_bin_handle_message_func):
The message src can be NULL, don't try to print the object names in that
case.
* libs/gst/base/gstbasesink.c: (gst_base_sink_pad_activate):
Add some more debug info.
* tests/check/pipelines/simple-launch-lines.c: (run_pipeline),
(GST_START_TEST):
Add some debug.
Fix the test, pull based sinks go ASYNC to PAUSED, just like other
scheduling modes.
This commit is contained in:
Wim Taymans 2008-10-10 10:38:12 +00:00
parent b3403511ea
commit bc8e367885
4 changed files with 40 additions and 15 deletions

View file

@ -1,3 +1,19 @@
2008-10-10 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/gstbin.c: (gst_bin_remove_func), (update_degree),
(gst_bin_handle_message_func):
The message src can be NULL, don't try to print the object names in that
case.
* libs/gst/base/gstbasesink.c: (gst_base_sink_pad_activate):
Add some more debug info.
* tests/check/pipelines/simple-launch-lines.c: (run_pipeline),
(GST_START_TEST):
Add some debug.
Fix the test, pull based sinks go ASYNC to PAUSED, just like other
scheduling modes.
2008-10-10 Wim Taymans <wim.taymans@collabora.co.uk> 2008-10-10 Wim Taymans <wim.taymans@collabora.co.uk>
* docs/design/part-negotiation.txt: * docs/design/part-negotiation.txt:

View file

@ -1167,15 +1167,14 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
else else
other_async = TRUE; other_async = TRUE;
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), GST_DEBUG_OBJECT (src, "looking at message %p", message);
"looking at message %p", message);
break; break;
case GST_MESSAGE_STRUCTURE_CHANGE: case GST_MESSAGE_STRUCTURE_CHANGE:
{ {
GstElement *owner; GstElement *owner;
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), GST_DEBUG_OBJECT (src, "looking at structure change message %p",
"looking at structure change message %p", message); message);
/* it's unlikely that this message is still in the list of messages /* it's unlikely that this message is still in the list of messages
* because this would mean that a link/unlink is busy in another thread * because this would mean that a link/unlink is busy in another thread
* while we remove the element. We still have to remove the message * while we remove the element. We still have to remove the message
@ -1194,8 +1193,8 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
if (remove) { if (remove) {
/* delete all message types */ /* delete all message types */
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), GST_DEBUG_OBJECT (src, "deleting message %p of element \"%s\"",
"deleting message %p of element \"%s\"", message, elem_name); message, elem_name);
bin->messages = g_list_delete_link (bin->messages, walk); bin->messages = g_list_delete_link (bin->messages, walk);
gst_message_unref (message); gst_message_unref (message);
} }
@ -2769,7 +2768,8 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
type = GST_MESSAGE_TYPE (message); type = GST_MESSAGE_TYPE (message);
GST_DEBUG_OBJECT (bin, "[msg %p] handling child %s message of type %s", GST_DEBUG_OBJECT (bin, "[msg %p] handling child %s message of type %s",
message, GST_ELEMENT_NAME (src), GST_MESSAGE_TYPE_NAME (message)); message, src ? GST_ELEMENT_NAME (src) : "(NULL)",
GST_MESSAGE_TYPE_NAME (message));
switch (type) { switch (type) {
case GST_MESSAGE_EOS: case GST_MESSAGE_EOS:
@ -2903,7 +2903,7 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
GstState target; GstState target;
GST_DEBUG_OBJECT (bin, "ASYNC_START message %p, %s", message, GST_DEBUG_OBJECT (bin, "ASYNC_START message %p, %s", message,
GST_OBJECT_NAME (src)); src ? GST_OBJECT_NAME (src) : "(NULL)");
gst_message_parse_async_start (message, &new_base_time); gst_message_parse_async_start (message, &new_base_time);
@ -2935,7 +2935,7 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
gboolean is_bin; gboolean is_bin;
GST_DEBUG_OBJECT (bin, "ASYNC_DONE message %p, %s", message, GST_DEBUG_OBJECT (bin, "ASYNC_DONE message %p, %s", message,
GST_OBJECT_NAME (src)); src ? GST_OBJECT_NAME (src) : "(NULL)");
GST_OBJECT_LOCK (bin); GST_OBJECT_LOCK (bin);
target = GST_STATE_TARGET (bin); target = GST_STATE_TARGET (bin);

View file

@ -3000,12 +3000,16 @@ gst_base_sink_pad_activate (GstPad * pad)
gst_base_sink_set_flushing (basesink, pad, FALSE); gst_base_sink_set_flushing (basesink, pad, FALSE);
/* we need to have the pull mode enabled */ /* we need to have the pull mode enabled */
if (!basesink->can_activate_pull) if (!basesink->can_activate_pull) {
GST_DEBUG_OBJECT (basesink, "pull mode disabled");
goto fallback; goto fallback;
}
/* check if downstreams supports pull mode at all */ /* check if downstreams supports pull mode at all */
if (!gst_pad_check_pull_range (pad)) if (!gst_pad_check_pull_range (pad)) {
GST_DEBUG_OBJECT (basesink, "pull mode not supported");
goto fallback; goto fallback;
}
/* set the pad mode before starting the task so that it's in the /* set the pad mode before starting the task so that it's in the
* correct state for the new thread. also the sink set_caps and get_caps * correct state for the new thread. also the sink set_caps and get_caps
@ -3014,8 +3018,10 @@ gst_base_sink_pad_activate (GstPad * pad)
/* we first try to negotiate a format so that when we try to activate /* we first try to negotiate a format so that when we try to activate
* downstream, it knows about our format */ * downstream, it knows about our format */
if (!gst_base_sink_negotiate_pull (basesink)) if (!gst_base_sink_negotiate_pull (basesink)) {
GST_DEBUG_OBJECT (basesink, "failed to negotiate in pull mode");
goto fallback; goto fallback;
}
/* ok activate now */ /* ok activate now */
if (!gst_pad_activate_pull (pad, TRUE)) { if (!gst_pad_activate_pull (pad, TRUE)) {
@ -3023,6 +3029,7 @@ gst_base_sink_pad_activate (GstPad * pad)
GST_OBJECT_LOCK (basesink); GST_OBJECT_LOCK (basesink);
gst_caps_replace (&basesink->priv->pull_caps, NULL); gst_caps_replace (&basesink->priv->pull_caps, NULL);
GST_OBJECT_UNLOCK (basesink); GST_OBJECT_UNLOCK (basesink);
GST_DEBUG_OBJECT (basesink, "failed to activate in pull mode");
goto fallback; goto fallback;
} }

View file

@ -54,10 +54,13 @@ run_pipeline (GstElement * pipeline, gchar * descr,
bus = gst_element_get_bus (pipeline); bus = gst_element_get_bus (pipeline);
fail_if (bus == NULL); fail_if (bus == NULL);
GST_DEBUG ("running pipeline %s", descr);
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING); ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
ret = gst_element_get_state (pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); ret = gst_element_get_state (pipeline, NULL, NULL, GST_CLOCK_TIME_NONE);
if (ret != GST_STATE_CHANGE_SUCCESS) { if (ret != GST_STATE_CHANGE_SUCCESS) {
GST_WARNING ("have failed state change %d", ret);
g_critical ("Couldn't set pipeline to PLAYING"); g_critical ("Couldn't set pipeline to PLAYING");
goto done; goto done;
} }
@ -168,11 +171,10 @@ GST_START_TEST (test_state_change_returns)
check_state_change_return (pipeline, GST_STATE_READY, check_state_change_return (pipeline, GST_STATE_READY,
GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS);
check_state_change_return (pipeline, GST_STATE_PAUSED, check_state_change_return (pipeline, GST_STATE_PAUSED,
GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); GST_STATE_CHANGE_ASYNC, GST_STATE_CHANGE_SUCCESS);
check_state_change_return (pipeline, GST_STATE_PLAYING, check_state_change_return (pipeline, GST_STATE_PLAYING,
GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS);
check_state_change_return (pipeline, GST_STATE_PAUSED, /* can't check PAUSED, it's not deterministic */
GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS);
check_state_change_return (pipeline, GST_STATE_READY, check_state_change_return (pipeline, GST_STATE_READY,
GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS);
check_state_change_return (pipeline, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS, check_state_change_return (pipeline, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS,