DefaultVideoFrameProcessor.Factory.Builder


public final class DefaultVideoFrameProcessor.Factory.Builder


A builder for DefaultVideoFrameProcessor.Factory instances.

Summary

Public constructors

Creates an instance.

Public methods

DefaultVideoFrameProcessor.Factory

Builds an DefaultVideoFrameProcessor.Factory instance.

DefaultVideoFrameProcessor.Factory.Builder
@CanIgnoreReturnValue
setEnableColorTransfers(boolean enableColorTransfers)

Sets whether to transfer colors to an intermediate color space when applying effects.

DefaultVideoFrameProcessor.Factory.Builder

Sets the newSingleThreadScheduledExecutor to execute GL commands from.

DefaultVideoFrameProcessor.Factory.Builder

Sets the GlObjectsProvider.

DefaultVideoFrameProcessor.Factory.Builder
@CanIgnoreReturnValue
setRequireRegisteringAllInputFrames(
    boolean requireRegisteringAllInputFrames
)

Sets whether registering every input frame is required.

DefaultVideoFrameProcessor.Factory.Builder
@CanIgnoreReturnValue
setTextureOutput(
    GlTextureProducer.Listener textureOutputListener,
    @IntRange(from = 1) int textureOutputCapacity
)

Sets texture output settings.

Public constructors

Builder

public Builder()

Creates an instance.

Public methods

setEnableColorTransfers

@CanIgnoreReturnValue
public DefaultVideoFrameProcessor.Factory.Builder setEnableColorTransfers(boolean enableColorTransfers)

Sets whether to transfer colors to an intermediate color space when applying effects.

If the input or output is HDR, this must be true.

setExecutorService

@CanIgnoreReturnValue
public DefaultVideoFrameProcessor.Factory.Builder setExecutorService(@Nullable ExecutorService executorService)

Sets the newSingleThreadScheduledExecutor to execute GL commands from.

If set to a non-null value, the ExecutorService must be shut down by the caller after all VideoFrameProcessors using it have been released.

The default value is a new newSingleThreadScheduledExecutor, owned and shutdown by the created DefaultVideoFrameProcessor. Setting a nullExecutorService is equivalent to using the default value.

Parameters
@Nullable ExecutorService executorService

The ExecutorService.

setRequireRegisteringAllInputFrames

@CanIgnoreReturnValue
public DefaultVideoFrameProcessor.Factory.Builder setRequireRegisteringAllInputFrames(
    boolean requireRegisteringAllInputFrames
)

Sets whether registering every input frame is required.

The default value is true, meaning that all frames input to the 's input Surface must be registered before they are rendered. In this mode the input format change between input streams is handled frame-exactly. If false, registerInputFrame can be called only once for each registered input stream before rendering the first frame to the input Surface. The same registered FrameInfo is repeated for the subsequent frames. To ensure the format change between input streams is applied on the right frame, the caller needs to register the new input stream strictly after rendering all frames from the previous input stream. This mode should be used in streams where users don't have direct control over rendering frames, like in a camera feed.

Regardless of the value set, registerInputStream must be called for each input stream to specify the format for upcoming frames before calling registerInputFrame.

setTextureOutput

@CanIgnoreReturnValue
public DefaultVideoFrameProcessor.Factory.Builder setTextureOutput(
    GlTextureProducer.Listener textureOutputListener,
    @IntRange(from = 1) int textureOutputCapacity
)

Sets texture output settings.

If set, the VideoFrameProcessor will output to OpenGL textures, accessible via onTextureRendered. Textures will stop being outputted when the number of output textures available reaches the textureOutputCapacity. To regain capacity, output textures must be released using .

If set, setOutputSurfaceInfo and renderOutputFrame will be no-ops, and renderFramesAutomatically will behave as if it is set to true.

If not set, there will be no texture output.

Parameters
GlTextureProducer.Listener textureOutputListener

The GlTextureProducer.Listener.

@IntRange(from = 1) int textureOutputCapacity

The amount of output textures that may be allocated at a time before texture output blocks. Must be greater than or equal to 1.