Skip to content

Commit

Permalink
Add Encoder/Decoder info to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
aalekseevx authored and Sean-Der committed Dec 27, 2024
1 parent 3f246fd commit 80b5649
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ type InboundRTPStreamStats struct {
// these numbers are not expected to match the numbers seen on sending. Not all
// OSes make this information available.
PerDSCPPacketsReceived map[string]uint32 `json:"perDscpPacketsReceived"`

// Identifies the decoder implementation used. This is useful for diagnosing interoperability issues.
DecoderImplementation string `json:"decoderImplementation"`
}

func (s InboundRTPStreamStats) statsMarker() {}
Expand Down Expand Up @@ -806,6 +809,9 @@ type OutboundRTPStreamStats struct {
// Active indicates whether this RTP stream is configured to be sent or disabled. Note that an
// active stream can still not be sending, e.g. when being limited by network conditions.
Active bool `json:"active"`

// Identifies the encoder implementation used. This is useful for diagnosing interoperability issues.
EncoderImplementation string `json:"encoderImplementation"`
}

func (s OutboundRTPStreamStats) statsMarker() {}
Expand Down
10 changes: 7 additions & 3 deletions stats_go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ func getStatsSamples() []statSample {
PerDSCPPacketsReceived: map[string]uint32{
"123": 23,
},
DecoderImplementation: "libvpx",
}
inboundRTPStreamStatsJSON := `
{
Expand Down Expand Up @@ -210,7 +211,8 @@ func getStatsSamples() []statSample {
"packetsDuplicated": 22,
"perDscpPacketsReceived": {
"123": 23
}
},
"decoderImplementation": "libvpx"
}
`
outboundRTPStreamStats := OutboundRTPStreamStats{
Expand Down Expand Up @@ -264,7 +266,8 @@ func getStatsSamples() []statSample {
PerDSCPPacketsSent: map[string]uint32{
"123": 23,
},
Active: true,
Active: true,
EncoderImplementation: "libvpx",
}
outboundRTPStreamStatsJSON := `
{
Expand Down Expand Up @@ -318,7 +321,8 @@ func getStatsSamples() []statSample {
"perDscpPacketsSent": {
"123": 23
},
"active": true
"active": true,
"encoderImplementation": "libvpx"
}
`
remoteInboundRTPStreamStats := RemoteInboundRTPStreamStats{
Expand Down

0 comments on commit 80b5649

Please sign in to comment.