DefaultTsPayloadReaderFactory
@UnstableApi
public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Factory
Default TsPayloadReader.Factory implementation.
Summary
Nested types |
|---|
@DocumentedFlags controlling elementary stream readers' behavior. |
Constants |
|
|---|---|
static final int |
When extracting H.264 samples, whether to treat samples consisting of non-IDR I slices as synchronization samples (key-frames). |
static final int |
When extracting H.264 samples, whether to split the input stream into access units (samples) based on slice headers. |
static final int |
Sets whether HDMV DTS audio streams will be handled. |
static final int |
Prevents the creation of |
static final int |
Prevents the creation of |
static final int |
Prevents the creation of |
static final int |
Whether the list of |
Public constructors |
|---|
DefaultTsPayloadReaderFactory( |
Public methods |
|
|---|---|
SparseArray<TsPayloadReader> |
Returns the initial mapping from PIDs to payload readers. |
@Nullable TsPayloadReader |
createPayloadReader(int streamType, TsPayloadReader.EsInfo esInfo)Returns a |
Constants
FLAG_ALLOW_NON_IDR_KEYFRAMES
public static final int FLAG_ALLOW_NON_IDR_KEYFRAMES = 1
When extracting H.264 samples, whether to treat samples consisting of non-IDR I slices as synchronization samples (key-frames).
FLAG_DETECT_ACCESS_UNITS
public static final int FLAG_DETECT_ACCESS_UNITS = 8
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
public static final int FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS = 64
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
public static final int FLAG_IGNORE_AAC_STREAM = 2
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
public static final int FLAG_IGNORE_H264_STREAM = 4
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
public static final int FLAG_IGNORE_SPLICE_INFO_STREAM = 16
Prevents the creation of SectionPayloadReaders for splice information sections (SCTE-35).
FLAG_OVERRIDE_CAPTION_DESCRIPTORS
public static final int FLAG_OVERRIDE_CAPTION_DESCRIPTORS = 32
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
public DefaultTsPayloadReaderFactory(
@DefaultTsPayloadReaderFactory.Flags int flags
)
| Parameters | |
|---|---|
@DefaultTsPayloadReaderFactory.Flags int flags |
A combination of |
DefaultTsPayloadReaderFactory
public DefaultTsPayloadReaderFactory(
@DefaultTsPayloadReaderFactory.Flags int flags,
List<Format> closedCaptionFormats
)
| Parameters | |
|---|---|
@DefaultTsPayloadReaderFactory.Flags int flags |
A combination of |
List<Format> closedCaptionFormats |
|
Public methods
createInitialPayloadReaders
public SparseArray<TsPayloadReader> createInitialPayloadReaders()
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 |
createPayloadReader
public @Nullable TsPayloadReader createPayloadReader(int streamType, TsPayloadReader.EsInfo esInfo)
Returns a TsPayloadReader for a given stream type and elementary stream information. May return null if the stream type is not supported.
| Parameters | |
|---|---|
int streamType |
Stream type value as defined in the PMT entry or associated descriptors. |
TsPayloadReader.EsInfo esInfo |
Information associated to the elementary stream provided in the PMT. |
| Returns | |
|---|---|
@Nullable TsPayloadReader |
A |