mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
event: _qos_full -> _qos
This commit is contained in:
parent
c07b57fc05
commit
7f24a48387
6 changed files with 15 additions and 67 deletions
|
@ -786,33 +786,6 @@ gst_event_parse_buffer_size (GstEvent * event, GstFormat * format,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_event_new_qos:
|
* 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
|
* @type: the QoS type
|
||||||
* @proportion: the proportion of the qos message
|
* @proportion: the proportion of the qos message
|
||||||
* @diff: The time difference of the last Clock sync
|
* @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.
|
* event and implement custom application specific QoS handling.
|
||||||
*
|
*
|
||||||
* Returns: (transfer full): a new QOS event.
|
* Returns: (transfer full): a new QOS event.
|
||||||
*
|
|
||||||
* Since: 0.10.33
|
|
||||||
*/
|
*/
|
||||||
GstEvent *
|
GstEvent *
|
||||||
gst_event_new_qos_full (GstQOSType type, gdouble proportion,
|
gst_event_new_qos (GstQOSType type, gdouble proportion,
|
||||||
GstClockTimeDiff diff, GstClockTime timestamp)
|
GstClockTimeDiff diff, GstClockTime timestamp)
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
|
@ -893,35 +864,16 @@ gst_event_new_qos_full (GstQOSType type, gdouble proportion,
|
||||||
/**
|
/**
|
||||||
* gst_event_parse_qos:
|
* gst_event_parse_qos:
|
||||||
* @event: The event to query
|
* @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
|
* @type: (out): A pointer to store the QoS type in
|
||||||
* @proportion: (out): A pointer to store the proportion in
|
* @proportion: (out): A pointer to store the proportion in
|
||||||
* @diff: (out): A pointer to store the diff in
|
* @diff: (out): A pointer to store the diff in
|
||||||
* @timestamp: (out): A pointer to store the timestamp in
|
* @timestamp: (out): A pointer to store the timestamp in
|
||||||
*
|
*
|
||||||
* Get the type, proportion, diff and timestamp in the qos event. See
|
* 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.
|
* gst_event_new_qos() for more information about the different QoS values.
|
||||||
*
|
|
||||||
* Since: 0.10.33
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_event_parse_qos_full (GstEvent * event, GstQOSType * type,
|
gst_event_parse_qos (GstEvent * event, GstQOSType * type,
|
||||||
gdouble * proportion, GstClockTimeDiff * diff, GstClockTime * timestamp)
|
gdouble * proportion, GstClockTimeDiff * diff, GstClockTime * timestamp)
|
||||||
{
|
{
|
||||||
const GstStructure *structure;
|
const GstStructure *structure;
|
||||||
|
|
|
@ -486,13 +486,9 @@ void gst_event_parse_buffer_size (GstEvent *event, GstFormat *for
|
||||||
gint64 *maxsize, gboolean *async);
|
gint64 *maxsize, gboolean *async);
|
||||||
|
|
||||||
/* QOS events */
|
/* QOS events */
|
||||||
GstEvent* gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff,
|
GstEvent* gst_event_new_qos (GstQOSType type, gdouble proportion,
|
||||||
GstClockTime timestamp);
|
|
||||||
GstEvent* gst_event_new_qos_full (GstQOSType type, gdouble proportion,
|
|
||||||
GstClockTimeDiff diff, GstClockTime timestamp);
|
GstClockTimeDiff diff, GstClockTime timestamp);
|
||||||
void gst_event_parse_qos (GstEvent *event, gdouble *proportion, GstClockTimeDiff *diff,
|
void gst_event_parse_qos (GstEvent *event, GstQOSType *type,
|
||||||
GstClockTime *timestamp);
|
|
||||||
void gst_event_parse_qos_full (GstEvent *event, GstQOSType *type,
|
|
||||||
gdouble *proportion, GstClockTimeDiff *diff,
|
gdouble *proportion, GstClockTimeDiff *diff,
|
||||||
GstClockTime *timestamp);
|
GstClockTime *timestamp);
|
||||||
/* seek event */
|
/* seek event */
|
||||||
|
|
|
@ -2554,7 +2554,7 @@ gst_base_sink_send_qos (GstBaseSink * basesink, GstQOSType type,
|
||||||
"qos: type %d, proportion: %lf, diff %" G_GINT64_FORMAT ", timestamp %"
|
"qos: type %d, proportion: %lf, diff %" G_GINT64_FORMAT ", timestamp %"
|
||||||
GST_TIME_FORMAT, type, proportion, diff, GST_TIME_ARGS (time));
|
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 */
|
/* send upstream */
|
||||||
res = gst_pad_push_event (basesink->sinkpad, event);
|
res = gst_pad_push_event (basesink->sinkpad, event);
|
||||||
|
|
|
@ -1730,7 +1730,7 @@ gst_base_src_default_event (GstBaseSrc * src, GstEvent * event)
|
||||||
GstClockTimeDiff diff;
|
GstClockTimeDiff diff;
|
||||||
GstClockTime timestamp;
|
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);
|
gst_base_src_update_qos (src, proportion, diff, timestamp);
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1730,7 +1730,7 @@ gst_base_transform_src_eventfunc (GstBaseTransform * trans, GstEvent * event)
|
||||||
GstClockTimeDiff diff;
|
GstClockTimeDiff diff;
|
||||||
GstClockTime timestamp;
|
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);
|
gst_base_transform_update_qos (trans, proportion, diff, timestamp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,18 +144,18 @@ GST_START_TEST (create_events)
|
||||||
GstClockTimeDiff ctd1 = G_GINT64_CONSTANT (10), ctd2;
|
GstClockTimeDiff ctd1 = G_GINT64_CONSTANT (10), ctd2;
|
||||||
GstClockTime ct1 = G_GUINT64_CONSTANT (20), ct2;
|
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_if (event == NULL);
|
||||||
fail_unless (GST_EVENT_TYPE (event) == GST_EVENT_QOS);
|
fail_unless (GST_EVENT_TYPE (event) == GST_EVENT_QOS);
|
||||||
fail_unless (GST_EVENT_IS_UPSTREAM (event));
|
fail_unless (GST_EVENT_IS_UPSTREAM (event));
|
||||||
fail_if (GST_EVENT_IS_DOWNSTREAM (event));
|
fail_if (GST_EVENT_IS_DOWNSTREAM (event));
|
||||||
fail_if (GST_EVENT_IS_SERIALIZED (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 (p1 == p2);
|
||||||
fail_unless (ctd1 == ctd2);
|
fail_unless (ctd1 == ctd2);
|
||||||
fail_unless (ct1 == ct2);
|
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 (t2 == GST_QOS_TYPE_UNDERFLOW);
|
||||||
fail_unless (p1 == p2);
|
fail_unless (p1 == p2);
|
||||||
fail_unless (ctd1 == ctd2);
|
fail_unless (ctd1 == ctd2);
|
||||||
|
@ -163,13 +163,13 @@ GST_START_TEST (create_events)
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
|
|
||||||
ctd1 = G_GINT64_CONSTANT (-10);
|
ctd1 = G_GINT64_CONSTANT (-10);
|
||||||
event = gst_event_new_qos (p1, ctd1, ct1);
|
event = gst_event_new_qos (t1, p1, ctd1, ct1);
|
||||||
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_OVERFLOW);
|
fail_unless (t2 == GST_QOS_TYPE_OVERFLOW);
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
|
|
||||||
event = gst_event_new_qos_full (t1, p1, ctd1, ct1);
|
event = gst_event_new_qos (t1, p1, ctd1, ct1);
|
||||||
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_THROTTLE);
|
fail_unless (t2 == GST_QOS_TYPE_THROTTLE);
|
||||||
fail_unless (p1 == p2);
|
fail_unless (p1 == p2);
|
||||||
fail_unless (ctd1 == ctd2);
|
fail_unless (ctd1 == ctd2);
|
||||||
|
|
Loading…
Reference in a new issue