gst: Implement segment-done event

This commit is contained in:
Sebastian Dröge 2012-07-05 13:18:47 +02:00
parent a26e5bbf9b
commit 9c7d7498bb
5 changed files with 15 additions and 0 deletions

View file

@ -601,6 +601,8 @@ gst_musepackdec_loop (GstPad * sinkpad)
gst_element_post_message (GST_ELEMENT (musepackdec), gst_element_post_message (GST_ELEMENT (musepackdec),
gst_message_new_segment_done (GST_OBJECT (musepackdec), gst_message_new_segment_done (GST_OBJECT (musepackdec),
GST_FORMAT_TIME, stop_time)); GST_FORMAT_TIME, stop_time));
gst_pad_push_event (musepackdec->srcpad,
gst_event_new_segment_done (GST_FORMAT_TIME, stop_time));
goto pause_task; goto pause_task;
} }

View file

@ -1314,6 +1314,8 @@ pause:
gst_element_post_message (GST_ELEMENT_CAST (aiff), gst_element_post_message (GST_ELEMENT_CAST (aiff),
gst_message_new_segment_done (GST_OBJECT_CAST (aiff), gst_message_new_segment_done (GST_OBJECT_CAST (aiff),
aiff->segment.format, stop)); aiff->segment.format, stop));
gst_pad_push_event (aiff->srcpad,
gst_evnet_new_segment_done (aiff->segment.format, stop));
} else { } else {
gst_pad_push_event (aiff->srcpad, gst_event_new_eos ()); gst_pad_push_event (aiff->srcpad, gst_event_new_eos ());
} }

View file

@ -2838,12 +2838,17 @@ pause:
gst_element_post_message (GST_ELEMENT_CAST (demux), gst_element_post_message (GST_ELEMENT_CAST (demux),
gst_message_new_segment_done (GST_OBJECT_CAST (demux), gst_message_new_segment_done (GST_OBJECT_CAST (demux),
GST_FORMAT_TIME, stop)); GST_FORMAT_TIME, stop));
gst_flups_demux_send_event (demux,
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
} else { /* Reverse playback */ } else { /* Reverse playback */
GST_LOG_OBJECT (demux, "Sending segment done, at beginning of " GST_LOG_OBJECT (demux, "Sending segment done, at beginning of "
"segment"); "segment");
gst_element_post_message (GST_ELEMENT_CAST (demux), gst_element_post_message (GST_ELEMENT_CAST (demux),
gst_message_new_segment_done (GST_OBJECT_CAST (demux), gst_message_new_segment_done (GST_OBJECT_CAST (demux),
GST_FORMAT_TIME, demux->src_segment.start)); GST_FORMAT_TIME, demux->src_segment.start));
gst_flups_demux_send_event (demux,
gst_event_new_segment_done (GST_FORMAT_TIME,
demux->src_segment.start));
} }
} else { } else {
/* normal playback, send EOS to all linked pads */ /* normal playback, send EOS to all linked pads */

View file

@ -2773,6 +2773,7 @@ pause:
if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) { if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
gint64 stop; gint64 stop;
GstMessage *m; GstMessage *m;
GstEvent *e;
/* for segment playback we need to post when (in stream time) /* for segment playback we need to post when (in stream time)
* we stopped, this is either stop (when set) or the duration. */ * we stopped, this is either stop (when set) or the duration. */
@ -2784,6 +2785,9 @@ pause:
GST_FORMAT_TIME, stop); GST_FORMAT_TIME, stop);
gst_message_set_seqnum (m, demux->seqnum); gst_message_set_seqnum (m, demux->seqnum);
gst_element_post_message (GST_ELEMENT_CAST (demux), m); gst_element_post_message (GST_ELEMENT_CAST (demux), m);
e = gst_event_new_segment_done (GST_FORMAT_TIME, stop);
gst_event_set_seqnum (e, demux->seqnum);
gst_mxf_demux_push_src_event (demux, e);
} else { } else {
GstEvent *e; GstEvent *e;

View file

@ -436,6 +436,8 @@ pause:
gst_element_post_message (GST_ELEMENT_CAST (rp), gst_element_post_message (GST_ELEMENT_CAST (rp),
gst_message_new_segment_done (GST_OBJECT_CAST (rp), gst_message_new_segment_done (GST_OBJECT_CAST (rp),
rp->segment.format, stop)); rp->segment.format, stop));
gst_pad_push_event (rp->srcpad,
gst_event_new_segment_done (rp->segment.format, stop));
} else { } else {
GST_LOG_OBJECT (rp, "Sending EOS, at end of stream"); GST_LOG_OBJECT (rp, "Sending EOS, at end of stream");
gst_pad_push_event (rp->srcpad, gst_event_new_eos ()); gst_pad_push_event (rp->srcpad, gst_event_new_eos ());