summaryrefslogtreecommitdiff
path: root/libs/gst/base/gstbasesink.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gst/base/gstbasesink.c')
-rw-r--r--libs/gst/base/gstbasesink.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
index b4c5e7366e..498b0e9600 100644
--- a/libs/gst/base/gstbasesink.c
+++ b/libs/gst/base/gstbasesink.c
@@ -2592,3 +2592,3 @@ preroll_failed:
static gboolean
-gst_base_sink_send_qos (GstBaseSink * basesink,
+gst_base_sink_send_qos (GstBaseSink * basesink, GstQOSType type,
gdouble proportion, GstClockTime time, GstClockTimeDiff diff)
@@ -2600,6 +2600,6 @@ gst_base_sink_send_qos (GstBaseSink * basesink,
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, basesink,
- "qos: proportion: %lf, diff %" G_GINT64_FORMAT ", timestamp %"
- GST_TIME_FORMAT, proportion, diff, GST_TIME_ARGS (time));
+ "qos: type %d, proportion: %lf, diff %" G_GINT64_FORMAT ", timestamp %"
+ GST_TIME_FORMAT, type, proportion, diff, GST_TIME_ARGS (time));
- event = gst_event_new_qos (proportion, diff, time);
+ event = gst_event_new_qos_full (type, proportion, diff, time);
@@ -2717,2 +2717,5 @@ gst_base_sink_perform_qos (GstBaseSink * sink, gboolean dropped)
if (priv->avg_rate >= 0.0) {
+ GstQOSType type;
+ GstClockTimeDiff diff;
+
/* if we have a valid rate, start sending QoS messages */
@@ -2724,4 +2727,16 @@ gst_base_sink_perform_qos (GstBaseSink * sink, gboolean dropped)
}
- gst_base_sink_send_qos (sink, priv->avg_rate, priv->current_rstart,
- priv->current_jitter);
+
+ if (priv->throttle_time > 0) {
+ diff = priv->throttle_time;
+ type = GST_QOS_TYPE_THROTTLE;
+ } else {
+ diff = priv->current_jitter;
+ if (diff <= 0)
+ type = GST_QOS_TYPE_OVERFLOW;
+ else
+ type = GST_QOS_TYPE_UNDERFLOW;
+ }
+
+ gst_base_sink_send_qos (sink, type, priv->avg_rate, priv->current_rstart,
+ diff);
}