DefaultGlFrameProcessor.Factory.Builder


public final class DefaultGlFrameProcessor.Factory.Builder


A builder for Factory instances.

Summary

Public constructors

Builder(Context context)

Creates an instance.

Public methods

DefaultGlFrameProcessor.Factory

Builds a Factory instance.

DefaultGlFrameProcessor.Factory.Builder

Sets a Supplier that provides a new GlObjectsProvider for each created DefaultGlFrameProcessor.

DefaultGlFrameProcessor.Factory.Builder

Sets the HardwareBufferJniWrapper.

DefaultGlFrameProcessor.Factory.Builder

Sets the working color space, which is the color space of frames as they move through the pipeline.

Public constructors

Builder

public Builder(Context context)

Creates an instance.

Parameters
Context context

The Context.

Public methods

build

public DefaultGlFrameProcessor.Factory build()

Builds a Factory instance.

setGlObjectsProviderSupplier

@CanIgnoreReturnValue
public DefaultGlFrameProcessor.Factory.Builder setGlObjectsProviderSupplier(
    Supplier<GlObjectsProvider> glObjectsProviderSupplier
)

Sets a Supplier that provides a new GlObjectsProvider for each created DefaultGlFrameProcessor.

Each created DefaultGlFrameProcessor executes OpenGL commands on a new, internal single-thread executor, and releases its GlObjectsProvider on that executor's thread when it's closed. Every call to get must return a new GlObjectsProvider instance.

The default value is DefaultGlObjectsProvider::new.

Parameters
Supplier<GlObjectsProvider> glObjectsProviderSupplier

The Supplier of GlObjectsProvider instances.

setHardwareBufferJniWrapper

@CanIgnoreReturnValue
public DefaultGlFrameProcessor.Factory.Builder setHardwareBufferJniWrapper(
    HardwareBufferJniWrapper hardwareBufferJniWrapper
)

Sets the HardwareBufferJniWrapper.

The default value is INSTANCE.

Parameters
HardwareBufferJniWrapper hardwareBufferJniWrapper

The HardwareBufferJniWrapper.

setWorkingColorSpace

@CanIgnoreReturnValue
public DefaultGlFrameProcessor.Factory.Builder setWorkingColorSpace(ColorInfo workingColorSpace)

Sets the working color space, which is the color space of frames as they move through the pipeline. Input frames are converted to it, and effects receive frames in it. Effects other than ColorConversion also output frames in it.

Supported values are BT2020_LINEAR, BT2020_HLG, BT709_LINEAR and BT709_SRGB.

Before frames are written to the FrameWriter, frames in a linear working color space are converted to an electrical color space: BT2020_LINEAR to BT2020_HLG, and BT709_LINEAR to BT709_SRGB. Frames in an electrical working color space are written unchanged. A ColorConversion applied as the last effect overrides both.

When the working color space is BT.709, HDR input is tone mapped to SDR. Ultra HDR gain maps are only applied when the working color space is BT.2020, on API 34+.

If not set, the working color space is resolved from the first input frame: BT2020_LINEAR for HDR video and Ultra HDR images, and BT709_SRGB otherwise.

Parameters
ColorInfo workingColorSpace

The working ColorInfo.

Throws
java.lang.IllegalArgumentException

If workingColorSpace is not supported.