mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
gst: Implement segment-done event
This commit is contained in:
parent
2e90ff9bb9
commit
aeafc3a093
9 changed files with 31 additions and 2 deletions
|
@ -1741,6 +1741,9 @@ pause:
|
||||||
gst_element_post_message (GST_ELEMENT (dvdemux),
|
gst_element_post_message (GST_ELEMENT (dvdemux),
|
||||||
gst_message_new_segment_done (GST_OBJECT_CAST (dvdemux),
|
gst_message_new_segment_done (GST_OBJECT_CAST (dvdemux),
|
||||||
dvdemux->time_segment.format, dvdemux->time_segment.position));
|
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 {
|
} else {
|
||||||
gst_dvdemux_push_event (dvdemux, gst_event_new_eos ());
|
gst_dvdemux_push_event (dvdemux, gst_event_new_eos ());
|
||||||
}
|
}
|
||||||
|
|
|
@ -5212,6 +5212,8 @@ pause:{
|
||||||
(GST_ELEMENT_CAST (avi),
|
(GST_ELEMENT_CAST (avi),
|
||||||
gst_message_new_segment_done (GST_OBJECT_CAST (avi),
|
gst_message_new_segment_done (GST_OBJECT_CAST (avi),
|
||||||
GST_FORMAT_TIME, stop));
|
GST_FORMAT_TIME, stop));
|
||||||
|
gst_avi_demux_push_event (avi,
|
||||||
|
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
|
||||||
} else {
|
} else {
|
||||||
push_eos = TRUE;
|
push_eos = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2458,12 +2458,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_flv_demux_push_src_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->segment.start));
|
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 {
|
} else {
|
||||||
/* normal playback, send EOS to all linked pads */
|
/* normal playback, send EOS to all linked pads */
|
||||||
|
|
|
@ -794,15 +794,20 @@ gst_image_freeze_src_loop (GstPad * pad)
|
||||||
if (eos) {
|
if (eos) {
|
||||||
if ((self->segment.flags & GST_SEEK_FLAG_SEGMENT)) {
|
if ((self->segment.flags & GST_SEEK_FLAG_SEGMENT)) {
|
||||||
GstMessage *m;
|
GstMessage *m;
|
||||||
|
GstEvent *e;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "Sending segment done at end of segment");
|
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),
|
m = gst_message_new_segment_done (GST_OBJECT_CAST (self),
|
||||||
GST_FORMAT_TIME, self->segment.stop);
|
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),
|
m = gst_message_new_segment_done (GST_OBJECT_CAST (self),
|
||||||
GST_FORMAT_TIME, self->segment.start);
|
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_element_post_message (GST_ELEMENT_CAST (self), m);
|
||||||
|
gst_pad_push_event (self->srcpad, e);
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (pad, "Sending EOS at end of segment");
|
GST_DEBUG_OBJECT (pad, "Sending EOS at end of segment");
|
||||||
gst_pad_push_event (self->srcpad, gst_event_new_eos ());
|
gst_pad_push_event (self->srcpad, gst_event_new_eos ());
|
||||||
|
|
|
@ -3887,12 +3887,17 @@ pause:
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
|
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
|
||||||
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
|
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
|
||||||
GST_FORMAT_TIME, stop));
|
GST_FORMAT_TIME, stop));
|
||||||
|
gst_qtdemux_push_event (qtdemux,
|
||||||
|
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
|
||||||
} else {
|
} else {
|
||||||
/* For Reverse Playback */
|
/* For Reverse Playback */
|
||||||
GST_LOG_OBJECT (qtdemux, "Sending segment done, at start of segment");
|
GST_LOG_OBJECT (qtdemux, "Sending segment done, at start of segment");
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
|
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
|
||||||
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
|
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
|
||||||
GST_FORMAT_TIME, qtdemux->segment.start));
|
GST_FORMAT_TIME, qtdemux->segment.start));
|
||||||
|
gst_qtdemux_push_event (qtdemux,
|
||||||
|
gst_event_new_segment_done (GST_FORMAT_TIME,
|
||||||
|
qtdemux->segment.start));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_LOG_OBJECT (qtdemux, "Sending EOS at end of segment");
|
GST_LOG_OBJECT (qtdemux, "Sending EOS at end of segment");
|
||||||
|
|
|
@ -4583,6 +4583,8 @@ pause:
|
||||||
gst_element_post_message (GST_ELEMENT (demux),
|
gst_element_post_message (GST_ELEMENT (demux),
|
||||||
gst_message_new_segment_done (GST_OBJECT (demux), GST_FORMAT_TIME,
|
gst_message_new_segment_done (GST_OBJECT (demux), GST_FORMAT_TIME,
|
||||||
stop));
|
stop));
|
||||||
|
gst_matroska_demux_send_event (demux,
|
||||||
|
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
|
||||||
} else {
|
} else {
|
||||||
push_eos = TRUE;
|
push_eos = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2984,6 +2984,8 @@ pause:
|
||||||
gst_element_post_message (GST_ELEMENT (parse),
|
gst_element_post_message (GST_ELEMENT (parse),
|
||||||
gst_message_new_segment_done (GST_OBJECT (parse), GST_FORMAT_TIME,
|
gst_message_new_segment_done (GST_OBJECT (parse), GST_FORMAT_TIME,
|
||||||
stop));
|
stop));
|
||||||
|
gst_matroska_parse_send_event (parse,
|
||||||
|
gst_event_new_segment_done (GST_FORMAT_TIME, stop));
|
||||||
} else {
|
} else {
|
||||||
push_eos = TRUE;
|
push_eos = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4119,6 +4119,9 @@ pause:
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (src),
|
gst_element_post_message (GST_ELEMENT_CAST (src),
|
||||||
gst_message_new_segment_done (GST_OBJECT_CAST (src),
|
gst_message_new_segment_done (GST_OBJECT_CAST (src),
|
||||||
src->segment.format, src->segment.position));
|
src->segment.format, src->segment.position));
|
||||||
|
gst_rtspsrc_push_event (src,
|
||||||
|
gst_event_new_segment_done (src->segment.format,
|
||||||
|
src->segment.position));
|
||||||
} else {
|
} else {
|
||||||
gst_rtspsrc_push_event (src, gst_event_new_eos ());
|
gst_rtspsrc_push_event (src, gst_event_new_eos ());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2072,6 +2072,8 @@ pause:
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (wav),
|
gst_element_post_message (GST_ELEMENT_CAST (wav),
|
||||||
gst_message_new_segment_done (GST_OBJECT_CAST (wav),
|
gst_message_new_segment_done (GST_OBJECT_CAST (wav),
|
||||||
wav->segment.format, stop));
|
wav->segment.format, stop));
|
||||||
|
gst_pad_push_event (wav->srcpad,
|
||||||
|
gst_event_new_segment_done (wav->segment.format, stop));
|
||||||
} else {
|
} else {
|
||||||
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue