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!
@CanIgnoreReturnValue
setGlObjectsProviderAndExecutorService(
    glObjectsProvider: GlObjectsProvider!,
    executorService: ExecutorService!
)

Sets the GlObjectsProvider and the ExecutorService to execute OpenGL commands on.

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.

setGlObjectsProviderAndExecutorService

@CanIgnoreReturnValue
fun setGlObjectsProviderAndExecutorService(
    glObjectsProvider: GlObjectsProvider!,
    executorService: ExecutorService!
): DefaultGlFrameProcessor.Factory.Builder!

Sets the GlObjectsProvider and the ExecutorService to execute OpenGL commands on.

If not set, each created DefaultGlFrameProcessor uses a new DefaultGlObjectsProvider and a new single-thread executor, and releases both when it's closed.

If set, the caller owns both. After all the DefaultGlFrameProcessor instances created by the built Factory have been closed, the caller must release the GlObjectsProvider on the ExecutorService's thread, and then shut down the ExecutorService.

Parameters
glObjectsProvider: GlObjectsProvider!

The GlObjectsProvider.

executorService: ExecutorService!

The ExecutorService.

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.