public final class

FrameInfo.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.FrameInfo.Builder

Overview

A builder for FrameInfo instances.

Summary

Constructors
publicBuilder(ColorInfo colorInfo, int width, int height)

Creates an instance with default values.

publicBuilder(FrameInfo frameInfo)

Creates an instance with the values of the provided FrameInfo.

Methods
public FrameInfobuild()

Builds a FrameInfo instance.

public FrameInfo.BuildersetColorInfo(ColorInfo colorInfo)

Sets the ColorInfo.

public FrameInfo.BuildersetHeight(int height)

Sets the frame height, in pixels.

public FrameInfo.BuildersetOffsetToAddUs(long offsetToAddUs)

Sets the offset to add to the frame presentation timestamp, in microseconds.

public FrameInfo.BuildersetPixelWidthHeightRatio(float pixelWidthHeightRatio)

Sets the ratio of width over height for each pixel.

public FrameInfo.BuildersetWidth(int width)

Sets the frame width, in pixels.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(ColorInfo colorInfo, int width, int height)

Creates an instance with default values.

Parameters:

colorInfo: The ColorInfo.
width: The frame width, in pixels.
height: The frame height, in pixels.

public Builder(FrameInfo frameInfo)

Creates an instance with the values of the provided FrameInfo.

Methods

public FrameInfo.Builder setColorInfo(ColorInfo colorInfo)

Sets the ColorInfo.

public FrameInfo.Builder setWidth(int width)

Sets the frame width, in pixels.

public FrameInfo.Builder setHeight(int height)

Sets the frame height, in pixels.

public FrameInfo.Builder setPixelWidthHeightRatio(float pixelWidthHeightRatio)

Sets the ratio of width over height for each pixel.

The default value is 1.

public FrameInfo.Builder setOffsetToAddUs(long offsetToAddUs)

Sets the offset to add to the frame presentation timestamp, in microseconds.

The default value is 0.

public FrameInfo build()

Builds a FrameInfo instance.