The format of the step units
"amount", G_TYPE_UINT64
- The amount of units to step. -1 resumes normal non-stepping behaviour to
- the end of the segment.
+ The amount of units to step. A 0 amount immediately completes and can be
+ used to cancel the current step and resume normal non-stepping behaviour
+ to the end of the segment.
+ A -1 amount steps until the end of the segment.
"rate", G_TYPE_DOUBLE
The rate at which the frames should be stepped in PLAYING mode. 1.0 is
* @position: the position in the segment
*
* Translate @position to the total running time using the currently configured
- * and previously accumulated segments. Position is a value between @segment
- * start and stop time.
+ * segment. Position is a value between @segment start and stop time.
*
* This function is typically used by elements that need to synchronize to the
* global clock in a pipeline. The runnning time is a constantly increasing value
current->start_start = segment->start;
if (current->format == GST_FORMAT_TIME) {
- end = current->start + current->amount;
+ /* calculate the running-time when the step operation should stop */
+ if (current->amount != -1)
+ end = current->start + current->amount;
+ else
+ end = -1;
+
if (!current->flush) {
+ gint64 position;
+
/* update the segment clipping regions for non-flushing seeks */
if (segment->rate > 0.0) {
- segment->stop = gst_segment_to_position (segment, GST_FORMAT_TIME, end);
- segment->position = segment->stop;
+ if (end != -1)
+ position = gst_segment_to_position (segment, GST_FORMAT_TIME, end);
+ else
+ position = segment->stop;
+
+ segment->stop = position;
+ segment->position = position;
} else {
- gint64 position;
+ if (end != -1)
+ position = gst_segment_to_position (segment, GST_FORMAT_TIME, end);
+ else
+ position = segment->start;
- position = gst_segment_to_position (segment, GST_FORMAT_TIME, end);
segment->time = position;
segment->start = position;
segment->position = position;
{
gboolean step_end = FALSE;
+ /* stepping never stops */
if (current->amount == -1)
- return TRUE;
+ return FALSE;
/* see if we need to skip this buffer because of stepping */
switch (current->format) {