mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
ext/dv/gstdvdemux.c: Handle events in push mode better, can now do non-flushing seeks in push mode as well.
Original commit message from CVS: * ext/dv/gstdvdemux.c: (gst_dvdemux_handle_sink_event), (gst_dvdemux_convert_segment), (gst_dvdemux_demux_frame): Handle events in push mode better, can now do non-flushing seeks in push mode as well.
This commit is contained in:
parent
1ec94df29d
commit
6b0cc54067
2 changed files with 48 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-03-09 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* ext/dv/gstdvdemux.c: (gst_dvdemux_handle_sink_event),
|
||||||
|
(gst_dvdemux_convert_segment), (gst_dvdemux_demux_frame):
|
||||||
|
Handle events in push mode better, can now do non-flushing
|
||||||
|
seeks in push mode as well.
|
||||||
|
|
||||||
2006-03-07 Wim Taymans <wim@fluendo.com>
|
2006-03-07 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/udp/gstdynudpsink.c: (gst_dynudpsink_class_init):
|
* gst/udp/gstdynudpsink.c: (gst_dynudpsink_class_init):
|
||||||
|
|
|
@ -726,10 +726,22 @@ gst_dvdemux_handle_sink_event (GstPad * pad, GstEvent * event)
|
||||||
gst_segment_set_newsegment (&dvdemux->byte_segment, update,
|
gst_segment_set_newsegment (&dvdemux->byte_segment, update,
|
||||||
rate, format, start, stop, time);
|
rate, format, start, stop, time);
|
||||||
|
|
||||||
/* and queue a SEGMENT before sending the next set of buffers, we
|
/* the update can always be sent */
|
||||||
* cannot convert to time yet as we might not know the size of the
|
if (update) {
|
||||||
* frames, etc.. */
|
GstEvent *update;
|
||||||
dvdemux->need_segment = TRUE;
|
|
||||||
|
update = gst_event_new_new_segment (TRUE,
|
||||||
|
dvdemux->time_segment.rate, dvdemux->time_segment.format,
|
||||||
|
dvdemux->time_segment.start, dvdemux->time_segment.last_stop,
|
||||||
|
dvdemux->time_segment.time);
|
||||||
|
|
||||||
|
gst_dvdemux_push_event (dvdemux, update);
|
||||||
|
} else {
|
||||||
|
/* and queue a SEGMENT before sending the next set of buffers, we
|
||||||
|
* cannot convert to time yet as we might not know the size of the
|
||||||
|
* frames, etc.. */
|
||||||
|
dvdemux->need_segment = TRUE;
|
||||||
|
}
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
break;
|
break;
|
||||||
case GST_FORMAT_TIME:
|
case GST_FORMAT_TIME:
|
||||||
|
@ -849,6 +861,19 @@ done:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static gboolean
|
||||||
|
gst_dvdemux_convert_segment (GstDVDemux * dvdemux, GstSegment * src,
|
||||||
|
GstSegment * dest)
|
||||||
|
{
|
||||||
|
dest->rate = src->rate;
|
||||||
|
dest->abs_rate = src->abs_rate;
|
||||||
|
dest->flags = src->flags;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* handle seek in push base mode.
|
/* handle seek in push base mode.
|
||||||
*
|
*
|
||||||
* Convert the time seek to a bytes seek and send it
|
* Convert the time seek to a bytes seek and send it
|
||||||
|
@ -856,6 +881,8 @@ done:
|
||||||
*
|
*
|
||||||
* FIXME, upstream might be able to perform time based
|
* FIXME, upstream might be able to perform time based
|
||||||
* seek too.
|
* seek too.
|
||||||
|
*
|
||||||
|
* Does not take ownership of the event.
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad,
|
gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad,
|
||||||
|
@ -941,6 +968,8 @@ done:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle seek in pull base mode.
|
/* handle seek in pull base mode.
|
||||||
|
*
|
||||||
|
* Does not take ownership of the event.
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvdemux_handle_pull_seek (GstDVDemux * demux, GstPad * pad,
|
gst_dvdemux_handle_pull_seek (GstDVDemux * demux, GstPad * pad,
|
||||||
|
@ -1277,6 +1306,10 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, GstBuffer * buffer)
|
||||||
&dvdemux->time_segment.start, &dvdemux->time_segment.stop)))
|
&dvdemux->time_segment.start, &dvdemux->time_segment.stop)))
|
||||||
goto segment_error;
|
goto segment_error;
|
||||||
|
|
||||||
|
dvdemux->time_segment.rate = dvdemux->byte_segment.rate;
|
||||||
|
dvdemux->time_segment.abs_rate = dvdemux->byte_segment.abs_rate;
|
||||||
|
dvdemux->time_segment.last_stop = dvdemux->time_segment.start;
|
||||||
|
|
||||||
/* calculate current frame number */
|
/* calculate current frame number */
|
||||||
format = GST_FORMAT_DEFAULT;
|
format = GST_FORMAT_DEFAULT;
|
||||||
if (!(res = gst_dvdemux_src_convert (dvdemux, dvdemux->videosrcpad,
|
if (!(res = gst_dvdemux_src_convert (dvdemux, dvdemux->videosrcpad,
|
||||||
|
@ -1290,9 +1323,9 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, GstBuffer * buffer)
|
||||||
GST_TIME_ARGS (dvdemux->time_segment.stop),
|
GST_TIME_ARGS (dvdemux->time_segment.stop),
|
||||||
GST_TIME_ARGS (dvdemux->time_segment.start));
|
GST_TIME_ARGS (dvdemux->time_segment.start));
|
||||||
|
|
||||||
event = gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
|
event = gst_event_new_new_segment (FALSE, dvdemux->byte_segment.rate,
|
||||||
dvdemux->time_segment.start, dvdemux->time_segment.stop,
|
GST_FORMAT_TIME, dvdemux->time_segment.start,
|
||||||
dvdemux->time_segment.start);
|
dvdemux->time_segment.stop, dvdemux->time_segment.start);
|
||||||
gst_dvdemux_push_event (dvdemux, event);
|
gst_dvdemux_push_event (dvdemux, event);
|
||||||
|
|
||||||
dvdemux->need_segment = FALSE;
|
dvdemux->need_segment = FALSE;
|
||||||
|
@ -1328,7 +1361,7 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = GST_FLOW_OK;
|
ret = GST_FLOW_OK;
|
||||||
dvdemux->time_segment.last_stop = next_ts;
|
gst_segment_set_last_stop (&dvdemux->time_segment, GST_FORMAT_TIME, next_ts);
|
||||||
dvdemux->frame_offset++;
|
dvdemux->frame_offset++;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in a new issue