mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
use GST_MESSAGE_DURATION_CHANGED in docs and code
This commit is contained in:
parent
f37fc1d299
commit
d7f15f542a
3 changed files with 11 additions and 10 deletions
|
@ -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
|
use the cached version. The reason for caching the result is because the
|
||||||
duration of a stream typically does not change that often.
|
duration of a stream typically does not change that often.
|
||||||
|
|
||||||
A GST_MESSAGE_DURATION posted by an element will clear the cached duration value
|
A GST_MESSAGE_DURATION_CHANGED posted by an element will clear the cached
|
||||||
so that the bin will query the sinks again. This message is typically posted by
|
duration value so that the bin will query the sinks again. This message is
|
||||||
elements that calculate the duration of the stream based on some average
|
typically posted by elements that calculate the duration of the stream based
|
||||||
bitrate, which might change while playing the stream. The DURATION message is
|
on some average bitrate, which might change while playing the stream. The
|
||||||
posted to the application, which can then fetch the updated DURATION.
|
DURATION_CHANGED message is posted to the application, which can then fetch
|
||||||
|
the updated DURATION.
|
||||||
|
|
||||||
|
|
||||||
Subclassing
|
Subclassing
|
||||||
|
|
|
@ -110,7 +110,7 @@ GST_MESSAGE_SEGMENT_DONE:
|
||||||
An element or bin completed playback of a segment. This message is only posted
|
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.
|
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.
|
An element posts this message when it has detected or updated the stream duration.
|
||||||
|
|
||||||
|
|
|
@ -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
|
* result so we can answer it quicker the next time. Any element that
|
||||||
* changes its duration marks our cached values invalid.
|
* changes its duration marks our cached values invalid.
|
||||||
* This message is also posted upwards. This is currently disabled
|
* This message is also posted upwards. This is currently disabled
|
||||||
* because too many elements don't post DURATION messages when the
|
* because too many elements don't post DURATION_CHANGED messages when
|
||||||
* duration changes.
|
* the duration changes.
|
||||||
*
|
*
|
||||||
* GST_MESSAGE_CLOCK_LOST: This message is posted by an element when it
|
* 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
|
* 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. */
|
* for duration, we will recalculate. */
|
||||||
#if 0
|
#if 0
|
||||||
GST_OBJECT_LOCK (bin);
|
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);
|
GST_OBJECT_UNLOCK (bin);
|
||||||
#endif
|
#endif
|
||||||
goto forward;
|
goto forward;
|
||||||
|
@ -3857,7 +3857,7 @@ gst_bin_query (GstElement * element, GstQuery * query)
|
||||||
for (cached = bin->messages; cached; cached = g_list_next (cached)) {
|
for (cached = bin->messages; cached; cached = g_list_next (cached)) {
|
||||||
GstMessage *message = (GstMessage *) cached->data;
|
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)) {
|
GST_MESSAGE_SRC (message) == GST_OBJECT_CAST (bin)) {
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
gint64 duration;
|
gint64 duration;
|
||||||
|
|
Loading…
Reference in a new issue