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
a7c6cb4a
authored
Jan 31, 2020
by
olly
Committed by
Oliver Woodman
Feb 03, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add some missing local @Nullable annotations
PiperOrigin-RevId: 292564056
parent
d287e13d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
library/common/src/main/java/com/google/android/exoplayer2/Format.java
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java
library/common/src/main/java/com/google/android/exoplayer2/Format.java
View file @
a7c6cb4a
...
@@ -1111,11 +1111,11 @@ public final class Format implements Parcelable {
...
@@ -1111,11 +1111,11 @@ public final class Format implements Parcelable {
int
trackType
=
MimeTypes
.
getTrackType
(
sampleMimeType
);
int
trackType
=
MimeTypes
.
getTrackType
(
sampleMimeType
);
// Use manifest value only.
// Use manifest value only.
String
id
=
manifestFormat
.
id
;
@Nullable
String
id
=
manifestFormat
.
id
;
// Prefer manifest values, but fill in from sample format if missing.
// Prefer manifest values, but fill in from sample format if missing.
String
label
=
manifestFormat
.
label
!=
null
?
manifestFormat
.
label
:
this
.
label
;
@Nullable
String
label
=
manifestFormat
.
label
!=
null
?
manifestFormat
.
label
:
this
.
label
;
String
language
=
this
.
language
;
@Nullable
String
language
=
this
.
language
;
if
((
trackType
==
C
.
TRACK_TYPE_TEXT
||
trackType
==
C
.
TRACK_TYPE_AUDIO
)
if
((
trackType
==
C
.
TRACK_TYPE_TEXT
||
trackType
==
C
.
TRACK_TYPE_AUDIO
)
&&
manifestFormat
.
language
!=
null
)
{
&&
manifestFormat
.
language
!=
null
)
{
language
=
manifestFormat
.
language
;
language
=
manifestFormat
.
language
;
...
@@ -1123,7 +1123,7 @@ public final class Format implements Parcelable {
...
@@ -1123,7 +1123,7 @@ public final class Format implements Parcelable {
// Prefer sample format values, but fill in from manifest if missing.
// Prefer sample format values, but fill in from manifest if missing.
int
bitrate
=
this
.
bitrate
==
NO_VALUE
?
manifestFormat
.
bitrate
:
this
.
bitrate
;
int
bitrate
=
this
.
bitrate
==
NO_VALUE
?
manifestFormat
.
bitrate
:
this
.
bitrate
;
String
codecs
=
this
.
codecs
;
@Nullable
String
codecs
=
this
.
codecs
;
if
(
codecs
==
null
)
{
if
(
codecs
==
null
)
{
// The manifest format may be muxed, so filter only codecs of this format's type. If we still
// The manifest format may be muxed, so filter only codecs of this format's type. If we still
// have more than one codec then we're unable to uniquely identify which codec to fill in.
// have more than one codec then we're unable to uniquely identify which codec to fill in.
...
@@ -1133,6 +1133,7 @@ public final class Format implements Parcelable {
...
@@ -1133,6 +1133,7 @@ public final class Format implements Parcelable {
}
}
}
}
@Nullable
Metadata
metadata
=
Metadata
metadata
=
this
.
metadata
==
null
this
.
metadata
==
null
?
manifestFormat
.
metadata
?
manifestFormat
.
metadata
...
@@ -1146,6 +1147,7 @@ public final class Format implements Parcelable {
...
@@ -1146,6 +1147,7 @@ public final class Format implements Parcelable {
// Merge manifest and sample format values.
// Merge manifest and sample format values.
@C
.
SelectionFlags
int
selectionFlags
=
this
.
selectionFlags
|
manifestFormat
.
selectionFlags
;
@C
.
SelectionFlags
int
selectionFlags
=
this
.
selectionFlags
|
manifestFormat
.
selectionFlags
;
@C
.
RoleFlags
int
roleFlags
=
this
.
roleFlags
|
manifestFormat
.
roleFlags
;
@C
.
RoleFlags
int
roleFlags
=
this
.
roleFlags
|
manifestFormat
.
roleFlags
;
@Nullable
DrmInitData
drmInitData
=
DrmInitData
drmInitData
=
DrmInitData
.
createSessionCreationData
(
manifestFormat
.
drmInitData
,
this
.
drmInitData
);
DrmInitData
.
createSessionCreationData
(
manifestFormat
.
drmInitData
,
this
.
drmInitData
);
...
...
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java
View file @
a7c6cb4a
...
@@ -1009,7 +1009,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -1009,7 +1009,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private
void
updateSampleStreams
(
@NullableType
SampleStream
[]
streams
)
{
private
void
updateSampleStreams
(
@NullableType
SampleStream
[]
streams
)
{
hlsSampleStreams
.
clear
();
hlsSampleStreams
.
clear
();
for
(
SampleStream
stream
:
streams
)
{
for
(
@Nullable
SampleStream
stream
:
streams
)
{
if
(
stream
!=
null
)
{
if
(
stream
!=
null
)
{
hlsSampleStreams
.
add
((
HlsSampleStream
)
stream
);
hlsSampleStreams
.
add
((
HlsSampleStream
)
stream
);
}
}
...
@@ -1118,7 +1118,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -1118,7 +1118,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
int
primaryExtractorTrackIndex
=
C
.
INDEX_UNSET
;
int
primaryExtractorTrackIndex
=
C
.
INDEX_UNSET
;
int
extractorTrackCount
=
sampleQueues
.
length
;
int
extractorTrackCount
=
sampleQueues
.
length
;
for
(
int
i
=
0
;
i
<
extractorTrackCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
extractorTrackCount
;
i
++)
{
String
sampleMimeType
=
sampleQueues
[
i
].
getUpstreamFormat
().
sampleMimeType
;
@Nullable
String
sampleMimeType
=
sampleQueues
[
i
].
getUpstreamFormat
().
sampleMimeType
;
int
trackType
;
int
trackType
;
if
(
MimeTypes
.
isVideo
(
sampleMimeType
))
{
if
(
MimeTypes
.
isVideo
(
sampleMimeType
))
{
trackType
=
C
.
TRACK_TYPE_VIDEO
;
trackType
=
C
.
TRACK_TYPE_VIDEO
;
...
@@ -1166,6 +1166,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -1166,6 +1166,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
trackGroups
[
i
]
=
new
TrackGroup
(
formats
);
trackGroups
[
i
]
=
new
TrackGroup
(
formats
);
primaryTrackGroupIndex
=
i
;
primaryTrackGroupIndex
=
i
;
}
else
{
}
else
{
@Nullable
Format
trackFormat
=
Format
trackFormat
=
primaryExtractorTrackType
==
C
.
TRACK_TYPE_VIDEO
primaryExtractorTrackType
==
C
.
TRACK_TYPE_VIDEO
&&
MimeTypes
.
isAudio
(
sampleFormat
.
sampleMimeType
)
&&
MimeTypes
.
isAudio
(
sampleFormat
.
sampleMimeType
)
...
@@ -1280,8 +1281,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -1280,8 +1281,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
?
playlistFormat
.
channelCount
?
playlistFormat
.
channelCount
:
sampleFormat
.
channelCount
;
:
sampleFormat
.
channelCount
;
int
sampleTrackType
=
MimeTypes
.
getTrackType
(
sampleFormat
.
sampleMimeType
);
int
sampleTrackType
=
MimeTypes
.
getTrackType
(
sampleFormat
.
sampleMimeType
);
String
codecs
=
Util
.
getCodecsOfType
(
playlistFormat
.
codecs
,
sampleTrackType
);
@Nullable
String
codecs
=
Util
.
getCodecsOfType
(
playlistFormat
.
codecs
,
sampleTrackType
);
String
mimeType
=
MimeTypes
.
getMediaMimeType
(
codecs
);
@Nullable
String
mimeType
=
MimeTypes
.
getMediaMimeType
(
codecs
);
if
(
mimeType
==
null
)
{
if
(
mimeType
==
null
)
{
mimeType
=
sampleFormat
.
sampleMimeType
;
mimeType
=
sampleFormat
.
sampleMimeType
;
}
}
...
@@ -1304,8 +1305,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -1304,8 +1305,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
}
}
private
static
boolean
formatsMatch
(
Format
manifestFormat
,
Format
sampleFormat
)
{
private
static
boolean
formatsMatch
(
Format
manifestFormat
,
Format
sampleFormat
)
{
String
manifestFormatMimeType
=
manifestFormat
.
sampleMimeType
;
@Nullable
String
manifestFormatMimeType
=
manifestFormat
.
sampleMimeType
;
String
sampleFormatMimeType
=
sampleFormat
.
sampleMimeType
;
@Nullable
String
sampleFormatMimeType
=
sampleFormat
.
sampleMimeType
;
int
manifestFormatTrackType
=
MimeTypes
.
getTrackType
(
manifestFormatMimeType
);
int
manifestFormatTrackType
=
MimeTypes
.
getTrackType
(
manifestFormatMimeType
);
if
(
manifestFormatTrackType
!=
C
.
TRACK_TYPE_TEXT
)
{
if
(
manifestFormatTrackType
!=
C
.
TRACK_TYPE_TEXT
)
{
return
manifestFormatTrackType
==
MimeTypes
.
getTrackType
(
sampleFormatMimeType
);
return
manifestFormatTrackType
==
MimeTypes
.
getTrackType
(
sampleFormatMimeType
);
...
...
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