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
733e71b4
authored
Jun 17, 2020
by
bachinger
Committed by
Oliver Woodman
Jun 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove overloaded set method
PiperOrigin-RevId: 316900193
parent
b6f5a263
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
124 deletions
extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastTimeline.java
library/core/src/main/java/com/google/android/exoplayer2/Timeline.java
library/core/src/main/java/com/google/android/exoplayer2/source/SinglePeriodTimeline.java
library/core/src/test/java/com/google/android/exoplayer2/TimelineTest.java
extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastTimeline.java
View file @
733e71b4
...
...
@@ -15,10 +15,12 @@
*/
package
com
.
google
.
android
.
exoplayer2
.
ext
.
cast
;
import
android.net.Uri
;
import
android.util.SparseArray
;
import
android.util.SparseIntArray
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Timeline
;
import
java.util.Arrays
;
...
...
@@ -126,7 +128,7 @@ import java.util.Arrays;
boolean
isDynamic
=
durationUs
==
C
.
TIME_UNSET
;
return
window
.
set
(
/* uid= */
ids
[
windowIndex
],
/*
tag= */
ids
[
windowIndex
]
,
/*
mediaItem= */
new
MediaItem
.
Builder
().
setUri
(
Uri
.
EMPTY
).
setTag
(
ids
[
windowIndex
]).
build
()
,
/* manifest= */
null
,
/* presentationStartTimeMs= */
C
.
TIME_UNSET
,
/* windowStartTimeMs= */
C
.
TIME_UNSET
,
...
...
library/core/src/main/java/com/google/android/exoplayer2/Timeline.java
View file @
733e71b4
...
...
@@ -225,44 +225,6 @@ public abstract class Timeline {
mediaItem
=
DUMMY_MEDIA_ITEM
;
}
/**
* @deprecated Use {@link #set(Object, MediaItem, Object, long, long, long, boolean, boolean,
* boolean, long, long, int, int, long)} instead.
*/
@Deprecated
public
Window
set
(
Object
uid
,
@Nullable
Object
tag
,
@Nullable
Object
manifest
,
long
presentationStartTimeMs
,
long
windowStartTimeMs
,
long
elapsedRealtimeEpochOffsetMs
,
boolean
isSeekable
,
boolean
isDynamic
,
boolean
isLive
,
long
defaultPositionUs
,
long
durationUs
,
int
firstPeriodIndex
,
int
lastPeriodIndex
,
long
positionInFirstPeriodUs
)
{
set
(
uid
,
DUMMY_MEDIA_ITEM
.
buildUpon
().
setTag
(
tag
).
build
(),
manifest
,
presentationStartTimeMs
,
windowStartTimeMs
,
elapsedRealtimeEpochOffsetMs
,
isSeekable
,
isDynamic
,
isLive
,
defaultPositionUs
,
durationUs
,
firstPeriodIndex
,
lastPeriodIndex
,
positionInFirstPeriodUs
);
return
this
;
}
/** Sets the data held by this window. */
@SuppressWarnings
(
"deprecation"
)
public
Window
set
(
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/SinglePeriodTimeline.java
View file @
733e71b4
...
...
@@ -46,7 +46,6 @@ public final class SinglePeriodTimeline extends Timeline {
private
final
boolean
isSeekable
;
private
final
boolean
isDynamic
;
private
final
boolean
isLive
;
@Nullable
private
final
Object
tag
;
@Nullable
private
final
Object
manifest
;
@Nullable
private
final
MediaItem
mediaItem
;
...
...
@@ -208,8 +207,7 @@ public final class SinglePeriodTimeline extends Timeline {
isDynamic
,
isLive
,
manifest
,
MEDIA_ITEM
.
buildUpon
().
setTag
(
tag
).
build
(),
tag
);
MEDIA_ITEM
.
buildUpon
().
setTag
(
tag
).
build
());
}
/**
...
...
@@ -248,36 +246,6 @@ public final class SinglePeriodTimeline extends Timeline {
boolean
isLive
,
@Nullable
Object
manifest
,
MediaItem
mediaItem
)
{
this
(
presentationStartTimeMs
,
windowStartTimeMs
,
elapsedRealtimeEpochOffsetMs
,
periodDurationUs
,
windowDurationUs
,
windowPositionInPeriodUs
,
windowDefaultStartPositionUs
,
isSeekable
,
isDynamic
,
isLive
,
manifest
,
mediaItem
,
/* tag= */
null
);
}
private
SinglePeriodTimeline
(
long
presentationStartTimeMs
,
long
windowStartTimeMs
,
long
elapsedRealtimeEpochOffsetMs
,
long
periodDurationUs
,
long
windowDurationUs
,
long
windowPositionInPeriodUs
,
long
windowDefaultStartPositionUs
,
boolean
isSeekable
,
boolean
isDynamic
,
boolean
isLive
,
@Nullable
Object
manifest
,
MediaItem
mediaItem
,
@Nullable
Object
tag
)
{
this
.
presentationStartTimeMs
=
presentationStartTimeMs
;
this
.
windowStartTimeMs
=
windowStartTimeMs
;
this
.
elapsedRealtimeEpochOffsetMs
=
elapsedRealtimeEpochOffsetMs
;
...
...
@@ -290,7 +258,6 @@ public final class SinglePeriodTimeline extends Timeline {
this
.
isLive
=
isLive
;
this
.
manifest
=
manifest
;
this
.
mediaItem
=
checkNotNull
(
mediaItem
);
this
.
tag
=
tag
;
}
@Override
...
...
@@ -316,24 +283,6 @@ public final class SinglePeriodTimeline extends Timeline {
}
}
}
if
(
tag
!=
null
)
{
// Support deprecated constructors.
return
window
.
set
(
Window
.
SINGLE_WINDOW_UID
,
tag
,
manifest
,
presentationStartTimeMs
,
windowStartTimeMs
,
elapsedRealtimeEpochOffsetMs
,
isSeekable
,
isDynamic
,
isLive
,
windowDefaultStartPositionUs
,
windowDurationUs
,
/* firstPeriodIndex= */
0
,
/* lastPeriodIndex= */
0
,
windowPositionInPeriodUs
);
}
return
window
.
set
(
Window
.
SINGLE_WINDOW_UID
,
mediaItem
,
...
...
library/core/src/test/java/com/google/android/exoplayer2/TimelineTest.java
View file @
733e71b4
...
...
@@ -17,7 +17,6 @@ package com.google.android.exoplayer2;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
android.net.Uri
;
import
androidx.annotation.Nullable
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.testutil.FakeTimeline
;
...
...
@@ -141,38 +140,6 @@ public class TimelineTest {
assertThat
(
window
).
isEqualTo
(
otherWindow
);
}
@SuppressWarnings
(
"deprecation"
)
@Test
public
void
windowSet_withTag
()
{
Object
tag
=
new
Object
();
Timeline
.
Window
window
=
populateWindow
(
new
MediaItem
.
Builder
()
.
setMediaId
(
"com.google.android.exoplayer2.Timeline"
)
.
setUri
(
Uri
.
EMPTY
)
.
setTag
(
tag
)
.
build
(),
tag
);
Timeline
.
Window
otherWindow
=
new
Timeline
.
Window
();
otherWindow
=
otherWindow
.
set
(
window
.
uid
,
window
.
tag
,
window
.
manifest
,
window
.
presentationStartTimeMs
,
window
.
windowStartTimeMs
,
window
.
elapsedRealtimeEpochOffsetMs
,
window
.
isSeekable
,
window
.
isDynamic
,
window
.
isLive
,
window
.
defaultPositionUs
,
window
.
durationUs
,
window
.
firstPeriodIndex
,
window
.
lastPeriodIndex
,
window
.
positionInFirstPeriodUs
);
assertThat
(
window
).
isEqualTo
(
otherWindow
);
}
@Test
public
void
windowHashCode
()
{
Timeline
.
Window
window
=
new
Timeline
.
Window
();
...
...
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