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),
(gst_element_set_locked_state), (gst_element_get_state_func),
(gst_element_change_state):
Handle INFO messages from the GST_ELEMENT_INFO macro as well.
* @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.
*/
* 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 { \
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);
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;
}
}
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)
{
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);
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));
}
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");
}
/**
* 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.
#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;
* 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.
GstBin bin;
/*< public >*/ /* with LOCK */
- GstClock *fixed_clock; /* fixed clock if any */
- GstClockTime stream_time;
+ GstClock *fixed_clock;
+
+ GstClockTime stream_time;
GstClockTime delay;
/*< private >*/
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);