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
243 "CWelsDecoder::init_decoder(), openh264 codec version = %s, ParseOnly = %d",243 "CWelsDecoder::init_decoder(), openh264 codec version = %s, ParseOnly = %d",
244 VERSION_NUMBER, (int32_t)pParam->bParseOnly);244 VERSION_NUMBER, (int32_t)pParam->bParseOnly);
245 245
246 //reset decoder context
246 if (m_pDecContext) //free247 if (m_pDecContext) //free
247 UninitDecoder();248 UninitDecoder();
248 m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext");249 m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext");
@@ -252,8 +253,8 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 3 unmodified lines
252 m_pDecContext->pMemAlign = new CMemoryAlign (iCacheLineSize);253 m_pDecContext->pMemAlign = new CMemoryAlign (iCacheLineSize);
253 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == m_pDecContext->pMemAlign), UninitDecoder())254 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == m_pDecContext->pMemAlign), UninitDecoder())
254 255
255 WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, pParam->bParseOnly,256 //fill in default value into context
256 &m_pWelsTrace->m_sLogCtx), UninitDecoder())257 WelsDecoderDefaults (m_pDecContext, &m_pWelsTrace->m_sLogCtx);
257 258
258 //check param and update decoder context259 //check param and update decoder context
259 m_pDecContext->pParam = (SDecodingParam*) m_pDecContext->pMemAlign->WelsMallocz (sizeof (SDecodingParam),260 m_pDecContext->pParam = (SDecodingParam*) m_pDecContext->pMemAlign->WelsMallocz (sizeof (SDecodingParam),
@@ -262,6 +263,9 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 2 unmodified lines
262 int32_t iRet = DecoderConfigParam (m_pDecContext, pParam);263 int32_t iRet = DecoderConfigParam (m_pDecContext, pParam);
263 WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess);264 WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess);
264 265
266 //init decoder
267 WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, &m_pWelsTrace->m_sLogCtx), UninitDecoder())
268
265 return cmResultSuccess;269 return cmResultSuccess;
266}270}
267 271
@@ -304,7 +308,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 36 unmodified lines
304 308
305 iVal = * ((int*)pOption); // int value for error concealment idc309 iVal = * ((int*)pOption); // int value for error concealment idc
306 iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE);310 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)) {
308 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,312 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
309 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);313 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);
310 return cmInitParaError;314 return cmInitParaError;
@@ -438,7 +442,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 127 unmodified lines
438 const int kiSrcLen,442 const int kiSrcLen,
439 unsigned char** ppDst,443 unsigned char** ppDst,
440 SBufferInfo* pDstInfo) {444 SBufferInfo* pDstInfo) {
441 if (m_pDecContext->bParseOnly) {445 if (m_pDecContext->pParam->bParseOnly) {
442 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be false for this API calling! \n");446 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be false for this API calling! \n");
443 m_pDecContext->iErrorCode |= dsInvalidArgument;447 m_pDecContext->iErrorCode |= dsInvalidArgument;
444 return dsInvalidArgument;448 return dsInvalidArgument;
@@ -583,7 +587,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 138 unmodified lines
583DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc,587DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc,
584 const int kiSrcLen,588 const int kiSrcLen,
585 SParserBsInfo* pDstInfo) {589 SParserBsInfo* pDstInfo) {
586 if (!m_pDecContext->bParseOnly) {590 if (!m_pDecContext->pParam->bParseOnly) {
587 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be true for this API calling! \n");591 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be true for this API calling! \n");
588 m_pDecContext->iErrorCode |= dsInvalidArgument;592 m_pDecContext->iErrorCode |= dsInvalidArgument;
589 return dsInvalidArgument;593 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