# DvbSubtitleReader

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/DvbSubtitleReader.java+class:androidx.media3.extractor.ts.DvbSubtitleReader)

*** ** * ** ***


```
@UnstableApi
class DvbSubtitleReader : ElementaryStreamReader
```

<br />

*** ** * ** ***

Parses DVB subtitle data and extracts individual frames.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/DvbSubtitleReader#DvbSubtitleReader(java.util.List<androidx.media3.extractor.ts.TsPayloadReader.DvbSubtitleInfo>,java.lang.String)( subtitleInfos: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.DvbSubtitleInfo!>!, containerMimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html! )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/DvbSubtitleReader#consume(androidx.media3.common.util.ParsableByteArray)(data: https://developer.android.com/reference/kotlin/androidx/media3/common/util/ParsableByteArray!)` Consumes (possibly partial) data from the current packet. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/DvbSubtitleReader#createTracks(androidx.media3.extractor.ExtractorOutput,androidx.media3.extractor.ts.TsPayloadReader.TrackIdGenerator)( extractorOutput: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput!, idGenerator: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator! )` Initializes the reader by providing outputs and ids for the tracks. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/DvbSubtitleReader#packetFinished()()` Called when a PES packet ends. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/DvbSubtitleReader#packetStarted(long,int)(pesTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, @https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.Flags flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Called when a packet starts. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/DvbSubtitleReader#seek()()` Notifies the reader that a seek has occurred. |

| ### Inherited functions |
|---|
| From [androidx.media3.extractor.ts.ElementaryStreamReader](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/ElementaryStreamReader) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/ElementaryStreamReader#endOfInputReached()()` Called when there will be no further packets (unless a seek occurs) because the stream ended. | |

## Public constructors

### DvbSubtitleReader

```
DvbSubtitleReader(
    subtitleInfos: (Mutable)List<TsPayloadReader.DvbSubtitleInfo!>!,
    containerMimeType: String!
)
```

| Parameters |
|---|---|
| `subtitleInfos: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.DvbSubtitleInfo!>!` | Information about the DVB subtitles associated to the stream. |
| `containerMimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The MIME type of the container holding the stream. |

## Public functions

### consume

```
fun consume(data: ParsableByteArray!): Unit
```

Consumes (possibly partial) data from the current packet.

| Parameters |
|---|---|
| `data: https://developer.android.com/reference/kotlin/androidx/media3/common/util/ParsableByteArray!` | The data to consume. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException` | If the data could not be parsed. |

### createTracks

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

Initializes the reader by providing outputs and ids for the tracks.

| Parameters |
|---|---|
| `extractorOutput: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput!` | The `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput` that receives the extracted data. |
| `idGenerator: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator!` | A `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator` that generates unique track ids for the `https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput`s. |

### packetFinished

```
fun packetFinished(): Unit
```

Called when a PES packet ends. For PES packets with an unset length, this is called when the next packet starts or the stream ends.

### packetStarted

```
fun packetStarted(pesTimeUs: Long, @TsPayloadReader.Flags flags: Int): Unit
```

Called when a packet starts.

| Parameters |
|---|---|
| `pesTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The timestamp associated with the packet. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.Flags flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | See `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.Flags`. |

### seek

```
fun seek(): Unit
```

Notifies the reader that a seek has occurred.