Package org.red5.server.stream.consumer
Class ImmutableTag
java.lang.Object
org.red5.server.stream.consumer.ImmutableTag
- All Implemented Interfaces:
IoConstants,ITag
An ImmutableTag represents immutable encapsulation of flash media data. The timestamp is the only mutable field.
- Author:
- Paul Gregoire ([email protected])
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]Tag body as byte bufferprivate final byteTag data typeprivate final intPrevious tag sizeprivate intTimestampFields inherited from interface org.red5.io.IoConstants
AVC_PACKET_TYPE_END_OF_SEQUENCE, AVC_PACKET_TYPE_NALU, AVC_PACKET_TYPE_SEQUENCE_HEADER, FLAG_CODEC_H263, FLAG_CODEC_SCREEN, FLAG_CODEC_VP6, FLAG_FORMAT_ADPCM, FLAG_FORMAT_MP3, FLAG_FORMAT_NELLYMOSER, FLAG_FORMAT_NELLYMOSER_8_KHZ, FLAG_FORMAT_RAW, FLAG_FRAMETYPE_DISPOSABLE, FLAG_FRAMETYPE_GENERATED_KEYFRAME, FLAG_FRAMETYPE_INFO, FLAG_FRAMETYPE_INTERFRAME, FLAG_FRAMETYPE_KEYFRAME, FLAG_RATE_11_KHZ, FLAG_RATE_22_KHZ, FLAG_RATE_44_KHZ, FLAG_RATE_48_KHZ, FLAG_RATE_5_5_KHZ, FLAG_SIZE_16_BIT, FLAG_SIZE_8_BIT, FLAG_TYPE_MONO, FLAG_TYPE_STEREO, INFO_PACKET_SEEK_END, INFO_PACKET_SEEK_START, MASK_SOUND_FORMAT, MASK_SOUND_RATE, MASK_SOUND_SIZE, MASK_SOUND_TYPE, MASK_VIDEO_CODEC, MASK_VIDEO_FRAMETYPE, TYPE_AUDIO, TYPE_ENCRYPTED, TYPE_ENCRYPTED_AUDIO, TYPE_ENCRYPTED_METADATA, TYPE_ENCRYPTED_VIDEO, TYPE_METADATA, TYPE_VIDEO -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableTag(byte dataType, int timestamp, byte[] data) ImmutableTag ConstructorprivateImmutableTag(byte dataType, int timestamp, byte[] data, int previousTagSize) ImmutableTag Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTagbuild(byte dataType, int timestamp) static ImmutableTagbuild(byte dataType, int timestamp, byte[] data, int previousTagSize) static ImmutableTagstatic ImmutableTagbuild(byte dataType, int timestamp, org.apache.mina.core.buffer.IoBuffer data) static ImmutableTagbuild(byte dataType, int timestamp, org.apache.mina.core.buffer.IoBuffer data, int previousTagSize) org.apache.mina.core.buffer.IoBuffergetBody()Return the body IoBufferintReturn the size of the bodyorg.apache.mina.core.buffer.IoBuffergetData()Returns the data as a ByteBufferbyteGet the data typeintReturn previous tag sizeintReturn the timestampvoidsetBody(org.apache.mina.core.buffer.IoBuffer body) Set the body ByteBuffer.voidsetBodySize(int size) Set the size of the body.voidsetDataType(byte datatype) Set the data type.voidsetPreviousTagSize(int size) Set the size of the previous tag.voidsetTimestamp(int timestamp) Set the timestamp.toString()Prints out the contents of the tag
-
Field Details
-
dataType
private final byte dataTypeTag data type -
timestamp
private int timestampTimestamp -
body
private final byte[] bodyTag body as byte buffer -
previousTagSize
private final int previousTagSizePrevious tag size
-
-
Constructor Details
-
ImmutableTag
private ImmutableTag(byte dataType, int timestamp, byte[] data) ImmutableTag Constructor- Parameters:
dataType- Tag data typetimestamp- Timestampbody- Tag body
-
ImmutableTag
private ImmutableTag(byte dataType, int timestamp, byte[] data, int previousTagSize) ImmutableTag Constructor- Parameters:
dataType- Tag data typetimestamp- Timestampbody- Tag bodypreviousTagSize- Previous tag size information
-
-
Method Details
-
getDataType
public byte getDataType()Get the data type- Specified by:
getDataTypein interfaceITag- Returns:
- Tag data type
-
getTimestamp
public int getTimestamp()Return the timestamp- Specified by:
getTimestampin interfaceITag- Returns:
- Tag timestamp
-
setTimestamp
public void setTimestamp(int timestamp) Description copied from interface:ITagSet the timestamp.- Specified by:
setTimestampin interfaceITag- Parameters:
timestamp- Timestamp
-
getData
public org.apache.mina.core.buffer.IoBuffer getData()Returns the data as a ByteBuffer -
getBody
public org.apache.mina.core.buffer.IoBuffer getBody()Return the body IoBuffer -
getBodySize
public int getBodySize()Return the size of the body- Specified by:
getBodySizein interfaceITag- Returns:
- Tag body size
-
getPreviousTagSize
public int getPreviousTagSize()Return previous tag size- Specified by:
getPreviousTagSizein interfaceITag- Returns:
- Previous tag size
-
setBody
public void setBody(org.apache.mina.core.buffer.IoBuffer body) Description copied from interface:ITagSet the body ByteBuffer. -
setBodySize
public void setBodySize(int size) Description copied from interface:ITagSet the size of the body.- Specified by:
setBodySizein interfaceITag- Parameters:
size- Body size
-
setDataType
public void setDataType(byte datatype) Description copied from interface:ITagSet the data type.- Specified by:
setDataTypein interfaceITag- Parameters:
datatype- Data type
-
setPreviousTagSize
public void setPreviousTagSize(int size) Description copied from interface:ITagSet the size of the previous tag.- Specified by:
setPreviousTagSizein interfaceITag- Parameters:
size- Previous tag size
-
toString
Prints out the contents of the tag -
build
-
build
-
build
public static ImmutableTag build(byte dataType, int timestamp, org.apache.mina.core.buffer.IoBuffer data) -
build
-
build
public static ImmutableTag build(byte dataType, int timestamp, org.apache.mina.core.buffer.IoBuffer data, int previousTagSize)
-