Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I recently had the same problem. I am using a Galaxy S2 as well, running Android 4.2.2 (from CyanogenMod). I had OpenCV 2.4.5 running okay. This problem showed up when I upgraded to OpenCV 2.4.7. After looking at the source code diff, I found the problem.

In JavaCameraView.java (line 149),

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
    params.setRecordingHint(true); //This line is breaking the preview

}

If you change this to params.setRecordingHint(false), or remove it altogether, the preview works again.