Update for new seeking variable name

When seeking, the start value and type are now called start and start_type.
This commit is contained in:
Wim Taymans 2012-07-27 15:19:57 +02:00
parent 104ef4e7e0
commit f05b0e222f
9 changed files with 56 additions and 55 deletions

View file

@ -1550,8 +1550,8 @@ gst_element_send_event (GstElement * element, GstEvent * event)
* @rate: The new playback rate * @rate: The new playback rate
* @format: The format of the seek values * @format: The format of the seek values
* @flags: The optional seek flags. * @flags: The optional seek flags.
* @cur_type: The type and flags for the new current position * @start_type: The type and flags for the new start position
* @cur: The value of the new current position * @start: The value of the new start position
* @stop_type: The type and flags for the new stop position * @stop_type: The type and flags for the new stop position
* @stop: The value of the new stop position * @stop: The value of the new stop position
* *
@ -1566,7 +1566,7 @@ gst_element_send_event (GstElement * element, GstEvent * event)
*/ */
gboolean gboolean
gst_element_seek (GstElement * element, gdouble rate, GstFormat format, gst_element_seek (GstElement * element, gdouble rate, GstFormat format,
GstSeekFlags flags, GstSeekType cur_type, gint64 cur, GstSeekFlags flags, GstSeekType start_type, gint64 start,
GstSeekType stop_type, gint64 stop) GstSeekType stop_type, gint64 stop)
{ {
GstEvent *event; GstEvent *event;
@ -1575,7 +1575,8 @@ gst_element_seek (GstElement * element, gdouble rate, GstFormat format,
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE); g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
event = event =
gst_event_new_seek (rate, format, flags, cur_type, cur, stop_type, stop); gst_event_new_seek (rate, format, flags, start_type, start, stop_type,
stop);
result = gst_element_send_event (element, event); result = gst_element_send_event (element, event);
return result; return result;

View file

@ -752,7 +752,7 @@ GstIterator * gst_element_iterate_sink_pads (GstElement * element);
gboolean gst_element_send_event (GstElement *element, GstEvent *event); gboolean gst_element_send_event (GstElement *element, GstEvent *event);
gboolean gst_element_seek (GstElement *element, gdouble rate, gboolean gst_element_seek (GstElement *element, gdouble rate,
GstFormat format, GstSeekFlags flags, GstFormat format, GstSeekFlags flags,
GstSeekType cur_type, gint64 cur, GstSeekType start_type, gint64 start,
GstSeekType stop_type, gint64 stop); GstSeekType stop_type, gint64 stop);
gboolean gst_element_query (GstElement *element, GstQuery *query); gboolean gst_element_query (GstElement *element, GstQuery *query);

View file

@ -63,7 +63,7 @@
* For elements that perform seeks, the current segment should be updated with the * For elements that perform seeks, the current segment should be updated with the
* gst_segment_do_seek() and the values from the seek event. This method will update * gst_segment_do_seek() and the values from the seek event. This method will update
* all the segment fields. The position field will contain the new playback position. * all the segment fields. The position field will contain the new playback position.
* If the cur_type was different from GST_SEEK_TYPE_NONE, playback continues from * If the start_type was different from GST_SEEK_TYPE_NONE, playback continues from
* the position position, possibly with updated flags or rate. * the position position, possibly with updated flags or rate.
* *
* For elements that want to use #GstSegment to track the playback region, * For elements that want to use #GstSegment to track the playback region,

View file

@ -3735,19 +3735,19 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event)
gdouble rate; gdouble rate;
GstFormat format; GstFormat format;
GstSeekFlags flags; GstSeekFlags flags;
GstSeekType cur_type = GST_SEEK_TYPE_NONE, stop_type; GstSeekType start_type = GST_SEEK_TYPE_NONE, stop_type;
gboolean flush, update, res = TRUE, accurate; gboolean flush, update, res = TRUE, accurate;
gint64 cur, stop, seekpos, seekstop; gint64 start, stop, seekpos, seekstop;
GstSegment seeksegment = { 0, }; GstSegment seeksegment = { 0, };
GstClockTime start_ts; GstClockTime start_ts;
gst_event_parse_seek (event, &rate, &format, &flags, gst_event_parse_seek (event, &rate, &format, &flags,
&cur_type, &cur, &stop_type, &stop); &start_type, &start, &stop_type, &stop);
GST_DEBUG_OBJECT (parse, "seek to format %s, rate %f, " GST_DEBUG_OBJECT (parse, "seek to format %s, rate %f, "
"start type %d at %" GST_TIME_FORMAT ", end type %d at %" "start type %d at %" GST_TIME_FORMAT ", end type %d at %"
GST_TIME_FORMAT, gst_format_get_name (format), rate, GST_TIME_FORMAT, gst_format_get_name (format), rate,
cur_type, GST_TIME_ARGS (cur), stop_type, GST_TIME_ARGS (stop)); start_type, GST_TIME_ARGS (start), stop_type, GST_TIME_ARGS (stop));
/* no negative rates in push mode */ /* no negative rates in push mode */
if (rate < 0.0 && parse->priv->pad_mode == GST_PAD_MODE_PUSH) if (rate < 0.0 && parse->priv->pad_mode == GST_PAD_MODE_PUSH)
@ -3760,7 +3760,7 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event)
if (format != GST_FORMAT_TIME || res) if (format != GST_FORMAT_TIME || res)
goto done; goto done;
if (cur_type != GST_SEEK_TYPE_SET || if (start_type != GST_SEEK_TYPE_SET ||
(stop_type != GST_SEEK_TYPE_SET && stop_type != GST_SEEK_TYPE_NONE)) (stop_type != GST_SEEK_TYPE_SET && stop_type != GST_SEEK_TYPE_NONE))
goto wrong_type; goto wrong_type;
@ -3773,7 +3773,7 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event)
GST_DEBUG_OBJECT (parse, "configuring seek"); GST_DEBUG_OBJECT (parse, "configuring seek");
gst_segment_do_seek (&seeksegment, rate, format, flags, gst_segment_do_seek (&seeksegment, rate, format, flags,
cur_type, cur, stop_type, stop, &update); start_type, start, stop_type, stop, &update);
/* accurate seeking implies seek tables are used to obtain position, /* accurate seeking implies seek tables are used to obtain position,
* and the requested segment is maintained exactly, not adjusted any way */ * and the requested segment is maintained exactly, not adjusted any way */

View file

@ -1965,8 +1965,8 @@ gst_base_sink_wait_clock (GstBaseSink * sink, GstClockTime time,
/* FIXME: Casting to GstClockEntry only works because the types /* FIXME: Casting to GstClockEntry only works because the types
* are the same */ * are the same */
if (G_LIKELY (sink->priv->cached_clock_id != NULL if (G_LIKELY (sink->priv->cached_clock_id != NULL
&& GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink-> && GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->priv->
priv->cached_clock_id) == clock)) { cached_clock_id) == clock)) {
if (!gst_clock_single_shot_id_reinit (clock, sink->priv->cached_clock_id, if (!gst_clock_single_shot_id_reinit (clock, sink->priv->cached_clock_id,
time)) { time)) {
gst_clock_id_unref (sink->priv->cached_clock_id); gst_clock_id_unref (sink->priv->cached_clock_id);
@ -3391,8 +3391,8 @@ gst_base_sink_default_prepare_seek_segment (GstBaseSink * sink,
* seek format, adjust by the relative seek offset and then convert back to * seek format, adjust by the relative seek offset and then convert back to
* the processing format * the processing format
*/ */
GstSeekType cur_type, stop_type; GstSeekType start_type, stop_type;
gint64 cur, stop; gint64 start, stop;
GstSeekFlags flags; GstSeekFlags flags;
GstFormat seek_format; GstFormat seek_format;
gdouble rate; gdouble rate;
@ -3400,24 +3400,24 @@ gst_base_sink_default_prepare_seek_segment (GstBaseSink * sink,
gboolean res = TRUE; gboolean res = TRUE;
gst_event_parse_seek (event, &rate, &seek_format, &flags, gst_event_parse_seek (event, &rate, &seek_format, &flags,
&cur_type, &cur, &stop_type, &stop); &start_type, &start, &stop_type, &stop);
if (seek_format == segment->format) { if (seek_format == segment->format) {
gst_segment_do_seek (segment, rate, seek_format, flags, gst_segment_do_seek (segment, rate, seek_format, flags,
cur_type, cur, stop_type, stop, &update); start_type, start, stop_type, stop, &update);
return TRUE; return TRUE;
} }
if (cur_type != GST_SEEK_TYPE_NONE) { if (start_type != GST_SEEK_TYPE_NONE) {
/* FIXME: Handle seek_cur & seek_end by converting the input segment vals */ /* FIXME: Handle seek_end by converting the input segment vals */
res = res =
gst_pad_query_convert (sink->sinkpad, seek_format, cur, segment->format, gst_pad_query_convert (sink->sinkpad, seek_format, start,
&cur); segment->format, &start);
cur_type = GST_SEEK_TYPE_SET; start_type = GST_SEEK_TYPE_SET;
} }
if (res && stop_type != GST_SEEK_TYPE_NONE) { if (res && stop_type != GST_SEEK_TYPE_NONE) {
/* FIXME: Handle seek_cur & seek_end by converting the input segment vals */ /* FIXME: Handle seek_end by converting the input segment vals */
res = res =
gst_pad_query_convert (sink->sinkpad, seek_format, stop, gst_pad_query_convert (sink->sinkpad, seek_format, stop,
segment->format, &stop); segment->format, &stop);
@ -3425,7 +3425,7 @@ gst_base_sink_default_prepare_seek_segment (GstBaseSink * sink,
} }
/* And finally, configure our output segment in the desired format */ /* And finally, configure our output segment in the desired format */
gst_segment_do_seek (segment, rate, segment->format, flags, cur_type, cur, gst_segment_do_seek (segment, rate, segment->format, flags, start_type, start,
stop_type, stop, &update); stop_type, stop, &update);
if (!res) if (!res)
@ -3448,9 +3448,9 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event)
gdouble rate; gdouble rate;
GstFormat seek_format, dest_format; GstFormat seek_format, dest_format;
GstSeekFlags flags; GstSeekFlags flags;
GstSeekType cur_type, stop_type; GstSeekType start_type, stop_type;
gboolean seekseg_configured = FALSE; gboolean seekseg_configured = FALSE;
gint64 cur, stop; gint64 start, stop;
gboolean update, res = TRUE; gboolean update, res = TRUE;
GstSegment seeksegment; GstSegment seeksegment;
@ -3459,7 +3459,7 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event)
if (event) { if (event) {
GST_DEBUG_OBJECT (sink, "performing seek with event %p", event); GST_DEBUG_OBJECT (sink, "performing seek with event %p", event);
gst_event_parse_seek (event, &rate, &seek_format, &flags, gst_event_parse_seek (event, &rate, &seek_format, &flags,
&cur_type, &cur, &stop_type, &stop); &start_type, &start, &stop_type, &stop);
flush = flags & GST_SEEK_FLAG_FLUSH; flush = flags & GST_SEEK_FLAG_FLUSH;
} else { } else {
@ -3499,7 +3499,7 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event)
/* The seek format matches our processing format, no need to ask the /* The seek format matches our processing format, no need to ask the
* the subclass to configure the segment. */ * the subclass to configure the segment. */
gst_segment_do_seek (&seeksegment, rate, seek_format, flags, gst_segment_do_seek (&seeksegment, rate, seek_format, flags,
cur_type, cur, stop_type, stop, &update); start_type, start, stop_type, stop, &update);
} }
} }
/* Else, no seek event passed, so we're just (re)starting the /* Else, no seek event passed, so we're just (re)starting the

View file

@ -1265,8 +1265,8 @@ gst_base_src_default_prepare_seek_segment (GstBaseSrc * src, GstEvent * event,
* seek format, adjust by the relative seek offset and then convert back to * seek format, adjust by the relative seek offset and then convert back to
* the processing format * the processing format
*/ */
GstSeekType cur_type, stop_type; GstSeekType start_type, stop_type;
gint64 cur, stop; gint64 start, stop;
GstSeekFlags flags; GstSeekFlags flags;
GstFormat seek_format, dest_format; GstFormat seek_format, dest_format;
gdouble rate; gdouble rate;
@ -1274,25 +1274,25 @@ gst_base_src_default_prepare_seek_segment (GstBaseSrc * src, GstEvent * event,
gboolean res = TRUE; gboolean res = TRUE;
gst_event_parse_seek (event, &rate, &seek_format, &flags, gst_event_parse_seek (event, &rate, &seek_format, &flags,
&cur_type, &cur, &stop_type, &stop); &start_type, &start, &stop_type, &stop);
dest_format = segment->format; dest_format = segment->format;
if (seek_format == dest_format) { if (seek_format == dest_format) {
gst_segment_do_seek (segment, rate, seek_format, flags, gst_segment_do_seek (segment, rate, seek_format, flags,
cur_type, cur, stop_type, stop, &update); start_type, start, stop_type, stop, &update);
return TRUE; return TRUE;
} }
if (cur_type != GST_SEEK_TYPE_NONE) { if (start_type != GST_SEEK_TYPE_NONE) {
/* FIXME: Handle seek_cur & seek_end by converting the input segment vals */ /* FIXME: Handle seek_end by converting the input segment vals */
res = res =
gst_pad_query_convert (src->srcpad, seek_format, cur, dest_format, gst_pad_query_convert (src->srcpad, seek_format, start, dest_format,
&cur); &start);
cur_type = GST_SEEK_TYPE_SET; start_type = GST_SEEK_TYPE_SET;
} }
if (res && stop_type != GST_SEEK_TYPE_NONE) { if (res && stop_type != GST_SEEK_TYPE_NONE) {
/* FIXME: Handle seek_cur & seek_end by converting the input segment vals */ /* FIXME: Handle seek_end by converting the input segment vals */
res = res =
gst_pad_query_convert (src->srcpad, seek_format, stop, dest_format, gst_pad_query_convert (src->srcpad, seek_format, stop, dest_format,
&stop); &stop);
@ -1300,7 +1300,7 @@ gst_base_src_default_prepare_seek_segment (GstBaseSrc * src, GstEvent * event,
} }
/* And finally, configure our output segment in the desired format */ /* And finally, configure our output segment in the desired format */
gst_segment_do_seek (segment, rate, dest_format, flags, cur_type, cur, gst_segment_do_seek (segment, rate, dest_format, flags, start_type, start,
stop_type, stop, &update); stop_type, stop, &update);
if (!res) if (!res)
@ -1471,8 +1471,8 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
gdouble rate; gdouble rate;
GstFormat seek_format, dest_format; GstFormat seek_format, dest_format;
GstSeekFlags flags; GstSeekFlags flags;
GstSeekType cur_type, stop_type; GstSeekType start_type, stop_type;
gint64 cur, stop; gint64 start, stop;
gboolean flush, playing; gboolean flush, playing;
gboolean update; gboolean update;
gboolean relative_seek = FALSE; gboolean relative_seek = FALSE;
@ -1489,9 +1489,9 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
if (event) { if (event) {
gst_event_parse_seek (event, &rate, &seek_format, &flags, gst_event_parse_seek (event, &rate, &seek_format, &flags,
&cur_type, &cur, &stop_type, &stop); &start_type, &start, &stop_type, &stop);
relative_seek = SEEK_TYPE_IS_RELATIVE (cur_type) || relative_seek = SEEK_TYPE_IS_RELATIVE (start_type) ||
SEEK_TYPE_IS_RELATIVE (stop_type); SEEK_TYPE_IS_RELATIVE (stop_type);
if (dest_format != seek_format && !relative_seek) { if (dest_format != seek_format && !relative_seek) {
@ -1564,7 +1564,7 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
/* The seek format matches our processing format, no need to ask the /* The seek format matches our processing format, no need to ask the
* the subclass to configure the segment. */ * the subclass to configure the segment. */
gst_segment_do_seek (&seeksegment, rate, seek_format, flags, gst_segment_do_seek (&seeksegment, rate, seek_format, flags,
cur_type, cur, stop_type, stop, &update); start_type, start, stop_type, stop, &update);
} }
} }
/* Else, no seek event passed, so we're just (re)starting the /* Else, no seek event passed, so we're just (re)starting the

View file

@ -423,14 +423,14 @@ static gboolean
gst_type_find_element_seek (GstTypeFindElement * typefind, GstEvent * event) gst_type_find_element_seek (GstTypeFindElement * typefind, GstEvent * event)
{ {
GstSeekFlags flags; GstSeekFlags flags;
GstSeekType cur_type, stop_type; GstSeekType start_type, stop_type;
GstFormat format; GstFormat format;
gboolean flush; gboolean flush;
gdouble rate; gdouble rate;
gint64 cur, stop; gint64 start, stop;
GstSegment seeksegment = { 0, }; GstSegment seeksegment = { 0, };
gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur, gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
&stop_type, &stop); &stop_type, &stop);
/* we can only seek on bytes */ /* we can only seek on bytes */
@ -445,7 +445,7 @@ gst_type_find_element_seek (GstTypeFindElement * typefind, GstEvent * event)
GST_DEBUG_OBJECT (typefind, "configuring seek"); GST_DEBUG_OBJECT (typefind, "configuring seek");
gst_segment_do_seek (&seeksegment, rate, format, flags, gst_segment_do_seek (&seeksegment, rate, format, flags,
cur_type, cur, stop_type, stop, NULL); start_type, start, stop_type, stop, NULL);
flush = ! !(flags & GST_SEEK_FLAG_FLUSH); flush = ! !(flags & GST_SEEK_FLAG_FLUSH);

View file

@ -243,8 +243,8 @@ GST_START_TEST (create_events)
gdouble rate; gdouble rate;
GstFormat format; GstFormat format;
GstSeekFlags flags; GstSeekFlags flags;
GstSeekType cur_type, stop_type; GstSeekType start_type, stop_type;
gint64 cur, stop; gint64 start, stop;
event = gst_event_new_seek (0.5, GST_FORMAT_BYTES, event = gst_event_new_seek (0.5, GST_FORMAT_BYTES,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
@ -256,13 +256,13 @@ GST_START_TEST (create_events)
fail_if (GST_EVENT_IS_DOWNSTREAM (event)); fail_if (GST_EVENT_IS_DOWNSTREAM (event));
fail_if (GST_EVENT_IS_SERIALIZED (event)); fail_if (GST_EVENT_IS_SERIALIZED (event));
gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur, gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
&stop_type, &stop); &stop_type, &stop);
fail_unless (rate == 0.5); fail_unless (rate == 0.5);
fail_unless (format == GST_FORMAT_BYTES); fail_unless (format == GST_FORMAT_BYTES);
fail_unless (flags == (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE)); fail_unless (flags == (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE));
fail_unless (cur_type == GST_SEEK_TYPE_SET); fail_unless (start_type == GST_SEEK_TYPE_SET);
fail_unless (cur == 1); fail_unless (start == 1);
fail_unless (stop_type == GST_SEEK_TYPE_NONE); fail_unless (stop_type == GST_SEEK_TYPE_NONE);
fail_unless (stop == 0xdeadbeef); fail_unless (stop == 0xdeadbeef);

View file

@ -233,7 +233,7 @@ GST_START_TEST (test_complete_structure)
GstStructure *structure; GstStructure *structure;
const gchar *s; const gchar *s;
s = "GstEventSeek, rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, flags=(GstSeekFlags)GST_SEEK_FLAGS_NONE, cur_type=(GstSeekType)GST_SEEK_TYPE_SET, cur=(gint64)1000000000, stop_type=(GstSeekType)GST_SEEK_TYPE_NONE, stop=(gint64)0"; s = "GstEventSeek, rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, flags=(GstSeekFlags)GST_SEEK_FLAGS_NONE, start_type=(GstSeekType)GST_SEEK_TYPE_SET, start=(gint64)1000000000, stop_type=(GstSeekType)GST_SEEK_TYPE_NONE, stop=(gint64)0";
structure = gst_structure_from_string (s, NULL); structure = gst_structure_from_string (s, NULL);
fail_if (structure == NULL, "Could not get structure from string %s", s); fail_if (structure == NULL, "Could not get structure from string %s", s);
/* FIXME: TODO: add checks for correct serialization of members ? */ /* FIXME: TODO: add checks for correct serialization of members ? */