@SuppressWarnings("resource")
    // @see ResourceDecoder.decode
    @Override
    public Resource<Bitmap> decode(ImageVideoWrapper source, int width, int height) throws IOException {
        Resource<Bitmap> result = null;
        InputStream is = source.getStream();
        if (is != null) {
            try {
                result = streamDecoder.decode(is, width, height);
            } catch (IOException e) {
                if (Log.isLoggable(TAG, Log.VERBOSE)) {
                    Log.v(TAG, "Failed to load image from stream, trying FileDescriptor", e);
                }
            }
        }

        if (result == null) {
            ParcelFileDescriptor fileDescriptor = source.getFileDescriptor();
            if (fileDescriptor != null) {
                result = fileDescriptorDecoder.decode(fileDescriptor, width, height);
            }
        }
        return result;
    }
A {@link ResourceDecoder} that decodes {@link ImageVideoWrapper}s using
a wrapped {@link ResourceDecoder} for {@link InputStream}s
and a wrapped {@link ResourceDecoder} for {@link ParcelFileDescriptor}s.
The {@link InputStream} data in the {@link ImageVideoWrapper} is always preferred.
core/src/main/java/com/bumptech/glide/load/resource/bitmap/ImageVideoBitmapDecoder.java