Class RtspDecoder

  • All Implemented Interfaces:
    ChannelHandler

    public class RtspDecoder
    extends HttpObjectDecoder
    Decodes io.netty5.buffer.ByteBufs into RTSP messages represented in HttpMessages.

    Parameters that prevents excessive memory consumption

    NameMeaning
    maxInitialLineLength The maximum length of the initial line (e.g. "SETUP / RTSP/1.0" or "RTSP/1.0 200 OK") If the length of the initial line exceeds this value, a TooLongFrameException will be raised.
    maxHeaderSize The maximum length of all headers. If the sum of the length of each header exceeds this value, a TooLongFrameException will be raised.
    maxContentLength The maximum length of the content. If the content length exceeds this value, a TooLongFrameException will be raised.
    • Field Detail

      • DEFAULT_MAX_CONTENT_LENGTH

        public static final int DEFAULT_MAX_CONTENT_LENGTH
        Constant for default max content length.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RtspDecoder

        public RtspDecoder()
        Creates a new instance with the default maxInitialLineLength (4096), maxHeaderSize (8192), and maxContentLength (8192).
      • RtspDecoder

        public RtspDecoder​(int maxInitialLineLength,
                           int maxHeaderSize,
                           int maxContentLength)
        Creates a new instance with the specified parameters.
        Parameters:
        maxInitialLineLength - The max allowed length of initial line
        maxHeaderSize - The max allowed size of header
        maxContentLength - The max allowed content length
      • RtspDecoder

        public RtspDecoder​(int maxInitialLineLength,
                           int maxHeaderSize,
                           int maxContentLength,
                           boolean validateHeaders)
        Creates a new instance with the specified parameters.
        Parameters:
        maxInitialLineLength - The max allowed length of initial line
        maxHeaderSize - The max allowed size of header
        maxContentLength - The max allowed content length
        validateHeaders - Set to true if headers should be validated