Class DefaultVideoFrameProcessor
- java.lang.Object
-
- com.google.android.exoplayer2.effect.DefaultVideoFrameProcessor
-
- All Implemented Interfaces:
VideoFrameProcessor
@Deprecated public final class DefaultVideoFrameProcessor extends Object implements VideoFrameProcessor
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.AVideoFrameProcessorimplementation that appliesGlEffectinstances using OpenGL on a background thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultVideoFrameProcessor.FactoryDeprecated.A factory forDefaultVideoFrameProcessorinstances.static interfaceDefaultVideoFrameProcessor.ReleaseOutputTextureCallbackDeprecated.Releases the output information stored for textures before and atpresentationTimeUs.static interfaceDefaultVideoFrameProcessor.TextureOutputListenerDeprecated.Listener interface for texture output.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.util.VideoFrameProcessor
VideoFrameProcessor.InputType, VideoFrameProcessor.Listener
-
-
Field Summary
-
Fields inherited from interface com.google.android.exoplayer2.util.VideoFrameProcessor
DROP_OUTPUT_FRAME, INPUT_TYPE_BITMAP, INPUT_TYPE_SURFACE, INPUT_TYPE_TEXTURE_ID, RENDER_OUTPUT_FRAME_IMMEDIATELY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidflush()Deprecated.Flushes theVideoFrameProcessor.SurfacegetInputSurface()Deprecated.Returns the inputSurface, whereVideoFrameProcessorconsumes input frames from.intgetPendingInputFrameCount()Deprecated.Returns the number of input frames that have been made available to theVideoFrameProcessorbut have not been processed yet.com.google.android.exoplayer2.effect.VideoFrameProcessingTaskExecutorgetTaskExecutor()Deprecated.Returns the task executor that runs video frame processing tasks.voidqueueInputBitmap(Bitmap inputBitmap, long durationUs, float frameRate)Deprecated.Provides an inputBitmapto theVideoFrameProcessor.voidqueueInputTexture(int textureId, long presentationTimeUs)Deprecated.Provides an input texture ID to theVideoFrameProcessor.voidregisterInputFrame()Deprecated.Informs theVideoFrameProcessorthat a frame will be queued to its input surface.voidregisterInputStream(@com.google.android.exoplayer2.util.VideoFrameProcessor.InputType int inputType)Deprecated.Informs theVideoFrameProcessorthat a new input stream will be queued.voidrelease()Deprecated.Releases all resources.voidrenderOutputFrame(long renderTimeNs)Deprecated.Renders the oldest unrendered output frame that has become available for rendering at the givenrenderTimeNs.voidsetInputDefaultBufferSize(int width, int height)Deprecated.Sets the default size for input buffers, for the case where the producer providing input does not override the buffer size.voidsetInputFrameInfo(FrameInfo inputFrameInfo)Deprecated.Sets information about the input frames.voidsetOnInputFrameProcessedListener(OnInputFrameProcessedListener listener)Deprecated.Sets theOnInputFrameProcessedListener.voidsetOutputSurfaceInfo(SurfaceInfo outputSurfaceInfo)Deprecated.Sets the output surface and supporting information.voidsignalEndOfInput()Deprecated.Informs theVideoFrameProcessorthat no further input frames should be accepted.
-
-
-
Method Detail
-
getTaskExecutor
public com.google.android.exoplayer2.effect.VideoFrameProcessingTaskExecutor getTaskExecutor()
Deprecated.Returns the task executor that runs video frame processing tasks.
-
setInputDefaultBufferSize
public void setInputDefaultBufferSize(int width, int height)Deprecated.Sets the default size for input buffers, for the case where the producer providing input does not override the buffer size.When input comes from a media codec it's not necessary to call this method because the codec (producer) sets the buffer size automatically. For the case where input comes from CameraX, call this method after instantiation to ensure that buffers are handled at full resolution. See
SurfaceTexture.setDefaultBufferSize(int, int)for more information.This method must only be called when the
VideoFrameProcessoris created withVideoFrameProcessor.INPUT_TYPE_SURFACE.- Parameters:
width- The default width for input buffers, in pixels.height- The default height for input buffers, in pixels.
-
queueInputBitmap
public void queueInputBitmap(Bitmap inputBitmap, long durationUs, float frameRate)
Deprecated.Description copied from interface:VideoFrameProcessor- Specified by:
queueInputBitmapin interfaceVideoFrameProcessor- Parameters:
inputBitmap- TheBitmapqueued to theVideoFrameProcessor.durationUs- The duration for which to display theinputBitmap, in microseconds.frameRate- The frame rate at which to display theinputBitmap, in frames per second.
-
queueInputTexture
public void queueInputTexture(int textureId, long presentationTimeUs)Deprecated.Description copied from interface:VideoFrameProcessorProvides an input texture ID to theVideoFrameProcessor.It must be called after the
onInputFrameProcessedListenerand theframeInfohave been set.Can be called on any thread.
- Specified by:
queueInputTexturein interfaceVideoFrameProcessor- Parameters:
textureId- The ID of the texture queued to theVideoFrameProcessor.presentationTimeUs- The presentation time of the queued texture, in microseconds.
-
setOnInputFrameProcessedListener
public void setOnInputFrameProcessedListener(OnInputFrameProcessedListener listener)
Deprecated.Description copied from interface:VideoFrameProcessorSets theOnInputFrameProcessedListener.Can be called on any thread.
- Specified by:
setOnInputFrameProcessedListenerin interfaceVideoFrameProcessor- Parameters:
listener- TheOnInputFrameProcessedListener.
-
getInputSurface
public Surface getInputSurface()
Deprecated.Description copied from interface:VideoFrameProcessorReturns the inputSurface, whereVideoFrameProcessorconsumes input frames from.Can be called on any thread.
- Specified by:
getInputSurfacein interfaceVideoFrameProcessor
-
registerInputStream
public void registerInputStream(@com.google.android.exoplayer2.util.VideoFrameProcessor.InputType int inputType)
Deprecated.Description copied from interface:VideoFrameProcessorInforms theVideoFrameProcessorthat a new input stream will be queued.Call
VideoFrameProcessor.setInputFrameInfo(com.google.android.exoplayer2.util.FrameInfo)before this method if theFrameInfoof the new input stream differs from that of the current input stream.- Specified by:
registerInputStreamin interfaceVideoFrameProcessor
-
setInputFrameInfo
public void setInputFrameInfo(FrameInfo inputFrameInfo)
Deprecated.Description copied from interface:VideoFrameProcessorSets information about the input frames.The new input information is applied from the next frame registered or VideoFrameProcessor.queueInputTexture(int, long) queued} onwards.
Pixels are expanded using the
FrameInfo.pixelWidthHeightRatioso that the output frames' pixels have a ratio of 1.Can be called on any thread.
- Specified by:
setInputFrameInfoin interfaceVideoFrameProcessor
-
registerInputFrame
public void registerInputFrame()
Deprecated.Description copied from interface:VideoFrameProcessorInforms theVideoFrameProcessorthat a frame will be queued to its input surface.Must be called before rendering a frame to the input surface.
Can be called on any thread.
- Specified by:
registerInputFramein interfaceVideoFrameProcessor
-
getPendingInputFrameCount
public int getPendingInputFrameCount()
Deprecated.Description copied from interface:VideoFrameProcessorReturns the number of input frames that have been made available to theVideoFrameProcessorbut have not been processed yet.Can be called on any thread.
- Specified by:
getPendingInputFrameCountin interfaceVideoFrameProcessor
-
setOutputSurfaceInfo
public void setOutputSurfaceInfo(@Nullable SurfaceInfo outputSurfaceInfo)Deprecated.Sets the output surface and supporting information. When output frames are rendered and not dropped, they will be rendered to this outputSurfaceInfo.The new output
SurfaceInfois applied from the next output frame rendered onwards. If the outputSurfaceInfoisnull, theVideoFrameProcessorwill stop rendering pending frames and resume rendering once a non-nullSurfaceInfois set.If the dimensions given in
SurfaceInfodo not match the output size after applying the final effect the frames are resized before rendering to the surface and letter/pillar-boxing is applied.The caller is responsible for tracking the lifecycle of the
SurfaceInfo.surfaceincluding calling this method with a new surface if it is destroyed. When this method returns, the previous output surface is no longer being used and can safely be released by the caller.If texture output is set, calling this method will be a no-op.
- Specified by:
setOutputSurfaceInfoin interfaceVideoFrameProcessor
-
renderOutputFrame
public void renderOutputFrame(long renderTimeNs)
Deprecated.Renders the oldest unrendered output frame that has become available for rendering at the givenrenderTimeNs.This will either render the output frame to the output surface, or drop the frame, per
renderTimeNs.This method must only be called if
renderFramesAutomaticallywas set tofalseusing theVideoFrameProcessor.Factoryand should be called exactly once for each frame that becomes available for rendering.The
renderTimeNsmay be passed toEGLExt.eglPresentationTimeANDROID(android.opengl.EGLDisplay, android.opengl.EGLSurface, long)depending on the implementation.If texture output is set, calling this method will be a no-op.
- Specified by:
renderOutputFramein interfaceVideoFrameProcessor- Parameters:
renderTimeNs- The render time to use for the frame, in nanoseconds. The render time can be before or after the current system time. UseVideoFrameProcessor.DROP_OUTPUT_FRAMEto drop the frame, orVideoFrameProcessor.RENDER_OUTPUT_FRAME_IMMEDIATELYto render the frame immediately.
-
signalEndOfInput
public void signalEndOfInput()
Deprecated.Description copied from interface:VideoFrameProcessorInforms theVideoFrameProcessorthat no further input frames should be accepted.Can be called on any thread.
- Specified by:
signalEndOfInputin interfaceVideoFrameProcessor
-
flush
public void flush()
Deprecated.Description copied from interface:VideoFrameProcessorFlushes theVideoFrameProcessor.All the frames that are registered prior to calling this method are no longer considered to be registered when this method returns.
VideoFrameProcessor.Listenermethods invoked prior to calling this method should be ignored.- Specified by:
flushin interfaceVideoFrameProcessor
-
release
public void release()
Deprecated.Description copied from interface:VideoFrameProcessorReleases all resources.If the
VideoFrameProcessoris released before it has ended, it will attempt to cancel processing any input frames that have already become available. Input frames that become available after release are ignored.This method blocks until all resources are released or releasing times out.
Can be called on any thread.
- Specified by:
releasein interfaceVideoFrameProcessor
-
-