public class Buffer
extends java.lang.Object
Buffer
carries media data from one media processing unit to another.Modifier and Type | Field and Description |
---|---|
java.lang.Object |
data
The media data.
|
java.util.EnumSet<BufferFlag> |
flags
A flag mask that describes the boolean attributes for this buffer.
|
Format |
format
The format of the data in this buffer.
|
java.lang.Object |
header
Header information, such as RTP header for this chunk.
|
int |
length
The data length.
|
static int |
NOT_SPECIFIED
Values which are not specified must have this value.
|
int |
offset
The data offset.
|
int |
sampleCount
The number of samples in the data field.
|
Rational |
sampleDuration
Duration of a sample in seconds.
|
long |
sequenceNumber
Sequence number of the buffer.
|
Rational |
timeStamp
The time stamp of this buffer in seconds.
|
int |
track
The track number.
|
Constructor and Description |
---|
Buffer() |
Modifier and Type | Method and Description |
---|---|
void |
clearFlag(BufferFlag flag)
Convenience method for clearing a flag.
|
void |
clearFlags() |
boolean |
isFlag(BufferFlag flag)
Returns true if the specified flag is set.
|
void |
setDataTo(Buffer that)
Sets
data , offset , length and header
of this buffer to that buffer. |
void |
setFlag(BufferFlag flag)
Convenience method for setting a flag.
|
void |
setFlag(BufferFlag flag,
boolean value)
Sets or clears the specified flag.
|
void |
setFlagsTo(BufferFlag... flags)
Clears all flags, and then sets the specified flag.
|
void |
setFlagsTo(java.util.EnumSet<BufferFlag> flags)
Clears all flags, and then sets the specified flag.
|
void |
setMetaTo(Buffer that)
Sets all variables of this buffer to that buffer except for
data ,
offset , length and header . |
public java.util.EnumSet<BufferFlag> flags
public static final int NOT_SPECIFIED
public int track
public java.lang.Object header
public java.lang.Object data
public int offset
data
is an array.public int length
data
is an array.public Rational sampleDuration
sampleCount
to get the buffer duration.public Rational timeStamp
public Format format
public int sampleCount
public long sequenceNumber
public void setMetaTo(Buffer that)
data
,
offset
, length
and header
.public void setDataTo(Buffer that)
data
, offset
, length
and header
of this buffer to that buffer.
Note that this method creates copies of the data
and
header
, so that these fields in that buffer can be discarded
without affecting the contents of this buffer.
FIXME - This method does not always create a copy!!
public boolean isFlag(BufferFlag flag)
public void setFlag(BufferFlag flag)
public void clearFlag(BufferFlag flag)
public void setFlag(BufferFlag flag, boolean value)
public void setFlagsTo(BufferFlag... flags)
public void setFlagsTo(java.util.EnumSet<BufferFlag> flags)
public void clearFlags()