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
f2055396
authored
Jul 13, 2020
by
olly
Committed by
Ian Baker
Jul 13, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use lambdas where possible
PiperOrigin-RevId: 320960833
parent
29b12e2f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
22 additions
and
46 deletions
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnectorTest.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnector.java
library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java
library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
library/core/src/test/java/com/google/android/exoplayer2/audio/MediaCodecAudioRendererTest.java
library/core/src/test/java/com/google/android/exoplayer2/offline/DownloadManagerTest.java
library/core/src/test/java/com/google/android/exoplayer2/video/MediaCodecVideoRendererTest.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlViewLayoutManager.java
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnectorTest.java
View file @
f2055396
...
@@ -1146,17 +1146,16 @@ public class SessionPlayerConnectorTest {
...
@@ -1146,17 +1146,16 @@ public class SessionPlayerConnectorTest {
assertPlayerResultSuccess
(
sessionPlayerConnector
.
prepare
());
assertPlayerResultSuccess
(
sessionPlayerConnector
.
prepare
());
InstrumentationRegistry
.
getInstrumentation
()
InstrumentationRegistry
.
getInstrumentation
()
.
runOnMainSync
(
.
runOnMainSync
(
()
->
{
()
->
simpleExoPlayer
.
addListener
(
simpleExoPlayer
.
addListener
(
new
Player
.
EventListener
()
{
new
Player
.
EventListener
()
{
@Override
@Override
public
void
onPlayWhenReadyChanged
(
boolean
playWhenReady
,
int
reason
)
{
public
void
onPlayWhenReadyChanged
(
boolean
playWhenReady
,
int
reason
)
{
if
(
playWhenReady
)
{
if
(
playWhenReady
)
{
simpleExoPlayer
.
setPlayWhenReady
(
false
);
simpleExoPlayer
.
setPlayWhenReady
(
false
);
}
}
}
}
}));
});
});
assertPlayerResultSuccess
(
sessionPlayerConnector
.
play
());
assertPlayerResultSuccess
(
sessionPlayerConnector
.
play
());
assertThat
(
assertThat
(
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnector.java
View file @
f2055396
...
@@ -149,19 +149,19 @@ public final class SessionPlayerConnector extends SessionPlayer {
...
@@ -149,19 +149,19 @@ public final class SessionPlayerConnector extends SessionPlayer {
@Override
@Override
public
ListenableFuture
<
PlayerResult
>
play
()
{
public
ListenableFuture
<
PlayerResult
>
play
()
{
return
playerCommandQueue
.
addCommand
(
return
playerCommandQueue
.
addCommand
(
PlayerCommandQueue
.
COMMAND_CODE_PLAYER_PLAY
,
/* command= */
()
->
player
.
play
()
);
PlayerCommandQueue
.
COMMAND_CODE_PLAYER_PLAY
,
/* command= */
player:
:
play
);
}
}
@Override
@Override
public
ListenableFuture
<
PlayerResult
>
pause
()
{
public
ListenableFuture
<
PlayerResult
>
pause
()
{
return
playerCommandQueue
.
addCommand
(
return
playerCommandQueue
.
addCommand
(
PlayerCommandQueue
.
COMMAND_CODE_PLAYER_PAUSE
,
/* command= */
()
->
player
.
pause
()
);
PlayerCommandQueue
.
COMMAND_CODE_PLAYER_PAUSE
,
/* command= */
player:
:
pause
);
}
}
@Override
@Override
public
ListenableFuture
<
PlayerResult
>
prepare
()
{
public
ListenableFuture
<
PlayerResult
>
prepare
()
{
return
playerCommandQueue
.
addCommand
(
return
playerCommandQueue
.
addCommand
(
PlayerCommandQueue
.
COMMAND_CODE_PLAYER_PREPARE
,
/* command= */
()
->
player
.
prepare
()
);
PlayerCommandQueue
.
COMMAND_CODE_PLAYER_PREPARE
,
/* command= */
player:
:
prepare
);
}
}
@Override
@Override
...
...
library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java
View file @
f2055396
...
@@ -771,9 +771,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
...
@@ -771,9 +771,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
keepaliveSessions
.
add
(
session
);
keepaliveSessions
.
add
(
session
);
Assertions
.
checkNotNull
(
sessionReleasingHandler
)
Assertions
.
checkNotNull
(
sessionReleasingHandler
)
.
postAtTime
(
.
postAtTime
(
()
->
{
()
->
session
.
release
(
/* eventDispatcher= */
null
),
session
.
release
(
/* eventDispatcher= */
null
);
},
session
,
session
,
/* uptimeMillis= */
SystemClock
.
uptimeMillis
()
+
sessionKeepaliveMs
);
/* uptimeMillis= */
SystemClock
.
uptimeMillis
()
+
sessionKeepaliveMs
);
}
else
if
(
newReferenceCount
==
0
)
{
}
else
if
(
newReferenceCount
==
0
)
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java
View file @
f2055396
...
@@ -156,9 +156,8 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
...
@@ -156,9 +156,8 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
mediaDrm
.
setOnExpirationUpdateListener
(
mediaDrm
.
setOnExpirationUpdateListener
(
listener
==
null
listener
==
null
?
null
?
null
:
(
mediaDrm
,
sessionId
,
expirationTimeMs
)
->
{
:
(
mediaDrm
,
sessionId
,
expirationTimeMs
)
->
listener
.
onExpirationUpdate
(
FrameworkMediaDrm
.
this
,
sessionId
,
expirationTimeMs
);
listener
.
onExpirationUpdate
(
FrameworkMediaDrm
.
this
,
sessionId
,
expirationTimeMs
),
},
/* handler= */
null
);
/* handler= */
null
);
}
}
...
...
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
View file @
f2055396
...
@@ -1913,9 +1913,7 @@ public final class ExoPlayerTest {
...
@@ -1913,9 +1913,7 @@ public final class ExoPlayerTest {
.
waitForTimelineChanged
()
.
waitForTimelineChanged
()
.
pause
()
.
pause
()
.
sendMessage
(
.
sendMessage
(
(
messageType
,
payload
)
->
{
(
messageType
,
payload
)
->
counter
.
getAndIncrement
(),
counter
.
getAndIncrement
();
},
/* windowIndex= */
0
,
/* windowIndex= */
0
,
/* positionMs= */
2000
,
/* positionMs= */
2000
,
/* deleteAfterDelivery= */
false
)
/* deleteAfterDelivery= */
false
)
...
...
library/core/src/test/java/com/google/android/exoplayer2/audio/MediaCodecAudioRendererTest.java
View file @
f2055396
...
@@ -40,7 +40,6 @@ import com.google.android.exoplayer2.testutil.FakeSampleStream;
...
@@ -40,7 +40,6 @@ import com.google.android.exoplayer2.testutil.FakeSampleStream;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.ImmutableList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -78,11 +77,8 @@ public class MediaCodecAudioRendererTest {
...
@@ -78,11 +77,8 @@ public class MediaCodecAudioRendererTest {
when
(
audioSink
.
handleBuffer
(
any
(),
anyLong
(),
anyInt
())).
thenReturn
(
true
);
when
(
audioSink
.
handleBuffer
(
any
(),
anyLong
(),
anyInt
())).
thenReturn
(
true
);
mediaCodecSelector
=
mediaCodecSelector
=
new
MediaCodecSelector
()
{
(
mimeType
,
requiresSecureDecoder
,
requiresTunnelingDecoder
)
->
@Override
Collections
.
singletonList
(
public
List
<
MediaCodecInfo
>
getDecoderInfos
(
String
mimeType
,
boolean
requiresSecureDecoder
,
boolean
requiresTunnelingDecoder
)
{
return
Collections
.
singletonList
(
MediaCodecInfo
.
newInstance
(
MediaCodecInfo
.
newInstance
(
/* name= */
"name"
,
/* name= */
"name"
,
/* mimeType= */
mimeType
,
/* mimeType= */
mimeType
,
...
@@ -93,8 +89,6 @@ public class MediaCodecAudioRendererTest {
...
@@ -93,8 +89,6 @@ public class MediaCodecAudioRendererTest {
/* vendor= */
false
,
/* vendor= */
false
,
/* forceDisableAdaptive= */
false
,
/* forceDisableAdaptive= */
false
,
/* forceSecure= */
false
));
/* forceSecure= */
false
));
}
};
mediaCodecAudioRenderer
=
mediaCodecAudioRenderer
=
new
MediaCodecAudioRenderer
(
new
MediaCodecAudioRenderer
(
...
...
library/core/src/test/java/com/google/android/exoplayer2/offline/DownloadManagerTest.java
View file @
f2055396
...
@@ -711,19 +711,13 @@ public class DownloadManagerTest {
...
@@ -711,19 +711,13 @@ public class DownloadManagerTest {
private
List
<
Download
>
postGetCurrentDownloads
()
{
private
List
<
Download
>
postGetCurrentDownloads
()
{
AtomicReference
<
List
<
Download
>>
currentDownloadsReference
=
new
AtomicReference
<>();
AtomicReference
<
List
<
Download
>>
currentDownloadsReference
=
new
AtomicReference
<>();
runOnMainThread
(
runOnMainThread
(()
->
currentDownloadsReference
.
set
(
downloadManager
.
getCurrentDownloads
()));
()
->
{
currentDownloadsReference
.
set
(
downloadManager
.
getCurrentDownloads
());
});
return
currentDownloadsReference
.
get
();
return
currentDownloadsReference
.
get
();
}
}
private
DownloadIndex
postGetDownloadIndex
()
{
private
DownloadIndex
postGetDownloadIndex
()
{
AtomicReference
<
DownloadIndex
>
downloadIndexReference
=
new
AtomicReference
<>();
AtomicReference
<
DownloadIndex
>
downloadIndexReference
=
new
AtomicReference
<>();
runOnMainThread
(
runOnMainThread
(()
->
downloadIndexReference
.
set
(
downloadManager
.
getDownloadIndex
()));
()
->
{
downloadIndexReference
.
set
(
downloadManager
.
getDownloadIndex
());
});
return
downloadIndexReference
.
get
();
return
downloadIndexReference
.
get
();
}
}
...
...
library/core/src/test/java/com/google/android/exoplayer2/video/MediaCodecVideoRendererTest.java
View file @
f2055396
...
@@ -50,7 +50,6 @@ import com.google.android.exoplayer2.testutil.FakeSampleStream.FakeSampleStreamI
...
@@ -50,7 +50,6 @@ import com.google.android.exoplayer2.testutil.FakeSampleStream.FakeSampleStreamI
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.ImmutableList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -82,11 +81,8 @@ public class MediaCodecVideoRendererTest {
...
@@ -82,11 +81,8 @@ public class MediaCodecVideoRendererTest {
@Before
@Before
public
void
setUp
()
throws
Exception
{
public
void
setUp
()
throws
Exception
{
MediaCodecSelector
mediaCodecSelector
=
MediaCodecSelector
mediaCodecSelector
=
new
MediaCodecSelector
()
{
(
mimeType
,
requiresSecureDecoder
,
requiresTunnelingDecoder
)
->
@Override
Collections
.
singletonList
(
public
List
<
MediaCodecInfo
>
getDecoderInfos
(
String
mimeType
,
boolean
requiresSecureDecoder
,
boolean
requiresTunnelingDecoder
)
{
return
Collections
.
singletonList
(
MediaCodecInfo
.
newInstance
(
MediaCodecInfo
.
newInstance
(
/* name= */
"name"
,
/* name= */
"name"
,
/* mimeType= */
mimeType
,
/* mimeType= */
mimeType
,
...
@@ -97,8 +93,6 @@ public class MediaCodecVideoRendererTest {
...
@@ -97,8 +93,6 @@ public class MediaCodecVideoRendererTest {
/* vendor= */
false
,
/* vendor= */
false
,
/* forceDisableAdaptive= */
false
,
/* forceDisableAdaptive= */
false
,
/* forceSecure= */
false
));
/* forceSecure= */
false
));
}
};
mediaCodecVideoRenderer
=
mediaCodecVideoRenderer
=
new
MediaCodecVideoRenderer
(
new
MediaCodecVideoRenderer
(
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
View file @
f2055396
This diff is collapsed.
Click to expand it.
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlViewLayoutManager.java
View file @
f2055396
This diff is collapsed.
Click to expand it.
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