package ඓ.ῲ.K.ᕣ.ᨨ;

import android.util.Log;
import com.bumptech.glide.Registry;
import com.bumptech.glide.load.DataSource;
import java.util.Collections;
import java.util.List;
import ඓ.ῲ.K.ᓣ.C0847;
import ඓ.ῲ.K.ᕣ.AbstractC1029;
import ඓ.ῲ.K.ᕣ.AbstractC1031;
import ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1021;
import ඓ.ῲ.K.ᕣ.㳳.AbstractC1033;
import ඓ.ῲ.K.ᕣ.㿎.AbstractC1146;

/* renamed from: ඓ.ῲ.K.ᕣ.ᨨ.ᑓ  reason: contains not printable characters */
/* compiled from: SourceGenerator */
public class C0941 implements AbstractC1021, AbstractC1021.AbstractC1022 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final AbstractC1021.AbstractC1022 f4255;

    /* renamed from: ඓ  reason: contains not printable characters */
    public C0934 f4256;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final C0956<?> f4257;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public volatile AbstractC1033.C1034<?> f4258;

    /* renamed from: 㴹  reason: contains not printable characters */
    public Object f4259;

    /* renamed from: 㸾  reason: contains not printable characters */
    public int f4260;

    /* renamed from: 㿎  reason: contains not printable characters */
    public C1024 f4261;

    public C0941(C0956<?> r1, AbstractC1021.AbstractC1022 k) {
        this.f4257 = r1;
        this.f4255 = k;
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1021
    public void cancel() {
        AbstractC1033.C1034<?> k = this.f4258;
        if (k != null) {
            k.f4474.cancel();
        }
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1021.AbstractC1022
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m2664() {
        throw new UnsupportedOperationException();
    }

    /* JADX INFO: finally extract failed */
    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1021
    /* renamed from: K  reason: contains not printable characters */
    public boolean m2667() {
        Object obj = this.f4259;
        if (obj != null) {
            this.f4259 = null;
            long r3 = C0847.m2463();
            try {
                AbstractC1031 r5 = this.f4257.f4302.f4849.f2183.m2411(obj.getClass());
                if (r5 != null) {
                    C0940 r6 = new C0940(r5, obj, this.f4257.f4308);
                    this.f4261 = new C1024(this.f4258.f4476, this.f4257.f4303);
                    this.f4257.m2710().m2800(this.f4261, r6);
                    if (Log.isLoggable("SourceGenerator", 2)) {
                        Log.v("SourceGenerator", "Finished encoding source to cache, key: " + this.f4261 + ", data: " + obj + ", encoder: " + r5 + ", duration: " + C0847.m2462(r3));
                    }
                    this.f4258.f4474.m3065();
                    this.f4256 = new C0934(Collections.singletonList(this.f4258.f4476), this.f4257, this);
                } else {
                    throw new Registry.NoSourceEncoderAvailableException(obj.getClass());
                }
            } catch (Throwable th) {
                this.f4258.f4474.m3065();
                throw th;
            }
        }
        C0934 r0 = this.f4256;
        if (r0 != null && r0.m2652()) {
            return true;
        }
        this.f4256 = null;
        this.f4258 = null;
        boolean z = false;
        while (!z) {
            if (!(this.f4260 < this.f4257.m2708().size())) {
                break;
            }
            List<AbstractC1033.C1034<?>> r32 = this.f4257.m2708();
            int i = this.f4260;
            this.f4260 = i + 1;
            this.f4258 = r32.get(i);
            if (this.f4258 != null && (this.f4257.f4304.m2694(this.f4258.f4474.m3064()) || this.f4257.m2709(this.f4258.f4474.m3066()))) {
                this.f4258.f4474.m3067(this.f4257.f4313, new C1020(this, this.f4258));
                z = true;
            }
        }
        return z;
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1021.AbstractC1022
    /* renamed from: K  reason: contains not printable characters */
    public void m2666(AbstractC1029 r7, Object obj, AbstractC1146<?> r9, DataSource dataSource, AbstractC1029 r11) {
        this.f4255.m2836(r7, obj, r9, this.f4258.f4474.m3064(), r7);
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1021.AbstractC1022
    /* renamed from: K  reason: contains not printable characters */
    public void m2665(AbstractC1029 r2, Exception exc, AbstractC1146<?> r4, DataSource dataSource) {
        this.f4255.m2835(r2, exc, r4, this.f4258.f4474.m3064());
    }
}
