DefaultTsPayloadReaderFactory


@UnstableApi
class DefaultTsPayloadReaderFactory : TsPayloadReader.Factory


Default TsPayloadReader.Factory implementation.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(flag = true, value = )
annotation DefaultTsPayloadReaderFactory.Flags

Flags controlling elementary stream readers' behavior.

Constants

const Int

When extracting H.264 samples, whether to treat samples consisting of non-IDR I slices as synchronization samples (key-frames).

const Int

When extracting H.264 samples, whether to split the input stream into access units (samples) based on slice headers.

const Int

Sets whether HDMV DTS audio streams will be handled.

const Int

Prevents the creation of AdtsReader and LatmReader instances.

const Int

Prevents the creation of H264Reader instances.

const Int

Prevents the creation of SectionPayloadReaders for splice information sections (SCTE-35).

const Int

Whether the list of closedCaptionFormats passed to DefaultTsPayloadReaderFactory should be used in spite of any closed captions service descriptors.

Public functions

SparseArray<TsPayloadReader!>!

Returns the initial mapping from PIDs to payload readers.

TsPayloadReader?

Returns a TsPayloadReader for a given stream type and elementary stream information.

Constants

FLAG_ALLOW_NON_IDR_KEYFRAMES

const val FLAG_ALLOW_NON_IDR_KEYFRAMES = 1: Int

When extracting H.264 samples, whether to treat samples consisting of non-IDR I slices as synchronization samples (key-frames).

FLAG_DETECT_ACCESS_UNITS

const val FLAG_DETECT_ACCESS_UNITS = 8: Int

When extracting H.264 samples, whether to split the input stream into access units (samples) based on slice headers. This flag should be disabled if the stream contains access unit delimiters (AUDs).

FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS

const val FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS = 64: Int

Sets whether HDMV DTS audio streams will be handled. If this flag is set, SCTE subtitles will not be detected, as they share the same elementary stream type as HDMV DTS.

FLAG_IGNORE_AAC_STREAM

const val FLAG_IGNORE_AAC_STREAM = 2: Int

Prevents the creation of AdtsReader and LatmReader instances. This flag should be enabled if the transport stream contains no packets for an AAC elementary stream that is declared in the PMT.

FLAG_IGNORE_H264_STREAM

const val FLAG_IGNORE_H264_STREAM = 4: Int

Prevents the creation of H264Reader instances. This flag should be enabled if the transport stream contains no packets for an H.264 elementary stream that is declared in the PMT.

FLAG_IGNORE_SPLICE_INFO_STREAM

const val FLAG_IGNORE_SPLICE_INFO_STREAM = 16: Int

Prevents the creation of SectionPayloadReaders for splice information sections (SCTE-35).

FLAG_OVERRIDE_CAPTION_DESCRIPTORS

const val FLAG_OVERRIDE_CAPTION_DESCRIPTORS = 32: Int

Whether the list of closedCaptionFormats passed to DefaultTsPayloadReaderFactory should be used in spite of any closed captions service descriptors. If this flag is disabled, closedCaptionFormats will be ignored if the PMT contains closed captions service descriptors.

Public constructors

DefaultTsPayloadReaderFactory

DefaultTsPayloadReaderFactory()

DefaultTsPayloadReaderFactory

DefaultTsPayloadReaderFactory(
    @DefaultTsPayloadReaderFactory.Flags flags: Int
)
Parameters
@DefaultTsPayloadReaderFactory.Flags flags: Int

A combination of FLAG_* values that control the behavior of the created readers.

DefaultTsPayloadReaderFactory

DefaultTsPayloadReaderFactory(
    @DefaultTsPayloadReaderFactory.Flags flags: Int,
    closedCaptionFormats: (Mutable)List<Format!>!
)
Parameters
@DefaultTsPayloadReaderFactory.Flags flags: Int

A combination of FLAG_* values that control the behavior of the created readers.

closedCaptionFormats: (Mutable)List<Format!>!

Formats to be exposed by payload readers for streams with embedded closed captions when no caption service descriptors are provided. If FLAG_OVERRIDE_CAPTION_DESCRIPTORS is set, closedCaptionFormats overrides any descriptor information. If not set, and closedCaptionFormats is empty, a closed caption track with accessibilityChannelNO_VALUE will be exposed.

Public functions

createInitialPayloadReaders

fun createInitialPayloadReaders(): SparseArray<TsPayloadReader!>!

Returns the initial mapping from PIDs to payload readers.

This method allows the injection of payload readers for reserved PIDs, excluding PID 0.

Returns
SparseArray<TsPayloadReader!>!

A SparseArray that maps PIDs to payload readers.

createPayloadReader

fun createPayloadReader(streamType: Int, esInfo: TsPayloadReader.EsInfo!): TsPayloadReader?

Returns a TsPayloadReader for a given stream type and elementary stream information. May return null if the stream type is not supported.

Parameters
streamType: Int

Stream type value as defined in the PMT entry or associated descriptors.

esInfo: TsPayloadReader.EsInfo!

Information associated to the elementary stream provided in the PMT.

Returns
TsPayloadReader?

A TsPayloadReader for the packet stream carried by the provided pid, or null if the stream is not supported.