Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setPreviewFPSRange on back-facing camera causes RunTimeException in Nexus S

 
Jeevitha Jay
Greenhorn
Posts: 3
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am trying to set the frame rate for camera preview and testing it on Nexus S.
The Camera.Parameters.getSupportedPreviewFPSRange for back-facing camera returns 15000 and 30000. and front-facing camera returns 7000 and 30000.

The follwoing code works fine without error for the front facing camera, but for the back-facing camera, it throws a runtime exception in setParameters "java.lang.RunTimeException, setParameters failed. "
Tried it with various values ranging from 15001 to 29999 and no luck.


if(cameraInfo.facing == CameraInfo.CAMERA_FACING_FRONT){
parameters.setPreviewFpsRange(8000, 25000);
}
else{
parameters.setPreviewFpsRange(16000, 22000);
}

mCamera.setParameters(parameters);


Eventhough the code for front-facing camera executes without error, the FPS seems to be arounnd 7.5 to 8.3 always irrespective of the value set. Any ideas or suggestions?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic