In my activity I show the camera preview on a surfaceView. It works perfectly fine on Nexus One (2.1update1, 2.2) and HTC Desire (2.1update1), but on Samsung Galaxy S (2.1update1) I see strange lines, weird proportions and everything three times. see the screenshot http://img249.imageshack.us/img249/7466/device1s.png

The issue seems to be similar to this one: http://stackoverflow.com/questions/2053440/camera-preview-on-androd-strange-lines-on-1-5-version-of-sdk but none of the comments there helped. I tried to swap height,width for the camera parameters, but not much of a difference.

(Side note: my activity is always in landscape mode, fixed. I have that fix in my manifest as screenOrientation parameters, in case that matters somehow).

Camera preview parameters as below:
== snip ==
....
private static final int IMAGE_WIDTH = 512;
private static final int IMAGE_HEIGHT = 384;
private static final String ORIENTATION = "orientation";
private static final String ROTATION = "rotation";
private static final String PORTRAIT = "portrait";
private static final String LANDSCAPE = "landscape";
....

camera = Camera.open();

Parameters p = camera.getParameters();
p.setPictureSize(IMAGE_WIDTH, IMAGE_HEIGHT);
p.set(ORIENTATION, PORTRAIT);
p.set(ROTATION, 90);

Camera.Size s = p.getSupportedPreviewSizes().get(0);
p.setPreviewSize( s.width,s.height );

p.setPictureFormat(PixelFormat.JPEG);
p.set("flash-mode", "auto");
camera.setParameters(p);

camera.setPreviewDisplay(surfaceHolder);
== snap ==

Full code of my SurfaceHolderCallback (the relevant inner class in my activity)
http://pastebin.com/YmcwEVn8

Anybody experiencing such issue on the Samsung Galaxy S as well?


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to