public static final class MediaCodec.BufferInfo extends Object
Modifier and Type | Field and Description |
---|---|
int |
flags
Buffer flags associated with the buffer.
|
int |
offset
The start-offset of the data in the buffer.
|
long |
presentationTimeUs
The presentation timestamp in microseconds for the buffer.
|
int |
size
The amount of data (in bytes) in the buffer.
|
Constructor and Description |
---|
BufferInfo() |
Modifier and Type | Method and Description |
---|---|
MediaCodec.BufferInfo |
dup() |
void |
set(int newOffset,
int newSize,
long newTimeUs,
int newFlags)
Update the buffer metadata information.
|
public int offset
public int size
0
,
the buffer has no data in it and can be discarded. The only
use of a 0-size buffer is to carry the end-of-stream marker.public long presentationTimeUs
public int flags
MediaCodec.BUFFER_FLAG_KEY_FRAME
and MediaCodec.BUFFER_FLAG_END_OF_STREAM
.
Encoded buffers that are key frames are marked with
MediaCodec.BUFFER_FLAG_KEY_FRAME
.
The last output buffer corresponding to the input buffer
marked with MediaCodec.BUFFER_FLAG_END_OF_STREAM
will also be marked
with MediaCodec.BUFFER_FLAG_END_OF_STREAM
. In some cases this could
be an empty buffer, whose sole purpose is to carry the end-of-stream
marker.
public void set(int newOffset, int newSize, long newTimeUs, int newFlags)
newOffset
- the start-offset of the data in the buffer.newSize
- the amount of data (in bytes) in the buffer.newTimeUs
- the presentation timestamp in microseconds.newFlags
- buffer flags associated with the buffer. This
should be a combination of MediaCodec.BUFFER_FLAG_KEY_FRAME
and
MediaCodec.BUFFER_FLAG_END_OF_STREAM
.public MediaCodec.BufferInfo dup()