simplify format.Unmarshal; improve tests (#631)

This commit is contained in:
Alessandro Ros
2024-10-09 16:21:01 +02:00
committed by GitHub
parent 605f3e4972
commit 1ca217ae3a
117 changed files with 594 additions and 1242 deletions

View File

@@ -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" +