Search code examples
androidandroid-camera

Android Camera: setSceneMode() has no effect on android V21


I am working on custom camera and using deprecated Camera api's instead of Camera2 api's in Android L but I am facing lots issues in preview. One of them is, It is showing dark preview and another problem is setSceneMode and setColorEffects making no effect. Please let me know the workaround if any one out there used deprecated camera api's in v21.


Solution

  • Setting a high FPS which may produce a dark preview in some devices, because a high FPS lowers the exposure compensation. Setting it to a variable range instead of a fixed one can solve the problem for the devices that present such issue.

    A device may return a set of supported ranges such as for example: [10-15, 15-30, 30-30]. In this example you would pick up any of the variable ones, and avoid the fixed one [30-30]. Note that fixed ranges are meant to be for video only.