Class DefaultVideoFrameProcessor.Factory
- java.lang.Object
-
- com.google.android.exoplayer2.effect.DefaultVideoFrameProcessor.Factory
-
- All Implemented Interfaces:
VideoFrameProcessor.Factory
- Enclosing class:
- DefaultVideoFrameProcessor
public static final class DefaultVideoFrameProcessor.Factory extends Object implements VideoFrameProcessor.Factory
A factory forDefaultVideoFrameProcessorinstances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultVideoFrameProcessor.Factory.BuilderA builder forDefaultVideoFrameProcessor.Factoryinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultVideoFrameProcessorcreate(Context context, List<Effect> effects, DebugViewProvider debugViewProvider, ColorInfo inputColorInfo, ColorInfo outputColorInfo, boolean renderFramesAutomatically, Executor listenerExecutor, VideoFrameProcessor.Listener listener)Creates a newVideoFrameProcessorinstance.
-
-
-
Method Detail
-
create
public DefaultVideoFrameProcessor create(Context context, List<Effect> effects, DebugViewProvider debugViewProvider, ColorInfo inputColorInfo, ColorInfo outputColorInfo, boolean renderFramesAutomatically, Executor listenerExecutor, VideoFrameProcessor.Listener listener) throws VideoFrameProcessingException
Creates a newVideoFrameProcessorinstance.All
Effectinstances must beGlEffectinstances.Using HDR
inputColorInforequires theEXT_YUV_targetOpenGL extension.Using HDR
inputColorInfooroutputColorInforequires OpenGL ES 3.0.If outputting HDR content to a display,
EGL_GL_COLORSPACE_BT2020_PQ_EXTis required, andoutputColorInfo.colorTransfermust beC.COLOR_TRANSFER_ST2084.Effects are applied onC.COLOR_RANGE_FULLcolors withnullColorInfo.hdrStaticInfo.inputColorInfo'sColorInfo.hdrStaticInfoandoutputColorInfo'sColorInfo.colorRangevalues are currently ignored, in favor ofnullandC.COLOR_RANGE_FULL, respectively.If
inputColorInfooroutputColorInfoColorInfo.isTransferHdr(com.google.android.exoplayer2.video.ColorInfo) are HDR}, textures will useGLES30.GL_RGBA16FandGLES30.GL_HALF_FLOAT. Otherwise, textures will useGLES20.GL_RGBAandGLES20.GL_UNSIGNED_BYTE.If
inputColorInfooroutputColorInfoColorInfo.isTransferHdr(com.google.android.exoplayer2.video.ColorInfo) are HDR}, color transfers must be enabled.If
outputColorInfois HDR, the context will be configured withGlUtil.EGL_CONFIG_ATTRIBUTES_RGBA_1010102. Otherwise, the context will be configured withGlUtil.EGL_CONFIG_ATTRIBUTES_RGBA_8888.If invoking the
listeneronDefaultVideoFrameProcessor's internal thread is desired, pass adirect listenerExecutor.If texture output is set, VideoFrameProcessor.setOutputSurfaceInfo(com.google.android.exoplayer2.util.SurfaceInfo) and
VideoFrameProcessor.renderOutputFrame(long)will be no-ops, andrenderFramesAutomaticallywill behave as if it is set totrue.- Specified by:
createin interfaceVideoFrameProcessor.Factory- Parameters:
context- AContext.effects- TheEffectinstances to apply to each frame. Applied on theoutputColorInfo's color space.debugViewProvider- ADebugViewProvider.inputColorInfo- TheColorInfofor the input frames.outputColorInfo- TheColorInfofor the output frames.renderFramesAutomatically- Iftrue, the instance will render output frames to the output surface automatically asVideoFrameProcessoris done processing them. Iffalse, theVideoFrameProcessorwill block untilVideoFrameProcessor.renderOutputFrame(long)is called, to render or drop the frame.listenerExecutor- TheExecutoron which thelisteneris invoked.listener- AVideoFrameProcessor.Listener.- Returns:
- A new instance.
- Throws:
VideoFrameProcessingException- If a problem occurs while creating theVideoFrameProcessor.
-
-