Merge pull request #695 from thegobot/master

Update SrsCameraView.java
camera2
Leo Ma 6 years ago committed by GitHub
commit 13d40cd9f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -145,13 +145,12 @@ public class SrsCameraView extends GLSurfaceView implements GLSurfaceView.Render
public int[] setPreviewResolution(int width, int height) { public int[] setPreviewResolution(int width, int height) {
if (mCamera == null) { if (mCamera != null) {
mCamera = openCamera(); stopCamera();
if (mCamera == null) {
return new int[] { 0, 0};
}
} }
mCamera = openCamera();
mPreviewWidth = width; mPreviewWidth = width;
mPreviewHeight = height; mPreviewHeight = height;
Camera.Size rs = adaptPreviewResolution(mCamera.new Size(width, height)); Camera.Size rs = adaptPreviewResolution(mCamera.new Size(width, height));

Loading…
Cancel
Save