android.hardware.camera2.CaptureFailure Java Examples
The following examples show how to use
android.hardware.camera2.CaptureFailure.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RepeatFailureDetector.java From Camera2 with Apache License 2.0 | 6 votes |
@Override public void onFailed(CaptureFailure failure) { if (failure.getReason() == CaptureFailure.REASON_ERROR) { mConsecutiveErrorCount++; mLog.e(String.format("onCaptureFailed() REASON_ERROR: Consecutive error count = %d x" + " %d", mConsecutiveErrorCount, mFailureLevel)); if (mConsecutiveErrorCount >= mConsecutiveFailureThreshold) { mConsecutiveErrorCount = 0; mFailureFrameNumber = failure.getFrameNumber(); if (mFailureLevel < mRecoveryStrategies.size()) { mLog.e(String.format("onCaptureFailed() REASON_ERROR: Repeat failure " + "detected (x%d). Attempting recovery strategy: %s", mConsecutiveErrorCount, mRecoveryStrategies.get(mFailureLevel) .toString())); mRecoveryStrategies.get(mFailureLevel).run(); } mFailureLevel++; } } }
Example #2
Source File: CaptureCallback.java From android-robocar with BSD 2-Clause "Simplified" License | 6 votes |
@Override public void onCaptureFailed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) { super.onCaptureFailed(session, request, failure); this.session = null; switch (failure.getReason()) { case CaptureFailure.REASON_ERROR: Timber.e("Capture failed: REASON_ERROR"); break; case CaptureFailure.REASON_FLUSHED: Timber.e("Capture failed: REASON_FLUSHED"); break; default: Timber.e("Capture failed: UNKNOWN"); break; } }
Example #3
Source File: Camera2RawFragment.java From android-Camera2Raw with Apache License 2.0 | 5 votes |
@Override public void onCaptureFailed(CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { int requestId = (int) request.getTag(); synchronized (mCameraStateLock) { mJpegResultQueue.remove(requestId); mRawResultQueue.remove(requestId); finishedCaptureLocked(); } showToast("Capture failed!"); }
Example #4
Source File: Camera2Source.java From Machine-Learning-Projects-for-Mobile-Applications with MIT License | 5 votes |
@Override public void onCaptureFailed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) { if (request.getTag() == "FOCUS_TAG") { Log.d(TAG, "Manual AF failure: " + failure); mAutoFocusCallback.onAutoFocus(false); } }
Example #5
Source File: MetadataFuture.java From Camera2 with Apache License 2.0 | 5 votes |
@Override public void onFailed(CaptureFailure failure) { super.onFailed(failure); if (failure.getReason() == CaptureFailure.REASON_FLUSHED) { mMetadata.cancel(true); } else if (failure.getReason() == CaptureFailure.REASON_ERROR) { mMetadata.setException(new IllegalStateException("CaptureFailure.REASON_ERROR!")); } }
Example #6
Source File: ResponseListenerBroadcaster.java From Camera2 with Apache License 2.0 | 5 votes |
@Override public void onFailed(CaptureFailure failure) { for (ResponseListener listener : mListeners) { listener.onFailed(failure); } }
Example #7
Source File: TagDispatchCaptureSession.java From Camera2 with Apache License 2.0 | 5 votes |
@Override public void onCaptureFailed(CameraCaptureSessionProxy session, CaptureRequest request, CaptureFailure failure) { Object tag = request.getTag(); mListeners.get(tag).onFailed(failure); }
Example #8
Source File: Camera2Source.java From Camera2Vision with Apache License 2.0 | 5 votes |
@Override public void onCaptureFailed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) { if(request.getTag() == "FOCUS_TAG") { Log.d(TAG, "Manual AF failure: "+failure); mAutoFocusCallback.onAutoFocus(false); } }
Example #9
Source File: Camera2CaptureCallbackForwarder.java From Camera2 with Apache License 2.0 | 5 votes |
@Override public void onCaptureFailed(final CameraCaptureSession session, final CaptureRequest request, final CaptureFailure failure) { mHandler.post(new Runnable() { @Override public void run() { mListener.onCaptureFailed(session, request, failure); }}); }
Example #10
Source File: Camera2CaptureCallbackSplitter.java From Camera2 with Apache License 2.0 | 5 votes |
@Override public void onCaptureFailed(CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { for (CaptureCallback target : mRecipients) { target.onCaptureFailed(session, request, failure); } }
Example #11
Source File: AndroidCamera2AgentImpl.java From Camera2 with Apache License 2.0 | 4 votes |
@Override public void onCaptureFailed(CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { Log.e(TAG, "Capture attempt failed with reason " + failure.getReason()); }
Example #12
Source File: Camera2Session.java From VideoCRE with MIT License | 4 votes |
@Override public void onCaptureFailed( CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { Logging.d(TAG, "Capture failed: " + failure); }
Example #13
Source File: CameraImageActivity.java From AndroidDemo with MIT License | 4 votes |
@Override public void onCaptureFailed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) { super.onCaptureFailed(session, request, failure); }
Example #14
Source File: CameraH264Activity.java From AndroidDemo with MIT License | 4 votes |
@Override public void onCaptureFailed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) { super.onCaptureFailed(session, request, failure); }
Example #15
Source File: BlockingCaptureCallback.java From Camera2 with Apache License 2.0 | 4 votes |
@Override public void onCaptureFailed(CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { if (mProxy != null) mProxy.onCaptureFailed(session, request, failure); mStateChangeListener.onStateChanged(CAPTURE_FAILED); }
Example #16
Source File: Camera2Session.java From webrtc_android with MIT License | 4 votes |
@Override public void onCaptureFailed( CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { Logging.d(TAG, "Capture failed: " + failure); }
Example #17
Source File: AndroidCameraCaptureSessionProxy.java From Camera2 with Apache License 2.0 | 4 votes |
@Override public void onCaptureFailed(CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { mCallback.onCaptureFailed(AndroidCameraCaptureSessionProxy.this, request, failure); }
Example #18
Source File: CameraCaptureSessionProxy.java From Camera2 with Apache License 2.0 | 4 votes |
public void onCaptureFailed(CameraCaptureSessionProxy session, CaptureRequest request, CaptureFailure failure);
Example #19
Source File: ResponseListener.java From Camera2 with Apache License 2.0 | 2 votes |
/** * Note that this is typically invoked on the camera thread and at high * frequency, so implementations must execute quickly and not make * assumptions regarding the thread they are on. * * @See {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureFailed} */ public void onFailed(CaptureFailure failure) { }
Example #20
Source File: CameraDeviceImpl.java From android_9.0.0_r45 with Apache License 2.0 | 2 votes |
/** * This method is called instead of {@link #onCaptureCompleted} when the * camera device failed to produce a {@link CaptureResult} for the * request. */ public void onCaptureFailed(CameraDevice camera, CaptureRequest request, CaptureFailure failure);