NalUnitTargetBuffer
@UnstableApi
public final class NalUnitTargetBuffer
A buffer that fills itself with data corresponding to a specific NAL unit, as it is encountered in the stream.
Summary
Public fields |
|
|---|---|
boolean |
|
byte[] |
|
int |
Public constructors |
|---|
NalUnitTargetBuffer(int targetType, int initialCapacity)Creates the buffer. |
Public methods |
|
|---|---|
void |
appendToNalUnit(byte[] data, int offset, int limit)Called to pass stream data. |
boolean |
endNalUnit(int discardPadding)Called to indicate that a NAL unit has ended. |
boolean |
Returns whether the buffer currently holds a complete NAL unit of the target type. |
void |
reset()Resets the buffer, clearing any data that it holds. |
void |
startNalUnit(int type)Called to indicate that a NAL unit has started. |
Public fields
Public constructors
NalUnitTargetBuffer
public NalUnitTargetBuffer(int targetType, int initialCapacity)
Creates the buffer.
| Parameters | |
|---|---|
int targetType |
The type of the NAL unit. |
int initialCapacity |
The initial capacity of the buffer in bytes. |
Public methods
appendToNalUnit
public void appendToNalUnit(byte[] data, int offset, int limit)
Called to pass stream data. The data passed should not include the 3 byte start code.
| Parameters | |
|---|---|
byte[] data |
Holds the data being passed. |
int offset |
The offset of the data in |
int limit |
The limit (exclusive) of the data in |
endNalUnit
public boolean endNalUnit(int discardPadding)
Called to indicate that a NAL unit has ended.
| Parameters | |
|---|---|
int discardPadding |
The number of excess bytes that were passed to |
| Returns | |
|---|---|
boolean |
Whether the ended NAL unit is of the target type. |
isCompleted
public boolean isCompleted()
Returns whether the buffer currently holds a complete NAL unit of the target type.
startNalUnit
public void startNalUnit(int type)
Called to indicate that a NAL unit has started.
| Parameters | |
|---|---|
int type |
The type of the NAL unit. |