Package com.google.android.exoplayer2.source.dash.manifest

## 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 class` | `DashManifestParser.RepresentationInfo` | A 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 AdaptationSet` | `buildAdaptationSet​(int id, int contentType, List<Representation> representations, List<Descriptor> accessibilityDescriptors, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties)` |
    `protected EventMessage` | `buildEvent​(String schemeIdUri, String value, long id, long durationMs, byte[] messageData)` |
    `protected EventStream` | `buildEventStream​(String schemeIdUri, String value, long timescale, long[] presentationTimesUs, EventMessage[] events)` |
    `protected Format` | `buildFormat​(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 DashManifest` | `buildMediaPresentationDescription​(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 Period` | `buildPeriod​(String id, long startMs, List<AdaptationSet> adaptationSets, List<EventStream> eventStreams, Descriptor assetIdentifier)` |
    `protected RangedUri` | `buildRangedUri​(String urlText, long rangeStart, long rangeLength)` |
    `protected Representation` | `buildRepresentation​(DashManifestParser.RepresentationInfo representationInfo, String label, String extraDrmSchemeType, ArrayList<DrmInitData.SchemeData> extraDrmSchemeDatas, ArrayList<Descriptor> extraInbandEventStreams)` |
    `protected SegmentBase.SegmentList` | `buildSegmentList​(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.SegmentTemplate` | `buildSegmentTemplate​(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.SegmentTimelineElement` | `buildSegmentTimelineElement​(long startTime, long duration)` |
    `protected SegmentBase.SingleSegmentBase` | `buildSingleSegmentBase​(RangedUri initialization, long timescale, long presentationTimeOffset, long indexStart, long indexLength)` |
    `protected UtcTimingElement` | `buildUtcTimingElement​(String schemeIdUri, String value)` |
    `static void` | `maybeSkipTag​(XmlPullParser xpp)` | If the provided `XmlPullParser` is currently positioned at the start of a tag, skips forward to the end of that tag.
    `DashManifest` | `parse​(Uri uri, InputStream inputStream)` | Parses an object from a response.
    `protected AdaptationSet` | `parseAdaptationSet​(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, SegmentBase segmentBase, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long periodStartUnixTimeMs, long timeShiftBufferDepthMs)` |
    `protected void` | `parseAdaptationSetChild​(XmlPullParser xpp)` | Parses children of AdaptationSet elements not specifically parsed elsewhere.
    `protected int` | `parseAudioChannelConfiguration​(XmlPullParser xpp)` |
    `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.
    `protected List<BaseUrl>` | `parseBaseUrl​(XmlPullParser xpp, List<BaseUrl> parentBaseUrls)` | Parses a BaseURL element.
    `protected static int` | `parseCea608AccessibilityChannel​(List<Descriptor> accessibilityDescriptors)` |
    `protected static int` | `parseCea708AccessibilityChannel​(List<Descriptor> accessibilityDescriptors)` |
    `protected Pair<@NullableType String,​@NullableType DrmInitData.SchemeData>` | `parseContentProtection​(XmlPullParser xpp)` | Parses a ContentProtection element.
    `protected int` | `parseContentType​(XmlPullParser xpp)` |
    `protected static long` | `parseDateTime​(XmlPullParser xpp, String name, long defaultValue)` |
    `protected static Descriptor` | `parseDescriptor​(XmlPullParser xpp, String tag)` | Parses a `Descriptor` from an element.
    `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".
    `protected static long` | `parseDuration​(XmlPullParser xpp, String name, long defaultValue)` |
    `protected static String` | `parseEac3SupplementalProperties​(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 EventStream` | `parseEventStream​(XmlPullParser xpp)` | Parses a single EventStream node in the manifest.
    `protected static float` | `parseFloat​(XmlPullParser xpp, String name, float defaultValue)` |
    `protected static float` | `parseFrameRate​(XmlPullParser xpp, float defaultValue)` |
    `protected RangedUri` | `parseInitialization​(XmlPullParser xpp)` |
    `protected static int` | `parseInt​(XmlPullParser xpp, String name, int defaultValue)` |
    `protected String` | `parseLabel​(XmlPullParser xpp)` | Parses a Label element.
    `protected static long` | `parseLastSegmentNumberSupplementalProperty​(List<Descriptor> supplementalProperties)` |
    `protected static long` | `parseLong​(XmlPullParser xpp, String name, long defaultValue)` |
    `protected DashManifest` | `parseMediaPresentationDescription​(XmlPullParser xpp, BaseUrl documentBaseUrl)` |
    `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.
    `protected Pair<Period,​Long>` | `parsePeriod​(XmlPullParser xpp, List<BaseUrl> parentBaseUrls, long defaultStartMs, long baseUrlAvailabilityTimeOffsetUs, long availabilityStartTimeMs, long timeShiftBufferDepthMs)` |
    `protected ProgramInformation` | `parseProgramInformation​(XmlPullParser xpp)` |
    `protected RangedUri` | `parseRangedUrl​(XmlPullParser xpp, String urlAttribute, String rangeAttribute)` |
    `protected DashManifestParser.RepresentationInfo` | `parseRepresentation​(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)` |
    `protected int` | `parseRoleFlagsFromAccessibilityDescriptors​(List<Descriptor> accessibilityDescriptors)` |
    `protected int` | `parseRoleFlagsFromDashRoleScheme​(String value)` |
    `protected int` | `parseRoleFlagsFromProperties​(List<Descriptor> accessibilityDescriptors)` |
    `protected int` | `parseRoleFlagsFromRoleDescriptors​(List<Descriptor> roleDescriptors)` |
    `protected SegmentBase.SingleSegmentBase` | `parseSegmentBase​(XmlPullParser xpp, SegmentBase.SingleSegmentBase parent)` |
    `protected SegmentBase.SegmentList` | `parseSegmentList​(XmlPullParser xpp, SegmentBase.SegmentList parent, long periodStartUnixTimeMs, long periodDurationMs, long baseUrlAvailabilityTimeOffsetUs, long segmentBaseAvailabilityTimeOffsetUs, long timeShiftBufferDepthMs)` |
    `protected SegmentBase.SegmentTemplate` | `parseSegmentTemplate​(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 RangedUri` | `parseSegmentUrl​(XmlPullParser xpp)` |
    `protected int` | `parseSelectionFlagsFromDashRoleScheme​(String value)` |
    `protected int` | `parseSelectionFlagsFromRoleDescriptors​(List<Descriptor> roleDescriptors)` |
    `protected ServiceDescriptionElement` | `parseServiceDescription​(XmlPullParser xpp)` |
    `protected static String` | `parseString​(XmlPullParser xpp, String name, String defaultValue)` |
    `protected static String` | `parseText​(XmlPullParser xpp, String label)` |
    `protected int` | `parseTvaAudioPurposeCsValue​(String value)` |
    `protected UrlTemplate` | `parseUrlTemplate​(XmlPullParser xpp, String name, UrlTemplate defaultValue)` |
    `protected UtcTimingElement` | `parseUtcTiming​(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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DashManifestParser

          public DashManifestParser()

  - ### Method Detail

    - #### parse

          public DashManifest parse​(Uri uri,
                                    InputStream inputStream)
                             throws IOException

      Description copied from interface: `ParsingLoadable.Parser`
      Parses an object from a response.
      Specified by:
        `parse` in interface `ParsingLoadable.Parser<DashManifest>`
      Parameters:
        `uri` - The source `Uri` of the response, after any redirection.
        `inputStream` - An `InputStream` from 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,
                                                                   BaseUrl documentBaseUrl)
                                                            throws XmlPullParserException,
                                                                   IOException

      Throws:
        `XmlPullParserException`
        `IOException`

    - #### 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:
        `XmlPullParserException`
        `IOException`

    - #### parsePeriod

          protected Pair<Period,​Long> parsePeriod​(XmlPullParser xpp,
                                                        List<BaseUrl> parentBaseUrls,
                                                        long defaultStartMs,
                                                        long baseUrlAvailabilityTimeOffsetUs,
                                                        long availabilityStartTimeMs,
                                                        long timeShiftBufferDepthMs)
                                                 throws XmlPullParserException,
                                                        IOException

      Throws:
        `XmlPullParserException`
        `IOException`

    - #### 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)
                                              throws XmlPullParserException,
                                                     IOException

      Throws:
        `XmlPullParserException`
        `IOException`

    - #### buildAdaptationSet

          protected AdaptationSet buildAdaptationSet​(int id,
                                                     int contentType,
                                                     List<Representation> representations,
                                                     List<Descriptor> accessibilityDescriptors,
                                                     List<Descriptor> essentialProperties,
                                                     List<Descriptor> supplementalProperties)

    - #### parseContentType

          protected 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.SchemeData` parsed 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)
                                                                       throws XmlPullParserException,
                                                                              IOException

      Throws:
        `XmlPullParserException`
        `IOException`

    - #### 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:
        `XmlPullParserException`
        `IOException`

    - #### 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:
        `XmlPullParserException`
        `IOException`

    - #### 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:
        `XmlPullParserException`
        `IOException`

    - #### 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 `EventStream` parsed 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` - A `ByteArrayOutputStream` that 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` - A `ByteArrayOutputStream` that'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:
        `XmlPullParserException`
        `IOException`

    - #### 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:
        `IOException`
        `XmlPullParserException`

    - #### 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)
                                        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.
      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:
        `XmlPullParserException`
        `IOException`

    - #### parseSelectionFlagsFromRoleDescriptors

          @SelectionFlags
          protected int parseSelectionFlagsFromRoleDescriptors​(List<Descriptor> roleDescriptors)

    - #### parseSelectionFlagsFromDashRoleScheme

          @SelectionFlags
          protected int parseSelectionFlagsFromDashRoleScheme​(@Nullable
                                                              String value)

    - #### parseRoleFlagsFromRoleDescriptors

          @RoleFlags
          protected int parseRoleFlagsFromRoleDescriptors​(List<Descriptor> roleDescriptors)

    - #### parseRoleFlagsFromAccessibilityDescriptors

          @RoleFlags
          protected int parseRoleFlagsFromAccessibilityDescriptors​(List<Descriptor> accessibilityDescriptors)

    - #### parseRoleFlagsFromProperties

          @RoleFlags
          protected int parseRoleFlagsFromProperties​(List<Descriptor> accessibilityDescriptors)

    - #### parseRoleFlagsFromDashRoleScheme

          @RoleFlags
          protected int parseRoleFlagsFromDashRoleScheme​(@Nullable
                                                         String value)

    - #### parseTvaAudioPurposeCsValue

          @RoleFlags
          protected int parseTvaAudioPurposeCsValue​(@Nullable
                                                    String value)

    - #### maybeSkipTag

          public static void maybeSkipTag​(XmlPullParser xpp)
                                   throws IOException,
                                          XmlPullParserException

      If the provided `XmlPullParser` is currently positioned at the start of a tag, skips forward to the end of that tag.
      Parameters:
        `xpp` - The `XmlPullParser`.
      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 a `Descriptor` from 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:
        `XmlPullParserException`
        `IOException`

    - #### 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_VALUE` if 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_VALUE` if the channel count could not be parsed.

    - #### parseLastSegmentNumberSupplementalProperty

          protected static long parseLastSegmentNumberSupplementalProperty​(List<Descriptor> supplementalProperties)