transport

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITransport

type ITransport interface {
	SetRemoteAddr(remoteHost string, remoteRtpPort, remoteRtcpPort int)
	GetRemoteRtcpAddr() (remoteHost string, remotePort int)
	OnRtpPacket(onRtpPacket func(pkt *rtprtcp.RTPPacket, rAddr net.Addr))
	OnRtpData(onRtpData func(buf []byte, rAddr net.Addr))
	OnRtcp(onRtcp func(buf []byte, rAddr net.Addr))
	SendRtp(pkt *rtprtcp.RTPPacket) (int, error)
	SendData(data []byte) (int, error)
	SendRtcp(buf []byte) (int, error)
	LocalHost() string
	LocalRtpPort() int
	LocalRtcpPort() int
	Close()
}

func NewTransport

func NewTransport(rtpOverTcp bool, setupActive bool, option ...ModTransportOption) ITransport

type ModTransportOption

type ModTransportOption func(option *TransportOption)

type TcpActiveTransport

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

func (*TcpActiveTransport) Close

func (c *TcpActiveTransport) Close()

func (*TcpActiveTransport) GetRemoteAddr

func (c *TcpActiveTransport) GetRemoteAddr() (remoteHost string, remoteRtpPort, remoteRtcpPort int)

func (*TcpActiveTransport) GetRemoteRtcpAddr

func (c *TcpActiveTransport) GetRemoteRtcpAddr() (remoteHost string, remotePort int)

func (*TcpActiveTransport) LocalHost

func (c *TcpActiveTransport) LocalHost() string

func (*TcpActiveTransport) LocalRtcpPort

func (c *TcpActiveTransport) LocalRtcpPort() int

func (*TcpActiveTransport) LocalRtpPort

func (c *TcpActiveTransport) LocalRtpPort() int

func (*TcpActiveTransport) OnRtcp

func (c *TcpActiveTransport) OnRtcp(onRtcp func(buf []byte, rAddr net.Addr))

func (*TcpActiveTransport) OnRtpData

func (c *TcpActiveTransport) OnRtpData(onRtpData func(buf []byte, rAddr net.Addr))

func (*TcpActiveTransport) OnRtpPacket

func (c *TcpActiveTransport) OnRtpPacket(onRtpPacket func(pkt *rtprtcp.RTPPacket, rAddr net.Addr))

func (*TcpActiveTransport) SendData

func (c *TcpActiveTransport) SendData(data []byte) (int, error)

func (*TcpActiveTransport) SendRtcp

func (c *TcpActiveTransport) SendRtcp(buf []byte) (int, error)

func (*TcpActiveTransport) SendRtp

func (c *TcpActiveTransport) SendRtp(pkt *rtprtcp.RTPPacket) (int, error)

func (*TcpActiveTransport) SetRemoteAddr

func (c *TcpActiveTransport) SetRemoteAddr(remoteHost string, remoteRtpPort, remoteRtcpPort int)

type TcpPassiveTransport

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

func (*TcpPassiveTransport) Close

func (s *TcpPassiveTransport) Close()

func (*TcpPassiveTransport) GetRemoteAddr

func (s *TcpPassiveTransport) GetRemoteAddr() (remoteHost string, remoteRtpPort, remoteRtcpPort int)

func (*TcpPassiveTransport) GetRemoteRtcpAddr

func (s *TcpPassiveTransport) GetRemoteRtcpAddr() (remoteHost string, remotePort int)

func (*TcpPassiveTransport) LocalHost

func (s *TcpPassiveTransport) LocalHost() string

func (*TcpPassiveTransport) LocalRtcpPort

func (s *TcpPassiveTransport) LocalRtcpPort() int

func (*TcpPassiveTransport) LocalRtpPort

func (s *TcpPassiveTransport) LocalRtpPort() int

func (*TcpPassiveTransport) OnRtcp

func (s *TcpPassiveTransport) OnRtcp(onRtcp func(buf []byte, rAddr net.Addr))

func (*TcpPassiveTransport) OnRtpData

func (s *TcpPassiveTransport) OnRtpData(onRtpData func(buf []byte, rAddr net.Addr))

func (*TcpPassiveTransport) OnRtpPacket

func (s *TcpPassiveTransport) OnRtpPacket(onRtpPacket func(pkt *rtprtcp.RTPPacket, rAddr net.Addr))

func (*TcpPassiveTransport) SendData

func (s *TcpPassiveTransport) SendData(data []byte) (int, error)

func (*TcpPassiveTransport) SendRtcp

func (s *TcpPassiveTransport) SendRtcp(buf []byte) (int, error)

func (*TcpPassiveTransport) SendRtp

func (s *TcpPassiveTransport) SendRtp(pkt *rtprtcp.RTPPacket) (int, error)

func (*TcpPassiveTransport) SetRemoteAddr

func (s *TcpPassiveTransport) SetRemoteAddr(remoteHost string, remoteRtpPort, remoteRtcpPort int)

type TransportOption

type TransportOption struct {
	LocalHost     string
	LocalRtpPort  int
	LocalRtcpPort int
	RtcpMux       bool // rtp rtcp共用端口
}

type UdpTransport

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

func (*UdpTransport) Close

func (s *UdpTransport) Close()

func (*UdpTransport) GetRemoteAddr

func (s *UdpTransport) GetRemoteAddr() (remoteHost string, remoteRtpPort, remoteRtcpPort int)

func (*UdpTransport) GetRemoteRtcpAddr

func (s *UdpTransport) GetRemoteRtcpAddr() (remoteHost string, remotePort int)

func (*UdpTransport) LocalHost

func (s *UdpTransport) LocalHost() string

func (*UdpTransport) LocalRtcpPort

func (s *UdpTransport) LocalRtcpPort() int

func (*UdpTransport) LocalRtpPort

func (s *UdpTransport) LocalRtpPort() int

func (*UdpTransport) OnRtcp

func (s *UdpTransport) OnRtcp(onRtcp func(buf []byte, rAddr net.Addr))

func (*UdpTransport) OnRtpData

func (s *UdpTransport) OnRtpData(onRtpData func(buf []byte, rAddr net.Addr))

func (*UdpTransport) OnRtpPacket

func (s *UdpTransport) OnRtpPacket(onRtpPacket func(pkt *rtprtcp.RTPPacket, rAddr net.Addr))

func (*UdpTransport) SendData

func (s *UdpTransport) SendData(data []byte) (int, error)

func (*UdpTransport) SendRtcp

func (s *UdpTransport) SendRtcp(buf []byte) (int, error)

func (*UdpTransport) SendRtp

func (s *UdpTransport) SendRtp(pkt *rtprtcp.RTPPacket) (int, error)

func (*UdpTransport) SetRemoteAddr

func (s *UdpTransport) SetRemoteAddr(remoteHost string, remoteRtpPort, remoteRtcpPort int)

Jump to

Keyboard shortcuts

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