| 81 | } |
| 82 | |
| 83 | int32_t InitDecoder (const SDecodingParam* pParam, PWelsDecoderContext pCtx, SLogContext* pLogCtx) { |
| 84 | |
| 85 | |
| 86 | if (NULL == pCtx) |
| 87 | return cmMallocMemeError; |
| 88 | |
| 89 | if (NULL == pCtx->pMemAlign) { |
| 90 | pCtx->pMemAlign = new CMemoryAlign (16); |
| 91 | if (NULL == pCtx->pMemAlign) |
| 92 | return cmMallocMemeError; |
| 93 | } |
| 94 | |
| 95 | pCtx->sLogCtx = *pLogCtx; |
| 96 | |
| 97 | //check param and update decoder context |
| 98 | pCtx->pParam = (SDecodingParam*) pCtx->pMemAlign->WelsMallocz (sizeof (SDecodingParam), "SDecodingParam"); |
| 99 | WELS_VERIFY_RETURN_PROC_IF (cmMallocMemeError, (NULL == pCtx->pParam), UninitDecoder (pCtx)); |
| 100 | int32_t iRet = DecoderConfigParam (pCtx, pParam); |
| 101 | WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess); |
| 102 | |
| 103 | WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (pCtx, pLogCtx), UninitDecoder (pCtx)); |
| 104 | |
| 105 | return cmResultSuccess; |
| 106 | } |
| 107 | |
| 108 | long Initialize (const SDecodingParam* pParam, PWelsDecoderContext pCtx, SLogContext* pLogCtx) { |
| 109 | int iRet = ERR_NONE; |
no test coverage detected