While googling, I've got this information that if I want to enable my camera to record high frame rate video on android device, I need to put specific parameters by device vendor for calling camera APIs.
For example, by calling the methods as below, I could enable my Galaxy S6 camera app recording 120 fps constantly.
camera = Camera.open();
Camera.Parameters parms = camera.getParameters();
// for 120fps
parms.set("fast-fps-mode", 2); // 2 for 120fps
parms.setPreviewFpsRange(120000, 120000);
But the problem is no all devices(including LG, and other vendors) support 120 fps(or higher). So I need to know maximum fps in API level in real-time when run my camera app for error handling.
In my case, Camera.Parameters.getSupportedPreviewFpsRange() not worked for me. It only returns maximum 30000(meaning 30fps) even it could record at 120000(120 fps). I think it because recording at high frame rate(more than 30 fps) is strongly related with camera hardware property and that's why I need to call vendor specific APIs.
Is there a common way to get maximum fps by camera device in API level?
---------------------- EDIT ----------------------
On API21(LOLLIPOP), we could use StreamConfigurationMap to get maximum value for high speed fps recording. The usage is as below.
CameraManager manager = (CameraManager)activity.getSystemService(Context.CAMERA_SERVICE);
String cameraId = manager.getCameraIdList()[0];
CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);
StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
Range<Integer>[] fpsRange = map.getHighSpeedVideoFpsRanges(); // this range intends available fps range of device's camera.