2008-11-18 Wim Taymans <wim.taymans@collabora.co.uk>
+ * docs/gst/gstreamer-sections.txt:
+ * gst/gstbin.c: (gst_bin_recalculate_latency),
+ (gst_bin_change_state_func):
+ * gst/gstbin.h:
+ Add method to recalculate and redistribute the latency on a bin.
+ API: gst_bin_recalculate_latency().
+
+2008-11-18 Wim Taymans <wim.taymans@collabora.co.uk>
+
* gst/gstbuffer.h:
Document the free_func.
}
}
-/* do latency correction. We do a latency query on the bin, and then send a
- * LATENCY event on the elements fo configure them */
-static gboolean
-do_bin_latency (GstElement * element)
+/**
+ * gst_bin_recalculate_latency:
+ * @bin: a #GstBin
+ *
+ * Query @bin for the current latency using and reconfigures this latency to all the
+ * elements with a LATENCY event.
+ *
+ * This method is typically called on the pipeline when a #GST_MESSAGE_LATENCY
+ * is posted on the bus.
+ *
+ * Returns: %TRUE if the latency could be queried and reconfigured.
+ *
+ * Since: 0.10.22.
+ */
+gboolean
+gst_bin_recalculate_latency (GstBin * bin)
{
GstQuery *query;
+ GstElement *element;
GstClockTime min_latency, max_latency;
gboolean res;
+ g_return_val_if_fail (GST_IS_BIN (bin), FALSE);
+
+ element = GST_ELEMENT_CAST (bin);
+
GST_DEBUG_OBJECT (element, "querying latency");
query = gst_query_new_latency ();
GST_OBJECT_UNLOCK (bin);
if (toplevel)
- do_bin_latency (element);
+ gst_bin_recalculate_latency (bin);
break;
}
case GST_STATE_PAUSED:
GstIterator* gst_bin_iterate_sources (GstBin *bin);
GstIterator* gst_bin_iterate_all_by_interface (GstBin *bin, GType iface);
+/* latency */
+gboolean gst_bin_recalculate_latency (GstBin * bin);
+
+
G_END_DECLS