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
a877bbaf
authored
Jun 05, 2018
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove NullableType usage from release branch
parent
97e68ecc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
16 deletions
library/core/build.gradle
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java
library/core/build.gradle
View file @
a877bbaf
...
@@ -54,7 +54,6 @@ android {
...
@@ -54,7 +54,6 @@ android {
dependencies
{
dependencies
{
implementation
'com.android.support:support-annotations:'
+
supportLibraryVersion
implementation
'com.android.support:support-annotations:'
+
supportLibraryVersion
compileOnly
'org.checkerframework:checker-qual:'
+
checkerframeworkVersion
compileOnly
'org.checkerframework:checker-qual:'
+
checkerframeworkVersion
compileOnly
'org.checkerframework:checker-compat-qual:'
+
checkerframeworkVersion
androidTestImplementation
'com.google.dexmaker:dexmaker:'
+
dexmakerVersion
androidTestImplementation
'com.google.dexmaker:dexmaker:'
+
dexmakerVersion
androidTestImplementation
'com.google.dexmaker:dexmaker-mockito:'
+
dexmakerVersion
androidTestImplementation
'com.google.dexmaker:dexmaker-mockito:'
+
dexmakerVersion
androidTestImplementation
'com.google.truth:truth:'
+
truthVersion
androidTestImplementation
'com.google.truth:truth:'
+
truthVersion
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
View file @
a877bbaf
...
@@ -43,7 +43,6 @@ import java.util.HashSet;
...
@@ -43,7 +43,6 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
import
org.checkerframework.checker.nullness.compatqual.NullableType
;
/**
/**
* A default {@link TrackSelector} suitable for most use cases. Track selections are made according
* A default {@link TrackSelector} suitable for most use cases. Track selections are made according
...
@@ -1214,7 +1213,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
...
@@ -1214,7 +1213,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
// Initialize the renderer configurations to the default configuration for all renderers with
// Initialize the renderer configurations to the default configuration for all renderers with
// selections, and null otherwise.
// selections, and null otherwise.
@NullableType
RendererConfiguration
[]
rendererConfigurations
=
RendererConfiguration
[]
rendererConfigurations
=
new
RendererConfiguration
[
rendererCount
];
new
RendererConfiguration
[
rendererCount
];
for
(
int
i
=
0
;
i
<
rendererCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
rendererCount
;
i
++)
{
boolean
forceRendererDisabled
=
params
.
getRendererDisabled
(
i
);
boolean
forceRendererDisabled
=
params
.
getRendererDisabled
(
i
);
...
@@ -1254,14 +1253,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
...
@@ -1254,14 +1253,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
* disabled, unless RendererCapabilities#getTrackType()} is {@link C#TRACK_TYPE_NONE}.
* disabled, unless RendererCapabilities#getTrackType()} is {@link C#TRACK_TYPE_NONE}.
* @throws ExoPlaybackException If an error occurs while selecting the tracks.
* @throws ExoPlaybackException If an error occurs while selecting the tracks.
*/
*/
protected
@NullableType
TrackSelection
[]
selectAllTracks
(
protected
TrackSelection
[]
selectAllTracks
(
MappedTrackInfo
mappedTrackInfo
,
MappedTrackInfo
mappedTrackInfo
,
int
[][][]
rendererFormatSupports
,
int
[][][]
rendererFormatSupports
,
int
[]
rendererMixedMimeTypeAdaptationSupports
,
int
[]
rendererMixedMimeTypeAdaptationSupports
,
Parameters
params
)
Parameters
params
)
throws
ExoPlaybackException
{
throws
ExoPlaybackException
{
int
rendererCount
=
mappedTrackInfo
.
getRendererCount
();
int
rendererCount
=
mappedTrackInfo
.
getRendererCount
();
@NullableType
TrackSelection
[]
rendererTrackSelections
=
new
TrackSelection
[
rendererCount
];
TrackSelection
[]
rendererTrackSelections
=
new
TrackSelection
[
rendererCount
];
boolean
seenVideoRendererWithMappedTracks
=
false
;
boolean
seenVideoRendererWithMappedTracks
=
false
;
boolean
selectedVideoTracks
=
false
;
boolean
selectedVideoTracks
=
false
;
...
@@ -1792,8 +1791,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
...
@@ -1792,8 +1791,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
private
static
void
maybeConfigureRenderersForTunneling
(
private
static
void
maybeConfigureRenderersForTunneling
(
MappedTrackInfo
mappedTrackInfo
,
MappedTrackInfo
mappedTrackInfo
,
int
[][][]
renderererFormatSupports
,
int
[][][]
renderererFormatSupports
,
@NullableType
RendererConfiguration
[]
rendererConfigurations
,
RendererConfiguration
[]
rendererConfigurations
,
@NullableType
TrackSelection
[]
trackSelections
,
TrackSelection
[]
trackSelections
,
int
tunnelingAudioSessionId
)
{
int
tunnelingAudioSessionId
)
{
if
(
tunnelingAudioSessionId
==
C
.
AUDIO_SESSION_ID_UNSET
)
{
if
(
tunnelingAudioSessionId
==
C
.
AUDIO_SESSION_ID_UNSET
)
{
return
;
return
;
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java
View file @
a877bbaf
...
@@ -29,7 +29,6 @@ import com.google.android.exoplayer2.util.Util;
...
@@ -29,7 +29,6 @@ import com.google.android.exoplayer2.util.Util;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.RetentionPolicy
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
org.checkerframework.checker.nullness.compatqual.NullableType
;
/**
/**
* Base class for {@link TrackSelector}s that first establish a mapping between {@link TrackGroup}s
* Base class for {@link TrackSelector}s that first establish a mapping between {@link TrackGroup}s
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java
View file @
a877bbaf
...
@@ -17,7 +17,6 @@ package com.google.android.exoplayer2.trackselection;
...
@@ -17,7 +17,6 @@ package com.google.android.exoplayer2.trackselection;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
org.checkerframework.checker.nullness.compatqual.NullableType
;
/** An array of {@link TrackSelection}s. */
/** An array of {@link TrackSelection}s. */
public
final
class
TrackSelectionArray
{
public
final
class
TrackSelectionArray
{
...
@@ -25,13 +24,13 @@ public final class TrackSelectionArray {
...
@@ -25,13 +24,13 @@ public final class TrackSelectionArray {
/** The length of this array. */
/** The length of this array. */
public
final
int
length
;
public
final
int
length
;
private
final
@NullableType
TrackSelection
[]
trackSelections
;
private
final
TrackSelection
[]
trackSelections
;
// Lazily initialized hashcode.
// Lazily initialized hashcode.
private
int
hashCode
;
private
int
hashCode
;
/** @param trackSelections The selections. Must not be null, but may contain null elements. */
/** @param trackSelections The selections. Must not be null, but may contain null elements. */
public
TrackSelectionArray
(
@NullableType
TrackSelection
...
trackSelections
)
{
public
TrackSelectionArray
(
TrackSelection
...
trackSelections
)
{
this
.
trackSelections
=
trackSelections
;
this
.
trackSelections
=
trackSelections
;
this
.
length
=
trackSelections
.
length
;
this
.
length
=
trackSelections
.
length
;
}
}
...
@@ -47,7 +46,7 @@ public final class TrackSelectionArray {
...
@@ -47,7 +46,7 @@ public final class TrackSelectionArray {
}
}
/** Returns the selections in a newly allocated array. */
/** Returns the selections in a newly allocated array. */
public
@NullableType
TrackSelection
[]
getAll
()
{
public
TrackSelection
[]
getAll
()
{
return
trackSelections
.
clone
();
return
trackSelections
.
clone
();
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java
View file @
a877bbaf
...
@@ -17,7 +17,6 @@ package com.google.android.exoplayer2.trackselection;
...
@@ -17,7 +17,6 @@ package com.google.android.exoplayer2.trackselection;
import
com.google.android.exoplayer2.RendererConfiguration
;
import
com.google.android.exoplayer2.RendererConfiguration
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
org.checkerframework.checker.nullness.compatqual.NullableType
;
/**
/**
* The result of a {@link TrackSelector} operation.
* The result of a {@link TrackSelector} operation.
...
@@ -30,7 +29,7 @@ public final class TrackSelectorResult {
...
@@ -30,7 +29,7 @@ public final class TrackSelectorResult {
* A {@link RendererConfiguration} for each renderer. A null entry indicates the corresponding
* A {@link RendererConfiguration} for each renderer. A null entry indicates the corresponding
* renderer should be disabled.
* renderer should be disabled.
*/
*/
public
final
@NullableType
RendererConfiguration
[]
rendererConfigurations
;
public
final
RendererConfiguration
[]
rendererConfigurations
;
/**
/**
* A {@link TrackSelectionArray} containing the track selection for each renderer.
* A {@link TrackSelectionArray} containing the track selection for each renderer.
*/
*/
...
@@ -49,8 +48,8 @@ public final class TrackSelectorResult {
...
@@ -49,8 +48,8 @@ public final class TrackSelectorResult {
* TrackSelector#onSelectionActivated(Object)} should the selection be activated.
* TrackSelector#onSelectionActivated(Object)} should the selection be activated.
*/
*/
public
TrackSelectorResult
(
public
TrackSelectorResult
(
@NullableType
RendererConfiguration
[]
rendererConfigurations
,
RendererConfiguration
[]
rendererConfigurations
,
@NullableType
TrackSelection
[]
selections
,
TrackSelection
[]
selections
,
Object
info
)
{
Object
info
)
{
this
.
rendererConfigurations
=
rendererConfigurations
;
this
.
rendererConfigurations
=
rendererConfigurations
;
this
.
selections
=
new
TrackSelectionArray
(
selections
);
this
.
selections
=
new
TrackSelectionArray
(
selections
);
...
...
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