use of android.hardware.Camera.CameraInfo in project android-gpuimage-ndkbuild-sample by mugku.
the class CameraHelperGB method getCameraInfo.
@Override
public void getCameraInfo(final int cameraId, final CameraHelper.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 android-gpuimage-ndkbuild-sample by mugku.
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;
}
use of android.hardware.Camera.CameraInfo in project android_frameworks_base by DirtyUnicorns.
the class CameraStreamer method getDefaultFacing.
/**
* Returns the camera facing that is chosen when DONT_CARE is specified.
* Returns 0 if neither a front nor back camera could be found.
*/
public static int getDefaultFacing() {
int camCount = Camera.getNumberOfCameras();
if (camCount == 0) {
return 0;
} else {
CameraInfo cameraInfo = new CameraInfo();
Camera.getCameraInfo(0, cameraInfo);
return (cameraInfo.facing == CameraInfo.CAMERA_FACING_FRONT) ? FACING_FRONT : FACING_BACK;
}
}
use of android.hardware.Camera.CameraInfo in project MagicCamera by wuhaoyu1990.
the class CameraEngine method getOrientation.
public static int getOrientation() {
CameraInfo cameraInfo = new CameraInfo();
Camera.getCameraInfo(mCameraID, cameraInfo);
return cameraInfo.orientation;
}
use of android.hardware.Camera.CameraInfo in project XobotOS by xamarin.
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;
}
Aggregations