package j5;

import android.graphics.Bitmap;
import android.graphics.ImageDecoder;
import android.util.Log;
import java.io.IOException;
import java.nio.ByteBuffer;

/* JADX INFO: loaded from: classes.dex */
public final class c implements a5.m {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f28640a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f28641b;

    public /* synthetic */ c(Object obj, int i10) {
        this.f28640a = i10;
        this.f28641b = obj;
    }

    @Override // a5.m
    public final boolean a(Object obj, a5.l lVar) {
        switch (this.f28640a) {
            case 0:
                j4.a.w(obj);
                break;
            case 1:
                break;
            default:
                ((n) this.f28641b).getClass();
                break;
        }
        return true;
    }

    public final d b(ImageDecoder.Source source, int i10, int i11, a5.l lVar) throws IOException {
        Bitmap bitmapDecodeBitmap = ImageDecoder.decodeBitmap(source, new i5.b(i10, i11, lVar));
        if (Log.isLoggable("BitmapImageDecoder", 2)) {
            bitmapDecodeBitmap.getWidth();
            bitmapDecodeBitmap.getHeight();
        }
        return new d(bitmapDecodeBitmap, (c5.e) this.f28641b);
    }

    @Override // a5.m
    public final com.bumptech.glide.load.engine.e0 decode(Object obj, int i10, int i11, a5.l lVar) {
        int i12 = this.f28640a;
        Object obj2 = this.f28641b;
        switch (i12) {
            case 0:
                return b(j4.a.d(obj), i10, i11, lVar);
            case 1:
                return d.obtain(((y4.e) ((y4.a) obj)).getNextFrame(), (c5.e) obj2);
            default:
                n nVar = (n) obj2;
                return nVar.a(new u(nVar.f28675d, (ByteBuffer) obj, nVar.f28674c), i10, i11, lVar, n.f28670j);
        }
    }

    public c() {
        this.f28640a = 0;
        this.f28641b = new c5.f();
    }
}
