DecoderInputBuffer
@UnstableApi
class DecoderInputBuffer : Buffer
Holds input for a decoder.
Summary
Nested types |
|---|
@DocumentedThe buffer replacement mode. |
|
Thrown when an attempt is made to write into a |
Constants |
|
|---|---|
const Int |
Allows buffer replacement using |
const Int |
Disallows buffer replacement. |
const Int |
Allows buffer replacement using |
Public constructors |
|---|
DecoderInputBuffer(Creates a new instance. |
DecoderInputBuffer(Creates a new instance. |
Public functions |
|
|---|---|
Unit |
clear()Clears the buffer. |
Unit |
@EnsuresNonNull(value = "data")Ensures that |
Unit |
flip()Flips |
Boolean |
Returns whether the |
java-static DecoderInputBuffer! |
Returns a new instance that's not able to hold any data. |
Unit |
@EnsuresNonNull(value = "supplementalData")Clears |
Public properties |
|
|---|---|
CryptoInfo! |
|
ByteBuffer? |
The buffer's data, or |
Format? |
The |
ByteBuffer? |
Supplemental data related to the buffer, if |
Long |
The time at which the sample should be presented. |
Boolean |
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. |
Inherited functions |
||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Constants
BUFFER_REPLACEMENT_MODE_DIRECT
const val BUFFER_REPLACEMENT_MODE_DIRECT = 2: Int
Allows buffer replacement using allocateDirect.
BUFFER_REPLACEMENT_MODE_DISABLED
const val BUFFER_REPLACEMENT_MODE_DISABLED = 0: Int
Disallows buffer replacement.
BUFFER_REPLACEMENT_MODE_NORMAL
const val BUFFER_REPLACEMENT_MODE_NORMAL = 1: Int
Allows buffer replacement using allocate.
Public constructors
DecoderInputBuffer
DecoderInputBuffer(
@DecoderInputBuffer.BufferReplacementMode bufferReplacementMode: Int
)
Creates a new instance.
| Parameters | |
|---|---|
@DecoderInputBuffer.BufferReplacementMode bufferReplacementMode: Int |
The |
DecoderInputBuffer
DecoderInputBuffer(
@DecoderInputBuffer.BufferReplacementMode bufferReplacementMode: Int,
paddingSize: Int
)
Creates a new instance.
| Parameters | |
|---|---|
@DecoderInputBuffer.BufferReplacementMode bufferReplacementMode: Int |
The |
paddingSize: Int |
If non-zero, |
Public functions
ensureSpaceForWrite
@EnsuresNonNull(value = "data")
fun ensureSpaceForWrite(length: Int): Unit
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: Int |
The length of the write that must be accommodated, in bytes. |
| Throws | |
|---|---|
androidx.media3.decoder.DecoderInputBuffer.InsufficientCapacityException |
If there is insufficient capacity to accommodate the write and |
flip
fun flip(): Unit
Flips data and supplementalData in preparation for being queued to a decoder.
| See also | |
|---|---|
flip |
newNoDataInstance
java-static fun newNoDataInstance(): DecoderInputBuffer!
Returns a new instance that's not able to hold any data.
resetSupplementalData
@EnsuresNonNull(value = "supplementalData")
fun resetSupplementalData(length: Int): Unit
Clears supplementalData and ensures that it's large enough to accommodate
length bytes.
| Parameters | |
|---|---|
length: Int |
The length of the supplemental data that must be accommodated, in bytes. |
Public properties
supplementalData
val supplementalData: ByteBuffer?
Supplemental data related to the buffer, if hasSupplementalData returns true. If present, the buffer is populated with supplemental data from position 0 to its limit.
waitingForKeys
val waitingForKeys: Boolean
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.