use of android.hardware.Camera.CameraInfo in project android_frameworks_base by ParanoidAndroid.
the class CamcorderProfile method hasProfile.
/**
* Returns true if camcorder profile exists for the first back-facing
* camera at the given quality level.
* @param quality the target quality level for the camcorder profile
*/
public static boolean hasProfile(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 hasProfile(i, quality);
}
}
return false;
}
use of android.hardware.Camera.CameraInfo in project android_frameworks_base by ParanoidAndroid.
the class CamcorderProfile method get.
/**
* Returns the camcorder profile for the first back-facing camera on the
* device at the given quality level. If the device has no back-facing
* camera, this returns null.
* @param quality the target quality level for the camcorder profile
* @see #get(int, int)
*/
public static CamcorderProfile get(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 get(i, quality);
}
}
return null;
}
use of android.hardware.Camera.CameraInfo in project android_frameworks_base by ParanoidAndroid.
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;
}
use of android.hardware.Camera.CameraInfo in project StickerCamera by Skykai521.
the class CameraHelperGB method getCameraInfo.
@Override
public void getCameraInfo(final int cameraId, final CameraInfo2 cameraInfo) {
CameraInfo info = new CameraInfo();
Camera.getCameraInfo(cameraId, info);
cameraInfo.facing = info.facing;
cameraInfo.orientation = info.orientation;
}
use of android.hardware.Camera.CameraInfo in project StickerCamera by Skykai521.
the class CameraHelperGB method getCameraId.
private int getCameraId(final int facing) {
int numberOfCameras = Camera.getNumberOfCameras();
CameraInfo info = new CameraInfo();
for (int id = 0; id < numberOfCameras; id++) {
Camera.getCameraInfo(id, info);
if (info.facing == facing) {
return id;
}
}
return -1;
}
Aggregations