what-the-bank/sources/o/SurfaceHolderCallbackC12505...

87 lines
2.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.content.Context;
import android.hardware.Camera;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import java.io.IOException;
import java.util.List;
/* renamed from: o.ezV, reason: case insensitive filesystem */
/* loaded from: classes5.dex */
public final class SurfaceHolderCallbackC12505ezV implements SurfaceHolder.Callback {
public InterfaceC10306eAb a;
public SurfaceHolder b;
public Camera c;
public Context e;
public Camera.Size g;
public SurfaceView h;
public List<Camera.Size> i;
public Camera.ShutterCallback f = new Camera.ShutterCallback() { // from class: o.ezZ
@Override // android.hardware.Camera.ShutterCallback
public final void onShutter() {
}
};
public Camera.PictureCallback j = new Camera.PictureCallback() { // from class: o.eAd
@Override // android.hardware.Camera.PictureCallback
public final void onPictureTaken(byte[] bArr, Camera camera) {
}
};
public Camera.PictureCallback d = new Camera.PictureCallback(this) { // from class: o.eAg
private SurfaceHolderCallbackC12505ezV b;
@Override // android.hardware.Camera.PictureCallback
public final void onPictureTaken(byte[] bArr, Camera camera) {
this.b.a.d(bArr);
}
{
this.b = this;
}
};
public SurfaceHolderCallbackC12505ezV(Context context) {
this.e = context;
}
@Override // android.view.SurfaceHolder.Callback
public final void surfaceCreated(SurfaceHolder surfaceHolder) {
try {
Camera camera = this.c;
if (camera != null) {
camera.setPreviewDisplay(surfaceHolder);
}
} catch (IOException e) {
guQ.e(e);
}
}
@Override // android.view.SurfaceHolder.Callback
public final void surfaceDestroyed(SurfaceHolder surfaceHolder) {
Camera camera = this.c;
if (camera != null) {
camera.stopPreview();
}
}
@Override // android.view.SurfaceHolder.Callback
public final void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
if (this.c == null || this.g == null || this.b.getSurface() == null) {
return;
}
try {
this.c.stopPreview();
} catch (Exception e) {
guQ.e(e);
}
try {
Camera.Parameters parameters = this.c.getParameters();
parameters.setPreviewSize(this.g.width, this.g.height);
this.c.setParameters(parameters);
this.c.startPreview();
} catch (Exception e2) {
guQ.e(e2);
}
}
}