Remove VideoSink.isFrameDropAllowedOnInput

This is an unnecessary layer

PiperOrigin-RevId: 665267029
This commit is contained in:
kimvde 2024-08-20 03:06:12 -07:00 committed by Copybara-Service
parent 9b69690856
commit 266f16823f
3 changed files with 3 additions and 15 deletions

View File

@ -465,7 +465,7 @@ public final class CompositingVideoSinkProvider implements VideoSinkProvider, Vi
/** Receives input from an ExoPlayer renderer and forwards it to the video graph. */
private final class VideoSinkImpl implements VideoSink, CompositingVideoSinkProvider.Listener {
private final Context context;
private final int videoFrameProcessorMaxPendingFrameCount;
private final ArrayList<Effect> videoEffects;
private final VideoFrameReleaseControl.FrameReleaseInfo frameReleaseInfo;
@ -494,7 +494,6 @@ public final class CompositingVideoSinkProvider implements VideoSinkProvider, Vi
/** Creates a new instance. */
public VideoSinkImpl(Context context) {
this.context = context;
// TODO b/226330223 - Investigate increasing frame count when frame dropping is allowed.
// TODO b/278234847 - Evaluate whether limiting frame count when frame dropping is not allowed
// reduces decoder timeouts, and consider restoring.
@ -607,11 +606,6 @@ public final class CompositingVideoSinkProvider implements VideoSinkProvider, Vi
}
}
@Override
public boolean isFrameDropAllowedOnInput() {
return Util.isFrameDropAllowedOnSurfaceInput(context);
}
@Override
public Surface getInputSurface() {
checkState(isInitialized());

View File

@ -1039,9 +1039,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
codecInfo, mediaFormat, format, codecSurface, crypto);
}
@SuppressWarnings("InlinedApi") // VideoSink will check the API level
@SuppressWarnings("InlinedApi") // The API level is checked in the utility method
private void maybeSetKeyAllowFrameDrop(MediaFormat mediaFormat) {
if (videoSink != null && !videoSink.isFrameDropAllowedOnInput()) {
if (videoSink != null && !Util.isFrameDropAllowedOnSurfaceInput(context)) {
mediaFormat.setInteger(MediaFormat.KEY_ALLOW_FRAME_DROP, 0);
}
}

View File

@ -180,12 +180,6 @@ public interface VideoSink {
/** Returns whether all the data has been rendered to the output surface. */
boolean isEnded();
/**
* Returns whether frames could be dropped from the sink's {@linkplain #getInputSurface() input
* surface}.
*/
boolean isFrameDropAllowedOnInput();
/**
* Returns the input {@link Surface} where the video sink consumes input frames from.
*