# BitmapFactoryImageDecoder.Factory

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.java+class:androidx.media3.exoplayer.image.BitmapFactoryImageDecoder.Factory)

*** ** * ** ***


```
class BitmapFactoryImageDecoder.Factory : ImageDecoder.Factory
```

<br />

*** ** * ** ***

A factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder` instances.

## Summary

| ### Public constructors |
|---|
| `[Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#Factory())()` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#Factory(android.content.Context)` instead. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#Factory(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html!)` Creates an instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#createImageDecoder()()` Creates a new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#setMaxOutputSize(int)(maxOutputSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the maximum size of `https://developer.android.com/reference/android/graphics/Bitmap.html` instances decoded by decoders produced by this factory. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RendererCapabilities.Capabilities https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#supportsFormat(androidx.media3.common.Format)(format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!)` Returns the highest `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RendererCapabilities.Capabilities` of the factory's decoders for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`. |

### Inherited Constants

From [androidx.media3.exoplayer.image.ImageDecoder.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder.Factory) `const https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder.Factory!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder.Factory#DEFAULT()`

**This property is deprecated.**

Instantiate a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory` directly.

<br />

## Public constructors

### Factory

```
[Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#Factory())()
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory#Factory(android.content.Context)` instead.

### Factory

```
Factory(context: Context!)
```

Creates an instance.

## Public functions

### createImageDecoder

```
fun createImageDecoder(): BitmapFactoryImageDecoder!
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder`.

### setMaxOutputSize

```
@CanIgnoreReturnValue
fun setMaxOutputSize(maxOutputSize: Int): BitmapFactoryImageDecoder.Factory!
```

Sets the maximum size of `https://developer.android.com/reference/android/graphics/Bitmap.html` instances decoded by decoders produced by this factory.

This overrides any maximum size derived from the display via `https://developer.android.com/reference/android/content/Context.html`. Passing `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` clears any max output size set.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/BitmapFactoryImageDecoder.Factory!` | This factory, for convenience. |

### supportsFormat

```
@RendererCapabilities.Capabilities
fun supportsFormat(format: Format!): Int
```

Returns the highest `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RendererCapabilities.Capabilities` of the factory's decoders for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`.

| Parameters |
|---|---|
| `format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RendererCapabilities.Capabilities` of the decoders the factory can instantiate for this format. |