MCPcopy
hub / github.com/livekit/livekit / Marshal

Method Marshal

pkg/rtc/datatrack/packet.go:279–286  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277}
278
279func (p *Packet) Marshal() ([]byte, error) {
280 buf := make([]byte, p.Header.MarshalSize()+len(p.Payload))
281 if err := p.MarshalTo(buf); err != nil {
282 return nil, err
283 }
284
285 return buf, nil
286}
287
288func (p *Packet) MarshalTo(buf []byte) error {
289 size := p.Header.MarshalSize() + len(p.Payload)

Callers 15

TestPacketFunction · 0.95
GenerateRawDataPacketsFunction · 0.95
GetTestExtPacketFunction · 0.95
TestNackFunction · 0.95
TestFractionLostReportFunction · 0.95
TestCodecChangeFunction · 0.95
TestFilteringCandidatesFunction · 0.45
preparePCMethod · 0.45
filterCandidatesMethod · 0.45
TestDataChannelFunction · 0.45

Calls 2

MarshalToMethod · 0.95
MarshalSizeMethod · 0.45

Tested by 6

TestPacketFunction · 0.76
TestNackFunction · 0.76
TestFractionLostReportFunction · 0.76
TestCodecChangeFunction · 0.76
TestFilteringCandidatesFunction · 0.36
TestDataChannelFunction · 0.36