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
ac782235
authored
Oct 06, 2020
by
andrewlewis
Committed by
tonihei
Oct 06, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix miscellaneous nits/typos
PiperOrigin-RevId: 335642909
parent
008c8081
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
22 additions
and
22 deletions
demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/DefaultMediaItemConverter.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/MediaItemConverter.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java
library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodQueue.java
library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java
library/core/src/test/java/com/google/android/exoplayer2/trackselection/TrackSelectorTest.java
library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultBandwidthMeterTest.java
library/core/src/test/java/com/google/android/exoplayer2/video/MediaCodecVideoRendererTest.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleView.java
demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java
View file @
ac782235
...
@@ -102,7 +102,7 @@ public class PlayerActivity extends AppCompatActivity
...
@@ -102,7 +102,7 @@ public class PlayerActivity extends AppCompatActivity
private
int
startWindow
;
private
int
startWindow
;
private
long
startPosition
;
private
long
startPosition
;
// Fields used only for ad playback.
The ads loader is loaded via reflection.
// Fields used only for ad playback.
private
AdsLoader
adsLoader
;
private
AdsLoader
adsLoader
;
private
Uri
loadedAdTagUri
;
private
Uri
loadedAdTagUri
;
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/DefaultMediaItemConverter.java
View file @
ac782235
...
@@ -45,7 +45,7 @@ public class DefaultMediaItemConverter implements MediaItemConverter {
...
@@ -45,7 +45,7 @@ public class DefaultMediaItemConverter implements MediaItemConverter {
if
(
media2MediaItem
instanceof
CallbackMediaItem
)
{
if
(
media2MediaItem
instanceof
CallbackMediaItem
)
{
throw
new
IllegalStateException
(
"CallbackMediaItem isn't supported"
);
throw
new
IllegalStateException
(
"CallbackMediaItem isn't supported"
);
}
}
@Nullable
Uri
uri
=
null
;
@Nullable
Uri
uri
=
null
;
@Nullable
String
mediaId
=
null
;
@Nullable
String
mediaId
=
null
;
@Nullable
String
title
=
null
;
@Nullable
String
title
=
null
;
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/MediaItemConverter.java
View file @
ac782235
...
@@ -23,13 +23,13 @@ import com.google.android.exoplayer2.MediaItem;
...
@@ -23,13 +23,13 @@ import com.google.android.exoplayer2.MediaItem;
*/
*/
public
interface
MediaItemConverter
{
public
interface
MediaItemConverter
{
/**
/**
* Converts a
n
{@link androidx.media2.common.MediaItem Media2 MediaItem} to an {@link MediaItem
* Converts a {@link androidx.media2.common.MediaItem Media2 MediaItem} to an {@link MediaItem
* ExoPlayer MediaItem}.
* ExoPlayer MediaItem}.
*/
*/
MediaItem
convertToExoPlayerMediaItem
(
androidx
.
media2
.
common
.
MediaItem
media2MediaItem
);
MediaItem
convertToExoPlayerMediaItem
(
androidx
.
media2
.
common
.
MediaItem
media2MediaItem
);
/**
/**
* Converts an {@link MediaItem ExoPlayer MediaItem} to a
n
{@link androidx.media2.common.MediaItem
* Converts an {@link MediaItem ExoPlayer MediaItem} to a {@link androidx.media2.common.MediaItem
* Media2 MediaItem}.
* Media2 MediaItem}.
*/
*/
androidx
.
media2
.
common
.
MediaItem
convertToMedia2MediaItem
(
MediaItem
exoPlayerMediaItem
);
androidx
.
media2
.
common
.
MediaItem
convertToMedia2MediaItem
(
MediaItem
exoPlayerMediaItem
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java
View file @
ac782235
...
@@ -157,7 +157,7 @@ import java.util.concurrent.TimeoutException;
...
@@ -157,7 +157,7 @@ import java.util.concurrent.TimeoutException;
new
TrackSelectorResult
(
new
TrackSelectorResult
(
new
RendererConfiguration
[
renderers
.
length
],
new
RendererConfiguration
[
renderers
.
length
],
new
TrackSelection
[
renderers
.
length
],
new
TrackSelection
[
renderers
.
length
],
null
);
/* info= */
null
);
period
=
new
Timeline
.
Period
();
period
=
new
Timeline
.
Period
();
maskingWindowIndex
=
C
.
INDEX_UNSET
;
maskingWindowIndex
=
C
.
INDEX_UNSET
;
playbackInfoUpdateHandler
=
new
Handler
(
applicationLooper
);
playbackInfoUpdateHandler
=
new
Handler
(
applicationLooper
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodQueue.java
View file @
ac782235
...
@@ -315,8 +315,8 @@ import com.google.common.collect.ImmutableList;
...
@@ -315,8 +315,8 @@ import com.google.common.collect.ImmutableList;
public
boolean
updateQueuedPeriods
(
public
boolean
updateQueuedPeriods
(
Timeline
timeline
,
long
rendererPositionUs
,
long
maxRendererReadPositionUs
)
{
Timeline
timeline
,
long
rendererPositionUs
,
long
maxRendererReadPositionUs
)
{
// TODO: Merge this into setTimeline so that the queue gets updated as soon as the new timeline
// TODO: Merge this into setTimeline so that the queue gets updated as soon as the new timeline
// is set, once all cases handled by ExoPlayerImplInternal.handle
SourceInfoRefreshed can be
// is set, once all cases handled by ExoPlayerImplInternal.handle
MediaSourceListInfoRefreshed
// handled here.
//
can be
handled here.
MediaPeriodHolder
previousPeriodHolder
=
null
;
MediaPeriodHolder
previousPeriodHolder
=
null
;
MediaPeriodHolder
periodHolder
=
playing
;
MediaPeriodHolder
periodHolder
=
playing
;
while
(
periodHolder
!=
null
)
{
while
(
periodHolder
!=
null
)
{
...
@@ -326,8 +326,8 @@ import com.google.common.collect.ImmutableList;
...
@@ -326,8 +326,8 @@ import com.google.common.collect.ImmutableList;
MediaPeriodInfo
newPeriodInfo
;
MediaPeriodInfo
newPeriodInfo
;
if
(
previousPeriodHolder
==
null
)
{
if
(
previousPeriodHolder
==
null
)
{
// The id and start position of the first period have already been verified by
// The id and start position of the first period have already been verified by
// ExoPlayerImplInternal.handle
SourceInfoRefreshed. Just update duration, isLastInTimeline
// ExoPlayerImplInternal.handle
MediaSourceListInfoRefreshed. Just update duration,
// and isLastInPeriod flags.
//
isLastInTimeline
and isLastInPeriod flags.
newPeriodInfo
=
getUpdatedMediaPeriodInfo
(
timeline
,
oldPeriodInfo
);
newPeriodInfo
=
getUpdatedMediaPeriodInfo
(
timeline
,
oldPeriodInfo
);
}
else
{
}
else
{
newPeriodInfo
=
newPeriodInfo
=
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java
View file @
ac782235
...
@@ -340,7 +340,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
...
@@ -340,7 +340,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
/* manifest= */
null
,
/* manifest= */
null
,
mediaItem
);
mediaItem
);
if
(
timelineIsPlaceholder
)
{
if
(
timelineIsPlaceholder
)
{
// TODO: Actually prepare the extractors during prepa
t
ation so that we don't need a
// TODO: Actually prepare the extractors during prepa
r
ation so that we don't need a
// placeholder. See https://github.com/google/ExoPlayer/issues/4727.
// placeholder. See https://github.com/google/ExoPlayer/issues/4727.
timeline
=
timeline
=
new
ForwardingTimeline
(
timeline
)
{
new
ForwardingTimeline
(
timeline
)
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java
View file @
ac782235
...
@@ -339,14 +339,15 @@ public abstract class MappingTrackSelector extends TrackSelector {
...
@@ -339,14 +339,15 @@ public abstract class MappingTrackSelector extends TrackSelector {
* Returns the mapping information for the currently active track selection, or null if no
* Returns the mapping information for the currently active track selection, or null if no
* selection is currently active.
* selection is currently active.
*/
*/
public
final
@Nullable
MappedTrackInfo
getCurrentMappedTrackInfo
()
{
@Nullable
public
final
MappedTrackInfo
getCurrentMappedTrackInfo
()
{
return
currentMappedTrackInfo
;
return
currentMappedTrackInfo
;
}
}
// TrackSelector implementation.
// TrackSelector implementation.
@Override
@Override
public
final
void
onSelectionActivated
(
Object
info
)
{
public
final
void
onSelectionActivated
(
@Nullable
Object
info
)
{
currentMappedTrackInfo
=
(
MappedTrackInfo
)
info
;
currentMappedTrackInfo
=
(
MappedTrackInfo
)
info
;
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java
View file @
ac782235
...
@@ -137,7 +137,7 @@ public abstract class TrackSelector {
...
@@ -137,7 +137,7 @@ public abstract class TrackSelector {
*
*
* @param info The value of {@link TrackSelectorResult#info} in the activated selection.
* @param info The value of {@link TrackSelectorResult#info} in the activated selection.
*/
*/
public
abstract
void
onSelectionActivated
(
Object
info
);
public
abstract
void
onSelectionActivated
(
@Nullable
Object
info
);
/**
/**
* Calls {@link InvalidationListener#onTrackSelectionsInvalidated()} to invalidate all previously
* Calls {@link InvalidationListener#onTrackSelectionsInvalidated()} to invalidate all previously
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java
View file @
ac782235
...
@@ -40,19 +40,20 @@ public final class TrackSelectorResult {
...
@@ -40,19 +40,20 @@ public final class TrackSelectorResult {
* An opaque object that will be returned to {@link TrackSelector#onSelectionActivated(Object)}
* An opaque object that will be returned to {@link TrackSelector#onSelectionActivated(Object)}
* should the selections be activated.
* should the selections be activated.
*/
*/
public
final
Object
info
;
@Nullable
public
final
Object
info
;
/**
/**
* @param rendererConfigurations A {@link RendererConfiguration} for each renderer. A null entry
* @param rendererConfigurations A {@link RendererConfiguration} for each renderer. A null entry
* indicates the corresponding renderer should be disabled.
* indicates the corresponding renderer should be disabled.
* @param selections A {@link TrackSelectionArray} containing the selection for each renderer.
* @param selections A {@link TrackSelectionArray} containing the selection for each renderer.
* @param info An opaque object that will be returned to {@link
* @param info An opaque object that will be returned to {@link
* TrackSelector#onSelectionActivated(Object)} should the selection be activated.
* TrackSelector#onSelectionActivated(Object)} should the selection be activated. May be
* {@code null}.
*/
*/
public
TrackSelectorResult
(
public
TrackSelectorResult
(
@NullableType
RendererConfiguration
[]
rendererConfigurations
,
@NullableType
RendererConfiguration
[]
rendererConfigurations
,
@NullableType
TrackSelection
[]
selections
,
@NullableType
TrackSelection
[]
selections
,
Object
info
)
{
@Nullable
Object
info
)
{
this
.
rendererConfigurations
=
rendererConfigurations
;
this
.
rendererConfigurations
=
rendererConfigurations
;
this
.
selections
=
new
TrackSelectionArray
(
selections
);
this
.
selections
=
new
TrackSelectionArray
(
selections
);
this
.
info
=
info
;
this
.
info
=
info
;
...
...
library/core/src/test/java/com/google/android/exoplayer2/trackselection/TrackSelectorTest.java
View file @
ac782235
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.trackselection;
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.trackselection;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
junit
.
Assert
.
fail
;
import
androidx.annotation.Nullable
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.RendererCapabilities
;
import
com.google.android.exoplayer2.RendererCapabilities
;
...
@@ -52,7 +53,7 @@ public class TrackSelectorTest {
...
@@ -52,7 +53,7 @@ public class TrackSelectorTest {
}
}
@Override
@Override
public
void
onSelectionActivated
(
Object
info
)
{}
public
void
onSelectionActivated
(
@Nullable
Object
info
)
{}
};
};
}
}
...
...
library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultBandwidthMeterTest.java
View file @
ac782235
...
@@ -107,7 +107,7 @@ public final class DefaultBandwidthMeterTest {
...
@@ -107,7 +107,7 @@ public final class DefaultBandwidthMeterTest {
/* isAvailable= */
true
,
/* isAvailable= */
true
,
CONNECTED
);
CONNECTED
);
}
}
@Test
@Test
public
void
defaultInitialBitrateEstimate_forWifi_isGreaterThanEstimateFor2G
()
{
public
void
defaultInitialBitrateEstimate_forWifi_isGreaterThanEstimateFor2G
()
{
setActiveNetworkInfo
(
networkInfoWifi
);
setActiveNetworkInfo
(
networkInfoWifi
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/video/MediaCodecVideoRendererTest.java
View file @
ac782235
...
@@ -46,7 +46,6 @@ import com.google.android.exoplayer2.drm.DrmSessionEventListener;
...
@@ -46,7 +46,6 @@ import com.google.android.exoplayer2.drm.DrmSessionEventListener;
import
com.google.android.exoplayer2.drm.DrmSessionManager
;
import
com.google.android.exoplayer2.drm.DrmSessionManager
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecInfo
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecInfo
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecSelector
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecSelector
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException
;
import
com.google.android.exoplayer2.testutil.FakeSampleStream
;
import
com.google.android.exoplayer2.testutil.FakeSampleStream
;
import
com.google.android.exoplayer2.testutil.FakeSampleStream.FakeSampleStreamItem
;
import
com.google.android.exoplayer2.testutil.FakeSampleStream.FakeSampleStreamItem
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
...
@@ -107,8 +106,7 @@ public class MediaCodecVideoRendererTest {
...
@@ -107,8 +106,7 @@ public class MediaCodecVideoRendererTest {
/* maxDroppedFramesToNotify= */
1
)
{
/* maxDroppedFramesToNotify= */
1
)
{
@Override
@Override
@Capabilities
@Capabilities
protected
int
supportsFormat
(
MediaCodecSelector
mediaCodecSelector
,
Format
format
)
protected
int
supportsFormat
(
MediaCodecSelector
mediaCodecSelector
,
Format
format
)
{
throws
DecoderQueryException
{
return
RendererCapabilities
.
create
(
FORMAT_HANDLED
);
return
RendererCapabilities
.
create
(
FORMAT_HANDLED
);
}
}
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleView.java
View file @
ac782235
...
@@ -414,5 +414,4 @@ public final class SubtitleView extends FrameLayout implements TextOutput {
...
@@ -414,5 +414,4 @@ public final class SubtitleView extends FrameLayout implements TextOutput {
return
cue
;
return
cue
;
}
}
}
}
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