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
22159673
authored
Mar 10, 2022
by
olly
Committed by
Oliver Woodman
Mar 15, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move TrackSelection back to ExoPlayer module
PiperOrigin-RevId: 433729648
parent
018d1770
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
16 deletions
extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/FakeExoPlayer.java
library/common/src/main/java/com/google/android/exoplayer2/Player.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/AdaptiveTrackSelection.java
library/common/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java → library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java
library/common/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java → library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java
extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/FakeExoPlayer.java
View file @
22159673
...
@@ -79,7 +79,7 @@ import com.google.android.exoplayer2.util.Util;
...
@@ -79,7 +79,7 @@ import com.google.android.exoplayer2.util.Util;
PositionInfo
oldPosition
=
PositionInfo
oldPosition
=
new
PositionInfo
(
new
PositionInfo
(
windowUid
,
windowUid
,
/*
window
Index= */
0
,
/*
mediaItem
Index= */
0
,
mediaItem
,
mediaItem
,
periodUid
,
periodUid
,
/* periodIndex= */
0
,
/* periodIndex= */
0
,
...
@@ -97,7 +97,7 @@ import com.google.android.exoplayer2.util.Util;
...
@@ -97,7 +97,7 @@ import com.google.android.exoplayer2.util.Util;
PositionInfo
newPosition
=
PositionInfo
newPosition
=
new
PositionInfo
(
new
PositionInfo
(
windowUid
,
windowUid
,
/*
window
Index= */
0
,
/*
mediaItem
Index= */
0
,
mediaItem
,
mediaItem
,
periodUid
,
periodUid
,
/* periodIndex= */
0
,
/* periodIndex= */
0
,
...
@@ -128,7 +128,7 @@ import com.google.android.exoplayer2.util.Util;
...
@@ -128,7 +128,7 @@ import com.google.android.exoplayer2.util.Util;
PositionInfo
oldPosition
=
PositionInfo
oldPosition
=
new
PositionInfo
(
new
PositionInfo
(
windowUid
,
windowUid
,
/*
window
Index= */
0
,
/*
mediaItem
Index= */
0
,
mediaItem
,
mediaItem
,
periodUid
,
periodUid
,
/* periodIndex= */
0
,
/* periodIndex= */
0
,
...
@@ -146,7 +146,7 @@ import com.google.android.exoplayer2.util.Util;
...
@@ -146,7 +146,7 @@ import com.google.android.exoplayer2.util.Util;
PositionInfo
newPosition
=
PositionInfo
newPosition
=
new
PositionInfo
(
new
PositionInfo
(
windowUid
,
windowUid
,
/*
window
Index= */
0
,
/*
mediaItem
Index= */
0
,
mediaItem
,
mediaItem
,
periodUid
,
periodUid
,
/* periodIndex= */
0
,
/* periodIndex= */
0
,
...
...
library/common/src/main/java/com/google/android/exoplayer2/Player.java
View file @
22159673
...
@@ -34,7 +34,6 @@ import androidx.annotation.Nullable;
...
@@ -34,7 +34,6 @@ import androidx.annotation.Nullable;
import
com.google.android.exoplayer2.audio.AudioAttributes
;
import
com.google.android.exoplayer2.audio.AudioAttributes
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.trackselection.TrackSelection
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionParameters
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionParameters
;
import
com.google.android.exoplayer2.util.BundleableUtil
;
import
com.google.android.exoplayer2.util.BundleableUtil
;
import
com.google.android.exoplayer2.util.FlagSet
;
import
com.google.android.exoplayer2.util.FlagSet
;
...
@@ -681,11 +680,12 @@ public interface Player {
...
@@ -681,11 +680,12 @@ public interface Player {
/**
/**
* Called when the combined {@link MediaMetadata} changes.
* Called when the combined {@link MediaMetadata} changes.
*
*
* <p>The provided {@link MediaMetadata} is a combination of the {@link MediaItem#mediaMetadata}
* <p>The provided {@link MediaMetadata} is a combination of the {@link MediaItem#mediaMetadata
* and the static and dynamic metadata from the {@link TrackSelection#getFormat(int) track
* MediaItem metadata}, the static metadata in the media's {@link Format#metadata Format}, and
* selections' formats} and {@link Listener#onMetadata(Metadata)}. If a field is populated in
* any timed metadata that has been parsed from the media and output via {@link
* the {@link MediaItem#mediaMetadata}, it will be prioritised above the same field coming from
* Listener#onMetadata(Metadata)}. If a field is populated in the {@link
* static or dynamic metadata.
* MediaItem#mediaMetadata}, it will be prioritised above the same field coming from static or
* timed metadata.
*
*
* <p>This method may be called multiple times in quick succession.
* <p>This method may be called multiple times in quick succession.
*
*
...
@@ -2105,11 +2105,11 @@ public interface Player {
...
@@ -2105,11 +2105,11 @@ public interface Player {
* Returns the current combined {@link MediaMetadata}, or {@link MediaMetadata#EMPTY} if not
* Returns the current combined {@link MediaMetadata}, or {@link MediaMetadata#EMPTY} if not
* supported.
* supported.
*
*
* <p>This {@link MediaMetadata} is a combination of the {@link MediaItem#mediaMetadata
} and the
* <p>This {@link MediaMetadata} is a combination of the {@link MediaItem#mediaMetadata
MediaItem
*
static and dynamic metadata from the {@link TrackSelection#getFormat(int) track selections'
*
metadata}, the static metadata in the media's {@link Format#metadata Format}, and any timed
*
formats} and {@link Listener#onMetadata(Metadata)}. If a field is populated in the
{@link
*
metadata that has been parsed from the media and output via
{@link
*
MediaItem#mediaMetadata}, it will be prioritised above the same field coming from static or
*
Listener#onMetadata(Metadata)}. If a field is populated in the {@link MediaItem#mediaMetadata},
*
dynamic
metadata.
*
it will be prioritised above the same field coming from static or timed
metadata.
*/
*/
MediaMetadata
getMediaMetadata
();
MediaMetadata
getMediaMetadata
();
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/AdaptiveTrackSelection.java
View file @
22159673
...
@@ -778,7 +778,8 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
...
@@ -778,7 +778,8 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
}
}
double
[]
logBitrates
=
new
double
[
trackBitrates
[
i
].
length
];
double
[]
logBitrates
=
new
double
[
trackBitrates
[
i
].
length
];
for
(
int
j
=
0
;
j
<
trackBitrates
[
i
].
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
trackBitrates
[
i
].
length
;
j
++)
{
logBitrates
[
j
]
=
trackBitrates
[
i
][
j
]
==
Format
.
NO_VALUE
?
0
:
Math
.
log
(
trackBitrates
[
i
][
j
]);
logBitrates
[
j
]
=
trackBitrates
[
i
][
j
]
==
Format
.
NO_VALUE
?
0
:
Math
.
log
((
double
)
trackBitrates
[
i
][
j
]);
}
}
double
totalBitrateDiff
=
logBitrates
[
logBitrates
.
length
-
1
]
-
logBitrates
[
0
];
double
totalBitrateDiff
=
logBitrates
[
logBitrates
.
length
-
1
]
-
logBitrates
[
0
];
for
(
int
j
=
0
;
j
<
logBitrates
.
length
-
1
;
j
++)
{
for
(
int
j
=
0
;
j
<
logBitrates
.
length
-
1
;
j
++)
{
...
...
library/co
mmon
/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java
→
library/co
re
/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java
View file @
22159673
File moved
library/co
mmon
/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java
→
library/co
re
/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java
View file @
22159673
File moved
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