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.
This commit is contained in:
Wim Taymans 2007-02-28 16:43:43 +00:00
parent 31be175723
commit acf6165c5e
7 changed files with 48 additions and 14 deletions

View file

@ -1,3 +1,19 @@
2007-02-28 Wim Taymans <wim@fluendo.com>
* 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 <wim@fluendo.com>
* gst/gstelement.c: (gst_element_message_full),

View file

@ -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.
*/

View file

@ -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 { \

View file

@ -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);

View file

@ -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.

View file

@ -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 >*/

View file

@ -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);