# PassthroughSectionPayloadReader

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

*** ** * ** ***


```
@UnstableApi
public final class PassthroughSectionPayloadReader implements SectionPayloadReader
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/media3/extractor/ts/SectionPayloadReader` that directly outputs the section bytes as sample data.

Timestamp adjustment is provided through `https://developer.android.com/reference/androidx/media3/common/Format#subsampleOffsetUs()`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/extractor/ts/PassthroughSectionPayloadReader#PassthroughSectionPayloadReader(java.lang.String,java.lang.String)( https://developer.android.com/reference/java/lang/String.html sampleMimeType, https://developer.android.com/reference/java/lang/String.html containerMimeType )` Create a new PassthroughSectionPayloadReader. |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/ts/PassthroughSectionPayloadReader#consume(androidx.media3.common.util.ParsableByteArray)(https://developer.android.com/reference/androidx/media3/common/util/ParsableByteArray sectionData)` Called by a `https://developer.android.com/reference/androidx/media3/extractor/ts/SectionReader` when a full section is received. |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/ts/PassthroughSectionPayloadReader#init(androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.ExtractorOutput,androidx.media3.extractor.ts.TsPayloadReader.TrackIdGenerator)( https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster, https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput extractorOutput, https://developer.android.com/reference/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator idGenerator )` Initializes the section payload reader. |

## Public constructors

### PassthroughSectionPayloadReader

```
public PassthroughSectionPayloadReader(
    String sampleMimeType,
    String containerMimeType
)
```

Create a new PassthroughSectionPayloadReader.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html sampleMimeType` | The MIME type set as `https://developer.android.com/reference/androidx/media3/common/Format#sampleMimeType()` on the created output track. |
| `https://developer.android.com/reference/java/lang/String.html containerMimeType` | The MIME type set as `https://developer.android.com/reference/androidx/media3/common/Format#containerMimeType()` on the created output track. |

## Public methods

### consume

```
public void consume(ParsableByteArray sectionData)
```

Called by a `https://developer.android.com/reference/androidx/media3/extractor/ts/SectionReader` when a full section is received.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/util/ParsableByteArray sectionData` | The data belonging to a section starting from the table_id. If section_syntax_indicator is set to '1', `sectionData` excludes the CRC_32 field. Otherwise, all bytes belonging to the table section are included. |

### init

```
public void init(
    TimestampAdjuster timestampAdjuster,
    ExtractorOutput extractorOutput,
    TsPayloadReader.TrackIdGenerator idGenerator
)
```

Initializes the section payload reader.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster` | A timestamp adjuster for offsetting and scaling sample timestamps. |
| `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput extractorOutput` | The `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput` that receives the extracted data. |
| `https://developer.android.com/reference/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator idGenerator` | A `https://developer.android.com/reference/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator` that generates unique track ids for the `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput`s. |