> Documentation index: https://developer.android.com/reference/llms.txt

# ExportResult.Builder

Artifact: [androidx.media3:media3-transformer](https://developer.android.com/jetpack/androidx/releases/media3.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/media3/transformer/ExportResult.java+class:androidx.media3.transformer.ExportResult.Builder)

*** ** * ** ***


```
class ExportResult.Builder
```

<br />

*** ** * ** ***

A builder for `ExportResult` instances.

## Summary

| ### Public constructors |
|---|
| `Builder()` Creates a builder. |

| ### Public functions |
|---|---|
| `ExportResult.Builder!` | `@CanIgnoreReturnValue addProcessedInputs( processedInputs: (Mutable)List<ExportResult.ProcessedInput!>! )` Adds `processed inputs` to the `ProcessedInput` list. |
| `ExportResult!` | `build()` Builds an `ExportResult` instance. |
| `Unit` | `reset()` Resets all the fields to their default values. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setApproximateDurationMs(approximateDurationMs: Long)` Sets the approximate duration of the output in milliseconds. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setAudioEncoderName(audioEncoderName: String?)` Sets the name of the audio encoder used. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setAudioMimeType(audioMimeType: String?)` Sets the output audio `mime type`. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setAverageAudioBitrate(averageAudioBitrate: Int)` Sets the average audio bitrate. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setAverageVideoBitrate(averageVideoBitrate: Int)` Sets the average video bitrate. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setChannelCount(channelCount: Int)` Sets the channel count. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setColorInfo(colorInfo: ColorInfo?)` Sets the `ColorInfo`. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setExportException(exportException: ExportException?)` Sets the `ExportException` that caused the export to fail. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setFileSizeBytes(fileSizeBytes: Long)` Sets the file size in bytes. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setHeight(height: Int)` Sets the height. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setOptimizationResult(optimizationResult: Int)` Sets `OptimizationResult` to indicate an optimization as been successful, or has failed and normal export proceeded instead. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setSampleRate(sampleRate: Int)` Sets the sample rate. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setVideoEncoderName(videoEncoderName: String?)` Sets the name of the video encoder used. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setVideoFrameCount(videoFrameCount: Int)` Sets the number of video frames. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setVideoMimeType(videoMimeType: String?)` Sets the output video `mime type`. |
| `ExportResult.Builder!` | `@CanIgnoreReturnValue setWidth(width: Int)` Sets the width. |

## Public constructors

### Builder

```
Builder()
```

Creates a builder.

## Public functions

### addProcessedInputs

```
@CanIgnoreReturnValue
fun addProcessedInputs(
    processedInputs: (Mutable)List<ExportResult.ProcessedInput!>!
): ExportResult.Builder!
```

Adds `processed inputs` to the `ProcessedInput` list.

### build

```
fun build(): ExportResult!
```

Builds an `ExportResult` instance.

### reset

```
fun reset(): Unit
```

Resets all the fields to their default values.

### setApproximateDurationMs

```
@CanIgnoreReturnValue
fun setApproximateDurationMs(approximateDurationMs: Long): ExportResult.Builder!
```

Sets the approximate duration of the output in milliseconds.

Must be positive or `TIME_UNSET`.

### setAudioEncoderName

```
@CanIgnoreReturnValue
fun setAudioEncoderName(audioEncoderName: String?): ExportResult.Builder!
```

Sets the name of the audio encoder used.

### setAudioMimeType

```
@CanIgnoreReturnValue
fun setAudioMimeType(audioMimeType: String?): ExportResult.Builder!
```

Sets the output audio `mime type`.

### setAverageAudioBitrate

```
@CanIgnoreReturnValue
fun setAverageAudioBitrate(averageAudioBitrate: Int): ExportResult.Builder!
```

Sets the average audio bitrate.

Must be positive or `RATE_UNSET_INT`.

### setAverageVideoBitrate

```
@CanIgnoreReturnValue
fun setAverageVideoBitrate(averageVideoBitrate: Int): ExportResult.Builder!
```

Sets the average video bitrate.

Must be positive or `RATE_UNSET_INT`.

### setChannelCount

```
@CanIgnoreReturnValue
fun setChannelCount(channelCount: Int): ExportResult.Builder!
```

Sets the channel count.

Must be positive or `LENGTH_UNSET`.

### setColorInfo

```
@CanIgnoreReturnValue
fun setColorInfo(colorInfo: ColorInfo?): ExportResult.Builder!
```

Sets the `ColorInfo`.

### setExportException

```
@CanIgnoreReturnValue
fun setExportException(exportException: ExportException?): ExportResult.Builder!
```

Sets the `ExportException` that caused the export to fail.

### setFileSizeBytes

```
@CanIgnoreReturnValue
fun setFileSizeBytes(fileSizeBytes: Long): ExportResult.Builder!
```

Sets the file size in bytes.

Must be positive or `LENGTH_UNSET`.

### setHeight

```
@CanIgnoreReturnValue
fun setHeight(height: Int): ExportResult.Builder!
```

Sets the height.

Must be positive or `LENGTH_UNSET`.

### setOptimizationResult

```
@CanIgnoreReturnValue
fun setOptimizationResult(optimizationResult: Int): ExportResult.Builder!
```

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

The default value is `OPTIMIZATION_NONE`.

| Parameters |
|---|---|
| `optimizationResult: Int` | The `OptimizationResult`. |

| Returns |
|---|---|
| `ExportResult.Builder!` | This `Builder`. |

### setSampleRate

```
@CanIgnoreReturnValue
fun setSampleRate(sampleRate: Int): ExportResult.Builder!
```

Sets the sample rate.

Must be positive or `RATE_UNSET_INT`.

### setVideoEncoderName

```
@CanIgnoreReturnValue
fun setVideoEncoderName(videoEncoderName: String?): ExportResult.Builder!
```

Sets the name of the video encoder used.

### setVideoFrameCount

```
@CanIgnoreReturnValue
fun setVideoFrameCount(videoFrameCount: Int): ExportResult.Builder!
```

Sets the number of video frames.

Must be positive or `0`.

### setVideoMimeType

```
@CanIgnoreReturnValue
fun setVideoMimeType(videoMimeType: String?): ExportResult.Builder!
```

Sets the output video `mime type`.

### setWidth

```
@CanIgnoreReturnValue
fun setWidth(width: Int): ExportResult.Builder!
```

Sets the width.

Must be positive or `LENGTH_UNSET`.