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

Commit da49a5ed authored by Emilian Peev's avatar Emilian Peev
Browse files

ImageReader: Set inverse diplay transform if needed

Image transform sometimes could be missing the inverse
display flag. Any buffers that pass through BQs will
have this bit reset and moved in a separate buffer item
field. To restore and pass the original transform forward
check whether the flag got reset and re-enable it
accordingly.

Bug: 110641448
Test: Manual using application,
Camera CTS

Change-Id: Ia849f62333be40038a02768563b2f93e2ccf61ce
parent 80167ec0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -612,8 +612,12 @@ static jint ImageReader_imageSetup(JNIEnv* env, jobject thiz, jobject image) {
    Image_setBufferItem(env, image, buffer);
    env->SetLongField(image, gSurfaceImageClassInfo.mTimestamp,
            static_cast<jlong>(buffer->mTimestamp));
    auto transform = buffer->mTransform;
    if (buffer->mTransformToDisplayInverse) {
        transform |= NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY;
    }
    env->SetIntField(image, gSurfaceImageClassInfo.mTransform,
            static_cast<jint>(buffer->mTransform));
            static_cast<jint>(transform));
    env->SetIntField(image, gSurfaceImageClassInfo.mScalingMode,
            static_cast<jint>(buffer->mScalingMode));