Merge "ImageReader: Fix format workarounds for legacy devices" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
be2e38e01c
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user