Home / Class/ RtspDecoder Class — netty Architecture

RtspDecoder Class — netty Architecture

Architecture documentation for the RtspDecoder class in RtspDecoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0aa9414c_6f4a_5397_26cd_8cb3bcc1311d["RtspDecoder"]
  5aae59e2_8c08_503b_2a28_d6e72292d067["RtspDecoder.java"]
  0aa9414c_6f4a_5397_26cd_8cb3bcc1311d -->|defined in| 5aae59e2_8c08_503b_2a28_d6e72292d067
  dd1ec73b_ebb8_638c_bed6_4b1e1c18cf91["RtspDecoder()"]
  0aa9414c_6f4a_5397_26cd_8cb3bcc1311d -->|method| dd1ec73b_ebb8_638c_bed6_4b1e1c18cf91
  eab04a74_69bd_ee11_8af8_be1596b62f66["HttpMessage()"]
  0aa9414c_6f4a_5397_26cd_8cb3bcc1311d -->|method| eab04a74_69bd_ee11_8af8_be1596b62f66
  8155ee75_7798_21db_949a_b8a1a741aa43["isContentAlwaysEmpty()"]
  0aa9414c_6f4a_5397_26cd_8cb3bcc1311d -->|method| 8155ee75_7798_21db_949a_b8a1a741aa43
  31f756e3_b8b9_d4cb_31d3_5e65d36e644e["isDecodingRequest()"]
  0aa9414c_6f4a_5397_26cd_8cb3bcc1311d -->|method| 31f756e3_b8b9_d4cb_31d3_5e65d36e644e

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspDecoder.java lines 59–181

public class RtspDecoder extends HttpObjectDecoder {
    /**
     * Status code for unknown responses.
     */
    private static final HttpResponseStatus UNKNOWN_STATUS =
            new HttpResponseStatus(999, "Unknown");
    /**
     * True if the message to decode is a request.
     * False if the message to decode is a response.
     */
    private boolean isDecodingRequest;

    /**
     * Regex used on first line in message to detect if it is a response.
     */
    private static final Pattern versionPattern = Pattern.compile("RTSP/\\d\\.\\d");

    /**
     * Constant for default max content length.
     */
    public static final int DEFAULT_MAX_CONTENT_LENGTH = 8192;

    /**
     * Creates a new instance with the default
     * {@code maxInitialLineLength (4096)}, {@code maxHeaderSize (8192)}, and
     * {@code maxContentLength (8192)}.
     */
    public RtspDecoder() {
        this(DEFAULT_MAX_INITIAL_LINE_LENGTH,
             DEFAULT_MAX_HEADER_SIZE,
             DEFAULT_MAX_CONTENT_LENGTH);
    }

    /**
     * Creates a new instance with the specified parameters.
     * @param maxInitialLineLength The max allowed length of initial line
     * @param maxHeaderSize The max allowed size of header
     * @param maxContentLength The max allowed content length
     */
    public RtspDecoder(final int maxInitialLineLength,
                       final int maxHeaderSize,
                       final int maxContentLength) {
        super(new HttpDecoderConfig()
                .setMaxInitialLineLength(maxInitialLineLength)
                .setMaxHeaderSize(maxHeaderSize)
                .setMaxChunkSize(maxContentLength * 2)
                .setChunkedSupported(false));
    }

    /**
     * Creates a new instance with the specified parameters.
     * @param maxInitialLineLength The max allowed length of initial line
     * @param maxHeaderSize The max allowed size of header
     * @param maxContentLength The max allowed content length
     * @param validateHeaders Set to true if headers should be validated
     * @deprecated Use the {@link #RtspDecoder(HttpDecoderConfig)} constructor instead,
     * or the {@link #RtspDecoder(int, int, int)} to always enable header validation.
     */
    @Deprecated
    public RtspDecoder(final int maxInitialLineLength,
                       final int maxHeaderSize,
                       final int maxContentLength,
                       final boolean validateHeaders) {
        super(new HttpDecoderConfig()
                .setMaxInitialLineLength(maxInitialLineLength)
                .setMaxHeaderSize(maxHeaderSize)
                .setMaxChunkSize(maxContentLength * 2)
                .setChunkedSupported(false)
                .setValidateHeaders(validateHeaders));
    }

    /**
     * Creates a new instance with the specified configuration.
     */
    public RtspDecoder(HttpDecoderConfig config) {
        super(config.clone()
                .setMaxChunkSize(2 * config.getMaxChunkSize())
                .setChunkedSupported(false));
    }

    @Override

Frequently Asked Questions

What is the RtspDecoder class?
RtspDecoder is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspDecoder.java.
Where is RtspDecoder defined?
RtspDecoder is defined in codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspDecoder.java at line 59.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free