DebugViewShaderProgram
@UnstableApi
public final class DebugViewShaderProgram implements GlShaderProgram
GlShaderProgram
that renders to a SurfaceView
provided by .
Summary
Public constructors |
---|
DebugViewShaderProgram( |
Public methods |
|
---|---|
void |
flush() Flushes the |
void |
queueInputFrame( Processes an input frame if possible. |
void |
release() Releases all resources. |
void |
releaseOutputFrame(GlTextureInfo outputTexture) Notifies the |
void |
setErrorListener( Sets the |
void |
setInputListener(GlShaderProgram.InputListener inputListener) Sets the |
void |
setOutputListener(GlShaderProgram.OutputListener outputListener) Sets the |
void |
Notifies the |
Public constructors
DebugViewShaderProgram
public DebugViewShaderProgram(
Context context,
DebugViewProvider debugViewProvider,
ColorInfo outputColorInfo
)
Public methods
flush
public void flush()
Flushes the GlShaderProgram
.
The GlShaderProgram
should reclaim the ownership of its allocated textures, notify
its InputListener
about the flush event, and report its availability
if necessary.
The implementation must not output frames
until after this method returns.
queueInputFrame
public void queueInputFrame(
GlObjectsProvider glObjectsProvider,
GlTextureInfo inputTexture,
long presentationTimeUs
)
Processes an input frame if possible.
The GlShaderProgram
owns the accepted frame until it calls onInputFrameProcessed
. 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 | |
---|---|
GlObjectsProvider glObjectsProvider |
The |
GlTextureInfo inputTexture |
A |
long presentationTimeUs |
The presentation timestamp of the input frame, in microseconds. |
release
public void release()
Releases all resources.
Throws | |
---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while releasing resources. |
releaseOutputFrame
public void releaseOutputFrame(GlTextureInfo outputTexture)
Notifies the GlShaderProgram
that the frame on the given output texture is no longer used and can be overwritten.
setErrorListener
public void setErrorListener(
Executor executor,
GlShaderProgram.ErrorListener errorListener
)
Sets the ErrorListener
.
The ErrorListener
is invoked on the provided Executor
.
setInputListener
public void setInputListener(GlShaderProgram.InputListener inputListener)
Sets the InputListener
.
The InputListener
should be invoked on the thread that owns the parent OpenGL context. For example, DefaultVideoFrameProcessor
invokes the InputListener
methods on its internal thread.
setOutputListener
public void setOutputListener(GlShaderProgram.OutputListener outputListener)
Sets the OutputListener
.
The OutputListener
should be invoked on the thread that owns the parent OpenGL context. For example, DefaultVideoFrameProcessor
invokes the OutputListener
methods on its internal thread.
signalEndOfCurrentInputStream
public void signalEndOfCurrentInputStream()
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.