2005-10-11 Wim Taymans <wim@fluendo.com>
* gst/gstbin.c: (gst_bin_init), (gst_bin_provide_clock_func),
+ (is_eos), (gst_bin_add_func), (gst_bin_remove_func),
+ (gst_bin_recalc_state), (gst_bin_change_state_func),
+ (gst_bin_dispose), (bin_bus_handler):
+ * gst/gstbin.h:
+ Prepare to make current EOS message queue more generic.
+ Fix some typos.
+
+ * gst/gstevent.c: (gst_event_new_newsegment),
+ (gst_event_parse_newsegment):
+ * gst/gstevent.h:
+ Rename base to stream_time.
+
+ * gst/gstmessage.h:
+ Fix typo in docs.
+
+2005-10-11 Wim Taymans <wim@fluendo.com>
+
+ * gst/gstbin.c: (gst_bin_init), (gst_bin_provide_clock_func),
(gst_bin_add_func), (gst_bin_remove_func), (gst_bin_recalc_state),
(gst_bin_change_state_func), (bin_bus_handler):
* gst/gstbin.h:
bin->numchildren = 0;
bin->children = NULL;
bin->children_cookie = 0;
- bin->eosed = NULL;
+ bin->messages = NULL;
bin->polling = FALSE;
bin->state_dirty = FALSE;
bin->provided_clock = NULL;
element = GST_ELEMENT_CAST (walk->data);
if (bin_element_is_sink (element, bin) == 0) {
- if (!g_list_find (bin->eosed, element)) {
+ if (!g_list_find (bin->messages, element)) {
GST_DEBUG ("element did not post EOS yet");
result = FALSE;
break;
bin = GST_BIN_CAST (element);
- /* Clear eosed element list on next PAUSED */
+ /* Clear message list on next PAUSED */
if (next == GST_STATE_PAUSED) {
GST_LOCK (bin);
GST_DEBUG_OBJECT (element, "clearing EOS elements");
- g_list_free (bin->eosed);
- bin->eosed = NULL;
+ g_list_free (bin->messages);
+ bin->messages = NULL;
GST_UNLOCK (bin);
}
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, "dispose");
- g_list_free (bin->eosed);
- bin->eosed = NULL;
+ g_list_free (bin->messages);
+ bin->messages = NULL;
gst_object_unref (bin->child_bus);
bin->child_bus = NULL;
GstObject *src = GST_MESSAGE_SRC (message);
if (src) {
- gchar *name;
gboolean eos;
- name = gst_object_get_name (src);
- GST_DEBUG_OBJECT (bin, "got EOS message from %s", name);
- g_free (name);
+ /* silly if we're not debugging.. */
+ GST_LOCK (src);
+ GST_DEBUG_OBJECT (bin, "got EOS message from %s",
+ GST_ELEMENT_NAME (src));
+ GST_UNLOCK (src);
/* collect all eos messages from the children */
GST_LOCK (bin);
- bin->eosed = g_list_prepend (bin->eosed, src);
+ bin->messages = g_list_prepend (bin->messages, src);
eos = is_eos (bin);
GST_UNLOCK (bin);
* @format: The format of the segment values
* @start_value: the start value of the segment
* @stop_value: the stop value of the segment
- * @base: base value for buffer timestamps.
+ * @stream_time: stream time for buffer timestamps.
*
* Allocate a new newsegment event with the given format/values tripplets.
*
* used intelligently by plugins to use more efficient methods of skipping
* unneeded packets.
*
- * The base time of the segment is also used to convert the buffer timestamps
+ * The stream time of the segment is also used to convert the buffer timestamps
* into the stream time again.
*
* The @start_value cannot be -1, the @stop_value can be -1. If there
*
* After a newsegment event, the buffer stream time is calculated with:
*
- * TIMESTAMP(buf) - start_time + base
+ * stream_time + (TIMESTAMP(buf) - start_value) * ABS (rate)
*
* Returns: A new newsegment event.
*/
GstEvent *
gst_event_new_newsegment (gdouble rate, GstFormat format,
- gint64 start_value, gint64 stop_value, gint64 base)
+ gint64 start_value, gint64 stop_value, gint64 stream_time)
{
if (format == GST_FORMAT_TIME) {
GST_CAT_INFO (GST_CAT_EVENT,
"creating newsegment rate %lf, format GST_FORMAT_TIME, "
"start %" GST_TIME_FORMAT ", stop %" GST_TIME_FORMAT
- ", base %" GST_TIME_FORMAT,
+ ", stream_time %" GST_TIME_FORMAT,
rate, GST_TIME_ARGS (start_value),
- GST_TIME_ARGS (stop_value), GST_TIME_ARGS (base));
+ GST_TIME_ARGS (stop_value), GST_TIME_ARGS (stream_time));
} else {
GST_CAT_INFO (GST_CAT_EVENT,
"creating newsegment rate %lf, format %d, "
- "start %lld, stop %lld, base %lld",
- rate, format, start_value, stop_value, base);
+ "start %lld, stop %lld, stream_time %lld",
+ rate, format, start_value, stop_value, stream_time);
}
if (start_value == -1)
g_return_val_if_fail (start_value != -1, NULL);
"format", GST_TYPE_FORMAT, format,
"start_val", G_TYPE_INT64, start_value,
"stop_val", G_TYPE_INT64, stop_value,
- "base", G_TYPE_INT64, base, NULL));
+ "stream_time", G_TYPE_INT64, stream_time, NULL));
}
/**
* @format: A pointer to the format of the newsegment values
* @start_value: A pointer to store the start value in
* @stop_value: A pointer to store the stop value in
- * @base: A pointer to store the base time in
+ * @stream_time: A pointer to store the stream time in
*
* Get the start, stop and format in the newsegment event.
*/
void
gst_event_parse_newsegment (GstEvent * event, gdouble * rate,
GstFormat * format, gint64 * start_value, gint64 * stop_value,
- gint64 * base)
+ gint64 * stream_time)
{
const GstStructure *structure;
if (stop_value)
*stop_value =
g_value_get_int64 (gst_structure_get_value (structure, "stop_val"));
- if (base)
- *base = g_value_get_int64 (gst_structure_get_value (structure, "base"));
+ if (stream_time)
+ *stream_time =
+ g_value_get_int64 (gst_structure_get_value (structure, "stream_time"));
}
/**