package v0;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

/* JADX INFO: renamed from: v0.h, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC1669h implements InterfaceC1668g {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public C1666e f18021b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public C1666e f18022c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public C1666e f18023d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public C1666e f18024e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public ByteBuffer f18025f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public ByteBuffer f18026g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f18027h;

    public AbstractC1669h() {
        ByteBuffer byteBuffer = InterfaceC1668g.f18020a;
        this.f18025f = byteBuffer;
        this.f18026g = byteBuffer;
        C1666e c1666e = C1666e.f18015e;
        this.f18023d = c1666e;
        this.f18024e = c1666e;
        this.f18021b = c1666e;
        this.f18022c = c1666e;
    }

    @Override // v0.InterfaceC1668g
    public boolean a() {
        return this.f18024e != C1666e.f18015e;
    }

    @Override // v0.InterfaceC1668g
    public ByteBuffer b() {
        ByteBuffer byteBuffer = this.f18026g;
        this.f18026g = InterfaceC1668g.f18020a;
        return byteBuffer;
    }

    @Override // v0.InterfaceC1668g
    public final void c() {
        this.f18027h = true;
        i();
    }

    @Override // v0.InterfaceC1668g
    public boolean d() {
        return this.f18027h && this.f18026g == InterfaceC1668g.f18020a;
    }

    @Override // v0.InterfaceC1668g
    public final C1666e f(C1666e c1666e) {
        this.f18023d = c1666e;
        this.f18024e = g(c1666e);
        return a() ? this.f18024e : C1666e.f18015e;
    }

    @Override // v0.InterfaceC1668g
    public final void flush() {
        this.f18026g = InterfaceC1668g.f18020a;
        this.f18027h = false;
        this.f18021b = this.f18023d;
        this.f18022c = this.f18024e;
        h();
    }

    public abstract C1666e g(C1666e c1666e);

    public final ByteBuffer k(int i) {
        if (this.f18025f.capacity() < i) {
            this.f18025f = ByteBuffer.allocateDirect(i).order(ByteOrder.nativeOrder());
        } else {
            this.f18025f.clear();
        }
        ByteBuffer byteBuffer = this.f18025f;
        this.f18026g = byteBuffer;
        return byteBuffer;
    }

    @Override // v0.InterfaceC1668g
    public final void reset() {
        flush();
        this.f18025f = InterfaceC1668g.f18020a;
        C1666e c1666e = C1666e.f18015e;
        this.f18023d = c1666e;
        this.f18024e = c1666e;
        this.f18021b = c1666e;
        this.f18022c = c1666e;
        j();
    }

    public void h() {
    }

    public void i() {
    }

    public void j() {
    }
}
