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

Commit 1ae950a3 authored by Lajos Molnar's avatar Lajos Molnar Committed by Steve Kondik
Browse files

stagefright: synchronously change nativewindow crop



Only change the nativewindow crop before queuing frames
with the new crop.

Change-Id: Icd8a84c82e66a8be3d6bc1675c777b1de8dc39b9
Signed-off-by: default avatarLajos Molnar <lajos@google.com>
Bug: 9395753
parent e101e021
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -2347,9 +2347,6 @@ void ACodec::sendFormatChange(const sp<AMessage> &reply) {
                            rect.nTop,
                            rect.nLeft + rect.nWidth,
                            rect.nTop + rect.nHeight);
                    reply->setInt32(
                            "color-format",
                            (int)(videoDef->eColorFormat));
                }
            }
            break;
@@ -3178,13 +3175,6 @@ void ACodec::BaseState::onOutputBufferDrained(const sp<AMessage> &msg) {
    android_native_rect_t crop;
    if (msg->findRect("crop",
            &crop.left, &crop.top, &crop.right, &crop.bottom)) {
        if (mCodec->mInSmoothStreamingMode) {
            OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
            CHECK(msg->findInt32("color-format", (int32_t*)&eColorFormat));
            QCUtils::updateNativeWindowBufferGeometry(
                    mCodec->mNativeWindow.get(), crop.right,
                    crop.bottom, eColorFormat);
        }
        CHECK_EQ(0, native_window_set_crop(
                mCodec->mNativeWindow.get(), &crop));
    }