DefaultGlFrameProcessor.Factory.Builder


class DefaultGlFrameProcessor.Factory.Builder


A builder for Factory instances.

Summary

Public constructors

Builder(context: Context!)

Creates an instance.

Public functions

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

Builder(context: Context!)

Creates an instance.

Parameters
context: Context!

The Context.

Public functions

build

fun build(): DefaultGlFrameProcessor.Factory!

Builds a Factory instance.

setGlObjectsProviderSupplier

@CanIgnoreReturnValue
fun setGlObjectsProviderSupplier(
    glObjectsProviderSupplier: Supplier<GlObjectsProvider!>!
): DefaultGlFrameProcessor.Factory.Builder!

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
glObjectsProviderSupplier: Supplier<GlObjectsProvider!>!

The Supplier of GlObjectsProvider instances.

setHardwareBufferJniWrapper

@CanIgnoreReturnValue
fun setHardwareBufferJniWrapper(
    hardwareBufferJniWrapper: HardwareBufferJniWrapper!
): DefaultGlFrameProcessor.Factory.Builder!

Sets the HardwareBufferJniWrapper.

The default value is INSTANCE.

Parameters
hardwareBufferJniWrapper: HardwareBufferJniWrapper!

The HardwareBufferJniWrapper.

setWorkingColorSpace

@CanIgnoreReturnValue
fun setWorkingColorSpace(workingColorSpace: ColorInfo!): DefaultGlFrameProcessor.Factory.Builder!

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
workingColorSpace: ColorInfo!

The working ColorInfo.

Throws
java.lang.IllegalArgumentException

If workingColorSpace is not supported.