# HardwareBufferFrame

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

*** ** * ** ***

<br />

```
@ExperimentalApi
interface HardwareBufferFrame : Frame
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame` backed by a `https://developer.android.com/reference/android/hardware/HardwareBuffer.html`.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame.Builder` A Builder for `https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame` instances. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame.Builder!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame#buildUpon()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame.Builder` initialized with the values of this instance. |
| `https://developer.android.com/reference/android/hardware/HardwareBuffer.html!` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame#getHardwareBuffer()()` Returns the `https://developer.android.com/reference/android/hardware/HardwareBuffer.html` backing this frame. |

### Inherited Constants

From [androidx.media3.common.video.Frame](https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#KEY_DISPLAY_TIME_NS() = "KEY_DISPLAY_TIME_NS"`

Metadata key for storing the system time that this frame should be displayed at to maintain A/V sync.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#KEY_PRESENTATION_TIME_US() = "KEY_PRESENTATION_TIME_US"`

Metadata key for storing the composition presentation time of this frame, in microseconds.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_COMPOSER_OVERLAY() = 2048`

The frame will be used as a hardware composer overlay layer.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_CPU_READ_OFTEN() = 3`

The frame will often be read by the CPU.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_CPU_READ_RARELY() = 2`

The frame will sometimes be read by the CPU.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_CPU_WRITE_OFTEN() = 48`

The frame will often be written to by the CPU.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_CPU_WRITE_RARELY() = 32`

The frame will sometimes be written to by the CPU.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_GPU_COLOR_OUTPUT() = 512`

The frame will be written to by the GPU.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_GPU_SAMPLED_IMAGE() = 256`

The frame will be read from by the GPU.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#USAGE_VIDEO_ENCODE() = 65536`

The frame will be read by a hardware video encoder.

### Inherited functions

From [androidx.media3.common.video.Frame](https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getContentTimeUs()()`

The time of the frame in the context of the input media in microseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if it is not set.
`https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getFormat()()`

The frame format.
`https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!` `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()()`

The frame metadata.

## Public functions

### buildUpon

```
fun buildUpon(): HardwareBufferFrame.Builder!
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame.Builder` initialized with the values of this instance.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame.Builder!` | A `https://developer.android.com/reference/kotlin/androidx/media3/common/video/HardwareBufferFrame.Builder` that can be used to create a modified copy of this frame. |

### getHardwareBuffer

```
@RequiresApi(value = 26)
fun getHardwareBuffer(): HardwareBuffer!
```

Returns the `https://developer.android.com/reference/android/hardware/HardwareBuffer.html` backing this frame.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/hardware/HardwareBuffer.html!` | The underlying `https://developer.android.com/reference/android/hardware/HardwareBuffer.html`. |