use of android.hardware.Camera.CameraInfo in project android_frameworks_base by crdroidandroid.
the class CameraProfile method getJpegEncodingQualityParameter.
/**
* Returns a pre-defined still image capture (jpeg) quality level
* used for the given quality level in the Camera application for
* the first back-facing camera on the device. If the device has no
* back-facing camera, this returns 0.
*
* @param quality The target quality level
*/
public static int getJpegEncodingQualityParameter(int quality) {
int numberOfCameras = Camera.getNumberOfCameras();
CameraInfo cameraInfo = new CameraInfo();
for (int i = 0; i < numberOfCameras; i++) {
Camera.getCameraInfo(i, cameraInfo);
if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
return getJpegEncodingQualityParameter(i, quality);
}
}
return 0;
}
Aggregations