Merge "MediaCodecInfo: do not alter performance points for 32-bit processes" am: 4f94f12cba

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532514

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifaf8e8a99c2626cf0ed9525bd1cd4d12a26408d9
This commit is contained in:
Wonsik Kim
2020-12-18 00:38:20 +00:00
committed by Automerger Merge Worker

View File

@@ -1865,10 +1865,6 @@ public final class MediaCodecInfo {
&& aligned.mMaxMacroBlockRate >= otherAligned.mMaxMacroBlockRate);
}
/* package private */ boolean isEqualDimension(@NonNull PerformancePoint other) {
return mWidth == other.mWidth && mHeight == other.mHeight;
}
private @NonNull Size getCommonBlockSize(@NonNull PerformancePoint other) {
return new Size(
Math.max(mBlockSize.getWidth(), other.mBlockSize.getWidth()) * 16,
@@ -2010,8 +2006,11 @@ public final class MediaCodecInfo {
* codecs are active, should use that highest pixel count, and add the frame rates of
* each individual codec.
* <p class=note>
* Supported resolution could be further restricted for 32-bit processes due to
* the limited virtual memory space.
* 32-bit processes will not support resolutions larger than 4096x4096 due to
* the limited address space, but performance points will be presented as is.
* In other words, even though a component publishes a performance point for
* a resolution higher than 4096x4096, it does not mean that the resolution is supported
* for 32-bit processes.
*/
@Nullable
public List<PerformancePoint> getSupportedPerformancePoints() {
@@ -2215,28 +2214,6 @@ public final class MediaCodecInfo {
(a.getMaxFrameRate() != b.getMaxFrameRate()) ?
(a.getMaxFrameRate() < b.getMaxFrameRate() ? -1 : 1) : 0));
// remove redundant points
for (int i = 1; i < ret.size(); ++i) {
PerformancePoint a = ret.get(i);
for (int j = 0; j < i; ++j) {
PerformancePoint b = ret.get(j);
if (b.isEqualDimension(a) && b.covers(a)) {
ret.set(i, null);
break;
}
}
}
int newSize = 0;
for (int i = 0; i < ret.size(); ++i) {
PerformancePoint a = ret.get(i);
if (a == null) {
continue;
}
ret.set(newSize, a);
++newSize;
}
ret.setSize(newSize);
return Collections.unmodifiableList(ret);
}