# MetadataInputBuffer

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/metadata/MetadataInputBuffer.java+class:androidx.media3.extractor.metadata.MetadataInputBuffer)

*** ** * ** ***


```
@UnstableApi
class MetadataInputBuffer : DecoderInputBuffer
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [androidx.media3.decoder.Buffer](https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer) |||
|   | ↳ | [androidx.media3.decoder.DecoderInputBuffer](https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer) ||
|   |   | ↳ | [androidx.media3.extractor.metadata.MetadataInputBuffer](https://developer.android.com/reference/kotlin/androidx/media3/extractor/metadata/MetadataInputBuffer) |

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer` for a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/metadata/MetadataDecoder`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/metadata/MetadataInputBuffer#MetadataInputBuffer()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/metadata/MetadataInputBuffer#subsampleOffsetUs()` An offset that must be added to the metadata's timestamps after it's been decoded, or `https://developer.android.com/reference/kotlin/androidx/media3/common/Format#OFFSET_SAMPLE_RELATIVE()` if `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#timeUs()` should be added. |

### Inherited Constants

From [androidx.media3.decoder.DecoderInputBuffer](https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#BUFFER_REPLACEMENT_MODE_DIRECT() = 2`

Allows buffer replacement using `https://developer.android.com/reference/java/nio/ByteBuffer.html#allocateDirect(int)`.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#BUFFER_REPLACEMENT_MODE_DISABLED() = 0`

Disallows buffer replacement.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#BUFFER_REPLACEMENT_MODE_NORMAL() = 1`

Allows buffer replacement using `https://developer.android.com/reference/java/nio/ByteBuffer.html#allocate(int)`.

### Inherited functions

From [androidx.media3.decoder.Buffer](https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#addFlag(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.BufferFlags flag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Adds the `flag` to this buffer's flags.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#clearFlag(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.BufferFlags flag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Removes the `flag` from this buffer's flags, if it is set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/Pure.html
https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#getFlag(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.BufferFlags flag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Returns whether the specified flag has been set on this buffer.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/Pure.html
https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#hasSupplementalData()()`

Returns whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/C#BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA()` flag is set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/Pure.html
https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#isEndOfStream()()`

Returns whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/C#BUFFER_FLAG_END_OF_STREAM()` flag is set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/Pure.html
https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#isFirstSample()()`

Returns whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/C#BUFFER_FLAG_FIRST_SAMPLE()` flag is set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/Pure.html
https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#isKeyFrame()()`

Returns whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/C#BUFFER_FLAG_KEY_FRAME()` flag is set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/Pure.html
https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#isLastSample()()`

Returns whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/C#BUFFER_FLAG_LAST_SAMPLE()` flag is set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/Pure.html
https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#notDependedOn()()`

Returns whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/C#BUFFER_FLAG_NOT_DEPENDED_ON()` flag is set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#setFlags(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.BufferFlags flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Replaces this buffer's flags with `flags`.
From [androidx.media3.decoder.DecoderInputBuffer](https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#clear()()`

Clears the buffer.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://checkerframework.org/api/org/checkerframework/checker/nullness/qual/EnsuresNonNull.html(value = "data")
https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#ensureSpaceForWrite(int)(length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Ensures that `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#data()` is large enough to accommodate a write of a given length at its current position.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#flip()()`

Flips `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#data()` and `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#supplementalData()` in preparation for being queued to a decoder.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#isEncrypted()()`

Returns whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/C#BUFFER_FLAG_ENCRYPTED()` flag is set.
`java-static https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer!` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#newNoDataInstance()()`

Returns a new instance that's not able to hold any data.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://checkerframework.org/api/org/checkerframework/checker/nullness/qual/EnsuresNonNull.html(value = "supplementalData")
https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#resetSupplementalData(int)(length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Clears `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#supplementalData()` and ensures that it's large enough to accommodate `
length` bytes.

### Inherited properties

From [androidx.media3.decoder.DecoderInputBuffer](https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer) `https://developer.android.com/reference/kotlin/androidx/media3/decoder/CryptoInfo!` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#cryptoInfo()`

`https://developer.android.com/reference/kotlin/androidx/media3/decoder/CryptoInfo` for encrypted data.
`https://developer.android.com/reference/java/nio/ByteBuffer.html?` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#data()`

The buffer's data, or `null` if no data has been set.
`https://developer.android.com/reference/kotlin/androidx/media3/common/Format?` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#format()`

The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`.
`https://developer.android.com/reference/java/nio/ByteBuffer.html?` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#supplementalData()`

Supplemental data related to the buffer, if `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Buffer#hasSupplementalData()` returns true.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#timeUs()`

The time at which the sample should be presented.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#waitingForKeys()`

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 constructors

### MetadataInputBuffer

```
MetadataInputBuffer()
```

## Public properties

### subsampleOffsetUs

```
val subsampleOffsetUs: Long
```

An offset that must be added to the metadata's timestamps after it's been decoded, or `https://developer.android.com/reference/kotlin/androidx/media3/common/Format#OFFSET_SAMPLE_RELATIVE()` if `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer#timeUs()` should be added.