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:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user