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

Method GetFromPool

track/media.go:109–117  ·  view source on GitHub ↗
(b util.IBytes)

Source from the content-addressed store, hash-verified

107}
108
109func (av *Media) GetFromPool(b util.IBytes) (item util.LIBP) {
110 if b.Reuse() {
111 item = av.BytesPool.Get(b.Len())
112 copy(item.Value, b.Bytes())
113 } else {
114 return av.BytesPool.GetShell(b.Bytes())
115 }
116 return
117}
118
119func (av *Media) GetRTPFromPool() (result *LIRTP) {
120 result = av.RtpPool.Get()

Callers

nothing calls this directly

Calls 5

GetShellMethod · 0.80
ReuseMethod · 0.65
LenMethod · 0.65
BytesMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected