gst_message_parse_segment_start
gst_message_new_segment_done
gst_message_parse_segment_done
-gst_message_new_duration
-gst_message_parse_duration
+gst_message_new_duration_changed
gst_message_new_latency
gst_message_new_async_start
gst_message_new_async_done
The GstStructure is removed from the public API, use the getters to get
a handle to a GstStructure.
+ GST_MESSAGE_DURATION -> GST_MESSAGE_DURATION_CHANGED
+
+ gst_message_parse_duration() was removed (not needed any longer, do
+ a duration query to query the updated duration)
+
* GstCaps
Is now a boxed type derived from GstMiniObject.
create request pads from elements.
* some elements that used to have a single dynamic source pad have a
- static source pad now. Example: wavparse, id3demux, apedemux. (This
- does not affect applications using decodebin or playbin)
+ static source pad now. Example: wavparse, id3demux, iceydemux, apedemux.
+ (This does not affect applications using decodebin or playbin).
* the name of the GstXOverlay "prepare-xwindow-id" message has changed
to "prepare-window-handle" (and GstXOverlay has been renamed to
* a SEGMENT_START have posted a SEGMENT_DONE.</para></listitem>
* </varlistentry>
* <varlistentry>
- * <term>GST_MESSAGE_DURATION</term>
+ * <term>GST_MESSAGE_DURATION_CHANGED</term>
* <listitem><para> Is posted by an element that detected a change
* in the stream duration. The default bin behaviour is to clear any
* cached duration values so that the next duration query will perform
* with the segment_done message. If there are no more segment_start
* messages, post segment_done message upwards.
*
- * GST_MESSAGE_DURATION: remove all previously cached duration messages.
+ * GST_MESSAGE_DURATION_CHANGED: clear any cached durations.
* Whenever someone performs a duration query on the bin, we store the
* result so we can answer it quicker the next time. Any element that
* changes its duration marks our cached values invalid.
}
break;
}
- case GST_MESSAGE_DURATION:
+ case GST_MESSAGE_DURATION_CHANGED:
{
- /* remove all cached duration messages, next time somebody asks
+ /* FIXME: remove all cached durations, next time somebody asks
* for duration, we will recalculate. */
+#if 0
GST_OBJECT_LOCK (bin);
bin_remove_messages (bin, NULL, GST_MESSAGE_DURATION);
GST_OBJECT_UNLOCK (bin);
+#endif
goto forward;
}
case GST_MESSAGE_CLOCK_LOST:
GST_DEBUG_OBJECT (bin, "max duration %" G_GINT64_FORMAT, fold->max);
+ /* FIXME: re-implement duration caching */
+#if 0
/* and cache now */
GST_OBJECT_LOCK (bin);
bin->messages = g_list_prepend (bin->messages,
gst_message_new_duration (GST_OBJECT_CAST (bin), format, fold->max));
GST_OBJECT_UNLOCK (bin);
+#endif
}
static gboolean
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:
{
+ /* FIXME: implement duration caching in GstBin again */
+#if 0
GList *cached;
GstFormat qformat;
}
}
GST_OBJECT_UNLOCK (bin);
+#else
+ GST_FIXME ("implement duration caching in GstBin again");
+#endif
/* no cached value found, iterate and collect durations */
fold_func = (GstIteratorFoldFunction) bin_query_duration_fold;
fold_init = bin_query_min_max_init;
done:
gst_iterator_free (iter);
-exit:
GST_DEBUG_OBJECT (bin, "query %p result %d", query, res);
return res;
#ifndef GST_DISABLE_DEPRECATED
+#define GST_MESSAGE_DURATION GST_MESSAGE_DURATION_CHANGED
+#define gst_message_new_duration_changed(src,fmt,dur) \
+ gst_message_new_duration_changed(src)
+#define gst_message_parse_duration(msg,fmt,dur) \
+G_STMT_START { \
+ GstFormat *p_fmt = fmt; \
+ gint64 *p_dur = dur; \
+ if (p_fmt) \
+ *p_fmt = GST_FORMAT_TIME; \
+ if (p_dur) \
+ *p_dur = GST_CLOCK_TIME_NONE; \
+} G_STMT_END
+
#endif /* not GST_DISABLE_DEPRECATED */
G_END_DECLS
{GST_MESSAGE_ELEMENT, "element", 0},
{GST_MESSAGE_SEGMENT_START, "segment-start", 0},
{GST_MESSAGE_SEGMENT_DONE, "segment-done", 0},
- {GST_MESSAGE_DURATION, "duration", 0},
+ {GST_MESSAGE_DURATION_CHANGED, "duration-changed", 0},
{GST_MESSAGE_LATENCY, "latency", 0},
{GST_MESSAGE_ASYNC_START, "async-start", 0},
{GST_MESSAGE_ASYNC_DONE, "async-done", 0},
}
/**
- * gst_message_new_duration:
+ * gst_message_new_duration_changed:
* @src: (transfer none): The object originating the message.
- * @format: The format of the duration
- * @duration: The new duration
*
- * Create a new duration message. This message is posted by elements that
- * know the duration of a stream in a specific format. This message
+ * Create a new duration changed message. This message is posted by elements
+ * that know the duration of a stream when the duration changes. This message
* is received by bins and is used to calculate the total duration of a
* pipeline. Elements may post a duration message with a duration of
* GST_CLOCK_TIME_NONE to indicate that the duration has changed and the
* cached duration should be discarded. The new duration can then be
* retrieved via a query.
*
- * Returns: (transfer full): The new duration message.
+ * Returns: (transfer full): The new duration-changed message.
*
* MT safe.
*/
GstMessage *
-gst_message_new_duration (GstObject * src, GstFormat format, gint64 duration)
+gst_message_new_duration_changed (GstObject * src)
{
GstMessage *message;
- GstStructure *structure;
- structure = gst_structure_new_id (GST_QUARK (MESSAGE_DURATION),
- GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
- GST_QUARK (DURATION), G_TYPE_INT64, duration, NULL);
- message = gst_message_new_custom (GST_MESSAGE_DURATION, src, structure);
+ message = gst_message_new_custom (GST_MESSAGE_DURATION_CHANGED, src,
+ gst_structure_new_id_empty (GST_QUARK (MESSAGE_DURATION_CHANGED)));
return message;
}
}
/**
- * gst_message_parse_duration:
- * @message: A valid #GstMessage of type GST_MESSAGE_DURATION.
- * @format: (out): Result location for the format, or NULL
- * @duration: (out): Result location for the duration, or NULL
- *
- * Extracts the duration and format from the duration message. The duration
- * might be GST_CLOCK_TIME_NONE, which indicates that the duration has
- * changed. Applications should always use a query to retrieve the duration
- * of a pipeline.
- *
- * MT safe.
- */
-void
-gst_message_parse_duration (GstMessage * message, GstFormat * format,
- gint64 * duration)
-{
- GstStructure *structure;
-
- g_return_if_fail (GST_IS_MESSAGE (message));
- g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_DURATION);
-
- structure = GST_MESSAGE_STRUCTURE (message);
- if (format)
- *format = (GstFormat)
- g_value_get_enum (gst_structure_id_get_value (structure,
- GST_QUARK (FORMAT)));
- if (duration)
- *duration =
- g_value_get_int64 (gst_structure_id_get_value (structure,
- GST_QUARK (DURATION)));
-}
-
-/**
* gst_message_parse_async_done:
* @message: A valid #GstMessage of type GST_MESSAGE_ASYNC_DONE.
* @running_time: (out): Result location for the running_time or NULL
* @GST_MESSAGE_SEGMENT_DONE: pipeline completed playback of a segment. This
* message is forwarded to the application after all elements that posted
* @GST_MESSAGE_SEGMENT_START posted a GST_MESSAGE_SEGMENT_DONE message.
- * @GST_MESSAGE_DURATION: The duration of a pipeline changed. The application
- * can get the new duration with a duration query.
+ * @GST_MESSAGE_DURATION_CHANGED: The duration of a pipeline changed. The
+ * application can get the new duration with a duration query.
* @GST_MESSAGE_ASYNC_START: Posted by elements when they start an ASYNC
* #GstStateChange. This message is not forwarded to the application but is used
* internally.
GST_MESSAGE_ELEMENT = (1 << 15),
GST_MESSAGE_SEGMENT_START = (1 << 16),
GST_MESSAGE_SEGMENT_DONE = (1 << 17),
- GST_MESSAGE_DURATION = (1 << 18),
+ GST_MESSAGE_DURATION_CHANGED = (1 << 18),
GST_MESSAGE_LATENCY = (1 << 19),
GST_MESSAGE_ASYNC_START = (1 << 20),
GST_MESSAGE_ASYNC_DONE = (1 << 21),
void gst_message_parse_segment_done (GstMessage *message, GstFormat *format,
gint64 *position);
-/* DURATION */
-GstMessage * gst_message_new_duration (GstObject * src, GstFormat format, gint64 duration) G_GNUC_MALLOC;
-void gst_message_parse_duration (GstMessage *message, GstFormat *format,
- gint64 *duration);
+/* DURATION_CHANGED */
+GstMessage * gst_message_new_duration_changed (GstObject * src) G_GNUC_MALLOC;
/* LATENCY */
GstMessage * gst_message_new_latency (GstObject * src) G_GNUC_MALLOC;
"GstMessageError", "GstMessageWarning", "GstMessageInfo",
"GstMessageBuffering", "GstMessageStateChanged", "GstMessageClockProvide",
"GstMessageClockLost", "GstMessageNewClock", "GstMessageStructureChange",
- "GstMessageSegmentStart", "GstMessageSegmentDone", "GstMessageDuration",
+ "GstMessageSegmentStart", "GstMessageSegmentDone",
+ "GstMessageDurationChanged",
"GstMessageAsyncDone", "GstMessageRequestState", "GstMessageStreamStatus",
"GstQueryPosition", "GstQueryDuration", "GstQueryLatency", "GstQueryConvert",
"GstQuerySegment", "GstQuerySeeking", "GstQueryFormats", "GstQueryBuffering",
GST_QUARK_MESSAGE_STRUCTURE_CHANGE = 67,
GST_QUARK_MESSAGE_SEGMENT_START = 68,
GST_QUARK_MESSAGE_SEGMENT_DONE = 69,
- GST_QUARK_MESSAGE_DURATION = 70,
+ GST_QUARK_MESSAGE_DURATION_CHANGED = 70,
GST_QUARK_MESSAGE_ASYNC_DONE = 71,
GST_QUARK_MESSAGE_REQUEST_STATE = 72,
GST_QUARK_MESSAGE_STREAM_STATUS = 73,
gst_message_new_clock_lost
gst_message_new_clock_provide
gst_message_new_custom
- gst_message_new_duration
+ gst_message_new_duration_changed
gst_message_new_element
gst_message_new_eos
gst_message_new_error
gst_message_parse_buffering_stats
gst_message_parse_clock_lost
gst_message_parse_clock_provide
- gst_message_parse_duration
gst_message_parse_error
gst_message_parse_info
gst_message_parse_new_clock