History

remove parseonly in decoder ctx

huili2 committed 10 years ago

Commit 926fc671 parent 60aaf4811 files · +128 −86Browse files

Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 11 files). Show all

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+9−5
@@ -243,6 +243,7 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 242 unmodified lines
243243 "CWelsDecoder::init_decoder(), openh264 codec version = %s, ParseOnly = %d",
244244 VERSION_NUMBER, (int32_t)pParam->bParseOnly);
245245
246+ //reset decoder context
246247 if (m_pDecContext) //free
247248 UninitDecoder();
248249 m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext");
@@ -252,8 +253,8 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 3 unmodified lines
252253 m_pDecContext->pMemAlign = new CMemoryAlign (iCacheLineSize);
253254 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == m_pDecContext->pMemAlign), UninitDecoder())
254255
255− WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, pParam->bParseOnly,
256− &m_pWelsTrace->m_sLogCtx), UninitDecoder())
256+ //fill in default value into context
257+ WelsDecoderDefaults (m_pDecContext, &m_pWelsTrace->m_sLogCtx);
257258
258259 //check param and update decoder context
259260 m_pDecContext->pParam = (SDecodingParam*) m_pDecContext->pMemAlign->WelsMallocz (sizeof (SDecodingParam),
@@ -262,6 +263,9 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 2 unmodified lines
262263 int32_t iRet = DecoderConfigParam (m_pDecContext, pParam);
263264 WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess);
264265
266+ //init decoder
267+ WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, &m_pWelsTrace->m_sLogCtx), UninitDecoder())
268+
265269 return cmResultSuccess;
266270 }
267271
@@ -304,7 +308,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 36 unmodified lines
304308
305309 iVal = * ((int*)pOption); // int value for error concealment idc
306310 iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE);
307− if ((m_pDecContext->bParseOnly) && (iVal != (int32_t) ERROR_CON_DISABLE)) {
311+ if ((m_pDecContext->pParam->bParseOnly) && (iVal != (int32_t) ERROR_CON_DISABLE)) {
308312 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
309313 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);
310314 return cmInitParaError;
@@ -438,7 +442,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 127 unmodified lines
438442 const int kiSrcLen,
439443 unsigned char** ppDst,
440444 SBufferInfo* pDstInfo) {
441− if (m_pDecContext->bParseOnly) {
445+ if (m_pDecContext->pParam->bParseOnly) {
442446 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be false for this API calling! \n");
443447 m_pDecContext->iErrorCode |= dsInvalidArgument;
444448 return dsInvalidArgument;
@@ -583,7 +587,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 138 unmodified lines
583587 DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc,
584588 const int kiSrcLen,
585589 SParserBsInfo* pDstInfo) {
586− if (!m_pDecContext->bParseOnly) {
590+ if (!m_pDecContext->pParam->bParseOnly) {
587591 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be true for this API calling! \n");
588592 m_pDecContext->iErrorCode |= dsInvalidArgument;
589593 return dsInvalidArgument;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t