Class DashManifestParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.google.android.exoplayer2.source.dash.manifest.DashManifestParser
-
- All Implemented Interfaces:
ParsingLoadable.Parser<DashManifest>,ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class DashManifestParser extends DefaultHandler implements ParsingLoadable.Parser<DashManifest>
A parser of media presentation description files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDashManifestParser.RepresentationInfoA parsed Representation element.
-
Constructor Summary
Constructors Constructor Description DashManifestParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AdaptationSetbuildAdaptationSet(int id, @com.google.android.exoplayer2.C.TrackType int contentType, List<Representation> representations, List<Descriptor> accessibilityDescriptors, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties)protected EventMessagebuildEvent(String schemeIdUri, String value, long id, long durationMs, byte[] messageData)protected EventStreambuildEventStream(String schemeIdUri, String value, long timescale, long[] presentationTimesUs, EventMessage[] events)protected FormatbuildFormat(String id, String containerMimeType, int width, int height, float frameRate, int audioChannels, int audioSamplingRate, int bitrate, String language, List<Descriptor> roleDescriptors, List<Descriptor> accessibilityDescriptors, String codecs, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties)protected DashManifestbuildMediaPresentationDescription(long availabilityStartTime, long durationMs, long minBufferTimeMs, boolean dynamic, long minUpdateTimeMs, long timeShiftBufferDepthMs, long suggestedPresentationDelayMs, long publishTimeMs, ProgramInformation programInformation, UtcTimingElement utcTiming, ServiceDescriptionElement serviceDescription, Uri location, List<Period> periods)protected PeriodbuildPeriod(String id, long startMs, List<AdaptationSet> adaptationSets, List<EventStream> eventStreams, Descriptor assetIdentifier)protected RangedUribuildRangedUri(String urlText, long rangeStart, long rangeLength)protected RepresentationbuildRepresentation(DashManifestParser.RepresentationInfo representationInfo, String label, String extraDrmSchemeType, ArrayList<DrmInitData.SchemeData> extraDrmSchemeDatas, ArrayList<Descriptor> extraInbandEventStreams)protected SegmentBase.SegmentListbuildSegmentList(RangedUri initialization, long timescale, long presentationTimeOffset, long startNumber, long duration, List<SegmentBase.SegmentTimelineElement> timeline, long availabilityTimeOffsetUs, List<RangedUri> segments, long timeShiftBufferDepthMs, long periodStartUnixTimeMs)protected SegmentBase.SegmentTemplatebuildSegmentTemplate(RangedUri initialization, long timescale, long presentationTimeOffset, long startNumber, long endNumber, long duration, List<SegmentBase.SegmentTimelineElement> timeline, long availabilityTimeOffsetUs, UrlTemplate initializationTemplate, UrlTemplate mediaTemplate, long timeShiftBufferDepthMs, long periodStartUnixTimeMs)protected SegmentBase.SegmentTimelineElementbuildSegmentTimelineElement(long startTime, long duration)protected SegmentBase.SingleSegmentBasebuildSingleSegmentBase(RangedUri initialization, long timescale, long presentationTimeOffset, long indexStart, long indexLength)protected UtcTimingElementbuildUtcTimingElement(String schemeIdUri, String value)static voidmaybeSkipTag(XmlPullParser xpp)If the providedXmlPullParseris currently positioned at the start of a tag, skips forward to the end of that tag.DashManifestparse(Uri uri, InputStream inputStream)Parses an object from a response.protected AdaptationSetparseAdaptationSet(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, SegmentBase segmentBase, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long periodStartUnixTimeMs, long timeShiftBufferDepthMs, boolean dvbProfileDeclared)protected voidparseAdaptationSetChild(XmlPullParser xpp)Parses children of AdaptationSet elements not specifically parsed elsewhere.protected intparseAudioChannelConfiguration(XmlPullParser xpp)protected longparseAvailabilityTimeOffsetUs(XmlPullParser xpp, long parentAvailabilityTimeOffsetUs)Parses the availabilityTimeOffset value and returns the parsed value or the parent value if it doesn't exist.protected List<BaseUrl>parseBaseUrl(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, boolean dvbProfileDeclared)Parses a BaseURL element.protected static intparseCea608AccessibilityChannel(List<Descriptor> accessibilityDescriptors)protected static intparseCea708AccessibilityChannel(List<Descriptor> accessibilityDescriptors)protected Pair<@NullableType String,@NullableType DrmInitData.SchemeData>parseContentProtection(XmlPullParser xpp)Parses a ContentProtection element.protected @com.google.android.exoplayer2.C.TrackType intparseContentType(XmlPullParser xpp)protected static longparseDateTime(XmlPullParser xpp, String name, long defaultValue)protected static DescriptorparseDescriptor(XmlPullParser xpp, String tag)Parses aDescriptorfrom an element.protected static intparseDolbyChannelConfiguration(XmlPullParser xpp)Parses the number of channels from the value attribute of an AudioElementConfiguration with schemeIdUri "tag:dolby.com,2014:dash:audio_channel_configuration:2011", as defined by table E.5 in ETSI TS 102 366, or the legacy schemeIdUri "urn:dolby:dash:audio_channel_configuration:2011".protected static longparseDuration(XmlPullParser xpp, String name, long defaultValue)protected static StringparseEac3SupplementalProperties(List<Descriptor> supplementalProperties)protected Pair<Long,EventMessage>parseEvent(XmlPullParser xpp, String schemeIdUri, String value, long timescale, ByteArrayOutputStream scratchOutputStream)Parses a single Event node in the manifest.protected byte[]parseEventObject(XmlPullParser xpp, ByteArrayOutputStream scratchOutputStream)Parses an event object.protected EventStreamparseEventStream(XmlPullParser xpp)Parses a single EventStream node in the manifest.protected static floatparseFloat(XmlPullParser xpp, String name, float defaultValue)protected static floatparseFrameRate(XmlPullParser xpp, float defaultValue)protected RangedUriparseInitialization(XmlPullParser xpp)protected static intparseInt(XmlPullParser xpp, String name, int defaultValue)protected StringparseLabel(XmlPullParser xpp)Parses a Label element.protected static longparseLastSegmentNumberSupplementalProperty(List<Descriptor> supplementalProperties)protected static longparseLong(XmlPullParser xpp, String name, long defaultValue)protected DashManifestparseMediaPresentationDescription(XmlPullParser xpp, Uri documentBaseUri)protected static intparseMpegChannelConfiguration(XmlPullParser xpp)Parses the number of channels from the value attribute of an AudioElementConfiguration with schemeIdUri "urn:mpeg:mpegB:cicp:ChannelConfiguration", as defined by ISO 23001-8 clause 8.1.protected Pair<Period,Long>parsePeriod(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, long defaultStartMs, long baseUrlAvailabilityTimeOffsetUs, long availabilityStartTimeMs, long timeShiftBufferDepthMs, boolean dvbProfileDeclared)protected String[]parseProfiles(XmlPullParser xpp, String attributeName, String[] defaultValue)protected ProgramInformationparseProgramInformation(XmlPullParser xpp)protected RangedUriparseRangedUrl(XmlPullParser xpp, String urlAttribute, String rangeAttribute)protected DashManifestParser.RepresentationInfoparseRepresentation(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, String adaptationSetMimeType, String adaptationSetCodecs, int adaptationSetWidth, int adaptationSetHeight, float adaptationSetFrameRate, int adaptationSetAudioChannels, int adaptationSetAudioSamplingRate, String adaptationSetLanguage, List<Descriptor> adaptationSetRoleDescriptors, List<Descriptor> adaptationSetAccessibilityDescriptors, List<Descriptor> adaptationSetEssentialProperties, List<Descriptor> adaptationSetSupplementalProperties, SegmentBase segmentBase, long periodStartUnixTimeMs, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long timeShiftBufferDepthMs, boolean dvbProfileDeclared)protected @com.google.android.exoplayer2.C.RoleFlags intparseRoleFlagsFromAccessibilityDescriptors(List<Descriptor> accessibilityDescriptors)protected @com.google.android.exoplayer2.C.RoleFlags intparseRoleFlagsFromDashRoleScheme(String value)protected @com.google.android.exoplayer2.C.RoleFlags intparseRoleFlagsFromProperties(List<Descriptor> accessibilityDescriptors)protected @com.google.android.exoplayer2.C.RoleFlags intparseRoleFlagsFromRoleDescriptors(List<Descriptor> roleDescriptors)protected SegmentBase.SingleSegmentBaseparseSegmentBase(XmlPullParser xpp, SegmentBase.SingleSegmentBase parent)protected SegmentBase.SegmentListparseSegmentList(XmlPullParser xpp, SegmentBase.SegmentList parent, long periodStartUnixTimeMs, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long timeShiftBufferDepthMs)protected SegmentBase.SegmentTemplateparseSegmentTemplate(XmlPullParser xpp, SegmentBase.SegmentTemplate parent, List<Descriptor> adaptationSetSupplementalProperties, long periodStartUnixTimeMs, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long timeShiftBufferDepthMs)protected List<SegmentBase.SegmentTimelineElement>parseSegmentTimeline(XmlPullParser xpp, long timescale, long periodDurationMs)protected RangedUriparseSegmentUrl(XmlPullParser xpp)protected @com.google.android.exoplayer2.C.SelectionFlags intparseSelectionFlagsFromDashRoleScheme(String value)protected @com.google.android.exoplayer2.C.SelectionFlags intparseSelectionFlagsFromRoleDescriptors(List<Descriptor> roleDescriptors)protected ServiceDescriptionElementparseServiceDescription(XmlPullParser xpp)protected static StringparseString(XmlPullParser xpp, String name, String defaultValue)protected static StringparseText(XmlPullParser xpp, String label)protected @com.google.android.exoplayer2.C.RoleFlags intparseTvaAudioPurposeCsValue(String value)protected UrlTemplateparseUrlTemplate(XmlPullParser xpp, String name, UrlTemplate defaultValue)protected UtcTimingElementparseUtcTiming(XmlPullParser xpp)-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Method Detail
-
parse
public DashManifest parse(Uri uri, InputStream inputStream) throws IOException
Description copied from interface:ParsingLoadable.ParserParses an object from a response.- Specified by:
parsein interfaceParsingLoadable.Parser<DashManifest>- Parameters:
uri- The sourceUriof the response, after any redirection.inputStream- AnInputStreamfrom which the response data can be read.- Returns:
- The parsed object.
- Throws:
ParserException- If an error occurs parsing the data.IOException- If an error occurs reading data from the stream.
-
parseMediaPresentationDescription
protected DashManifest parseMediaPresentationDescription(XmlPullParser xpp, Uri documentBaseUri) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildMediaPresentationDescription
protected DashManifest buildMediaPresentationDescription(long availabilityStartTime, long durationMs, long minBufferTimeMs, boolean dynamic, long minUpdateTimeMs, long timeShiftBufferDepthMs, long suggestedPresentationDelayMs, long publishTimeMs, @Nullable ProgramInformation programInformation, @Nullable UtcTimingElement utcTiming, @Nullable ServiceDescriptionElement serviceDescription, @Nullable Uri location, List<Period> periods)
-
parseUtcTiming
protected UtcTimingElement parseUtcTiming(XmlPullParser xpp)
-
buildUtcTimingElement
protected UtcTimingElement buildUtcTimingElement(String schemeIdUri, String value)
-
parseServiceDescription
protected ServiceDescriptionElement parseServiceDescription(XmlPullParser xpp) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
parsePeriod
protected Pair<Period,Long> parsePeriod(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, long defaultStartMs, long baseUrlAvailabilityTimeOffsetUs, long availabilityStartTimeMs, long timeShiftBufferDepthMs, boolean dvbProfileDeclared) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildPeriod
protected Period buildPeriod(@Nullable String id, long startMs, List<AdaptationSet> adaptationSets, List<EventStream> eventStreams, @Nullable Descriptor assetIdentifier)
-
parseAdaptationSet
protected AdaptationSet parseAdaptationSet(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, @Nullable SegmentBase segmentBase, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long periodStartUnixTimeMs, long timeShiftBufferDepthMs, boolean dvbProfileDeclared) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildAdaptationSet
protected AdaptationSet buildAdaptationSet(int id, @com.google.android.exoplayer2.C.TrackType int contentType, List<Representation> representations, List<Descriptor> accessibilityDescriptors, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties)
-
parseContentType
protected @com.google.android.exoplayer2.C.TrackType int parseContentType(XmlPullParser xpp)
-
parseContentProtection
protected Pair<@NullableType String,@NullableType DrmInitData.SchemeData> parseContentProtection(XmlPullParser xpp) throws XmlPullParserException, IOException
Parses a ContentProtection element.- Parameters:
xpp- The parser from which to read.- Returns:
- The scheme type and/or
DrmInitData.SchemeDataparsed from the ContentProtection element. Either or both may be null, depending on the ContentProtection element being parsed. - Throws:
XmlPullParserException- If an error occurs parsing the element.IOException- If an error occurs reading the element.
-
parseAdaptationSetChild
protected void parseAdaptationSetChild(XmlPullParser xpp) throws XmlPullParserException, IOException
Parses children of AdaptationSet elements not specifically parsed elsewhere.- Parameters:
xpp- The XmpPullParser from which the AdaptationSet child should be parsed.- Throws:
XmlPullParserException- If an error occurs parsing the element.IOException- If an error occurs reading the element.
-
parseRepresentation
protected DashManifestParser.RepresentationInfo parseRepresentation(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, @Nullable String adaptationSetMimeType, @Nullable String adaptationSetCodecs, int adaptationSetWidth, int adaptationSetHeight, float adaptationSetFrameRate, int adaptationSetAudioChannels, int adaptationSetAudioSamplingRate, @Nullable String adaptationSetLanguage, List<Descriptor> adaptationSetRoleDescriptors, List<Descriptor> adaptationSetAccessibilityDescriptors, List<Descriptor> adaptationSetEssentialProperties, List<Descriptor> adaptationSetSupplementalProperties, @Nullable SegmentBase segmentBase, long periodStartUnixTimeMs, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long timeShiftBufferDepthMs, boolean dvbProfileDeclared) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildFormat
protected Format buildFormat(@Nullable String id, @Nullable String containerMimeType, int width, int height, float frameRate, int audioChannels, int audioSamplingRate, int bitrate, @Nullable String language, List<Descriptor> roleDescriptors, List<Descriptor> accessibilityDescriptors, @Nullable String codecs, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties)
-
buildRepresentation
protected Representation buildRepresentation(DashManifestParser.RepresentationInfo representationInfo, @Nullable String label, @Nullable String extraDrmSchemeType, ArrayList<DrmInitData.SchemeData> extraDrmSchemeDatas, ArrayList<Descriptor> extraInbandEventStreams)
-
parseSegmentBase
protected SegmentBase.SingleSegmentBase parseSegmentBase(XmlPullParser xpp, @Nullable SegmentBase.SingleSegmentBase parent) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildSingleSegmentBase
protected SegmentBase.SingleSegmentBase buildSingleSegmentBase(RangedUri initialization, long timescale, long presentationTimeOffset, long indexStart, long indexLength)
-
parseSegmentList
protected SegmentBase.SegmentList parseSegmentList(XmlPullParser xpp, @Nullable SegmentBase.SegmentList parent, long periodStartUnixTimeMs, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long timeShiftBufferDepthMs) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildSegmentList
protected SegmentBase.SegmentList buildSegmentList(RangedUri initialization, long timescale, long presentationTimeOffset, long startNumber, long duration, @Nullable List<SegmentBase.SegmentTimelineElement> timeline, long availabilityTimeOffsetUs, @Nullable List<RangedUri> segments, long timeShiftBufferDepthMs, long periodStartUnixTimeMs)
-
parseSegmentTemplate
protected SegmentBase.SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, @Nullable SegmentBase.SegmentTemplate parent, List<Descriptor> adaptationSetSupplementalProperties, long periodStartUnixTimeMs, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long timeShiftBufferDepthMs) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildSegmentTemplate
protected SegmentBase.SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale, long presentationTimeOffset, long startNumber, long endNumber, long duration, List<SegmentBase.SegmentTimelineElement> timeline, long availabilityTimeOffsetUs, @Nullable UrlTemplate initializationTemplate, @Nullable UrlTemplate mediaTemplate, long timeShiftBufferDepthMs, long periodStartUnixTimeMs)
-
parseEventStream
protected EventStream parseEventStream(XmlPullParser xpp) throws XmlPullParserException, IOException
Parses a single EventStream node in the manifest.- Parameters:
xpp- The current xml parser.- Returns:
- The
EventStreamparsed from this EventStream node. - Throws:
XmlPullParserException- If there is any error parsing this node.IOException- If there is any error reading from the underlying input stream.
-
buildEventStream
protected EventStream buildEventStream(String schemeIdUri, String value, long timescale, long[] presentationTimesUs, EventMessage[] events)
-
parseEvent
protected Pair<Long,EventMessage> parseEvent(XmlPullParser xpp, String schemeIdUri, String value, long timescale, ByteArrayOutputStream scratchOutputStream) throws IOException, XmlPullParserException
Parses a single Event node in the manifest.- Parameters:
xpp- The current xml parser.schemeIdUri- The schemeIdUri of the parent EventStream.value- The schemeIdUri of the parent EventStream.timescale- The timescale of the parent EventStream.scratchOutputStream- AByteArrayOutputStreamthat is used when parsing event objects.- Returns:
- A pair containing the node's presentation timestamp in microseconds and the parsed
EventMessage. - Throws:
XmlPullParserException- If there is any error parsing this node.IOException- If there is any error reading from the underlying input stream.
-
parseEventObject
protected byte[] parseEventObject(XmlPullParser xpp, ByteArrayOutputStream scratchOutputStream) throws XmlPullParserException, IOException
Parses an event object.- Parameters:
xpp- The current xml parser.scratchOutputStream- AByteArrayOutputStreamthat's used when parsing the object.- Returns:
- The serialized byte array.
- Throws:
XmlPullParserException- If there is any error parsing this node.IOException- If there is any error reading from the underlying input stream.
-
buildEvent
protected EventMessage buildEvent(String schemeIdUri, String value, long id, long durationMs, byte[] messageData)
-
parseSegmentTimeline
protected List<SegmentBase.SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp, long timescale, long periodDurationMs) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
buildSegmentTimelineElement
protected SegmentBase.SegmentTimelineElement buildSegmentTimelineElement(long startTime, long duration)
-
parseUrlTemplate
@Nullable protected UrlTemplate parseUrlTemplate(XmlPullParser xpp, String name, @Nullable UrlTemplate defaultValue)
-
parseInitialization
protected RangedUri parseInitialization(XmlPullParser xpp)
-
parseSegmentUrl
protected RangedUri parseSegmentUrl(XmlPullParser xpp)
-
parseRangedUrl
protected RangedUri parseRangedUrl(XmlPullParser xpp, String urlAttribute, String rangeAttribute)
-
buildRangedUri
protected RangedUri buildRangedUri(String urlText, long rangeStart, long rangeLength)
-
parseProgramInformation
protected ProgramInformation parseProgramInformation(XmlPullParser xpp) throws IOException, XmlPullParserException
- Throws:
IOExceptionXmlPullParserException
-
parseLabel
protected String parseLabel(XmlPullParser xpp) throws XmlPullParserException, IOException
Parses a Label element.- Parameters:
xpp- The parser from which to read.- Returns:
- The parsed label.
- Throws:
XmlPullParserException- If an error occurs parsing the element.IOException- If an error occurs reading the element.
-
parseBaseUrl
protected List<BaseUrl> parseBaseUrl(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, boolean dvbProfileDeclared) throws XmlPullParserException, IOException
Parses a BaseURL element.- Parameters:
xpp- The parser from which to read.parentBaseUrls- The parent base URLs for resolving the parsed URLs.dvbProfileDeclared- Whether the dvb profile is declared.- Returns:
- The list of parsed and resolved URLs.
- Throws:
XmlPullParserException- If an error occurs parsing the element.IOException- If an error occurs reading the element.
-
parseAvailabilityTimeOffsetUs
protected long parseAvailabilityTimeOffsetUs(XmlPullParser xpp, long parentAvailabilityTimeOffsetUs)
Parses the availabilityTimeOffset value and returns the parsed value or the parent value if it doesn't exist.- Parameters:
xpp- The parser from which to read.parentAvailabilityTimeOffsetUs- The availability time offset of a parent element in microseconds.- Returns:
- The parsed availabilityTimeOffset in microseconds.
-
parseAudioChannelConfiguration
protected int parseAudioChannelConfiguration(XmlPullParser xpp) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
parseSelectionFlagsFromRoleDescriptors
@SelectionFlags protected @com.google.android.exoplayer2.C.SelectionFlags int parseSelectionFlagsFromRoleDescriptors(List<Descriptor> roleDescriptors)
-
parseSelectionFlagsFromDashRoleScheme
@SelectionFlags protected @com.google.android.exoplayer2.C.SelectionFlags int parseSelectionFlagsFromDashRoleScheme(@Nullable String value)
-
parseRoleFlagsFromRoleDescriptors
@RoleFlags protected @com.google.android.exoplayer2.C.RoleFlags int parseRoleFlagsFromRoleDescriptors(List<Descriptor> roleDescriptors)
-
parseRoleFlagsFromAccessibilityDescriptors
@RoleFlags protected @com.google.android.exoplayer2.C.RoleFlags int parseRoleFlagsFromAccessibilityDescriptors(List<Descriptor> accessibilityDescriptors)
-
parseRoleFlagsFromProperties
@RoleFlags protected @com.google.android.exoplayer2.C.RoleFlags int parseRoleFlagsFromProperties(List<Descriptor> accessibilityDescriptors)
-
parseRoleFlagsFromDashRoleScheme
@RoleFlags protected @com.google.android.exoplayer2.C.RoleFlags int parseRoleFlagsFromDashRoleScheme(@Nullable String value)
-
parseTvaAudioPurposeCsValue
@RoleFlags protected @com.google.android.exoplayer2.C.RoleFlags int parseTvaAudioPurposeCsValue(@Nullable String value)
-
parseProfiles
protected String[] parseProfiles(XmlPullParser xpp, String attributeName, String[] defaultValue)
-
maybeSkipTag
public static void maybeSkipTag(XmlPullParser xpp) throws IOException, XmlPullParserException
If the providedXmlPullParseris currently positioned at the start of a tag, skips forward to the end of that tag.- Parameters:
xpp- TheXmlPullParser.- Throws:
XmlPullParserException- If an error occurs parsing the stream.IOException- If an error occurs reading the stream.
-
parseDescriptor
protected static Descriptor parseDescriptor(XmlPullParser xpp, String tag) throws XmlPullParserException, IOException
Parses aDescriptorfrom an element.- Parameters:
xpp- The parser from which to read.tag- The tag of the element being parsed.- Returns:
- The parsed
Descriptor. - Throws:
XmlPullParserException- If an error occurs parsing the element.IOException- If an error occurs reading the element.
-
parseCea608AccessibilityChannel
protected static int parseCea608AccessibilityChannel(List<Descriptor> accessibilityDescriptors)
-
parseCea708AccessibilityChannel
protected static int parseCea708AccessibilityChannel(List<Descriptor> accessibilityDescriptors)
-
parseEac3SupplementalProperties
protected static String parseEac3SupplementalProperties(List<Descriptor> supplementalProperties)
-
parseFrameRate
protected static float parseFrameRate(XmlPullParser xpp, float defaultValue)
-
parseDuration
protected static long parseDuration(XmlPullParser xpp, String name, long defaultValue)
-
parseDateTime
protected static long parseDateTime(XmlPullParser xpp, String name, long defaultValue) throws ParserException
- Throws:
ParserException
-
parseText
protected static String parseText(XmlPullParser xpp, String label) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
parseInt
protected static int parseInt(XmlPullParser xpp, String name, int defaultValue)
-
parseLong
protected static long parseLong(XmlPullParser xpp, String name, long defaultValue)
-
parseFloat
protected static float parseFloat(XmlPullParser xpp, String name, float defaultValue)
-
parseString
protected static String parseString(XmlPullParser xpp, String name, String defaultValue)
-
parseMpegChannelConfiguration
protected static int parseMpegChannelConfiguration(XmlPullParser xpp)
Parses the number of channels from the value attribute of an AudioElementConfiguration with schemeIdUri "urn:mpeg:mpegB:cicp:ChannelConfiguration", as defined by ISO 23001-8 clause 8.1.- Parameters:
xpp- The parser from which to read.- Returns:
- The parsed number of channels, or
Format.NO_VALUEif the channel count could not be parsed.
-
parseDolbyChannelConfiguration
protected static int parseDolbyChannelConfiguration(XmlPullParser xpp)
Parses the number of channels from the value attribute of an AudioElementConfiguration with schemeIdUri "tag:dolby.com,2014:dash:audio_channel_configuration:2011", as defined by table E.5 in ETSI TS 102 366, or the legacy schemeIdUri "urn:dolby:dash:audio_channel_configuration:2011".- Parameters:
xpp- The parser from which to read.- Returns:
- The parsed number of channels, or
Format.NO_VALUEif the channel count could not be parsed.
-
parseLastSegmentNumberSupplementalProperty
protected static long parseLastSegmentNumberSupplementalProperty(List<Descriptor> supplementalProperties)
-
-