GstStepInfo * pending, GstStepInfo * current)
{
gint64 end;
+ GstMessage *message;
GST_DEBUG_OBJECT (sink, "update pending step");
pending->valid = FALSE;
GST_OBJECT_UNLOCK (sink);
+ /* post message first */
+ message = gst_message_new_step_start (GST_OBJECT (sink), TRUE);
+ gst_message_set_seqnum (message, current->seqnum);
+ gst_element_post_message (GST_ELEMENT (sink), message);
+
/* get the running time of where we paused and remember it */
current->start = gst_element_get_start_time (GST_ELEMENT_CAST (sink));
gst_segment_set_running_time (segment, GST_FORMAT_TIME, current->start);
/* clip, only when we know about time */
if (G_UNLIKELY (!gst_segment_clip (segment, GST_FORMAT_TIME,
- (gint64) start, (gint64) stop, &cstart, &cstop)))
+ (gint64) start, (gint64) stop, &cstart, &cstop))) {
+ if (step->valid) {
+ /* when we are stepping, pretend we're at the end of the segment */
+ if (segment->rate > 0.0) {
+ cstart = segment->stop;
+ cstop = segment->stop;
+ } else {
+ cstart = segment->start;
+ cstop = segment->start;
+ }
+ goto do_times;
+ }
goto out_of_segment;
+ }
if (G_UNLIKELY (start != cstart || stop != cstop)) {
GST_DEBUG_OBJECT (basesink, "clipped to: start %" GST_TIME_FORMAT
start = priv->current_rstart;
+ if (priv->current_step.valid)
+ return;
+
/* if Quality-of-Service disabled, do nothing */
if (!g_atomic_int_get (&priv->qos_enabled) || start == -1)
return;
done:
if (step_end) {
+ /* the step ended, check if we need to activate a new step */
+ GST_DEBUG_OBJECT (basesink, "step ended");
stop_stepping (basesink, &basesink->segment, &priv->current_step,
priv->current_rstart, priv->current_rstop);
goto again;
guint64 amount;
guint seqnum;
GstStepInfo *pending, *current;
+ GstMessage *message;
bclass = GST_BASE_SINK_GET_CLASS (sink);
priv = sink->priv;
pending = &priv->pending_step;
current = &priv->current_step;
+ /* post message first */
+ message = gst_message_new_step_start (GST_OBJECT (sink), FALSE);
+ gst_message_set_seqnum (message, current->seqnum);
+ gst_element_post_message (GST_ELEMENT (sink), message);
+
if (flush) {
/* we need to call ::unlock before locking PREROLL_LOCK
* since we lock it before going into ::render */