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
e8b0971f
authored
Mar 24, 2022
by
aquilescanta
Committed by
Ian Baker
Mar 24, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Simplify nullability in Mp4Extractor
PiperOrigin-RevId: 437002406
parent
c83a28f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
libraries/extractor/src/main/java/androidx/media3/extractor/mp4/Mp4Extractor.java
libraries/extractor/src/main/java/androidx/media3/extractor/mp4/Mp4Extractor.java
View file @
e8b0971f
...
...
@@ -15,7 +15,6 @@
*/
package
androidx
.
media3
.
extractor
.
mp4
;
import
static
androidx
.
media3
.
common
.
util
.
Assertions
.
checkNotNull
;
import
static
androidx
.
media3
.
common
.
util
.
Util
.
castNonNull
;
import
static
androidx
.
media3
.
extractor
.
mp4
.
AtomParsers
.
parseTraks
;
import
static
androidx
.
media3
.
extractor
.
mp4
.
Sniffer
.
BRAND_HEIC
;
...
...
@@ -165,8 +164,8 @@ public final class Mp4Extractor implements Extractor, SeekMap {
private
int
sampleCurrentNalBytesRemaining
;
// Extractor outputs.
private
@MonotonicNonNull
ExtractorOutput
extractorOutput
;
private
Mp4Track
@MonotonicNonNull
[]
tracks
;
private
ExtractorOutput
extractorOutput
;
private
Mp4Track
[]
tracks
;
private
long
@MonotonicNonNull
[][]
accumulatedSampleSizes
;
private
int
firstVideoTrackIndex
;
...
...
@@ -197,6 +196,8 @@ public final class Mp4Extractor implements Extractor, SeekMap {
nalLength
=
new
ParsableByteArray
(
4
);
scratch
=
new
ParsableByteArray
();
sampleTrackIndex
=
C
.
INDEX_UNSET
;
extractorOutput
=
ExtractorOutput
.
PLACEHOLDER
;
tracks
=
new
Mp4Track
[
0
];
}
@Override
...
...
@@ -227,7 +228,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
sefReader
.
reset
();
slowMotionMetadataEntries
.
clear
();
}
}
else
if
(
tracks
!=
null
)
{
}
else
{
for
(
Mp4Track
track
:
tracks
)
{
updateSampleIndex
(
track
,
timeUs
);
if
(
track
.
trueHdSampleRechunker
!=
null
)
{
...
...
@@ -280,7 +281,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
@Override
public
SeekPoints
getSeekPoints
(
long
timeUs
)
{
if
(
checkNotNull
(
tracks
)
.
length
==
0
)
{
if
(
tracks
.
length
==
0
)
{
return
new
SeekPoints
(
SeekPoint
.
START
);
}
...
...
@@ -502,7 +503,6 @@ public final class Mp4Extractor implements Extractor, SeekMap {
isQuickTime
,
/* modifyTrackFunction= */
track
->
track
);
ExtractorOutput
extractorOutput
=
checkNotNull
(
this
.
extractorOutput
);
int
trackCount
=
trackSampleTables
.
size
();
for
(
int
i
=
0
;
i
<
trackCount
;
i
++)
{
TrackSampleTable
trackSampleTable
=
trackSampleTables
.
get
(
i
);
...
...
@@ -582,7 +582,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
return
RESULT_END_OF_INPUT
;
}
}
Mp4Track
track
=
castNonNull
(
tracks
)
[
sampleTrackIndex
];
Mp4Track
track
=
tracks
[
sampleTrackIndex
];
TrackOutput
trackOutput
=
track
.
trackOutput
;
int
sampleIndex
=
track
.
sampleIndex
;
long
position
=
track
.
sampleTable
.
offsets
[
sampleIndex
];
...
...
@@ -699,7 +699,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
long
minAccumulatedBytes
=
Long
.
MAX_VALUE
;
boolean
minAccumulatedBytesRequiresReload
=
true
;
int
minAccumulatedBytesTrackIndex
=
C
.
INDEX_UNSET
;
for
(
int
trackIndex
=
0
;
trackIndex
<
castNonNull
(
tracks
)
.
length
;
trackIndex
++)
{
for
(
int
trackIndex
=
0
;
trackIndex
<
tracks
.
length
;
trackIndex
++)
{
Mp4Track
track
=
tracks
[
trackIndex
];
int
sampleIndex
=
track
.
sampleIndex
;
if
(
sampleIndex
==
track
.
sampleTable
.
sampleCount
)
{
...
...
@@ -744,7 +744,6 @@ public final class Mp4Extractor implements Extractor, SeekMap {
private
void
processEndOfStreamReadingAtomHeader
()
{
if
(
fileType
==
FILE_TYPE_HEIC
&&
(
flags
&
FLAG_READ_MOTION_PHOTO_METADATA
)
!=
0
)
{
// Add image track and prepare media.
ExtractorOutput
extractorOutput
=
checkNotNull
(
this
.
extractorOutput
);
TrackOutput
trackOutput
=
extractorOutput
.
track
(
/* id= */
0
,
C
.
TRACK_TYPE_IMAGE
);
@Nullable
Metadata
metadata
=
motionPhotoMetadata
==
null
?
null
:
new
Metadata
(
motionPhotoMetadata
);
...
...
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