# DecoderOutputBuffer

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

*** ** * ** ***


```
@UnstableApi
public abstract class DecoderOutputBuffer extends Buffer
```

<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.DecoderOutputBuffer](https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer) |

Known direct subclasses [ImageOutputBuffer](https://developer.android.com/reference/androidx/media3/exoplayer/image/ImageOutputBuffer), [SimpleDecoderOutputBuffer](https://developer.android.com/reference/androidx/media3/decoder/SimpleDecoderOutputBuffer), [SubtitleOutputBuffer](https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleOutputBuffer), [VideoDecoderOutputBuffer](https://developer.android.com/reference/androidx/media3/decoder/VideoDecoderOutputBuffer)

|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/image/ImageOutputBuffer` | Output buffer for `https://developer.android.com/reference/androidx/media3/exoplayer/image/ImageDecoder` instances. |
| `https://developer.android.com/reference/androidx/media3/decoder/SimpleDecoderOutputBuffer` | Buffer for `https://developer.android.com/reference/androidx/media3/decoder/SimpleDecoder` output. |
| `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleOutputBuffer` | Base class for `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` output buffers. |
| `https://developer.android.com/reference/androidx/media3/decoder/VideoDecoderOutputBuffer` | Video decoder output buffer containing video frame data. |

*** ** * ** ***

Output buffer decoded by a `https://developer.android.com/reference/androidx/media3/decoder/Decoder`.

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer.Owner<S extends https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer>` Buffer owner. |

| ### Public fields |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer#shouldBeSkipped()` Whether this buffer should be skipped, usually because the decoding process generated no data or invalid data. |
| `int` | `https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer#skippedOutputBufferCount()` The number of buffers immediately prior to this one that were skipped in the `https://developer.android.com/reference/androidx/media3/decoder/Decoder`. |
| `long` | `https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer#timeUs()` The presentation timestamp for the buffer, in microseconds. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer#DecoderOutputBuffer()()` |

| ### Public methods |
|---|---|
| `void` | `@https://developer.android.com/reference/androidx/annotation/CallSuper https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer#clear()()` Clears the buffer. |
| `abstract void` | `https://developer.android.com/reference/androidx/media3/decoder/DecoderOutputBuffer#release()()` Releases the output buffer for reuse. |

### 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`.

## Public fields

### shouldBeSkipped

```
public boolean shouldBeSkipped
```

Whether this buffer should be skipped, usually because the decoding process generated no data or invalid data.

### skippedOutputBufferCount

```
public int skippedOutputBufferCount
```

The number of buffers immediately prior to this one that were skipped in the `https://developer.android.com/reference/androidx/media3/decoder/Decoder`.

### timeUs

```
public long timeUs
```

The presentation timestamp for the buffer, in microseconds.

## Public constructors

### DecoderOutputBuffer

```
public DecoderOutputBuffer()
```

## Public methods

### clear

```
@CallSuper
public void clear()
```

Clears the buffer.

### release

```
public abstract void release()
```

Releases the output buffer for reuse. Must be called when the buffer is no longer needed.