mirror of
https://github.com/harshabose/transcode.git
synced 2025-10-13 00:13:44 +08:00
first-commit
This commit is contained in:
@@ -3,6 +3,7 @@ package internal
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/harshabose/tools/buffer/pkg"
|
||||
"github.com/pion/rtp"
|
||||
)
|
||||
|
||||
@@ -10,6 +11,16 @@ type rtpPool struct {
|
||||
pool sync.Pool
|
||||
}
|
||||
|
||||
func CreateRTPPool() buffer.Pool[rtp.Packet] {
|
||||
return &rtpPool{
|
||||
pool: sync.Pool{
|
||||
New: func() any {
|
||||
return &rtp.Packet{}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (pool *rtpPool) Get() *rtp.Packet {
|
||||
packet, ok := pool.pool.Get().(*rtp.Packet)
|
||||
|
||||
|
Reference in New Issue
Block a user