AImageReader: Add support for private format
The private format was unsupported in API24, but since API26 added
getAHardwareBuffer for AImageReader, the format becomes useful now. It
maps to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED defined in
<system/graphics.h>.
This CL also updates the supported format/usage combination with the
rule that if format is AIMAGE_FORMAT_PRIVATE, neither CPU_READ or
CPU_READ_OFTEN is supported.
Bug: 37097572
Test: AImageReaderCts, Graphics CTS
Change-Id: Ide3db8c6ceb4504d6f198ea1d9526edecc3a56ad
diff --git a/media/ndk/NdkImageReaderPriv.h b/media/ndk/NdkImageReaderPriv.h
index 989c1fd..989b937 100644
--- a/media/ndk/NdkImageReaderPriv.h
+++ b/media/ndk/NdkImageReaderPriv.h
@@ -49,7 +49,7 @@
struct AImageReader : public RefBase {
public:
- static bool isSupportedFormat(int32_t format);
+ static bool isSupportedFormatAndUsage(int32_t format, uint64_t usage0);
static int getNumPlanesForFormat(int32_t format);
AImageReader(int32_t width,