This commit is contained in:
Alessandro Ros
2024-04-29 10:22:27 +02:00
committed by GitHub
parent 363b48e632
commit 1d60608b6b
4 changed files with 28 additions and 12 deletions

View File

@@ -39,7 +39,7 @@ var cases = []struct {
}{
{
"single",
[]byte{0x01, 0x02, 0x03, 0x04},
[]byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34},
[]*rtp.Packet{
{
Header: rtp.Header{
@@ -49,13 +49,20 @@ var cases = []struct {
SequenceNumber: 17645,
SSRC: 0x9dbb7812,
},
Payload: []byte{0x9c, 0xb5, 0xaf, 0x01, 0x02, 0x03, 0x04},
Payload: []byte{
0x8f, 0xb5, 0xaf, 0x18, 0x07, 0x80, 0x03, 0x24,
0x01, 0x14, 0x01, 0x82, 0x49, 0x83, 0x42, 0x00,
0x77, 0xf0, 0x32, 0x34,
},
},
},
},
{
"fragmented",
bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 4096/4),
mergeBytes(
[]byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34},
bytes.Repeat([]byte{1, 2, 3, 4}, 4096/4),
),
[]*rtp.Packet{
{
Header: rtp.Header{
@@ -65,7 +72,13 @@ var cases = []struct {
SequenceNumber: 17645,
SSRC: 0x9dbb7812,
},
Payload: mergeBytes([]byte{0x98, 0xb5, 0xaf}, bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 364), []byte{0x01}),
Payload: mergeBytes(
[]byte{
0x8b, 0xb5, 0xaf, 0x18, 0x07, 0x80, 0x03, 0x24,
0x01, 0x14, 0x01, 0x82, 0x49, 0x83, 0x42, 0x00,
0x77, 0xf0, 0x32, 0x34,
},
bytes.Repeat([]byte{1, 2, 3, 4}, 360)),
},
{
Header: rtp.Header{
@@ -75,8 +88,9 @@ var cases = []struct {
SequenceNumber: 17646,
SSRC: 0x9dbb7812,
},
Payload: mergeBytes([]byte{0x90, 0xb5, 0xaf, 0x02, 0x03, 0x04},
bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 363), []byte{0x01, 0x02}),
Payload: mergeBytes(
[]byte{0x81, 0xb5, 0xaf},
bytes.Repeat([]byte{1, 2, 3, 4}, 364), []byte{1}),
},
{
Header: rtp.Header{
@@ -86,7 +100,9 @@ var cases = []struct {
SequenceNumber: 17647,
SSRC: 0x9dbb7812,
},
Payload: mergeBytes([]byte{0x94, 0xb5, 0xaf, 0x03, 0x04}, bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 295)),
Payload: mergeBytes(
[]byte{0x85, 0xb5, 0xaf, 2, 3, 4},
bytes.Repeat([]byte{1, 2, 3, 4}, 299)),
},
},
},