public final class

ExportResult.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.transformer.ExportResult.Builder

Overview

A builder for ExportResult instances.

Summary

Constructors
publicBuilder()

Creates a builder.

Methods
public ExportResult.BuilderaddProcessedInputs(java.util.List<ExportResult.ProcessedInput> processedInputs)

Adds processed inputs to the ExportResult.ProcessedInput list.

public ExportResultbuild()

Builds an ExportResult instance.

public voidreset()

Resets all the fields to their default values.

public ExportResult.BuildersetAudioEncoderName(java.lang.String audioEncoderName)

Sets the name of the audio encoder used.

public ExportResult.BuildersetAudioMimeType(java.lang.String audioMimeType)

Sets the output audio mime type.

public ExportResult.BuildersetAverageAudioBitrate(int averageAudioBitrate)

Sets the average audio bitrate.

public ExportResult.BuildersetAverageVideoBitrate(int averageVideoBitrate)

Sets the average video bitrate.

public ExportResult.BuildersetChannelCount(int channelCount)

Sets the channel count.

public ExportResult.BuildersetColorInfo(ColorInfo colorInfo)

Sets the ColorInfo.

public ExportResult.BuildersetDurationMs(long durationMs)

Sets the duration of the output in milliseconds.

public ExportResult.BuildersetExportException(ExportException exportException)

Sets the ExportException that caused the export to fail.

public ExportResult.BuildersetFileSizeBytes(long fileSizeBytes)

Sets the file size in bytes.

public ExportResult.BuildersetHeight(int height)

Sets the height.

public ExportResult.BuildersetOptimizationResult(int optimizationResult)

Sets to indicate an optimization as been successful, or has failed and normal export proceeded instead.

public ExportResult.BuildersetSampleRate(int sampleRate)

Sets the sample rate.

public ExportResult.BuildersetVideoEncoderName(java.lang.String videoEncoderName)

Sets the name of the video encoder used.

public ExportResult.BuildersetVideoFrameCount(int videoFrameCount)

Sets the number of video frames.

public ExportResult.BuildersetVideoMimeType(java.lang.String videoMimeType)

Sets the output video mime type.

public ExportResult.BuildersetWidth(int width)

Sets the width.

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

Constructors

public Builder()

Creates a builder.

Methods

public ExportResult.Builder addProcessedInputs(java.util.List<ExportResult.ProcessedInput> processedInputs)

Adds processed inputs to the ExportResult.ProcessedInput list.

public ExportResult.Builder setDurationMs(long durationMs)

Sets the duration of the output in milliseconds.

Must be positive or C.TIME_UNSET.

public ExportResult.Builder setFileSizeBytes(long fileSizeBytes)

Sets the file size in bytes.

Must be positive or C.LENGTH_UNSET.

public ExportResult.Builder setAverageAudioBitrate(int averageAudioBitrate)

Sets the average audio bitrate.

Must be positive or C.RATE_UNSET_INT.

public ExportResult.Builder setChannelCount(int channelCount)

Sets the channel count.

Must be positive or C.LENGTH_UNSET.

public ExportResult.Builder setSampleRate(int sampleRate)

Sets the sample rate.

Must be positive or C.RATE_UNSET_INT.

public ExportResult.Builder setAudioEncoderName(java.lang.String audioEncoderName)

Sets the name of the audio encoder used.

public ExportResult.Builder setAudioMimeType(java.lang.String audioMimeType)

Sets the output audio mime type.

public ExportResult.Builder setAverageVideoBitrate(int averageVideoBitrate)

Sets the average video bitrate.

Must be positive or C.RATE_UNSET_INT.

public ExportResult.Builder setColorInfo(ColorInfo colorInfo)

Sets the ColorInfo.

public ExportResult.Builder setHeight(int height)

Sets the height.

Must be positive or C.LENGTH_UNSET.

public ExportResult.Builder setWidth(int width)

Sets the width.

Must be positive or C.LENGTH_UNSET.

public ExportResult.Builder setVideoFrameCount(int videoFrameCount)

Sets the number of video frames.

Must be positive or 0.

public ExportResult.Builder setVideoEncoderName(java.lang.String videoEncoderName)

Sets the name of the video encoder used.

public ExportResult.Builder setVideoMimeType(java.lang.String videoMimeType)

Sets the output video mime type.

public ExportResult.Builder setOptimizationResult(int optimizationResult)

Sets to indicate an optimization as been successful, or has failed and normal export proceeded instead.

The default value is ExportResult.OPTIMIZATION_NONE.

Parameters:

optimizationResult: The .

Returns:

This ExportResult.Builder.

public ExportResult.Builder setExportException(ExportException exportException)

Sets the ExportException that caused the export to fail.

public ExportResult build()

Builds an ExportResult instance.

public void reset()

Resets all the fields to their default values.