SetPreviewFpsRange does not work even though the values ​​are within the range of getPreviewFpsRange

This simple code:

Camera.Parameters params = currentCamera.getParameters(); params.setPreviewFpsRange( 10000, 15000 ); currentCamera.setParameters( params ); 

does not work on my Nexus 4 (or my Motorola Atrix), despite the acceptable values ​​between the allowable range from 5000 to 120,000.

When I try to use any min or max values ​​other than 5000 and 120000, I get:

 setPreviewFpsRange(const android::QCameraParameters&): error: FPS range value not supported 

which is stupid. Also, I tried this code on my older Motorola Atrix (which shows that the valid fps range is from 10,000 to 30,000) and it also doesn't work. Anything you can do?

From my search on the topic, I found that a) there is very little material in this area, and b) it may be that this functionality is simply not supported by some platforms. It's a little strange that the current Google flagship phone, the Nexus 4, does not support it, though ...

+4
source share
2 answers

Ahaha! Therefore, as part of my search for answers, I tested the operation of my Nexus 10 with my application. It turns out that the values ​​returned by getSupportedFpsRange function are ranges representing exact duplicates that can be entered into setPreviewFpsRange, and any other duplicates are not supported (as far as I can tell, anyway.)

I discovered this because Nexus 10 returns multiple duplicates from getSupportedFpsRange. I duplicated here getSupportedFpsRange return values ​​for three devices.

Examples of supported range values

LG Nexus 4:

Preview-FPS-value range = (5000.120000);

Motorola Atrix:

Preview-FPS-value range = (10000,30000);

Samsung Nexus 10:

Preview-FPS-range of values ​​= (15000.15000), (24000.24000), (25000.25000), (15000.300000), (30000.300000);

Conclusion

We cannot do

 params.setPreviewFpsRange( 29000, 29000 ); 

so that the preview is at 29 frames per second, if the device already does not specifically support this duplicate.

Of course, the original reason I studied this functionality was the hope that a smooth Nexus 4 image with a silky smooth camera would be played in my application. This, it would seem, convincingly proves that, at least on Nexus 4, setPreviewFpsRange will not help with this.

Search Continuation Time. (

+17
source

I found that if in the getSupportedPreviewFpsRange list there is only one pair of supported values, such as (2000, 35000), which is from 2 to 35 frames per second, then it will take any value between this range.

If the list contains more pairs, you need to use one of them

 List<int[]> fpsRange = param.getSupportedPreviewFpsRange(); if (fpsRange.size() == 1) { //fpsRange.get(0)[0] < CAMERA_PREVIEW_FPS < fpsRange.get(0)[1] param.setPreviewFpsRange(CAMERA_PREVIEW_FPS, CAMERA_PREVIEW_FPS); } else { //pick first from list to limit framerate or last to maximize framerate param.setPreviewFpsRange(fpsRange.get(0)[0], fpsRange.get(0)[1]); } 
-2
source

All Articles