Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
29392d26
authored
Apr 22, 2020
by
tonihei
Committed by
Ian Baker
Apr 27, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make some TtmlDecoder methods static.
PiperOrigin-RevId: 307776363
parent
1031dae1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
library/core/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlDecoder.java
library/core/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlDecoder.java
View file @
29392d26
...
@@ -184,7 +184,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment