Class FrameCache

  • All Implemented Interfaces:
    GlEffect, Effect

    public final class FrameCache
    extends Object
    implements GlEffect
    Deprecated. 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 Detail

      • capacity

        public final int capacity
        The capacity of the frame cache.
    • Constructor Detail

      • FrameCache

        public FrameCache​(@IntRange(from=1L,to=8L)
                          int capacity)
        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.

        capacity - The capacity of the frame cache, must be greater than zero.