# DefaultSsChunkSource.Factory

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

*** ** * ** ***


```
public final class DefaultSsChunkSource.Factory implements SsChunkSource.Factory
```

<br />

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory#Factory(androidx.media3.datasource.DataSource.Factory)(https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory dataSourceFactory)` |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/SsChunkSource` | `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory#createChunkSource(androidx.media3.exoplayer.upstream.LoaderErrorThrower,androidx.media3.exoplayer.smoothstreaming.manifest.SsManifest,int,androidx.media3.exoplayer.trackselection.ExoTrackSelection,androidx.media3.datasource.TransferListener,androidx.media3.exoplayer.upstream.CmcdConfiguration)( https://developer.android.com/reference/androidx/media3/exoplayer/upstream/LoaderErrorThrower manifestLoaderErrorThrower, https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest manifest, int streamElementIndex, https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/ExoTrackSelection trackSelection, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/TransferListener transferListener, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration cmcdConfiguration )` Creates a new `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/SsChunkSource`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory#experimentalParseSubtitlesDuringExtraction(boolean)( boolean parseSubtitlesDuringExtraction )` Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). |
| `https://developer.android.com/reference/androidx/media3/common/Format` | `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory#getOutputTextFormat(androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format sourceFormat)` Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory#setSubtitleParserFactory(androidx.media3.extractor.text.SubtitleParser.Factory)(https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory)` Sets the `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` to use for parsing subtitles during extraction. |

## Public constructors

### Factory

```
public Factory(DataSource.Factory dataSourceFactory)
```

## Public methods

### createChunkSource

```
public SsChunkSource createChunkSource(
    LoaderErrorThrower manifestLoaderErrorThrower,
    SsManifest manifest,
    int streamElementIndex,
    ExoTrackSelection trackSelection,
    @Nullable TransferListener transferListener,
    @Nullable CmcdConfiguration cmcdConfiguration
)
```

Creates a new `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/SsChunkSource`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/LoaderErrorThrower manifestLoaderErrorThrower` | Throws errors affecting loading of manifests. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest manifest` | The initial manifest. |
| `int streamElementIndex` | The index of the corresponding stream element in the manifest. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/ExoTrackSelection trackSelection` | The track selection. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/TransferListener transferListener` | The transfer listener which should be informed of any data transfers. May be null if no listener is available. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration cmcdConfiguration` | The `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration` for this chunk source. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/SsChunkSource` | The created `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/SsChunkSource`. |

### experimentalParseSubtitlesDuringExtraction

```
@CanIgnoreReturnValue
public DefaultSsChunkSource.Factory experimentalParseSubtitlesDuringExtraction(
    boolean parseSubtitlesDuringExtraction
)
```

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). Defaults to `false` (i.e. subtitles will be parsed as part of rendering).

This method is experimental and will be renamed or removed in a future release.

| Parameters |
|---|---|
| `boolean parseSubtitlesDuringExtraction` | Whether to parse subtitles during extraction or rendering. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory` | This factory, for convenience. |

### getOutputTextFormat

```
public Format getOutputTextFormat(Format sourceFormat)
```

Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}.

In many cases, where an emits samples from the source without mutation, this method simply returns sourceFormat}. In other cases, such as an that transcodes subtitles from the sourceFormat} to \* MimeTypes#APPLICATION_MEDIA3_CUES, the format is updated to indicate the transcoding that is taking place.

Non-text source formats are always returned without mutation.

This implementation performs transcoding of the original format to `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_MEDIA3_CUES()` if it is supported by `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory`.

### setSubtitleParserFactory

```
@CanIgnoreReturnValue
public DefaultSsChunkSource.Factory setSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)
```

Sets the `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` to use for parsing subtitles during extraction. The default factory value is implementation dependent.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory` | The `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` for parsing subtitles during extraction. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory` | This factory, for convenience. |