rtsp

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 26 Imported by: 1

README

Documentation

Index

Constants

View Source
const (
	ProtoRTSP      = "RTSP/1.0"
	MethodOptions  = "OPTIONS"
	MethodSetup    = "SETUP"
	MethodTeardown = "TEARDOWN"
	MethodDescribe = "DESCRIBE"
	MethodPlay     = "PLAY"
	MethodPause    = "PAUSE"
	MethodAnnounce = "ANNOUNCE"
	MethodRecord   = "RECORD"
)

Variables

View Source
var Timeout = time.Second * 5

Functions

func UnmarshalSDP

func UnmarshalSDP(rawSDP []byte) ([]*core.Media, error)

Types

type Conn

type Conn struct {
	core.Listener

	Backchannel bool
	Media       string
	PacketSize  uint16
	SessionName string
	Timeout     int
	Transport   string // custom transport support, ex. RTSP over WebSocket

	Medias    []*core.Media
	UserAgent string
	URL       *url.URL
	// contains filtered or unexported fields
}

func NewClient

func NewClient(uri string) *Conn

func NewServer

func NewServer(conn net.Conn) *Conn

func (*Conn) Accept

func (c *Conn) Accept() error

func (*Conn) AddTrack

func (c *Conn) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) (err error)

func (*Conn) Announce added in v1.2.0

func (c *Conn) Announce() (err error)

func (*Conn) Auth

func (c *Conn) Auth(username, password string)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Describe

func (c *Conn) Describe() error

func (*Conn) Dial

func (c *Conn) Dial() (err error)

func (*Conn) Do

func (c *Conn) Do(req *tcp.Request) (*tcp.Response, error)

Do send WriteRequest and receive and process WriteResponse

func (*Conn) GetMedias

func (c *Conn) GetMedias() []*core.Media

func (*Conn) GetTrack

func (c *Conn) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error)

func (*Conn) Handle

func (c *Conn) Handle() (err error)

func (*Conn) MarshalJSON

func (c *Conn) MarshalJSON() ([]byte, error)

func (*Conn) Options

func (c *Conn) Options() error

func (*Conn) Play

func (c *Conn) Play() (err error)

func (*Conn) ReadRequest added in v1.3.2

func (c *Conn) ReadRequest() (*tcp.Request, error)

func (*Conn) ReadResponse added in v1.3.2

func (c *Conn) ReadResponse() (*tcp.Response, error)

func (*Conn) Reconnect added in v1.3.2

func (c *Conn) Reconnect() error

func (*Conn) SetupMedia

func (c *Conn) SetupMedia(media *core.Media) (byte, error)

func (*Conn) Start

func (c *Conn) Start() (err error)

func (*Conn) Stop

func (c *Conn) Stop() (err error)

func (*Conn) Teardown

func (c *Conn) Teardown() (err error)

func (*Conn) WriteRequest added in v1.3.2

func (c *Conn) WriteRequest(req *tcp.Request) error

func (*Conn) WriteResponse added in v1.3.2

func (c *Conn) WriteResponse(res *tcp.Response) error

type RTCP

type RTCP struct {
	Channel byte
	Header  rtcp.Header
	Packets []rtcp.Packet
}

type State

type State byte
const (
	StateNone State = iota
	StateConn
	StateSetup
	StatePlay
)

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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