When seeking, the start value and type are now called start and start_type.
* @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
*
*/
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;
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;
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);
* 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,
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)
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;
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 */
/* 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);
* 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;
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);
}
/* 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)
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;
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 {
/* 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
* 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;
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);
}
/* 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)
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;
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) {
/* 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
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 */
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);
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,
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);
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 ? */