Package org.red5.io.flv
Class FLVHeader
java.lang.Object
org.red5.io.flv.FLVHeader
FLVHeader parses out the contents of a FLV video file and returns the Header data
- Author:
- The Red5 Project, Dominick Accattato ([email protected]), Luke Hubbard, Codegent Ltd ([email protected]), Tiago Jacobs ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionintreserved for data up to 4,294,967,295booleanAudio flagstatic byteReserved flag, onestatic byteReserved flag, twobooleanVideo flag(package private) static final int(package private) static final intstatic final byte[]Signaturestatic final byteFLV version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the data offset bytesbooleanReturns a boolean on whether this data contains audiobyteGets the FlagReserved01 which is a datatype specified in the Flash SpecificationbyteGets the FlagReserved02 which is a datatype specified in the Flash SpecificationbooleanReturns a boolean on whether this data contains videobyte[]Returns the signature bytesbyteGets the version bytevoidsetDataOffset(int data_offset) Sets the data offset bytesvoidsetFlagAudio(boolean flagAudio) Sets the audioflag on whether this data contains audiovoidsetFlagReserved01(byte flagReserved01) Sets the FlagReserved01 which is a datatype specified in the Flash SpecificationvoidsetFlagReserved02(byte flagReserved02) Sets the Flag Reserved02 which is a datatype specified in the Flash SpecificationvoidsetFlagVideo(boolean type_flags_video) Sets the audioflag on whether this data contains audiovoidsetTypeFlags(byte typeFlags) Sets the type flags on whether this data is audio or videotoString()Overrides the toString method so that a FLVHeader can be represented by its datatypesvoidwrite(ByteBuffer buffer) voidwrite(org.apache.mina.core.buffer.IoBuffer buffer) Writes the FLVHeader to IoBuffer.
-
Field Details
-
FLV_HEADER_FLAG_HAS_AUDIO
static final int FLV_HEADER_FLAG_HAS_AUDIO- See Also:
-
FLV_HEADER_FLAG_HAS_VIDEO
static final int FLV_HEADER_FLAG_HAS_VIDEO- See Also:
-
signature
public static final byte[] signatureSignature -
version
public static final byte versionFLV version- See Also:
-
flagReserved01
public static byte flagReserved01Reserved flag, one -
flagAudio
public boolean flagAudioAudio flag -
flagReserved02
public static byte flagReserved02Reserved flag, two -
flagVideo
public boolean flagVideoVideo flag -
dataOffset
public int dataOffsetreserved for data up to 4,294,967,295
-
-
Constructor Details
-
FLVHeader
public FLVHeader()
-
-
Method Details
-
getDataOffset
public int getDataOffset()Returns the data offset bytes- Returns:
- int Data offset
-
setDataOffset
public void setDataOffset(int data_offset) Sets the data offset bytes- Parameters:
data_offset- Data offset
-
getSignature
public byte[] getSignature()Returns the signature bytes- Returns:
- byte[] Signature
-
toString
Overrides the toString method so that a FLVHeader can be represented by its datatypes -
getFlagAudio
public boolean getFlagAudio()Returns a boolean on whether this data contains audio- Returns:
- boolean
trueif this FLV header contains audio data,falseotherwise
-
setFlagAudio
public void setFlagAudio(boolean flagAudio) Sets the audioflag on whether this data contains audio- Parameters:
flagAudio-trueif this FLV header contains audio data,falseotherwise
-
setTypeFlags
public void setTypeFlags(byte typeFlags) Sets the type flags on whether this data is audio or video- Parameters:
typeFlags- Type flags determining data types (audio or video)
-
getFlagReserved01
public byte getFlagReserved01()Gets the FlagReserved01 which is a datatype specified in the Flash Specification- Returns:
- byte Flag reserved, first
-
setFlagReserved01
public void setFlagReserved01(byte flagReserved01) Sets the FlagReserved01 which is a datatype specified in the Flash Specification- Parameters:
flagReserved01- Flag reserved, first
-
getFlagReserved02
public byte getFlagReserved02()Gets the FlagReserved02 which is a datatype specified in the Flash Specification- Returns:
- byte FlagReserved02
-
setFlagReserved02
public void setFlagReserved02(byte flagReserved02) Sets the Flag Reserved02 which is a datatype specified in the Flash Specification- Parameters:
flagReserved02- FlagReserved02
-
getFlagVideo
public boolean getFlagVideo()Returns a boolean on whether this data contains video- Returns:
- boolean
trueif this FLV header contains vide data,falseotherwise
-
setFlagVideo
public void setFlagVideo(boolean type_flags_video) Sets the audioflag on whether this data contains audio- Parameters:
type_flags_video-trueif this FLV header contains video data,falseotherwise
-
getVersion
public byte getVersion()Gets the version byte- Returns:
- byte FLV version byte
-
write
public void write(org.apache.mina.core.buffer.IoBuffer buffer) Writes the FLVHeader to IoBuffer.- Parameters:
buffer- IoBuffer to write
-
write
-