Compare commits
2 Commits
cameraphy
...
cameraphy.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad8ced5b1e | ||
|
|
36b17ee068 |
@@ -15,7 +15,6 @@ import android.util.Range;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
@@ -98,7 +97,7 @@ public final class LogUtils {
|
||||
builder.append("\n (none)");
|
||||
} else {
|
||||
for (String id : cameraIds) {
|
||||
builder.append("\n --video-source=camera --camera-id=").append(id);
|
||||
builder.append("\n --camera-id=").append(id);
|
||||
CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(id);
|
||||
|
||||
int facing = characteristics.get(CameraCharacteristics.LENS_FACING);
|
||||
@@ -114,8 +113,11 @@ public final class LogUtils {
|
||||
|
||||
int[] capabilities = characteristics.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES);
|
||||
if (Arrays.asList(capabilities).contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA)) {
|
||||
Set<String> phy = characteristics.getPhysicalCameraIds();
|
||||
builder.append("\n PHYSICAL: ").append(phy);
|
||||
builder.append("\n Logical multi-camera, backed by physical cameras:");
|
||||
for (String phyId : characteristics.getPhysicalCameraIds()) {
|
||||
CameraCharacteristics phyCharacteristics = cameraManager.getCameraCharacteristics(phyId);
|
||||
appendPhysicalCamera(builder, phyId, phyCharacteristics);
|
||||
}
|
||||
}
|
||||
|
||||
if (includeSizes) {
|
||||
@@ -145,6 +147,13 @@ public final class LogUtils {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private static void appendPhysicalCamera(StringBuilder builder, String id, CameraCharacteristics characteristics) {
|
||||
builder.append("\n --camera-id=").append(id).append(" (");
|
||||
|
||||
Rect activeSize = characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
|
||||
builder.append(activeSize.width()).append("x").append(activeSize.height()).append(")");
|
||||
}
|
||||
|
||||
private static SortedSet<Integer> getUniqueSet(Range<Integer>[] ranges) {
|
||||
SortedSet<Integer> set = new TreeSet<>();
|
||||
for (Range<Integer> range : ranges) {
|
||||
|
||||
Reference in New Issue
Block a user