Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1070)

Unified Diff: webrtc/sdk/android/api/org/webrtc/CameraCapturer.java

Issue 2642703002: Add failure type parameter to onFailure callback. (Closed)
Patch Set: Correctly handle failure type. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/android/api/org/webrtc/CameraCapturer.java
diff --git a/webrtc/sdk/android/api/org/webrtc/CameraCapturer.java b/webrtc/sdk/android/api/org/webrtc/CameraCapturer.java
index fcfcd70e861e759b109477a1cd1c2eee73f0732a..e80b0630d1e3ca96788042fabdba43fc951666cd 100644
--- a/webrtc/sdk/android/api/org/webrtc/CameraCapturer.java
+++ b/webrtc/sdk/android/api/org/webrtc/CameraCapturer.java
@@ -61,7 +61,7 @@ public abstract class CameraCapturer implements CameraVideoCapturer {
}
@Override
- public void onFailure(String error) {
+ public void onFailure(CameraSession.FailureType failureType, String error) {
checkIsOnCameraThread();
uiThreadHandler.removeCallbacks(openCameraTimeoutRunnable);
synchronized (stateLock) {
@@ -81,7 +81,11 @@ public abstract class CameraCapturer implements CameraVideoCapturer {
switchState = SwitchState.IDLE;
}
- eventsHandler.onCameraError(error);
+ if (failureType == CameraSession.FailureType.DISCONNECTED) {
+ eventsHandler.onCameraDisconnected();
+ } else {
+ eventsHandler.onCameraError(error);
+ }
} else {
Logging.w(TAG, "Opening camera failed, retry: " + error);
« no previous file with comments | « webrtc/sdk/android/api/org/webrtc/Camera2Session.java ('k') | webrtc/sdk/android/api/org/webrtc/CameraSession.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698