# Av1SampleDependencyParser

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

*** ** * ** ***


```
@UnstableApi
public final class Av1SampleDependencyParser
```

<br />

*** ** * ** ***

An AV1 bitstream parser that identifies frames that are not depended on.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/video/Av1SampleDependencyParser#Av1SampleDependencyParser()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/video/Av1SampleDependencyParser#queueInputBuffer(java.nio.ByteBuffer)(https://developer.android.com/reference/java/nio/ByteBuffer.html sample)` Updates the parser state with the next sample data from a random access temporal unit. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/video/Av1SampleDependencyParser#reset()()` Resets the parser state. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/video/Av1SampleDependencyParser#sampleLimitAfterSkippingNonReferenceFrame(java.nio.ByteBuffer,boolean)( https://developer.android.com/reference/java/nio/ByteBuffer.html sample, boolean skipFrameHeaders )` Returns the new sample `https://developer.android.com/reference/java/nio/Buffer.html#limit()` after deleting any frames that are not used as reference. |

## Public constructors

### Av1SampleDependencyParser

```
public Av1SampleDependencyParser()
```

## Public methods

### queueInputBuffer

```
public void queueInputBuffer(ByteBuffer sample)
```

Updates the parser state with the next sample data from a random access temporal unit.

In order to identify non-reference frames, the parser needs a sequence header. The relevant sequence headers fields cannot change within a coded video sequence. And a new coded video sequence is defined to begin with a temporal unit where:

- A sequence header OBU appears before the first frame header.
- The first frame header has frame_type equal to KEY_FRAME.

These requirements are the same as the requirements for random access points. See [Ordering of OBUs](https://aomediacodec.github.io/av1-spec/#ordering-of-obus)

### reset

```
public void reset()
```

Resets the parser state.

### sampleLimitAfterSkippingNonReferenceFrame

```
public int sampleLimitAfterSkippingNonReferenceFrame(
    ByteBuffer sample,
    boolean skipFrameHeaders
)
```

Returns the new sample `https://developer.android.com/reference/java/nio/Buffer.html#limit()` after deleting any frames that are not used as reference.

Each AV1 temporal unit must have exactly one shown frame. Other frames in the temporal unit that aren't shown are used as reference, but the shown frame may not be used as reference. Frequently, the shown frame is the last frame in the temporal unit.

If the last frame in the temporal unit is a non-reference `https://developer.android.com/reference/androidx/media3/container/ObuParser#OBU_FRAME()` or `https://developer.android.com/reference/androidx/media3/container/ObuParser#OBU_FRAME_HEADER()`, this method returns a new `https://developer.android.com/reference/java/nio/Buffer.html#limit()` value that would leave only the frames used as reference in the input `sample`.

See [Ordering of OBUs](https://aomediacodec.github.io/av1-spec/#ordering-of-obus).

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/nio/ByteBuffer.html sample` | The sample data for one AV1 temporal unit. |
| `boolean skipFrameHeaders` | Whether to skip `https://developer.android.com/reference/androidx/media3/container/ObuParser#OBU_FRAME_HEADER()`. |