docs/doc/reference/com/google/android/exoplayer2/effect/GlShaderProgram.html
Package com.google.android.exoplayer2.effect
BaseGlShaderProgram, SingleFrameGlShaderProgram[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceGlShaderProgram
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.
Processes frames from one OpenGL 2D texture to another.
The GlShaderProgram consumes input frames it accepts via queueInputFrame(GlTextureInfo, long) and surrenders each texture back to the caller via its listener once the texture's contents have been processed.
The GlShaderProgram produces output frames asynchronously and notifies its owner when they are available via its listener. The GlShaderProgram instance's owner must surrender the texture back to the GlShaderProgram via releaseOutputFrame(GlTextureInfo) when it has finished processing it.
GlShaderProgram implementations can choose to produce output frames before receiving input frames or process several input frames before producing an output frame. However, GlShaderProgram implementations cannot assume that they will receive more than one input frame at a time, so they must process each input frame they accept even if they cannot produce output yet.
The methods in this interface must be called on the thread that owns the parent OpenGL context. If the implementation uses another OpenGL context, e.g., on another thread, it must configure it to share data with the context of thread the interface methods are called on.
Nested Classes | Modifier and Type | Interface | Description |
| --- | --- | --- |
| static interface | GlShaderProgram.ErrorListener |
Deprecated.
Listener for video frame processing errors.
|
| static interface | GlShaderProgram.InputListener |
Deprecated.
Listener for input-related video frame processing events.
|
| static interface | GlShaderProgram.OutputListener |
Deprecated.
Listener for output-related video frame processing events. |
All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | flush() |
Deprecated.
Flushes the GlShaderProgram.
|
| void | queueInputFrame(GlTextureInfo inputTexture, long presentationTimeUs) |
Deprecated.
Processes an input frame if possible.
|
| void | release() |
Deprecated.
Releases all resources.
|
| void | releaseOutputFrame(GlTextureInfo outputTexture) |
Deprecated.
Notifies the GlShaderProgram that the frame on the given output texture is no longer used and can be overwritten.
|
| void | setErrorListener(Executor executor, GlShaderProgram.ErrorListener errorListener) |
Deprecated.
Sets the GlShaderProgram.ErrorListener.
|
| void | setGlObjectsProvider(GlObjectsProvider glObjectsProvider) |
Deprecated.
Sets the GlObjectsProvider.
|
| void | setInputListener(GlShaderProgram.InputListener inputListener) |
Deprecated.
Sets the GlShaderProgram.InputListener.
|
| void | setOutputListener(GlShaderProgram.OutputListener outputListener) |
Deprecated.
Sets the GlShaderProgram.OutputListener.
|
| void | signalEndOfCurrentInputStream() |
Deprecated.
Notifies the GlShaderProgram that no further input frames belonging to the current input stream will be queued.
|
-
void setInputListener([GlShaderProgram.InputListener](GlShaderProgram.InputListener.html "interface in com.google.android.exoplayer2.effect")inputListener)
Deprecated.
Sets the GlShaderProgram.InputListener.
The GlShaderProgram.InputListener should be invoked on the thread that owns the parent OpenGL context. For example, DefaultVideoFrameProcessor invokes the GlShaderProgram.InputListener methods on its internal thread.
-
void setOutputListener([GlShaderProgram.OutputListener](GlShaderProgram.OutputListener.html "interface in com.google.android.exoplayer2.effect")outputListener)
Deprecated.
Sets the GlShaderProgram.OutputListener.
The GlShaderProgram.OutputListener should be invoked on the thread that owns the parent OpenGL context. For example, DefaultVideoFrameProcessor invokes the GlShaderProgram.OutputListener methods on its internal thread.
-
void setErrorListener([Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,[GlShaderProgram.ErrorListener](GlShaderProgram.ErrorListener.html "interface in com.google.android.exoplayer2.effect")errorListener)
Deprecated.
Sets the GlShaderProgram.ErrorListener.
The GlShaderProgram.ErrorListener is invoked on the provided Executor.
-
void setGlObjectsProvider([GlObjectsProvider](../util/GlObjectsProvider.html "interface in com.google.android.exoplayer2.util")glObjectsProvider)
Deprecated.
Sets the GlObjectsProvider.
This method should not be called after any of the frame processing methods.
-
void queueInputFrame([GlTextureInfo](../util/GlTextureInfo.html "class in com.google.android.exoplayer2.util")inputTexture,
long presentationTimeUs)
Deprecated.
Processes an input frame if possible.
The GlShaderProgram owns the accepted frame until it calls GlShaderProgram.InputListener.onInputFrameProcessed(GlTextureInfo). The caller should not overwrite or release the texture before the GlShaderProgram has finished processing it.
This method must only be called when the GlShaderProgram can accept an input frame.
Parameters:inputTexture - A GlTextureInfo describing the texture containing the input frame.presentationTimeUs - The presentation timestamp of the input frame, in microseconds.
-
void releaseOutputFrame([GlTextureInfo](../util/GlTextureInfo.html "class in com.google.android.exoplayer2.util")outputTexture)
Deprecated.
Notifies the GlShaderProgram that the frame on the given output texture is no longer used and can be overwritten.
-
void signalEndOfCurrentInputStream()
Deprecated.
Notifies the GlShaderProgram that no further input frames belonging to the current input stream will be queued.
Input frames that are queued after this method is called belong to a different input stream.
-
void flush()
Deprecated.
Flushes the GlShaderProgram.
The GlShaderProgram should reclaim the ownership of its allocated textures, notify its GlShaderProgram.InputListener about the flush event, and report its availability if necessary.
-
void release()
throws[VideoFrameProcessingException](../util/VideoFrameProcessingException.html "class in com.google.android.exoplayer2.util")
Deprecated.
Releases all resources.
Throws:VideoFrameProcessingException - If an error occurs while releasing resources.