mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
Expect runtime exceptions from camera API methods.
This commit is contained in:
@@ -95,6 +95,8 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
previewConsumer.start(camera);
|
previewConsumer.start(camera);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.log(WARNING, "Error starting camera preview", e);
|
LOG.log(WARNING, "Error starting camera preview", e);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
LOG.log(WARNING, "Error starting camera preview", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +122,11 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
}
|
}
|
||||||
if(LOG.isLoggable(INFO))
|
if(LOG.isLoggable(INFO))
|
||||||
LOG.info("Display orientation " + orientation + " degrees");
|
LOG.info("Display orientation " + orientation + " degrees");
|
||||||
camera.setDisplayOrientation(orientation);
|
try {
|
||||||
|
camera.setDisplayOrientation(orientation);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
LOG.log(WARNING, "Error setting display orientation", e);
|
||||||
|
}
|
||||||
displayOrientation = orientation;
|
displayOrientation = orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,9 +233,13 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
surfaceHeight = h;
|
surfaceHeight = h;
|
||||||
if (camera == null) return; // We are stopped
|
if (camera == null) return; // We are stopped
|
||||||
stopPreview();
|
stopPreview();
|
||||||
Parameters params = camera.getParameters();
|
try {
|
||||||
setPreviewSize(params);
|
Parameters params = camera.getParameters();
|
||||||
applyParameters(params);
|
setPreviewSize(params);
|
||||||
|
applyParameters(params);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
LOG.log(WARNING, "Error getting camera parameters", e);
|
||||||
|
}
|
||||||
startPreview(holder);
|
startPreview(holder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user