rtpconn

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn deprecated

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

Deprecated: use MediaPort instead

func NewConn

func NewConn(conf *ConnConfig) *Conn

func NewConnWith

func NewConnWith(conn UDPConn, conf *ConnConfig) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) DestAddr

func (c *Conn) DestAddr() *net.UDPAddr

func (*Conn) EnableTimeout

func (c *Conn) EnableTimeout(enabled bool)

func (*Conn) Listen

func (c *Conn) Listen(portMin, portMax int, listenAddr string) error

func (*Conn) ListenAndServe

func (c *Conn) ListenAndServe(portMin, portMax int, listenAddr string) error

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() *net.UDPAddr

func (*Conn) OnRTP

func (c *Conn) OnRTP(h mrtp.Handler)

func (*Conn) ReadRTP

func (c *Conn) ReadRTP() (*rtp.Packet, *net.UDPAddr, error)

func (*Conn) Received

func (c *Conn) Received() <-chan struct{}

Received chan is closed once Conn receives at least one RTP packet.

func (*Conn) SetDestAddr

func (c *Conn) SetDestAddr(addr *net.UDPAddr)

func (*Conn) String

func (c *Conn) String() string

func (*Conn) WriteRTP

func (c *Conn) WriteRTP(h *rtp.Header, payload []byte) (int, error)

type ConnConfig

type ConnConfig struct {
	Log                 logger.Logger
	MediaTimeoutInitial time.Duration
	MediaTimeout        time.Duration
	TimeoutCallback     func()
}

type UDPConn

type UDPConn interface {
	LocalAddr() net.Addr
	WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)
	ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error)
	Close() error
}

Jump to

Keyboard shortcuts

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