# Av1SampleDependencyParser

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/video/Av1SampleDependencyParser "View this page in Java")

<br />

```
@UnstableApi
class Av1SampleDependencyParser
```

<br />

*** ** * ** ***

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

## Summary

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

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [queueInputBuffer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/Av1SampleDependencyParser#queueInputBuffer(java.nio.ByteBuffer))`(sample: `[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html)`!)` Updates the parser state with the next sample data from a random access temporal unit.                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [reset](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/Av1SampleDependencyParser#reset())`()` Resets the parser state.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)   | [sampleLimitAfterSkippingNonReferenceFrame](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/Av1SampleDependencyParser#sampleLimitAfterSkippingNonReferenceFrame(java.nio.ByteBuffer,boolean))`(` ` sample: `[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html)`!,` ` skipFrameHeaders: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Returns the new sample[limit](https://developer.android.com/reference/java/nio/Buffer.html#limit())after deleting any frames that are not used as reference. |

## Public constructors

### Av1SampleDependencyParser

```
Av1SampleDependencyParser()
```  

## Public functions

### queueInputBuffer

```
fun queueInputBuffer(sample: ByteBuffer!): Unit
```

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

```
fun reset(): Unit
```

Resets the parser state.  

### sampleLimitAfterSkippingNonReferenceFrame

```
fun sampleLimitAfterSkippingNonReferenceFrame(
    sample: ByteBuffer!,
    skipFrameHeaders: Boolean
): Int
```

Returns the new sample[limit](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[OBU_FRAME](https://developer.android.com/reference/kotlin/androidx/media3/container/ObuParser#OBU_FRAME())or[OBU_FRAME_HEADER](https://developer.android.com/reference/kotlin/androidx/media3/container/ObuParser#OBU_FRAME_HEADER()), this method returns a new[limit](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                                                |
|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `sample: `[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html)`!`             | The sample data for one AV1 temporal unit.                                                                                                |
| `skipFrameHeaders: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether to skip[OBU_FRAME_HEADER](https://developer.android.com/reference/kotlin/androidx/media3/container/ObuParser#OBU_FRAME_HEADER()). |