rtspv2

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignalStreamRTPStop = iota
	SignalCodecUpdate
)
View Source
const (
	VIDEO = "video"
	AUDIO = "audio"
)
View Source
const (
	RTPHeaderSize      = 12
	RTCPSenderReport   = 200
	RTCPReceiverReport = 201
)
View Source
const (
	DESCRIBE = "DESCRIBE"
	OPTIONS  = "OPTIONS"
	PLAY     = "PLAY"
	SETUP    = "SETUP"
	TEARDOWN = "TEARDOWN"
)
View Source
const (
	TimeBaseFactor = 90
	TimeDelay      = 1
)
View Source
const (
	StartCodePS        = 0x000001ba
	StartCodeSYS       = 0x000001bb
	StartCodeMAP       = 0x000001bc
	StartCodeVideo     = 0x000001e0
	StartCodeAudio     = 0x000001c0
	MEPGProgramEndCode = 0x000001b9
)
View Source
const (
	StreamIDVideo = 0xe0
	StreamIDAudio = 0xc0
)
View Source
const (
	UDPTransfer        int = 0
	TCPTransferActive  int = 1
	TCPTransferPassive int = 2
	LocalCache         int = 3
)
View Source
const (
	StreamTypeH264 = 0x1b
	StreamTypeH265 = 0x24
	StreamTypeAAC  = 0x90
)

Variables

View Source
var Debug bool

Functions

This section is empty.

Types

type Conn

type Conn struct {
	URL *url.URL
	// contains filtered or unexported fields
}

func NewConn

func NewConn(netconn net.Conn) *Conn

func (*Conn) Close

func (self *Conn) Close() (err error)

func (*Conn) NetConn

func (self *Conn) NetConn() net.Conn

func (*Conn) WriteHeader

func (self *Conn) WriteHeader(codec []av.CodecData) (err error)

func (*Conn) WritePacket

func (self *Conn) WritePacket(pkt *av.Packet) (err error)

type Proxy

type Proxy struct {
	Addr          string
	HandleConn    func(*ProxyConn)
	HandleOptions func(*ProxyConn)
	HandlePlay    func(*ProxyConn)
}

func (*Proxy) ListenAndServe

func (self *Proxy) ListenAndServe() (err error)

type ProxyConn

type ProxyConn struct {
	URL *url.URL
	// contains filtered or unexported fields
}

func NewProxyConn

func NewProxyConn(netconn net.Conn) *ProxyConn

func (*ProxyConn) Close

func (self *ProxyConn) Close() (err error)

func (*ProxyConn) NetConn

func (self *ProxyConn) NetConn() net.Conn

func (*ProxyConn) WriteHeader

func (self *ProxyConn) WriteHeader(sdp []byte)

func (*ProxyConn) WritePacket

func (self *ProxyConn) WritePacket(pkt *[]byte) (err error)

type RTSPClient

type RTSPClient struct {
	SDPRaw []byte

	Signals             chan int
	OutgoingProxyQueue  chan *[]byte
	OutgoingPacketQueue chan *av.Packet

	BufferRtpPacket *bytes.Buffer

	CodecData      []av.CodecData
	AudioTimeLine  time.Duration
	AudioTimeScale int64

	PreAudioTS        int64
	PreVideoTS        int64
	PreSequenceNumber int
	FPS               int
	WaitCodec         bool
	// contains filtered or unexported fields
}

func Dial

func Dial(options RTSPClientOptions) (*RTSPClient, error)

func (*RTSPClient) Close

func (client *RTSPClient) Close()

func (*RTSPClient) CodecUpdatePPS

func (client *RTSPClient) CodecUpdatePPS(val []byte)

func (*RTSPClient) CodecUpdateSPS

func (client *RTSPClient) CodecUpdateSPS(val []byte)

func (*RTSPClient) CodecUpdateVPS

func (client *RTSPClient) CodecUpdateVPS(val []byte)

func (*RTSPClient) ControlTrack

func (client *RTSPClient) ControlTrack(track string) string

func (*RTSPClient) Println

func (client *RTSPClient) Println(v ...interface{})

Println mini logging functions

func (*RTSPClient) RTPDemuxer

func (client *RTSPClient) RTPDemuxer(payloadRAW *[]byte) ([]*av.Packet, bool)

type RTSPClientOptions

type RTSPClientOptions struct {
	Debug              bool
	URL                string
	DialTimeout        time.Duration
	ReadWriteTimeout   time.Duration
	DisableAudio       bool
	OutgoingProxy      bool
	InsecureSkipVerify bool
}

type Server

type Server struct {
	Addr           string
	HandleDescribe func(*Conn)
	HandleOptions  func(*Conn)
	HandleSetup    func(*Conn)
	HandlePlay     func(*Conn)
	HandleConn     func(*Conn)
}

func (*Server) ListenAndServe

func (self *Server) ListenAndServe() (err error)

Jump to

Keyboard shortcuts

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