mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 23:02:45 +08:00
25 lines
420 B
Go
25 lines
420 B
Go
package gortsplib
|
|
|
|
import (
|
|
"github.com/pion/rtp"
|
|
)
|
|
|
|
type rtpPacketMultiBuffer struct {
|
|
count uint64
|
|
buffers []rtp.Packet
|
|
cur uint64
|
|
}
|
|
|
|
func newRTPPacketMultiBuffer(count uint64) *rtpPacketMultiBuffer {
|
|
return &rtpPacketMultiBuffer{
|
|
count: count,
|
|
buffers: make([]rtp.Packet, count),
|
|
}
|
|
}
|
|
|
|
func (mb *rtpPacketMultiBuffer) next() *rtp.Packet {
|
|
ret := &mb.buffers[mb.cur%mb.count]
|
|
mb.cur++
|
|
return ret
|
|
}
|