Package org.red5.server.net.protocol
Class RTMPDecodeState
java.lang.Object
org.red5.server.net.protocol.RTMPDecodeState
Represents current decode state of the protocol.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic byteDecoder is buffering state constant.static byteDecoding continues state constant.static byteDecoding finished successfully state constant.private intClasses like the RTMP state object will extend this marker interface.private byteCurrent decoder state, decoder is stopped by default.private static final String[]Names for the states.final StringSession id to which this decoding state belongs. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbufferDecoding(int amount) Specifies buffer decoding amountbooleanChecks whether decoding process can be continued.booleancanStartDecoding(int remaining) Checks whether remaining buffer size is greater or equal than buffer amount and so if it makes sense to start decoding.voidSet decoding state as "needed to be continued".intReturns current buffer amount.booleanChecks whether decoding is complete.voidStarts decoding.toString()
-
Field Details
-
DECODER_OK
public static byte DECODER_OKDecoding finished successfully state constant. -
DECODER_CONTINUE
public static byte DECODER_CONTINUEDecoding continues state constant. -
DECODER_BUFFER
public static byte DECODER_BUFFERDecoder is buffering state constant. -
sessionId
Session id to which this decoding state belongs. -
decoderBufferAmount
private int decoderBufferAmountClasses like the RTMP state object will extend this marker interface. -
decoderState
private byte decoderStateCurrent decoder state, decoder is stopped by default. -
names
Names for the states.
-
-
Constructor Details
-
RTMPDecodeState
-
-
Method Details
-
getDecoderBufferAmount
public int getDecoderBufferAmount()Returns current buffer amount.- Returns:
- Buffer amount
-
bufferDecoding
public void bufferDecoding(int amount) Specifies buffer decoding amount- Parameters:
amount- Buffer decoding amount
-
continueDecoding
public void continueDecoding()Set decoding state as "needed to be continued". -
canStartDecoding
public boolean canStartDecoding(int remaining) Checks whether remaining buffer size is greater or equal than buffer amount and so if it makes sense to start decoding.- Parameters:
remaining- Remaining buffer size- Returns:
- true if there is data to decode, false otherwise
-
startDecoding
public void startDecoding()Starts decoding. Sets state to "ready" and clears buffer amount. -
hasDecodedObject
public boolean hasDecodedObject()Checks whether decoding is complete.- Returns:
- true if decoding has finished, false otherwise
-
canContinueDecoding
public boolean canContinueDecoding()Checks whether decoding process can be continued.- Returns:
- true if decoding can be continued, false otherwise
-
getSessionId
- Returns:
- the sessionId
-
toString
-