/* Cached GstClockID */
GstClockID cached_clock_id;
- /* for throttling */
+ /* for throttling and QoS */
+ GstClockTime earliest_in_time;
GstClockTime throttle_time;
};
/* save sync time for eos when the previous object needed sync */
priv->eos_rtime = (do_sync ? priv->current_rstop : GST_CLOCK_TIME_NONE);
+ if (G_UNLIKELY (priv->earliest_in_time != -1
+ && rstart < priv->earliest_in_time))
+ goto qos_dropped;
+
again:
/* first do preroll, this makes sure we commit our state
* to PAUSED and can continue to PLAYING. We cannot perform
GST_DEBUG_OBJECT (basesink, "non syncable object %p", obj);
return GST_FLOW_OK;
}
+qos_dropped:
+ {
+ GST_DEBUG_OBJECT (basesink, "dropped because of QoS %p", obj);
+ *late = TRUE;
+ return GST_FLOW_OK;
+ }
flushing:
{
GST_DEBUG_OBJECT (basesink, "we are flushing");
priv = sink->priv;
priv->last_in_time = GST_CLOCK_TIME_NONE;
+ priv->earliest_in_time = GST_CLOCK_TIME_NONE;
priv->last_left = GST_CLOCK_TIME_NONE;
priv->avg_duration = GST_CLOCK_TIME_NONE;
priv->avg_pt = GST_CLOCK_TIME_NONE;
done:
if (!late || !GST_CLOCK_TIME_IS_VALID (priv->last_in_time)) {
priv->last_in_time = start;
+ /* the next allowed input timestamp */
+ if (priv->throttle_time > 0)
+ priv->earliest_in_time = start + priv->throttle_time;
}
return late;