DefaultVideoFrameProcessor.Factory.Builder


class DefaultVideoFrameProcessor.Factory.Builder


A builder for DefaultVideoFrameProcessor.Factory instances.

Summary

Public constructors

Creates an instance.

Public functions

DefaultVideoFrameProcessor.Factory!

Builds an DefaultVideoFrameProcessor.Factory instance.

DefaultVideoFrameProcessor.Factory.Builder!

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(
    requireRegisteringAllInputFrames: Boolean
)

Sets whether registering every input frame is required.

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

Sets texture output settings.

Public constructors

Builder

Builder()

Creates an instance.

Public functions

setEnableColorTransfers

@CanIgnoreReturnValue
fun setEnableColorTransfers(enableColorTransfers: Boolean): DefaultVideoFrameProcessor.Factory.Builder!

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
fun setExecutorService(executorService: ExecutorService?): DefaultVideoFrameProcessor.Factory.Builder!

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
executorService: ExecutorService?

The ExecutorService.

setRequireRegisteringAllInputFrames

@CanIgnoreReturnValue
fun setRequireRegisteringAllInputFrames(
    requireRegisteringAllInputFrames: Boolean
): DefaultVideoFrameProcessor.Factory.Builder!

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
fun setTextureOutput(
    textureOutputListener: GlTextureProducer.Listener!,
    textureOutputCapacity: @IntRange(from = 1) Int
): DefaultVideoFrameProcessor.Factory.Builder!

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
textureOutputListener: GlTextureProducer.Listener!

The GlTextureProducer.Listener.

textureOutputCapacity: @IntRange(from = 1) Int

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