Class FrameCache
- java.lang.Object
-
- com.google.android.exoplayer2.effect.FrameCache
-
@Deprecated public final class FrameCache extends Object implements GlEffect
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.Caches the input frames.Example usage: cache the processed frames when presenting them on screen, to accommodate for the possible fluctuation in video frame processing time between frames.
-
-
Field Summary
Fields Modifier and Type Field Description int
capacity
Deprecated.The capacity of the frame cache.
-
Constructor Summary
Constructors Constructor Description FrameCache(int capacity)
Deprecated.Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GlShaderProgram
toGlShaderProgram(Context context, boolean useHdr)
Deprecated.Returns aGlShaderProgram
that applies the effect.
-
-
-
Constructor Detail
-
FrameCache
public FrameCache(@IntRange(from=1L,to=8L) int capacity)
Deprecated.Creates a new instance.The
capacity
should be chosen carefully. OpenGL could crash unexpectedly if the device is not capable of allocating the requested buffer.Currently up to 8 frames can be cached in one
FrameCache
instance.- Parameters:
capacity
- The capacity of the frame cache, must be greater than zero.
-
-
Method Detail
-
toGlShaderProgram
public GlShaderProgram toGlShaderProgram(Context context, boolean useHdr) throws VideoFrameProcessingException
Deprecated.Description copied from interface:GlEffect
Returns aGlShaderProgram
that applies the effect.- Specified by:
toGlShaderProgram
in interfaceGlEffect
- Parameters:
context
- AContext
.useHdr
- Whether input textures come from an HDR source. Iftrue
, colors will be in linear RGB BT.2020. Iffalse
, colors will be in linear RGB BT.709.- Throws:
VideoFrameProcessingException
- If an error occurs while creating theGlShaderProgram
.
-
-