Back to Exoplayer

DataSourceBitmapLoader (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/DataSourceBitmapLoader.html

latest7.3 KB
Original Source

Package com.google.android.exoplayer2.upstream

Class DataSourceBitmapLoader

  • java.lang.Object

    • com.google.android.exoplayer2.upstream.DataSourceBitmapLoader
  • All Implemented Interfaces:BitmapLoader


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDataSourceBitmapLoaderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[BitmapLoader](../util/BitmapLoader.html "interface in com.google.android.exoplayer2.util")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

A BitmapLoader implementation that uses a DataSource to support fetching images from URIs.

Loading tasks are delegated to a ListeningExecutorService defined during construction. If no executor service is passed, all tasks are delegated to a single-thread executor service that is shared between instances of this class.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static Supplier<ListeningExecutorService> | DEFAULT_EXECUTOR_SERVICE | Deprecated. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | DataSourceBitmapLoader​(Context context) | Deprecated.

Creates an instance that uses a DefaultHttpDataSource for image loading and delegates loading tasks to a Executors.newSingleThreadExecutor(). | | DataSourceBitmapLoader​(ListeningExecutorService listeningExecutorService, DataSource.Factory dataSourceFactory) | Deprecated.

Creates an instance that delegates loading tasks to the ListeningExecutorService. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | ListenableFuture<Bitmap> | decodeBitmap​(byte[] data) | Deprecated.

Decodes an image from compressed binary data. | | ListenableFuture<Bitmap> | loadBitmap​(Uri uri) | Deprecated.

Loads an image from a Uri. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

- 

Methods inherited from interface com.google.android.exoplayer2.util.BitmapLoader

loadBitmapFromMetadata

Field Detail

- 

DEFAULT_EXECUTOR_SERVICE

public static final[Supplier](https://guava.dev/releases/31.1-android/api/docs/com/google/common/base/Supplier.html?is-external=true "class or interface in com.google.common.base")<[ListeningExecutorService](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListeningExecutorService.html?is-external=true "class or interface in com.google.common.util.concurrent")> DEFAULT_EXECUTOR_SERVICE

Deprecated.

Constructor Detail

- 

DataSourceBitmapLoader

public DataSourceBitmapLoader​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)

Deprecated.

Creates an instance that uses a DefaultHttpDataSource for image loading and delegates loading tasks to a Executors.newSingleThreadExecutor().

- 

DataSourceBitmapLoader

public DataSourceBitmapLoader​([ListeningExecutorService](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListeningExecutorService.html?is-external=true "class or interface in com.google.common.util.concurrent")listeningExecutorService,[DataSource.Factory](DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")dataSourceFactory)

Deprecated.

Creates an instance that delegates loading tasks to the ListeningExecutorService. Parameters:listeningExecutorService - The ListeningExecutorService.dataSourceFactory - The DataSource.Factory that creates the DataSource used to load the image.

Method Detail

- 

decodeBitmap

public[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html "class or interface in android.graphics")> decodeBitmap​(byte[] data)

Deprecated.

Description copied from interface: BitmapLoader

Decodes an image from compressed binary data. Specified by:decodeBitmap in interface BitmapLoader

- 

loadBitmap

public[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html "class or interface in android.graphics")> loadBitmap​([Uri](https://developer.android.com/reference/android/net/Uri.html?is-external=true "class or interface in android.net")uri)

Deprecated.

Loads an image from a Uri. Specified by:loadBitmap in interface BitmapLoader