From 7f24a48387458a28c499fe3256fff5f38a5f027f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 9 May 2011 18:48:55 +0200 Subject: [PATCH] event: _qos_full -> _qos --- gst/gstevent.c | 54 +++------------------------------------- gst/gstevent.h | 8 ++---- libs/gst/base/gstbasesink.c | 2 +- libs/gst/base/gstbasesrc.c | 2 +- libs/gst/base/gstbasetransform.c | 2 +- tests/check/gst/gstevent.c | 14 +++++------ 6 files changed, 15 insertions(+), 67 deletions(-) diff --git a/gst/gstevent.c b/gst/gstevent.c index 28685d9..61a22ed 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -786,33 +786,6 @@ gst_event_parse_buffer_size (GstEvent * event, GstFormat * format, /** * gst_event_new_qos: - * @proportion: the proportion of the qos message - * @diff: The time difference of the last Clock sync - * @timestamp: The timestamp of the buffer - * - * Allocate a new qos event with the given values. This function calls - * gst_event_new_qos_full() with the type set to #GST_QOS_TYPE_OVERFLOW - * when diff is negative (buffers are in time) and #GST_QOS_TYPE_UNDERFLOW - * when @diff is positive (buffers are late). - * - * Returns: (transfer full): a new QOS event. - */ -GstEvent * -gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff, - GstClockTime timestamp) -{ - GstQOSType type; - - if (diff <= 0) - type = GST_QOS_TYPE_OVERFLOW; - else - type = GST_QOS_TYPE_UNDERFLOW; - - return gst_event_new_qos_full (type, proportion, diff, timestamp); -} - -/** - * gst_event_new_qos_full: * @type: the QoS type * @proportion: the proportion of the qos message * @diff: The time difference of the last Clock sync @@ -862,11 +835,9 @@ gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff, * event and implement custom application specific QoS handling. * * Returns: (transfer full): a new QOS event. - * - * Since: 0.10.33 */ GstEvent * -gst_event_new_qos_full (GstQOSType type, gdouble proportion, +gst_event_new_qos (GstQOSType type, gdouble proportion, GstClockTimeDiff diff, GstClockTime timestamp) { GstEvent *event; @@ -893,35 +864,16 @@ gst_event_new_qos_full (GstQOSType type, gdouble proportion, /** * gst_event_parse_qos: * @event: The event to query - * @proportion: (out): A pointer to store the proportion in - * @diff: (out): A pointer to store the diff in - * @timestamp: (out): A pointer to store the timestamp in - * - * Get the proportion, diff and timestamp in the qos event. See - * gst_event_new_qos() for more information about the different QoS values. - */ -void -gst_event_parse_qos (GstEvent * event, gdouble * proportion, - GstClockTimeDiff * diff, GstClockTime * timestamp) -{ - gst_event_parse_qos_full (event, NULL, proportion, diff, timestamp); -} - -/** - * gst_event_parse_qos_full: - * @event: The event to query * @type: (out): A pointer to store the QoS type in * @proportion: (out): A pointer to store the proportion in * @diff: (out): A pointer to store the diff in * @timestamp: (out): A pointer to store the timestamp in * * Get the type, proportion, diff and timestamp in the qos event. See - * gst_event_new_qos_full() for more information about the different QoS values. - * - * Since: 0.10.33 + * gst_event_new_qos() for more information about the different QoS values. */ void -gst_event_parse_qos_full (GstEvent * event, GstQOSType * type, +gst_event_parse_qos (GstEvent * event, GstQOSType * type, gdouble * proportion, GstClockTimeDiff * diff, GstClockTime * timestamp) { const GstStructure *structure; diff --git a/gst/gstevent.h b/gst/gstevent.h index f3f957b..804de17 100644 --- a/gst/gstevent.h +++ b/gst/gstevent.h @@ -486,13 +486,9 @@ void gst_event_parse_buffer_size (GstEvent *event, GstFormat *for gint64 *maxsize, gboolean *async); /* QOS events */ -GstEvent* gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff, - GstClockTime timestamp); -GstEvent* gst_event_new_qos_full (GstQOSType type, gdouble proportion, +GstEvent* gst_event_new_qos (GstQOSType type, gdouble proportion, GstClockTimeDiff diff, GstClockTime timestamp); -void gst_event_parse_qos (GstEvent *event, gdouble *proportion, GstClockTimeDiff *diff, - GstClockTime *timestamp); -void gst_event_parse_qos_full (GstEvent *event, GstQOSType *type, +void gst_event_parse_qos (GstEvent *event, GstQOSType *type, gdouble *proportion, GstClockTimeDiff *diff, GstClockTime *timestamp); /* seek event */ diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 4e67fc5..5f1b92da3 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -2554,7 +2554,7 @@ gst_base_sink_send_qos (GstBaseSink * basesink, GstQOSType type, "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_full (type, proportion, diff, time); + event = gst_event_new_qos (type, proportion, diff, time); /* send upstream */ res = gst_pad_push_event (basesink->sinkpad, event); diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 58a3cf1..5818b35 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -1730,7 +1730,7 @@ gst_base_src_default_event (GstBaseSrc * src, GstEvent * event) GstClockTimeDiff diff; GstClockTime timestamp; - gst_event_parse_qos (event, &proportion, &diff, ×tamp); + gst_event_parse_qos (event, NULL, &proportion, &diff, ×tamp); gst_base_src_update_qos (src, proportion, diff, timestamp); result = TRUE; break; diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 21fb22b..1e37b78 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -1730,7 +1730,7 @@ gst_base_transform_src_eventfunc (GstBaseTransform * trans, GstEvent * event) GstClockTimeDiff diff; GstClockTime timestamp; - gst_event_parse_qos (event, &proportion, &diff, ×tamp); + gst_event_parse_qos (event, NULL, &proportion, &diff, ×tamp); gst_base_transform_update_qos (trans, proportion, diff, timestamp); break; } diff --git a/tests/check/gst/gstevent.c b/tests/check/gst/gstevent.c index 015e8fc..33f019d 100644 --- a/tests/check/gst/gstevent.c +++ b/tests/check/gst/gstevent.c @@ -144,18 +144,18 @@ GST_START_TEST (create_events) GstClockTimeDiff ctd1 = G_GINT64_CONSTANT (10), ctd2; GstClockTime ct1 = G_GUINT64_CONSTANT (20), ct2; - event = gst_event_new_qos (p1, ctd1, ct1); + event = gst_event_new_qos (t1, p1, ctd1, ct1); fail_if (event == NULL); fail_unless (GST_EVENT_TYPE (event) == GST_EVENT_QOS); fail_unless (GST_EVENT_IS_UPSTREAM (event)); fail_if (GST_EVENT_IS_DOWNSTREAM (event)); fail_if (GST_EVENT_IS_SERIALIZED (event)); - gst_event_parse_qos (event, &p2, &ctd2, &ct2); + gst_event_parse_qos (event, &t2, &p2, &ctd2, &ct2); fail_unless (p1 == p2); fail_unless (ctd1 == ctd2); fail_unless (ct1 == ct2); - gst_event_parse_qos_full (event, &t2, &p2, &ctd2, &ct2); + gst_event_parse_qos (event, &t2, &p2, &ctd2, &ct2); fail_unless (t2 == GST_QOS_TYPE_UNDERFLOW); fail_unless (p1 == p2); fail_unless (ctd1 == ctd2); @@ -163,13 +163,13 @@ GST_START_TEST (create_events) gst_event_unref (event); ctd1 = G_GINT64_CONSTANT (-10); - event = gst_event_new_qos (p1, ctd1, ct1); - gst_event_parse_qos_full (event, &t2, &p2, &ctd2, &ct2); + event = gst_event_new_qos (t1, p1, ctd1, ct1); + gst_event_parse_qos (event, &t2, &p2, &ctd2, &ct2); fail_unless (t2 == GST_QOS_TYPE_OVERFLOW); gst_event_unref (event); - event = gst_event_new_qos_full (t1, p1, ctd1, ct1); - gst_event_parse_qos_full (event, &t2, &p2, &ctd2, &ct2); + event = gst_event_new_qos (t1, p1, ctd1, ct1); + gst_event_parse_qos (event, &t2, &p2, &ctd2, &ct2); fail_unless (t2 == GST_QOS_TYPE_THROTTLE); fail_unless (p1 == p2); fail_unless (ctd1 == ctd2); -- 2.7.4