gst_event_parse_toc_select
gst_event_new_segment_done
+gst_event_parse_segment_done
<SUBSECTION Standard>
GstEventClass
GST_EVENT
/**
* gst_event_new_segment_done:
-
+ * @format: The format of the position being done
+ * @position: The position of the segment being done
+ *
* Create a new segment-done event. This event is sent by elements that
* finish playback of a segment as a result of a segment seek.
*
* Since: 0.11.0
*/
GstEvent *
-gst_event_new_segment_done (void)
+gst_event_new_segment_done (GstFormat format, gint64 position)
{
GstEvent *event;
+ GstStructure *structure;
GST_CAT_INFO (GST_CAT_EVENT, "creating segment-done event");
- event = gst_event_new_custom (GST_EVENT_SEGMENT_DONE, NULL);
+ structure = gst_structure_new_id (GST_QUARK (EVENT_SEGMENT_DONE),
+ GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
+ GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
+
+ event = gst_event_new_custom (GST_EVENT_SEGMENT_DONE, structure);
return event;
}
+
+/**
+ * gst_event_parse_segment_done:
+ * @event: A valid #GstEvent of type GST_EVENT_SEGMENT_DONE.
+ * @format: (out): Result location for the format, or NULL
+ * @position: (out): Result location for the position, or NULL
+ *
+ * Extracts the position and format from the segment done message.
+ *
+ */
+void
+gst_event_parse_segment_done (GstEvent * event, GstFormat * format,
+ gint64 * position)
+{
+ const GstStructure *structure;
+ const GValue *val;
+
+ g_return_if_fail (event != NULL);
+ g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT_DONE);
+
+ structure = gst_event_get_structure (event);
+
+ val = gst_structure_id_get_value (structure, GST_QUARK (FORMAT));
+ if (format != NULL)
+ *format = g_value_get_enum (val);
+
+ val = gst_structure_id_get_value (structure, GST_QUARK (POSITION));
+ if (position != NULL)
+ *position = g_value_get_int64 (val);
+}
void gst_event_parse_toc_select (GstEvent *event, gchar **uid);
/* segment-done event */
-GstEvent* gst_event_new_segment_done (void) G_GNUC_MALLOC;
+GstEvent* gst_event_new_segment_done (GstFormat format, gint64 position) G_GNUC_MALLOC;
+void gst_event_parse_segment_done (GstEvent *event, GstFormat *format, gint64 *position);
G_END_DECLS
GST_ELEMENT_METADATA_AUTHOR, "toc", "toc-entry", "updated", "extend-uid",
"uid", "tags", "sub-entries", "info", "GstMessageTag", "GstEventTag",
"GstMessageResetTime",
- "GstMessageToc", "GstEventToc"
+ "GstMessageToc", "GstEventToc", "GstEventSegmentDone"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
GST_QUARK_MESSAGE_RESET_TIME = 155,
GST_QUARK_MESSAGE_TOC = 156,
GST_QUARK_EVENT_TOC = 157,
- GST_QUARK_MAX = 158
+ GST_QUARK_EVENT_SEGMENT_DONE = 158,
+ GST_QUARK_MAX = 159
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
(GST_ELEMENT_CAST (parse),
gst_message_new_segment_done (GST_OBJECT_CAST (parse),
GST_FORMAT_TIME, stop));
- gst_pad_push_event (parse->srcpad, gst_event_new_segment_done ());
+ gst_pad_push_event (parse->srcpad,
+ gst_event_new_segment_done (GST_FORMAT_TIME, stop));
} else {
/* If we STILL have zero frames processed, fire an error */
if (parse->priv->framecount == 0) {
gst_element_post_message (GST_ELEMENT_CAST (basesink),
gst_message_new_segment_done (GST_OBJECT_CAST (basesink),
basesink->segment.format, basesink->segment.position));
- gst_base_sink_event (pad, parent, gst_event_new_segment_done ());
+ gst_base_sink_event (pad, parent,
+ gst_event_new_segment_done (basesink->segment.format,
+ basesink->segment.position));
} else {
gst_base_sink_event (pad, parent, gst_event_new_eos ());
}
format, position);
gst_message_set_seqnum (message, src->priv->seqnum);
gst_element_post_message (GST_ELEMENT_CAST (src), message);
- event = gst_event_new_segment_done ();
+ event = gst_event_new_segment_done (format, position);
gst_event_set_seqnum (event, src->priv->seqnum);
gst_pad_push_event (pad, event);
} else {
gst_event_new_reconfigure
gst_event_new_seek
gst_event_new_segment
+ gst_event_new_segment_done
gst_event_new_sink_message
gst_event_new_step
gst_event_new_stream_config
gst_event_parse_qos
gst_event_parse_seek
gst_event_parse_segment
+ gst_event_parse_segment_done
gst_event_parse_sink_message
gst_event_parse_step
gst_event_parse_stream_config