HardwareBufferFrameQueue.FrameFormat.Builder


public final class HardwareBufferFrameQueue.FrameFormat.Builder


A builder for FrameFormat instances.

Summary

Public constructors

Creates a new builder with default values.

Public constructors

Builder

public Builder()

Creates a new builder with default values.

Width and height default to 0, pixelFormat defaults to RGBA_8888, usageFlags defaults to USAGE_GPU_SAMPLED_IMAGE, and ColorInfo defaults to SDR_BT709_LIMITED.

Public methods

build

public HardwareBufferFrameQueue.FrameFormat build()

Builds the FrameFormat instance.

setHeight

@CanIgnoreReturnValue
public HardwareBufferFrameQueue.FrameFormat.Builder setHeight(int height)

Sets the height of the buffer in pixels.

Parameters
int height

The height.

setPixelFormat

@CanIgnoreReturnValue
public HardwareBufferFrameQueue.FrameFormat.Builder setPixelFormat(int pixelFormat)

Sets the format of the HardwareBuffer.

Parameters
int pixelFormat

The pixel format.

setUsageFlags

@CanIgnoreReturnValue
public HardwareBufferFrameQueue.FrameFormat.Builder setUsageFlags(long usageFlags)

Sets the usage flags of the HardwareBuffer.

Parameters
long usageFlags

The usage flags.

setWidth

@CanIgnoreReturnValue
public HardwareBufferFrameQueue.FrameFormat.Builder setWidth(int width)

Sets the width of the buffer in pixels.

Parameters
int width

The width.