mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-01 10:13:24 +01:00
138 lines
7.2 KiB
Java
138 lines
7.2 KiB
Java
package androidx.camera.camera2.internal;
|
|
|
|
import android.hardware.camera2.CameraCaptureSession;
|
|
import android.hardware.camera2.CaptureFailure;
|
|
import android.hardware.camera2.CaptureRequest;
|
|
import android.hardware.camera2.CaptureResult;
|
|
import android.hardware.camera2.TotalCaptureResult;
|
|
import android.view.Surface;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.camera.camera2.internal.compat.ApiCompat;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes.dex */
|
|
public final class Camera2CaptureCallbacks {
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static final class ComboSessionCaptureCallback extends CameraCaptureSession.CaptureCallback {
|
|
private final List<CameraCaptureSession.CaptureCallback> mCallbacks = new ArrayList();
|
|
|
|
public ComboSessionCaptureCallback(List<CameraCaptureSession.CaptureCallback> list) {
|
|
for (CameraCaptureSession.CaptureCallback captureCallback : list) {
|
|
if (!(captureCallback instanceof NoOpSessionCaptureCallback)) {
|
|
this.mCallbacks.add(captureCallback);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
@RequiresApi(api = 24)
|
|
public void onCaptureBufferLost(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull Surface surface, long j) {
|
|
Iterator<CameraCaptureSession.CaptureCallback> it2 = this.mCallbacks.iterator();
|
|
while (it2.hasNext()) {
|
|
ApiCompat.Api24Impl.onCaptureBufferLost(it2.next(), cameraCaptureSession, captureRequest, surface, j);
|
|
}
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureCompleted(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull TotalCaptureResult totalCaptureResult) {
|
|
Iterator<CameraCaptureSession.CaptureCallback> it2 = this.mCallbacks.iterator();
|
|
while (it2.hasNext()) {
|
|
it2.next().onCaptureCompleted(cameraCaptureSession, captureRequest, totalCaptureResult);
|
|
}
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureFailed(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull CaptureFailure captureFailure) {
|
|
Iterator<CameraCaptureSession.CaptureCallback> it2 = this.mCallbacks.iterator();
|
|
while (it2.hasNext()) {
|
|
it2.next().onCaptureFailed(cameraCaptureSession, captureRequest, captureFailure);
|
|
}
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureProgressed(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull CaptureResult captureResult) {
|
|
Iterator<CameraCaptureSession.CaptureCallback> it2 = this.mCallbacks.iterator();
|
|
while (it2.hasNext()) {
|
|
it2.next().onCaptureProgressed(cameraCaptureSession, captureRequest, captureResult);
|
|
}
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureSequenceAborted(@NonNull CameraCaptureSession cameraCaptureSession, int i) {
|
|
Iterator<CameraCaptureSession.CaptureCallback> it2 = this.mCallbacks.iterator();
|
|
while (it2.hasNext()) {
|
|
it2.next().onCaptureSequenceAborted(cameraCaptureSession, i);
|
|
}
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureSequenceCompleted(@NonNull CameraCaptureSession cameraCaptureSession, int i, long j) {
|
|
Iterator<CameraCaptureSession.CaptureCallback> it2 = this.mCallbacks.iterator();
|
|
while (it2.hasNext()) {
|
|
it2.next().onCaptureSequenceCompleted(cameraCaptureSession, i, j);
|
|
}
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureStarted(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, long j, long j2) {
|
|
Iterator<CameraCaptureSession.CaptureCallback> it2 = this.mCallbacks.iterator();
|
|
while (it2.hasNext()) {
|
|
it2.next().onCaptureStarted(cameraCaptureSession, captureRequest, j, j2);
|
|
}
|
|
}
|
|
}
|
|
|
|
private Camera2CaptureCallbacks() {
|
|
}
|
|
|
|
@NonNull
|
|
public static CameraCaptureSession.CaptureCallback createComboCallback(@NonNull CameraCaptureSession.CaptureCallback... captureCallbackArr) {
|
|
return createComboCallback((List<CameraCaptureSession.CaptureCallback>) Arrays.asList(captureCallbackArr));
|
|
}
|
|
|
|
@NonNull
|
|
public static CameraCaptureSession.CaptureCallback createNoOpCallback() {
|
|
return new NoOpSessionCaptureCallback();
|
|
}
|
|
|
|
public static CameraCaptureSession.CaptureCallback createComboCallback(List<CameraCaptureSession.CaptureCallback> list) {
|
|
return new ComboSessionCaptureCallback(list);
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static final class NoOpSessionCaptureCallback extends CameraCaptureSession.CaptureCallback {
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureSequenceAborted(@NonNull CameraCaptureSession cameraCaptureSession, int i) {
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureCompleted(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull TotalCaptureResult totalCaptureResult) {
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureFailed(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull CaptureFailure captureFailure) {
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureProgressed(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull CaptureResult captureResult) {
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureSequenceCompleted(@NonNull CameraCaptureSession cameraCaptureSession, int i, long j) {
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureBufferLost(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, @NonNull Surface surface, long j) {
|
|
}
|
|
|
|
@Override // android.hardware.camera2.CameraCaptureSession.CaptureCallback
|
|
public void onCaptureStarted(@NonNull CameraCaptureSession cameraCaptureSession, @NonNull CaptureRequest captureRequest, long j, long j2) {
|
|
}
|
|
}
|
|
}
|