Documentation ¶
Index ¶
- Constants
- func CheckAuth(authLine string, method string, sessionNonce string) error
- func DigestAuth(authLine string, method string, URL string) (string, error)
- func ParseSDP(sdpRaw string) map[string]*SDPInfo
- type Player
- type Pusher
- func (pusher *Pusher) ACodec() string
- func (pusher *Pusher) AControl() string
- func (pusher *Pusher) AddOutputBytes(size int)
- func (pusher *Pusher) AddPlayer(player *Player) *Pusher
- func (pusher *Pusher) BroadcastRTP(pack *RTPPack) *Pusher
- func (pusher *Pusher) ClearPlayer()
- func (pusher *Pusher) GetPlayers() (players map[string]*Player)
- func (pusher *Pusher) HasPlayer(player *Player) bool
- func (pusher *Pusher) ID() string
- func (pusher *Pusher) InBytes() int
- func (pusher *Pusher) Logger() *log.Logger
- func (pusher *Pusher) OutBytes() int
- func (pusher *Pusher) Path() string
- func (pusher *Pusher) QueueRTP(pack *RTPPack) *Pusher
- func (pusher *Pusher) RebindClient(client *RTSPClient) bool
- func (pusher *Pusher) RebindSession(session *Session) bool
- func (pusher *Pusher) RemovePlayer(player *Player) *Pusher
- func (pusher *Pusher) SDPRaw() string
- func (pusher *Pusher) Server() *Server
- func (pusher *Pusher) Source() string
- func (pusher *Pusher) Start()
- func (pusher *Pusher) StartAt() time.Time
- func (pusher *Pusher) Stop()
- func (pusher *Pusher) Stoped() bool
- func (pusher *Pusher) String() string
- func (pusher *Pusher) TransType() string
- func (pusher *Pusher) URL() string
- func (pusher *Pusher) VCodec() string
- func (pusher *Pusher) VControl() string
- type RTPInfo
- type RTPPack
- type RTPType
- type RTSPClient
- func (client *RTSPClient) Request(method string, headers map[string]string) (*Response, error)
- func (client *RTSPClient) RequestNoResp(method string, headers map[string]string) (err error)
- func (client *RTSPClient) RequestWithPath(method string, path string, headers map[string]string, needResp bool) (resp *Response, err error)
- func (client *RTSPClient) Start(timeout time.Duration) (err error)
- func (client *RTSPClient) Stop()
- func (client *RTSPClient) String() string
- type Request
- type Response
- type RichConn
- type SDPInfo
- type Server
- func (server *Server) AddPusher(pusher *Pusher) bool
- func (server *Server) GetPusher(path string) (pusher *Pusher)
- func (server *Server) GetPusherSize() (size int)
- func (server *Server) GetPushers() (pushers map[string]*Pusher)
- func (server *Server) RemovePusher(pusher *Pusher)
- func (server *Server) Start() (err error)
- func (server *Server) Stop()
- func (server *Server) TryAttachToPusher(session *Session) (int, *Pusher)
- type Session
- type SessionLogger
- type SessionType
- type TransType
- type UDPClient
- type UDPServer
Constants ¶
View Source
const ( // Client to server for presentation and stream objects; recommended DESCRIBE = "DESCRIBE" // Bidirectional for client and stream objects; optional ANNOUNCE = "ANNOUNCE" // Bidirectional for client and stream objects; optional GET_PARAMETER = "GET_PARAMETER" // Bidirectional for client and stream objects; required for Client to server, optional for server to client OPTIONS = "OPTIONS" // Client to server for presentation and stream objects; recommended PAUSE = "PAUSE" // Client to server for presentation and stream objects; required PLAY = "PLAY" // Client to server for presentation and stream objects; optional RECORD = "RECORD" // Server to client for presentation and stream objects; optional REDIRECT = "REDIRECT" // Client to server for stream objects; required SETUP = "SETUP" // Bidirectional for presentation and stream objects; optional SET_PARAMETER = "SET_PARAMETER" // Client to server for presentation and stream objects; required TEARDOWN = "TEARDOWN" DATA = "DATA" )
View Source
const (
RTP_FIXED_HEADER_LENGTH = 12
)
View Source
const (
RTSP_VERSION = "RTSP/1.0"
)
View Source
const UDP_BUF_SIZE = 1048576
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pusher ¶
type Pusher struct { *Session *RTSPClient UDPServer *UDPServer // contains filtered or unexported fields }
func NewClientPusher ¶
func NewClientPusher(client *RTSPClient) (pusher *Pusher)
func (*Pusher) AddOutputBytes ¶
func (*Pusher) BroadcastRTP ¶
func (*Pusher) ClearPlayer ¶
func (pusher *Pusher) ClearPlayer()
func (*Pusher) GetPlayers ¶
func (*Pusher) RebindClient ¶
func (pusher *Pusher) RebindClient(client *RTSPClient) bool
func (*Pusher) RebindSession ¶
func (*Pusher) RemovePlayer ¶
type RTPInfo ¶
type RTSPClient ¶
type RTSPClient struct { Server *Server SessionLogger Stoped bool Status string URL string Path string CustomPath string //custom path for pusher ID string Conn *RichConn Session string Seq int InBytes int OutBytes int TransType TransType StartAt time.Time Sdp *sdp.Session AControl string VControl string ACodec string VCodec string OptionIntervalMillis int64 SDPRaw string Agent string UDPServer *UDPServer RTPHandles []func(*RTPPack) StopHandles []func() // contains filtered or unexported fields }
func NewRTSPClient ¶
func (*RTSPClient) RequestNoResp ¶
func (client *RTSPClient) RequestNoResp(method string, headers map[string]string) (err error)
func (*RTSPClient) RequestWithPath ¶
func (*RTSPClient) Stop ¶
func (client *RTSPClient) Stop()
func (*RTSPClient) String ¶
func (client *RTSPClient) String() string
type Request ¶
type Request struct { Method string URL string Version string Header map[string]string Content string Body string }
func NewRequest ¶
func (*Request) GetContentLength ¶
type Response ¶
type Response struct { Version string StatusCode int Status string Header map[string]interface{} Body string }
func NewResponse ¶
type Server ¶
type Server struct { SessionLogger TCPListener *net.TCPListener TCPPort int Stoped bool // contains filtered or unexported fields }
var Instance *Server = &Server{ SessionLogger: SessionLogger{log.New(os.Stdout, "[RTSPServer]", log.LstdFlags|log.Lshortfile)}, Stoped: true, TCPPort: utils.Conf().Section("rtsp").Key("port").MustInt(554), pushers: make(map[string]*Pusher), addPusherCh: make(chan *Pusher), removePusherCh: make(chan *Pusher), }
func (*Server) GetPusherSize ¶
func (*Server) GetPushers ¶
func (*Server) RemovePusher ¶
type Session ¶
type Session struct { SessionLogger ID string Server *Server Conn *RichConn Type SessionType TransType TransType Path string URL string SDPRaw string SDPMap map[string]*SDPInfo AControl string VControl string ACodec string VCodec string // stats info InBytes int OutBytes int StartAt time.Time Timeout int Stoped bool Pusher *Pusher Player *Player UDPClient *UDPClient RTPHandles []func(*RTPPack) StopHandles []func() // contains filtered or unexported fields }
type SessionLogger ¶
type SessionLogger struct {
// contains filtered or unexported fields
}
type SessionType ¶
type SessionType int
const ( SESSION_TYPE_PUSHER SessionType = iota SESSEION_TYPE_PLAYER )
func (SessionType) String ¶
func (st SessionType) String() string
type UDPClient ¶
type UDPClient struct { *Session APort int AConn *net.UDPConn AControlPort int AControlConn *net.UDPConn VPort int VConn *net.UDPConn VControlPort int VControlConn *net.UDPConn Stoped bool }
func (*UDPClient) SetupAudio ¶
func (*UDPClient) SetupVideo ¶
type UDPServer ¶
type UDPServer struct { *Session *RTSPClient APort int AConn *net.UDPConn AControlPort int AControlConn *net.UDPConn VPort int VConn *net.UDPConn VControlPort int VControlConn *net.UDPConn Stoped bool }
func (*UDPServer) AddInputBytes ¶
func (*UDPServer) SetupAudio ¶
func (*UDPServer) SetupVideo ¶
Click to show internal directories.
Click to hide internal directories.