# 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)

*** ** * ** ***


```
public final class BitmapFactoryImageDecoder.Factory implements ImageDecoder.Factory
```

<br />

*** ** * ** ***

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

## Summary

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

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

### Inherited Constants

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

**This field is deprecated.**

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

<br />

## Public constructors

### Factory

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

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

### Factory

```
public Factory(Context context)
```

Creates an instance.

## Public methods

### createImageDecoder

```
public BitmapFactoryImageDecoder createImageDecoder()
```

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

### setMaxOutputSize

```
@CanIgnoreReturnValue
public BitmapFactoryImageDecoder.Factory setMaxOutputSize(int maxOutputSize)
```

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/androidx/media3/common/C#LENGTH_UNSET()` clears any max output size set.

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

### supportsFormat

```
@RendererCapabilities.Capabilities
public int supportsFormat(Format format)
```

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

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

| Returns |
|---|---|
| `int` | The `https://developer.android.com/reference/androidx/media3/exoplayer/RendererCapabilities.Capabilities` of the decoders the factory can instantiate for this format. |