mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove ability to inject content-id via DashManifestParser
It doesn't make sense for multi-period manifest PiperOrigin-RevId: 223537958
This commit is contained in:
parent
a1b8e17ed1
commit
d650f8e0e3
1 changed files with 14 additions and 18 deletions
|
|
@ -66,21 +66,9 @@ public class DashManifestParser extends DefaultHandler
|
||||||
private static final Pattern CEA_708_ACCESSIBILITY_PATTERN =
|
private static final Pattern CEA_708_ACCESSIBILITY_PATTERN =
|
||||||
Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
|
Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
|
||||||
|
|
||||||
private final String contentId;
|
|
||||||
private final XmlPullParserFactory xmlParserFactory;
|
private final XmlPullParserFactory xmlParserFactory;
|
||||||
|
|
||||||
/**
|
|
||||||
* Equivalent to calling {@code new DashManifestParser(null)}.
|
|
||||||
*/
|
|
||||||
public DashManifestParser() {
|
public DashManifestParser() {
|
||||||
this(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param contentId An optional content identifier to include in the parsed manifest.
|
|
||||||
*/
|
|
||||||
public DashManifestParser(String contentId) {
|
|
||||||
this.contentId = contentId;
|
|
||||||
try {
|
try {
|
||||||
xmlParserFactory = XmlPullParserFactory.newInstance();
|
xmlParserFactory = XmlPullParserFactory.newInstance();
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
|
|
@ -355,8 +343,9 @@ public class DashManifestParser extends DefaultHandler
|
||||||
// Build the representations.
|
// Build the representations.
|
||||||
List<Representation> representations = new ArrayList<>(representationInfos.size());
|
List<Representation> representations = new ArrayList<>(representationInfos.size());
|
||||||
for (int i = 0; i < representationInfos.size(); i++) {
|
for (int i = 0; i < representationInfos.size(); i++) {
|
||||||
representations.add(buildRepresentation(representationInfos.get(i), contentId,
|
representations.add(
|
||||||
drmSchemeType, drmSchemeDatas, inbandEventStreams));
|
buildRepresentation(
|
||||||
|
representationInfos.get(i), drmSchemeType, drmSchemeDatas, inbandEventStreams));
|
||||||
}
|
}
|
||||||
|
|
||||||
return buildAdaptationSet(id, contentType, representations, accessibilityDescriptors,
|
return buildAdaptationSet(id, contentType, representations, accessibilityDescriptors,
|
||||||
|
|
@ -664,8 +653,10 @@ public class DashManifestParser extends DefaultHandler
|
||||||
id, label, containerMimeType, sampleMimeType, codecs, bitrate, selectionFlags, language);
|
id, label, containerMimeType, sampleMimeType, codecs, bitrate, selectionFlags, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Representation buildRepresentation(RepresentationInfo representationInfo,
|
protected Representation buildRepresentation(
|
||||||
String contentId, String extraDrmSchemeType, ArrayList<SchemeData> extraDrmSchemeDatas,
|
RepresentationInfo representationInfo,
|
||||||
|
String extraDrmSchemeType,
|
||||||
|
ArrayList<SchemeData> extraDrmSchemeDatas,
|
||||||
ArrayList<Descriptor> extraInbandEventStreams) {
|
ArrayList<Descriptor> extraInbandEventStreams) {
|
||||||
Format format = representationInfo.format;
|
Format format = representationInfo.format;
|
||||||
String drmSchemeType = representationInfo.drmSchemeType != null
|
String drmSchemeType = representationInfo.drmSchemeType != null
|
||||||
|
|
@ -679,8 +670,13 @@ public class DashManifestParser extends DefaultHandler
|
||||||
}
|
}
|
||||||
ArrayList<Descriptor> inbandEventStreams = representationInfo.inbandEventStreams;
|
ArrayList<Descriptor> inbandEventStreams = representationInfo.inbandEventStreams;
|
||||||
inbandEventStreams.addAll(extraInbandEventStreams);
|
inbandEventStreams.addAll(extraInbandEventStreams);
|
||||||
return Representation.newInstance(contentId, representationInfo.revisionId, format,
|
return Representation.newInstance(
|
||||||
representationInfo.baseUrl, representationInfo.segmentBase, inbandEventStreams);
|
/* contentId= */ null,
|
||||||
|
representationInfo.revisionId,
|
||||||
|
format,
|
||||||
|
representationInfo.baseUrl,
|
||||||
|
representationInfo.segmentBase,
|
||||||
|
inbandEventStreams);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SegmentBase, SegmentList and SegmentTemplate parsing.
|
// SegmentBase, SegmentList and SegmentTemplate parsing.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue