event: _qos_full -> _qos

This commit is contained in:
Wim Taymans 2011-05-09 18:48:55 +02:00
parent c07b57fc05
commit 7f24a48387
6 changed files with 15 additions and 67 deletions

View file

@ -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;

View file

@ -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 */

View file

@ -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);

View file

@ -1730,7 +1730,7 @@ gst_base_src_default_event (GstBaseSrc * src, GstEvent * event)
GstClockTimeDiff diff;
GstClockTime timestamp;
gst_event_parse_qos (event, &proportion, &diff, &timestamp);
gst_event_parse_qos (event, NULL, &proportion, &diff, &timestamp);
gst_base_src_update_qos (src, proportion, diff, timestamp);
result = TRUE;
break;

View file

@ -1730,7 +1730,7 @@ gst_base_transform_src_eventfunc (GstBaseTransform * trans, GstEvent * event)
GstClockTimeDiff diff;
GstClockTime timestamp;
gst_event_parse_qos (event, &proportion, &diff, &timestamp);
gst_event_parse_qos (event, NULL, &proportion, &diff, &timestamp);
gst_base_transform_update_qos (trans, proportion, diff, timestamp);
break;
}

View file

@ -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);