Skip to content
Open
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
18 changes: 14 additions & 4 deletions rtpcodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,26 @@ func codecParametersFuzzySearch(
return RTPCodecParameters{}, codecMatchNone
}

// Given a CodecParameters find the RTX CodecParameters if one exists.
// Given a CodecParameters find the RTX PayloadType.
func findRTXPayloadType(needle PayloadType, haystack []RTPCodecParameters) PayloadType {
rtxParam := findRTXCodecParameters(needle, haystack)
if rtxParam != nil {
return rtxParam.PayloadType
}

return PayloadType(0)
}

// Given a CodecParameters find the RTX CodecParameters if one exists.
func findRTXCodecParameters(needle PayloadType, haystack []RTPCodecParameters) *RTPCodecParameters {
aptStr := fmt.Sprintf("apt=%d", needle)
for _, c := range haystack {
for i, c := range haystack {
if aptStr == c.SDPFmtpLine {
return c.PayloadType
return &haystack[i]
}
}

return PayloadType(0)
return nil
}

// For now, only FlexFEC is supported.
Expand Down
Loading
Loading