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

Function TestPacketizer

packetizer_test.go:12–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestPacketizer(t *testing.T) {
13 multiplepayload := make([]byte, 128)
14 // use the G722 payloader here, because it's very simple and all 0s is valid G722 data.
15 packetizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewRandomSequencer(), 90000)
16 packets := packetizer.Packetize(multiplepayload, 2000)
17
18 if len(packets) != 2 {
19 packetlengths := ""
20 for i := 0; i < len(packets); i++ {
21 packetlengths += fmt.Sprintf("Packet %d length %d\n", i, len(packets[i].Payload))
22 }
23 t.Fatalf("Generated %d packets instead of 2\n%s", len(packets), packetlengths)
24 }
25}
26
27func TestPacketizer_AbsSendTime(t *testing.T) {
28 // use the G722 payloader here, because it's very simple and all 0s is valid G722 data.

Callers

nothing calls this directly

Calls 3

PacketizeMethod · 0.95
NewPacketizerFunction · 0.85
NewRandomSequencerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…