C2 vp9, av1: Add support for conversion to RGBA1010102 for 10-bit decode
In Android T and above, HAL_PIXEL_FORMAT_RGBA_1010102 corresponds to
actual RGBA 1010102 format which was earlier used to return YUV 1010102
data. Now when HAL_PIXEL_FORMAT_RGBA_1010102 is selected, YUV 10 bit
output from decoder is converted to RGBA 1010102 format.
This conversion to RGBA is done only in Android T and above to ensure
that these libraries continue to work as per the old convention when
running on older android versions.
Bug: 229002916
Test: decode 10-bit av1 clip in gallery
Test: atest android.mediav2.cts.CodecDecoderSurfaceTest \
android.mediav2.cts.AdaptivePlaybackTest \
android.mediav2.cts.CodecDecoderTest -- --module-arg \
CtsMediaV2TestCases:instrumentation-arg:codec-prefix:=c2.android.
Change-Id: I0b7fd8b581e39df65c5984ece4a6fdbe646d18a1
diff --git a/media/codec2/components/vpx/C2SoftVpxDec.cpp b/media/codec2/components/vpx/C2SoftVpxDec.cpp
index e81f044..c2ccfa0 100644
--- a/media/codec2/components/vpx/C2SoftVpxDec.cpp
+++ b/media/codec2/components/vpx/C2SoftVpxDec.cpp
@@ -760,7 +760,7 @@
[dstY, srcY, srcU, srcV,
srcYStride, srcUStride, srcVStride, dstYStride,
width = mWidth, height = std::min(mHeight - i, kHeight)] {
- convertYUV420Planar16ToY410(
+ convertYUV420Planar16ToY410OrRGBA1010102(
(uint32_t *)dstY, srcY, srcU, srcV, srcYStride / 2,
srcUStride / 2, srcVStride / 2, dstYStride / sizeof(uint32_t),
width, height);