docs/doc/reference/com/google/android/exoplayer2/decoder/DecoderInputBuffer.html
Package com.google.android.exoplayer2.decoder
Direct Known Subclasses:MetadataInputBuffer, SubtitleInputBuffer
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classDecoderInputBufferextends[Buffer](Buffer.html "class in com.google.android.exoplayer2.decoder")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Holds input for a decoder.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static interface | DecoderInputBuffer.BufferReplacementMode |
Deprecated.
The buffer replacement mode.
|
| static class | DecoderInputBuffer.InsufficientCapacityException |
Deprecated.
Thrown when an attempt is made to write into a DecoderInputBuffer whose bufferReplacementMode is BUFFER_REPLACEMENT_MODE_DISABLED and who data capacity is smaller than required.
|
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static int | BUFFER_REPLACEMENT_MODE_DIRECT |
Deprecated.
Allows buffer replacement using ByteBuffer.allocateDirect(int).
|
| static int | BUFFER_REPLACEMENT_MODE_DISABLED |
Deprecated.
Disallows buffer replacement.
|
| static int | BUFFER_REPLACEMENT_MODE_NORMAL |
Deprecated.
Allows buffer replacement using ByteBuffer.allocate(int).
|
| CryptoInfo | cryptoInfo |
Deprecated.
CryptoInfo for encrypted data.
|
| ByteBuffer | data |
Deprecated.
The buffer's data, or null if no data has been set.
|
| Format | format |
Deprecated.
The Format.
|
| ByteBuffer | supplementalData |
Deprecated.
Supplemental data related to the buffer, if Buffer.hasSupplementalData() returns true.
|
| long | timeUs |
Deprecated.
The time at which the sample should be presented.
|
| boolean | waitingForKeys |
Deprecated.
Whether the last attempt to read a sample into this buffer failed due to not yet having the DRM keys associated with the next sample. |
Constructors | Constructor | Description |
| --- | --- |
| DecoderInputBuffer(@com.google.android.exoplayer2.decoder.DecoderInputBuffer.BufferReplacementMode int bufferReplacementMode) |
Deprecated.
Creates a new instance.
|
| DecoderInputBuffer(@com.google.android.exoplayer2.decoder.DecoderInputBuffer.BufferReplacementMode int bufferReplacementMode, int paddingSize) |
Deprecated.
Creates a new instance. |
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | clear() |
Deprecated.
Clears the buffer.
|
| void | ensureSpaceForWrite(int length) |
Deprecated.
Ensures that data is large enough to accommodate a write of a given length at its current position.
|
| void | flip() |
Deprecated.
Flips data and supplementalData in preparation for being queued to a decoder.
|
| boolean | isEncrypted() |
Deprecated.
Returns whether the C.BUFFER_FLAG_ENCRYPTED flag is set.
|
| static DecoderInputBuffer | newNoDataInstance() |
Deprecated.
Returns a new instance that's not able to hold any data.
|
| void | resetSupplementalData(int length) |
Deprecated.
Clears supplementalData and ensures that it's large enough to accommodate length bytes.
|
-
addFlag, clearFlag, getFlag, hasSupplementalData, isDecodeOnly, isEndOfStream, isFirstSample, isKeyFrame, isLastSample, setFlags
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public static final int BUFFER_REPLACEMENT_MODE_DISABLED
Deprecated.
Disallows buffer replacement. See Also:Constant Field Values
-
public static final int BUFFER_REPLACEMENT_MODE_NORMAL
Deprecated.
Allows buffer replacement using ByteBuffer.allocate(int).
See Also:Constant Field Values
-
public static final int BUFFER_REPLACEMENT_MODE_DIRECT
Deprecated.
Allows buffer replacement using ByteBuffer.allocateDirect(int).
See Also:Constant Field Values
-
@Nullable
public[Format](../Format.html "class in com.google.android.exoplayer2")format
Deprecated.
The Format.
-
public final[CryptoInfo](CryptoInfo.html "class in com.google.android.exoplayer2.decoder")cryptoInfo
Deprecated.
CryptoInfo for encrypted data.
-
@Nullable
public[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")data
Deprecated.
The buffer's data, or null if no data has been set.
-
public boolean waitingForKeys
Deprecated.
Whether the last attempt to read a sample into this buffer failed due to not yet having the DRM keys associated with the next sample.
-
public long timeUs
Deprecated.
The time at which the sample should be presented.
-
@Nullable
public[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")supplementalData
Deprecated.
Supplemental data related to the buffer, if Buffer.hasSupplementalData() returns true. If present, the buffer is populated with supplemental data from position 0 to its limit.
-
public DecoderInputBuffer(@com.google.android.exoplayer2.decoder.DecoderInputBuffer.BufferReplacementMode int bufferReplacementMode)
Deprecated.
Creates a new instance.
Parameters:bufferReplacementMode - The DecoderInputBuffer.BufferReplacementMode replacement mode.
-
public DecoderInputBuffer(@com.google.android.exoplayer2.decoder.DecoderInputBuffer.BufferReplacementMode int bufferReplacementMode,
int paddingSize)
Deprecated.
Creates a new instance.
Parameters:bufferReplacementMode - The DecoderInputBuffer.BufferReplacementMode replacement mode.paddingSize - If non-zero, ensureSpaceForWrite(int) will ensure that the buffer is this number of bytes larger than the requested length. This can be useful for decoders that consume data in fixed size blocks, for efficiency. Setting the padding size to the decoder's fixed read size is necessary to prevent such a decoder from trying to read beyond the end of the buffer.
-
public static[DecoderInputBuffer](DecoderInputBuffer.html "class in com.google.android.exoplayer2.decoder")newNoDataInstance()
Deprecated.
Returns a new instance that's not able to hold any data.
-
@EnsuresNonNull("supplementalData")
public void resetSupplementalData(int length)
Deprecated.
Clears supplementalData and ensures that it's large enough to accommodate length bytes.
Parameters:length - The length of the supplemental data that must be accommodated, in bytes.
-
@EnsuresNonNull("data")
public void ensureSpaceForWrite(int length)
Deprecated.
Ensures that data is large enough to accommodate a write of a given length at its current position.
If the capacity of data is sufficient this method does nothing. If the capacity is insufficient then an attempt is made to replace data with a new ByteBuffer whose capacity is sufficient. Data up to the current position is copied to the new buffer.
Parameters:length - The length of the write that must be accommodated, in bytes.Throws:DecoderInputBuffer.InsufficientCapacityException - If there is insufficient capacity to accommodate the write and bufferReplacementMode is BUFFER_REPLACEMENT_MODE_DISABLED.
-
public final boolean isEncrypted()
Deprecated.
Returns whether the C.BUFFER_FLAG_ENCRYPTED flag is set.
-
public final void flip()
Deprecated.
Flips data and supplementalData in preparation for being queued to a decoder.
See Also:Buffer.flip()
-
public void clear()
Deprecated.
Description copied from class: Buffer
Clears the buffer.
Overrides:clear in class Buffer