am befbd422: am be2e38e0: Merge "ImageReader: Fix format workarounds for legacy devices" into mnc-dev

* commit 'befbd42211c8d47c02f08db107f9bc18be8576c6':
  ImageReader: Fix format workarounds for legacy devices
This commit is contained in:
Chien-Yu Chen
2015-06-19 21:22:58 +00:00
committed by Android Git Automerger
2 changed files with 4 additions and 3 deletions

View File

@@ -630,8 +630,6 @@ public class SurfaceTextureRenderer {
holder.width = surfaceSize.getWidth();
holder.height = surfaceSize.getHeight();
if (LegacyCameraDevice.needsConversion(s)) {
// Always override to YV12 output for YUV surface formats.
LegacyCameraDevice.setSurfaceFormat(s, ImageFormat.YV12);
mConversionSurfaces.add(holder);
} else {
mSurfaces.add(holder);

View File

@@ -1240,8 +1240,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);
}
}