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
6cbac152
authored
Oct 11, 2018
by
Lieblich, Jonathan
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
added attribute parsin
parent
ce0b5e4c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
10 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/ProgramInformation.java
library/dash/src/test/assets/sample_mpd_1
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java
View file @
6cbac152
...
@@ -985,17 +985,19 @@ public class DashManifestParser extends DefaultHandler
...
@@ -985,17 +985,19 @@ public class DashManifestParser extends DefaultHandler
String
title
=
null
;
String
title
=
null
;
String
source
=
null
;
String
source
=
null
;
String
copyright
=
null
;
String
copyright
=
null
;
String
moreInformationURL
=
parseString
(
xpp
,
"moreInformationURL"
,
null
);
String
lang
=
parseString
(
xpp
,
"lang"
,
null
);
do
{
do
{
xpp
.
next
();
xpp
.
next
();
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Title"
))
{
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Title"
))
{
title
=
xpp
.
ge
tText
();
title
=
xpp
.
nex
tText
();
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Source"
))
{
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Source"
))
{
source
=
xpp
.
ge
tText
();
source
=
xpp
.
nex
tText
();
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Copyright"
))
{
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Copyright"
))
{
copyright
=
xpp
.
ge
tText
();
copyright
=
xpp
.
nex
tText
();
}
}
}
while
(!
XmlPullParserUtil
.
isEndTag
(
xpp
,
"ProgramInformation"
));
}
while
(!
XmlPullParserUtil
.
isEndTag
(
xpp
,
"ProgramInformation"
));
return
new
ProgramInformation
(
title
,
source
,
copyright
);
return
new
ProgramInformation
(
title
,
source
,
copyright
,
moreInformationURL
,
lang
);
}
}
// AudioChannelConfiguration parsing.
// AudioChannelConfiguration parsing.
...
...
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/manifest/ProgramInformation.java
View file @
6cbac152
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
source
.
dash
.
manifest
;
package
com
.
google
.
android
.
exoplayer2
.
source
.
dash
.
manifest
;
import
com.google.android.exoplayer2.util.Util
;
public
class
ProgramInformation
{
public
class
ProgramInformation
{
/**
/**
* The title for the media presentation.
* The title for the media presentation.
...
@@ -31,9 +33,45 @@ public class ProgramInformation {
...
@@ -31,9 +33,45 @@ public class ProgramInformation {
*/
*/
public
final
String
copyright
;
public
final
String
copyright
;
public
ProgramInformation
(
String
title
,
String
source
,
String
copyright
)
{
/**
* A URL that provides more information about the media presentation.
*/
public
final
String
moreInformationURL
;
/**
* Declares the language code(s) for this ProgramInformation.
*/
public
final
String
lang
;
public
ProgramInformation
(
String
title
,
String
source
,
String
copyright
,
String
moreInformationURL
,
String
lang
)
{
this
.
title
=
title
;
this
.
title
=
title
;
this
.
source
=
source
;
this
.
source
=
source
;
this
.
copyright
=
copyright
;
this
.
copyright
=
copyright
;
this
.
moreInformationURL
=
moreInformationURL
;
this
.
lang
=
lang
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(!(
obj
instanceof
ProgramInformation
))
{
return
false
;
}
ProgramInformation
other
=
(
ProgramInformation
)
obj
;
return
Util
.
areEqual
(
this
.
title
,
other
.
title
)
&&
Util
.
areEqual
(
this
.
source
,
other
.
source
)
&&
Util
.
areEqual
(
this
.
copyright
,
other
.
copyright
)
&&
Util
.
areEqual
(
this
.
moreInformationURL
,
other
.
moreInformationURL
)
&&
Util
.
areEqual
(
this
.
lang
,
other
.
lang
);
}
@Override
public
int
hashCode
()
{
int
result
=
17
;
result
=
31
*
result
+
(
title
!=
null
?
title
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
source
!=
null
?
source
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
copyright
!=
null
?
copyright
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
moreInformationURL
!=
null
?
moreInformationURL
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
lang
!=
null
?
lang
.
hashCode
()
:
0
);
return
result
;
}
}
}
}
library/dash/src/test/assets/sample_mpd_1
View file @
6cbac152
...
@@ -9,8 +9,11 @@
...
@@ -9,8 +9,11 @@
xmlns=
"urn:mpeg:DASH:schema:MPD:2011"
xmlns=
"urn:mpeg:DASH:schema:MPD:2011"
xsi:schemaLocation=
"urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd"
xsi:schemaLocation=
"urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd"
yt:earliestMediaSequence=
"1266404"
>
yt:earliestMediaSequence=
"1266404"
>
<ProgramInformation>
<ProgramInformation
lang=
"enUs"
<scte214:ContentIdentifier
type=
"URN"
value=
"5939026565177792163"
/>
moreInformationURL=
"www.example.com"
>
<Title>
MediaTitle
</Title>
<Source>
MediaSource
</Source>
<Copyright>
MediaCopyright
</Copyright>
</ProgramInformation>
</ProgramInformation>
<Period
start=
"PT6462826.784S"
>
<Period
start=
"PT6462826.784S"
>
<SegmentList
<SegmentList
...
...
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java
View file @
6cbac152
...
@@ -158,9 +158,8 @@ public class DashManifestParserTest {
...
@@ -158,9 +158,8 @@ public class DashManifestParserTest {
DashManifestParser
parser
=
new
DashManifestParser
();
DashManifestParser
parser
=
new
DashManifestParser
();
DashManifest
mpd
=
parser
.
parse
(
Uri
.
parse
(
"Https://example.com/test.mpd"
),
DashManifest
mpd
=
parser
.
parse
(
Uri
.
parse
(
"Https://example.com/test.mpd"
),
TestUtil
.
getInputStream
(
RuntimeEnvironment
.
application
,
SAMPLE_MPD_1
));
TestUtil
.
getInputStream
(
RuntimeEnvironment
.
application
,
SAMPLE_MPD_1
));
List
<
byte
[]>
list
=
new
ArrayList
<>();
ProgramInformation
programInformation
=
new
ProgramInformation
(
"MediaTitle"
,
"MediaSource"
,
list
.
add
(
"<scte214:ContentIdentifier type=\"URN\" value=\"5939026565177792163\" />"
.
getBytes
());
"MediaCopyright"
,
"www.example.com"
,
"enUs"
);
ProgramInformation
programInformation
=
new
ProgramInformation
(
""
,
""
,
""
,
list
);
assertThat
(
programInformation
).
isEqualTo
(
mpd
.
programInformation
);
assertThat
(
programInformation
).
isEqualTo
(
mpd
.
programInformation
);
}
}
...
...
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