Commit 53166e9a by olly Committed by marcbaechinger

Package VideoDecoderGLSurfaceView a little more nicely

The main change here is that VideoDecoderGLSurfaceView now implements
VideoDecoderOutputBufferRenderer directly. This avoids SimpleExoPlayer
having to cast to VideoDecoderGLSurfaceView, which will be necessary
if VideoDecoderGLSurfaceView is moved to the UI module. Instead, the
player can cast directly to VideoDecoderOutputBufferRenderer, which
could be moved to the Common module.

The renderer is also moved to be an inner class, since it's not used
anywhere else and since doing this makes it a little easier to move
things around.

PiperOrigin-RevId: 367398147
parent d24cec51
...@@ -857,9 +857,9 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -857,9 +857,9 @@ public class SimpleExoPlayer extends BasePlayer
@Override @Override
public void setVideoSurfaceView(@Nullable SurfaceView surfaceView) { public void setVideoSurfaceView(@Nullable SurfaceView surfaceView) {
verifyApplicationThread(); verifyApplicationThread();
if (surfaceView instanceof VideoDecoderGLSurfaceView) { if (surfaceView instanceof VideoDecoderOutputBufferRenderer) {
VideoDecoderOutputBufferRenderer videoDecoderOutputBufferRenderer = VideoDecoderOutputBufferRenderer videoDecoderOutputBufferRenderer =
((VideoDecoderGLSurfaceView) surfaceView).getVideoDecoderOutputBufferRenderer(); (VideoDecoderOutputBufferRenderer) surfaceView;
clearVideoSurface(); clearVideoSurface();
surfaceHolder = surfaceView.getHolder(); surfaceHolder = surfaceView.getHolder();
setVideoDecoderOutputBufferRenderer(videoDecoderOutputBufferRenderer); setVideoDecoderOutputBufferRenderer(videoDecoderOutputBufferRenderer);
......
...@@ -232,7 +232,7 @@ public final class SphericalGLSurfaceView extends GLSurfaceView { ...@@ -232,7 +232,7 @@ public final class SphericalGLSurfaceView extends GLSurfaceView {
* onDrawFrame and updatePitchMatrix. * onDrawFrame and updatePitchMatrix.
*/ */
@VisibleForTesting @VisibleForTesting
/* package */ class Renderer /* package */ final class Renderer
implements GLSurfaceView.Renderer, TouchTracker.Listener, OrientationListener.Listener { implements GLSurfaceView.Renderer, TouchTracker.Listener, OrientationListener.Listener {
private final SceneRenderer scene; private final SceneRenderer scene;
private final float[] projectionMatrix = new float[16]; private final float[] projectionMatrix = new float[16];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment