rtp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

type Packet struct {
	Raw              []byte
	Version          uint8
	Padding          bool
	Extension        bool
	Marker           bool
	PayloadOffset    int
	PayloadType      uint8
	SequenceNumber   uint16
	Timestamp        uint32
	SSRC             uint32
	CSRC             []uint32
	ExtensionProfile uint16
	ExtensionPayload []byte
	Payload          []byte
}

Packet represents an RTP Packet RTP is a network protocol for delivering audio and video over IP networks.

func (*Packet) Marshal

func (p *Packet) Marshal() ([]byte, error)

Marshal returns a raw RTP packet for the instance it is called upon

func (*Packet) Unmarshal

func (p *Packet) Unmarshal(rawPacket []byte) error

Unmarshal parses the passed byte slice and stores the result in the Packet this method is called upon

type Packetizer

type Packetizer interface {
	Packetize(payload []byte, samples uint32) []*Packet
}

Packetizer packetizes a payload

func NewPacketizer

func NewPacketizer(mtu int, pt uint8, ssrc uint32, payloader Payloader, sequencer Sequencer, clockRate uint32) Packetizer

NewPacketizer returns a new instance of a Packetizer for a specific payloader

type Payloader

type Payloader interface {
	Payload(mtu int, payload []byte) [][]byte
}

Payloader payloads a byte array for use as rtp.Packet payloads

type Sequencer

type Sequencer interface {
	NextSequenceNumber() uint16
	RollOverCount() uint64
}

Sequencer generates sequential sequence numbers for building RTP packets

func NewFixedSequencer

func NewFixedSequencer(s uint16) Sequencer

NewFixedSequencer returns a new sequencer starting from a specific sequence number

func NewRandomSequencer

func NewRandomSequencer() Sequencer

NewRandomSequencer returns a new sequencer starting from a random sequence number

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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