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

public Class RtspDecoder

extends HttpObjectDecoder
Class Inheritance
Imports
io.netty5.channel.ChannelHandlerContext, io.netty5.handler.codec.http.DefaultFullHttpRequest, .DefaultFullHttpResponse, .DefaultHttpRequest, .DefaultHttpResponse, .HttpMessage, .HttpObjectDecoder, .HttpResponseStatus, java.util.regex.Pattern

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 io.netty5.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.netty5.handler.codec.TooLongFrameException will be raised.
maxContentLength The maximum length of the content. If the content length exceeds this value, a io.netty5.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.netty5.handler.codec.http.HttpObjectDecoder:
DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHSDEFAULT_CHUNKED_SUPPORTEDDEFAULT_INITIAL_BUFFER_SIZEDEFAULT_MAX_HEADER_SIZEDEFAULT_MAX_INITIAL_LINE_LENGTHDEFAULT_VALIDATE_HEADERSvalidateHeaders

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
)

Creates a new instance with the specified parameters.

Method Summary

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

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)

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

Method Detail

createInvalidMessageback to summary
protected HttpMessage createInvalidMessage(ChannelHandlerContext ctx)

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

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

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

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

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

Annotations
@Override
isDecodingRequestback to summary
protected boolean isDecodingRequest()

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

Annotations
@Override