Add support FLAC codec to MP4/MSE

This commit is contained in:
Alexey Khit
2023-04-20 16:18:38 +03:00
parent 5f9788209d
commit 7452eb5e05
18 changed files with 566 additions and 65 deletions
+8
View File
@@ -99,6 +99,14 @@ func UnmarshalCodec(md *sdp.MediaDescription, payloadType string) *Codec {
case "8":
c.Name = CodecPCMA
c.ClockRate = 8000
case "10":
c.Name = CodecPCM
c.ClockRate = 44100
c.Channels = 2
case "11":
c.Name = CodecPCM
c.ClockRate = 44100
c.Channels = 1
case "14":
c.Name = CodecMP3
c.ClockRate = 44100
+2 -1
View File
@@ -27,7 +27,8 @@ const (
CodecMP3 = "MPA" // payload: 14, aka MPEG-1 Layer III
CodecPCM = "L16" // Linear PCM
CodecELD = "ELD" // AAC-ELD
CodecELD = "ELD" // AAC-ELD
CodecFLAC = "FLAC"
CodecAll = "ALL"
CodecAny = "ANY"
+1 -1
View File
@@ -93,7 +93,7 @@ func GetKind(name string) string {
switch name {
case CodecH264, CodecH265, CodecVP8, CodecVP9, CodecAV1, CodecJPEG:
return KindVideo
case CodecPCMU, CodecPCMA, CodecAAC, CodecOpus, CodecG722, CodecMP3, CodecELD:
case CodecPCMU, CodecPCMA, CodecAAC, CodecOpus, CodecG722, CodecMP3, CodecPCM, CodecELD, CodecFLAC:
return KindAudio
}
return ""