VideoCaptureAndroid: stop preview in opposite order of starting.
While the SDK documentation doesn't prescribe a required shutdown order, good hygiene suggests stopping should happen in reverse order of starting. It also seems to relieve a crash in the system capturer on at least the Galaxy Note 10. BUG=2793 R=henrike@webrtc.org Review URL: https://webrtc-codereview.appspot.com/7549004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5445 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
18586d38bc
commit
932b0193e7
@ -126,14 +126,14 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
|||||||
}
|
}
|
||||||
Throwable error = null;
|
Throwable error = null;
|
||||||
try {
|
try {
|
||||||
|
camera.stopPreview();
|
||||||
|
camera.setPreviewCallbackWithBuffer(null);
|
||||||
if (localPreview != null) {
|
if (localPreview != null) {
|
||||||
localPreview.removeCallback(this);
|
localPreview.removeCallback(this);
|
||||||
camera.setPreviewDisplay(null);
|
camera.setPreviewDisplay(null);
|
||||||
} else {
|
} else {
|
||||||
camera.setPreviewTexture(null);
|
camera.setPreviewTexture(null);
|
||||||
}
|
}
|
||||||
camera.setPreviewCallbackWithBuffer(null);
|
|
||||||
camera.stopPreview();
|
|
||||||
camera.release();
|
camera.release();
|
||||||
camera = null;
|
camera = null;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user