rtpdump

package
v4.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package rtpdump implements the RTPDump file format documented at https://www.cs.columbia.edu/irt/software/rtptools/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(r io.Reader) (*Reader, Header, error)

NewReader opens a new Reader and immediately reads the Header from the start of the input stream.

Types

type Header struct {
	// start of recording (GMT)
	Start time.Time
	// network source (multicast address)
	Source net.IP
	// UDP port
	Port uint16
}

Header is the binary header at the top of the RTPDump file. It contains information about the source and start time of the packet stream included in the file.

func (Header) Marshal

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

Marshal encodes the Header as binary.

func (*Header) Unmarshal

func (h *Header) Unmarshal(d []byte) error

Unmarshal decodes the Header from binary.

type Packet

type Packet struct {
	// Offset is the time since the start of recording in milliseconds
	Offset time.Duration
	// IsRTCP is true if the payload is RTCP, false if the payload is RTP
	IsRTCP bool
	// Payload is the binary RTP or RTCP payload. The contents may not parse
	// as a valid packet if the contents have been truncated.
	Payload []byte
}

Packet contains an RTP or RTCP packet along a time offset when it was logged (relative to the Start of the recording in Header). The Payload may contain truncated packets to support logging just the headers of RTP/RTCP packets.

func (Packet) Marshal

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

Marshal encodes the Packet as binary.

func (*Packet) Unmarshal

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

Unmarshal decodes the Packet from binary.

type Reader

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

Reader reads the RTPDump file format

func (*Reader) Next

func (r *Reader) Next() (Packet, error)

Next returns the next Packet in the Reader input stream

type Writer

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

Writer writes the RTPDump file format

func NewWriter

func NewWriter(w io.Writer, hdr Header) (*Writer, error)

NewWriter makes a new Writer and immediately writes the given Header to begin the file.

func (*Writer) WritePacket

func (w *Writer) WritePacket(p Packet) error

WritePacket writes a Packet to the output

Jump to

Keyboard shortcuts

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