rtp

package
v1.0.61 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extension

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

Extension RTP Header extension

type Header struct {
	Version          uint8
	Padding          bool
	Extension        bool
	Marker           bool
	PayloadType      uint8
	SequenceNumber   uint16
	Timestamp        uint32
	SSRC             uint32
	CSRC             []uint32
	ExtensionProfile uint16
	Extensions       []Extension
}

Header represents an RTP packet header

func (Header) Clone

func (h Header) Clone() Header

Clone returns a deep copy h.

func (*Header) DelExtension

func (h *Header) DelExtension(id uint8) error

DelExtension Removes an RTP Header extension

func (*Header) GetExtension

func (h *Header) GetExtension(id uint8) []byte

GetExtension returns an RTP header extension

func (*Header) GetExtensionIDs

func (h *Header) GetExtensionIDs() []uint8

GetExtensionIDs returns an extension id array

func (Header) Marshal

func (h Header) Marshal() (buf []byte, err error)

Marshal serializes the header into bytes.

func (Header) MarshalSize

func (h Header) MarshalSize() int

MarshalSize returns the size of the header once marshaled.

func (Header) MarshalTo

func (h Header) MarshalTo(buf []byte) (n int, err error)

MarshalTo serializes the header and writes to the buffer.

func (*Header) SetExtension

func (h *Header) SetExtension(id uint8, payload []byte) error

SetExtension sets an RTP header extension

func (*Header) Unmarshal

func (h *Header) Unmarshal(buf []byte) (n int, err error)

Unmarshal parses the passed byte slice and stores the result in the Header. It returns the number of bytes read n and any error.

type Packet

type Packet struct {
	Header
	Payload     []byte
	PaddingSize byte
}

Packet represents an RTP Packet

func (Packet) Clone

func (p Packet) Clone() *Packet

Clone returns a deep copy of p.

func (Packet) Marshal

func (p Packet) Marshal() (buf []byte, err error)

Marshal serializes the packet into bytes.

func (Packet) MarshalSize

func (p Packet) MarshalSize() int

MarshalSize returns the size of the packet once marshaled.

func (Packet) MarshalTo

func (p Packet) MarshalTo(buf []byte) (n int, err error)

MarshalTo serializes the packet and writes to the buffer.

func (Packet) String

func (p Packet) String() string

String helps with debugging by printing packet information in a readable way

func (*Packet) Unmarshal

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

Unmarshal parses the passed byte slice and stores the result in the Packet.

Jump to

Keyboard shortcuts

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