From bc8e36788554a9764a5d50dbe57ce781adb4182e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 10 Oct 2008 10:38:12 +0000 Subject: [PATCH] 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. --- ChangeLog | 16 ++++++++++++++++ gst/gstbin.c | 18 +++++++++--------- libs/gst/base/gstbasesink.c | 13 ++++++++++--- tests/check/pipelines/simple-launch-lines.c | 8 +++++--- 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32989b2..9b319ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,21 @@ 2008-10-10 Wim Taymans + * 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 + * docs/design/part-negotiation.txt: Small doc update. diff --git a/gst/gstbin.c b/gst/gstbin.c index 7b78dd1..d522489 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -1167,15 +1167,14 @@ gst_bin_remove_func (GstBin * bin, GstElement * element) else other_async = TRUE; - GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), - "looking at message %p", message); + GST_DEBUG_OBJECT (src, "looking at message %p", message); break; case GST_MESSAGE_STRUCTURE_CHANGE: { GstElement *owner; - GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), - "looking at structure change message %p", message); + GST_DEBUG_OBJECT (src, "looking at structure change message %p", + message); /* 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 * 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) { /* delete all message types */ - GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), - "deleting message %p of element \"%s\"", message, elem_name); + GST_DEBUG_OBJECT (src, "deleting message %p of element \"%s\"", + message, elem_name); bin->messages = g_list_delete_link (bin->messages, walk); gst_message_unref (message); } @@ -2769,7 +2768,8 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message) type = GST_MESSAGE_TYPE (message); 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) { case GST_MESSAGE_EOS: @@ -2903,7 +2903,7 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message) GstState target; 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); @@ -2935,7 +2935,7 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message) gboolean is_bin; GST_DEBUG_OBJECT (bin, "ASYNC_DONE message %p, %s", message, - GST_OBJECT_NAME (src)); + src ? GST_OBJECT_NAME (src) : "(NULL)"); GST_OBJECT_LOCK (bin); target = GST_STATE_TARGET (bin); diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index a6d8edd..6d058c6 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -3000,12 +3000,16 @@ gst_base_sink_pad_activate (GstPad * pad) gst_base_sink_set_flushing (basesink, pad, FALSE); /* 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; + } /* 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; + } /* 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 @@ -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 * 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; + } /* ok activate now */ if (!gst_pad_activate_pull (pad, TRUE)) { @@ -3023,6 +3029,7 @@ gst_base_sink_pad_activate (GstPad * pad) GST_OBJECT_LOCK (basesink); gst_caps_replace (&basesink->priv->pull_caps, NULL); GST_OBJECT_UNLOCK (basesink); + GST_DEBUG_OBJECT (basesink, "failed to activate in pull mode"); goto fallback; } diff --git a/tests/check/pipelines/simple-launch-lines.c b/tests/check/pipelines/simple-launch-lines.c index e0d2ba8..167e049 100644 --- a/tests/check/pipelines/simple-launch-lines.c +++ b/tests/check/pipelines/simple-launch-lines.c @@ -54,10 +54,13 @@ run_pipeline (GstElement * pipeline, gchar * descr, bus = gst_element_get_bus (pipeline); fail_if (bus == NULL); + GST_DEBUG ("running pipeline %s", descr); + ret = gst_element_set_state (pipeline, GST_STATE_PLAYING); ret = gst_element_get_state (pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); if (ret != GST_STATE_CHANGE_SUCCESS) { + GST_WARNING ("have failed state change %d", ret); g_critical ("Couldn't set pipeline to PLAYING"); goto done; } @@ -168,11 +171,10 @@ GST_START_TEST (test_state_change_returns) check_state_change_return (pipeline, GST_STATE_READY, GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); 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, GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); - check_state_change_return (pipeline, GST_STATE_PAUSED, - GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); + /* can't check PAUSED, it's not deterministic */ check_state_change_return (pipeline, GST_STATE_READY, GST_STATE_CHANGE_SUCCESS, GST_STATE_CHANGE_SUCCESS); check_state_change_return (pipeline, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS, -- 2.7.4