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
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
@@ -291,7 +295,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 23 unmodified lines
291295 return dsInitialOptExpected;
292296
293297 if (eOptID == DECODER_OPTION_DATAFORMAT) { // Set color space of decoding output frame
294− if (m_pDecContext->bParseOnly) {
298+ if (m_pDecContext->pParam->bParseOnly) {
295299 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,
296300 "CWelsDecoder::SetOption for data format meaningless for parseonly.");
297301 return cmResultSuccess;
@@ -318,7 +322,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 20 unmodified lines
318322 iVal = * ((int*)pOption); // int value for error concealment idc
319323 iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE);
320324 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)) {
322326 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
323327 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);
324328 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