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
a92ccb01
authored
Sep 25, 2020
by
kim-vde
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #7968 from DolbyLaboratories:dev-v2-channelConfiguration
PiperOrigin-RevId: 333485323
parents
66636f9e
1736e7cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java
View file @
a92ccb01
...
...
@@ -70,6 +70,16 @@ public class DashManifestParser extends DefaultHandler
private
static
final
Pattern
CEA_708_ACCESSIBILITY_PATTERN
=
Pattern
.
compile
(
"([1-9]|[1-5][0-9]|6[0-3])=.*"
);
/**
* Maps the value attribute of an AudioElementConfiguration with schemeIdUri
* "urn:mpeg:mpegB:cicp:ChannelConfiguration", as defined by ISO 23001-8 clause 8.1, to a channel
* count.
*/
private
static
final
int
[]
MPEG_CHANNEL_CONFIGURATION_MAPPING
=
new
int
[]
{
Format
.
NO_VALUE
,
1
,
2
,
3
,
4
,
5
,
6
,
8
,
2
,
3
,
4
,
7
,
8
,
24
,
8
,
12
,
10
,
12
,
14
,
12
,
14
};
private
final
XmlPullParserFactory
xmlParserFactory
;
public
DashManifestParser
()
{
...
...
@@ -1302,13 +1312,22 @@ public class DashManifestParser extends DefaultHandler
protected
int
parseAudioChannelConfiguration
(
XmlPullParser
xpp
)
throws
XmlPullParserException
,
IOException
{
String
schemeIdUri
=
parseString
(
xpp
,
"schemeIdUri"
,
null
);
int
audioChannels
=
"urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
.
equals
(
schemeIdUri
)
?
parseInt
(
xpp
,
"value"
,
Format
.
NO_VALUE
)
:
(
"tag:dolby.com,2014:dash:audio_channel_configuration:2011"
.
equals
(
schemeIdUri
)
||
"urn:dolby:dash:audio_channel_configuration:2011"
.
equals
(
schemeIdUri
)
?
parseDolbyChannelConfiguration
(
xpp
)
:
Format
.
NO_VALUE
);
int
audioChannels
;
switch
(
schemeIdUri
)
{
case
"urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
:
audioChannels
=
parseInt
(
xpp
,
"value"
,
Format
.
NO_VALUE
);
break
;
case
"urn:mpeg:mpegB:cicp:ChannelConfiguration"
:
audioChannels
=
parseMpegChannelConfiguration
(
xpp
);
break
;
case
"tag:dolby.com,2014:dash:audio_channel_configuration:2011"
:
case
"urn:dolby:dash:audio_channel_configuration:2011"
:
audioChannels
=
parseDolbyChannelConfiguration
(
xpp
);
break
;
default
:
audioChannels
=
Format
.
NO_VALUE
;
break
;
}
do
{
xpp
.
next
();
}
while
(!
XmlPullParserUtil
.
isEndTag
(
xpp
,
"AudioChannelConfiguration"
));
...
...
@@ -1676,6 +1695,21 @@ public class DashManifestParser extends DefaultHandler
/**
* 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.
*
* @param xpp The parser from which to read.
* @return The parsed number of channels, or {@link Format#NO_VALUE} if the channel count could
* not be parsed.
*/
protected
static
int
parseMpegChannelConfiguration
(
XmlPullParser
xpp
)
{
int
index
=
parseInt
(
xpp
,
"value"
,
C
.
INDEX_UNSET
);
return
0
<=
index
&&
index
<
MPEG_CHANNEL_CONFIGURATION_MAPPING
.
length
?
MPEG_CHANNEL_CONFIGURATION_MAPPING
[
index
]
:
Format
.
NO_VALUE
;
}
/**
* 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".
...
...
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