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

Commit 62ecb20f authored by Rakesh Kumar's avatar Rakesh Kumar Committed by Ray Essick
Browse files

C2SoftXaac: Updating plugin to support latest conformance changes

Bug: 128648229
Test: atest android.media.cts.DecoderTestXheAac
Test: atest android.media.cts.DecoderTestAacDrc
Change-Id: I51f963373fa3b21823621f468421bb642a6163ba
parent d456f916
Loading
Loading
Loading
Loading
+75 −60
Original line number Diff line number Diff line
@@ -1317,6 +1317,17 @@ IA_ERRORCODE C2SoftXaacDec::decodeXAACStream(uint8_t* inBuffer,
                                &ui_exec_done);
    RETURN_IF_FATAL(err_code,  "IA_CMD_TYPE_DONE_QUERY");

    int32_t num_preroll = 0;
    err_code = ixheaacd_dec_api(mXheaacCodecHandle,
                                IA_API_CMD_GET_CONFIG_PARAM,
                                IA_ENHAACPLUS_DEC_CONFIG_GET_NUM_PRE_ROLL_FRAMES,
                                &num_preroll);
    RETURN_IF_FATAL(err_code, "IA_ENHAACPLUS_DEC_CONFIG_GET_NUM_PRE_ROLL_FRAMES");

    {
      int32_t preroll_frame_offset = 0;

        do {
            if (ui_exec_done != 1) {
                VOID* p_array;        // ITTIAM:buffer to handle gain payload
                WORD32 buf_size = 0;  // ITTIAM:gain payload length
@@ -1371,7 +1382,8 @@ IA_ERRORCODE C2SoftXaacDec::decodeXAACStream(uint8_t* inBuffer,
            RETURN_IF_FATAL(err_code,  "IA_API_CMD_GET_OUTPUT_BYTES");

            if (mMpegDDRCPresent == 1) {
        memcpy(mDrcInBuf, mOutputBuffer, *outBytes);
                memcpy(mDrcInBuf, mOutputBuffer + preroll_frame_offset, *outBytes);
                preroll_frame_offset += *outBytes;
                err_code = ia_drc_dec_api(mMpegDDrcHandle, IA_API_CMD_SET_INPUT_BYTES, 0, outBytes);
                RETURN_IF_FATAL(err_code, "IA_API_CMD_SET_INPUT_BYTES");

@@ -1381,6 +1393,9 @@ IA_ERRORCODE C2SoftXaacDec::decodeXAACStream(uint8_t* inBuffer,

                memcpy(mOutputBuffer, mDrcOutBuf, *outBytes);
            }
            num_preroll--;
        } while (num_preroll > 0);
    }
    return IA_NO_ERROR;
}