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 forDefaultVideoFrameProcessor
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultVideoFrameProcessor.Factory.Builder
A builder forDefaultVideoFrameProcessor.Factory
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultVideoFrameProcessor
create(Context context, List<Effect> effects, DebugViewProvider debugViewProvider, ColorInfo inputColorInfo, ColorInfo outputColorInfo, boolean renderFramesAutomatically, Executor listenerExecutor, VideoFrameProcessor.Listener listener)
Creates a newVideoFrameProcessor
instance.
-
-
-
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 newVideoFrameProcessor
instance.All
Effect
instances must beGlEffect
instances.Using HDR
inputColorInfo
requires theEXT_YUV_target
OpenGL extension.Using HDR
inputColorInfo
oroutputColorInfo
requires OpenGL ES 3.0.If outputting HDR content to a display,
EGL_GL_COLORSPACE_BT2020_PQ_EXT
is required, andoutputColorInfo.colorTransfer
must beC.COLOR_TRANSFER_ST2084
.Effect
s are applied onC.COLOR_RANGE_FULL
colors withnull
ColorInfo.hdrStaticInfo
.inputColorInfo
'sColorInfo.hdrStaticInfo
andoutputColorInfo
'sColorInfo.colorRange
values are currently ignored, in favor ofnull
andC.COLOR_RANGE_FULL
, respectively.If
inputColorInfo
oroutputColorInfo
ColorInfo.isTransferHdr(com.google.android.exoplayer2.video.ColorInfo) are HDR}, textures will useGLES30.GL_RGBA16F
andGLES30.GL_HALF_FLOAT
. Otherwise, textures will useGLES20.GL_RGBA
andGLES20.GL_UNSIGNED_BYTE
.If
inputColorInfo
oroutputColorInfo
ColorInfo.isTransferHdr(com.google.android.exoplayer2.video.ColorInfo) are HDR}, color transfers must be enabled.If
outputColorInfo
is 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
listener
onDefaultVideoFrameProcessor
'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, andrenderFramesAutomatically
will behave as if it is set totrue
.- Specified by:
create
in interfaceVideoFrameProcessor.Factory
- Parameters:
context
- AContext
.effects
- TheEffect
instances to apply to each frame. Applied on theoutputColorInfo
's color space.debugViewProvider
- ADebugViewProvider
.inputColorInfo
- TheColorInfo
for the input frames.outputColorInfo
- TheColorInfo
for the output frames.renderFramesAutomatically
- Iftrue
, the instance will render output frames to the output surface automatically asVideoFrameProcessor
is done processing them. Iffalse
, theVideoFrameProcessor
will block untilVideoFrameProcessor.renderOutputFrame(long)
is called, to render or drop the frame.listenerExecutor
- TheExecutor
on which thelistener
is invoked.listener
- AVideoFrameProcessor.Listener
.- Returns:
- A new instance.
- Throws:
VideoFrameProcessingException
- If a problem occurs while creating theVideoFrameProcessor
.
-
-