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
5c722acc
authored
Mar 19, 2021
by
kimvde
Committed by
marcbaechinger
Apr 09, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
JpegExtractor: read GContainer and GContainerItem XMP prefixes
#minor-release PiperOrigin-RevId: 363859522
parent
3732eca8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
RELEASENOTES.md
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/jpeg/XmpMotionPhotoDescriptionParser.java
RELEASENOTES.md
View file @
5c722acc
...
@@ -40,6 +40,9 @@
...
@@ -40,6 +40,9 @@
*
Fix container type detection for segments with incorrect file extension
*
Fix container type detection for segments with incorrect file extension
or HTTP Content-Type
or HTTP Content-Type
(
[
#8733
](
https://github.com/google/ExoPlayer/issues/8733
)
).
(
[
#8733
](
https://github.com/google/ExoPlayer/issues/8733
)
).
*
Extractors:
*
Add support for
`GContainer`
and
`GContainerItem`
XMP namespace prefixes
in JPEG motion photo parsing.
*
Remove deprecated symbols:
*
Remove deprecated symbols:
*
Remove
`Player.DefaultEventListener`
. Use
`Player.EventListener`
*
Remove
`Player.DefaultEventListener`
. Use
`Player.EventListener`
instead.
instead.
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/jpeg/XmpMotionPhotoDescriptionParser.java
View file @
5c722acc
...
@@ -100,7 +100,9 @@ import org.xmlpull.v1.XmlPullParserFactory;
...
@@ -100,7 +100,9 @@ import org.xmlpull.v1.XmlPullParserFactory;
parseMotionPhotoPresentationTimestampUsFromDescription
(
xpp
);
parseMotionPhotoPresentationTimestampUsFromDescription
(
xpp
);
containerItems
=
parseMicroVideoOffsetFromDescription
(
xpp
);
containerItems
=
parseMicroVideoOffsetFromDescription
(
xpp
);
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Container:Directory"
))
{
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Container:Directory"
))
{
containerItems
=
parseMotionPhotoV1Directory
(
xpp
);
containerItems
=
parseMotionPhotoV1Directory
(
xpp
,
"Container"
,
"Item"
);
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"GContainer:Directory"
))
{
containerItems
=
parseMotionPhotoV1Directory
(
xpp
,
"GContainer"
,
"GContainerItem"
);
}
}
}
while
(!
XmlPullParserUtil
.
isEndTag
(
xpp
,
"x:xmpmeta"
));
}
while
(!
XmlPullParserUtil
.
isEndTag
(
xpp
,
"x:xmpmeta"
));
if
(
containerItems
.
isEmpty
())
{
if
(
containerItems
.
isEmpty
())
{
...
@@ -154,16 +156,23 @@ import org.xmlpull.v1.XmlPullParserFactory;
...
@@ -154,16 +156,23 @@ import org.xmlpull.v1.XmlPullParserFactory;
}
}
private
static
ImmutableList
<
MotionPhotoDescription
.
ContainerItem
>
parseMotionPhotoV1Directory
(
private
static
ImmutableList
<
MotionPhotoDescription
.
ContainerItem
>
parseMotionPhotoV1Directory
(
XmlPullParser
xpp
)
throws
XmlPullParserException
,
IOException
{
XmlPullParser
xpp
,
String
containerNamespacePrefix
,
String
itemNamespacePrefix
)
throws
XmlPullParserException
,
IOException
{
ImmutableList
.
Builder
<
MotionPhotoDescription
.
ContainerItem
>
containerItems
=
ImmutableList
.
Builder
<
MotionPhotoDescription
.
ContainerItem
>
containerItems
=
ImmutableList
.
builder
();
ImmutableList
.
builder
();
String
itemTagName
=
containerNamespacePrefix
+
":Item"
;
String
directoryTagName
=
containerNamespacePrefix
+
":Directory"
;
do
{
do
{
xpp
.
next
();
xpp
.
next
();
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Container:Item"
))
{
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
itemTagName
))
{
@Nullable
String
mime
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
"Item:Mime"
);
String
mimeAttributeName
=
itemNamespacePrefix
+
":Mime"
;
@Nullable
String
semantic
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
"Item:Semantic"
);
String
semanticAttributeName
=
itemNamespacePrefix
+
":Semantic"
;
@Nullable
String
length
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
"Item:Length"
);
String
lengthAttributeName
=
itemNamespacePrefix
+
":Length"
;
@Nullable
String
padding
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
"Item:Padding"
);
String
paddinghAttributeName
=
itemNamespacePrefix
+
":Padding"
;
@Nullable
String
mime
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
mimeAttributeName
);
@Nullable
String
semantic
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
semanticAttributeName
);
@Nullable
String
length
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
lengthAttributeName
);
@Nullable
String
padding
=
XmlPullParserUtil
.
getAttributeValue
(
xpp
,
paddinghAttributeName
);
if
(
mime
==
null
||
semantic
==
null
)
{
if
(
mime
==
null
||
semantic
==
null
)
{
// Required values are missing.
// Required values are missing.
return
ImmutableList
.
of
();
return
ImmutableList
.
of
();
...
@@ -175,7 +184,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
...
@@ -175,7 +184,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
length
!=
null
?
Long
.
parseLong
(
length
)
:
0
,
length
!=
null
?
Long
.
parseLong
(
length
)
:
0
,
padding
!=
null
?
Long
.
parseLong
(
padding
)
:
0
));
padding
!=
null
?
Long
.
parseLong
(
padding
)
:
0
));
}
}
}
while
(!
XmlPullParserUtil
.
isEndTag
(
xpp
,
"Container:Directory"
));
}
while
(!
XmlPullParserUtil
.
isEndTag
(
xpp
,
directoryTagName
));
return
containerItems
.
build
();
return
containerItems
.
build
();
}
}
...
...
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