mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
webrtcstats: Unify 'packets-lost' data type to int64
Previously, 'packets-lost' member of RTCReceivedRtpStreamStats had a value of G_TYPE_INT from rtpsource or a value of G_TYPE_UINT64 from rtpjitterbuffer. Because of the negative value of estimated amount of packets lost in rtpsource as well as the description in https://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats it is fixed to set this value with G_TYPE_INT64. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2049>
This commit is contained in:
parent
368f7b2cf2
commit
a801d6dd63
3 changed files with 13 additions and 10 deletions
|
@ -8316,7 +8316,7 @@ gst_webrtc_bin_class_init (GstWebRTCBinClass * klass)
|
||||||
* RTCReceivedStreamStats supported fields (https://w3c.github.io/webrtc-stats/#receivedrtpstats-dict*)
|
* RTCReceivedStreamStats supported fields (https://w3c.github.io/webrtc-stats/#receivedrtpstats-dict*)
|
||||||
*
|
*
|
||||||
* "packets-received" G_TYPE_UINT64 number of packets received (only for local inbound)
|
* "packets-received" G_TYPE_UINT64 number of packets received (only for local inbound)
|
||||||
* "packets-lost" G_TYPE_UINT64 number of packets lost
|
* "packets-lost" G_TYPE_INT64 number of packets lost
|
||||||
* "packets-discarded" G_TYPE_UINT64 number of packets discarded
|
* "packets-discarded" G_TYPE_UINT64 number of packets discarded
|
||||||
* "packets-repaired" G_TYPE_UINT64 number of packets repaired
|
* "packets-repaired" G_TYPE_UINT64 number of packets repaired
|
||||||
* "jitter" G_TYPE_DOUBLE packet jitter measured in seconds
|
* "jitter" G_TYPE_DOUBLE packet jitter measured in seconds
|
||||||
|
|
|
@ -142,7 +142,7 @@ _get_stats_from_remote_rtp_source_stats (GstWebRTCBin * webrtc,
|
||||||
/* RTCReceivedRtpStreamStats */
|
/* RTCReceivedRtpStreamStats */
|
||||||
|
|
||||||
if (gst_structure_get_int (source_stats, "rb-packetslost", &lost))
|
if (gst_structure_get_int (source_stats, "rb-packetslost", &lost))
|
||||||
gst_structure_set (r_in, "packets-lost", G_TYPE_INT, lost, NULL);
|
gst_structure_set (r_in, "packets-lost", G_TYPE_INT64, (gint64) lost, NULL);
|
||||||
|
|
||||||
if (clock_rate && gst_structure_get_uint (source_stats, "rb-jitter", &jitter))
|
if (clock_rate && gst_structure_get_uint (source_stats, "rb-jitter", &jitter))
|
||||||
gst_structure_set (r_in, "jitter", G_TYPE_DOUBLE,
|
gst_structure_set (r_in, "jitter", G_TYPE_DOUBLE,
|
||||||
|
@ -359,8 +359,11 @@ _get_stats_from_rtp_source_stats (GstWebRTCBin * webrtc,
|
||||||
|
|
||||||
if (gst_structure_get_uint64 (source_stats, "packets-received", &packets))
|
if (gst_structure_get_uint64 (source_stats, "packets-received", &packets))
|
||||||
gst_structure_set (in, "packets-received", G_TYPE_UINT64, packets, NULL);
|
gst_structure_set (in, "packets-received", G_TYPE_UINT64, packets, NULL);
|
||||||
if (jb_stats)
|
if (jb_stats) {
|
||||||
gst_structure_set (in, "packets-lost", G_TYPE_UINT64, jb_lost, NULL);
|
gint64 packets_lost = jb_lost > G_MAXINT64 ?
|
||||||
|
G_MAXINT64 : (gint64) jb_lost;
|
||||||
|
gst_structure_set (in, "packets-lost", G_TYPE_INT64, packets_lost, NULL);
|
||||||
|
}
|
||||||
if (gst_structure_get_uint (source_stats, "jitter", &jitter))
|
if (gst_structure_get_uint (source_stats, "jitter", &jitter))
|
||||||
gst_structure_set (in, "jitter", G_TYPE_DOUBLE,
|
gst_structure_set (in, "jitter", G_TYPE_DOUBLE,
|
||||||
CLOCK_RATE_VALUE_TO_SECONDS (jitter, clock_rate), NULL);
|
CLOCK_RATE_VALUE_TO_SECONDS (jitter, clock_rate), NULL);
|
||||||
|
|
|
@ -1453,7 +1453,7 @@ static void
|
||||||
validate_inbound_rtp_stats (const GstStructure * s, const GstStructure * stats)
|
validate_inbound_rtp_stats (const GstStructure * s, const GstStructure * stats)
|
||||||
{
|
{
|
||||||
guint ssrc, fir, pli, nack;
|
guint ssrc, fir, pli, nack;
|
||||||
gint packets_lost;
|
gint64 packets_lost;
|
||||||
guint64 packets_received, bytes_received;
|
guint64 packets_received, bytes_received;
|
||||||
double jitter;
|
double jitter;
|
||||||
gchar *remote_id;
|
gchar *remote_id;
|
||||||
|
@ -1470,8 +1470,8 @@ validate_inbound_rtp_stats (const GstStructure * s, const GstStructure * stats)
|
||||||
fail_unless (gst_structure_get (s, "bytes-received", G_TYPE_UINT64,
|
fail_unless (gst_structure_get (s, "bytes-received", G_TYPE_UINT64,
|
||||||
&bytes_received, NULL));
|
&bytes_received, NULL));
|
||||||
fail_unless (gst_structure_get (s, "jitter", G_TYPE_DOUBLE, &jitter, NULL));
|
fail_unless (gst_structure_get (s, "jitter", G_TYPE_DOUBLE, &jitter, NULL));
|
||||||
fail_unless (gst_structure_get (s, "packets-lost", G_TYPE_INT, &packets_lost,
|
fail_unless (gst_structure_get (s, "packets-lost", G_TYPE_INT64,
|
||||||
NULL));
|
&packets_lost, NULL));
|
||||||
fail_unless (gst_structure_get (s, "remote-id", G_TYPE_STRING, &remote_id,
|
fail_unless (gst_structure_get (s, "remote-id", G_TYPE_STRING, &remote_id,
|
||||||
NULL));
|
NULL));
|
||||||
fail_unless (gst_structure_get (stats, remote_id, GST_TYPE_STRUCTURE, &remote,
|
fail_unless (gst_structure_get (stats, remote_id, GST_TYPE_STRUCTURE, &remote,
|
||||||
|
@ -1487,7 +1487,7 @@ validate_remote_inbound_rtp_stats (const GstStructure * s,
|
||||||
const GstStructure * stats)
|
const GstStructure * stats)
|
||||||
{
|
{
|
||||||
guint ssrc;
|
guint ssrc;
|
||||||
gint packets_lost;
|
gint64 packets_lost;
|
||||||
double jitter, rtt;
|
double jitter, rtt;
|
||||||
gchar *local_id;
|
gchar *local_id;
|
||||||
GstStructure *local;
|
GstStructure *local;
|
||||||
|
@ -1496,8 +1496,8 @@ validate_remote_inbound_rtp_stats (const GstStructure * s,
|
||||||
|
|
||||||
fail_unless (gst_structure_get (s, "ssrc", G_TYPE_UINT, &ssrc, NULL));
|
fail_unless (gst_structure_get (s, "ssrc", G_TYPE_UINT, &ssrc, NULL));
|
||||||
fail_unless (gst_structure_get (s, "jitter", G_TYPE_DOUBLE, &jitter, NULL));
|
fail_unless (gst_structure_get (s, "jitter", G_TYPE_DOUBLE, &jitter, NULL));
|
||||||
fail_unless (gst_structure_get (s, "packets-lost", G_TYPE_INT, &packets_lost,
|
fail_unless (gst_structure_get (s, "packets-lost", G_TYPE_INT64,
|
||||||
NULL));
|
&packets_lost, NULL));
|
||||||
fail_unless (gst_structure_get (s, "round-trip-time", G_TYPE_DOUBLE, &rtt,
|
fail_unless (gst_structure_get (s, "round-trip-time", G_TYPE_DOUBLE, &rtt,
|
||||||
NULL));
|
NULL));
|
||||||
fail_unless (gst_structure_get (s, "local-id", G_TYPE_STRING, &local_id,
|
fail_unless (gst_structure_get (s, "local-id", G_TYPE_STRING, &local_id,
|
||||||
|
|
Loading…
Reference in a new issue