Do not classify error after stopping the camera as a startup failure.
Calling event handlers when the camera is closing is safe because CameraCapturer checks if the errors are coming from the current session. Calling onFailure after camera has already started might lead to strange behavior. BUG=b/34112992 Review-Url: https://codereview.webrtc.org/2634973002 Cr-Commit-Position: refs/heads/master@{#16101}
This commit is contained in:
parent
2df07342ee
commit
c117e2ed79
@ -97,7 +97,7 @@ public class Camera2Session implements CameraSession {
|
||||
@Override
|
||||
public void onDisconnected(CameraDevice camera) {
|
||||
checkIsOnCameraThread();
|
||||
final boolean startFailure = (captureSession == null);
|
||||
final boolean startFailure = (captureSession == null) && (state != SessionState.STOPPED);
|
||||
state = SessionState.STOPPED;
|
||||
stopInternal();
|
||||
if (startFailure) {
|
||||
@ -402,7 +402,7 @@ public class Camera2Session implements CameraSession {
|
||||
checkIsOnCameraThread();
|
||||
Logging.e(TAG, "Error: " + error);
|
||||
|
||||
final boolean startFailure = (captureSession == null);
|
||||
final boolean startFailure = (captureSession == null) && (state != SessionState.STOPPED);
|
||||
state = SessionState.STOPPED;
|
||||
stopInternal();
|
||||
if (startFailure) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user