# SsChunkSource.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/SsChunkSource.java+class:androidx.media3.exoplayer.smoothstreaming.SsChunkSource.Factory)

*** ** * ** ***


```
interface SsChunkSource.Factory
```

<br />

Known direct subclasses [DefaultSsChunkSource.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory` |   |

*** ** * ** ***

Factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource`s.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource.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)( manifestLoaderErrorThrower: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower!, manifest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest!, streamElementIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, trackSelection: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!, transferListener: https://developer.android.com/reference/kotlin/androidx/media3/datasource/TransferListener?, cmcdConfiguration: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration? )` Creates a new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/ExperimentalApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource.Factory#experimentalParseSubtitlesDuringExtraction(boolean)( parseSubtitlesDuringExtraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` 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/kotlin/androidx/media3/common/Format!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource.Factory#getOutputTextFormat(androidx.media3.common.Format)(sourceFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!)` Returns the output `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` of emitted `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TRACK_TYPE_TEXT()` which were originally in `sourceFormat`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource.Factory#setSubtitleParserFactory(androidx.media3.extractor.text.SubtitleParser.Factory)(subtitleParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory` to use for parsing subtitles during extraction. |

## Public functions

### createChunkSource

```
fun createChunkSource(
    manifestLoaderErrorThrower: LoaderErrorThrower!,
    manifest: SsManifest!,
    streamElementIndex: Int,
    trackSelection: ExoTrackSelection!,
    transferListener: TransferListener?,
    cmcdConfiguration: CmcdConfiguration?
): SsChunkSource!
```

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

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

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

### experimentalParseSubtitlesDuringExtraction

```
@CanIgnoreReturnValue
@ExperimentalApi
fun experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
): SsChunkSource.Factory!
```

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 |
|---|---|
| `parseSubtitlesDuringExtraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to parse subtitles during extraction or rendering. |

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

### getOutputTextFormat

```
fun getOutputTextFormat(sourceFormat: Format!): Format!
```

Returns the output `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` of emitted `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TRACK_TYPE_TEXT()` which were originally in `sourceFormat`.

In many cases, where an `https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor` emits samples from the source without mutation, this method simply returns `sourceFormat`. In other cases, such as an `https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor` that transcodes subtitles from the `sourceFormat` to `https://developer.android.com/reference/kotlin/androidx/media3/common/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.

| Parameters |
|---|---|
| `sourceFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The original text-based format. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` that will be associated with a `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TRACK_TYPE_TEXT()`. |

### setSubtitleParserFactory

```
@CanIgnoreReturnValue
fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): SsChunkSource.Factory!
```

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

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

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