AudioProcessor.StreamMetadata.Builder


public final class AudioProcessor.StreamMetadata.Builder


A builder for StreamMetadata.

Summary

Public constructors

Creates a new builder.

Public methods

AudioProcessor.StreamMetadata

Builds a StreamMetadata instance.

AudioProcessor.StreamMetadata.Builder

Sets the period UID of the current playback this audio processor is used for.

AudioProcessor.StreamMetadata.Builder

Sets the stream position in microseconds from which the processor will start receiving input buffers after a call to flush.

AudioProcessor.StreamMetadata.Builder

Sets the Timeline of the current playback this audio processor is used for.

Public constructors

Builder

public Builder()

Creates a new builder.

Public methods

build

public AudioProcessor.StreamMetadata build()

Builds a StreamMetadata instance.

setPeriodUid

@CanIgnoreReturnValue
public AudioProcessor.StreamMetadata.Builder setPeriodUid(@Nullable Object periodUid)

Sets the period UID of the current playback this audio processor is used for.

If the period UID is non-null and the provided Timeline non-empty, this UID must be present in the provided Timeline.

Parameters
@Nullable Object periodUid

The period UID or null to leave it undefined.

setPositionOffsetUs

@CanIgnoreReturnValue
public AudioProcessor.StreamMetadata.Builder setPositionOffsetUs(long positionOffsetUs)

Sets the stream position in microseconds from which the processor will start receiving input buffers after a call to flush.

The position offset is aligned to the Window start position.

The offset value is up-to-date at the time of the flush call, but might change due to updates to the media structure. In that case, the offset value will not be updated until the next call to flush.

Parameters
long positionOffsetUs

The stream position offset in microseconds.

setTimeline

@CanIgnoreReturnValue
public AudioProcessor.StreamMetadata.Builder setTimeline(Timeline timeline)

Sets the Timeline of the current playback this audio processor is used for.

Parameters
Timeline timeline

The Timeline.