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

Commit 4be41e9d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "avc-fatal-errors" into qt-dev

* changes:
  C2SoftAvcDec: return error for fatal errors in decoder
  SoftAVCDec: notify error for fatal errors in decoder
parents 1c334da0 8f98eee3
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -812,19 +812,19 @@ void C2SoftAvcDec::process(
            ALOGV("decodeTime=%6d delay=%6d numBytes=%6d", decodeTime, delay,
                  s_decode_op.u4_num_bytes_consumed);
        }
        if (IVD_MEM_ALLOC_FAILED == (s_decode_op.u4_error_code & 0xFF)) {
        if (IVD_MEM_ALLOC_FAILED == (s_decode_op.u4_error_code & IVD_ERROR_MASK)) {
            ALOGE("allocation failure in decoder");
            mSignalledError = true;
            work->workletsProcessed = 1u;
            work->result = C2_CORRUPTED;
            return;
        } else if (IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED == (s_decode_op.u4_error_code & 0xFF)) {
        } else if (IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED == (s_decode_op.u4_error_code & IVD_ERROR_MASK)) {
            ALOGE("unsupported resolution : %dx%d", mWidth, mHeight);
            mSignalledError = true;
            work->workletsProcessed = 1u;
            work->result = C2_CORRUPTED;
            return;
        } else if (IVD_RES_CHANGED == (s_decode_op.u4_error_code & 0xFF)) {
        } else if (IVD_RES_CHANGED == (s_decode_op.u4_error_code & IVD_ERROR_MASK)) {
            ALOGV("resolution changed");
            drainInternal(DRAIN_COMPONENT_NO_EOS, pool, work);
            resetDecoder();
@@ -834,6 +834,12 @@ void C2SoftAvcDec::process(
            /* Decode header and get new dimensions */
            setParams(mStride, IVD_DECODE_HEADER);
            (void) ivdec_api_function(mDecHandle, &s_decode_ip, &s_decode_op);
        } else if (IS_IVD_FATAL_ERROR(s_decode_op.u4_error_code)) {
            ALOGE("Fatal error in decoder 0x%x", s_decode_op.u4_error_code);
            mSignalledError = true;
            work->workletsProcessed = 1u;
            work->result = C2_CORRUPTED;
            return;
        }
        if (0 < s_decode_op.u4_pic_wd && 0 < s_decode_op.u4_pic_ht) {
            if (mHeaderDecoded == false) {
+10 −3
Original line number Diff line number Diff line
@@ -580,7 +580,7 @@ void SoftAVC::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) {
@@ -590,7 +590,7 @@ void SoftAVC::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);
@@ -598,7 +598,14 @@ void SoftAVC::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();