MCPcopy Create free account
hub / github.com/pion/rtp / TestRFC8285TwoByteMultipleExtensionsWithLargeExtension

Function TestRFC8285TwoByteMultipleExtensionsWithLargeExtension

packet_test.go:412–468  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

410}
411
412func TestRFC8285TwoByteMultipleExtensionsWithLargeExtension(t *testing.T) {
413 // 0 1 2 3
414 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
415 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
416 // | 0x10 | 0x00 | length=3 |
417 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
418 // | ID=1 | L=0 | ID=2 | L=1 |
419 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
420 // | data | ID=3 | L=17 | data...
421 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
422 // ...data...
423 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
424 // ...data...
425 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
426 // ...data...
427 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
428 // ...data... |
429 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
430 rawPkt := []byte{
431 0x90, 0xe0, 0x69, 0x8f, 0xd9, 0xc2, 0x93, 0xda, 0x1c, 0x64,
432 0x27, 0x82, 0x10, 0x00, 0x00, 0x06, 0x01, 0x00, 0x02, 0x01,
433 0xBB, 0x03, 0x11, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
434 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
435 // Payload
436 0x98, 0x36, 0xbe, 0x88, 0x9e,
437 }
438
439 p := &Packet{
440 Header: Header{
441 Marker: true,
442 Extension: true,
443 ExtensionProfile: 0x1000,
444 Extensions: []Extension{
445 {1, []byte{}},
446 {2, []byte{
447 0xBB,
448 }},
449 {3, []byte{
450 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
451 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
452 }},
453 },
454 Version: 2,
455 PayloadType: 96,
456 SequenceNumber: 27023,
457 Timestamp: 3653407706,
458 SSRC: 476325762,
459 CSRC: []uint32{},
460 },
461 Payload: rawPkt[40:],
462 }
463
464 dstData, _ := p.Marshal()
465 if !bytes.Equal(dstData, rawPkt) {
466 t.Errorf("Marshal failed raw \nMarshaled: %+v,\nrawPkt: %+v", dstData, rawPkt)
467 }
468}
469

Callers

nothing calls this directly

Calls 1

MarshalMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…