@ExperimentalApi
public interface Frame

Known direct subclasses

Holds a frame of video data.

Pixel data is accessible via subtypes.

Summary

Nested types

@Retention(value = RetentionPolicy.SOURCE)
@Target(value = ElementType.TYPE_USE)
@LongDef(flag = true, value = )
public annotation Frame.Usage

Flags that define how frames are used.

Constants

default static final String
KEY_DISPLAY_TIME_NS = "KEY_DISPLAY_TIME_NS"

Metadata key for storing the system time that this frame should be displayed at to maintain A/V sync.

default static final String
KEY_PRESENTATION_TIME_US = "KEY_PRESENTATION_TIME_US"

Metadata key for storing the composition presentation time of this frame, in microseconds.

default static final long

The frame will be used as a hardware composer overlay layer.

default static final long

The frame will often be read by the CPU.

default static final long

The frame will sometimes be read by the CPU.

default static final long

The frame will often be written to by the CPU.

default static final long

The frame will sometimes be written to by the CPU.

default static final long

The frame will be written to by the GPU.

default static final long

The frame will be read from by the GPU.

default static final long

The frame will be read by a hardware video encoder.

Public methods

abstract long

The time of the frame in the context of the input media in microseconds, or TIME_UNSET if it is not set.

abstract Format

The frame format.

abstract ImmutableMap<StringObject>

The frame metadata.

Constants

KEY_DISPLAY_TIME_NS

default static final String KEY_DISPLAY_TIME_NS = "KEY_DISPLAY_TIME_NS"

Metadata key for storing the system time that this frame should be displayed at to maintain A/V sync. The value should be a Long.

KEY_PRESENTATION_TIME_US

default static final String KEY_PRESENTATION_TIME_US = "KEY_PRESENTATION_TIME_US"

Metadata key for storing the composition presentation time of this frame, in microseconds. The value should be a Long.

USAGE_COMPOSER_OVERLAY

default static final long USAGE_COMPOSER_OVERLAY = 2048

The frame will be used as a hardware composer overlay layer. That is, it will be displayed using the system compositor via android.view.SurfaceControl.

USAGE_CPU_READ_OFTEN

default static final long USAGE_CPU_READ_OFTEN = 3

The frame will often be read by the CPU.

USAGE_CPU_READ_RARELY

default static final long USAGE_CPU_READ_RARELY = 2

The frame will sometimes be read by the CPU.

USAGE_CPU_WRITE_OFTEN

default static final long USAGE_CPU_WRITE_OFTEN = 48

The frame will often be written to by the CPU.

USAGE_CPU_WRITE_RARELY

default static final long USAGE_CPU_WRITE_RARELY = 32

The frame will sometimes be written to by the CPU.

USAGE_GPU_COLOR_OUTPUT

default static final long USAGE_GPU_COLOR_OUTPUT = 512

The frame will be written to by the GPU.

USAGE_GPU_SAMPLED_IMAGE

default static final long USAGE_GPU_SAMPLED_IMAGE = 256

The frame will be read from by the GPU.

USAGE_VIDEO_ENCODE

default static final long USAGE_VIDEO_ENCODE = 65536

The frame will be read by a hardware video encoder.

Public methods

getContentTimeUs

abstract long getContentTimeUs()

The time of the frame in the context of the input media in microseconds, or TIME_UNSET if it is not set.

getFormat

abstract Format getFormat()

The frame format.

getMetadata

abstract ImmutableMap<StringObjectgetMetadata()

The frame metadata.