public final class DefaultTsPayloadReaderFactory extends java.lang.Object implements TsPayloadReader.Factory
TsPayloadReader.Factory implementation.| Modifier and Type | Class and Description |
|---|---|
static interface |
DefaultTsPayloadReaderFactory.Flags
Flags controlling elementary stream readers' behavior.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
FLAG_ALLOW_NON_IDR_KEYFRAMES
When extracting H.264 samples, whether to treat samples consisting of non-IDR I slices as
synchronization samples (key-frames).
|
static int |
FLAG_DETECT_ACCESS_UNITS
When extracting H.264 samples, whether to split the input stream into access units (samples)
based on slice headers.
|
static int |
FLAG_IGNORE_AAC_STREAM
Prevents the creation of
AdtsReader and LatmReader instances. |
static int |
FLAG_IGNORE_H264_STREAM
Prevents the creation of
H264Reader instances. |
static int |
FLAG_IGNORE_SPLICE_INFO_STREAM
Prevents the creation of
SpliceInfoSectionReader instances. |
static int |
FLAG_OVERRIDE_CAPTION_DESCRIPTORS
Whether the list of
closedCaptionFormats passed to DefaultTsPayloadReaderFactory(int, List) should be used in spite
of any closed captions service descriptors. |
| Constructor and Description |
|---|
DefaultTsPayloadReaderFactory() |
DefaultTsPayloadReaderFactory(int flags) |
DefaultTsPayloadReaderFactory(int flags,
java.util.List<Format> closedCaptionFormats) |
| Modifier and Type | Method and Description |
|---|---|
android.util.SparseArray<TsPayloadReader> |
createInitialPayloadReaders()
Returns the initial mapping from PIDs to payload readers.
|
TsPayloadReader |
createPayloadReader(int streamType,
TsPayloadReader.EsInfo esInfo)
Returns a
TsPayloadReader for a given stream type and elementary stream information. |
public static final int FLAG_ALLOW_NON_IDR_KEYFRAMES
public static final int FLAG_IGNORE_AAC_STREAM
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.public static final int FLAG_IGNORE_H264_STREAM
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.public static final int FLAG_DETECT_ACCESS_UNITS
public static final int FLAG_IGNORE_SPLICE_INFO_STREAM
SpliceInfoSectionReader instances.public static final int FLAG_OVERRIDE_CAPTION_DESCRIPTORS
closedCaptionFormats passed to DefaultTsPayloadReaderFactory(int, List) 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 DefaultTsPayloadReaderFactory()
public DefaultTsPayloadReaderFactory(@DefaultTsPayloadReaderFactory.Flags int flags)
flags - A combination of FLAG_* values that control the behavior of the created
readers.public DefaultTsPayloadReaderFactory(@DefaultTsPayloadReaderFactory.Flags int flags, java.util.List<Format> closedCaptionFormats)
flags - A combination of FLAG_* values that control the behavior of the created
readers.closedCaptionFormats - 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 Format.accessibilityChannel Format.NO_VALUE will
be exposed.public android.util.SparseArray<TsPayloadReader> createInitialPayloadReaders()
TsPayloadReader.FactoryThis method allows the injection of payload readers for reserved PIDs, excluding PID 0.
createInitialPayloadReaders in interface TsPayloadReader.FactorySparseArray that maps PIDs to payload readers.public TsPayloadReader createPayloadReader(int streamType, TsPayloadReader.EsInfo esInfo)
TsPayloadReader.FactoryTsPayloadReader for a given stream type and elementary stream information.
May return null if the stream type is not supported.createPayloadReader in interface TsPayloadReader.FactorystreamType - Stream type value as defined in the PMT entry or associated descriptors.esInfo - Information associated to the elementary stream provided in the PMT.TsPayloadReader for the packet stream carried by the provided pid.
null if the stream is not supported.