# SeiReader

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/extractor/ts/SeiReader "View this page in Java")

<br />

```
@UnstableApi
class SeiReader
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                                                                                                                  |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SeiReader](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SeiReader#SeiReader(java.util.List<androidx.media3.common.Format>,java.lang.String))`(` ` closedCaptionFormats: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!>!,` ` containerMimeType: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` `)` |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [clear](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SeiReader#clear())`()` Drops any 'buffered for re-ordering' messages.                                                                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [consume](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SeiReader#consume(long,androidx.media3.common.util.ParsableByteArray))`(pesTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, seiBuffer: `[ParsableByteArray](https://developer.android.com/reference/kotlin/androidx/media3/common/util/ParsableByteArray)`!)`                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [createTracks](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SeiReader#createTracks(androidx.media3.extractor.ExtractorOutput,androidx.media3.extractor.ts.TsPayloadReader.TrackIdGenerator))`(` ` extractorOutput: `[ExtractorOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput)`!,` ` idGenerator: `[TsPayloadReader.TrackIdGenerator](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator)`!` `)` |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [flush](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SeiReader#flush())`()` Immediately passes any 'buffered for re-ordering' messages to the[outputs](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)passed to the constructor, using[consume](https://developer.android.com/reference/kotlin/androidx/media3/extractor/CeaUtil#consume(long,androidx.media3.common.util.ParsableByteArray,androidx.media3.extractor.TrackOutput[])).                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [setReorderingQueueSize](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SeiReader#setReorderingQueueSize(int))`(reorderingQueueSize: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` 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

```
SeiReader(
    closedCaptionFormats: (Mutable)List<Format!>!,
    containerMimeType: String!
)
```  

|                                                                                                                                                       Parameters                                                                                                                                                        |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `closedCaptionFormats: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!>!` | A list of formats for the closed caption channels to expose. |
| `containerMimeType: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                                                                                                                                               | The MIME type of the container holding the SEI buffers.      |

## Public functions

### clear

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

Drops any 'buffered for re-ordering' messages.  

### consume

```
fun consume(pesTimeUs: Long, seiBuffer: ParsableByteArray!): Unit
```  

### createTracks

```
fun createTracks(
    extractorOutput: ExtractorOutput!,
    idGenerator: TsPayloadReader.TrackIdGenerator!
): Unit
```  

### flush

```
fun flush(): Unit
```

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

### setReorderingQueueSize

```
fun setReorderingQueueSize(reorderingQueueSize: Int): Unit
```

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