Documentation
¶
Index ¶
- Constants
- func NewResponse(proto string, cSeq string) *response
- type Channel
- type HandlerFunc
- type Media
- type Package
- type Request
- type Response
- type Server
- type ServerOption
- type Transaction
- type TransactionController
- type Transport
- type UnimplementedServerHandler
- func (u *UnimplementedServerHandler) ANNOUNCE(req Request, res Response, tx Transaction) error
- func (u *UnimplementedServerHandler) DESCRIBE(req Request, res Response, tx Transaction) error
- func (u *UnimplementedServerHandler) OPTIONS(req Request, res Response, tx Transaction) error
- func (u *UnimplementedServerHandler) PLAY(req Request, res Response, tx Transaction) error
- func (u *UnimplementedServerHandler) RECORD(req Request, res Response, tx Transaction) error
- func (u *UnimplementedServerHandler) SETUP(req Request, res Response, tx Transaction) error
- func (u *UnimplementedServerHandler) TEARDOWN(req Request, res Response, tx Transaction) error
Constants ¶
View Source
const Version1 = "RTSP/1.0"
Variables ¶
This section is empty.
Functions ¶
func NewResponse ¶
Types ¶
type Channel ¶
type Channel interface { SetSDP(tx Transaction, sdp *sdp.Message, raw []byte) bool SDP() *sdp.Message Raw() []byte Lock(tx Transaction) bool Source() Transaction Input() chan *Package Play(tx Transaction) error Record(tx Transaction) error Teardown(tx Transaction) error }
func NewChannel ¶
type HandlerFunc ¶
type HandlerFunc func(req Request, res Response, tx Transaction) error
type Request ¶
type Request interface { Method() methods.Method URL() *url.URL Path() string Stream() string Headers() map[string][]string Header(key string) ([]string, bool) Transport() (header.TransportHeader, bool) CSeq() string Proto() string SessionID() string ContentType() string Body() []byte Encode() []byte ParseSDP() (*sdp.Message, error) Channel() string }
type Response ¶
type Response interface { SetHeader(key string, value ...string) SetBody(body []byte) SetStatus(status string) SetCode(code uint64) Encoding() []byte }
func ErrInternal ¶
func ErrMethodNotAllowed ¶
func ErrUnsupportedTransport ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) RegisterHandleFunc ¶
func (s *Server) RegisterHandleFunc(method methods.Method, fn HandlerFunc)
func (*Server) RegisterHandler ¶
func (s *Server) RegisterHandler(handler minimalHandler)
type ServerOption ¶
type ServerOption func(s *Server)
func Address ¶
func Address(addr string) ServerOption
func Logger ¶
func Logger(logger log.Logger) ServerOption
func Network ¶
func Network(network string) ServerOption
func RTCP ¶
func RTCP(rtcp string) ServerOption
func RTP ¶
func RTP(rtp string) ServerOption
func Timeout ¶
func Timeout(duration time.Duration) ServerOption
func WithChannel ¶
func WithChannel(ch string) ServerOption
type Transaction ¶
type Transaction interface { ID() string IP() net.IP Status() status.Status Forward(p *Package, wg *sync.WaitGroup) error Response(res Response) error Request(req Request) error Medias() map[string]*Media AddMedia(media *Media) PreReady(sdp *sdp.Message) bool PreRecord(sdp *sdp.Message) bool PrePlay(sdp *sdp.Message) bool PreInit() Interleaved() bool ReadInterleavedFrame(frame []byte) (int, uint32, error) WriteInterleavedFrame(channel int, frame []byte) error Read(buf []byte) (int, error) RTCP() int RTP() int Close() error }
type TransactionController ¶
type UnimplementedServerHandler ¶
type UnimplementedServerHandler struct {
// contains filtered or unexported fields
}
func (*UnimplementedServerHandler) ANNOUNCE ¶
func (u *UnimplementedServerHandler) ANNOUNCE(req Request, res Response, tx Transaction) error
func (*UnimplementedServerHandler) DESCRIBE ¶
func (u *UnimplementedServerHandler) DESCRIBE(req Request, res Response, tx Transaction) error
func (*UnimplementedServerHandler) OPTIONS ¶
func (u *UnimplementedServerHandler) OPTIONS(req Request, res Response, tx Transaction) error
func (*UnimplementedServerHandler) PLAY ¶
func (u *UnimplementedServerHandler) PLAY(req Request, res Response, tx Transaction) error
func (*UnimplementedServerHandler) RECORD ¶
func (u *UnimplementedServerHandler) RECORD(req Request, res Response, tx Transaction) error
func (*UnimplementedServerHandler) SETUP ¶
func (u *UnimplementedServerHandler) SETUP(req Request, res Response, tx Transaction) error
func (*UnimplementedServerHandler) TEARDOWN ¶
func (u *UnimplementedServerHandler) TEARDOWN(req Request, res Response, tx Transaction) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.