gst: Implement segment-done event

This commit is contained in:
Sebastian Dröge 2012-07-05 13:13:09 +02:00
parent 2e90ff9bb9
commit aeafc3a093
9 changed files with 31 additions and 2 deletions

View file

@ -1741,6 +1741,9 @@ pause:
gst_element_post_message (GST_ELEMENT (dvdemux),
gst_message_new_segment_done (GST_OBJECT_CAST (dvdemux),
dvdemux->time_segment.format, dvdemux->time_segment.position));
gst_dvdemux_push_event (dvdemux,
gst_event_new_segment_done (dvdemux->time_segment.format,
dvdemux->time_segment.position));
} else {
gst_dvdemux_push_event (dvdemux, gst_event_new_eos ());
}

View file

@ -5212,6 +5212,8 @@ pause:{
(GST_ELEMENT_CAST (avi),
gst_message_new_segment_done (GST_OBJECT_CAST (avi),
GST_FORMAT_TIME, stop));
gst_avi_demux_push_event (avi,
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
} else {
push_eos = TRUE;
}

View file

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

View file

@ -794,15 +794,20 @@ gst_image_freeze_src_loop (GstPad * pad)
if (eos) {
if ((self->segment.flags & GST_SEEK_FLAG_SEGMENT)) {
GstMessage *m;
GstEvent *e;
GST_DEBUG_OBJECT (pad, "Sending segment done at end of segment");
if (self->segment.rate >= 0)
if (self->segment.rate >= 0) {
m = gst_message_new_segment_done (GST_OBJECT_CAST (self),
GST_FORMAT_TIME, self->segment.stop);
else
e = gst_event_new_segment_done (GST_FORMAT_TIME, self->segment.stop);
} else {
m = gst_message_new_segment_done (GST_OBJECT_CAST (self),
GST_FORMAT_TIME, self->segment.start);
e = gst_event_new_segment_done (GST_FORMAT_TIME, self->segment.start);
}
gst_element_post_message (GST_ELEMENT_CAST (self), m);
gst_pad_push_event (self->srcpad, e);
} else {
GST_DEBUG_OBJECT (pad, "Sending EOS at end of segment");
gst_pad_push_event (self->srcpad, gst_event_new_eos ());

View file

@ -3887,12 +3887,17 @@ pause:
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
GST_FORMAT_TIME, stop));
gst_qtdemux_push_event (qtdemux,
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
} else {
/* For Reverse Playback */
GST_LOG_OBJECT (qtdemux, "Sending segment done, at start of segment");
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
GST_FORMAT_TIME, qtdemux->segment.start));
gst_qtdemux_push_event (qtdemux,
gst_event_new_segment_done (GST_FORMAT_TIME,
qtdemux->segment.start));
}
} else {
GST_LOG_OBJECT (qtdemux, "Sending EOS at end of segment");

View file

@ -4583,6 +4583,8 @@ pause:
gst_element_post_message (GST_ELEMENT (demux),
gst_message_new_segment_done (GST_OBJECT (demux), GST_FORMAT_TIME,
stop));
gst_matroska_demux_send_event (demux,
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
} else {
push_eos = TRUE;
}

View file

@ -2984,6 +2984,8 @@ pause:
gst_element_post_message (GST_ELEMENT (parse),
gst_message_new_segment_done (GST_OBJECT (parse), GST_FORMAT_TIME,
stop));
gst_matroska_parse_send_event (parse,
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
} else {
push_eos = TRUE;
}

View file

@ -4119,6 +4119,9 @@ pause:
gst_element_post_message (GST_ELEMENT_CAST (src),
gst_message_new_segment_done (GST_OBJECT_CAST (src),
src->segment.format, src->segment.position));
gst_rtspsrc_push_event (src,
gst_event_new_segment_done (src->segment.format,
src->segment.position));
} else {
gst_rtspsrc_push_event (src, gst_event_new_eos ());
}

View file

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