I have a custom camera that works fine in some devices. It works well on Samsung Galaxy Gran Duos (samsung-gt i9082, Android 4.2.2) but when I try to capture an image, that I zoomed in before, it freezes, no crash, the only way to get out is to press the back button. This happen only in the Samsung Galaxy Gran Duos.
The code that I used to take a picture:
Camera.PictureCallback photoCallback = new Camera.PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
try {
} catch (Exception e) {
if (flePicture== null){
Log.d("camera", "Error creating media file, check storage permissions: " +
e.getMessage());
return;
}
}
try {
FileOutputStream fos = new FileOutputStream(flePicture);
fos.write(data);
fos.close();
} catch (FileNotFoundException e) {
Log.d("camera", "File not found: " + e.getMessage());
} catch (IOException e) {
Log.d("camera", "Error accessing file: " + e.getMessage());
}
}
};
And the code used for the zoom in:
private void zoomIn() {
if (pblnInPreview) {
Camera.Parameters parameters = camCamera.getParameters();
if ((parameters.getZoom() + 1) < parameters.getMaxZoom()) {
parameters.setZoom(parameters.getZoom() + 1);
camCamera.setParameters(parameters);
}
}
}
LogCat:
04-07 17:21:14.386: E/BrcmCamera(130): processControlBuffer: Corrupt stream error raised by camera - sensor communication failure