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

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

Issue 2171023003: Convert Android camera tests to use the new createVideoSource API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Style. Created 4 years, 5 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
« no previous file with comments | « no previous file | webrtc/api/androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
diff --git a/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java b/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
index c3c912acd5bbdc922a0308850d31582f72ae2737..958eb7b3c08d9e6d76c32f4d2822d7aa71fe84d9 100644
--- a/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
+++ b/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
@@ -267,6 +267,7 @@ public class Camera2Capturer implements
Logging.d(TAG, "Close and release.");
setCameraState(CameraState.STOPPING);
+ capturerObserver.onCapturerStopped();
// Remove all pending Runnables posted from |this|.
cameraThreadHandler.removeCallbacksAndMessages(this /* token */);
@@ -575,7 +576,6 @@ public class Camera2Capturer implements
if (eventsHandler != null) {
eventsHandler.onCameraClosed();
}
- capturerObserver.onCapturerStopped();
}
}
@@ -862,6 +862,11 @@ public class Camera2Capturer implements
int oesTextureId, float[] transformMatrix, long timestampNs) {
checkIsOnCameraThread();
+ if (cameraState != CameraState.RUNNING) {
+ Logging.d(TAG, "Texture frame received while camera was not running.");
+ return;
+ }
+
if (eventsHandler != null && !firstFrameReported) {
eventsHandler.onFirstFrameAvailable();
firstFrameReported = true;
« no previous file with comments | « no previous file | webrtc/api/androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698