From f05b0e222f9cf4fff35327c7d109be42fbf27eb7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 27 Jul 2012 15:19:57 +0200 Subject: [PATCH] Update for new seeking variable name When seeking, the start value and type are now called start and start_type. --- gst/gstelement.c | 9 +++---- gst/gstelement.h | 2 +- gst/gstsegment.c | 2 +- libs/gst/base/gstbaseparse.c | 12 +++++----- libs/gst/base/gstbasesink.c | 34 +++++++++++++-------------- libs/gst/base/gstbasesrc.c | 32 ++++++++++++------------- plugins/elements/gsttypefindelement.c | 8 +++---- tests/check/gst/gstevent.c | 10 ++++---- tests/check/gst/gststructure.c | 2 +- 9 files changed, 56 insertions(+), 55 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index c0d1ee8d2f..fa2c3bcd84 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1550,8 +1550,8 @@ gst_element_send_event (GstElement * element, GstEvent * event) * @rate: The new playback rate * @format: The format of the seek values * @flags: The optional seek flags. - * @cur_type: The type and flags for the new current position - * @cur: The value of the new current position + * @start_type: The type and flags for the new start position + * @start: The value of the new start position * @stop_type: The type and flags for 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 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) { 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); 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); return result; diff --git a/gst/gstelement.h b/gst/gstelement.h index 22790a795f..725dc342c0 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -752,7 +752,7 @@ GstIterator * gst_element_iterate_sink_pads (GstElement * element); gboolean gst_element_send_event (GstElement *element, GstEvent *event); gboolean gst_element_seek (GstElement *element, gdouble rate, GstFormat format, GstSeekFlags flags, - GstSeekType cur_type, gint64 cur, + GstSeekType start_type, gint64 start, GstSeekType stop_type, gint64 stop); gboolean gst_element_query (GstElement *element, GstQuery *query); diff --git a/gst/gstsegment.c b/gst/gstsegment.c index bcabcc872b..6ff04fa560 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -63,7 +63,7 @@ * 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 * 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. * * For elements that want to use #GstSegment to track the playback region, diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index f86f4b5ccb..edaedcc9fe 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -3735,19 +3735,19 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) gdouble rate; GstFormat format; 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; - gint64 cur, stop, seekpos, seekstop; + gint64 start, stop, seekpos, seekstop; GstSegment seeksegment = { 0, }; GstClockTime start_ts; 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, " "start type %d at %" GST_TIME_FORMAT ", end type %d at %" 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 */ 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) 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)) goto wrong_type; @@ -3773,7 +3773,7 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) GST_DEBUG_OBJECT (parse, "configuring seek"); 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, * and the requested segment is maintained exactly, not adjusted any way */ diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index a96fa04354..db7ee021a8 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -1965,8 +1965,8 @@ gst_base_sink_wait_clock (GstBaseSink * sink, GstClockTime time, /* FIXME: Casting to GstClockEntry only works because the types * are the same */ if (G_LIKELY (sink->priv->cached_clock_id != NULL - && GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink-> - priv->cached_clock_id) == clock)) { + && GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->priv-> + cached_clock_id) == clock)) { if (!gst_clock_single_shot_id_reinit (clock, sink->priv->cached_clock_id, time)) { 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 * the processing format */ - GstSeekType cur_type, stop_type; - gint64 cur, stop; + GstSeekType start_type, stop_type; + gint64 start, stop; GstSeekFlags flags; GstFormat seek_format; gdouble rate; @@ -3400,24 +3400,24 @@ gst_base_sink_default_prepare_seek_segment (GstBaseSink * sink, gboolean res = TRUE; 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) { 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; } - if (cur_type != GST_SEEK_TYPE_NONE) { - /* FIXME: Handle seek_cur & seek_end by converting the input segment vals */ + if (start_type != GST_SEEK_TYPE_NONE) { + /* FIXME: Handle seek_end by converting the input segment vals */ res = - gst_pad_query_convert (sink->sinkpad, seek_format, cur, segment->format, - &cur); - cur_type = GST_SEEK_TYPE_SET; + gst_pad_query_convert (sink->sinkpad, seek_format, start, + segment->format, &start); + start_type = GST_SEEK_TYPE_SET; } 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 = gst_pad_query_convert (sink->sinkpad, seek_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 */ - 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); if (!res) @@ -3448,9 +3448,9 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event) gdouble rate; GstFormat seek_format, dest_format; GstSeekFlags flags; - GstSeekType cur_type, stop_type; + GstSeekType start_type, stop_type; gboolean seekseg_configured = FALSE; - gint64 cur, stop; + gint64 start, stop; gboolean update, res = TRUE; GstSegment seeksegment; @@ -3459,7 +3459,7 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event) if (event) { GST_DEBUG_OBJECT (sink, "performing seek with event %p", event); 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; } 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 subclass to configure the segment. */ 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 diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index bedb88e211..ad74b71ade 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -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 * the processing format */ - GstSeekType cur_type, stop_type; - gint64 cur, stop; + GstSeekType start_type, stop_type; + gint64 start, stop; GstSeekFlags flags; GstFormat seek_format, dest_format; gdouble rate; @@ -1274,25 +1274,25 @@ gst_base_src_default_prepare_seek_segment (GstBaseSrc * src, GstEvent * event, gboolean res = TRUE; 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; if (seek_format == dest_format) { 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; } - if (cur_type != GST_SEEK_TYPE_NONE) { - /* FIXME: Handle seek_cur & seek_end by converting the input segment vals */ + if (start_type != GST_SEEK_TYPE_NONE) { + /* FIXME: Handle seek_end by converting the input segment vals */ res = - gst_pad_query_convert (src->srcpad, seek_format, cur, dest_format, - &cur); - cur_type = GST_SEEK_TYPE_SET; + gst_pad_query_convert (src->srcpad, seek_format, start, dest_format, + &start); + start_type = GST_SEEK_TYPE_SET; } 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 = gst_pad_query_convert (src->srcpad, seek_format, stop, dest_format, &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 */ - 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); if (!res) @@ -1471,8 +1471,8 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock) gdouble rate; GstFormat seek_format, dest_format; GstSeekFlags flags; - GstSeekType cur_type, stop_type; - gint64 cur, stop; + GstSeekType start_type, stop_type; + gint64 start, stop; gboolean flush, playing; gboolean update; gboolean relative_seek = FALSE; @@ -1489,9 +1489,9 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock) if (event) { 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); 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 subclass to configure the segment. */ 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 diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 7674b4201d..ca1ffa2af5 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -423,14 +423,14 @@ static gboolean gst_type_find_element_seek (GstTypeFindElement * typefind, GstEvent * event) { GstSeekFlags flags; - GstSeekType cur_type, stop_type; + GstSeekType start_type, stop_type; GstFormat format; gboolean flush; gdouble rate; - gint64 cur, stop; + gint64 start, stop; 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); /* 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_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); diff --git a/tests/check/gst/gstevent.c b/tests/check/gst/gstevent.c index b16b023b44..5e805cca4c 100644 --- a/tests/check/gst/gstevent.c +++ b/tests/check/gst/gstevent.c @@ -243,8 +243,8 @@ GST_START_TEST (create_events) gdouble rate; GstFormat format; GstSeekFlags flags; - GstSeekType cur_type, stop_type; - gint64 cur, stop; + GstSeekType start_type, stop_type; + gint64 start, stop; event = gst_event_new_seek (0.5, GST_FORMAT_BYTES, 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_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); fail_unless (rate == 0.5); fail_unless (format == GST_FORMAT_BYTES); fail_unless (flags == (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE)); - fail_unless (cur_type == GST_SEEK_TYPE_SET); - fail_unless (cur == 1); + fail_unless (start_type == GST_SEEK_TYPE_SET); + fail_unless (start == 1); fail_unless (stop_type == GST_SEEK_TYPE_NONE); fail_unless (stop == 0xdeadbeef); diff --git a/tests/check/gst/gststructure.c b/tests/check/gst/gststructure.c index 3428d1743d..9150872a0c 100644 --- a/tests/check/gst/gststructure.c +++ b/tests/check/gst/gststructure.c @@ -233,7 +233,7 @@ GST_START_TEST (test_complete_structure) GstStructure *structure; 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); fail_if (structure == NULL, "Could not get structure from string %s", s); /* FIXME: TODO: add checks for correct serialization of members ? */