Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be2e38e0 authored by Chien-Yu Chen's avatar Chien-Yu Chen Committed by Android (Google) Code Review
Browse files

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

parents f3e8dca8 0782aab0
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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);
+4 −1
Original line number Diff line number Diff line
@@ -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);
    }
}