diff --git a/pkg/description/media.go b/pkg/description/media.go index 0992383e..2e2d9540 100644 --- a/pkg/description/media.go +++ b/pkg/description/media.go @@ -4,7 +4,6 @@ package description import ( "fmt" "reflect" - "regexp" "sort" "strconv" "strings" @@ -16,26 +15,6 @@ import ( "github.com/bluenviron/gortsplib/v4/pkg/format" ) -var ( - smartPayloadTypeRegexp = regexp.MustCompile("^smart/[0-9]/[0-9]+$") - smartRtpmapRegexp = regexp.MustCompile("^([0-9]+) (.+)/[0-9]+$") -) - -func replaceSmartPayloadType(payloadType string, attributes []psdp.Attribute) string { - re1 := smartPayloadTypeRegexp.FindStringSubmatch(payloadType) - if re1 != nil { - for _, attr := range attributes { - if attr.Key == "rtpmap" { - re2 := smartRtpmapRegexp.FindStringSubmatch(attr.Value) - if re2 != nil { - return re2[1] - } - } - } - } - return payloadType -} - func getAttribute(attributes []psdp.Attribute, key string) string { for _, attr := range attributes { if attr.Key == key { @@ -54,45 +33,6 @@ func isBackChannel(attributes []psdp.Attribute) bool { return false } -func getFormatAttribute(attributes []psdp.Attribute, payloadType uint8, key string) string { - for _, attr := range attributes { - if attr.Key == key { - v := strings.TrimSpace(attr.Value) - if parts := strings.SplitN(v, " ", 2); len(parts) == 2 { - if tmp, err := strconv.ParseUint(parts[0], 10, 8); err == nil && uint8(tmp) == payloadType { - return parts[1] - } - } - } - } - return "" -} - -func decodeFMTP(enc string) map[string]string { - if enc == "" { - return nil - } - - ret := make(map[string]string) - - for _, kv := range strings.Split(enc, ";") { - kv = strings.Trim(kv, " ") - - if len(kv) == 0 { - continue - } - - tmp := strings.SplitN(kv, "=", 2) - if len(tmp) != 2 { - continue - } - - ret[strings.ToLower(tmp[0])] = tmp[1] - } - - return ret -} - func sortedKeys(fmtp map[string]string) []string { keys := make([]string, len(fmtp)) i := 0 @@ -155,19 +95,9 @@ func (m *Media) Unmarshal(md *psdp.MediaDescription) error { m.Control = getAttribute(md.Attributes, "control") m.Formats = nil + for _, payloadType := range md.MediaName.Formats { - payloadType = replaceSmartPayloadType(payloadType, md.Attributes) - - tmp, err := strconv.ParseUint(payloadType, 10, 8) - if err != nil { - return err - } - payloadTypeInt := uint8(tmp) - - rtpMap := getFormatAttribute(md.Attributes, payloadTypeInt, "rtpmap") - fmtp := decodeFMTP(getFormatAttribute(md.Attributes, payloadTypeInt, "fmtp")) - - format, err := format.Unmarshal(string(m.Type), payloadTypeInt, rtpMap, fmtp) + format, err := format.Unmarshal(md, payloadType) if err != nil { return err } diff --git a/pkg/description/session_test.go b/pkg/description/session_test.go index b9cf6b3a..6032c40d 100644 --- a/pkg/description/session_test.go +++ b/pkg/description/session_test.go @@ -550,133 +550,6 @@ var casesSession = []struct { }, }, }, - { - "issue mediamtx/1267 (tp-link)", - "v=0\r\n" + - "o=- 4158123474391860926 2 IN IP4 127.0.0.1\r\n" + - "s=-\r\n" + - "t=0 0\r\n" + - "m=application/TP-LINK 0 RTP/AVP smart/1/90000\r\n" + - "a=rtpmap:95 TP-LINK/90000\r\n", - "v=0\r\n" + - "o=- 0 0 IN IP4 127.0.0.1\r\n" + - "s=-\r\n" + - "c=IN IP4 0.0.0.0\r\n" + - "t=0 0\r\n" + - "m=application/TP-LINK 0 RTP/AVP 95\r\n" + - "a=control\r\n" + - "a=rtpmap:95 TP-LINK/90000\r\n", - Session{ - Title: `-`, - Medias: []*Media{ - { - Type: "application/TP-LINK", - Formats: []format.Format{&format.Generic{ - PayloadTyp: 95, - RTPMa: "TP-LINK/90000", - ClockRat: 90000, - }}, - }, - }, - }, - }, - { - "issue gortsplib/509 (tp-link)", - "v=0\n" + - "o=- 14665860 31787219 1 IN IP4 192.168.1.102\n" + - "s=Session streamed by \"TP-LINK RTSP Server\"\n" + - "t=0 0\n" + - "a=smart_encoder:virtualIFrame=1\n" + - "m=application/tp-link 0 RTP/AVP smart/0/25000\n" + - "a=rtpmap:95 tp-link/25000\n" + - "a=control:track3\n", - "v=0\r\n" + - "o=- 0 0 IN IP4 127.0.0.1\r\n" + - "s=Session streamed by \"TP-LINK RTSP Server\"\r\n" + - "c=IN IP4 0.0.0.0\r\n" + - "t=0 0\r\n" + - "m=application/tp-link 0 RTP/AVP 95\r\n" + - "a=control:track3\r\n" + - "a=rtpmap:95 tp-link/25000\r\n", - Session{ - Title: `Session streamed by "TP-LINK RTSP Server"`, - Medias: []*Media{ - { - Type: "application/tp-link", - Formats: []format.Format{&format.Generic{ - PayloadTyp: 95, - RTPMa: "tp-link/25000", - ClockRat: 25000, - }}, - Control: "track3", - }, - }, - }, - }, - { - "mercury", - "v=0\n" + - "o=- 14665860 31787219 1 IN IP4 192.168.0.60\n" + - "s=Session streamed by \"MERCURY RTSP Server\"\n" + - "t=0 0\n" + - "a=smart_encoder:virtualIFrame=1\n" + - "m=application/MERCURY 0 RTP/AVP smart/1/90000\n" + - "a=rtpmap:95 MERCURY/90000\n", - "v=0\r\n" + - "o=- 0 0 IN IP4 127.0.0.1\r\n" + - "s=Session streamed by \"MERCURY RTSP Server\"\r\n" + - "c=IN IP4 0.0.0.0\r\n" + - "t=0 0\r\n" + - "m=application/MERCURY 0 RTP/AVP 95\r\n" + - "a=control\r\n" + - "a=rtpmap:95 MERCURY/90000\r\n", - Session{ - Title: `Session streamed by "MERCURY RTSP Server"`, - Medias: []*Media{ - { - Type: "application/MERCURY", - Formats: []format.Format{&format.Generic{ - PayloadTyp: 95, - RTPMa: "MERCURY/90000", - ClockRat: 90000, - }}, - }, - }, - }, - }, - { - "h264 with space at end", - "v=0\r\n" + - "o=- 4158123474391860926 2 IN IP4 127.0.0.1\r\n" + - "s=-\r\n" + - "t=0 0\r\n" + - "m=video 42504 RTP/AVP 96\r\n" + - "a=rtpmap:96 H264/90000 \r\n" + - "a=fmtp:96 packetization-mode=1\r\n", - "v=0\r\n" + - "o=- 0 0 IN IP4 127.0.0.1\r\n" + - "s=-\r\n" + - "c=IN IP4 0.0.0.0\r\n" + - "t=0 0\r\n" + - "m=video 0 RTP/AVP 96\r\n" + - "a=control\r\n" + - "a=rtpmap:96 H264/90000\r\n" + - "a=fmtp:96 packetization-mode=1\r\n", - Session{ - Title: "-", - Medias: []*Media{ - { - Type: MediaTypeVideo, - Formats: []format.Format{ - &format.H264{ - PayloadTyp: 96, - PacketizationMode: 1, - }, - }, - }, - }, - }, - }, { "ulpfec rfc5109", "v=0\r\n" + diff --git a/pkg/format/av1_test.go b/pkg/format/av1_test.go index e8e34ef4..31a51192 100644 --- a/pkg/format/av1_test.go +++ b/pkg/format/av1_test.go @@ -33,35 +33,3 @@ func TestAV1DecEncoder(t *testing.T) { require.NoError(t, err) require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts) } - -func FuzzUnmarshalAV1(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - e bool, - f string, - ) { - ma := map[string]string{} - - if a { - ma["level-idx"] = b - } - - if c { - ma["profile"] = d - } - - if e { - ma["tier"] = f - } - - fo, err := Unmarshal("video", 96, "AV1/90000", ma) - if err == nil { - fo.(*AV1).RTPMap() - fo.(*AV1).FMTP() - } - }) -} diff --git a/pkg/format/format.go b/pkg/format/format.go index 657c43ae..b7c6763c 100644 --- a/pkg/format/format.go +++ b/pkg/format/format.go @@ -2,11 +2,48 @@ package format import ( + "regexp" + "strconv" "strings" "github.com/pion/rtp" + psdp "github.com/pion/sdp/v3" ) +var ( + smartPayloadTypeRegexp = regexp.MustCompile("^smart/[0-9]/[0-9]+$") + smartRtpmapRegexp = regexp.MustCompile("^([0-9]+) (.+)/[0-9]+$") +) + +func replaceSmartPayloadType(payloadType string, attributes []psdp.Attribute) string { + re1 := smartPayloadTypeRegexp.FindStringSubmatch(payloadType) + if re1 != nil { + for _, attr := range attributes { + if attr.Key == "rtpmap" { + re2 := smartRtpmapRegexp.FindStringSubmatch(attr.Value) + if re2 != nil { + return re2[1] + } + } + } + } + return payloadType +} + +func getFormatAttribute(attributes []psdp.Attribute, payloadType uint8, key string) string { + for _, attr := range attributes { + if attr.Key == key { + v := strings.TrimSpace(attr.Value) + if parts := strings.SplitN(v, " ", 2); len(parts) == 2 { + if tmp, err := strconv.ParseUint(parts[0], 10, 8); err == nil && uint8(tmp) == payloadType { + return parts[1] + } + } + } + } + return "" +} + func getCodecAndClock(rtpMap string) (string, string) { parts2 := strings.SplitN(rtpMap, "/", 2) if len(parts2) != 2 { @@ -16,6 +53,31 @@ func getCodecAndClock(rtpMap string) (string, string) { return strings.ToLower(parts2[0]), parts2[1] } +func decodeFMTP(enc string) map[string]string { + if enc == "" { + return nil + } + + ret := make(map[string]string) + + for _, kv := range strings.Split(enc, ";") { + kv = strings.Trim(kv, " ") + + if len(kv) == 0 { + continue + } + + tmp := strings.SplitN(kv, "=", 2) + if len(tmp) != 2 { + continue + } + + ret[strings.ToLower(tmp[0])] = tmp[1] + } + + return ret +} + type unmarshalContext struct { mediaType string payloadType uint8 @@ -50,7 +112,19 @@ type Format interface { } // Unmarshal decodes a format from a media description. -func Unmarshal(mediaType string, payloadType uint8, rtpMap string, fmtp map[string]string) (Format, error) { +func Unmarshal(md *psdp.MediaDescription, payloadTypeStr string) (Format, error) { + mediaType := md.MediaName.Media + payloadTypeStr = replaceSmartPayloadType(payloadTypeStr, md.Attributes) + + tmp, err := strconv.ParseUint(payloadTypeStr, 10, 8) + if err != nil { + return nil, err + } + payloadType := uint8(tmp) + + rtpMap := getFormatAttribute(md.Attributes, payloadType, "rtpmap") + fmtp := decodeFMTP(getFormatAttribute(md.Attributes, payloadType, "fmtp")) + codec, clock := getCodecAndClock(rtpMap) format := func() Format { @@ -148,7 +222,7 @@ func Unmarshal(mediaType string, payloadType uint8, rtpMap string, fmtp map[stri return &Generic{} }() - err := format.unmarshal(&unmarshalContext{ + err = format.unmarshal(&unmarshalContext{ mediaType: mediaType, payloadType: payloadType, clock: clock, diff --git a/pkg/format/format_test.go b/pkg/format/format_test.go index 9258c5f5..83e1ff69 100644 --- a/pkg/format/format_test.go +++ b/pkg/format/format_test.go @@ -3,9 +3,9 @@ package format import ( "testing" - "github.com/stretchr/testify/require" - + "github.com/bluenviron/gortsplib/v4/pkg/sdp" "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" + "github.com/stretchr/testify/require" ) func intPtr(v int) *int { @@ -17,265 +17,268 @@ func boolPtr(v bool) *bool { } var casesFormat = []struct { - name string - mediaType string - payloadType uint8 - rtpMap string - fmtp map[string]string - dec Format - encRtpMap string - encFmtp map[string]string + name string + in string + dec Format + encPayloadType uint8 + encRtpMap string + encFmtp map[string]string }{ { "audio g711 pcma static payload type", - "audio", - 8, - "", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 8\n", &G711{ PayloadTyp: 8, MULaw: false, SampleRate: 8000, ChannelCount: 1, }, + 8, "PCMA/8000", nil, }, { "audio g711 pcmu static payload type", - "audio", - 0, - "", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 0\n", &G711{ PayloadTyp: 0, MULaw: true, SampleRate: 8000, ChannelCount: 1, }, + 0, "PCMU/8000", nil, }, { "audio g711 pcma dynamic payload type", - "audio", - 96, - "PCMA/16000/2", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 PCMA/16000/2", &G711{ PayloadTyp: 96, MULaw: false, SampleRate: 16000, ChannelCount: 2, }, + 96, "PCMA/16000/2", nil, }, { "audio g711 pcmu dynamic payload type", - "audio", - 96, - "PCMU/16000/2", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 PCMU/16000/2\n", &G711{ PayloadTyp: 96, MULaw: true, SampleRate: 16000, ChannelCount: 2, }, + 96, "PCMU/16000/2", nil, }, { "audio g722", - "audio", - 9, - "", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 9\n", &G722{}, + 9, "G722/8000", nil, }, { "audio g726 le 1", - "audio", - 97, - "G726-16/8000", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 G726-16/8000\n", &G726{ PayloadTyp: 97, BitRate: 16, }, + 97, "G726-16/8000", nil, }, { "audio g726 le 2", - "audio", - 97, - "G726-24/8000", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 G726-24/8000\n", &G726{ PayloadTyp: 97, BitRate: 24, }, + 97, "G726-24/8000", nil, }, { "audio g726 le 3", - "audio", - 97, - "G726-32/8000", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 G726-32/8000\n", &G726{ PayloadTyp: 97, BitRate: 32, }, + 97, "G726-32/8000", nil, }, { "audio g726 le 4", - "audio", - 97, - "G726-40/8000", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 G726-40/8000\n", &G726{ PayloadTyp: 97, BitRate: 40, }, + 97, "G726-40/8000", nil, }, { "audio g726 be", - "audio", - 97, - "AAL2-G726-32/8000", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 AAL2-G726-32/8000\n", &G726{ PayloadTyp: 97, BitRate: 32, BigEndian: true, }, + 97, "AAL2-G726-32/8000", nil, }, { "audio lpcm 8 dynamic payload type", - "audio", - 97, - "L8/48000/2", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 L8/48000/2\n", &LPCM{ PayloadTyp: 97, BitDepth: 8, SampleRate: 48000, ChannelCount: 2, }, + 97, "L8/48000/2", nil, }, { "audio lpcm 16 dynamic payload type", - "audio", - 97, - "L16/96000/2", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 L16/96000/2\n", &LPCM{ PayloadTyp: 97, BitDepth: 16, SampleRate: 96000, ChannelCount: 2, }, + 97, "L16/96000/2", nil, }, { "audio lpcm 16 static payload type", - "audio", - 10, - "", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 10\n", &LPCM{ PayloadTyp: 10, BitDepth: 16, SampleRate: 44100, ChannelCount: 2, }, + 10, "L16/44100/2", nil, }, { "audio lpcm 16 static payload type", - "audio", - 11, - "", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 11\n", &LPCM{ PayloadTyp: 11, BitDepth: 16, SampleRate: 44100, ChannelCount: 1, }, + 11, "L16/44100/1", nil, }, { "audio lpcm 16 with no explicit channel", - "audio", - 97, - "L16/16000", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 L16/16000\n", &LPCM{ PayloadTyp: 97, BitDepth: 16, SampleRate: 16000, ChannelCount: 1, }, + 97, "L16/16000/1", nil, }, { "audio lpcm 24", - "audio", - 98, - "L24/44100/4", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 98\n" + + "a=rtpmap:98 L24/44100/4\n", &LPCM{ PayloadTyp: 98, BitDepth: 24, SampleRate: 44100, ChannelCount: 4, }, + 98, "L24/44100/4", nil, }, { "audio mpeg2 audio", - "audio", - 14, - "", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 14\n", &MPEG1Audio{}, + 14, "", nil, }, { "audio aac", - "audio", - 96, - "mpeg4-generic/48000/2", - map[string]string{ - "streamtype": "5", - "profile-level-id": "1", - "mode": "AAC-hbr", - "sizelength": "13", - "indexlength": "3", - "indexdeltalength": "3", - "config": "11900810", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 mpeg4-generic/48000/2\n" + + "a=fmtp:96 streamtype=5; profile-level-id=1; mode=AAC-hbr; " + + "config=11900810; SizeLength=13; IndexLength=3; IndexDeltaLength=3\n", &MPEG4Audio{ PayloadTyp: 96, ProfileLevelID: 1, @@ -288,6 +291,7 @@ var casesFormat = []struct { IndexLength: 3, IndexDeltaLength: 3, }, + 96, "mpeg4-generic/48000/2", map[string]string{ "streamtype": "5", @@ -301,17 +305,12 @@ var casesFormat = []struct { }, { "audio aac vlc rtsp server", - "audio", - 96, - "mpeg4-generic/48000/2", - map[string]string{ - "profile-level-id": "1", - "mode": "AAC-hbr", - "sizelength": "13", - "indexlength": "3", - "indexdeltalength": "3", - "config": "1190", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 mpeg4-generic/48000/2\n" + + "a=fmtp:96 profile-level-id=1; mode=AAC-hbr; " + + "config=1190; SizeLength=13; IndexLength=3; IndexDeltaLength=3\n", &MPEG4Audio{ PayloadTyp: 96, ProfileLevelID: 1, @@ -324,6 +323,7 @@ var casesFormat = []struct { IndexLength: 3, IndexDeltaLength: 3, }, + 96, "mpeg4-generic/48000/2", map[string]string{ "streamtype": "5", @@ -337,16 +337,12 @@ var casesFormat = []struct { }, { "audio aac without indexlength", - "audio", - 96, - "mpeg4-generic/48000/2", - map[string]string{ - "streamtype": "5", - "profile-level-id": "14", - "mode": "AAC-hbr", - "config": "1190", - "sizelength": "13", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 mpeg4-generic/48000/2\n" + + "a=fmtp:96 streamtype=5; profile-level-id=14; mode=AAC-hbr; " + + "config=1190; SizeLength=13\n", &MPEG4Audio{ PayloadTyp: 96, ProfileLevelID: 14, @@ -357,6 +353,7 @@ var casesFormat = []struct { }, SizeLength: 13, }, + 96, "mpeg4-generic/48000/2", map[string]string{ "streamtype": "5", @@ -368,16 +365,12 @@ var casesFormat = []struct { }, { "audio aac he-aac v2 ps", - "audio", - 96, - "mpeg4-generic/48000/2", - map[string]string{ - "streamtype": "5", - "profile-level-id": "48", - "mode": "AAC-hbr", - "config": "eb098800", - "sizelength": "13", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 mpeg4-generic/48000/2\n" + + "a=fmtp:96 streamtype=5; profile-level-id=48; mode=AAC-hbr; " + + "config=eb098800; SizeLength=13\n", &MPEG4Audio{ PayloadTyp: 96, ProfileLevelID: 48, @@ -390,6 +383,7 @@ var casesFormat = []struct { }, SizeLength: 13, }, + 96, "mpeg4-generic/48000/2", map[string]string{ "streamtype": "5", @@ -401,16 +395,12 @@ var casesFormat = []struct { }, { "audio aac latm lc", - "audio", - 96, - "MP4A-LATM/24000/2", - map[string]string{ - "profile-level-id": "1", - "bitrate": "64000", - "cpresent": "0", - "object": "2", - "config": "400026203fc0", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 MP4A-LATM/24000/2\n" + + "a=fmtp:96 profile-level-id=1; " + + "bitrate=64000; cpresent=0; object=2; config=400026203fc0\n", &MPEG4Audio{ LATM: true, PayloadTyp: 96, @@ -430,6 +420,7 @@ var casesFormat = []struct { }}, }, }, + 96, "MP4A-LATM/24000/2", map[string]string{ "profile-level-id": "1", @@ -441,16 +432,12 @@ var casesFormat = []struct { }, { "audio aac latm he-aac v2", - "audio", - 110, - "MP4A-LATM/24000/1", - map[string]string{ - "profile-level-id": "15", - "object": "2", - "cpresent": "0", - "config": "400026103fc0", - "sbr-enabled": "1", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 110\n" + + "a=rtpmap:110 MP4A-LATM/24000/1\n" + + "a=fmtp:110 profile-level-id=15; " + + "cpresent=0; object=2; config=400026103fc0; sbr-enabled=1\n", &MPEG4Audio{ LATM: true, PayloadTyp: 110, @@ -470,6 +457,7 @@ var casesFormat = []struct { }}, }, }, + 110, "MP4A-LATM/24000/1", map[string]string{ "profile-level-id": "15", @@ -481,16 +469,12 @@ var casesFormat = []struct { }, { "audio aac latm hierarchical sbr", - "audio", - 110, - "MP4A-LATM/48000/2", - map[string]string{ - "profile-level-id": "44", - "bitrate": "64000", - "cpresent": "0", - "config": "40005623101fe0", - "sbr-enabled": "1", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 110\n" + + "a=rtpmap:110 MP4A-LATM/48000/2\n" + + "a=fmtp:110 profile-level-id=44; " + + "bitrate=64000; cpresent=0; config=40005623101fe0; sbr-enabled=1\n", &MPEG4Audio{ LATM: true, PayloadTyp: 110, @@ -513,6 +497,7 @@ var casesFormat = []struct { }}, }, }, + 110, "MP4A-LATM/48000/2", map[string]string{ "profile-level-id": "44", @@ -525,15 +510,12 @@ var casesFormat = []struct { }, { "audio aac latm hierarchical ps", - "audio", - 110, - "MP4A-LATM/48000/2", - map[string]string{ - "profile-level-id": "48", - "bitrate": "64000", - "cpresent": "0", - "config": "4001d613101fe0", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 110\n" + + "a=rtpmap:110 MP4A-LATM/48000/2\n" + + "a=fmtp:110 profile-level-id=48; " + + "bitrate=64000; cpresent=0; config=4001d613101fe0\n", &MPEG4Audio{ LATM: true, PayloadTyp: 110, @@ -555,6 +537,7 @@ var casesFormat = []struct { }}, }, }, + 110, "MP4A-LATM/48000/2", map[string]string{ "profile-level-id": "48", @@ -566,13 +549,12 @@ var casesFormat = []struct { }, { "audio aac latm no channels", - "audio", - 110, - "MP4A-LATM/48000", - map[string]string{ - "cpresent": "0", - "config": "40002310", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 110\n" + + "a=rtpmap:110 MP4A-LATM/48000\n" + + "a=fmtp:110 profile-level-id=30; " + + "cpresent=0; config=40002310\n", &MPEG4Audio{ LATM: true, PayloadTyp: 110, @@ -591,6 +573,7 @@ var casesFormat = []struct { }}, }, }, + 110, "MP4A-LATM/48000/1", map[string]string{ "profile-level-id": "30", @@ -600,18 +583,38 @@ var casesFormat = []struct { }, }, { - "audio speex", - "audio", - 96, - "speex/16000", - map[string]string{ - "vbr": "off", + "audio aac latm cpresent", + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 MP4A-LATM/48000/2\n" + + "a=fmtp:96 cpresent=1\n", + &MPEG4Audio{ + PayloadTyp: 96, + LATM: true, + ProfileLevelID: 30, + CPresent: true, }, + 96, + "MP4A-LATM/16000/1", + map[string]string{ + "cpresent": "1", + "profile-level-id": "30", + }, + }, + { + "audio speex", + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 speex/16000\n" + + "a=fmtp:96 vbr=off\n", &Speex{ PayloadTyp: 96, SampleRate: 16000, VBR: boolPtr(false), }, + 96, "speex/16000", map[string]string{ "vbr": "off", @@ -619,18 +622,18 @@ var casesFormat = []struct { }, { "audio vorbis", - "audio", - 96, - "VORBIS/44100/2", - map[string]string{ - "configuration": "AQIDBA==", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 VORBIS/44100/2\n" + + "a=fmtp:96 configuration=AQIDBA==\n", &Vorbis{ PayloadTyp: 96, SampleRate: 44100, ChannelCount: 2, Configuration: []byte{0x01, 0x02, 0x03, 0x04}, }, + 96, "VORBIS/44100/2", map[string]string{ "configuration": "AQIDBA==", @@ -638,17 +641,17 @@ var casesFormat = []struct { }, { "audio opus", - "audio", - 96, - "opus/48000/2", - map[string]string{ - "sprop-stereo": "1", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 opus/48000/2\n" + + "a=fmtp:96 sprop-stereo=1\n", &Opus{ PayloadTyp: 96, IsStereo: true, ChannelCount: 2, }, + 96, "opus/48000/2", map[string]string{ "sprop-stereo": "1", @@ -656,18 +659,16 @@ var casesFormat = []struct { }, { "audio opus 5.1", - "audio", - 96, - "multiopus/48000/6", - map[string]string{ - "num_streams": "4", - "coupled_streams": "2", - "channel_mapping": "0,4,1,2,3,5", - }, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 multiopus/48000/6\n" + + "a=fmtp:96 num_streams=4; coupled_streams=2; channel_mapping=0,4,1,2,3,5\n", &Opus{ PayloadTyp: 96, ChannelCount: 6, }, + 96, "multiopus/48000/6", map[string]string{ "channel_mapping": "0,4,1,2,3,5", @@ -678,72 +679,71 @@ var casesFormat = []struct { }, { "audio ac3", - "audio", - 96, - "AC3/48000/2", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 96\n" + + "a=rtpmap:96 AC3/48000/2\n", &AC3{ PayloadTyp: 96, SampleRate: 48000, ChannelCount: 2, }, + 96, "AC3/48000/2", nil, }, { "audio ac3 implicit channels", - "audio", - 97, - "AC3/48000", - nil, + "v=0\n" + + "s=\n" + + "m=audio 0 RTP/AVP 97\n" + + "a=rtpmap:97 AC3/48000\n", &AC3{ PayloadTyp: 97, SampleRate: 48000, ChannelCount: 6, }, + 97, "AC3/48000/6", nil, }, { "video jpeg", - "video", - 26, - "", - nil, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 26\n", &MJPEG{}, + 26, "JPEG/90000", nil, }, { "video mpeg1 video", - "video", - 32, - "", - nil, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 32\n", &MPEG1Video{}, + 32, "", nil, }, { "video mpeg-ts", - "video", - 33, - "", - nil, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 33\n", &MPEGTS{}, + 33, "MP2T/90000", nil, }, { "video mpeg4 video", - "video", - 96, - "MP4V-ES/90000", - map[string]string{ - "profile-level-id": "1", - "config": "000001B001000001B58913000001000000012000C48" + - "D8AEE053C04641443000001B24C61766335382E3133342E313030", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 MP4V-ES/90000\n" + + "a=fmtp:96 profile-level-id=1; config=000001B001000001B58913000001000000012000C48D8AEE053C04641443000001B24C61766335382E3133342E313030\n", &MPEG4Video{ PayloadTyp: 96, ProfileLevelID: 1, @@ -756,6 +756,7 @@ var casesFormat = []struct { 0x2e, 0x31, 0x33, 0x34, 0x2e, 0x31, 0x30, 0x30, }, }, + 96, "MP4V-ES/90000", map[string]string{ "profile-level-id": "1", @@ -765,14 +766,11 @@ var casesFormat = []struct { }, { "video h264", - "video", - 96, - "H264/90000", - map[string]string{ - "packetization-mode": "1", - "sprop-parameter-sets": "Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==", - "profile-level-id": "64000C", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H264/90000\n" + + "a=fmtp:96 packetization-mode=1; profile-level-id=64000C; sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==\n", &H264{ PayloadTyp: 96, SPS: []byte{ @@ -785,6 +783,7 @@ var casesFormat = []struct { }, PacketizationMode: 1, }, + 96, "H264/90000", map[string]string{ "packetization-mode": "1", @@ -794,14 +793,11 @@ var casesFormat = []struct { }, { "video h264 vlc rtsp server", - "video", - 96, - "H264/90000", - map[string]string{ - "packetization-mode": "1", - "profile-level-id": "64001f", - "sprop-parameter-sets": "Z2QAH6zZQFAFuwFsgAAAAwCAAAAeB4wYyw==,aOvjyyLA", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H264/90000\n" + + "a=fmtp:96 packetization-mode=1; profile-level-id=64001f; sprop-parameter-sets=Z2QAH6zZQFAFuwFsgAAAAwCAAAAeB4wYyw==,aOvjyyLA\n", &H264{ PayloadTyp: 96, SPS: []byte{ @@ -815,6 +811,7 @@ var casesFormat = []struct { }, PacketizationMode: 1, }, + 96, "H264/90000", map[string]string{ "packetization-mode": "1", @@ -824,14 +821,11 @@ var casesFormat = []struct { }, { "video h264 sprop-parameter-sets with extra data", - "video", - 96, - "H264/90000", - map[string]string{ - "packetization-mode": "1", - "sprop-parameter-sets": "Z2QAKawTMUB4BEfeA+oCAgPgAAADACAAAAZSgA==,aPqPLA==,aF6jzAMA", - "profile-level-id": "640029", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H264/90000\n" + + "a=fmtp:96 packetization-mode=1; profile-level-id=640029; sprop-parameter-sets=Z2QAKawTMUB4BEfeA+oCAgPgAAADACAAAAZSgA==,aPqPLA==,aF6jzAMA\n", &H264{ PayloadTyp: 96, SPS: []byte{ @@ -845,6 +839,7 @@ var casesFormat = []struct { }, PacketizationMode: 1, }, + 96, "H264/90000", map[string]string{ "packetization-mode": "1", @@ -854,17 +849,16 @@ var casesFormat = []struct { }, { "video h264 empty sprop-parameter-sets", - "video", - 96, - "H264/90000", - map[string]string{ - "packetization-mode": "1", - "sprop-parameter-sets": "", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H264/90000\n" + + "a=fmtp:96 packetization-mode=1; sprop-parameter-sets=\n", &H264{ PayloadTyp: 96, PacketizationMode: 1, }, + 96, "H264/90000", map[string]string{ "packetization-mode": "1", @@ -872,14 +866,11 @@ var casesFormat = []struct { }, { "video h264 annexb", - "video", - 96, - "H264/90000", - map[string]string{ - "sprop-parameter-sets": "AAAAAWdNAB6NjUBaHtCAAAOEAACvyAI=,AAAAAWjuOIA=", - "packetization-mode": "1", - "profile-level-id": "4DE028", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H264/90000\n" + + "a=fmtp:96 packetization-mode=1; profile-level-id=4DE028; sprop-parameter-sets=AAAAAWdNAB6NjUBaHtCAAAOEAACvyAI=,AAAAAWjuOIA=\n", &H264{ PayloadTyp: 96, SPS: []byte{ @@ -892,6 +883,7 @@ var casesFormat = []struct { }, PacketizationMode: 1, }, + 96, "H264/90000", map[string]string{ "packetization-mode": "1", @@ -901,18 +893,35 @@ var casesFormat = []struct { }, { "video h264 with unparsable parameters (mediamtx/2348)", - "video", - 96, - "H264/90000", - map[string]string{ - "sprop-parameter-sets": "QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Y2uSTJrlnAIAAADAAgAAAMAyEA=,RAHgdrAmQA==", - "packetization-mode": "1", - "profile-level-id": "010101", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H264/90000\n" + + "a=fmtp:96 packetization-mode=1; profile-level-id=010101; sprop-parameter-sets=QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Y2uSTJrlnAIAAADAAgAAAMAyEA=,RAHgdrAmQA==\n", &H264{ PayloadTyp: 96, PacketizationMode: 1, }, + 96, + "H264/90000", + map[string]string{ + "packetization-mode": "1", + }, + }, + { + "video h264 with space at end", + "v=0\r\n" + + "o=- 4158123474391860926 2 IN IP4 127.0.0.1\r\n" + + "s=-\r\n" + + "t=0 0\r\n" + + "m=video 42504 RTP/AVP 96\r\n" + + "a=rtpmap:96 H264/90000 \r\n" + + "a=fmtp:96 packetization-mode=1\r\n", + &H264{ + PayloadTyp: 96, + PacketizationMode: 1, + }, + 96, "H264/90000", map[string]string{ "packetization-mode": "1", @@ -920,15 +929,12 @@ var casesFormat = []struct { }, { "video h265", - "video", - 96, - "H265/90000", - map[string]string{ - "sprop-vps": "QAEMAf//AWAAAAMAkAAAAwAAAwB4mZgJ", - "sprop-sps": "QgEBAWAAAAMAkAAAAwAAAwB4oAPAgBDllmZpJMrgEAAAAwAQAAADAeCA", - "sprop-pps": "RAHBcrRiQA==", - "sprop-max-don-diff": "2", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H265/90000\n" + + "a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAkAAAAwAAAwB4mZgJ; sprop-sps=QgEBAWAAAAMAkAAAAwAAAwB4oAPAgBDllmZpJMrgEAAAAwAQAAADAeCA; " + + "sprop-pps=RAHBcrRiQA==; sprop-max-don-diff=2\n", &H265{ PayloadTyp: 96, VPS: []byte{ @@ -949,6 +955,7 @@ var casesFormat = []struct { }, MaxDONDiff: 2, }, + 96, "H265/90000", map[string]string{ "sprop-vps": "QAEMAf//AWAAAAMAkAAAAwAAAwB4mZgJ", @@ -959,14 +966,12 @@ var casesFormat = []struct { }, { "video h265 annexb", - "video", - 96, - "H265/90000", - map[string]string{ - "sprop-vps": "AAAAAUABDAH//wFgAAADAAADAAADAAADAJasCQ==", - "sprop-sps": "AAAAAUIBAQFgAAADAAADAAADAAADAJagBaIB4WNrkkya5Zk=", - "sprop-pps": "AAAAAUQB4HawJkA=", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 H265/90000\n" + + "a=fmtp:96 sprop-vps=AAAAAUABDAH//wFgAAADAAADAAADAAADAJasCQ==; sprop-sps=AAAAAUIBAQFgAAADAAADAAADAAADAJagBaIB4WNrkkya5Zk=; " + + "sprop-pps=AAAAAUQB4HawJkA=\n", &H265{ PayloadTyp: 96, VPS: []byte{ @@ -984,6 +989,7 @@ var casesFormat = []struct { 0x44, 0x01, 0xe0, 0x76, 0xb0, 0x26, 0x40, }, }, + 96, "H265/90000", map[string]string{ "sprop-vps": "QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ", @@ -993,18 +999,17 @@ var casesFormat = []struct { }, { "video vp8", - "video", - 96, - "VP8/90000", - map[string]string{ - "max-fr": "123", - "max-fs": "456", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 VP8/90000\n" + + "a=fmtp:96 max-fr=123; max-fs=456\n", &VP8{ PayloadTyp: 96, MaxFR: intPtr(123), MaxFS: intPtr(456), }, + 96, "VP8/90000", map[string]string{ "max-fr": "123", @@ -1013,20 +1018,18 @@ var casesFormat = []struct { }, { "video vp9", - "video", - 96, - "VP9/90000", - map[string]string{ - "max-fr": "123", - "max-fs": "456", - "profile-id": "789", - }, + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 VP9/90000\n" + + "a=fmtp:96 max-fr=123; max-fs=456; profile-id=789\n", &VP9{ PayloadTyp: 96, MaxFR: intPtr(123), MaxFS: intPtr(456), ProfileID: intPtr(789), }, + 96, "VP9/90000", map[string]string{ "max-fr": "123", @@ -1036,7 +1039,17 @@ var casesFormat = []struct { }, { "video av1", - "video", + "v=0\n" + + "s=\n" + + "m=video 0 RTP/AVP 96\n" + + "a=rtpmap:96 AV1/90000\n" + + "a=fmtp:96 profile=2; level-idx=8; tier=1\n", + &AV1{ + PayloadTyp: 96, + Profile: intPtr(2), + LevelIdx: intPtr(8), + Tier: intPtr(1), + }, 96, "AV1/90000", map[string]string{ @@ -1044,64 +1057,114 @@ var casesFormat = []struct { "level-idx": "8", "tier": "1", }, - &AV1{ - PayloadTyp: 96, - Profile: intPtr(2), - LevelIdx: intPtr(8), - Tier: intPtr(1), - }, - "AV1/90000", - map[string]string{ - "profile": "2", - "level-idx": "8", - "tier": "1", - }, }, { "application", - "application", - 98, - "MetaData/80000", - nil, + "v=0\n" + + "s=\n" + + "m=application 0 RTP/AVP 98\n" + + "a=rtpmap:98 MetaData/80000\n", &Generic{ PayloadTyp: 98, RTPMa: "MetaData/80000", ClockRat: 80000, }, + 98, "MetaData/80000", nil, }, { "application without clock rate", - "application", - 107, - "", - nil, + "v=0\n" + + "s=\n" + + "m=application 0 RTP/AVP 107\n", &Generic{ PayloadTyp: 107, }, + 107, "", nil, }, { "application invalid rtpmap", - "application", - 98, - "custom", - nil, + "v=0\n" + + "s=\n" + + "m=application 0 RTP/AVP 98\n" + + "a=rtpmap:98 custom\n", &Generic{ PayloadTyp: 98, RTPMa: "custom", }, + 98, "custom", nil, }, + { + "application tp-link (issue gortsplib/509)", + "v=0\n" + + "o=- 14665860 31787219 1 IN IP4 192.168.1.102\n" + + "s=Session streamed by \"TP-LINK RTSP Server\"\n" + + "t=0 0\n" + + "a=smart_encoder:virtualIFrame=1\n" + + "m=application/tp-link 0 RTP/AVP smart/0/25000\n" + + "a=rtpmap:95 tp-link/25000\n" + + "a=control:track3\n", + &Generic{ + PayloadTyp: 95, + RTPMa: "tp-link/25000", + ClockRat: 25000, + }, + 95, + "tp-link/25000", + nil, + }, + { + "application mercury (issue gortsplib/271)", + "v=0\n" + + "o=- 14665860 31787219 1 IN IP4 192.168.0.60\n" + + "s=Session streamed by \"MERCURY RTSP Server\"\n" + + "t=0 0\n" + + "a=smart_encoder:virtualIFrame=1\n" + + "m=application/MERCURY 0 RTP/AVP smart/1/90000\n" + + "a=rtpmap:95 MERCURY/90000\n", + &Generic{ + PayloadTyp: 95, + RTPMa: "MERCURY/90000", + ClockRat: 90000, + }, + 95, + "MERCURY/90000", + nil, + }, + { + "application tp-link (issue mediamtx/1267)", + "v=0\r\n" + + "o=- 4158123474391860926 2 IN IP4 127.0.0.1\r\n" + + "s=-\r\n" + + "t=0 0\r\n" + + "m=application/TP-LINK 0 RTP/AVP smart/1/90000\r\n" + + "a=rtpmap:95 TP-LINK/90000\r\n", + &Generic{ + PayloadTyp: 95, + RTPMa: "TP-LINK/90000", + ClockRat: 90000, + }, + 95, + "TP-LINK/90000", + nil, + }, } func TestUnmarshal(t *testing.T) { for _, ca := range casesFormat { t.Run(ca.name, func(t *testing.T) { - dec, err := Unmarshal(ca.mediaType, ca.payloadType, ca.rtpMap, ca.fmtp) + var desc sdp.SessionDescription + err := desc.Unmarshal([]byte(ca.in)) + require.NoError(t, err) + require.Equal(t, 1, len(desc.MediaDescriptions)) + require.Equal(t, 1, len(desc.MediaDescriptions[0].MediaName.Formats)) + + dec, err := Unmarshal(desc.MediaDescriptions[0], desc.MediaDescriptions[0].MediaName.Formats[0]) require.NoError(t, err) require.Equal(t, ca.dec, dec) }) @@ -1111,16 +1174,24 @@ func TestUnmarshal(t *testing.T) { func TestMarshal(t *testing.T) { for _, ca := range casesFormat { t.Run(ca.name, func(t *testing.T) { - require.Equal(t, ca.payloadType, ca.dec.PayloadType()) + require.Equal(t, ca.encPayloadType, ca.dec.PayloadType()) require.Equal(t, ca.encRtpMap, ca.dec.RTPMap()) require.Equal(t, ca.encFmtp, ca.dec.FMTP()) }) } } -func TestUnmarshalErrors(t *testing.T) { - t.Run("invalid video", func(t *testing.T) { - _, err := Unmarshal("video", 96, "", map[string]string{}) - require.Error(t, err) +func FuzzUnmarshal(f *testing.F) { + for _, ca := range casesFormat { + f.Add(ca.in) + } + + f.Fuzz(func(_ *testing.T, in string) { + var desc sdp.SessionDescription + err := desc.Unmarshal([]byte(in)) + + if err == nil && len(desc.MediaDescriptions) == 1 && len(desc.MediaDescriptions[0].MediaName.Formats) == 1 { + Unmarshal(desc.MediaDescriptions[0], desc.MediaDescriptions[0].MediaName.Formats[0]) + } }) } diff --git a/pkg/format/h264_test.go b/pkg/format/h264_test.go index 3b5a0034..a3d143e3 100644 --- a/pkg/format/h264_test.go +++ b/pkg/format/h264_test.go @@ -62,32 +62,6 @@ func TestH264DecEncoder(t *testing.T) { require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts) } -func FuzzUnmarshalH264(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - ) { - ma := map[string]string{} - - if a { - ma["sprop-parameter-sets"] = b - } - - if c { - ma["packetization-mode"] = d - } - - fo, err := Unmarshal("video", 96, "H264/90000", ma) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} - func FuzzH264PTSEqualsDTS(f *testing.F) { f.Fuzz(func(t *testing.T, b []byte) { (&H264{}).PTSEqualsDTS(&rtp.Packet{Payload: b}) diff --git a/pkg/format/h265_test.go b/pkg/format/h265_test.go index af29904d..20768343 100644 --- a/pkg/format/h265_test.go +++ b/pkg/format/h265_test.go @@ -71,40 +71,6 @@ func TestH265DecEncoder(t *testing.T) { require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts) } -func FuzzUnmarshalH265(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - ) { - ma := map[string]string{} - - if a { - ma["sprop-vps"] = b - } - - if c { - ma["sprop-sps"] = d - } - - if c { - ma["sprop-pps"] = d - } - - if c { - ma["sprop-max-don-diff"] = d - } - - fo, err := Unmarshal("video", 96, "H265/90000", ma) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} - func FuzzH265PTSEqualsDTS(f *testing.F) { f.Fuzz(func(t *testing.T, b []byte) { (&H265{}).PTSEqualsDTS(&rtp.Packet{Payload: b}) diff --git a/pkg/format/lpcm_test.go b/pkg/format/lpcm_test.go index e2662f56..c6015d9e 100644 --- a/pkg/format/lpcm_test.go +++ b/pkg/format/lpcm_test.go @@ -41,13 +41,3 @@ func TestLPCMDecEncoder(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts) } - -func FuzzUnmarshalLPCM(f *testing.F) { - f.Fuzz(func(_ *testing.T, a string) { - fo, err := Unmarshal("audio", 96, "L16/"+a, nil) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} diff --git a/pkg/format/mpeg4_audio_test.go b/pkg/format/mpeg4_audio_test.go index d6d20d6b..da680b8c 100644 --- a/pkg/format/mpeg4_audio_test.go +++ b/pkg/format/mpeg4_audio_test.go @@ -124,109 +124,3 @@ func TestMPEG4AudioDecEncoder(t *testing.T) { require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts) }) } - -func FuzzUnmarshalMPEG4AudioGeneric(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - e bool, - f string, - g bool, - h string, - i bool, - j string, - k bool, - l string, - m bool, - n string, - ) { - ma := map[string]string{} - - if a { - ma["streamtype"] = b - } - - if c { - ma["mode"] = d - } - - if e { - ma["profile-level-id"] = f - } - - if g { - ma["config"] = h - } - - if i { - ma["sizelength"] = j - } - - if k { - ma["indexlength"] = l - } - - if m { - ma["indexdeltalength"] = n - } - - fo, err := Unmarshal("audio", 96, "MPEG4-generic/48000/2", ma) //nolint:errcheck - if err == nil { - fo.(*MPEG4Audio).GetConfig() - } - }) -} - -func FuzzUnmarshalMPEG4AudioLATM(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - e bool, - f string, - g bool, - h string, - i bool, - j string, - k bool, - l string, - ) { - ma := map[string]string{} - - if a { - ma["profile-level-id"] = b - } - - if c { - ma["bitrate"] = d - } - - if e { - ma["cpresent"] = f - } - - if g { - ma["config"] = h - } - - if i { - ma["object"] = j - } - - if k { - ma["sbr-enabled"] = l - } - - fo, err := Unmarshal("audio", 96, "MP4A-LATM/48000/2", ma) - if err == nil { - fo.(*MPEG4Audio).RTPMap() - fo.(*MPEG4Audio).FMTP() - fo.(*MPEG4Audio).GetConfig() - } - }) -} diff --git a/pkg/format/mpeg4_video_test.go b/pkg/format/mpeg4_video_test.go index 083c7ecb..15df5428 100644 --- a/pkg/format/mpeg4_video_test.go +++ b/pkg/format/mpeg4_video_test.go @@ -37,29 +37,3 @@ func TestMPEG4VideoDecEncoder(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts) } - -func FuzzUnmarshalMPEG4Video(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - ) { - ma := map[string]string{} - - if a { - ma["profile-level-id"] = b - } - - if c { - ma["config"] = d - } - - fo, err := Unmarshal("audio", 96, "MP4V-ES/90000", ma) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} diff --git a/pkg/format/opus_test.go b/pkg/format/opus_test.go index 740fe716..21690cc1 100644 --- a/pkg/format/opus_test.go +++ b/pkg/format/opus_test.go @@ -34,27 +34,3 @@ func TestOpusDecEncoder(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts) } - -func FuzzUnmarshalOpus(f *testing.F) { - f.Add("48000/a") - - f.Fuzz(func(_ *testing.T, a string) { - fo, err := Unmarshal("audio", 96, "Opus/"+a, nil) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} - -func FuzzUnmarshalOpusMulti(f *testing.F) { - f.Add("48000/a") - - f.Fuzz(func(_ *testing.T, a string) { - fo, err := Unmarshal("audio", 96, "multiopus/"+a, nil) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/034abdada9825c88 b/pkg/format/testdata/fuzz/FuzzUnmarshal/034abdada9825c88 new file mode 100644 index 00000000..e69ed2c7 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/034abdada9825c88 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 AV1/90000\na=fmtp:96 tier=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/0bf5831d94e96868 b/pkg/format/testdata/fuzz/FuzzUnmarshal/0bf5831d94e96868 new file mode 100644 index 00000000..a7cb6e62 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/0bf5831d94e96868 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 0A") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/11a1645d8d3b471e b/pkg/format/testdata/fuzz/FuzzUnmarshal/11a1645d8d3b471e new file mode 100644 index 00000000..90aefe46 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/11a1645d8d3b471e @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 110\na=rtpmap:110 MP4A-LATM/\na=fmtp:110 Config=7001d01010") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/29c5602317dcc787 b/pkg/format/testdata/fuzz/FuzzUnmarshal/29c5602317dcc787 new file mode 100644 index 00000000..56adf379 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/29c5602317dcc787 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H264/90000\na=fmtp:96 sprop-pArAmeter-sets=,0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/30b767478066fd0d b/pkg/format/testdata/fuzz/FuzzUnmarshal/30b767478066fd0d new file mode 100644 index 00000000..494ffbb5 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/30b767478066fd0d @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 SiZeLength=A") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/3376b5ae75b1a24c b/pkg/format/testdata/fuzz/FuzzUnmarshal/3376b5ae75b1a24c new file mode 100644 index 00000000..9002fdec --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/3376b5ae75b1a24c @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 IndeXLength=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/36a3ed85efc6a1f7 b/pkg/format/testdata/fuzz/FuzzUnmarshal/36a3ed85efc6a1f7 new file mode 100644 index 00000000..5754f586 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/36a3ed85efc6a1f7 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 multiopus//") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/3a376c3e00e61fd6 b/pkg/format/testdata/fuzz/FuzzUnmarshal/3a376c3e00e61fd6 new file mode 100644 index 00000000..c693c25e --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/3a376c3e00e61fd6 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 VORBIS/0/0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/3b20c0b4a9b513c9 b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b20c0b4a9b513c9 new file mode 100644 index 00000000..b685bf55 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b20c0b4a9b513c9 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 MP4A-LATM/\na=fmtp:96 Cpresent=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/3b281e7f1169e546 b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b281e7f1169e546 new file mode 100644 index 00000000..305ad07b --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b281e7f1169e546 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 110\na=rtpmap:110 MP4A-LATM/\na=fmtp:110 profile-level-id=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/3b697a94739c061a b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b697a94739c061a new file mode 100644 index 00000000..7e6897cf --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b697a94739c061a @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 Config=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/3b94c0a14997fa8e b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b94c0a14997fa8e new file mode 100644 index 00000000..311bf96b --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/3b94c0a14997fa8e @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H264/90000\na=fmtp:96 pACketiZAtion-mode=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/3d9078c9105f644c b/pkg/format/testdata/fuzz/FuzzUnmarshal/3d9078c9105f644c new file mode 100644 index 00000000..9a8585d6 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/3d9078c9105f644c @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 VP8/90000\na=fmtp:96 mAX-fs=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/413db20183d4e979 b/pkg/format/testdata/fuzz/FuzzUnmarshal/413db20183d4e979 new file mode 100644 index 00000000..3fd38cad --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/413db20183d4e979 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 AC3/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/423c64c5363f3801 b/pkg/format/testdata/fuzz/FuzzUnmarshal/423c64c5363f3801 new file mode 100644 index 00000000..917b6f30 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/423c64c5363f3801 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/4995d0f1f765d676 b/pkg/format/testdata/fuzz/FuzzUnmarshal/4995d0f1f765d676 new file mode 100644 index 00000000..ebe5bb53 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/4995d0f1f765d676 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 Config=0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/4bef93ff7ecac01e b/pkg/format/testdata/fuzz/FuzzUnmarshal/4bef93ff7ecac01e new file mode 100644 index 00000000..f411f424 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/4bef93ff7ecac01e @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 97\na=rtpmap:97 L8/0/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/4dce10144578f984 b/pkg/format/testdata/fuzz/FuzzUnmarshal/4dce10144578f984 new file mode 100644 index 00000000..fe5e10d0 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/4dce10144578f984 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H265/90000\na=fmtp:96 sprop-sps=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/50616734ee54c407 b/pkg/format/testdata/fuzz/FuzzUnmarshal/50616734ee54c407 new file mode 100644 index 00000000..68f672ea --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/50616734ee54c407 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H264/90000\na=fmtp:96 sprop-pArAmeter-sets=0,") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/5188afc3e28a714a b/pkg/format/testdata/fuzz/FuzzUnmarshal/5188afc3e28a714a new file mode 100644 index 00000000..7162ea2b --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/5188afc3e28a714a @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 110\na=rtpmap:110 MP4A-LATM/\na=fmtp:110 BitrAte=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/523c4bb794171e98 b/pkg/format/testdata/fuzz/FuzzUnmarshal/523c4bb794171e98 new file mode 100644 index 00000000..fb1313f5 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/523c4bb794171e98 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 PCMA/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/5f7d6603a814b3a2 b/pkg/format/testdata/fuzz/FuzzUnmarshal/5f7d6603a814b3a2 new file mode 100644 index 00000000..0909e888 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/5f7d6603a814b3a2 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 AV1/90000\na=fmtp:96 profile=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/6577d661dc3e8ba2 b/pkg/format/testdata/fuzz/FuzzUnmarshal/6577d661dc3e8ba2 new file mode 100644 index 00000000..757f3af2 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/6577d661dc3e8ba2 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 MP4V-ES/90000\na=fmtp:96 Config=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/6900f94173f808ce b/pkg/format/testdata/fuzz/FuzzUnmarshal/6900f94173f808ce new file mode 100644 index 00000000..70c7ee77 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/6900f94173f808ce @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 MP4V-ES/90000\na=fmtp:96 Config=0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/6a7c1f14fe28275b b/pkg/format/testdata/fuzz/FuzzUnmarshal/6a7c1f14fe28275b new file mode 100644 index 00000000..27a43ed9 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/6a7c1f14fe28275b @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 VP8/90000\na=fmtp:96 mAX-fr=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/76d640019c196cbc b/pkg/format/testdata/fuzz/FuzzUnmarshal/76d640019c196cbc new file mode 100644 index 00000000..18e13757 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/76d640019c196cbc @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 MP4V-ES/90000\na=fmtp:96 profile-level-id=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/87f8e3c82de38c3e b/pkg/format/testdata/fuzz/FuzzUnmarshal/87f8e3c82de38c3e new file mode 100644 index 00000000..897e695c --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/87f8e3c82de38c3e @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H265/90000\na=fmtp:96 sprop-sps=0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/8fd80eda6c0e2f13 b/pkg/format/testdata/fuzz/FuzzUnmarshal/8fd80eda6c0e2f13 new file mode 100644 index 00000000..909fdf3d --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/8fd80eda6c0e2f13 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 opus//") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/91d47ea512cdda3c b/pkg/format/testdata/fuzz/FuzzUnmarshal/91d47ea512cdda3c new file mode 100644 index 00000000..0637ad3a --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/91d47ea512cdda3c @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 97\na=rtpmap:97 L16/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/92d2b72f40915528 b/pkg/format/testdata/fuzz/FuzzUnmarshal/92d2b72f40915528 new file mode 100644 index 00000000..d34e976a --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/92d2b72f40915528 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 VORBIS/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/96307de7e97ac685 b/pkg/format/testdata/fuzz/FuzzUnmarshal/96307de7e97ac685 new file mode 100644 index 00000000..856d7ad6 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/96307de7e97ac685 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H265/90000\na=fmtp:96 sprop-vps=0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/98200394850efb6f b/pkg/format/testdata/fuzz/FuzzUnmarshal/98200394850efb6f new file mode 100644 index 00000000..e2830901 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/98200394850efb6f @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 ConfiG=1010") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/9a290dfa7fa3b3c9 b/pkg/format/testdata/fuzz/FuzzUnmarshal/9a290dfa7fa3b3c9 new file mode 100644 index 00000000..433c7068 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/9a290dfa7fa3b3c9 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=fmtp:96 ;") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/9b47fdc0d0409444 b/pkg/format/testdata/fuzz/FuzzUnmarshal/9b47fdc0d0409444 new file mode 100644 index 00000000..55464764 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/9b47fdc0d0409444 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 VORBIS/0/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/a0ceb61cbc690724 b/pkg/format/testdata/fuzz/FuzzUnmarshal/a0ceb61cbc690724 new file mode 100644 index 00000000..c878664c --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/a0ceb61cbc690724 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 PCMA/0/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/a9a010cfdac9dc47 b/pkg/format/testdata/fuzz/FuzzUnmarshal/a9a010cfdac9dc47 new file mode 100644 index 00000000..20af3bcc --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/a9a010cfdac9dc47 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 multiopus/48000/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/afe443360ca786f8 b/pkg/format/testdata/fuzz/FuzzUnmarshal/afe443360ca786f8 new file mode 100644 index 00000000..9ec4c24d --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/afe443360ca786f8 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 profile-level-id=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/b2f5e634fa2e6a4e b/pkg/format/testdata/fuzz/FuzzUnmarshal/b2f5e634fa2e6a4e new file mode 100644 index 00000000..7e79531a --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/b2f5e634fa2e6a4e @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 RTP 96\na=rtpmap:96 H265/90000\na=fmtp:96 sprop-mAX-don-diff=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/b3784ea9b177385f b/pkg/format/testdata/fuzz/FuzzUnmarshal/b3784ea9b177385f new file mode 100644 index 00000000..c3b44f50 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/b3784ea9b177385f @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 opus/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/b6535f672b25662e b/pkg/format/testdata/fuzz/FuzzUnmarshal/b6535f672b25662e new file mode 100644 index 00000000..81bab814 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/b6535f672b25662e @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 VP9/90000\na=fmtp:96 mAX-fs=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/b654e108157859e4 b/pkg/format/testdata/fuzz/FuzzUnmarshal/b654e108157859e4 new file mode 100644 index 00000000..ec757305 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/b654e108157859e4 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 VP9/90000\na=fmtp:96 mAX-fr=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/b986bb7d07c6f72a b/pkg/format/testdata/fuzz/FuzzUnmarshal/b986bb7d07c6f72a new file mode 100644 index 00000000..dd274cd5 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/b986bb7d07c6f72a @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 110\na=rtpmap:110 MP4A-LATM/\na=fmtp:110 Config=0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/ba0dd5e9e3af186d b/pkg/format/testdata/fuzz/FuzzUnmarshal/ba0dd5e9e3af186d new file mode 100644 index 00000000..133aeb77 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/ba0dd5e9e3af186d @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 opus/48000/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/bd1f3d6f9c9af61b b/pkg/format/testdata/fuzz/FuzzUnmarshal/bd1f3d6f9c9af61b new file mode 100644 index 00000000..e402cd2d --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/bd1f3d6f9c9af61b @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 VORBIS//") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/c0e9e8ca3ca76b11 b/pkg/format/testdata/fuzz/FuzzUnmarshal/c0e9e8ca3ca76b11 new file mode 100644 index 00000000..d883a668 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/c0e9e8ca3ca76b11 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 AV1/90000\na=fmtp:96 level-idX=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/cf6df355fbd0f3ef b/pkg/format/testdata/fuzz/FuzzUnmarshal/cf6df355fbd0f3ef new file mode 100644 index 00000000..81fb354c --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/cf6df355fbd0f3ef @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 streAmtYpe=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/d0c09b9869788237 b/pkg/format/testdata/fuzz/FuzzUnmarshal/d0c09b9869788237 new file mode 100644 index 00000000..1ec2627e --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/d0c09b9869788237 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 VORBIS/0/0\na=fmtp:96 ConfigurAtion=0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/da69831ba96d38ce b/pkg/format/testdata/fuzz/FuzzUnmarshal/da69831ba96d38ce new file mode 100644 index 00000000..810dcf69 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/da69831ba96d38ce @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H265/90000\na=fmtp:96 sprop-pps=0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/ddde5138312670b5 b/pkg/format/testdata/fuzz/FuzzUnmarshal/ddde5138312670b5 new file mode 100644 index 00000000..7b5eb38c --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/ddde5138312670b5 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 multiopus/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/de14ef8edfc9fd56 b/pkg/format/testdata/fuzz/FuzzUnmarshal/de14ef8edfc9fd56 new file mode 100644 index 00000000..72517934 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/de14ef8edfc9fd56 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 AC3/0/A") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/e221a08a9ff51e3b b/pkg/format/testdata/fuzz/FuzzUnmarshal/e221a08a9ff51e3b new file mode 100644 index 00000000..78f7be4c --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/e221a08a9ff51e3b @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=fmtp:96 0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/e4a8f6640dba9776 b/pkg/format/testdata/fuzz/FuzzUnmarshal/e4a8f6640dba9776 new file mode 100644 index 00000000..3ce9add3 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/e4a8f6640dba9776 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 H265/90000\na=fmtp:96 sprop-pps=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/e4d4225b3bafe927 b/pkg/format/testdata/fuzz/FuzzUnmarshal/e4d4225b3bafe927 new file mode 100644 index 00000000..7ec7ea20 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/e4d4225b3bafe927 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 mode=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/e5541bd80eef8c03 b/pkg/format/testdata/fuzz/FuzzUnmarshal/e5541bd80eef8c03 new file mode 100644 index 00000000..298a1f33 --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/e5541bd80eef8c03 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 96\na=rtpmap:96 mpeg4-generiC/\na=fmtp:96 IndeXDeltALength=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/e5ebd400c30d4ee0 b/pkg/format/testdata/fuzz/FuzzUnmarshal/e5ebd400c30d4ee0 new file mode 100644 index 00000000..44a47afe --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/e5ebd400c30d4ee0 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 VP9/90000\na=fmtp:96 profile-id=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/f076a0e487d5c86b b/pkg/format/testdata/fuzz/FuzzUnmarshal/f076a0e487d5c86b new file mode 100644 index 00000000..354587bf --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/f076a0e487d5c86b @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=audio 0 AVP 110\na=rtpmap:110 MP4A-LATM/\na=fmtp:110 Config=") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshal/f64c2ab9f4956c76 b/pkg/format/testdata/fuzz/FuzzUnmarshal/f64c2ab9f4956c76 new file mode 100644 index 00000000..524607fd --- /dev/null +++ b/pkg/format/testdata/fuzz/FuzzUnmarshal/f64c2ab9f4956c76 @@ -0,0 +1,2 @@ +go test fuzz v1 +string("m=video 0 AVP 96\na=rtpmap:96 /") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/1125f325323e9fc7 b/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/1125f325323e9fc7 deleted file mode 100644 index cada3db7..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/1125f325323e9fc7 +++ /dev/null @@ -1,7 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string(" \x17T\x9b") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/b00e47b24d2e9cb9 b/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/b00e47b24d2e9cb9 deleted file mode 100644 index 18186876..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/b00e47b24d2e9cb9 +++ /dev/null @@ -1,7 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(true) -string("") -bool(false) -string("7XXB") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/eebf8f9815961809 b/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/eebf8f9815961809 deleted file mode 100644 index 11537806..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalAV1/eebf8f9815961809 +++ /dev/null @@ -1,7 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH264/04eaaf225372ea22 b/pkg/format/testdata/fuzz/FuzzUnmarshalH264/04eaaf225372ea22 deleted file mode 100644 index 39b6af49..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH264/04eaaf225372ea22 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH264/5075dbc90b7b6a98 b/pkg/format/testdata/fuzz/FuzzUnmarshalH264/5075dbc90b7b6a98 deleted file mode 100644 index 7552e273..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH264/5075dbc90b7b6a98 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(true) -string("1,") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH264/92341614cac990f4 b/pkg/format/testdata/fuzz/FuzzUnmarshalH264/92341614cac990f4 deleted file mode 100644 index df0956f0..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH264/92341614cac990f4 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(true) -string(",0") -bool(true) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/2daed44edfbf6eb6 b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/2daed44edfbf6eb6 deleted file mode 100644 index 2a904ace..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/2daed44edfbf6eb6 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("6") -bool(true) -string("\v\xd7F?O\xc1\x86\t") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/33e4616183c38258 b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/33e4616183c38258 deleted file mode 100644 index c476f83d..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/33e4616183c38258 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("\xd9\xf3fdž\xd7\xf6\x1d6") -bool(true) -string("\v\xd7F?O\xc1\x86\t") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/6eb4ff7048b704f4 b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/6eb4ff7048b704f4 deleted file mode 100644 index 39b6af49..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/6eb4ff7048b704f4 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/7110e314ad342f4f b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/7110e314ad342f4f deleted file mode 100644 index c4bee601..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/7110e314ad342f4f +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(true) -string("0") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/c7ec2102ba02e189 b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/c7ec2102ba02e189 deleted file mode 100644 index 504e2bdd..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalH265/c7ec2102ba02e189 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("6") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 b/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 deleted file mode 100644 index da98342e..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 +++ /dev/null @@ -1,2 +0,0 @@ -go test fuzz v1 -string("0/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c b/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c deleted file mode 100644 index 9d842673..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c +++ /dev/null @@ -1,2 +0,0 @@ -go test fuzz v1 -string("A") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/20a4b86e7f3eb21a b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/20a4b86e7f3eb21a deleted file mode 100644 index d29071e7..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/20a4b86e7f3eb21a +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/27784d49f1893338 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/27784d49f1893338 deleted file mode 100644 index d5e65554..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/27784d49f1893338 +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") -bool(true) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/2bb30ba1c4453253 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/2bb30ba1c4453253 deleted file mode 100644 index 882cb554..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/2bb30ba1c4453253 +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(true) -string("wB\xaa(A\x0e}") -bool(true) -string("\xe4o\xe0^\xae\t") -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("D") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/476ec3e9138c8eb5 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/476ec3e9138c8eb5 deleted file mode 100644 index ef4cedf9..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/476ec3e9138c8eb5 +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/4af8a7dd6093eb24 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/4af8a7dd6093eb24 deleted file mode 100644 index 8d5149be..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/4af8a7dd6093eb24 +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string("") -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/5d992b86416286cb b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/5d992b86416286cb deleted file mode 100644 index 80fd4e13..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/5d992b86416286cb +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") -bool(true) -string("u7\xae") -bool(true) -string("") -bool(true) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/731691b15fbea80a b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/731691b15fbea80a deleted file mode 100644 index 3d235782..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/731691b15fbea80a +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/8b4ed3e41f9c83a2 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/8b4ed3e41f9c83a2 deleted file mode 100644 index 0a5168fc..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/8b4ed3e41f9c83a2 +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/bfe2ad2a3698abb3 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/bfe2ad2a3698abb3 deleted file mode 100644 index b0fe440f..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/bfe2ad2a3698abb3 +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") -bool(true) -string("") -bool(false) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/d8485f52680b1799 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/d8485f52680b1799 deleted file mode 100644 index 3654e1c9..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/d8485f52680b1799 +++ /dev/null @@ -1,15 +0,0 @@ -go test fuzz v1 -bool(false) -string("0") -bool(false) -string("") -bool(false) -string("0") -bool(true) -string("1010") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/1257c728665a4688 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/1257c728665a4688 deleted file mode 100644 index b6880c4c..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/1257c728665a4688 +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/2fb2d97e2adc8960 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/2fb2d97e2adc8960 deleted file mode 100644 index 1675bf42..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/2fb2d97e2adc8960 +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/3553983aa018ca4e b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/3553983aa018ca4e deleted file mode 100644 index 5d7e9552..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/3553983aa018ca4e +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/4b1485d4a1427dc3 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/4b1485d4a1427dc3 deleted file mode 100644 index 8ebd1c7f..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/4b1485d4a1427dc3 +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") -bool(true) -string("") -bool(false) -string("") -bool(true) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/75b3662d71eadc76 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/75b3662d71eadc76 deleted file mode 100644 index 24993f2a..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/75b3662d71eadc76 +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string("") -bool(true) -string("") -bool(false) -string("") -bool(false) -string("") -bool(false) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/760672708ba53010 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/760672708ba53010 deleted file mode 100644 index c64b105f..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/760672708ba53010 +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(false) -string("0") -bool(false) -string("") -bool(true) -string("") -bool(true) -string("0") -bool(false) -string("0") -bool(true) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f0052bccde74165b b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f0052bccde74165b deleted file mode 100644 index 416d6456..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f0052bccde74165b +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(false) -string("0") -bool(true) -string("0") -bool(true) -string("0") -bool(true) -string("70102010") -bool(true) -string("0") -bool(true) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f08cb14faaf3bac7 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f08cb14faaf3bac7 deleted file mode 100644 index 1beb8aa3..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f08cb14faaf3bac7 +++ /dev/null @@ -1,13 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(true) -string("0") -bool(false) -string("0") -bool(true) -string("70002010") -bool(true) -string("0") -bool(true) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/4cbba342f17447d3 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/4cbba342f17447d3 deleted file mode 100644 index 05987de5..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/4cbba342f17447d3 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/6eb4ff7048b704f4 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/6eb4ff7048b704f4 deleted file mode 100644 index 39b6af49..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/6eb4ff7048b704f4 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/834909e9c5ac9ffb b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/834909e9c5ac9ffb deleted file mode 100644 index 113545c1..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/834909e9c5ac9ffb +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(true) -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 b/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 deleted file mode 100644 index ee3f3399..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 +++ /dev/null @@ -1,2 +0,0 @@ -go test fuzz v1 -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 b/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 deleted file mode 100644 index e4946606..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 +++ /dev/null @@ -1,2 +0,0 @@ -go test fuzz v1 -string("/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalOpusMulti/771e938e4458e983 b/pkg/format/testdata/fuzz/FuzzUnmarshalOpusMulti/771e938e4458e983 deleted file mode 100644 index ee3f3399..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalOpusMulti/771e938e4458e983 +++ /dev/null @@ -1,2 +0,0 @@ -go test fuzz v1 -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalOpusMulti/9cd9b70960b4a733 b/pkg/format/testdata/fuzz/FuzzUnmarshalOpusMulti/9cd9b70960b4a733 deleted file mode 100644 index e4946606..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalOpusMulti/9cd9b70960b4a733 +++ /dev/null @@ -1,2 +0,0 @@ -go test fuzz v1 -string("/") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/92bbe9945f7ff439 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/92bbe9945f7ff439 deleted file mode 100644 index 0db09db9..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/92bbe9945f7ff439 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(true) -string("A") -bool(false) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/baa4de9a6a973e87 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/baa4de9a6a973e87 deleted file mode 100644 index e8dc64ea..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/baa4de9a6a973e87 +++ /dev/null @@ -1,5 +0,0 @@ -go test fuzz v1 -bool(false) -string("0") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/24b8bd12666dcd48 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/24b8bd12666dcd48 deleted file mode 100644 index 358aa694..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/24b8bd12666dcd48 +++ /dev/null @@ -1,7 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(true) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/a108f706bad26777 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/a108f706bad26777 deleted file mode 100644 index fb0d5f34..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/a108f706bad26777 +++ /dev/null @@ -1,7 +0,0 @@ -go test fuzz v1 -bool(false) -string("") -bool(false) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/be47706b29845dac b/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/be47706b29845dac deleted file mode 100644 index 73ba578c..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/be47706b29845dac +++ /dev/null @@ -1,7 +0,0 @@ -go test fuzz v1 -bool(true) -string("") -bool(false) -string("") -bool(true) -string("") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 b/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 deleted file mode 100644 index 8798f740..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 +++ /dev/null @@ -1,3 +0,0 @@ -go test fuzz v1 -string("/") -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b b/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b deleted file mode 100644 index d1de66a1..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b +++ /dev/null @@ -1,3 +0,0 @@ -go test fuzz v1 -string("0/0") -string("0") diff --git a/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 b/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 deleted file mode 100644 index a7213182..00000000 --- a/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 +++ /dev/null @@ -1,3 +0,0 @@ -go test fuzz v1 -string("0/") -string("0") diff --git a/pkg/format/vorbis_test.go b/pkg/format/vorbis_test.go index 592f1668..b1200969 100644 --- a/pkg/format/vorbis_test.go +++ b/pkg/format/vorbis_test.go @@ -18,15 +18,3 @@ func TestVorbisAttributes(t *testing.T) { require.Equal(t, 48000, format.ClockRate()) require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{})) } - -func FuzzUnmarshalVorbis(f *testing.F) { - f.Fuzz(func(_ *testing.T, a, b string) { - fo, err := Unmarshal("audio", 96, "Vorbis/"+a, map[string]string{ - "configuration": b, - }) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} diff --git a/pkg/format/vp8_test.go b/pkg/format/vp8_test.go index 3219f571..e57d8688 100644 --- a/pkg/format/vp8_test.go +++ b/pkg/format/vp8_test.go @@ -33,29 +33,3 @@ func TestVP8DecEncoder(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts) } - -func FuzzUnmarshalVP8(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - ) { - ma := map[string]string{} - - if a { - ma["max-fr"] = b - } - - if c { - ma["max-fs"] = d - } - - fo, err := Unmarshal("audio", 96, "VP8/90000", ma) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -} diff --git a/pkg/format/vp9_test.go b/pkg/format/vp9_test.go index b8cd82ba..46bcf66d 100644 --- a/pkg/format/vp9_test.go +++ b/pkg/format/vp9_test.go @@ -33,35 +33,3 @@ func TestVP9DecEncoder(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34}, byts) } - -func FuzzUnmarshalVP9(f *testing.F) { - f.Fuzz(func( - _ *testing.T, - a bool, - b string, - c bool, - d string, - e bool, - f string, - ) { - ma := map[string]string{} - - if a { - ma["max-fr"] = b - } - - if c { - ma["max-fs"] = d - } - - if e { - ma["profile-id"] = f - } - - fo, err := Unmarshal("audio", 96, "VP9/90000", ma) - if err == nil { - fo.RTPMap() - fo.FMTP() - } - }) -}