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
GlShaderProgramconsumes 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
GlShaderProgramproduces output frames asynchronously and notifies its owner when they are available via its listener. TheGlShaderPrograminstance's owner must surrender the texture back to theGlShaderProgramviareleaseOutputFrame(GlTextureInfo)when it has finished processing it.GlShaderProgramimplementations can choose to produce output frames before receiving input frames or process several input frames before producing an output frame. However,GlShaderProgramimplementations 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 interfaceGlShaderProgram.ErrorListenerDeprecated.Listener for video frame processing errors.static interfaceGlShaderProgram.InputListenerDeprecated.Listener for input-related video frame processing events.static interfaceGlShaderProgram.OutputListenerDeprecated.Listener for output-related video frame processing events.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidflush()Deprecated.Flushes theGlShaderProgram.voidqueueInputFrame(GlTextureInfo inputTexture, long presentationTimeUs)Deprecated.Processes an input frame if possible.voidrelease()Deprecated.Releases all resources.voidreleaseOutputFrame(GlTextureInfo outputTexture)Deprecated.Notifies theGlShaderProgramthat the frame on the given output texture is no longer used and can be overwritten.voidsetErrorListener(Executor executor, GlShaderProgram.ErrorListener errorListener)Deprecated.Sets theGlShaderProgram.ErrorListener.voidsetGlObjectsProvider(GlObjectsProvider glObjectsProvider)Deprecated.Sets theGlObjectsProvider.voidsetInputListener(GlShaderProgram.InputListener inputListener)Deprecated.Sets theGlShaderProgram.InputListener.voidsetOutputListener(GlShaderProgram.OutputListener outputListener)Deprecated.Sets theGlShaderProgram.OutputListener.voidsignalEndOfCurrentInputStream()Deprecated.Notifies theGlShaderProgramthat 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.InputListenershould be invoked on the thread that owns the parent OpenGL context. For example,DefaultVideoFrameProcessorinvokes theGlShaderProgram.InputListenermethods on its internal thread.
-
setOutputListener
void setOutputListener(GlShaderProgram.OutputListener outputListener)
Deprecated.Sets theGlShaderProgram.OutputListener.The
GlShaderProgram.OutputListenershould be invoked on the thread that owns the parent OpenGL context. For example,DefaultVideoFrameProcessorinvokes theGlShaderProgram.OutputListenermethods on its internal thread.
-
setErrorListener
void setErrorListener(Executor executor, GlShaderProgram.ErrorListener errorListener)
Deprecated.Sets theGlShaderProgram.ErrorListener.The
GlShaderProgram.ErrorListeneris 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
GlShaderProgramowns the accepted frame until it callsGlShaderProgram.InputListener.onInputFrameProcessed(GlTextureInfo). The caller should not overwrite or release the texture before theGlShaderProgramhas finished processing it.This method must only be called when the
GlShaderProgramcan accept an input frame.- Parameters:
inputTexture- AGlTextureInfodescribing the texture containing the input frame.presentationTimeUs- The presentation timestamp of the input frame, in microseconds.
-
releaseOutputFrame
void releaseOutputFrame(GlTextureInfo outputTexture)
Deprecated.Notifies theGlShaderProgramthat the frame on the given output texture is no longer used and can be overwritten.
-
signalEndOfCurrentInputStream
void signalEndOfCurrentInputStream()
Deprecated.Notifies theGlShaderProgramthat 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
GlShaderProgramshould reclaim the ownership of its allocated textures, notify itsGlShaderProgram.InputListenerabout the flush event, and report its availability if necessary.
-
release
void release() throws VideoFrameProcessingExceptionDeprecated.Releases all resources.- Throws:
VideoFrameProcessingException- If an error occurs while releasing resources.
-
-