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

Commit 075a815a authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge \\\\"SoftHEVC: Exit gracefully in case of decoder errors\\\\" into...

Merge \\\\"SoftHEVC: Exit gracefully in case of decoder errors\\\\" into mnc-dr-dev am: 56317f8d am: b13e845d am: 2d1be7fe
am: ef3efe5a

Change-Id: I13bd5ffbbc8119a956eae98c3808d39afd7b89b3
parents 88b6c4d3 ef3efe5a
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -444,6 +444,9 @@ void SoftHEVC::onQueueFilled(OMX_U32 portIndex) {

    if (NULL == mCodecCtx) {
        if (OK != initDecoder()) {
            ALOGE("Failed to initialize decoder");
            notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
            mSignalledError = true;
            return;
        }
    }
@@ -530,6 +533,25 @@ void SoftHEVC::onQueueFilled(OMX_U32 portIndex) {
            IV_API_CALL_STATUS_T status;
            status = ivdec_api_function(mCodecCtx, (void *)&s_dec_ip, (void *)&s_dec_op);

            bool unsupportedResolution =
                (IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED == (s_dec_op.u4_error_code & 0xFF));

            /* Check for unsupported dimensions */
            if (unsupportedResolution) {
                ALOGE("Unsupported resolution : %dx%d", mWidth, mHeight);
                notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
                mSignalledError = true;
                return;
            }

            bool allocationFailed = (IVD_MEM_ALLOC_FAILED == (s_dec_op.u4_error_code & 0xFF));
            if (allocationFailed) {
                ALOGE("Allocation failure in decoder");
                notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
                mSignalledError = true;
                return;
            }

            bool resChanged = (IVD_RES_CHANGED == (s_dec_op.u4_error_code & 0xFF));

            GETTIME(&mTimeEnd, NULL);