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

Commit 8140a2b7 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: report crop rectangle as codec resolution if exists

Bug: 18789054
Change-Id: I08b82a400541b5e09580801473c34ce56bfef5db
parent 7ae3dfab
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1014,9 +1014,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {

                    // Notify mCrypto of video resolution changes
                    if (mCrypto != NULL) {
                      int32_t height, width;
                      if (mOutputFormat->findInt32("height", &height) &&
                          mOutputFormat->findInt32("width", &width)) {
                        int32_t left, top, right, bottom, width, height;
                        if (mOutputFormat->findRect("crop", &left, &top, &right, &bottom)) {
                            mCrypto->notifyResolution(right - left + 1, bottom - top + 1);
                        } else if (mOutputFormat->findInt32("width", &width)
                                && mOutputFormat->findInt32("height", &height)) {
                            mCrypto->notifyResolution(width, height);
                        }
                    }