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
4227c8f1
authored
Jun 26, 2020
by
kimvde
Committed by
Oliver Woodman
Jun 29, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move MP4 getTrackSampleTables to AtomParsers
PiperOrigin-RevId: 318485946
parent
b9511697
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
64 deletions
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java
View file @
4227c8f1
This diff is collapsed.
Click to expand it.
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
View file @
4227c8f1
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
mp4
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
mp4
;
import
static
com
.
google
.
android
.
exoplayer2
.
extractor
.
mp4
.
AtomParsers
.
parseTraks
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
...
@@ -406,8 +408,8 @@ public final class Mp4Extractor implements Extractor, SeekMap {
...
@@ -406,8 +408,8 @@ public final class Mp4Extractor implements Extractor, SeekMap {
}
}
boolean
ignoreEditLists
=
(
flags
&
FLAG_WORKAROUND_IGNORE_EDIT_LISTS
)
!=
0
;
boolean
ignoreEditLists
=
(
flags
&
FLAG_WORKAROUND_IGNORE_EDIT_LISTS
)
!=
0
;
Array
List
<
TrackSampleTable
>
trackSampleTables
=
List
<
TrackSampleTable
>
trackSampleTables
=
getTrackSampleTables
(
moov
,
gaplessInfoHolder
,
ignoreEditLists
);
parseTraks
(
moov
,
gaplessInfoHolder
,
ignoreEditLists
,
isQuickTime
);
int
trackCount
=
trackSampleTables
.
size
();
int
trackCount
=
trackSampleTables
.
size
();
for
(
int
i
=
0
;
i
<
trackCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
trackCount
;
i
++)
{
...
@@ -448,40 +450,6 @@ public final class Mp4Extractor implements Extractor, SeekMap {
...
@@ -448,40 +450,6 @@ public final class Mp4Extractor implements Extractor, SeekMap {
extractorOutput
.
seekMap
(
this
);
extractorOutput
.
seekMap
(
this
);
}
}
private
ArrayList
<
TrackSampleTable
>
getTrackSampleTables
(
ContainerAtom
moov
,
GaplessInfoHolder
gaplessInfoHolder
,
boolean
ignoreEditLists
)
throws
ParserException
{
ArrayList
<
TrackSampleTable
>
trackSampleTables
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
moov
.
containerChildren
.
size
();
i
++)
{
Atom
.
ContainerAtom
atom
=
moov
.
containerChildren
.
get
(
i
);
if
(
atom
.
type
!=
Atom
.
TYPE_trak
)
{
continue
;
}
@Nullable
Track
track
=
AtomParsers
.
parseTrak
(
atom
,
moov
.
getLeafAtomOfType
(
Atom
.
TYPE_mvhd
),
/* duration= */
C
.
TIME_UNSET
,
/* drmInitData= */
null
,
ignoreEditLists
,
isQuickTime
);
if
(
track
==
null
)
{
continue
;
}
Atom
.
ContainerAtom
stblAtom
=
atom
.
getContainerAtomOfType
(
Atom
.
TYPE_mdia
)
.
getContainerAtomOfType
(
Atom
.
TYPE_minf
)
.
getContainerAtomOfType
(
Atom
.
TYPE_stbl
);
TrackSampleTable
trackSampleTable
=
AtomParsers
.
parseStbl
(
track
,
stblAtom
,
gaplessInfoHolder
);
if
(
trackSampleTable
.
sampleCount
==
0
)
{
continue
;
}
trackSampleTables
.
add
(
trackSampleTable
);
}
return
trackSampleTables
;
}
/**
/**
* Attempts to extract the next sample in the current mdat atom for the specified track.
* Attempts to extract the next sample in the current mdat atom for the specified track.
*
*
...
...
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