docs/doc/reference/com/google/android/exoplayer2/video/VideoFrameReleaseHelper.html
Package com.google.android.exoplayer2.video
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classVideoFrameReleaseHelperextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Helps a video Renderer release frames to a Surface. The helper:
Adjusts frame release timestamps to achieve a smoother visual result. The release timestamps are smoothed, and aligned with the default display's vsync signal.
Adjusts the Surface frame rate to inform the underlying platform of a fixed frame rate, when there is one.
Constructors | Constructor | Description |
| --- | --- |
| VideoFrameReleaseHelper(Context context) |
Deprecated.
Constructs an instance. |
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| long | adjustReleaseTime(long releaseTimeNs) |
Deprecated.
Adjusts the release timestamp for the next frame.
|
| void | onFormatChanged(float formatFrameRate) |
Deprecated.
Called when the renderer's output format changes.
|
| void | onNextFrame(long framePresentationTimeUs) |
Deprecated.
Called by the renderer for each frame, prior to it being skipped, dropped or rendered.
|
| void | onPlaybackSpeed(float playbackSpeed) |
Deprecated.
Called when the renderer's playback speed changes.
|
| void | onPositionReset() |
Deprecated.
Called when the renderer's position is reset.
|
| void | onStarted() |
Deprecated.
Called when the renderer is started.
|
| void | onStopped() |
Deprecated.
Called when the renderer is stopped.
|
| void | onSurfaceChanged(Surface surface) |
Deprecated.
Called when the renderer changes which Surface it's rendering to renders to.
|
| void | setChangeFrameRateStrategy(@com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int changeFrameRateStrategy) |
Deprecated.
Change the C.VideoChangeFrameRateStrategy used when calling Surface.setFrameRate(float, int, int).
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public VideoFrameReleaseHelper(@Nullable[Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)
Deprecated.
Constructs an instance.
Parameters:context - A context from which information about the default display can be retrieved.
-
public void setChangeFrameRateStrategy([@VideoChangeFrameRateStrategy](../C.VideoChangeFrameRateStrategy.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int changeFrameRateStrategy)
Deprecated.
Change the C.VideoChangeFrameRateStrategy used when calling Surface.setFrameRate(float, int, int).
-
public void onStarted()
Deprecated.
Called when the renderer is started.
-
public void onSurfaceChanged(@Nullable[Surface](https://developer.android.com/reference/android/view/Surface.html "class or interface in android.view")surface)
Deprecated.
Called when the renderer changes which Surface it's rendering to renders to.
Parameters:surface - The new Surface, or null if the renderer does not have one.
-
public void onPositionReset()
Deprecated.
Called when the renderer's position is reset.
-
public void onPlaybackSpeed(float playbackSpeed)
Deprecated.
Called when the renderer's playback speed changes.
Parameters:playbackSpeed - The factor by which playback is sped up.
-
public void onFormatChanged(float formatFrameRate)
Deprecated.
Called when the renderer's output format changes.
Parameters:formatFrameRate - The format's frame rate, or Format.NO_VALUE if unknown.
-
public void onNextFrame(long framePresentationTimeUs)
Deprecated.
Called by the renderer for each frame, prior to it being skipped, dropped or rendered.
Parameters:framePresentationTimeUs - The frame presentation timestamp, in microseconds.
-
public void onStopped()
Deprecated.
Called when the renderer is stopped.
-
public long adjustReleaseTime(long releaseTimeNs)
Deprecated.
Adjusts the release timestamp for the next frame. This is the frame whose presentation timestamp was most recently passed to onNextFrame(long).
This method may be called any number of times for each frame, including zero times (for skipped frames, or when rendering the first frame prior to playback starting), or more than once (if the caller wishes to give the helper the opportunity to refine a release time closer to when the frame needs to be released).
Parameters:releaseTimeNs - The frame's unadjusted release time, in nanoseconds and in the same time base as System.nanoTime().Returns:The adjusted frame release timestamp, in nanoseconds and in the same time base as System.nanoTime().