Back to Exoplayer

FrameCache (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/effect/FrameCache.html

latest4.2 KB
Original Source

Package com.google.android.exoplayer2.effect

Class FrameCache

  • java.lang.Object

    • com.google.android.exoplayer2.effect.FrameCache
  • All Implemented Interfaces:GlEffect, Effect


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classFrameCacheextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[GlEffect](GlEffect.html "interface in com.google.android.exoplayer2.effect")

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 a GlShaderProgram that applies the effect. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

- 

Methods inherited from interface com.google.android.exoplayer2.effect.GlEffect

isNoOp

Field Detail

- 

capacity

public final int capacity

Deprecated.

The capacity of the frame cache.

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](GlShaderProgram.html "interface in com.google.android.exoplayer2.effect")toGlShaderProgram​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,
                                         boolean useHdr)
                                  throws[VideoFrameProcessingException](../util/VideoFrameProcessingException.html "class in com.google.android.exoplayer2.util")

Deprecated.

Description copied from interface: GlEffect

Returns a GlShaderProgram that applies the effect. Specified by:toGlShaderProgram in interface GlEffectParameters:context - A Context.useHdr - Whether input textures come from an HDR source. If true, colors will be in linear RGB BT.2020. If false, colors will be in linear RGB BT.709.Throws:VideoFrameProcessingException - If an error occurs while creating the GlShaderProgram.