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

Unified Diff: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java

Issue 2673373003: getUserMeida: report device starting states (Closed)
Patch Set: address comments on PS#7 Created 3 years, 10 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: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
diff --git a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
index 929f041150de28ccec086a696f2bc2f219dc9537..db3f6e3cae640953f9ecefdb8b913adea91cb474 100644
--- a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
+++ b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
@@ -400,10 +400,10 @@ public class VideoCaptureCamera
if (mIsRunning) {
return true;
}
- mIsRunning = true;
} finally {
mPreviewBufferLock.unlock();
}
+
setPreviewCallback(this);
try {
mCamera.startPreview();
@@ -411,6 +411,14 @@ public class VideoCaptureCamera
Log.e(TAG, "startCapture: Camera.startPreview: " + ex);
return false;
}
+
+ mPreviewBufferLock.lock();
+ try {
+ nativeOnStarted(mNativeVideoCaptureDeviceAndroid);
+ mIsRunning = true;
chfremer 2017/02/23 17:49:53 Why are we moving the mIsRunning = true down here?
braveyao 2017/02/23 18:08:09 If startPreview fails, it's not right to set mIsRu
chfremer 2017/02/23 19:07:08 Ah, I see. Then this is a fix for a bug that exist
+ } finally {
+ mPreviewBufferLock.unlock();
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698