MCPcopy Create free account
hub / github.com/Monibuca/engine / GetRTPFromPool

Method GetRTPFromPool

track/media.go:119–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117}
118
119func (av *Media) GetRTPFromPool() (result *LIRTP) {
120 result = av.RtpPool.Get()
121 if result.Value.Packet == nil {
122 result.Value.Packet = &rtp.Packet{}
123 result.Value.PayloadType = av.PayloadType
124 result.Value.SSRC = av.SSRC
125 result.Value.Version = 2
126 result.Value.Raw = make([]byte, 1460)
127 }
128 result.Value.Raw = result.Value.Raw[:1460]
129 result.Value.Payload = result.Value.Raw[:0]
130 return
131}
132
133// 为json序列化而计算的数据
134func (av *Media) SnapForJson() {

Callers 1

PacketizeRTPMethod · 0.95

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected