public class DashManifestParser extends DefaultHandler implements ParsingLoadable.Parser<DashManifest>
Constructor and Description |
---|
DashManifestParser()
Equivalent to calling
new DashManifestParser(null) . |
DashManifestParser(String contentId) |
Modifier and Type | Method and Description |
---|---|
protected AdaptationSet |
buildAdaptationSet(int id,
int contentType,
List<Representation> representations,
List<Descriptor> accessibilityDescriptors,
List<Descriptor> supplementalProperties) |
protected Format |
buildFormat(String id,
String containerMimeType,
int width,
int height,
float frameRate,
int audioChannels,
int audioSamplingRate,
int bitrate,
String language,
int selectionFlags,
List<Descriptor> accessibilityDescriptors,
String codecs) |
protected DashManifest |
buildMediaPresentationDescription(long availabilityStartTime,
long durationMs,
long minBufferTimeMs,
boolean dynamic,
long minUpdateTimeMs,
long timeShiftBufferDepthMs,
long suggestedPresentationDelayMs,
UtcTimingElement utcTiming,
Uri location,
List<Period> periods) |
protected Period |
buildPeriod(String id,
long startMs,
List<AdaptationSet> adaptationSets) |
protected RangedUri |
buildRangedUri(String urlText,
long rangeStart,
long rangeLength) |
protected Representation |
buildRepresentation(com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.RepresentationInfo representationInfo,
String contentId,
ArrayList<DrmInitData.SchemeData> extraDrmSchemeDatas,
ArrayList<Descriptor> extraInbandEventStreams) |
protected SegmentBase.SegmentList |
buildSegmentList(RangedUri initialization,
long timescale,
long presentationTimeOffset,
int startNumber,
long duration,
List<SegmentBase.SegmentTimelineElement> timeline,
List<RangedUri> segments) |
protected SegmentBase.SegmentTemplate |
buildSegmentTemplate(RangedUri initialization,
long timescale,
long presentationTimeOffset,
int startNumber,
long duration,
List<SegmentBase.SegmentTimelineElement> timeline,
UrlTemplate initializationTemplate,
UrlTemplate mediaTemplate) |
protected SegmentBase.SegmentTimelineElement |
buildSegmentTimelineElement(long elapsedTime,
long duration) |
protected SegmentBase.SingleSegmentBase |
buildSingleSegmentBase(RangedUri initialization,
long timescale,
long presentationTimeOffset,
long indexStart,
long indexLength) |
protected UtcTimingElement |
buildUtcTimingElement(String schemeIdUri,
String value) |
protected int |
getContentType(Format format) |
DashManifest |
parse(Uri uri,
InputStream inputStream)
Parses an object from a response.
|
protected AdaptationSet |
parseAdaptationSet(XmlPullParser xpp,
String baseUrl,
SegmentBase segmentBase) |
protected void |
parseAdaptationSetChild(XmlPullParser xpp)
Parses children of AdaptationSet elements not specifically parsed elsewhere.
|
protected int |
parseAudioChannelConfiguration(XmlPullParser xpp) |
protected static String |
parseBaseUrl(XmlPullParser xpp,
String parentBaseUrl) |
protected static int |
parseCea608AccessibilityChannel(List<Descriptor> accessibilityDescriptors) |
protected static int |
parseCea708AccessibilityChannel(List<Descriptor> accessibilityDescriptors) |
protected 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 long |
parseDuration(XmlPullParser xpp,
String name,
long 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 static long |
parseLong(XmlPullParser xpp,
String name,
long defaultValue) |
protected DashManifest |
parseMediaPresentationDescription(XmlPullParser xpp,
String baseUrl) |
protected Pair<Period,Long> |
parsePeriod(XmlPullParser xpp,
String baseUrl,
long defaultStartMs) |
protected RangedUri |
parseRangedUrl(XmlPullParser xpp,
String urlAttribute,
String rangeAttribute) |
protected com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.RepresentationInfo |
parseRepresentation(XmlPullParser xpp,
String baseUrl,
String adaptationSetMimeType,
String adaptationSetCodecs,
int adaptationSetWidth,
int adaptationSetHeight,
float adaptationSetFrameRate,
int adaptationSetAudioChannels,
int adaptationSetAudioSamplingRate,
String adaptationSetLanguage,
int adaptationSetSelectionFlags,
List<Descriptor> adaptationSetAccessibilityDescriptors,
SegmentBase segmentBase) |
protected int |
parseRole(XmlPullParser xpp)
Parses a Role element.
|
protected SegmentBase.SingleSegmentBase |
parseSegmentBase(XmlPullParser xpp,
SegmentBase.SingleSegmentBase parent) |
protected SegmentBase.SegmentList |
parseSegmentList(XmlPullParser xpp,
SegmentBase.SegmentList parent) |
protected SegmentBase.SegmentTemplate |
parseSegmentTemplate(XmlPullParser xpp,
SegmentBase.SegmentTemplate parent) |
protected List<SegmentBase.SegmentTimelineElement> |
parseSegmentTimeline(XmlPullParser xpp) |
protected RangedUri |
parseSegmentUrl(XmlPullParser xpp) |
protected static String |
parseString(XmlPullParser xpp,
String name,
String defaultValue) |
protected UrlTemplate |
parseUrlTemplate(XmlPullParser xpp,
String name,
UrlTemplate defaultValue) |
protected UtcTimingElement |
parseUtcTiming(XmlPullParser xpp) |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
public DashManifestParser()
new DashManifestParser(null)
.public DashManifestParser(String contentId)
contentId
- An optional content identifier to include in the parsed manifest.public DashManifest parse(Uri uri, InputStream inputStream) throws IOException
ParsingLoadable.Parser
parse
in interface ParsingLoadable.Parser<DashManifest>
uri
- The source Uri
of the response, after any redirection.inputStream
- An InputStream
from which the response data can be read.ParserException
- If an error occurs parsing the data.IOException
- If an error occurs reading data from the stream.protected DashManifest parseMediaPresentationDescription(XmlPullParser xpp, String baseUrl) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected DashManifest buildMediaPresentationDescription(long availabilityStartTime, long durationMs, long minBufferTimeMs, boolean dynamic, long minUpdateTimeMs, long timeShiftBufferDepthMs, long suggestedPresentationDelayMs, UtcTimingElement utcTiming, Uri location, List<Period> periods)
protected UtcTimingElement parseUtcTiming(XmlPullParser xpp)
protected UtcTimingElement buildUtcTimingElement(String schemeIdUri, String value)
protected Pair<Period,Long> parsePeriod(XmlPullParser xpp, String baseUrl, long defaultStartMs) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected Period buildPeriod(String id, long startMs, List<AdaptationSet> adaptationSets)
protected AdaptationSet parseAdaptationSet(XmlPullParser xpp, String baseUrl, SegmentBase segmentBase) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected AdaptationSet buildAdaptationSet(int id, int contentType, List<Representation> representations, List<Descriptor> accessibilityDescriptors, List<Descriptor> supplementalProperties)
protected int parseContentType(XmlPullParser xpp)
protected int getContentType(Format format)
protected DrmInitData.SchemeData parseContentProtection(XmlPullParser xpp) throws XmlPullParserException, IOException
xpp
- The parser from which to read.DrmInitData.SchemeData
parsed from the ContentProtection element, or null if the element is
unsupported.XmlPullParserException
- If an error occurs parsing the element.IOException
- If an error occurs reading the element.protected int parseRole(XmlPullParser xpp) throws XmlPullParserException, IOException
xpp
- The parser from which to read.C.SelectionFlags
parsed from the element.XmlPullParserException
- If an error occurs parsing the element.IOException
- If an error occurs reading the element.protected void parseAdaptationSetChild(XmlPullParser xpp) throws XmlPullParserException, IOException
xpp
- The XmpPullParser from which the AdaptationSet child should be parsed.XmlPullParserException
- If an error occurs parsing the element.IOException
- If an error occurs reading the element.protected com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.RepresentationInfo parseRepresentation(XmlPullParser xpp, String baseUrl, String adaptationSetMimeType, String adaptationSetCodecs, int adaptationSetWidth, int adaptationSetHeight, float adaptationSetFrameRate, int adaptationSetAudioChannels, int adaptationSetAudioSamplingRate, String adaptationSetLanguage, int adaptationSetSelectionFlags, List<Descriptor> adaptationSetAccessibilityDescriptors, SegmentBase segmentBase) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected Format buildFormat(String id, String containerMimeType, int width, int height, float frameRate, int audioChannels, int audioSamplingRate, int bitrate, String language, int selectionFlags, List<Descriptor> accessibilityDescriptors, String codecs)
protected Representation buildRepresentation(com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.RepresentationInfo representationInfo, String contentId, ArrayList<DrmInitData.SchemeData> extraDrmSchemeDatas, ArrayList<Descriptor> extraInbandEventStreams)
protected SegmentBase.SingleSegmentBase parseSegmentBase(XmlPullParser xpp, SegmentBase.SingleSegmentBase parent) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected SegmentBase.SingleSegmentBase buildSingleSegmentBase(RangedUri initialization, long timescale, long presentationTimeOffset, long indexStart, long indexLength)
protected SegmentBase.SegmentList parseSegmentList(XmlPullParser xpp, SegmentBase.SegmentList parent) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected SegmentBase.SegmentList buildSegmentList(RangedUri initialization, long timescale, long presentationTimeOffset, int startNumber, long duration, List<SegmentBase.SegmentTimelineElement> timeline, List<RangedUri> segments)
protected SegmentBase.SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, SegmentBase.SegmentTemplate parent) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected SegmentBase.SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale, long presentationTimeOffset, int startNumber, long duration, List<SegmentBase.SegmentTimelineElement> timeline, UrlTemplate initializationTemplate, UrlTemplate mediaTemplate)
protected List<SegmentBase.SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected SegmentBase.SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration)
protected UrlTemplate parseUrlTemplate(XmlPullParser xpp, String name, UrlTemplate defaultValue)
protected RangedUri parseInitialization(XmlPullParser xpp)
protected RangedUri parseSegmentUrl(XmlPullParser xpp)
protected RangedUri parseRangedUrl(XmlPullParser xpp, String urlAttribute, String rangeAttribute)
protected RangedUri buildRangedUri(String urlText, long rangeStart, long rangeLength)
protected int parseAudioChannelConfiguration(XmlPullParser xpp) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected static Descriptor parseDescriptor(XmlPullParser xpp, String tag) throws XmlPullParserException, IOException
Descriptor
from an element.xpp
- The parser from which to read.tag
- The tag of the element being parsed.Descriptor
.XmlPullParserException
- If an error occurs parsing the element.IOException
- If an error occurs reading the element.protected static int parseCea608AccessibilityChannel(List<Descriptor> accessibilityDescriptors)
protected static int parseCea708AccessibilityChannel(List<Descriptor> accessibilityDescriptors)
protected static float parseFrameRate(XmlPullParser xpp, float defaultValue)
protected static long parseDuration(XmlPullParser xpp, String name, long defaultValue)
protected static long parseDateTime(XmlPullParser xpp, String name, long defaultValue) throws ParserException
ParserException
protected static String parseBaseUrl(XmlPullParser xpp, String parentBaseUrl) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected static int parseInt(XmlPullParser xpp, String name, int defaultValue)
protected static long parseLong(XmlPullParser xpp, String name, long defaultValue)
protected static String parseString(XmlPullParser xpp, String name, String defaultValue)