Remove unnecessary method in VideoFrameRenderControl

PiperOrigin-RevId: 685632001
This commit is contained in:
kimvde 2024-10-14 02:31:42 -07:00 committed by Copybara-Service
parent 5eeedeacc6
commit 638eae44ab
3 changed files with 5 additions and 9 deletions

View File

@ -105,7 +105,7 @@ import java.util.concurrent.Executor;
@Override
public void setPlaybackSpeed(float speed) {
videoFrameRenderControl.setPlaybackSpeed(speed);
videoFrameReleaseControl.setPlaybackSpeed(speed);
}
@Override

View File

@ -15,6 +15,7 @@
*/
package androidx.media3.exoplayer.video;
import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Util.msToUs;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
@ -22,6 +23,7 @@ import static java.lang.annotation.ElementType.TYPE_USE;
import android.content.Context;
import android.os.SystemClock;
import android.view.Surface;
import androidx.annotation.FloatRange;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -402,7 +404,8 @@ public final class VideoFrameReleaseControl {
}
/** Sets the playback speed. Called when the renderer playback speed changes. */
public void setPlaybackSpeed(float speed) {
public void setPlaybackSpeed(@FloatRange(from = 0, fromInclusive = false) float speed) {
checkArgument(speed > 0);
if (speed == playbackSpeed) {
return;
}

View File

@ -19,7 +19,6 @@ import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.common.util.Assertions.checkStateNotNull;
import androidx.annotation.FloatRange;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
import androidx.media3.common.VideoFrameProcessor;
@ -138,12 +137,6 @@ import androidx.media3.exoplayer.ExoPlaybackException;
return lastPresentationTimeUs != C.TIME_UNSET && lastPresentationTimeUs >= presentationTimeUs;
}
/** Sets the playback speed. */
public void setPlaybackSpeed(@FloatRange(from = 0, fromInclusive = false) float speed) {
checkArgument(speed > 0);
videoFrameReleaseControl.setPlaybackSpeed(speed);
}
/**
* Incrementally renders available video frames.
*