package h5;

import a5.l;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import g5.a0;
import g5.b0;
import nb.g;

/* JADX INFO: loaded from: classes.dex */
public final class b implements b0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Context f26430a;

    public b(Context context) {
        this.f26430a = context.getApplicationContext();
    }

    @Override // g5.b0
    public final boolean a(Object obj) {
        Uri uri = (Uri) obj;
        return g.H(uri) && uri.getPathSegments().contains("video");
    }

    @Override // g5.b0
    @Nullable
    public a0 buildLoadData(@NonNull Uri uri, int i10, int i11, @NonNull l lVar) {
        Long l10;
        if (i10 == Integer.MIN_VALUE || i11 == Integer.MIN_VALUE || i10 > 512 || i11 > 384 || (l10 = (Long) lVar.get(com.bumptech.glide.load.resource.bitmap.b.f5820d)) == null || l10.longValue() != -1) {
            return null;
        }
        s5.d dVar = new s5.d(uri);
        Context context = this.f26430a;
        return new a0(dVar, new b5.c(uri, new b5.e(com.bumptech.glide.c.a(context).f5555d.e(), new b5.b(context.getContentResolver()), com.bumptech.glide.c.a(context).f5556e, context.getContentResolver())));
    }
}
