Don't create DDParser for non-svc codec (#2883)

This commit is contained in:
cnderrauber
2024-07-19 10:52:27 +08:00
committed by GitHub
parent a877ba2352
commit 0c5b5537b2
3 changed files with 30 additions and 28 deletions
+2 -20
View File
@@ -132,24 +132,6 @@ type WebRTCReceiver struct {
forwardStats *ForwardStats
}
// SVC-TODO: Have to use more conditions to differentiate between
// SVC-TODO: SVC and non-SVC (could be single layer or simulcast).
// SVC-TODO: May only need to differentiate between simulcast and non-simulcast
// SVC-TODO: i. e. may be possible to treat single layer as SVC to get proper/intended functionality.
func IsSvcCodec(mime string) bool {
switch strings.ToLower(mime) {
case "video/av1":
fallthrough
case "video/vp9":
return true
}
return false
}
func IsRedCodec(mime string) bool {
return strings.HasSuffix(strings.ToLower(mime), "red")
}
type ReceiverOpts func(w *WebRTCReceiver) *WebRTCReceiver
// WithPliThrottleConfig indicates minimum time(ms) between sending PLIs
@@ -220,8 +202,8 @@ func NewWebRTCReceiver(
codec: track.Codec(),
kind: track.Kind(),
onRTCP: onRTCP,
isSVC: IsSvcCodec(track.Codec().MimeType),
isRED: IsRedCodec(track.Codec().MimeType),
isSVC: buffer.IsSvcCodec(track.Codec().MimeType),
isRED: buffer.IsRedCodec(track.Codec().MimeType),
}
for _, opt := range opts {