# SubtitleDecoderFactory

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

*** ** * ** ***


```
@UnstableApi
public interface SubtitleDecoderFactory
```

<br />

*** ** * ** ***

A factory for `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` instances.

## Summary

| ### Constants |
|---|---|
| `default static final https://developer.android.com/reference/androidx/media3/exoplayer/text/SubtitleDecoderFactory` | `https://developer.android.com/reference/androidx/media3/exoplayer/text/SubtitleDecoderFactory#DEFAULT()` Default `https://developer.android.com/reference/androidx/media3/exoplayer/text/SubtitleDecoderFactory` implementation. |

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` | `https://developer.android.com/reference/androidx/media3/exoplayer/text/SubtitleDecoderFactory#createDecoder(androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format format)` Creates a `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` for the given `https://developer.android.com/reference/androidx/media3/common/Format`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/text/SubtitleDecoderFactory#supportsFormat(androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format format)` Returns whether the factory is able to instantiate a `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` for the given `https://developer.android.com/reference/androidx/media3/common/Format`. |

## Constants

### DEFAULT

```
default static final SubtitleDecoderFactory DEFAULT
```

Default `https://developer.android.com/reference/androidx/media3/exoplayer/text/SubtitleDecoderFactory` implementation.

Supports formats supported by `https://developer.android.com/reference/androidx/media3/extractor/text/DefaultSubtitleParserFactory` as well as the following:

- Cea608 (`https://developer.android.com/reference/androidx/media3/extractor/text/cea/Cea608Decoder`)
- Cea708 (`https://developer.android.com/reference/androidx/media3/extractor/text/cea/Cea708Decoder`)

## Public methods

### createDecoder

```
abstract SubtitleDecoder createDecoder(Format format)
```

Creates a `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` for the given `https://developer.android.com/reference/androidx/media3/common/Format`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Format format` | The `https://developer.android.com/reference/androidx/media3/common/Format`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` | A new `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If the `https://developer.android.com/reference/androidx/media3/common/Format` is not supported. |

### supportsFormat

```
abstract boolean supportsFormat(Format format)
```

Returns whether the factory is able to instantiate a `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder` for the given `https://developer.android.com/reference/androidx/media3/common/Format`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Format format` | The `https://developer.android.com/reference/androidx/media3/common/Format`. |

| Returns |
|---|---|
| `boolean` | Whether the factory can instantiate a suitable `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleDecoder`. |