History

remove bParseonly in ctx using that in param, and slightly modify the initialize process of decoder

huili2 committed 11 years ago

Commit 777dbc01 parent b700b6711 files · +133 −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+8−4
@@ -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
@@ -291,7 +295,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 23 unmodified lines
291 return dsInitialOptExpected;295 return dsInitialOptExpected;
292 296
293 if (eOptID == DECODER_OPTION_DATAFORMAT) { // Set color space of decoding output frame297 if (eOptID == DECODER_OPTION_DATAFORMAT) { // Set color space of decoding output frame
294 if (m_pDecContext->bParseOnly) {298 if (m_pDecContext->pParam->bParseOnly) {
295 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,299 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,
296 "CWelsDecoder::SetOption for data format meaningless for parseonly.");300 "CWelsDecoder::SetOption for data format meaningless for parseonly.");
297 return cmResultSuccess;301 return cmResultSuccess;
@@ -318,7 +322,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 20 unmodified lines
318 iVal = * ((int*)pOption); // int value for error concealment idc322 iVal = * ((int*)pOption); // int value for error concealment idc
319 iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE);323 iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE);
320 m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal;324 m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal;
321 if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) {325 if ((m_pDecContext->pParam->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) {
322 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,326 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
323 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);327 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);
324 return cmInitParaError;328 return cmInitParaError;

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