mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
show configuration sections in docs
This commit is contained in:
13
client.go
13
client.go
@@ -32,15 +32,12 @@ type Client struct {
|
|||||||
//
|
//
|
||||||
// connection
|
// connection
|
||||||
//
|
//
|
||||||
|
|
||||||
// timeout of read operations.
|
// timeout of read operations.
|
||||||
// It defaults to 10 seconds.
|
// It defaults to 10 seconds.
|
||||||
ReadTimeout time.Duration
|
ReadTimeout time.Duration
|
||||||
|
|
||||||
// timeout of write operations.
|
// timeout of write operations.
|
||||||
// It defaults to 10 seconds.
|
// It defaults to 10 seconds.
|
||||||
WriteTimeout time.Duration
|
WriteTimeout time.Duration
|
||||||
|
|
||||||
// a TLS configuration to connect to TLS (RTSPS) servers.
|
// a TLS configuration to connect to TLS (RTSPS) servers.
|
||||||
// It defaults to &tls.Config{InsecureSkipVerify:true}
|
// It defaults to &tls.Config{InsecureSkipVerify:true}
|
||||||
TLSConfig *tls.Config
|
TLSConfig *tls.Config
|
||||||
@@ -48,11 +45,9 @@ type Client struct {
|
|||||||
//
|
//
|
||||||
// initialization
|
// initialization
|
||||||
//
|
//
|
||||||
|
|
||||||
// disable being redirected to other servers, that can happen during Describe().
|
// disable being redirected to other servers, that can happen during Describe().
|
||||||
// It defaults to false.
|
// It defaults to false.
|
||||||
RedirectDisable bool
|
RedirectDisable bool
|
||||||
|
|
||||||
// enable communication with servers which don't provide server ports.
|
// enable communication with servers which don't provide server ports.
|
||||||
// this can be a security issue.
|
// this can be a security issue.
|
||||||
// It defaults to false.
|
// It defaults to false.
|
||||||
@@ -61,23 +56,19 @@ type Client struct {
|
|||||||
//
|
//
|
||||||
// reading / writing
|
// reading / writing
|
||||||
//
|
//
|
||||||
|
|
||||||
// the stream protocol (UDP or TCP).
|
// the stream protocol (UDP or TCP).
|
||||||
// If nil, it is chosen automatically (first UDP, then, if it fails, TCP).
|
// If nil, it is chosen automatically (first UDP, then, if it fails, TCP).
|
||||||
// It defaults to nil.
|
// It defaults to nil.
|
||||||
StreamProtocol *StreamProtocol
|
StreamProtocol *StreamProtocol
|
||||||
|
|
||||||
// If the client is reading with UDP, it must receive
|
// If the client is reading with UDP, it must receive
|
||||||
// at least a packet within this timeout.
|
// at least a packet within this timeout.
|
||||||
// It defaults to 3 seconds.
|
// It defaults to 3 seconds.
|
||||||
InitialUDPReadTimeout time.Duration
|
InitialUDPReadTimeout time.Duration
|
||||||
|
|
||||||
// read buffer count.
|
// read buffer count.
|
||||||
// If greater than 1, allows to pass buffers to routines different than the one
|
// If greater than 1, allows to pass buffers to routines different than the one
|
||||||
// that is reading frames.
|
// that is reading frames.
|
||||||
// It defaults to 1.
|
// It defaults to 1.
|
||||||
ReadBufferCount int
|
ReadBufferCount int
|
||||||
|
|
||||||
// read buffer size.
|
// read buffer size.
|
||||||
// This must be touched only when the server reports problems about buffer sizes.
|
// This must be touched only when the server reports problems about buffer sizes.
|
||||||
// It defaults to 2048.
|
// It defaults to 2048.
|
||||||
@@ -86,21 +77,17 @@ type Client struct {
|
|||||||
//
|
//
|
||||||
// callbacks
|
// callbacks
|
||||||
//
|
//
|
||||||
|
|
||||||
// callback called before every request.
|
// callback called before every request.
|
||||||
OnRequest func(req *base.Request)
|
OnRequest func(req *base.Request)
|
||||||
|
|
||||||
// callback called after every response.
|
// callback called after every response.
|
||||||
OnResponse func(res *base.Response)
|
OnResponse func(res *base.Response)
|
||||||
|
|
||||||
//
|
//
|
||||||
// system functions
|
// system functions
|
||||||
//
|
//
|
||||||
|
|
||||||
// function used to initialize the TCP client.
|
// function used to initialize the TCP client.
|
||||||
// It defaults to net.DialTimeout.
|
// It defaults to net.DialTimeout.
|
||||||
DialTimeout func(network, address string, timeout time.Duration) (net.Conn, error)
|
DialTimeout func(network, address string, timeout time.Duration) (net.Conn, error)
|
||||||
|
|
||||||
// function used to initialize UDP listeners.
|
// function used to initialize UDP listeners.
|
||||||
// It defaults to net.ListenPacket.
|
// It defaults to net.ListenPacket.
|
||||||
ListenPacket func(network, address string) (net.PacketConn, error)
|
ListenPacket func(network, address string) (net.PacketConn, error)
|
||||||
|
10
server.go
10
server.go
@@ -63,29 +63,23 @@ type Server struct {
|
|||||||
//
|
//
|
||||||
// handler
|
// handler
|
||||||
//
|
//
|
||||||
|
|
||||||
// an handler interface to handle requests.
|
// an handler interface to handle requests.
|
||||||
Handler ServerHandler
|
Handler ServerHandler
|
||||||
|
|
||||||
//
|
//
|
||||||
// connection
|
// connection
|
||||||
//
|
//
|
||||||
|
|
||||||
// timeout of read operations.
|
// timeout of read operations.
|
||||||
// It defaults to 10 seconds
|
// It defaults to 10 seconds
|
||||||
ReadTimeout time.Duration
|
ReadTimeout time.Duration
|
||||||
|
|
||||||
// timeout of write operations.
|
// timeout of write operations.
|
||||||
// It defaults to 10 seconds
|
// It defaults to 10 seconds
|
||||||
WriteTimeout time.Duration
|
WriteTimeout time.Duration
|
||||||
|
|
||||||
// a TLS configuration to accept TLS (RTSPS) connections.
|
// a TLS configuration to accept TLS (RTSPS) connections.
|
||||||
TLSConfig *tls.Config
|
TLSConfig *tls.Config
|
||||||
|
|
||||||
// a port to send and receive UDP/RTP packets.
|
// a port to send and receive UDP/RTP packets.
|
||||||
// If UDPRTPAddress and UDPRTCPAddress are != "", the server can accept and send UDP streams.
|
// If UDPRTPAddress and UDPRTCPAddress are != "", the server can accept and send UDP streams.
|
||||||
UDPRTPAddress string
|
UDPRTPAddress string
|
||||||
|
|
||||||
// a port to send and receive UDP/RTCP packets.
|
// a port to send and receive UDP/RTCP packets.
|
||||||
// If UDPRTPAddress and UDPRTCPAddress are != "", the server can accept and send UDP streams.
|
// If UDPRTPAddress and UDPRTCPAddress are != "", the server can accept and send UDP streams.
|
||||||
UDPRTCPAddress string
|
UDPRTCPAddress string
|
||||||
@@ -93,7 +87,6 @@ type Server struct {
|
|||||||
//
|
//
|
||||||
// reading / writing
|
// reading / writing
|
||||||
//
|
//
|
||||||
|
|
||||||
// read buffer count.
|
// read buffer count.
|
||||||
// If greater than 1, allows to pass buffers to routines different than the one
|
// If greater than 1, allows to pass buffers to routines different than the one
|
||||||
// that is reading frames.
|
// that is reading frames.
|
||||||
@@ -101,7 +94,6 @@ type Server struct {
|
|||||||
// that are particularly high when using UDP.
|
// that are particularly high when using UDP.
|
||||||
// It defaults to 512
|
// It defaults to 512
|
||||||
ReadBufferCount int
|
ReadBufferCount int
|
||||||
|
|
||||||
// read buffer size.
|
// read buffer size.
|
||||||
// This must be touched only when the server reports problems about buffer sizes.
|
// This must be touched only when the server reports problems about buffer sizes.
|
||||||
// It defaults to 2048.
|
// It defaults to 2048.
|
||||||
@@ -110,11 +102,9 @@ type Server struct {
|
|||||||
//
|
//
|
||||||
// system functions
|
// system functions
|
||||||
//
|
//
|
||||||
|
|
||||||
// function used to initialize the TCP listener.
|
// function used to initialize the TCP listener.
|
||||||
// It defaults to net.Listen.
|
// It defaults to net.Listen.
|
||||||
Listen func(network string, address string) (net.Listener, error)
|
Listen func(network string, address string) (net.Listener, error)
|
||||||
|
|
||||||
// function used to initialize UDP listeners.
|
// function used to initialize UDP listeners.
|
||||||
// It defaults to net.ListenPacket.
|
// It defaults to net.ListenPacket.
|
||||||
ListenPacket func(network, address string) (net.PacketConn, error)
|
ListenPacket func(network, address string) (net.PacketConn, error)
|
||||||
|
Reference in New Issue
Block a user