Merge "camera2: Add non burst sizes to mandatory streams for ultra high resolution sensors" am: 74ab3f4974 am: 65915a087c am: 287fce0ea9 am: bb83ecf667
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2237375 Change-Id: I53a41b78cf65f1c7e6ca460f50d0e33b5edb5438 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -826,7 +826,9 @@ public abstract class CameraDevice implements AutoCloseable {
|
|||||||
* <p> Here, SC Map, refers to the {@link StreamConfigurationMap}, the target stream sizes must
|
* <p> Here, SC Map, refers to the {@link StreamConfigurationMap}, the target stream sizes must
|
||||||
* be chosen from. {@code DEFAULT} refers to the default sensor pixel mode {@link
|
* be chosen from. {@code DEFAULT} refers to the default sensor pixel mode {@link
|
||||||
* StreamConfigurationMap} and {@code MAX_RES} refers to the maximum resolution {@link
|
* StreamConfigurationMap} and {@code MAX_RES} refers to the maximum resolution {@link
|
||||||
* StreamConfigurationMap}. The same capture request must not mix targets from
|
* StreamConfigurationMap}. For {@code MAX_RES} streams, {@code MAX} in the {@code Max size} column refers to the maximum size from
|
||||||
|
* {@link StreamConfigurationMap#getOutputSizes} and {@link StreamConfigurationMap#getHighResolutionOutputSizes}.
|
||||||
|
* Note: The same capture request must not mix targets from
|
||||||
* {@link StreamConfigurationMap}s corresponding to different sensor pixel modes. </p>
|
* {@link StreamConfigurationMap}s corresponding to different sensor pixel modes. </p>
|
||||||
*
|
*
|
||||||
* <p> 10-bit output capable
|
* <p> 10-bit output capable
|
||||||
|
|||||||
@@ -1723,7 +1723,17 @@ public final class MandatoryStreamCombination {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isUltraHighResolution) {
|
if (isUltraHighResolution) {
|
||||||
sizes.add(getMaxSize(sm.getOutputSizes(formatChosen)));
|
Size [] outputSizes = sm.getOutputSizes(formatChosen);
|
||||||
|
Size [] highResolutionOutputSizes =
|
||||||
|
sm.getHighResolutionOutputSizes(formatChosen);
|
||||||
|
Size maxBurstSize = getMaxSizeOrNull(outputSizes);
|
||||||
|
Size maxHighResolutionSize = getMaxSizeOrNull(highResolutionOutputSizes);
|
||||||
|
Size chosenMaxSize =
|
||||||
|
maxBurstSize != null ? maxBurstSize : maxHighResolutionSize;
|
||||||
|
if (maxBurstSize != null && maxHighResolutionSize != null) {
|
||||||
|
chosenMaxSize = getMaxSize(maxBurstSize, maxHighResolutionSize);
|
||||||
|
}
|
||||||
|
sizes.add(chosenMaxSize);
|
||||||
} else {
|
} else {
|
||||||
if (formatChosen == ImageFormat.RAW_SENSOR) {
|
if (formatChosen == ImageFormat.RAW_SENSOR) {
|
||||||
// RAW_SENSOR always has MAXIMUM threshold.
|
// RAW_SENSOR always has MAXIMUM threshold.
|
||||||
@@ -2125,6 +2135,21 @@ public final class MandatoryStreamCombination {
|
|||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the largest size by area.
|
||||||
|
*
|
||||||
|
* @param sizes an array of sizes
|
||||||
|
*
|
||||||
|
* @return Largest Size or null if sizes was null or had 0 elements
|
||||||
|
*/
|
||||||
|
public static @Nullable Size getMaxSizeOrNull(Size... sizes) {
|
||||||
|
if (sizes == null || sizes.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getMaxSize(sizes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the hardware level reported by android.info.supportedHardwareLevel is
|
* Whether or not the hardware level reported by android.info.supportedHardwareLevel is
|
||||||
* at least the desired one (but could be higher)
|
* at least the desired one (but could be higher)
|
||||||
|
|||||||
Reference in New Issue
Block a user