rtcp

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_SEQUENTIAL = 2
	RTP_SEQ_MOD    = 1 << 16
	MAX_DROPOUT    = 3000
	MAX_MISORDER   = 100
)
View Source
const (
	SDES_CNAME = 1
	SDES_NAME  = 2
	SDES_EMAIL = 3
	SDES_PHONE = 4
	SDES_LOC   = 5
	SDES_TOOL  = 6
	SDES_NOTE  = 7
	SDES_PRIV  = 8
)
View Source
const (
	RTCP_SR   = 200
	RTCP_RR   = 201
	RTCP_SDES = 202
	RTCP_BYE  = 203
	RTCP_APP  = 204
)

Variables

This section is empty.

Functions

func NTP2UtcClock

func NTP2UtcClock(ntp uint64) time.Time

func UtcClockToNTP

func UtcClockToNTP(t time.Time) uint64

Types

type App

type App struct {
	Comm
	SubType uint8
	SSRC    uint32
	Name    []byte
	AppData []byte
}

func NewApp

func NewApp() *App

func (*App) Decode

func (pkt *App) Decode(data []byte) error

func (*App) Encode

func (pkt *App) Encode() []byte

type Bye

type Bye struct {
	Comm
	SC        uint8
	ReasonLen uint8
	Reason    string
	SSRCS     []uint32
}

func NewBye

func NewBye() *Bye

func (*Bye) Decode

func (pkt *Bye) Decode(data []byte) error

func (*Bye) Encode

func (pkt *Bye) Encode() []byte

type ChunkItem

type ChunkItem struct {
	Type   uint8
	Length uint8
	Txt    []byte
}

func MakeCNameItem

func MakeCNameItem(name []byte) *ChunkItem

func (*ChunkItem) Encode

func (item *ChunkItem) Encode() []byte

type Comm

type Comm struct {
	Padding     bool
	PT          uint8
	Length      uint16
	PayloadLen  uint16
	PaddingData []byte
}

func (*Comm) Decode

func (pkt *Comm) Decode(data []byte) error

func (*Comm) Encode

func (pkt *Comm) Encode() []byte

type ReceiverReport

type ReceiverReport struct {
	Comm
	RC     uint8
	SSRC   uint32
	Blocks []ReportBlock
}

func NewReceiverReport

func NewReceiverReport() *ReceiverReport

func (*ReceiverReport) Decode

func (pkt *ReceiverReport) Decode(data []byte) error

func (*ReceiverReport) Encode

func (pkt *ReceiverReport) Encode() []byte

type ReportBlock

type ReportBlock struct {
	SSRC             uint32
	Fraction         uint8
	Lost             uint32
	ExtendHighestSeq uint32
	Jitter           uint32
	Lsr              uint32
	Dlsr             uint32
}

func (*ReportBlock) Decode

func (rb *ReportBlock) Decode(data []byte) error

func (*ReportBlock) Encode

func (rb *ReportBlock) Encode() []byte

type RtcpContext

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

func NewRtcpContext

func NewRtcpContext(ssrc uint32, seq uint16, sampleRate uint32) *RtcpContext

func (*RtcpContext) GenerateApp

func (ctx *RtcpContext) GenerateApp(name string, data []byte) *App

func (*RtcpContext) GenerateBye

func (ctx *RtcpContext) GenerateBye() *Bye

func (*RtcpContext) GenerateRR

func (ctx *RtcpContext) GenerateRR() *ReceiverReport

func (*RtcpContext) GenerateSDES

func (ctx *RtcpContext) GenerateSDES(sdesType uint8, txt string) *SourceDescription

func (*RtcpContext) GenerateSR

func (ctx *RtcpContext) GenerateSR() *SenderReport

func (*RtcpContext) ReceivedRtp

func (ctx *RtcpContext) ReceivedRtp(pkt *rtp.RtpPacket)

func (*RtcpContext) ReceivedSR

func (ctx *RtcpContext) ReceivedSR(sr *SenderReport)

func (*RtcpContext) SendRtp

func (ctx *RtcpContext) SendRtp(pkt *rtp.RtpPacket)

type SDESChunk

type SDESChunk struct {
	SSRC uint32
	Item *ChunkItem
}

type SenderReport

type SenderReport struct {
	Comm
	RC              uint8
	SSRC            uint32
	NTP             uint64
	RtpTimestamp    uint32
	SendPacketCount uint32
	SendOctetCount  uint32
	Blocks          []ReportBlock
}

func NewSenderReport

func NewSenderReport() *SenderReport

func (*SenderReport) Decode

func (pkt *SenderReport) Decode(data []byte) error

func (*SenderReport) Encode

func (pkt *SenderReport) Encode() []byte

type SourceDescription

type SourceDescription struct {
	Comm
	SC     uint8
	Chunks []SDESChunk
}

func NewSourceDescription

func NewSourceDescription() *SourceDescription

func (*SourceDescription) Decode

func (pkt *SourceDescription) Decode(data []byte) error

func (*SourceDescription) Encode

func (pkt *SourceDescription) Encode() []byte

Jump to

Keyboard shortcuts

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