# SimpleDecoderOutputBuffer

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/SimpleDecoderOutputBuffer.java+class:androidx.media3.decoder.SimpleDecoderOutputBuffer)

*** ** * ** ***


```
@UnstableApi
class SimpleDecoderOutputBuffer : DecoderOutputBuffer
```

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

*** ** * ** ***

Buffer for `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoder` output.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#SimpleDecoderOutputBuffer(androidx.media3.decoder.DecoderOutputBuffer.Owner<androidx.media3.decoder.SimpleDecoderOutputBuffer>)( owner: https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderOutputBuffer.Owner<https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer!>! )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#clear()()` Clears the buffer. |
| `https://developer.android.com/reference/java/nio/ByteBuffer.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#grow(int)(newSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Grows the buffer to a new size. |
| `https://developer.android.com/reference/java/nio/ByteBuffer.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#init(long,int)(timeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Initializes the buffer. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#release()()` Releases the output buffer for reuse. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/java/nio/ByteBuffer.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#data()` |

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

### Inherited properties

From [androidx.media3.decoder.DecoderOutputBuffer](https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderOutputBuffer) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderOutputBuffer#shouldBeSkipped()`

Whether this buffer should be skipped, usually because the decoding process generated no data or invalid data.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderOutputBuffer#skippedOutputBufferCount()`

The number of buffers immediately prior to this one that were skipped in the `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderOutputBuffer#timeUs()`

The presentation timestamp for the buffer, in microseconds.

## Public constructors

### SimpleDecoderOutputBuffer

```
SimpleDecoderOutputBuffer(
    owner: DecoderOutputBuffer.Owner<SimpleDecoderOutputBuffer!>!
)
```

## Public functions

### clear

```
fun clear(): Unit
```

Clears the buffer.

### grow

```
fun grow(newSize: Int): ByteBuffer!
```

Grows the buffer to a new size.

Existing data is copied to the new buffer, and `https://developer.android.com/reference/java/nio/ByteBuffer.html#position(int)` is preserved.

| Parameters |
|---|---|
| `newSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | New size of the buffer. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/nio/ByteBuffer.html!` | The `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#data()` buffer, for convenience. |

### init

```
fun init(timeUs: Long, size: Int): ByteBuffer!
```

Initializes the buffer.

| Parameters |
|---|---|
| `timeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The presentation timestamp for the buffer, in microseconds. |
| `size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An upper bound on the size of the data that will be written to the buffer. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/nio/ByteBuffer.html!` | The `https://developer.android.com/reference/kotlin/androidx/media3/decoder/SimpleDecoderOutputBuffer#data()` buffer, for convenience. |

### release

```
fun release(): Unit
```

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

## Public properties

### data

```
val data: ByteBuffer?
```