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

Commit 983e8ca3 authored by Harish Mahendrakar's avatar Harish Mahendrakar Committed by Ray Essick
Browse files

SoftHevcDec: notify error for fatal errors in decoder

Bug: 129796771
Bug: 130578045
Test: adb shell stagefright -s -S /sdcard/crowd422_hevc.mp4
Test: Ensure decoder doesn't attemp decoding all frames
Test: atest android.media.cts.DecoderTest
Test: android.media.cts.AdaptivePlaybackTest

Change-Id: Icb183d9aaa4280416c468e71cf319dacacf3b2ea
parent da35a430
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -569,7 +569,7 @@ void SoftHEVC::onQueueFilled(OMX_U32 portIndex) {
            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));
                (IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED == (s_dec_op.u4_error_code & IVD_ERROR_MASK));

            /* Check for unsupported dimensions */
            if (unsupportedResolution) {
@@ -579,7 +579,8 @@ void SoftHEVC::onQueueFilled(OMX_U32 portIndex) {
                return;
            }

            bool allocationFailed = (IVD_MEM_ALLOC_FAILED == (s_dec_op.u4_error_code & 0xFF));
            bool allocationFailed = 
                (IVD_MEM_ALLOC_FAILED == (s_dec_op.u4_error_code & IVD_ERROR_MASK));
            if (allocationFailed) {
                ALOGE("Allocation failure in decoder");
                notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
@@ -587,7 +588,14 @@ void SoftHEVC::onQueueFilled(OMX_U32 portIndex) {
                return;
            }

            bool resChanged = (IVD_RES_CHANGED == (s_dec_op.u4_error_code & 0xFF));
            if (IS_IVD_FATAL_ERROR(s_dec_op.u4_error_code)) {
                ALOGE("Fatal Error : 0x%x", s_dec_op.u4_error_code);
                notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
                mSignalledError = true;
                return;
            }

            bool resChanged = (IVD_RES_CHANGED == (s_dec_op.u4_error_code & IVD_ERROR_MASK));

            getVUIParams();