@Override
    public Bitmap decode(ParcelFileDescriptor resource, BitmapPool bitmapPool, int outWidth, int outHeight,
            DecodeFormat decodeFormat)
            throws IOException {
        MediaMetadataRetriever mediaMetadataRetriever = factory.build();
        mediaMetadataRetriever.setDataSource(resource.getFileDescriptor());
        Bitmap result;
        if (frame >= 0) {
          result = mediaMetadataRetriever.getFrameAtTime(frame);
        } else {
          result = mediaMetadataRetriever.getFrameAtTime();
        }
        mediaMetadataRetriever.release();
        resource.close();
        return result;
    }
An {@link BitmapDecoder} that can decode a thumbnail frame
{@link Bitmap} from a {@link ParcelFileDescriptor} containing a video.

@see MediaMetadataRetriever
core/src/main/java/com/bumptech/glide/load/resource/bitmap/VideoBitmapDecoder.java