use of android.hardware.Camera.CameraInfo in project android_frameworks_base by ResurrectionRemix.
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 ResurrectionRemix.
the class CamcorderProfile method hasProfile.
/**
* Returns true if camcorder profile exists for the first back-facing
* camera at the given quality level.
*
* <p>
* When using the Camera 2 API in {@code LEGACY} mode (i.e. when
* {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL} is set
* to
* {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY}),
* {@link #hasProfile} may return {@code true} for unsupported resolutions. To ensure a
* a given resolution is supported in LEGACY mode, the configuration given in
* {@link android.hardware.camera2.CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP}
* must contain the the resolution in the supported output sizes. The recommended way to check
* this is with
* {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes(Class)} with the
* class of the desired recording endpoint, and check that the desired resolution is contained
* in the list returned.
* </p>
* @see android.hardware.camera2.CameraManager
* @see android.hardware.camera2.CameraCharacteristics
*
* @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 ResurrectionRemix.
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 android_frameworks_base by DirtyUnicorns.
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 DirtyUnicorns.
the class CamcorderProfile method hasProfile.
/**
* Returns true if camcorder profile exists for the first back-facing
* camera at the given quality level.
*
* <p>
* When using the Camera 2 API in {@code LEGACY} mode (i.e. when
* {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL} is set
* to
* {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY}),
* {@link #hasProfile} may return {@code true} for unsupported resolutions. To ensure a
* a given resolution is supported in LEGACY mode, the configuration given in
* {@link android.hardware.camera2.CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP}
* must contain the the resolution in the supported output sizes. The recommended way to check
* this is with
* {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes(Class)} with the
* class of the desired recording endpoint, and check that the desired resolution is contained
* in the list returned.
* </p>
* @see android.hardware.camera2.CameraManager
* @see android.hardware.camera2.CameraCharacteristics
*
* @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;
}
Aggregations