com.bumptech.glide.load.resource.bitmap
Class VideoBitmapDecoder

java.lang.Object
  extended by com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder
All Implemented Interfaces:
BitmapDecoder<ParcelFileDescriptor>

public class VideoBitmapDecoder
extends Object
implements BitmapDecoder<ParcelFileDescriptor>

An BitmapDecoder that can decode a thumbnail frame Bitmap from a ParcelFileDescriptor containing a video.

See Also:
MediaMetadataRetriever

Constructor Summary
VideoBitmapDecoder()
           
VideoBitmapDecoder(int frame)
           
 
Method Summary
 Bitmap decode(ParcelFileDescriptor resource, BitmapPool bitmapPool, int outWidth, int outHeight, DecodeFormat decodeFormat)
          Returns a decoded bitmap for a given resource and target dimensions.
 String getId()
          Returns some unique String id that distinguishes this decoder from any other decoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VideoBitmapDecoder

public VideoBitmapDecoder()

VideoBitmapDecoder

public VideoBitmapDecoder(int frame)
Method Detail

decode

public Bitmap decode(ParcelFileDescriptor resource,
                     BitmapPool bitmapPool,
                     int outWidth,
                     int outHeight,
                     DecodeFormat decodeFormat)
              throws IOException
Description copied from interface: BitmapDecoder
Returns a decoded bitmap for a given resource and target dimensions.

Specified by:
decode in interface BitmapDecoder<ParcelFileDescriptor>
Parameters:
resource - The resource to decode, managed by the caller, no need to clean it up.
bitmapPool - A bitmap pool that can be used to reuse bitmaps during the load. Any bitmaps created or obtained from the pool other than the bitmap returned by this method should be returned to the pool.
outWidth - The target width for the returned bitmap (need not match exactly).
outHeight - The target height for the returned bitmap (need not match exactly).
decodeFormat - The desired configuration for the returned bitmap.
Throws:
IOException

getId

public String getId()
Description copied from interface: BitmapDecoder
Returns some unique String id that distinguishes this decoder from any other decoder.

This method can return the empty string if for all practical purposes it applies no transformations to the data while loading the resource. For Bitmaps this would mean at a minimum doing no downsampling and also probably always producing Bitmaps with Bitmap.Config.ARGB_8888 as their config.

Specified by:
getId in interface BitmapDecoder<ParcelFileDescriptor>