From acf6165c5eca89ef6159c8ee2b0ff19a38dd7267 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 28 Feb 2007 16:43:43 +0000 Subject: [PATCH] gst/gstelement.*: Improve docs a little. Added Since: for new macro. Original commit message from CVS: * gst/gstelement.c: (gst_element_message_full), (gst_element_get_state_func): * gst/gstelement.h: Improve docs a little. Added Since: for new macro. * gst/gstobject.c: (gst_object_sink): * gst/gstpipeline.c: (gst_pipeline_change_state), (gst_pipeline_set_new_stream_time): * gst/gstpipeline.h: Improve debugging and docs. * gst/gstutils.c: (gst_element_state_change_return_get_name): Improve debugging. --- ChangeLog | 16 ++++++++++++++++ gst/gstelement.c | 5 ++++- gst/gstelement.h | 2 ++ gst/gstobject.c | 1 + gst/gstpipeline.c | 24 ++++++++++++++++-------- gst/gstpipeline.h | 12 ++++++++---- gst/gstutils.c | 2 +- 7 files changed, 48 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index b65ee044da..2f5247188c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2007-02-28 Wim Taymans + + * gst/gstelement.c: (gst_element_message_full), + (gst_element_get_state_func): + * gst/gstelement.h: + Improve docs a little. Added Since: for new macro. + + * gst/gstobject.c: (gst_object_sink): + * gst/gstpipeline.c: (gst_pipeline_change_state), + (gst_pipeline_set_new_stream_time): + * gst/gstpipeline.h: + Improve debugging and docs. + + * gst/gstutils.c: (gst_element_state_change_return_get_name): + Improve debugging. + 2007-02-28 Wim Taymans * gst/gstelement.c: (gst_element_message_full), diff --git a/gst/gstelement.c b/gst/gstelement.c index 26bcd6962a..0d25557147 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1536,7 +1536,10 @@ _gst_element_error_printf (const gchar * format, ...) * @function: the source code function where the error was generated * @line: the source code line where the error was generated * - * Post an error or warning message on the bus from inside an element. + * Post an error, warning or info message on the bus from inside an element. + * + * @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or + * #GST_MESSAGE_INFO. * * MT safe. */ diff --git a/gst/gstelement.h b/gst/gstelement.h index d80a9b52ec..9aad5e5151 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -320,6 +320,8 @@ G_STMT_START { \ * the application of something noteworthy that is not an error. * The pipeline will post a warning message and the * application will be informed. + * + * Since: 0.10.12 */ #define GST_ELEMENT_INFO(el, domain, code, text, debug) \ G_STMT_START { \ diff --git a/gst/gstobject.c b/gst/gstobject.c index 404c3849ee..2a0963d909 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -380,6 +380,7 @@ gst_object_sink (gpointer object) GST_OBJECT_LOCK (object); if (G_LIKELY (GST_OBJECT_IS_FLOATING (object))) { + GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "clear floating flag"); GST_OBJECT_FLAG_UNSET (object, GST_OBJECT_FLOATING); GST_OBJECT_UNLOCK (object); gst_object_unref (object); diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 49613584b8..a28f5ec609 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -436,14 +436,16 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) GstClockTime start_time, stream_time, delay; gboolean new_clock; + GST_DEBUG_OBJECT (element, "selecting clock and base_time"); + /* when going to playing, select a clock */ clock = gst_element_provide_clock (element); if (clock) { start_time = gst_clock_get_time (clock); } else { - start_time = GST_CLOCK_TIME_NONE; GST_DEBUG ("no clock, using base time of NONE"); + start_time = GST_CLOCK_TIME_NONE; new_base_time = GST_CLOCK_TIME_NONE; } @@ -467,9 +469,14 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) } if (stream_time != GST_CLOCK_TIME_NONE - && start_time != GST_CLOCK_TIME_NONE) + && start_time != GST_CLOCK_TIME_NONE) { new_base_time = start_time - stream_time + delay; - else + GST_DEBUG_OBJECT (element, + "stream_time=%" GST_TIME_FORMAT ", now=%" GST_TIME_FORMAT + ", base_time %" GST_TIME_FORMAT, + GST_TIME_ARGS (stream_time), GST_TIME_ARGS (start_time), + GST_TIME_ARGS (new_base_time)); + } else new_base_time = GST_CLOCK_TIME_NONE; if (clock) @@ -498,8 +505,8 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) { gboolean need_reset; - /* only reset the stream time when the application did not - * specify a stream time explicitly */ + /* only reset the stream_time when the application did not + * specify a stream_time explicitly */ GST_OBJECT_LOCK (element); need_reset = pipeline->stream_time != GST_CLOCK_TIME_NONE; GST_OBJECT_UNLOCK (element); @@ -529,7 +536,7 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) pipeline->stream_time = now - element->base_time; GST_DEBUG_OBJECT (element, "stream_time=%" GST_TIME_FORMAT ", now=%" GST_TIME_FORMAT - ", base time %" GST_TIME_FORMAT, + ", base_time %" GST_TIME_FORMAT, GST_TIME_ARGS (pipeline->stream_time), GST_TIME_ARGS (now), GST_TIME_ARGS (element->base_time)); } @@ -613,7 +620,7 @@ gst_pipeline_set_new_stream_time (GstPipeline * pipeline, GstClockTime time) GST_TIME_ARGS (time)); if (time == GST_CLOCK_TIME_NONE) - GST_DEBUG_OBJECT (pipeline, "told not to adjust base time"); + GST_DEBUG_OBJECT (pipeline, "told not to adjust base_time"); } /** @@ -794,7 +801,8 @@ gst_pipeline_auto_clock (GstPipeline * pipeline) * Set the expected delay needed for all elements to perform the * PAUSED to PLAYING state change. @delay will be added to the * base time of the elements so that they wait an additional @delay - * amount of time before starting to process buffers. + * amount of time before starting to process buffers and cannot be + * #GST_CLOCK_TIME_NONE. * * This option is used for tuning purposes and should normally not be * used. diff --git a/gst/gstpipeline.h b/gst/gstpipeline.h index 5355a04aa3..bb44bccbb9 100644 --- a/gst/gstpipeline.h +++ b/gst/gstpipeline.h @@ -34,6 +34,7 @@ G_BEGIN_DECLS #define GST_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PIPELINE, GstPipelineClass)) #define GST_IS_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PIPELINE)) #define GST_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PIPELINE, GstPipelineClass)) +#define GST_PIPELINE_CAST(obj) ((GstPipeline*)(obj)) typedef struct _GstPipeline GstPipeline; typedef struct _GstPipelineClass GstPipelineClass; @@ -56,8 +57,10 @@ typedef enum { * GstPipeline: * @fixed_clock: The fixed clock of the pipeline, used when * GST_PIPELINE_FLAG_FIXED_CLOCK is set. - * @stream_time: The stream time of the pipeline. - * @delay: Extra delay added to base time to compensate for delay + * @stream_time: The stream time of the pipeline. A better name for this + * property would be the running_time, the total time spent in the + * PLAYING state without being flushed. + * @delay: Extra delay added to base_time to compensate for computing delays * when setting elements to PLAYING. * * The #GstPipeline structure. @@ -66,8 +69,9 @@ struct _GstPipeline { GstBin bin; /*< public >*/ /* with LOCK */ - GstClock *fixed_clock; /* fixed clock if any */ - GstClockTime stream_time; + GstClock *fixed_clock; + + GstClockTime stream_time; GstClockTime delay; /*< private >*/ diff --git a/gst/gstutils.c b/gst/gstutils.c index 5ac9bd3b6a..f0ed2adbf6 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -1043,7 +1043,7 @@ gst_element_state_change_return_get_name (GstStateChangeReturn state_ret) case GST_STATE_CHANGE_ASYNC: return "\033[01;33mASYNC\033[00m"; case GST_STATE_CHANGE_NO_PREROLL: - return "\033[01;34mNO PREROLL\033[00m"; + return "\033[01;34mNO_PREROLL\033[00m"; default: /* This is a memory leak */ return g_strdup_printf ("\033[01;35;41mUNKNOWN!\033[00m(%d)", state_ret);