mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Make some TtmlDecoder methods static.
PiperOrigin-RevId: 307776363
This commit is contained in:
parent
1031dae19b
commit
29392d2689
1 changed files with 11 additions and 11 deletions
|
|
@ -184,7 +184,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private FrameAndTickRate parseFrameAndTickRates(XmlPullParser xmlParser)
|
private static FrameAndTickRate parseFrameAndTickRates(XmlPullParser xmlParser)
|
||||||
throws SubtitleDecoderException {
|
throws SubtitleDecoderException {
|
||||||
int frameRate = DEFAULT_FRAME_RATE;
|
int frameRate = DEFAULT_FRAME_RATE;
|
||||||
String frameRateString = xmlParser.getAttributeValue(TTP, "frameRate");
|
String frameRateString = xmlParser.getAttributeValue(TTP, "frameRate");
|
||||||
|
|
@ -218,8 +218,8 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
return new FrameAndTickRate(frameRate * frameRateMultiplier, subFrameRate, tickRate);
|
return new FrameAndTickRate(frameRate * frameRateMultiplier, subFrameRate, tickRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CellResolution parseCellResolution(XmlPullParser xmlParser, CellResolution defaultValue)
|
private static CellResolution parseCellResolution(
|
||||||
throws SubtitleDecoderException {
|
XmlPullParser xmlParser, CellResolution defaultValue) throws SubtitleDecoderException {
|
||||||
String cellResolution = xmlParser.getAttributeValue(TTP, "cellResolution");
|
String cellResolution = xmlParser.getAttributeValue(TTP, "cellResolution");
|
||||||
if (cellResolution == null) {
|
if (cellResolution == null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
|
|
@ -244,7 +244,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private TtsExtent parseTtsExtent(XmlPullParser xmlParser) {
|
private static TtsExtent parseTtsExtent(XmlPullParser xmlParser) {
|
||||||
@Nullable
|
@Nullable
|
||||||
String ttsExtent = XmlPullParserUtil.getAttributeValue(xmlParser, TtmlNode.ATTR_TTS_EXTENT);
|
String ttsExtent = XmlPullParserUtil.getAttributeValue(xmlParser, TtmlNode.ATTR_TTS_EXTENT);
|
||||||
if (ttsExtent == null) {
|
if (ttsExtent == null) {
|
||||||
|
|
@ -266,7 +266,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, TtmlStyle> parseHeader(
|
private static Map<String, TtmlStyle> parseHeader(
|
||||||
XmlPullParser xmlParser,
|
XmlPullParser xmlParser,
|
||||||
Map<String, TtmlStyle> globalStyles,
|
Map<String, TtmlStyle> globalStyles,
|
||||||
CellResolution cellResolution,
|
CellResolution cellResolution,
|
||||||
|
|
@ -301,7 +301,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
return globalStyles;
|
return globalStyles;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseMetadata(XmlPullParser xmlParser, Map<String, String> imageMap)
|
private static void parseMetadata(XmlPullParser xmlParser, Map<String, String> imageMap)
|
||||||
throws IOException, XmlPullParserException {
|
throws IOException, XmlPullParserException {
|
||||||
do {
|
do {
|
||||||
xmlParser.next();
|
xmlParser.next();
|
||||||
|
|
@ -324,7 +324,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
* returned.
|
* returned.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
private TtmlRegion parseRegionAttributes(
|
private static TtmlRegion parseRegionAttributes(
|
||||||
XmlPullParser xmlParser, CellResolution cellResolution, @Nullable TtsExtent ttsExtent) {
|
XmlPullParser xmlParser, CellResolution cellResolution, @Nullable TtsExtent ttsExtent) {
|
||||||
@Nullable String regionId = XmlPullParserUtil.getAttributeValue(xmlParser, TtmlNode.ATTR_ID);
|
@Nullable String regionId = XmlPullParserUtil.getAttributeValue(xmlParser, TtmlNode.ATTR_ID);
|
||||||
if (regionId == null) {
|
if (regionId == null) {
|
||||||
|
|
@ -456,12 +456,12 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
/* textSize= */ regionTextHeight);
|
/* textSize= */ regionTextHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] parseStyleIds(String parentStyleIds) {
|
private static String[] parseStyleIds(String parentStyleIds) {
|
||||||
parentStyleIds = parentStyleIds.trim();
|
parentStyleIds = parentStyleIds.trim();
|
||||||
return parentStyleIds.isEmpty() ? new String[0] : Util.split(parentStyleIds, "\\s+");
|
return parentStyleIds.isEmpty() ? new String[0] : Util.split(parentStyleIds, "\\s+");
|
||||||
}
|
}
|
||||||
|
|
||||||
private @PolyNull TtmlStyle parseStyleAttributes(
|
private static @PolyNull TtmlStyle parseStyleAttributes(
|
||||||
XmlPullParser parser, @PolyNull TtmlStyle style) {
|
XmlPullParser parser, @PolyNull TtmlStyle style) {
|
||||||
int attributeCount = parser.getAttributeCount();
|
int attributeCount = parser.getAttributeCount();
|
||||||
for (int i = 0; i < attributeCount; i++) {
|
for (int i = 0; i < attributeCount; i++) {
|
||||||
|
|
@ -611,11 +611,11 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TtmlStyle createIfNull(@Nullable TtmlStyle style) {
|
private static TtmlStyle createIfNull(@Nullable TtmlStyle style) {
|
||||||
return style == null ? new TtmlStyle() : style;
|
return style == null ? new TtmlStyle() : style;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TtmlNode parseNode(
|
private static TtmlNode parseNode(
|
||||||
XmlPullParser parser,
|
XmlPullParser parser,
|
||||||
@Nullable TtmlNode parent,
|
@Nullable TtmlNode parent,
|
||||||
Map<String, TtmlRegion> regionMap,
|
Map<String, TtmlRegion> regionMap,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue