# SeiReader

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

*** ** * ** ***


```
@UnstableApi
public final class SeiReader
```

<br />

*** ** * ** ***

Consumes SEI buffers, outputting contained CEA-608/708 messages to a `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/extractor/ts/SeiReader#SeiReader(java.util.List<androidx.media3.common.Format>,java.lang.String)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats, https://developer.android.com/reference/java/lang/String.html containerMimeType)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/ts/SeiReader#clear()()` Drops any 'buffered for re-ordering' messages. |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/ts/SeiReader#consume(long,androidx.media3.common.util.ParsableByteArray)(long pesTimeUs, https://developer.android.com/reference/androidx/media3/common/util/ParsableByteArray seiBuffer)` |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/ts/SeiReader#createTracks(androidx.media3.extractor.ExtractorOutput,androidx.media3.extractor.ts.TsPayloadReader.TrackIdGenerator)( https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput extractorOutput, https://developer.android.com/reference/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator idGenerator )` |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/ts/SeiReader#flush()()` Immediately passes any 'buffered for re-ordering' messages to the `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` passed to the constructor, using `https://developer.android.com/reference/androidx/media3/extractor/CeaUtil#consume(long,androidx.media3.common.util.ParsableByteArray,androidx.media3.extractor.TrackOutput[])`. |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/ts/SeiReader#setReorderingQueueSize(int)(int reorderingQueueSize)` Sets the maximum number of SEI buffers that need to be kept in order to re-order from decode to presentation order. |

## Public constructors

### SeiReader

```
public SeiReader(List<Format> closedCaptionFormats, String containerMimeType)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats` | A list of formats for the closed caption channels to expose. |
| `https://developer.android.com/reference/java/lang/String.html containerMimeType` | The MIME type of the container holding the SEI buffers. |

## Public methods

### clear

```
public void clear()
```

Drops any 'buffered for re-ordering' messages.

### consume

```
public void consume(long pesTimeUs, ParsableByteArray seiBuffer)
```

### createTracks

```
public void createTracks(
    ExtractorOutput extractorOutput,
    TsPayloadReader.TrackIdGenerator idGenerator
)
```

### flush

```
public void flush()
```

Immediately passes any 'buffered for re-ordering' messages to the `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` passed to the constructor, using `https://developer.android.com/reference/androidx/media3/extractor/CeaUtil#consume(long,androidx.media3.common.util.ParsableByteArray,androidx.media3.extractor.TrackOutput[])`.

### setReorderingQueueSize

```
public void setReorderingQueueSize(int reorderingQueueSize)
```

Sets the maximum number of SEI buffers that need to be kept in order to re-order from decode to presentation order.