diff options
Diffstat (limited to 'cros_gralloc')
| -rw-r--r-- | cros_gralloc/gralloc4/CrosGralloc4Mapper.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc b/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc index 47e24ac..2a3f4c0 100644 --- a/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc +++ b/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc @@ -467,7 +467,12 @@ Return<void> CrosGralloc4Mapper::get(cros_gralloc_handle_t crosHandle, PixelFormat pixelFormat = static_cast<PixelFormat>(crosHandle->droid_format); status = android::gralloc4::encodePixelFormatRequested(pixelFormat, &encodedMetadata); } else if (metadataType == android::gralloc4::MetadataType_PixelFormatFourCC) { - status = android::gralloc4::encodePixelFormatFourCC(crosHandle->format, &encodedMetadata); + uint32_t format = crosHandle->format; + // Map internal fourcc codes back to standard fourcc codes. + if (format == DRM_FORMAT_YVU420_ANDROID) { + format = DRM_FORMAT_YVU420; + } + status = android::gralloc4::encodePixelFormatFourCC(format, &encodedMetadata); } else if (metadataType == android::gralloc4::MetadataType_PixelFormatModifier) { status = android::gralloc4::encodePixelFormatModifier(crosHandle->format_modifier, &encodedMetadata); |
