From d7f15f542a2481b7c13ce3de459cf84f0f6b121f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 26 Feb 2013 15:32:25 +0100 Subject: [PATCH] use GST_MESSAGE_DURATION_CHANGED in docs and code --- docs/design/part-gstbin.txt | 11 ++++++----- docs/design/part-messages.txt | 2 +- gst/gstbin.c | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/design/part-gstbin.txt b/docs/design/part-gstbin.txt index bf486f86db..a262a9bdee 100644 --- a/docs/design/part-gstbin.txt +++ b/docs/design/part-gstbin.txt @@ -95,11 +95,12 @@ returned durations and will then cache the result so that any further query can use the cached version. The reason for caching the result is because the duration of a stream typically does not change that often. -A GST_MESSAGE_DURATION posted by an element will clear the cached duration value -so that the bin will query the sinks again. This message is typically posted by -elements that calculate the duration of the stream based on some average -bitrate, which might change while playing the stream. The DURATION message is -posted to the application, which can then fetch the updated DURATION. +A GST_MESSAGE_DURATION_CHANGED posted by an element will clear the cached +duration value so that the bin will query the sinks again. This message is +typically posted by elements that calculate the duration of the stream based +on some average bitrate, which might change while playing the stream. The +DURATION_CHANGED message is posted to the application, which can then fetch +the updated DURATION. Subclassing diff --git a/docs/design/part-messages.txt b/docs/design/part-messages.txt index 6e23d5b598..171cdabef7 100644 --- a/docs/design/part-messages.txt +++ b/docs/design/part-messages.txt @@ -110,7 +110,7 @@ GST_MESSAGE_SEGMENT_DONE: An element or bin completed playback of a segment. This message is only posted on the bus if a SEGMENT seek is performed on a pipeline. -GST_MESSAGE_DURATION: +GST_MESSAGE_DURATION_CHANGED: An element posts this message when it has detected or updated the stream duration. diff --git a/gst/gstbin.c b/gst/gstbin.c index b5b47dedb7..c28f2d72ba 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -3262,8 +3262,8 @@ bin_do_message_forward (GstBin * bin, GstMessage * message) * result so we can answer it quicker the next time. Any element that * changes its duration marks our cached values invalid. * This message is also posted upwards. This is currently disabled - * because too many elements don't post DURATION messages when the - * duration changes. + * because too many elements don't post DURATION_CHANGED messages when + * the duration changes. * * GST_MESSAGE_CLOCK_LOST: This message is posted by an element when it * can no longer provide a clock. The default bin behaviour is to @@ -3426,7 +3426,7 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message) * for duration, we will recalculate. */ #if 0 GST_OBJECT_LOCK (bin); - bin_remove_messages (bin, NULL, GST_MESSAGE_DURATION); + bin_remove_messages (bin, NULL, GST_MESSAGE_DURATION_CHANGED); GST_OBJECT_UNLOCK (bin); #endif goto forward; @@ -3857,7 +3857,7 @@ gst_bin_query (GstElement * element, GstQuery * query) for (cached = bin->messages; cached; cached = g_list_next (cached)) { GstMessage *message = (GstMessage *) cached->data; - if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_DURATION && + if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_DURATION_CHANGED && GST_MESSAGE_SRC (message) == GST_OBJECT_CAST (bin)) { GstFormat format; gint64 duration;