diff options
author | Chien-Yu Chen <cychen@google.com> | 2015-06-11 16:48:13 -0700 |
---|---|---|
committer | Chien-Yu Chen <cychen@google.com> | 2015-06-17 11:03:04 -0700 |
commit | 0782aab077b32613c6715190135008dbf3dc5d6d (patch) | |
tree | d8f1f0c1e701e943884534d91260f2235a1786a9 /media | |
parent | 98b40aac8399d8befc5099955a34ce54df477d8f (diff) | |
download | frameworks_base-0782aab077b32613c6715190135008dbf3dc5d6d.zip frameworks_base-0782aab077b32613c6715190135008dbf3dc5d6d.tar.gz frameworks_base-0782aab077b32613c6715190135008dbf3dc5d6d.tar.bz2 |
ImageReader: Fix format workarounds for legacy devices
Legacy shim overrides HAL_PIXEL_FORMAT_BLOB to
HAL_PIXEL_FORMAT_RGBA_8888. Make ImageReader aware of the
workaround when returning the format.
Remove the workaround in legacy shim that overrides YUV_420_888
to YV12 because allocating YUV_420_888 buffers with SW access
is supported on Flo.
Bug: 21707937
Change-Id: I84a8610c82ae986a0064873f611e4f257baf1774
Diffstat (limited to 'media')
-rw-r--r-- | media/jni/android_media_ImageReader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/jni/android_media_ImageReader.cpp b/media/jni/android_media_ImageReader.cpp index 49614bd..b3393a7 100644 --- a/media/jni/android_media_ImageReader.cpp +++ b/media/jni/android_media_ImageReader.cpp @@ -1229,8 +1229,11 @@ static jint Image_getFormat(JNIEnv* env, jobject thiz, jint readerFormat) return static_cast<jint>(PublicFormat::PRIVATE); } else { CpuConsumer::LockedBuffer* buffer = Image_getLockedBuffer(env, thiz); + int readerHalFormat = android_view_Surface_mapPublicFormatToHalFormat( + static_cast<PublicFormat>(readerFormat)); + int32_t fmt = applyFormatOverrides(buffer->flexFormat, readerHalFormat); PublicFormat publicFmt = android_view_Surface_mapHalFormatDataspaceToPublicFormat( - buffer->flexFormat, buffer->dataSpace); + fmt, buffer->dataSpace); return static_cast<jint>(publicFmt); } } |