/
webrtc-stats.html
2044 lines (2034 loc) · 78.6 KB
/
webrtc-stats.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="webrtc-stats.css" rel="stylesheet" type="text/css">
<title>
Identifiers for WebRTC's Statistics API
</title>
<script class="remove" src="https://www.w3.org/Tools/respec/respec-w3c-common">
//<![CDATA[
// keep this comment
//]]>
</script>
<script class="remove" src="webrtc-stats.js" type="text/javascript">
//<![CDATA[
// keep this comment
//]]>
</script>
</head>
<body>
<section id="abstract">
<p>
This document defines a set of Javascript APIs that allow access to the statistical
information about a PeerConnection.
</p>
</section>
<section id="sotd">
<!-- Status of the draft -->
<p>
This document is incomplete, and as such is not yet suitable for implementation. However,
early experimentation is encouraged.
</p>
</section><!-- NB: [[!..]] normative refs, [[..]] informative refs-->
<!-- based on the wiki page https://www.w3.org/2011/04/webrtc/wiki/Stats -->
<section class="informative">
<h2>
Introduction
</h2>
<p>
Audio, video, or data packets transmitted over a peer-connection can be lost, and
experience varying amounts of network delay. A web application implementing WebRTC expects
to monitor the performance of the underlying network and media pipeline.
</p>
<p>
This document defines the APIs and statistic identifiers used by the web application to
extract metrics from the user agent.
</p>
</section>
<section id="conformance">
<p>
This specification defines the conformance criteria that applies to a single product: the
<em>user agent</em>.
</p>
<p>
Implementations that use ECMAScript to implement the APIs and objects defined in this specification
<em class="rfc2119" title="MUST">MUST</em> implement them in a manner consistent with the
ECMAScript Bindings defined in the Web IDL specification [[WEBIDL]], as this document uses
that specification and terminology.
</p>
<p>
This specification does not define what objects a conforming
implementation should generate.
Specifications that refer to this specification have the need to
specify conformance. They should put in their document text
like this:
</p>
<ul>
<li>An implementation MUST support generating statistics for the type
RTCInboundRTPStreamStats, with attributes packetsReceived,
bytesReceived, packetsLost, jitter, and fractionLost.</li>
<li>
It MUST support generating statistics for the type
RTCOutboundRTPStreamStats, with attributes packetsSent,
bytesSent.</li>
<li>For all subclasses of RTCRtpStreamStats, it MUST include ssrc,
associateStatsId, isRemote, mediaType.</li>
<li>It MAY support generating other stats.</li>
</ul>
</section>
<section>
<h2>
Terminology
</h2>
<p>
The <code><a href=
"https://www.w3.org/TR/2014/REC-html5-20141028/webappapis.html#eventhandler">EventHandler</a></code>
represents a callback used for event handlers as defined in [[!HTML5]].
</p>
<p>
The concepts <dfn><a href="https://www.w3.org/TR/2014/REC-html5-20141028/webappapis.html#queue-a-task">queue
a task</a></dfn>, and <dfn><a href=
"https://www.w3.org/TR/2014/REC-html5-20141028/webappapis.html#fire-a-simple-event">fires a simple
event</a></dfn> are defined in [[!HTML5]].
</p>
<p>
The terms <dfn>event</dfn>, <dfn><a href=
"https://www.w3.org/TR/2014/REC-html5-20141028/webappapis.html#event-handlers">event handlers</a></dfn>, and
<dfn><a href="https://www.w3.org/TR/2014/REC-html5-20141028/webappapis.html#event-handler-event-type">event
handler event types</a></dfn> are defined in [[!HTML5]].
</p>
<p>
The terms <dfn>MediaStream</dfn>, <dfn>MediaStreamTrack</dfn>, and <dfn>Consumer</dfn> are
defined in [[!GETUSERMEDIA]].
</p>
<p>
The terms <dfn>RTCPeerConnection</dfn>, <dfn>RTCDataChannel</dfn>,
<dfn>RTCDtlsTransport</dfn> and <dfn>RTCIceTransport</dfn> are defined
in [[!WEBRTC]].
</p>
<p>
The term <dfn>RTP stream</dfn> is defined in [[RFC7656]] section 2.1.10.
</p>
</section>
<section class="informative">
<h2>Basic concepts</h2>
<p>The stats API is defined in [[!WEBRTC]]. It is defined to return
a set of objects that are a subclass of the RTCStats dictionary. This is
normatively defined in [[!WEBRTC]], but is reproduced here
for ease of reference.
</p>
<pre class="idl">
dictionary RTCStats {
DOMHighResTimeStamp timestamp;
RTCStatsType type;
DOMString id;
};
</pre>
<section>
<h3>Guidelines for design of stats objects</h3>
<p>
When introducing a new stats type, the following principles
should be followed:
</p>
<ul>
<li>An RTCStats object should correspond to an object
defined in the specification it supports.
</li>
<li>All members of the new object need to have definitions
that make them consistently implementable. References to
other specifications are a good way of doing this.
</li>
<li>All members need to have defined behavior for what
happens before the thing it counts happens, or when the
information it's supposed to show is not
available. Usually, this will be "start at zero" or "do
not populate the value".
</li>
</ul>
<p>
The new members of the stats dictionary need to be named
according to standard practice (camelCase).
</p>
<p>
Names ending in
"Id" (such as "datachannelId") are always of type DOMString
and are used to refer to other
stats objects by the value of their "id" field; names ending
in "Ids" (such as "trackIds")
are always of type sequence<DOMString>, and are used to
refer to a list of other stats objects.
</p>
</section>
<section>
<h3>Guidelines for implementing stats objects</h3>
<p>
When implementing stats objects, the following guidelines
should be adhered to:
</p>
<ul>
<li>When a feature is not implemented on the platform,
omit the dictionary member that is tracking usage of the
feature.</li>
<li>When a feature is not applicable to an instance of an
object (for example audioLevel on a video stream), omit
the dictionary member. Do NOT report a count of zero,
-1 or "empty string".</li>
<li>When a counted feature hasn't been used yet, but may happen in
the future, report a count of zero.
</li>
</ul>
</section>
<section>
<h3>Lifetime of stats objects</h3>
<p>The general rule is that stats objects, once created, exist
for the lifetime of the PeerConnection that contains
them, even when the underlying object they report on is
stopped or deleted. This is important in order to report
consistently on short-lived objects and to be able to report
totals over the lifetime of a PeerConnection.</p>
<p>When an object is closed or deleted,
the <code>timestamp</code> member of the stats object stops
updating; it is frozen at the time when the object stopped.
</p>
</section>
</section>
<section id="rtctatstype-*">
<h2>
RTCStatsType
</h2>
<p>The <code>type</code> element, of type <a>RTCStatsType</a>,
indicates the type of the object that the
<code>RTCStats</code> object represents. An object with a given "type"
can have only one IDL dictionary type, but multiple "type" values may
indicate the same IDL dictionary type; for example, "local-candidate"
and "remote-candidate" both use the IDL dictionary type
<a>RTCIceCandidateStats</a>.</p>
<p>This specification is normative for the allowed values of <dfn>RTCStatsType</dfn>.</p>
<section id="rtcstatstype-str*">
<pre class="idl">
enum RTCStatsType {
"codec",
"inbound-rtp",
"outbound-rtp",
"peer-connection",
"data-channel",
"track",
"transport",
"candidate-pair",
"local-candidate",
"remote-candidate",
"certificate"
};
</pre>
<p>
The following strings are valid values for <var>RTCStatsType</var>:
</p>
<dl data-link-for="RTCStatsType" data-dfn-for="RTCStatsType">
<dt>
<dfn><code>codec</code></dfn>
</dt>
<dd>
<p>
Statistics for a codec that is currently being used by RTP streams being sent or
received by this <code>RTCPeerConnection</code> object. It is accessed by the
<code><a>RTCCodecStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>inbound-rtp</code></dfn>
</dt>
<dd>
<p>
Statistics for an inbound RTP stream that is currently received with this
<code>RTCPeerConnection</code> object. It is accessed by the
<code><a>RTCInboundRTPStreamStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>outbound-rtp</code></dfn>
</dt>
<dd>
<p>
Statistics for an outbound RTP stream that is currently sent with this
<code>RTCPeerConnection</code> object. It is accessed by the
<code><a>RTCOutboundRTPStreamStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>peer-connection</code></dfn>
</dt>
<dd>
<p>
Statistics related to the <code>RTCPeerConnection</code> object.
It is accessed by the <code><a>RTCPeerConnectionStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>data-channel</code></dfn>
</dt>
<dd>
<p>
Statistics related to each <code>RTCDataChannel</code> id.
It is accessed by the <code><a>RTCDataChannelStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>track</code></dfn>
</dt>
<dd>
<p>
Contains statistics related to a specific MediaStreamTrack and the
corresponding media-level metrics. It is accessed by the <code><a>RTCMediaStreamStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>transport</code></dfn>
</dt>
<dd>
<p>
Transport statistics related to the <code>RTCPeerConnection</code> object.
It is accessed by the <code><a>RTCTransportStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>candidate-pair</code></dfn>
</dt>
<dd>
<p>
ICE candidate pair statistics related to the <code>RTCIceTransport</code> objects.
It is accessed by the <code><a>RTCIceCandidatePairStats</a></code>.
</p>
</dd>
<dt>
<dfn><code>local-candidate</code></dfn>
</dt>
<dd>
<p>
ICE local candidate statistics related to the <code>RTCIceTransport</code> objects.
It is accessed by the <code><a>RTCIceCandidateStats</a></code> for the local candidate.
</p>
</dd>
<dt>
<dfn><code>remote-candidate</code></dfn>
</dt>
<dd>
<p>
ICE remote candidate statistics related to the <code>RTCIceTransport</code> objects.
It is accessed by the <code><a>RTCIceCandidateStats</a></code> for the remote candidate.
</p>
</dd>
<dt>
<dfn><code>certificate</code></dfn>
</dt>
<dd>
<p>
Information about a certificate used by an RTCIceTransport.
</p>
</dd>
</dl>
</section>
</section>
<section>
<h2>Stats dictionaries</h2>
<section id="streamstats-dict*">
<h3>
<dfn>RTCRTPStreamStats</dfn> dictionary
</h3>
<div>
<pre class="idl">dictionary RTCRTPStreamStats : RTCStats {
DOMString ssrc;
DOMString associateStatsId;
boolean isRemote = false;
DOMString mediaType;
DOMString mediaTrackId;
DOMString transportId;
DOMString codecId;
unsigned long firCount;
unsigned long pliCount;
unsigned long nackCount;
unsigned long sliCount;
unsigned long long qpSum;
};</pre>
<section>
<h2>
Dictionary <a class="idlType">RTCRTPStreamStats</a> Members
</h2>
<dl data-link-for="RTCRTPStreamStats" data-dfn-for="RTCRTPStreamStats" class=
"dictionary-members">
<dt>
<dfn><code>ssrc</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd></dd>
<dt>
<dfn><code>associateStatsId</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
The <code>associateStatsId</code> is used for looking up the corresponding
(local/remote) <code><a>RTCStats</a></code> object for a given SSRC.
</p>
</dd>
<dt>
<dfn><code>isRemote</code></dfn> of type <span class=
"idlMemberType"><a>boolean</a></span>, defaulting to <code>false</code>
</dt>
<dd>
<p>
<code>false</code> indicates that the statistics are measured locally, while
<code>true</code> indicates that the measurements were done at the remote
endpoint and reported in an RTCP RR/XR.
</p>
</dd>
<dt>
<dfn><code>mediaType</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
Either "<code>audio</code>" or "<code>video</code>". This MUST match the media
type part of the information in the corresponding <code><a>codec</a></code>
member of <code>RTCCodecStats</code>.
</p>
</dd>
<dt>
<dfn><code>mediaTrackId</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd></dd>
<dt>
<dfn><code>transportId</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
It is a unique identifier that is associated to the object that was inspected to
produce the <code>RTCTransportStats</code> associated with this RTP stream.
</p>
</dd>
<dt>
<dfn><code>codecId</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
It is a unique identifier that is associated to the object that was inspected to
produce the <code>RTCCodecStats</code> associated with this RTP stream.
</p>
</dd>
<dt>
<dfn><code>firCount</code></dfn> of type <span class="idlMemberType"><a>unsigned
long</a></span>
</dt>
<dd>
<p>
Count the total number of Full Intra Request (FIR) packets received by the
sender. This metric is only valid for video and is sent by receiver. Calculated
as defined in [[!RFC5104]] section 4.3.1. and does not use the metric indicated
in [[RFC2032]], because it was deprecated by [[RFC4587]].
</p>
</dd>
<dt>
<dfn><code>pliCount</code></dfn> of type <span class="idlMemberType"><a>unsigned
long</a></span>
</dt>
<dd>
<p>
Count the total number of Packet Loss Indication (PLI) packets received by the
sender. This metric is only valid for video and is sent by receiver. Calculated as
defined in [[!RFC4585]] section 6.3.1.
</p>
</dd>
<dt>
<dfn><code>nackCount</code></dfn> of type <span class="idlMemberType"><a>unsigned
long</a></span>
</dt>
<dd>
<p>
Count the total number of Negative ACKnowledgement (NACK) packets received by the
sender and is sent by receiver. Calculated as defined in [[!RFC4585]] section
6.2.1.
</p>
</dd>
<dt>
<dfn><code>sliCount</code></dfn> of type <span class="idlMemberType"><a>unsigned
long</a></span>
</dt>
<dd>
<p>
Count the total number of Slice Loss Indication (SLI) packets received by the
sender. This metric is only valid for video and is sent by receiver. Calculated
as defined in [[!RFC4585]] section 6.3.2.
</p>
</dd>
<dt><dfn><code>qpSum</code></dfn> of type
<span class="idlMemberType"><a>unsigned long long</a></span>
</dt>
<dd>
<p>
The sum of the QP values of frames passed. The count
of frames is in <a>framesDecoded</a> for inbound
stream stats, and in <a>framesEncoded</a> for
outbound stream stats.
</p>
<p>
The definition of QP value depends on
the <a>codec</a>; for VP8, the QP value is the value carried
in the frame header as the syntax element "y_ac_qi", and
defined in [[RFC6386]] section 19.2. Its range is 0..127.
<!-- Need appropriate references for VP9 and H.264 -->
</p>
<p>
Note that the QP value is only
an indication of quantizer values used; many formats have
ways to vary the quantizer value within the frame.
</p>
<p>Only valid for video.</p>
</dd>
</dl>
</section>
</div>
</section>
<section id="codec-dict*">
<h3>
<dfn>RTCCodecStats</dfn> dictionary
</h3>
<div>
<pre class="idl">dictionary RTCCodecStats : RTCStats {
unsigned long payloadType;
DOMString codec;
unsigned long clockRate;
unsigned long channels;
DOMString parameters;
DOMString implementation;
};</pre>
<section>
<h2>
Dictionary <a class="idlType">RTCCodecStats</a> Members
</h2>
<dl data-link-for="RTCCodecStats" data-dfn-for="RTCCodecStats" class="dictionary-members">
<dt>
<dfn><code>payloadType</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
Payload type as used in RTP encoding.
</p>
</dd>
<dt>
<dfn><code>codec</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
e.g., video/vp8 or equivalent.
</p>
</dd>
<dt>
<dfn><code>clockRate</code></dfn> of type <span class="idlMemberType"><a>unsigned
long</a></span>
</dt>
<dd>
<p>
Represents the media sampling rate.
</p>
</dd>
<dt>
<dfn><code>channels</code></dfn> of type <span class="idlMemberType"><a>unsigned
long</a></span>
</dt>
<dd>
<p>
Use 2 for stereo, missing for most other cases.
</p>
</dd>
<dt>
<dfn><code>parameters</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
From the SDP description line.
</p>
</dd>
<dt>
<dfn><code>implementation</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
Identifies the implementation used. This is useful for diagnosing
interoperability issues.
</p>
<p class="fingerprint">
If too much information is given here, it increases the fingerprint surface.
Since it is only given for active tracks, the incremental exposure is small.
</p>
</dd>
</dl>
</section>
</div>
</section>
<section id="inboundrtpstats-dict*">
<h3>
RTCInboundRTPStreamStats dictionary
</h3>
<p>
The <dfn>RTCInboundRTPStreamStats</dfn> dictionary
represents the measurement metrics for
the incoming RTP media stream.
</p>
<div>
<pre class="idl">dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
unsigned long packetsReceived;
unsigned long long bytesReceived;
unsigned long packetsLost;
double jitter;
double fractionLost;
unsigned long packetsDiscarded;
unsigned long packetsRepaired;
unsigned long burstPacketsLost;
unsigned long burstPacketsDiscarded;
unsigned long burstLossCount;
unsigned long burstDiscardCount;
double burstLossRate;
double burstDiscardRate;
double gapLossRate;
double gapDiscardRate;
unsigned long framesDecoded;
};</pre>
<section>
<h2>
Dictionary <a class="idlType">RTCInboundRTPStreamStats</a> Members
</h2>
<dl data-link-for="RTCInboundRTPStreamStats" data-dfn-for="RTCInboundRTPStreamStats"
class="dictionary-members">
<dt>
<dfn><code>packetsReceived</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
Total number of RTP packets received for this SSRC. Calculated as defined in
[[!RFC3550]] section 6.4.1.
</p>
</dd>
<dt>
<dfn><code>bytesReceived</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long long</a></span>
</dt>
<dd>
<p>
Total number of bytes received for this SSRC. Calculated as defined in
[[!RFC3550]] section 6.4.1.
</p>
</dd>
<dt>
<dfn><code>packetsLost</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
Total number of RTP packets lost for this SSRC. Calculated as defined in
[[!RFC3550]] section 6.4.1.
</p>
</dd>
<dt>
<dfn><code>jitter</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
Packet Jitter measured in seconds for this SSRC. Calculated as defined in
section 6.4.1. of [[!RFC3550]].
</p>
</dd>
<dt>
<dfn><code>fractionLost</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
The fraction packet loss reported for this SSRC. Calculated as defined in
[[!RFC3550]] section 6.4.1 and Appendix A.3.
</p>
</dd>
<dt>
<dfn><code>packetsDiscarded</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
The cumulative number of RTP packets discarded by the jitter buffer
due to late or early-arrival, i.e., these packets are not played out.
RTP packets discarded due to packet duplication are not reported in
this metric [[XRBLOCK-STATS]]. Calculated as defined in
[[!RFC7002]] section 3.2 and Appendix A.a.
</p>
</dd>
<dt>
<dfn><code>packetsRepaired</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
The cumulative number of lost RTP packets repaired after applying an
error-resilience mechanism [[XRBLOCK-STATS]]. It is measured for the
primary source RTP packets and only counted for RTP packets that have
no further chance of repair. To clarify, the value is upper-bound to
the cumulative number of lost packets. Calculated as defined in
[[!RFC7509]] section 3.1 and Appendix A.b.
</p>
</dd>
<dt>
<dfn><code>burstPacketsLost</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
The cumulative number of RTP packets lost during loss
bursts, Appendix A (c) of [[!RFC6958]].
</p>
</dd>
<dt>
<dfn><code>burstPacketsDiscarded</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
The cumulative number of RTP packets discarded during
discard bursts, Appendix A (b) of [[!RFC7003]].
</p>
</dd>
<dt>
<dfn><code>burstLossCount</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
The cumulative number of bursts of lost RTP packets,
Appendix A (e) of [[!RFC6958]].
</p>
<p>[[!RFC3611]] recommends a Gmin (threshold) value of
16 for classifying a sequence of packet losses or discards as a burst.
</p>
</dd>
<dt>
<dfn><code>burstDiscardCount</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
The cumulative number of bursts of discarded RTP packets,
Appendix A (e) of [[!burst-gap-discard]].
</p>
</dd>
<dt>
<dfn><code>burstLossRate</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
The fraction of RTP packets lost during bursts to the total
number of RTP packets expected in the bursts. As defined in
Appendix A (a) of [[!RFC7004]], however, the actual value is
reported without multiplying by 32768.
</p>
</dd>
<dt>
<dfn><code>burstDiscardRate</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
The fraction of RTP packets discarded during bursts to the total
number of RTP packets expected in bursts. As defined in
Appendix A (e) of [[!RFC7004]], however, the actual value is
reported without multiplying by 32768.
</p>
</dd>
<dt>
<dfn><code>gapLossRate</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
The fraction of RTP packets lost during the gap periods.
Appendix A (b) of [[!RFC7004]], however, the actual value is
reported without multiplying by 32768.
</p>
</dd>
<dt>
<dfn><code>gapDiscardRate</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
The fraction of RTP packets discarded during the gap periods.
Appendix A (f) of [[!RFC7004]], however, the actual value is
reported without multiplying by 32768.
</p>
</dd>
<dt>
<dfn><code>framesDecoded</code></dfn>
</dt>
<dd>
<p>
Only valid for video. It represents the total number of frames correctly
decoded for this SSRC. Same definition as <code>totalVideoFrames</code> in
Section 5 of [[!MEDIA-SOURCE]].
</p>
</dl>
</section>
</div>
</section>
<section id="outboundrtpstats-dict*">
<h3>
RTCOutboundRTPStreamStats dictionary
</h3>
<p>
<dfn>RTCOutboundRTPStreamStats</dfn> dictionary represents the measurement metrics for
the outgoing RTP stream.
</p>
<div>
<pre class="idl">dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats {
unsigned long packetsSent;
unsigned long long bytesSent;
double targetBitrate;
double roundTripTime;
unsigned long framesEncoded;
};</pre>
<section>
<h2>
Dictionary <a class="idlType">RTCOutboundRTPStreamStats</a> Members
</h2>
<dl data-link-for="RTCOutboundRTPStreamStats" data-dfn-for=
"RTCOutboundRTPStreamStats" class="dictionary-members">
<dt>
<dfn><code>packetsSent</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
Total number of RTP packets sent for this SSRC. Calculated as defined in
[[!RFC3550]] section 6.4.1.
</p>
</dd>
<dt>
<dfn><code>bytesSent</code></dfn> of type <span class="idlMemberType"><a>unsigned
long long</a></span>
</dt>
<dd>
<p>
Total number of bytes sent for this SSRC. Calculated as defined in [[!RFC3550]]
section 6.4.1.
</p>
</dd>
<dt>
<dfn><code>targetBitrate</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
It is the current target bitrate configured for this particular SSRC and
is the Transport Independent Application Specific (TIAS) bitrate [[!RFC3890]].
Typically, the target bitrate is a configuration parameter provided to the
codec's encoder and does not count the size of the IP or other transport
layers like TCP or UDP. It is measured in bits per second and the bitrate
is calculated over a 1 second window.
</p>
</dd>
<dt>
<dfn><code>roundTripTime</code></dfn> of type <span class=
"idlMemberType"><a>double</a></span>
</dt>
<dd>
<p>
Estimated round trip time for this SSRC based on the RTCP timestamps
in the RTCP Receiver Report (RR) and measured in seconds. Calculated
as defined in section 6.4.1. of [[!RFC3550]].
</p>
</dd>
<dt>
<dfn><code>framesEncoded</code></dfn> of type <span class=
"idlMemberType"><a>long</a></span>
</dt>
<dd>
<p>
Only valid for video. It represents the total
number of frames successfully encoded for this RTP
media stream.
</p>
</dl>
</section>
</div>
</section>
<section id="pcstats-dict*">
<h3>
<dfn>RTCPeerConnectionStats</dfn> dictionary
</h3>
<div>
<pre class="idl">dictionary RTCPeerConnectionStats : RTCStats {
unsigned long dataChannelsOpened;
unsigned long dataChannelsClosed;
};</pre>
<section>
<h2>
Dictionary <a class="idlType">RTCPeerConnectionStats</a> Members
</h2>
<dl data-link-for="RTCPeerConnectionStats" data-dfn-for="RTCPeerConnectionStats" class=
"dictionary-members">
<dt>
<dfn><code>dataChannelsOpened</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
Represents the number of unique datachannels opened.
</p>
</dd>
<dt>
<dfn><code>dataChannelsClosed</code></dfn> of type <span class=
"idlMemberType"><a>unsigned long</a></span>
</dt>
<dd>
<p>
Represents the number of unique datachannels closed.
</p>
</dd>
</dl>
</section>
</div>
</section>
<section id="msstats-dict*">
<h3>
<dfn>RTCMediaStreamStats</dfn> dictionary
</h3>
<div>
<pre class="idl">dictionary RTCMediaStreamStats : RTCStats {
DOMString streamIdentifier;
sequence<DOMString> trackIds;
};</pre>
<section>
<h2>
Dictionary <a class="idlType">RTCMediaStreamStats</a> Members
</h2>
<dl data-link-for="RTCMediaStreamStats" data-dfn-for="RTCMediaStreamStats" class=
"dictionary-members">
<dt>
<dfn><code>streamIdentifier</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
<code>stream.id</code> property
</p>
</dd>
<dt>
<dfn><code>trackIds</code></dfn> of type <span class=
"idlMemberType">sequence<<a>DOMString</a>></span>
</dt>
<dd>
<p>
This is the id of the stats object, not the <code>track.id</code>.
</p>
</dd>
</dl>
</section>
</div>
</section>
<section id="mststats-dict*">
<h3>
<dfn>RTCMediaStreamTrackStats</dfn> dictionary
</h3>
<p>
An RTCMediaStreamTrackStats object represents the stats about a MediaStreamTrack's
connection to the PeerConnection object for which one calls getStats.
</p>
<p>
It appears in the stats as soon as it is attached (via addTrack, via addTransceiver,
via ReplaceTrack on an RTPSender object, or via being created on an RTPReceiver
object). If it is detached (via removeTrack or via replaceTrack), it continues to
appear, but with the "detached" member set to True.
</p>
<div>
<pre class="idl">dictionary RTCMediaStreamTrackStats : RTCStats {
DOMString trackIdentifier;
boolean remoteSource;
boolean ended;
boolean detached;
sequence<DOMString> ssrcIds;
unsigned long frameWidth;
unsigned long frameHeight;
double framesPerSecond;
unsigned long framesSent;
unsigned long framesReceived;
unsigned long framesDecoded;
unsigned long framesDropped;
unsigned long framesCorrupted;
unsigned long partialFramesLost;
unsigned long fullFramesLost;
double audioLevel;
double echoReturnLoss;
double echoReturnLossEnhancement;
};</pre>
<section>
<h2>
Dictionary <a class="idlType">RTCMediaStreamTrackStats</a> Members
</h2>
<dl data-link-for="RTCMediaStreamTrackStats" data-dfn-for="RTCMediaStreamTrackStats"
class="dictionary-members">
<dt>
<dfn><code>trackIdentifier</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
</dt>
<dd>
<p>
Represents the <code>track.id</code> property.
</p>
</dd>
<dt>
<dfn><code>remoteSource</code></dfn> of type <span class=
"idlMemberType"><a>boolean</a></span>
</dt>
<dd></dd>
<dt>