# SubtitleTranscodingExtractorOutput

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

*** ** * ** ***


```
@UnstableApi
public final class SubtitleTranscodingExtractorOutput implements ExtractorOutput
```

<br />

*** ** * ** ***

A wrapping `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput` that transcodes `https://developer.android.com/reference/androidx/media3/common/C#TRACK_TYPE_TEXT()` from supported subtitle formats to `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_MEDIA3_CUES()`.

The resulting `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_MEDIA3_CUES()` samples are emitted to the underlying `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput`.

For non-text tracks (i.e. where `https://developer.android.com/reference/androidx/media3/common/C.TrackType` is not `C.TRACK_TYPE_TEXT`), samples are passed through to the underlying `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` without modification.

Support for subtitle formats is determined by `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory#supportsFormat(androidx.media3.common.Format)` on the `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` passed to the constructor of this class.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleTranscodingExtractorOutput#SubtitleTranscodingExtractorOutput(androidx.media3.extractor.ExtractorOutput,androidx.media3.extractor.text.SubtitleParser.Factory)( https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput delegate, https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory )` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleTranscodingExtractorOutput#endTracks()()` Called when all tracks have been identified, meaning no new `trackId` values will be passed to `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput#track(int,int)`. |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleTranscodingExtractorOutput#resetSubtitleParsers()()` |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleTranscodingExtractorOutput#seekMap(androidx.media3.extractor.SeekMap)(https://developer.android.com/reference/androidx/media3/extractor/SeekMap seekMap)` Called when a `https://developer.android.com/reference/androidx/media3/extractor/SeekMap` has been extracted from the stream. |
| `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` | `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleTranscodingExtractorOutput#track(int,int)(int id, @https://developer.android.com/reference/androidx/media3/common/C.TrackType int type)` Called by the `https://developer.android.com/reference/androidx/media3/extractor/Extractor` to get the `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` for a specific track. |

| ### Inherited Constants |
|---|
| From [androidx.media3.extractor.ExtractorOutput](https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput) |---|---| | `static final https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput` | `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput#PLACEHOLDER()` Placeholder `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput` implementation throwing an `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` in each method. | |

## Public constructors

### SubtitleTranscodingExtractorOutput

```
public SubtitleTranscodingExtractorOutput(
    ExtractorOutput delegate,
    SubtitleParser.Factory subtitleParserFactory
)
```

## Public methods

### endTracks

```
public void endTracks()
```

Called when all tracks have been identified, meaning no new `trackId` values will be passed to `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput#track(int,int)`.

### resetSubtitleParsers

```
public void resetSubtitleParsers()
```

### seekMap

```
public void seekMap(SeekMap seekMap)
```

Called when a `https://developer.android.com/reference/androidx/media3/extractor/SeekMap` has been extracted from the stream.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/SeekMap seekMap` | The extracted `https://developer.android.com/reference/androidx/media3/extractor/SeekMap`. |

### track

```
public TrackOutput track(int id, @C.TrackType int type)
```

Called by the `https://developer.android.com/reference/androidx/media3/extractor/Extractor` to get the `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` for a specific track.

The same `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` is returned if multiple calls are made with the same `
id`.

| Parameters |
|---|---|
| `int id` | A track identifier. |
| `@https://developer.android.com/reference/androidx/media3/common/C.TrackType int type` | The `https://developer.android.com/reference/androidx/media3/common/C.TrackType`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` | The `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` for the given track identifier. |