[Samsung Galaxy SL i9003] loSconosciuto:
Camera HAL - part 3:

I tried few more things with no success. The best I could do was to decrease the 480p preview, but at least I got 29/30 fps. A laggy preview is definitely better than a laggy video.

Patches and libcamera attached.

The preview framerate is customizable. You can choose the number of frames skipped through two different props:

su
setprop camera.720.fps 8
setprop camera.480.fps 2

(these are the default settings, you don't have to do anything to use these. EDIT: 0 should be valid, but your videos will be laggy).

8 and 2 represent the number of frame that will be skipped while recording respectively at 720p (value chosen randomly) and 480p (acceptable preview, more than 29fps).

Alternatively, you can add the props to your build.prop

camera.720.fps=8
camera.480.fps=2

There's a third prop, useful to debug. When the following prop is set, you can see the framerate through adb/terminal emulator:

su
setprop debug.camera.showfps 1

and to see the framerate:

logcat | grep Frames

Unlike for pictures, the preview and the final video have the same resolution. In Gingerbread there was liboverlay which did some changes to the preview and resized it when 1280x720 was selected (CameraHal.cpp). I don't know how it was selected etc, but I saw "$$$$$$$$$$$$$$$$$$$$$$" in my logs, but it's been a long time since I used GB and maybe I'm wrong.

Removing 720p from the supported preview sizes is not enough:

D/****CameraHAL( 1278): 235: camera_get_parameters() ENTER
D/****CameraHAL( 1278): 241: camera_put_parameters() ENTER
D/CameraSource( 1278): Camera does not support setVideoSize()
E/CameraSource( 1278): Video dimension (1280x720) is unsupported
D/****CameraHAL( 1278): 182: camera_recording_enabled() ENTER
E/MediaRecorder( 2946): start failed: -19
D/CameraHardware( 1278): [Preview] 960 Frames, 24.463428 FPS
E/videocamera( 2946): Could not start media recorder.
E/videocamera( 2946): java.lang.RuntimeException: start failed.
E/videocamera( 2946):	at android.media.MediaRecorder.start(Native Method)
E/videocamera( 2946):	at com.android.camera.VideoCamera.startVideoRecording(VideoCamera.java:1546)
E/videocamera( 2946):	at com.android.camera.VideoCamera.onShutterButtonClick(VideoCamera.java:619)
E/videocamera( 2946):	at com.android.camera.ShutterButton.performClick(ShutterButton.java:108)
E/videocamera( 2946):	at android.view.View$PerformClick.run(View.java:16966)
E/videocamera( 2946):	at android.os.Handler.handleCallback(Handler.java:615)
E/videocamera( 2946):	at android.os.Handler.dispatchMessage(Handler.java:92)
E/videocamera( 2946):	at android.os.Looper.loop(Looper.java:137)
E/videocamera( 2946):	at android.app.ActivityThread.main(ActivityThread.java:4931)
E/videocamera( 2946):	at java.lang.reflect.Method.invokeNative(Native Method)
E/videocamera( 2946):	at java.lang.reflect.Method.invoke(Method.java:511)
E/videocamera( 2946):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/videocamera( 2946):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
E/videocamera( 2946):	at dalvik.system.NativeStart.main(Native Method)

We could use /dev/omap-resizer to resize the preview, there's also some code ready to be used (saResizer.cpp), but that's something for Dhiru.

ping_1984 gave me some logs. If I remember correctly, gralloc crashes for some unknown reason. The Optimus Black, which uses our same binary blob, has the same problem, so I think the problem is in the ddk 1.8 (CM10 A4) and ddk 1.10 (CM10 A5 - Optimus Black) binary blob. I don't know if there's the same problem in Gingerbread (ddk 1.7).

As you can see here, old versions work perfectly.

Open GL ES 2.0 is working fine.