Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Encoder/Decoder info to stats #2979

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading