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 the newSingleThreadScheduledExecutor to execute GL commands from.

DefaultVideoFrameProcessor.Factory.Builder!
@CanIgnoreReturnValue
setExperimentalAdjustSurfaceTextureTransformationMatrix(
    experimentalAdjustSurfaceTextureTransformationMatrix: Boolean
)

This function is deprecated.

This experimental method will be removed in a future release.

DefaultVideoFrameProcessor.Factory.Builder!
@CanIgnoreReturnValue
setExperimentalRepeatInputBitmapWithoutResampling(
    experimentalRepeatInputBitmapWithoutResampling: Boolean
)

This function is deprecated.

This experimental method will be removed in a future release.

DefaultVideoFrameProcessor.Factory.Builder!

Sets the GlObjectsProvider.

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

This function is deprecated.

For automatic frame registration ( setRequireRegisteringAllInputFrames(false)), use INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION instead.

DefaultVideoFrameProcessor.Factory.Builder!

Sets the WorkingColorSpace in which frames passed to intermediate effects will be represented.

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

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.

setExperimentalAdjustSurfaceTextureTransformationMatrix

@CanIgnoreReturnValue
fun setExperimentalAdjustSurfaceTextureTransformationMatrix(
    experimentalAdjustSurfaceTextureTransformationMatrix: Boolean
): DefaultVideoFrameProcessor.Factory.Builder!

Sets whether the getTransformMatrix is adjusted to remove the scale that cuts off a 1- or 2-texel border around the edge of a crop.

When set, programs sampling GL_TEXTURE_EXTERNAL_OES from SurfaceTexture must not attempt to access data in any cropped region, including via GL_LINEAR resampling filter.

Defaults to true.

setExperimentalRepeatInputBitmapWithoutResampling

@CanIgnoreReturnValue
fun setExperimentalRepeatInputBitmapWithoutResampling(
    experimentalRepeatInputBitmapWithoutResampling: Boolean
): DefaultVideoFrameProcessor.Factory.Builder!

Sets whether BitmapTextureManager will sample from the input bitmap only once for a sequence of output frames.

Defaults to true. That is, each output frame will sample from the full resolution input bitmap.

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.

Parameters
requireRegisteringAllInputFrames: Boolean

Whether registering every input frame is required.

setSdrWorkingColorSpace

@CanIgnoreReturnValue
fun setSdrWorkingColorSpace(
    @DefaultVideoFrameProcessor.WorkingColorSpace sdrWorkingColorSpace: Int
): DefaultVideoFrameProcessor.Factory.Builder!

Sets the WorkingColorSpace in which frames passed to intermediate effects will be represented.

The default value is WORKING_COLOR_SPACE_LINEAR.

This setter doesn't affect the working color space for HDR output, since the working color space must have a linear transfer function for HDR output.

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.