PacketFactory allows custom logic around the handle of RTP Packets before they added to the RTPBuffer.
The NoOpPacketFactory doesn't copy packets, while the RetainablePacket will take a copy before adding.( PacketFactory) NewPacket(header *rtp.Header, payload []byte, rtxSsrc uint32, rtxPayloadType uint8) (*RetainablePacket, error)
*PacketFactoryCopy
*PacketFactoryNoOp
PacketFactoryCopy is PacketFactory that takes a copy of packets when added to the RTPBuffer. NewPacket constructs a new RetainablePacket that can be added to the RTPBuffer.
*PacketFactoryCopy : PacketFactory
func NewPacketFactoryCopy() *PacketFactoryCopy
PacketFactoryNoOp is a PacketFactory implementation that doesn't copy packets. NewPacket constructs a new RetainablePacket that can be added to the RTPBuffer.
*PacketFactoryNoOp : PacketFactory
RetainablePacket is a referenced counted RTP packet. Header returns the RTP Header of the RetainablePacket. Payload returns the RTP Payload of the RetainablePacket. Release decreases the reference count of the RetainablePacket and frees if needed. Retain increases the reference count of the RetainablePacket.
func PacketFactory.NewPacket(header *rtp.Header, payload []byte, rtxSsrc uint32, rtxPayloadType uint8) (*RetainablePacket, error)
func (*PacketFactoryCopy).NewPacket(header *rtp.Header, payload []byte, rtxSsrc uint32, rtxPayloadType uint8) (*RetainablePacket, error)
func (*PacketFactoryNoOp).NewPacket(header *rtp.Header, payload []byte, _ uint32, _ uint8) (*RetainablePacket, error)
func (*RTPBuffer).Get(seq uint16) *RetainablePacket
func (*RTPBuffer).Add(packet *RetainablePacket)
RTPBuffer stores RTP packets and allows custom logic
around the lifetime of them via the PacketFactory. Add places the RetainablePacket in the RTPBuffer. Get returns the RetainablePacket for the requested sequence number.
func NewRTPBuffer(size uint16) (*RTPBuffer, error)
Package-Level Functions (total 2)
NewPacketFactoryCopy constructs a PacketFactory that takes a copy of packets when added to the RTPBuffer.
NewRTPBuffer constructs a new RTPBuffer.
Package-Level Variables (only one)
ErrInvalidSize is returned by newReceiveLog/newRTPBuffer, when an incorrect buffer size is supplied.
Package-Level Constants (only one)
Uint16SizeHalf is half of a math.Uint16.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.