Interface GlShaderProgram
-
- All Known Implementing Classes:
BaseGlShaderProgram
,SingleFrameGlShaderProgram
@Deprecated public interface GlShaderProgram
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 viaqueueInputFrame(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. TheGlShaderProgram
instance's owner must surrender the texture back to theGlShaderProgram
viareleaseOutputFrame(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 Class Summary
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.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
flush()
Deprecated.Flushes theGlShaderProgram
.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 theGlShaderProgram
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 theGlShaderProgram.ErrorListener
.void
setGlObjectsProvider(GlObjectsProvider glObjectsProvider)
Deprecated.Sets theGlObjectsProvider
.void
setInputListener(GlShaderProgram.InputListener inputListener)
Deprecated.Sets theGlShaderProgram.InputListener
.void
setOutputListener(GlShaderProgram.OutputListener outputListener)
Deprecated.Sets theGlShaderProgram.OutputListener
.void
signalEndOfCurrentInputStream()
Deprecated.Notifies theGlShaderProgram
that no further input frames belonging to the current input stream will be queued.
-
-
-
Method Detail
-
setInputListener
void setInputListener(GlShaderProgram.InputListener inputListener)
Deprecated.Sets theGlShaderProgram.InputListener
.The
GlShaderProgram.InputListener
should be invoked on the thread that owns the parent OpenGL context. For example,DefaultVideoFrameProcessor
invokes theGlShaderProgram.InputListener
methods on its internal thread.
-
setOutputListener
void setOutputListener(GlShaderProgram.OutputListener outputListener)
Deprecated.Sets theGlShaderProgram.OutputListener
.The
GlShaderProgram.OutputListener
should be invoked on the thread that owns the parent OpenGL context. For example,DefaultVideoFrameProcessor
invokes theGlShaderProgram.OutputListener
methods on its internal thread.
-
setErrorListener
void setErrorListener(Executor executor, GlShaderProgram.ErrorListener errorListener)
Deprecated.Sets theGlShaderProgram.ErrorListener
.The
GlShaderProgram.ErrorListener
is invoked on the providedExecutor
.
-
setGlObjectsProvider
void setGlObjectsProvider(GlObjectsProvider glObjectsProvider)
Deprecated.Sets theGlObjectsProvider
.This method should not be called after any of the frame processing methods.
-
queueInputFrame
void queueInputFrame(GlTextureInfo inputTexture, long presentationTimeUs)
Deprecated.Processes an input frame if possible.The
GlShaderProgram
owns the accepted frame until it callsGlShaderProgram.InputListener.onInputFrameProcessed(GlTextureInfo)
. The caller should not overwrite or release the texture before theGlShaderProgram
has finished processing it.This method must only be called when the
GlShaderProgram
can accept an input frame.- Parameters:
inputTexture
- AGlTextureInfo
describing the texture containing the input frame.presentationTimeUs
- The presentation timestamp of the input frame, in microseconds.
-
releaseOutputFrame
void releaseOutputFrame(GlTextureInfo outputTexture)
Deprecated.Notifies theGlShaderProgram
that the frame on the given output texture is no longer used and can be overwritten.
-
signalEndOfCurrentInputStream
void signalEndOfCurrentInputStream()
Deprecated.Notifies theGlShaderProgram
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.
-
flush
void flush()
Deprecated.Flushes theGlShaderProgram
.The
GlShaderProgram
should reclaim the ownership of its allocated textures, notify itsGlShaderProgram.InputListener
about the flush event, and report its availability if necessary.
-
release
void release() throws VideoFrameProcessingException
Deprecated.Releases all resources.- Throws:
VideoFrameProcessingException
- If an error occurs while releasing resources.
-
-