Merge "Relax constraints on valid ImageReader usage flags" into pi-dev
am: fa43016626
Change-Id: I6e72c51e84a3d44fe2b7a5c53ee5b8627a823336
This commit is contained in:
@@ -727,18 +727,7 @@ public class ImageReader implements AutoCloseable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (format == ImageFormat.PRIVATE) {
|
return true;
|
||||||
// Usage need to be either USAGE0_GPU_SAMPLED_IMAGE or USAGE0_VIDEO_ENCODE or combined.
|
|
||||||
boolean isAllowed = (usage == HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE);
|
|
||||||
isAllowed = isAllowed || (usage == HardwareBuffer.USAGE_VIDEO_ENCODE);
|
|
||||||
isAllowed = isAllowed || (usage ==
|
|
||||||
(HardwareBuffer.USAGE_VIDEO_ENCODE | HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE));
|
|
||||||
return isAllowed;
|
|
||||||
} else {
|
|
||||||
// Usage need to make the buffer CPU readable for explicit format.
|
|
||||||
return ((usage == HardwareBuffer.USAGE_CPU_READ_RARELY) ||
|
|
||||||
(usage == HardwareBuffer.USAGE_CPU_READ_OFTEN));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user