# PassthroughSectionPayloadReader

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/extractor/ts/PassthroughSectionPayloadReader "View this page in Java")

<br />

```
@UnstableApi
class PassthroughSectionPayloadReader : SectionPayloadReader
```

<br />

*** ** * ** ***

A[SectionPayloadReader](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SectionPayloadReader)that directly outputs the section bytes as sample data.

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

## Summary

|                                                                                                                                                                                                                                  ### Public constructors                                                                                                                                                                                                                                   |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PassthroughSectionPayloadReader](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/PassthroughSectionPayloadReader#PassthroughSectionPayloadReader(java.lang.String,java.lang.String))`(` ` sampleMimeType: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` containerMimeType: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` `)` Create a new PassthroughSectionPayloadReader. |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [consume](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/PassthroughSectionPayloadReader#consume(androidx.media3.common.util.ParsableByteArray))`(sectionData: `[ParsableByteArray](https://developer.android.com/reference/kotlin/androidx/media3/common/util/ParsableByteArray)`!)` Called by a[SectionReader](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SectionReader)when a full section is received.                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [init](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/PassthroughSectionPayloadReader#init(androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.ExtractorOutput,androidx.media3.extractor.ts.TsPayloadReader.TrackIdGenerator))`(` ` timestampAdjuster: `[TimestampAdjuster](https://developer.android.com/reference/kotlin/androidx/media3/common/util/TimestampAdjuster)`!,` ` extractorOutput: `[ExtractorOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput)`!,` ` idGenerator: `[TsPayloadReader.TrackIdGenerator](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/TsPayloadReader.TrackIdGenerator)`!` `)` Initializes the section payload reader. |

## Public constructors

### PassthroughSectionPayloadReader

```
PassthroughSectionPayloadReader(
    sampleMimeType: String!,
    containerMimeType: String!
)
```

Create a new PassthroughSectionPayloadReader.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sampleMimeType: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`    | The MIME type set as[sampleMimeType](https://developer.android.com/reference/kotlin/androidx/media3/common/Format#sampleMimeType())on the created output track.       |
| `containerMimeType: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The MIME type set as[containerMimeType](https://developer.android.com/reference/kotlin/androidx/media3/common/Format#containerMimeType())on the created output track. |

## Public functions

### consume

```
fun consume(sectionData: ParsableByteArray!): Unit
```

Called by a[SectionReader](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ts/SectionReader)when a full section is received.  

|                                                             Parameters                                                              |
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sectionData: `[ParsableByteArray](https://developer.android.com/reference/kotlin/androidx/media3/common/util/ParsableByteArray)`!` | 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

```
fun init(
    timestampAdjuster: TimestampAdjuster!,
    extractorOutput: ExtractorOutput!,
    idGenerator: TsPayloadReader.TrackIdGenerator!
): Unit
```

Initializes the section payload reader.  

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