Commit 49d2ad56 authored by Sebastian Dröge's avatar Sebastian Dröge

event: Implement segment-done event

parent 1e3d8a83
......@@ -1026,6 +1026,8 @@ gst_event_parse_toc
gst_event_new_toc_select
gst_event_parse_toc_select
gst_event_new_segment_done
<SUBSECTION Standard>
GstEventClass
GST_EVENT
......
......@@ -1736,3 +1736,25 @@ gst_event_parse_toc_select (GstEvent * event, gchar ** uid)
*uid = g_strdup (g_value_get_string (val));
}
/**
* gst_event_new_segment_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.
*
* Returns: (transfer full): a new #GstEvent
*
* Since: 0.11.0
*/
GstEvent *
gst_event_new_segment_done (void)
{
GstEvent *event;
GST_CAT_INFO (GST_CAT_EVENT, "creating segment-done event");
event = gst_event_new_custom (GST_EVENT_SEGMENT_DONE, NULL);
return event;
}
......@@ -98,7 +98,7 @@ typedef enum {
* Since: 0.10.26
* @GST_EVENT_EOS: End-Of-Stream. No more data is to be expected to follow
* without a SEGMENT event.
* @GST_EVENT_SEGMENT_DONE: (unimplemented) Marks the end of a segment playback.
* @GST_EVENT_SEGMENT_DONE: Marks the end of a segment playback.
* @GST_EVENT_GAP: Marks a gap in the datastream.
* @GST_EVENT_TOC: An event which indicates that a new table of contents (TOC)
* was found or updated. Since: 0.10.37
......@@ -576,6 +576,9 @@ GstEvent* gst_event_new_reconfigure (void) G_GNUC_MALLOC;
GstEvent* gst_event_new_toc_select (const gchar *uid) G_GNUC_MALLOC;
void gst_event_parse_toc_select (GstEvent *event, gchar **uid);
/* segment-done event */
GstEvent* gst_event_new_segment_done (void) G_GNUC_MALLOC;
G_END_DECLS
#endif /* __GST_EVENT_H__ */
......@@ -2923,6 +2923,7 @@ pause:
(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 ());
} else {
/* If we STILL have zero frames processed, fire an error */
if (parse->priv->framecount == 0) {
......
......@@ -3751,6 +3751,7 @@ paused:
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 ());
} else {
gst_base_sink_event (pad, parent, gst_event_new_eos ());
}
......
......@@ -2718,6 +2718,9 @@ pause:
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 ();
gst_event_set_seqnum (event, src->priv->seqnum);
gst_pad_push_event (pad, event);
} else {
event = gst_event_new_eos ();
gst_event_set_seqnum (event, src->priv->seqnum);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment