Rename getVideoSurfaceSize to getSurfaceSize

This better matches the callback name (onSurfaceSizeChanged) and
probably cause less confusion with getVideoSize.

PiperOrigin-RevId: 488669786
This commit is contained in:
tonihei 2022-11-15 16:51:12 +00:00 committed by microkatz
parent 491b13622e
commit 1143edc59a
12 changed files with 17 additions and 17 deletions

View File

@ -28,7 +28,7 @@ Release notes
([#10667](https://github.com/google/ExoPlayer/issues/10667)). ([#10667](https://github.com/google/ExoPlayer/issues/10667)).
* Enforce minimum `compileSdkVersion` to avoid compilation errors * Enforce minimum `compileSdkVersion` to avoid compilation errors
([#10684](https://github.com/google/ExoPlayer/issues/10684)). ([#10684](https://github.com/google/ExoPlayer/issues/10684)).
* Add `Player.getVideoSurfaceSize` that returns the size of the surface on * Add `Player.getSurfaceSize` that returns the size of the surface on
which the video is rendered. which the video is rendered.
* Tweak the renderer's decoder ordering logic to uphold the * Tweak the renderer's decoder ordering logic to uphold the
`MediaCodecSelector`'s preferences, even if a decoder reports it may not `MediaCodecSelector`'s preferences, even if a decoder reports it may not

View File

@ -730,7 +730,7 @@ public final class CastPlayer extends BasePlayer {
/** This method is not supported and returns {@link Size#UNKNOWN}. */ /** This method is not supported and returns {@link Size#UNKNOWN}. */
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
return Size.UNKNOWN; return Size.UNKNOWN;
} }

View File

@ -760,10 +760,10 @@ public class ForwardingPlayer implements Player {
return player.getVideoSize(); return player.getVideoSize();
} }
/** Calls {@link Player#getVideoSurfaceSize()} on the delegate and returns the result. */ /** Calls {@link Player#getSurfaceSize()} on the delegate and returns the result. */
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
return player.getVideoSurfaceSize(); return player.getSurfaceSize();
} }
/** Calls {@link Player#clearVideoSurface()} on the delegate. */ /** Calls {@link Player#clearVideoSurface()} on the delegate. */

View File

@ -2519,7 +2519,7 @@ public interface Player {
* @see Listener#onSurfaceSizeChanged(int, int) * @see Listener#onSurfaceSizeChanged(int, int)
*/ */
@UnstableApi @UnstableApi
Size getVideoSurfaceSize(); Size getSurfaceSize();
/** Returns the current {@link CueGroup}. */ /** Returns the current {@link CueGroup}. */
CueGroup getCurrentCues(); CueGroup getCurrentCues();

View File

@ -591,7 +591,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
} }
@Override @Override
public final Size getVideoSurfaceSize() { public final Size getSurfaceSize() {
// TODO: implement. // TODO: implement.
throw new IllegalStateException(); throw new IllegalStateException();
} }

View File

@ -1231,7 +1231,7 @@ import java.util.concurrent.TimeoutException;
} }
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
verifyApplicationThread(); verifyApplicationThread();
return surfaceSize; return surfaceSize;
} }

View File

@ -530,9 +530,9 @@ public class SimpleExoPlayer extends BasePlayer
} }
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
blockUntilConstructorFinished(); blockUntilConstructorFinished();
return player.getVideoSurfaceSize(); return player.getSurfaceSize();
} }
@Override @Override

View File

@ -1501,9 +1501,9 @@ public class MediaController implements Player {
@UnstableApi @UnstableApi
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
verifyApplicationThread(); verifyApplicationThread();
return isConnected() ? impl.getVideoSurfaceSize() : Size.UNKNOWN; return isConnected() ? impl.getSurfaceSize() : Size.UNKNOWN;
} }
@Override @Override
@ -1976,7 +1976,7 @@ public class MediaController implements Player {
VideoSize getVideoSize(); VideoSize getVideoSize();
Size getVideoSurfaceSize(); Size getSurfaceSize();
void clearVideoSurface(); void clearVideoSurface();

View File

@ -1566,7 +1566,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
} }
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
return surfaceSize; return surfaceSize;
} }

View File

@ -963,7 +963,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
} }
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
Log.w(TAG, "Session doesn't support getting VideoSurfaceSize"); Log.w(TAG, "Session doesn't support getting VideoSurfaceSize");
return Size.UNKNOWN; return Size.UNKNOWN;
} }

View File

@ -1138,7 +1138,7 @@ public class MockPlayer implements Player {
} }
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
return surfaceSize; return surfaceSize;
} }

View File

@ -353,7 +353,7 @@ public class StubPlayer extends BasePlayer {
} }
@Override @Override
public Size getVideoSurfaceSize() { public Size getSurfaceSize() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }