package com.ss.android.ugc.aweme.im.sdk.common.ui.widget;

import X.C5160T2m;
import X.M12;
import android.graphics.SurfaceTexture;
import android.view.Surface;
import android.view.TextureView;
import com.bytedance.covode.number.Covode;

public final class KeepSurfaceTextureView$1 implements TextureView.SurfaceTextureListener {
    public final /* synthetic */ C5160T2m LIZ;

    static {
        Covode.recordClassIndex(86322);
    }

    public KeepSurfaceTextureView$1(C5160T2m t2m) {
        this.LIZ = t2m;
    }

    public final void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
        M12.LIZ(surfaceTexture);
        TextureView.SurfaceTextureListener surfaceTextureListener = this.LIZ.LIZLLL;
        if (surfaceTextureListener != null) {
            surfaceTextureListener.onSurfaceTextureUpdated(surfaceTexture);
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:2:0x000e, code lost:
        r1 = r0.onSurfaceTextureDestroyed(r3);
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final boolean onSurfaceTextureDestroyed(android.graphics.SurfaceTexture r3) {
        /*
            r2 = this;
            X.M12.LIZ(r3)
            X.T2m r0 = r2.LIZ
            r1 = 0
            r0.LIZJ = r1
            X.T2m r0 = r2.LIZ
            android.view.TextureView$SurfaceTextureListener r0 = r0.LIZLLL
            if (r0 == 0) goto L_0x0019
            boolean r1 = r0.onSurfaceTextureDestroyed(r3)
            if (r1 == 0) goto L_0x0019
            X.T2m r0 = r2.LIZ
            r0.LIZ()
        L_0x0019:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.im.sdk.common.ui.widget.KeepSurfaceTextureView$1.onSurfaceTextureDestroyed(android.graphics.SurfaceTexture):boolean");
    }

    public final void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i2) {
        M12.LIZ(surfaceTexture);
        TextureView.SurfaceTextureListener surfaceTextureListener = this.LIZ.LIZLLL;
        if (surfaceTextureListener != null) {
            surfaceTextureListener.onSurfaceTextureSizeChanged(surfaceTexture, i, i2);
        }
    }

    public final void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
        M12.LIZ(surfaceTexture);
        this.LIZ.LIZ();
        if (this.LIZ.LIZ == null) {
            this.LIZ.LIZ = surfaceTexture;
            this.LIZ.LIZIZ = new Surface(this.LIZ.LIZ);
        }
        this.LIZ.LIZJ = true;
        TextureView.SurfaceTextureListener surfaceTextureListener = this.LIZ.LIZLLL;
        if (surfaceTextureListener != null) {
            surfaceTextureListener.onSurfaceTextureAvailable(surfaceTexture, i, i2);
        }
    }
}
