Convert Android camera tests to use the new createVideoSource API.

Review-Url: https://codereview.webrtc.org/2171023003
Cr-Commit-Position: refs/heads/master@{#13528}
This commit is contained in:
sakal
2016-07-26 05:41:36 -07:00
committed by Commit bot
parent 86cc6ffc7c
commit 2fa14623cc
2 changed files with 26 additions and 12 deletions

View File

@ -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;