Compare commits
3 Commits
cameraphy.
...
camerafpsr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dedbc3f8cd | ||
|
|
ad8ced5b1e | ||
|
|
36b17ee068 |
@@ -104,15 +104,22 @@ public final class LogUtils {
|
|||||||
builder.append(" (").append(getCameraFacingName(facing)).append(", ");
|
builder.append(" (").append(getCameraFacingName(facing)).append(", ");
|
||||||
|
|
||||||
Rect activeSize = characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
|
Rect activeSize = characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
|
||||||
builder.append(activeSize.width()).append("x").append(activeSize.height()).append(", ");
|
builder.append(activeSize.width()).append("x").append(activeSize.height());
|
||||||
|
|
||||||
// Capture frame rates for low-FPS mode are the same for every resolution
|
try {
|
||||||
Range<Integer>[] lowFpsRanges = characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
|
// Capture frame rates for low-FPS mode are the same for every resolution
|
||||||
SortedSet<Integer> uniqueLowFps = getUniqueSet(lowFpsRanges);
|
Range<Integer>[] lowFpsRanges = characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
|
||||||
builder.append("fps=").append(uniqueLowFps).append(')');
|
SortedSet<Integer> uniqueLowFps = getUniqueSet(lowFpsRanges);
|
||||||
|
builder.append(", fps=").append(uniqueLowFps);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Some devices may provide invalid ranges, causing an IllegalArgumentException "lower must be less than or equal to upper"
|
||||||
|
Ln.w("Could not get available frame rates for camera " + id, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.append(')');
|
||||||
|
|
||||||
int[] capabilities = characteristics.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES);
|
int[] capabilities = characteristics.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES);
|
||||||
if (contains(capabilities, CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA)) {
|
if (Arrays.asList(capabilities).contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA)) {
|
||||||
builder.append("\n Logical multi-camera, backed by physical cameras:");
|
builder.append("\n Logical multi-camera, backed by physical cameras:");
|
||||||
for (String phyId : characteristics.getPhysicalCameraIds()) {
|
for (String phyId : characteristics.getPhysicalCameraIds()) {
|
||||||
CameraCharacteristics phyCharacteristics = cameraManager.getCameraCharacteristics(phyId);
|
CameraCharacteristics phyCharacteristics = cameraManager.getCameraCharacteristics(phyId);
|
||||||
@@ -147,16 +154,6 @@ public final class LogUtils {
|
|||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean contains(int[] array, int value) {
|
|
||||||
for (int i : array) {
|
|
||||||
if (i == value) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void appendPhysicalCamera(StringBuilder builder, String id, CameraCharacteristics characteristics) {
|
private static void appendPhysicalCamera(StringBuilder builder, String id, CameraCharacteristics characteristics) {
|
||||||
builder.append("\n --camera-id=").append(id).append(" (");
|
builder.append("\n --camera-id=").append(id).append(" (");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user