# 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
public final class MetadataInputBuffer extends DecoderInputBuffer
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.media3.decoder.Buffer](https://developer.android.com/reference/androidx/media3/decoder/Buffer) |||
|   | ↳ | [androidx.media3.decoder.DecoderInputBuffer](https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer) ||
|   |   | ↳ | [androidx.media3.extractor.metadata.MetadataInputBuffer](https://developer.android.com/reference/androidx/media3/extractor/metadata/MetadataInputBuffer) |

*** ** * ** ***

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

## Summary

| ### Public fields |
|---|---|
| `long` | `https://developer.android.com/reference/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/androidx/media3/common/Format#OFFSET_SAMPLE_RELATIVE()` if `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#timeUs()` should be added. |

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

### Inherited Constants

From [androidx.media3.decoder.DecoderInputBuffer](https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer) `static final int` `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#BUFFER_REPLACEMENT_MODE_DIRECT() = 2`

Allows buffer replacement using `https://developer.android.com/reference/java/nio/ByteBuffer.html#allocateDirect(int)`.
`static final int` `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#BUFFER_REPLACEMENT_MODE_DISABLED() = 0`

Disallows buffer replacement.
`static final int` `https://developer.android.com/reference/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 fields

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

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

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

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

Supplemental data related to the buffer, if `https://developer.android.com/reference/androidx/media3/decoder/Buffer#hasSupplementalData()` returns true.
`long` `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#timeUs()`

The time at which the sample should be presented.
`boolean` `https://developer.android.com/reference/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.

### Inherited methods

From [androidx.media3.decoder.Buffer](https://developer.android.com/reference/androidx/media3/decoder/Buffer) `final void` `https://developer.android.com/reference/androidx/media3/decoder/Buffer#addFlag(int)(@https://developer.android.com/reference/androidx/media3/common/C.BufferFlags int flag)`

Adds the `flag` to this buffer's flags.
`final void` `https://developer.android.com/reference/androidx/media3/decoder/Buffer#clearFlag(int)(@https://developer.android.com/reference/androidx/media3/common/C.BufferFlags int flag)`

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

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

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

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

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

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

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

Returns whether the `https://developer.android.com/reference/androidx/media3/common/C#BUFFER_FLAG_NOT_DEPENDED_ON()` flag is set.
`final void` `https://developer.android.com/reference/androidx/media3/decoder/Buffer#setFlags(int)(@https://developer.android.com/reference/androidx/media3/common/C.BufferFlags int flags)`

Replaces this buffer's flags with `flags`.
From [androidx.media3.decoder.DecoderInputBuffer](https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer) `void` `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#clear()()`

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

Ensures that `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#data()` is large enough to accommodate a write of a given length at its current position.
`final void` `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#flip()()`

Flips `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#data()` and `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#supplementalData()` in preparation for being queued to a decoder.
`final boolean` `https://developer.android.com/reference/androidx/media3/decoder/DecoderInputBuffer#isEncrypted()()`

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

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

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

## Public fields

### subsampleOffsetUs

```
public long subsampleOffsetUs
```

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

## Public constructors

### MetadataInputBuffer

```
public MetadataInputBuffer()
```