Class Buffer
java.lang.Object
org.monte.media.av.Buffer
A
Buffer carries media data from one media processing unit to
another.- Author:
- Werner Randelshofer
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe media data.A flag mask that describes the boolean attributes for this buffer.The format of the data in this buffer.Header information, such as RTP header for this chunk.intThe header length.intThe header offset.intThe data length.static final intValues which are not specified must have this value.intThe data offset.intThe number of samples in the data field.Duration of a sample in seconds.longSequence number of the buffer.The time stamp of this buffer in seconds.intThe track number. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearFlag(BufferFlag flag) Convenience method for clearing a flag.voidbooleanisFlag(BufferFlag flag) Returns true if the specified flag is set.intSetsdata,offset,lengthandheaderof this buffer to that buffer.voidsetFlag(BufferFlag flag) Convenience method for setting a flag.voidsetFlag(BufferFlag flag, boolean value) Sets or clears the specified flag.voidsetFlagsTo(EnumSet<BufferFlag> flags) Clears all flags, and then sets the specified flag.voidsetFlagsTo(BufferFlag... flags) Clears all flags, and then sets the specified flag.voidSets all variables of this buffer to that buffer except fordata,offset,lengthandheader.toString()
-
Field Details
-
flags
A flag mask that describes the boolean attributes for this buffer. -
NOT_SPECIFIED
public static final int NOT_SPECIFIEDValues which are not specified must have this value.- See Also:
-
track
public int trackThe track number. This can be set to NOT_SPECIFIED or to a number >= 0. -
header
Header information, such as RTP header for this chunk. -
headerOffset
public int headerOffsetThe header offset. This field is only used ifheaderis an array. -
headerLength
public int headerLengthThe header length. This field is only used ifheaderis an array. -
data
The media data. -
offset
public int offsetThe data offset. This field is only used ifdatais an array. -
length
public int lengthThe data length. This field is only used ifdatais an array. -
sampleDuration
Duration of a sample in seconds. Multiply this withsampleCountto get the buffer duration. -
timeStamp
The time stamp of this buffer in seconds. -
format
The format of the data in this buffer. -
sampleCount
public int sampleCountThe number of samples in the data field. -
sequenceNumber
public long sequenceNumberSequence number of the buffer. This can be used for debugging.
-
-
Constructor Details
-
Buffer
public Buffer()
-
-
Method Details
-
setMetaTo
Sets all variables of this buffer to that buffer except fordata,offset,lengthandheader. -
setDataTo
Setsdata,offset,lengthandheaderof this buffer to that buffer. Note that this method creates copies of thedataandheader, so that these fields in that buffer can be discarded without affecting the contents of this buffer.Returns
Codec.CODEC_FAILEDorCodec.CODEC_OK -
isFlag
Returns true if the specified flag is set. -
setFlag
Convenience method for setting a flag. -
clearFlag
Convenience method for clearing a flag. -
setFlag
Sets or clears the specified flag. -
setFlagsTo
Clears all flags, and then sets the specified flag. -
setFlagsTo
Clears all flags, and then sets the specified flag. -
clearFlags
public void clearFlags() -
toString
-