package p138.p145.p146.p151.p154;

import android.util.Log;
import com.bumptech.glide.Registry;
import java.util.Collections;
import java.util.List;
import p138.p145.p146.p151.EnumC2840;
import p138.p145.p146.p151.InterfaceC2843;
import p138.p145.p146.p151.InterfaceC2844;
import p138.p145.p146.p151.p152.InterfaceC2856;
import p138.p145.p146.p151.p154.InterfaceC2892;
import p138.p145.p146.p151.p158.InterfaceC3028;
import p138.p145.p146.p174.C3236;

/* JADX INFO: renamed from: ދ.ؠ.֏.ތ.ފ.ޘ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2938 implements InterfaceC2892, InterfaceC2892.InterfaceC2893 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final C2894<?> f9069;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final InterfaceC2892.InterfaceC2893 f9070;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public int f9071;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public C2889 f9072;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public Object f9073;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public volatile InterfaceC3028.C3029<?> f9074;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public C2890 f9075;

    public C2938(C2894<?> c2894, InterfaceC2892.InterfaceC2893 interfaceC2893) {
        this.f9069 = c2894;
        this.f9070 = interfaceC2893;
    }

    @Override // p138.p145.p146.p151.p154.InterfaceC2892
    public void cancel() {
        InterfaceC3028.C3029<?> c3029 = this.f9074;
        if (c3029 != null) {
            c3029.f9201.cancel();
        }
    }

    @Override // p138.p145.p146.p151.p154.InterfaceC2892.InterfaceC2893
    /* JADX INFO: renamed from: ֏ */
    public void mo5007(InterfaceC2844 interfaceC2844, Exception exc, InterfaceC2856<?> interfaceC2856, EnumC2840 enumC2840) {
        this.f9070.mo5007(interfaceC2844, exc, interfaceC2856, this.f9074.f9201.mo4974());
    }

    @Override // p138.p145.p146.p151.p154.InterfaceC2892.InterfaceC2893
    /* JADX INFO: renamed from: ֏ */
    public void mo5008(InterfaceC2844 interfaceC2844, Object obj, InterfaceC2856<?> interfaceC2856, EnumC2840 enumC2840, InterfaceC2844 interfaceC28442) {
        this.f9070.mo5008(interfaceC2844, obj, interfaceC2856, this.f9074.f9201.mo4974(), interfaceC2844);
    }

    @Override // p138.p145.p146.p151.p154.InterfaceC2892
    /* JADX INFO: renamed from: ֏ */
    public boolean mo5006() {
        Object obj = this.f9073;
        if (obj != null) {
            this.f9073 = null;
            long jM5320 = C3236.m5320();
            try {
                InterfaceC2843 interfaceC2843M5248 = this.f9069.f8888.f8659.f1508.m5248(obj.getClass());
                if (interfaceC2843M5248 == null) {
                    throw new Registry.NoSourceEncoderAvailableException(obj.getClass());
                }
                C2891 c2891 = new C2891(interfaceC2843M5248, obj, this.f9069.f8894);
                this.f9075 = new C2890(this.f9074.f9199, this.f9069.f8899);
                this.f9069.m5013().mo5116(this.f9075, c2891);
                if (Log.isLoggable("SourceGenerator", 2)) {
                    Log.v("SourceGenerator", "Finished encoding source to cache, key: " + this.f9075 + ", data: " + obj + ", encoder: " + interfaceC2843M5248 + ", duration: " + C3236.m5319(jM5320));
                }
                this.f9074.f9201.mo4973();
                this.f9072 = new C2889(Collections.singletonList(this.f9074.f9199), this.f9069, this);
            } catch (Throwable th) {
                this.f9074.f9201.mo4973();
                throw th;
            }
        }
        C2889 c2889 = this.f9072;
        if (c2889 != null && c2889.mo5006()) {
            return true;
        }
        this.f9072 = null;
        this.f9074 = null;
        boolean z = false;
        while (!z) {
            if (!(this.f9071 < this.f9069.m5014().size())) {
                break;
            }
            List<InterfaceC3028.C3029<?>> listM5014 = this.f9069.m5014();
            int i = this.f9071;
            this.f9071 = i + 1;
            this.f9074 = listM5014.get(i);
            if (this.f9074 != null && (this.f9069.f8901.mo5036(this.f9074.f9201.mo4974()) || this.f9069.m5015(this.f9074.f9201.mo4969()))) {
                this.f9074.f9201.mo4970(this.f9069.f8900, new C2937(this, this.f9074));
                z = true;
            }
        }
        return z;
    }

    @Override // p138.p145.p146.p151.p154.InterfaceC2892.InterfaceC2893
    /* JADX INFO: renamed from: ރ */
    public void mo5009() {
        throw new UnsupportedOperationException();
    }
}
