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
47919008
authored
Jan 22, 2021
by
olly
Committed by
kim-vde
Jan 22, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move Player.getTrackSelector to ExoPlayer
PiperOrigin-RevId: 353212567
parent
ba803a2e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
44 deletions
RELEASENOTES.md
extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java
library/common/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorInterface.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java
library/core/src/main/java/com/google/android/exoplayer2/Player.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
RELEASENOTES.md
View file @
47919008
...
...
@@ -151,6 +151,7 @@
*
Add support for playing JPEG motion photos
(
[
#5405
](
https://github.com/google/ExoPlayer/issues/5405
)
).
*
Track selection:
*
Moved
`Player.getTrackSelector`
to the
`ExoPlayer`
interface.
*
Allow parallel adaptation for video and audio
(
[
#5111
](
https://github.com/google/ExoPlayer/issues/5111
)
).
*
Simplified enabling tunneling with
`DefaultTrackSelector`
.
...
...
extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java
View file @
47919008
...
...
@@ -33,7 +33,6 @@ import com.google.android.exoplayer2.source.TrackGroupArray;
import
com.google.android.exoplayer2.trackselection.FixedTrackSelection
;
import
com.google.android.exoplayer2.trackselection.TrackSelection
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.trackselection.TrackSelector
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Clock
;
import
com.google.android.exoplayer2.util.ListenerSet
;
...
...
@@ -507,12 +506,6 @@ public final class CastPlayer extends BasePlayer {
}
@Override
@Nullable
public
TrackSelector
getTrackSelector
()
{
return
null
;
}
@Override
public
void
setRepeatMode
(
@RepeatMode
int
repeatMode
)
{
if
(
remoteMediaClient
==
null
)
{
return
;
...
...
library/common/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorInterface.java
deleted
100644 → 0
View file @
ba803a2e
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
trackselection
;
// TODO(b/172315872) Replace @code by @link when Player has been migrated to common
/**
* The component of a {@code Player} responsible for selecting tracks to be played.
*
* <p>No Player agnostic track selection is currently supported. Clients should downcast to the
* implementation's track selection.
*/
// TODO(b/172315872) Define an interface for track selection.
public
interface
TrackSelectorInterface
{}
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java
View file @
47919008
...
...
@@ -449,7 +449,9 @@ public interface ExoPlayer extends Player {
}
}
@Override
/**
* Returns the track selector that this player uses, or null if track selection is not supported.
*/
@Nullable
TrackSelector
getTrackSelector
();
...
...
library/core/src/main/java/com/google/android/exoplayer2/Player.java
View file @
47919008
...
...
@@ -34,7 +34,6 @@ import com.google.android.exoplayer2.source.TrackGroupArray;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.text.TextOutput
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.trackselection.TrackSelectorInterface
;
import
com.google.android.exoplayer2.util.MutableFlags
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.video.VideoFrameMetadataListener
;
...
...
@@ -1380,12 +1379,6 @@ public interface Player {
*/
int
getRendererType
(
int
index
);
/**
* Returns the track selector that this player uses, or null if track selection is not supported.
*/
@Nullable
TrackSelectorInterface
getTrackSelector
();
/** Returns the available track groups. */
TrackGroupArray
getCurrentTrackGroups
();
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java
View file @
47919008
...
...
@@ -83,7 +83,7 @@ import com.google.android.exoplayer2.util.Assertions;
* thread. The track selector may call {@link InvalidationListener#onTrackSelectionsInvalidated()}
* from any thread.
*/
public
abstract
class
TrackSelector
implements
TrackSelectorInterface
{
public
abstract
class
TrackSelector
{
/**
* Notified when selections previously made by a {@link TrackSelector} are no longer valid.
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
View file @
47919008
...
...
@@ -51,6 +51,7 @@ import androidx.recyclerview.widget.RecyclerView;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.DefaultControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlayer
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.PlaybackPreparer
;
...
...
@@ -66,6 +67,7 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector.Selecti
import
com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo
;
import
com.google.android.exoplayer2.trackselection.TrackSelection
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.trackselection.TrackSelector
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.RepeatModeUtil
;
import
com.google.android.exoplayer2.util.Util
;
...
...
@@ -759,8 +761,11 @@ public class StyledPlayerControlView extends FrameLayout {
if
(
player
!=
null
)
{
player
.
addListener
(
componentListener
);
}
if
(
player
!=
null
&&
player
.
getTrackSelector
()
instanceof
DefaultTrackSelector
)
{
this
.
trackSelector
=
(
DefaultTrackSelector
)
player
.
getTrackSelector
();
if
(
player
instanceof
ExoPlayer
)
{
TrackSelector
trackSelector
=
((
ExoPlayer
)
player
).
getTrackSelector
();
if
(
trackSelector
instanceof
DefaultTrackSelector
)
{
this
.
trackSelector
=
(
DefaultTrackSelector
)
trackSelector
;
}
}
else
{
this
.
trackSelector
=
null
;
}
...
...
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