Skip to content

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

stats.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,32 @@ type InboundRTPStreamStats struct {
569569
PerDSCPPacketsReceived map[string]uint32 `json:"perDscpPacketsReceived"`
570570

571571
// Identifies the decoder implementation used. This is useful for diagnosing interoperability issues.
572+
// Does not exist for audio.
572573
DecoderImplementation string `json:"decoderImplementation"`
574+
575+
// PauseCount is the total number of video pauses experienced by this receiver.
576+
// Video is considered to be paused if time passed since last rendered frame exceeds 5 seconds.
577+
// PauseCount is incremented when a frame is rendered after such a pause. Does not exist for audio.
578+
PauseCount uint32 `json:"pauseCount"`
579+
580+
// TotalPausesDuration is the total duration of pauses (for definition of pause see PauseCount), in seconds.
581+
// Does not exist for audio.
582+
TotalPausesDuration float64 `json:"totalPausesDuration"`
583+
584+
// FreezeCount is the total number of video freezes experienced by this receiver.
585+
// It is a freeze if frame duration, which is time interval between two consecutively rendered frames,
586+
// is equal or exceeds Max(3 * avg_frame_duration_ms, avg_frame_duration_ms + 150),
587+
// where avg_frame_duration_ms is linear average of durations of last 30 rendered frames.
588+
// Does not exist for audio.
589+
FreezeCount uint32 `json:"freezeCount"`
590+
591+
// TotalFreezesDuration is the total duration of rendered frames which are considered as frozen
592+
// (for definition of freeze see freezeCount), in seconds. Does not exist for audio.
593+
TotalFreezesDuration float64 `json:"totalFreezesDuration"`
594+
595+
// PowerEfficientDecoder indicates whether the decoder currently used is considered power efficient
596+
// by the user agent. Does not exist for audio.
597+
PowerEfficientDecoder bool `json:"powerEfficientDecoder"`
573598
}
574599

575600
func (s InboundRTPStreamStats) statsMarker() {}
@@ -811,7 +836,15 @@ type OutboundRTPStreamStats struct {
811836
Active bool `json:"active"`
812837

813838
// Identifies the encoder implementation used. This is useful for diagnosing interoperability issues.
839+
// Does not exist for audio.
814840
EncoderImplementation string `json:"encoderImplementation"`
841+
842+
// PowerEfficientEncoder indicates whether the encoder currently used is considered power efficient.
843+
// by the user agent. Does not exist for audio.
844+
PowerEfficientEncoder bool `json:"powerEfficientEncoder"`
845+
846+
// ScalabilityMode identifies the layering mode used for video encoding. Does not exist for audio.
847+
ScalabilityMode string `json:"scalabilityMode"`
815848
}
816849

817850
func (s OutboundRTPStreamStats) statsMarker() {}

stats_go_test.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ func getStatsSamples() []statSample {
145145
"123": 23,
146146
},
147147
DecoderImplementation: "libvpx",
148+
PauseCount: 48,
149+
TotalPausesDuration: 48.123,
150+
FreezeCount: 49,
151+
TotalFreezesDuration: 49.321,
152+
PowerEfficientDecoder: true,
148153
}
149154
inboundRTPStreamStatsJSON := `
150155
{
@@ -212,7 +217,12 @@ func getStatsSamples() []statSample {
212217
"perDscpPacketsReceived": {
213218
"123": 23
214219
},
215-
"decoderImplementation": "libvpx"
220+
"decoderImplementation": "libvpx",
221+
"pauseCount": 48,
222+
"totalPausesDuration": 48.123,
223+
"freezeCount": 49,
224+
"totalFreezesDuration": 49.321,
225+
"powerEfficientDecoder": true
216226
}
217227
`
218228
outboundRTPStreamStats := OutboundRTPStreamStats{
@@ -268,6 +278,8 @@ func getStatsSamples() []statSample {
268278
},
269279
Active: true,
270280
EncoderImplementation: "libvpx",
281+
PowerEfficientEncoder: true,
282+
ScalabilityMode: "L1T1",
271283
}
272284
outboundRTPStreamStatsJSON := `
273285
{
@@ -322,7 +334,9 @@ func getStatsSamples() []statSample {
322334
"123": 23
323335
},
324336
"active": true,
325-
"encoderImplementation": "libvpx"
337+
"encoderImplementation": "libvpx",
338+
"powerEfficientEncoder": true,
339+
"scalabilityMode": "L1T1"
326340
}
327341
`
328342
remoteInboundRTPStreamStats := RemoteInboundRTPStreamStats{

0 commit comments

Comments
 (0)