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

Unified Diff: talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java

Issue 1479523003: Add separate event for camera freeze. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix tests Created 5 years, 1 month 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
« no previous file with comments | « talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
diff --git a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
index 952bd083959f98488388964d77e53cc0c480d288..66b4048b9d7050ba551748b3325eca4eb855a86b 100644
--- a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
+++ b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
@@ -28,7 +28,6 @@
package org.webrtc;
import android.content.Context;
-import android.graphics.SurfaceTexture;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.SystemClock;
@@ -103,7 +102,7 @@ public class VideoCapturerAndroid extends VideoCapturer implements
// another application when startCaptureOnCameraThread is called.
private Runnable openCameraOnCodecThreadRunner;
private final static int MAX_OPEN_CAMERA_ATTEMPTS = 3;
- private final static int OPEN_CAMERA_DELAY_MS = 300;
+ private final static int OPEN_CAMERA_DELAY_MS = 500;
private int openCameraAttempts;
// Camera error callback.
@@ -141,9 +140,9 @@ public class VideoCapturerAndroid extends VideoCapturer implements
&& eventsHandler != null) {
Logging.e(TAG, "Camera freezed.");
if (cameraStatistics.pendingFramesCount() == cameraStatistics.maxPendingFrames) {
- eventsHandler.onCameraError("Camera failure. Client must return video buffers.");
+ eventsHandler.onCameraFreezed("Camera failure. Client must return video buffers.");
} else {
- eventsHandler.onCameraError("Camera failure.");
+ eventsHandler.onCameraFreezed("Camera failure.");
}
return;
}
@@ -204,10 +203,13 @@ public class VideoCapturerAndroid extends VideoCapturer implements
}
public static interface CameraEventsHandler {
- // Camera error handler - invoked when camera stops receiving frames
+ // Camera error handler - invoked when camera can not be opened
// or any camera exception happens on camera thread.
void onCameraError(String errorDescription);
+ // Invoked when camera stops receiving frames
+ void onCameraFreezed(String errorDescription);
+
// Callback invoked when camera is opening.
void onCameraOpening(int cameraId);
« no previous file with comments | « talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698