|
|
|
@ -167,22 +167,11 @@ func (s *rtspSession) OnAnnounce(c *rtspConn, ctx *gortsplib.ServerHandlerOnAnno |
|
|
|
// OnSetup is called by rtspServer.
|
|
|
|
// OnSetup is called by rtspServer.
|
|
|
|
func (s *rtspSession) OnSetup(c *rtspConn, ctx *gortsplib.ServerHandlerOnSetupCtx, |
|
|
|
func (s *rtspSession) OnSetup(c *rtspConn, ctx *gortsplib.ServerHandlerOnSetupCtx, |
|
|
|
) (*base.Response, *gortsplib.ServerStream, error) { |
|
|
|
) (*base.Response, *gortsplib.ServerStream, error) { |
|
|
|
switch ctx.Transport { |
|
|
|
// in case the client is setupping a stream with UDP or UDP-multicast, and these
|
|
|
|
case gortsplib.TransportUDP: |
|
|
|
// transport protocols are disabled, gortsplib already blocks the request.
|
|
|
|
if _, ok := s.protocols[conf.Protocol(gortsplib.TransportUDP)]; !ok { |
|
|
|
// we have only to handle the case in which the transport protocol is TCP
|
|
|
|
return &base.Response{ |
|
|
|
// and it is disabled.
|
|
|
|
StatusCode: base.StatusUnsupportedTransport, |
|
|
|
if ctx.Transport == gortsplib.TransportTCP { |
|
|
|
}, nil, nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case gortsplib.TransportUDPMulticast: |
|
|
|
|
|
|
|
if _, ok := s.protocols[conf.Protocol(gortsplib.TransportUDPMulticast)]; !ok { |
|
|
|
|
|
|
|
return &base.Response{ |
|
|
|
|
|
|
|
StatusCode: base.StatusUnsupportedTransport, |
|
|
|
|
|
|
|
}, nil, nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default: // TCP
|
|
|
|
|
|
|
|
if _, ok := s.protocols[conf.Protocol(gortsplib.TransportTCP)]; !ok { |
|
|
|
if _, ok := s.protocols[conf.Protocol(gortsplib.TransportTCP)]; !ok { |
|
|
|
return &base.Response{ |
|
|
|
return &base.Response{ |
|
|
|
StatusCode: base.StatusUnsupportedTransport, |
|
|
|
StatusCode: base.StatusUnsupportedTransport, |
|
|
|
|