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
4e40a03a
authored
Jan 14, 2021
by
christosts
Committed by
Ian Baker
Jan 15, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove interface SimpleExoPlayer.VideoListener
PiperOrigin-RevId: 351808884
parent
d9e0b91b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
RELEASENOTES.md
View file @
4e40a03a
...
@@ -62,6 +62,8 @@
...
@@ -62,6 +62,8 @@
application is calling
`SimpleExoPlayer.setVideoListener(null)`
,
application is calling
`SimpleExoPlayer.setVideoListener(null)`
,
make sure to replace this call with
make sure to replace this call with
`SimpleExoPlayer.removeVideoListener(VideoListener)`
.
`SimpleExoPlayer.removeVideoListener(VideoListener)`
.
*
`SimpleExoPlayer.VideoListener`
. Use
`com.google.android.exoplayer2.video.VideoListener`
instead.
*
`SingleSampleMediaSource.EventListener`
and constructors. Use
*
`SingleSampleMediaSource.EventListener`
and constructors. Use
`MediaSourceEventListener`
and
`SingleSampleMediaSource.Factory`
`MediaSourceEventListener`
and
`SingleSampleMediaSource.Factory`
instead.
instead.
...
...
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
View file @
4e40a03a
...
@@ -63,6 +63,7 @@ import com.google.android.exoplayer2.util.Util;
...
@@ -63,6 +63,7 @@ import com.google.android.exoplayer2.util.Util;
import
com.google.android.exoplayer2.video.VideoDecoderGLSurfaceView
;
import
com.google.android.exoplayer2.video.VideoDecoderGLSurfaceView
;
import
com.google.android.exoplayer2.video.VideoDecoderOutputBufferRenderer
;
import
com.google.android.exoplayer2.video.VideoDecoderOutputBufferRenderer
;
import
com.google.android.exoplayer2.video.VideoFrameMetadataListener
;
import
com.google.android.exoplayer2.video.VideoFrameMetadataListener
;
import
com.google.android.exoplayer2.video.VideoListener
;
import
com.google.android.exoplayer2.video.VideoRendererEventListener
;
import
com.google.android.exoplayer2.video.VideoRendererEventListener
;
import
com.google.android.exoplayer2.video.spherical.CameraMotionListener
;
import
com.google.android.exoplayer2.video.spherical.CameraMotionListener
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -86,10 +87,6 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -86,10 +87,6 @@ public class SimpleExoPlayer extends BasePlayer
/** The default timeout for detaching a surface from the player, in milliseconds. */
/** The default timeout for detaching a surface from the player, in milliseconds. */
public
static
final
long
DEFAULT_DETACH_SURFACE_TIMEOUT_MS
=
2_000
;
public
static
final
long
DEFAULT_DETACH_SURFACE_TIMEOUT_MS
=
2_000
;
/** @deprecated Use {@link com.google.android.exoplayer2.video.VideoListener}. */
@Deprecated
public
interface
VideoListener
extends
com
.
google
.
android
.
exoplayer2
.
video
.
VideoListener
{}
/**
/**
* A builder for {@link SimpleExoPlayer} instances.
* A builder for {@link SimpleExoPlayer} instances.
*
*
...
@@ -572,8 +569,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -572,8 +569,7 @@ public class SimpleExoPlayer extends BasePlayer
private
final
Context
applicationContext
;
private
final
Context
applicationContext
;
private
final
ExoPlayerImpl
player
;
private
final
ExoPlayerImpl
player
;
private
final
ComponentListener
componentListener
;
private
final
ComponentListener
componentListener
;
private
final
CopyOnWriteArraySet
<
com
.
google
.
android
.
exoplayer2
.
video
.
VideoListener
>
private
final
CopyOnWriteArraySet
<
VideoListener
>
videoListeners
;
videoListeners
;
private
final
CopyOnWriteArraySet
<
AudioListener
>
audioListeners
;
private
final
CopyOnWriteArraySet
<
AudioListener
>
audioListeners
;
private
final
CopyOnWriteArraySet
<
TextOutput
>
textOutputs
;
private
final
CopyOnWriteArraySet
<
TextOutput
>
textOutputs
;
private
final
CopyOnWriteArraySet
<
MetadataOutput
>
metadataOutputs
;
private
final
CopyOnWriteArraySet
<
MetadataOutput
>
metadataOutputs
;
...
@@ -1120,14 +1116,14 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -1120,14 +1116,14 @@ public class SimpleExoPlayer extends BasePlayer
}
}
@Override
@Override
public
void
addVideoListener
(
com
.
google
.
android
.
exoplayer2
.
video
.
VideoListener
listener
)
{
public
void
addVideoListener
(
VideoListener
listener
)
{
// Don't verify application thread. We allow calls to this method from any thread.
// Don't verify application thread. We allow calls to this method from any thread.
Assertions
.
checkNotNull
(
listener
);
Assertions
.
checkNotNull
(
listener
);
videoListeners
.
add
(
listener
);
videoListeners
.
add
(
listener
);
}
}
@Override
@Override
public
void
removeVideoListener
(
com
.
google
.
android
.
exoplayer2
.
video
.
VideoListener
listener
)
{
public
void
removeVideoListener
(
VideoListener
listener
)
{
// Don't verify application thread. We allow calls to this method from any thread.
// Don't verify application thread. We allow calls to this method from any thread.
videoListeners
.
remove
(
listener
);
videoListeners
.
remove
(
listener
);
}
}
...
@@ -1943,7 +1939,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -1943,7 +1939,7 @@ public class SimpleExoPlayer extends BasePlayer
if
(
width
!=
surfaceWidth
||
height
!=
surfaceHeight
)
{
if
(
width
!=
surfaceWidth
||
height
!=
surfaceHeight
)
{
surfaceWidth
=
width
;
surfaceWidth
=
width
;
surfaceHeight
=
height
;
surfaceHeight
=
height
;
for
(
com
.
google
.
android
.
exoplayer2
.
video
.
VideoListener
videoListener
:
videoListeners
)
{
for
(
VideoListener
videoListener
:
videoListeners
)
{
videoListener
.
onSurfaceSizeChanged
(
width
,
height
);
videoListener
.
onSurfaceSizeChanged
(
width
,
height
);
}
}
}
}
...
@@ -2119,7 +2115,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -2119,7 +2115,7 @@ public class SimpleExoPlayer extends BasePlayer
@Override
@Override
public
void
onVideoSizeChanged
(
public
void
onVideoSizeChanged
(
int
width
,
int
height
,
int
unappliedRotationDegrees
,
float
pixelWidthHeightRatio
)
{
int
width
,
int
height
,
int
unappliedRotationDegrees
,
float
pixelWidthHeightRatio
)
{
for
(
com
.
google
.
android
.
exoplayer2
.
video
.
VideoListener
videoListener
:
videoListeners
)
{
for
(
VideoListener
videoListener
:
videoListeners
)
{
// Prevent duplicate notification if a listener is both a VideoRendererEventListener and
// Prevent duplicate notification if a listener is both a VideoRendererEventListener and
// a VideoListener, as they have the same method signature.
// a VideoListener, as they have the same method signature.
if
(!
videoDebugListeners
.
contains
(
videoListener
))
{
if
(!
videoDebugListeners
.
contains
(
videoListener
))
{
...
@@ -2136,7 +2132,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -2136,7 +2132,7 @@ public class SimpleExoPlayer extends BasePlayer
@Override
@Override
public
void
onRenderedFirstFrame
(
Surface
surface
)
{
public
void
onRenderedFirstFrame
(
Surface
surface
)
{
if
(
SimpleExoPlayer
.
this
.
surface
==
surface
)
{
if
(
SimpleExoPlayer
.
this
.
surface
==
surface
)
{
for
(
com
.
google
.
android
.
exoplayer2
.
video
.
VideoListener
videoListener
:
videoListeners
)
{
for
(
VideoListener
videoListener
:
videoListeners
)
{
videoListener
.
onRenderedFirstFrame
();
videoListener
.
onRenderedFirstFrame
();
}
}
}
}
...
...
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