Stretched camera preview with size of 160x240 with front-facing camera on Droid 3
I use code like shown below to choose one of the supported preview sizes for displaying the camera preview. What I am seeing is that if the chosen preview size is 240 x 160 (an unusual aspect ratio of 1.5), the preview looks stretched. ie. it looks like the camera is capturing at a lower aspect ratio (something like 1.3) and then stretching it to become 240 x 160. If any of the other supported preview sizes (128x96, 160x120, 176x144, 352x288, 320x240, 640x480) are chosen, the preview looks fine. Also, this only happens with the front-facing camera. The preview with the rear camera looks fine at 240 x 160.
Is anyone else seeing this? Is this a known issue?
Camera.Parameters params = camera.getParameters();
List<Camera.Size> supportedSizes = params.getSupportedPreviewSizes();
// Chose one of the supportedSizes
Camera.Size chosenSize = chooseSize(supportedSizes);
Camera.Size previewSize = camera.getParameters().getPreviewSize();
// Set the size of the SurfaceView to be proportional to the
// aspect ratio of the preview size.
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
previewSize.width * 3, previewSize.height * 3);