Skip to content

Commit 80b5649

Browse files
aalekseevxSean-Der
authored andcommitted
Add Encoder/Decoder info to stats
1 parent 3f246fd commit 80b5649

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

stats.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ type InboundRTPStreamStats struct {
567567
// these numbers are not expected to match the numbers seen on sending. Not all
568568
// OSes make this information available.
569569
PerDSCPPacketsReceived map[string]uint32 `json:"perDscpPacketsReceived"`
570+
571+
// Identifies the decoder implementation used. This is useful for diagnosing interoperability issues.
572+
DecoderImplementation string `json:"decoderImplementation"`
570573
}
571574

572575
func (s InboundRTPStreamStats) statsMarker() {}
@@ -806,6 +809,9 @@ type OutboundRTPStreamStats struct {
806809
// Active indicates whether this RTP stream is configured to be sent or disabled. Note that an
807810
// active stream can still not be sending, e.g. when being limited by network conditions.
808811
Active bool `json:"active"`
812+
813+
// Identifies the encoder implementation used. This is useful for diagnosing interoperability issues.
814+
EncoderImplementation string `json:"encoderImplementation"`
809815
}
810816

811817
func (s OutboundRTPStreamStats) statsMarker() {}

stats_go_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ func getStatsSamples() []statSample {
144144
PerDSCPPacketsReceived: map[string]uint32{
145145
"123": 23,
146146
},
147+
DecoderImplementation: "libvpx",
147148
}
148149
inboundRTPStreamStatsJSON := `
149150
{
@@ -210,7 +211,8 @@ func getStatsSamples() []statSample {
210211
"packetsDuplicated": 22,
211212
"perDscpPacketsReceived": {
212213
"123": 23
213-
}
214+
},
215+
"decoderImplementation": "libvpx"
214216
}
215217
`
216218
outboundRTPStreamStats := OutboundRTPStreamStats{
@@ -264,7 +266,8 @@ func getStatsSamples() []statSample {
264266
PerDSCPPacketsSent: map[string]uint32{
265267
"123": 23,
266268
},
267-
Active: true,
269+
Active: true,
270+
EncoderImplementation: "libvpx",
268271
}
269272
outboundRTPStreamStatsJSON := `
270273
{
@@ -318,7 +321,8 @@ func getStatsSamples() []statSample {
318321
"perDscpPacketsSent": {
319322
"123": 23
320323
},
321-
"active": true
324+
"active": true,
325+
"encoderImplementation": "libvpx"
322326
}
323327
`
324328
remoteInboundRTPStreamStats := RemoteInboundRTPStreamStats{

0 commit comments

Comments
 (0)