rtp

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const RTP_FIX_HEAD_LEN = 12

Variables

This section is empty.

Functions

This section is empty.

Types

type AACPacker

type AACPacker struct {
	CommPacker
	// contains filtered or unexported fields
}

func NewAACPacker

func NewAACPacker(pt uint8, ssrc uint32, sequence uint16, mtu int) *AACPacker

func (*AACPacker) Pack

func (packer *AACPacker) Pack(data []byte, timestamp uint32) error

type AACUnPacker

type AACUnPacker struct {
	CommUnPacker
	// contains filtered or unexported fields
}

func NewAACUnPacker

func NewAACUnPacker(sizeLength int, indexLength int, asc []byte) *AACUnPacker

func (*AACUnPacker) UnPack

func (unpacker *AACUnPacker) UnPack(pkt []byte) error

type CommPacker

type CommPacker struct {
	// contains filtered or unexported fields
}

func (*CommPacker) HookRtp

func (pack *CommPacker) HookRtp(cb RTP_HOOK_FUNC)

func (*CommPacker) OnPacket

func (pack *CommPacker) OnPacket(onPkt ON_RTP_PKT_FUNC)

func (*CommPacker) SetMtu

func (pack *CommPacker) SetMtu(mtu int)

type CommUnPacker

type CommUnPacker struct {
	// contains filtered or unexported fields
}

func (*CommUnPacker) HookRtp

func (unpack *CommUnPacker) HookRtp(cb RTP_HOOK_FUNC)

func (*CommUnPacker) OnFrame

func (unpack *CommUnPacker) OnFrame(onframe ON_FRAME_FUNC)

type G711Packer

type G711Packer struct {
	CommPacker
	// contains filtered or unexported fields
}

func NewG711Packer

func NewG711Packer(pt uint8, ssrc uint32, sequence uint16, mtu int) *G711Packer

func (*G711Packer) Pack

func (packer *G711Packer) Pack(data []byte, timestamp uint32) error

type G711UnPacker

type G711UnPacker struct {
	CommUnPacker
}

func NewG711UnPacker

func NewG711UnPacker() *G711UnPacker

func (*G711UnPacker) UnPack

func (unpacker *G711UnPacker) UnPack(pkt []byte) error

type H264Packer

type H264Packer struct {
	CommPacker
	// contains filtered or unexported fields
}

func NewH264Packer

func NewH264Packer(pt uint8, ssrc uint32, sequence uint16, mtu int) *H264Packer

func (*H264Packer) EnableStapA

func (pack *H264Packer) EnableStapA()

func (*H264Packer) Pack

func (pack *H264Packer) Pack(frame []byte, timestamp uint32) (err error)

type H264UnPacker

type H264UnPacker struct {
	CommUnPacker
	// contains filtered or unexported fields
}

func NewH264UnPacker

func NewH264UnPacker() *H264UnPacker

func (*H264UnPacker) UnPack

func (unpacker *H264UnPacker) UnPack(pkt []byte) error

type H265Packer

type H265Packer struct {
	CommPacker
	// contains filtered or unexported fields
}

func NewH265Packer

func NewH265Packer(pt uint8, ssrc uint32, sequence uint16, mtu int) *H265Packer

func (*H265Packer) Pack

func (h265 *H265Packer) Pack(data []byte, timestamp uint32) error

type H265UnPacker

type H265UnPacker struct {
	CommUnPacker
	// contains filtered or unexported fields
}

func NewH265UnPacker

func NewH265UnPacker() *H265UnPacker

func (*H265UnPacker) UnPack

func (unpacker *H265UnPacker) UnPack(pkt []byte) error

type ON_FRAME_FUNC

type ON_FRAME_FUNC func(frame []byte, timestamp uint32, lost bool)

type ON_RTP_PKT_FUNC

type ON_RTP_PKT_FUNC func(pkt []byte) error

type Packer

type Packer interface {
	Pack(data []byte, timestamp uint32) error
	HookRtp(cb RTP_HOOK_FUNC)
	SetMtu(mtu int)
	OnPacket(onPkt ON_RTP_PKT_FUNC)
}

type RTP_HOOK_FUNC

type RTP_HOOK_FUNC func(pkg *RtpPacket)

type RtpHdr

type RtpHdr struct {
	Version        uint8
	PaddingFlag    uint8
	ExtensionFlag  uint8
	CC             uint8
	Marker         uint8
	PayloadType    uint8
	SequenceNumber uint16
	Timestamp      uint32
	SSRC           uint32
	CSRC           []uint32
}

func (*RtpHdr) Decode

func (head *RtpHdr) Decode(pkt []byte) (int, error)

func (*RtpHdr) Encode

func (head *RtpHdr) Encode() []byte

type RtpPacket

type RtpPacket struct {
	Header     RtpHdr
	Extensions []byte
	Payload    []byte
	Padding    []byte
}

func (*RtpPacket) Decode

func (pkg *RtpPacket) Decode(data []byte) error

func (*RtpPacket) Encode

func (pkg *RtpPacket) Encode() []byte

type TsPacker

type TsPacker struct {
	CommPacker
	// contains filtered or unexported fields
}

func NewTsPacker

func NewTsPacker(pt uint8, ssrc uint32, sequence uint16, mtu int) *TsPacker

func (*TsPacker) Pack

func (pack *TsPacker) Pack(data []byte, timestamp uint32) error

type TsUnPacker

type TsUnPacker struct {
	CommUnPacker
	// contains filtered or unexported fields
}

func NewTsUnPacker

func NewTsUnPacker() *TsUnPacker

func (*TsUnPacker) UnPack

func (unpacker *TsUnPacker) UnPack(pkt []byte) error

type UnPacker

type UnPacker interface {
	OnFrame(onframe ON_FRAME_FUNC)
	UnPack(pkt []byte) error
	HookRtp(cb RTP_HOOK_FUNC)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL