Top Description Fields Constructors Methods
io.netty.handler.codec.rtsp

public Class RtspDecoder

extends HttpObjectDecoder
Class Inheritance
Known Direct Subclasses
io.netty.handler.codec.rtsp.RtspRequestDecoder, io.netty.handler.codec.rtsp.RtspResponseDecoder
Imports
java.util.regex.Pattern, io.netty.buffer.Unpooled, io.netty.handler.codec.http.DefaultFullHttpRequest, .DefaultFullHttpResponse, .DefaultHttpRequest, .DefaultHttpResponse, .HttpDecoderConfig, .HttpMessage, .HttpObjectDecoder, .HttpResponseStatus

Decodes io.netty.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 io.netty.handler.codec.TooLongFrameException will be raised.
maxHeaderSize The maximum length of all headers. If the sum of the length of each header exceeds this value, a io.netty.handler.codec.TooLongFrameException will be raised.
maxContentLength The maximum length of the content. If the content length exceeds this value, a io.netty.handler.codec.TooLongFrameException will be raised.

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT_MAX_CONTENT_LENGTH

Constant for default max content length.

private boolean
isDecodingRequest

True if the message to decode is a request.

private static final HttpResponseStatus
UNKNOWN_STATUS

Status code for unknown responses.

private static final Pattern
versionPattern

Regex used on first line in message to detect if it is a response.

Inherited from io.netty.handler.codec.http.HttpObjectDecoder:
DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHSDEFAULT_ALLOW_PARTIAL_CHUNKSDEFAULT_CHUNKED_SUPPORTEDDEFAULT_INITIAL_BUFFER_SIZEDEFAULT_MAX_CHUNK_SIZEDEFAULT_MAX_HEADER_SIZEDEFAULT_MAX_INITIAL_LINE_LENGTHDEFAULT_VALIDATE_HEADERSheadersFactorytrailersFactoryvalidateHeaders

Constructor Summary

AccessConstructor and Description
public
RtspDecoder()

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

public
RtspDecoder(final int
The max allowed length of initial line
maxInitialLineLength
,
final int
The max allowed size of header
maxHeaderSize
,
final int
The max allowed content length
maxContentLength
)

Creates a new instance with the specified parameters.

public
RtspDecoder(final int
The max allowed length of initial line
maxInitialLineLength
,
final int
The max allowed size of header
maxHeaderSize
,
final int
The max allowed content length
maxContentLength
,
final boolean
Set to true if headers should be validated
validateHeaders
)

Deprecated Use the RtspDecoder(HttpDecoderConfig) constructor instead, or the RtspDecoder(int, int, int) to always enable header validation.
Creates a new instance with the specified parameters.
public
RtspDecoder(HttpDecoderConfig config)

Creates a new instance with the specified configuration.

Method Summary

Modifier and TypeMethod and Description
protected HttpMessage
protected HttpMessage
protected boolean
protected boolean
Inherited from io.netty.handler.codec.http.HttpObjectDecoder:
decodedecodeLasthandlerRemoved0handleTransferEncodingChunkedWithContentLengthisSwitchingToNonHttp1ProtocolisValidatingresetsplitFirstWordInitialLinesplitHeaderNamesplitSecondWordInitialLinesplitThirdWordInitialLineuserEventTriggered

Field Detail

DEFAULT_MAX_CONTENT_LENGTHback to summary
public static final int DEFAULT_MAX_CONTENT_LENGTH

Constant for default max content length.

isDecodingRequestback to summary
private boolean isDecodingRequest

True if the message to decode is a request. False if the message to decode is a response.

UNKNOWN_STATUSback to summary
private static final HttpResponseStatus UNKNOWN_STATUS

Status code for unknown responses.

versionPatternback to summary
private static final Pattern versionPattern

Regex used on first line in message to detect if it is a response.

Constructor Detail

RtspDecoderback to summary
public RtspDecoder()

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

RtspDecoderback to summary
public RtspDecoder(final int maxInitialLineLength, final int maxHeaderSize, final int maxContentLength)

Creates a new instance with the specified parameters.

Parameters
maxInitialLineLength:int

The max allowed length of initial line

maxHeaderSize:int

The max allowed size of header

maxContentLength:int

The max allowed content length

RtspDecoderback to summary
public RtspDecoder(final int maxInitialLineLength, final int maxHeaderSize, final int maxContentLength, final boolean validateHeaders)

Deprecated

Use the RtspDecoder(HttpDecoderConfig) constructor instead, or the RtspDecoder(int, int, int) to always enable header validation.

Creates a new instance with the specified parameters.

Parameters
maxInitialLineLength:int

The max allowed length of initial line

maxHeaderSize:int

The max allowed size of header

maxContentLength:int

The max allowed content length

validateHeaders:boolean

Set to true if headers should be validated

Annotations
@Deprecated
RtspDecoderback to summary
public RtspDecoder(HttpDecoderConfig config)

Creates a new instance with the specified configuration.

Method Detail

createInvalidMessageback to summary
protected HttpMessage createInvalidMessage()

Implements abstract io.netty.handler.codec.http.HttpObjectDecoder.createInvalidMessage.

Annotations
@Override
createMessageback to summary
protected HttpMessage createMessage(final String[] initialLine) throws Exception

Implements abstract io.netty.handler.codec.http.HttpObjectDecoder.createMessage.

Annotations
@Override
isContentAlwaysEmptyback to summary
protected boolean isContentAlwaysEmpty(final HttpMessage msg)

Overrides io.netty.handler.codec.http.HttpObjectDecoder.isContentAlwaysEmpty.

Annotations
@Override
isDecodingRequestback to summary
protected boolean isDecodingRequest()

Implements abstract io.netty.handler.codec.http.HttpObjectDecoder.isDecodingRequest.

Annotations
@Override