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

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

Issue 2381343002: Add onCameraDisconnected camera event. (Closed)
Patch Set: Created 4 years, 3 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/api/android/java/src/org/webrtc/CameraCapturer.java
diff --git a/webrtc/api/android/java/src/org/webrtc/CameraCapturer.java b/webrtc/api/android/java/src/org/webrtc/CameraCapturer.java
index c94538bf740a256c4b60b8c51d8b91942b1a9cf3..86f5f217c1cd3dd19a8ada9bfea469e0c62d06de 100644
--- a/webrtc/api/android/java/src/org/webrtc/CameraCapturer.java
+++ b/webrtc/api/android/java/src/org/webrtc/CameraCapturer.java
@@ -119,6 +119,19 @@ public abstract class CameraCapturer implements CameraVideoCapturer {
}
@Override
+ public void onCameraDisconnected(CameraSession session) {
+ checkIsOnCameraThread();
+ synchronized (stateLock) {
+ if (session != currentSession) {
+ Logging.w(TAG, "onCameraDisconnected from another session.");
+ return;
+ }
+ eventsHandler.onCameraDisconnected();
+ stopCapture();
+ }
+ }
+
+ @Override
public void onCameraClosed(CameraSession session) {
checkIsOnCameraThread();
synchronized (stateLock) {
@@ -204,6 +217,8 @@ public abstract class CameraCapturer implements CameraVideoCapturer {
@Override
public void onCameraError(String errorDescription) {}
@Override
+ public void onCameraDisconnected() {}
+ @Override
public void onCameraFreezed(String errorDescription) {}
@Override
public void onCameraOpening(String cameraName) {}
« no previous file with comments | « webrtc/api/android/java/src/org/webrtc/Camera2Session.java ('k') | webrtc/api/android/java/src/org/webrtc/CameraSession.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698