From a1f6e158ef972c9ae07d125813c8332879f13e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 18 Feb 2014 11:31:55 +0200 Subject: [PATCH] Move REC_FRAME_COUNT logging into the Initialize2 method --- codec/encoder/plus/src/welsEncoderExt.cpp | 35 ++++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/codec/encoder/plus/src/welsEncoderExt.cpp b/codec/encoder/plus/src/welsEncoderExt.cpp index d0605892..74d73f02 100644 --- a/codec/encoder/plus/src/welsEncoderExt.cpp +++ b/codec/encoder/plus/src/welsEncoderExt.cpp @@ -233,8 +233,25 @@ int CWelsH264SVCEncoder::Initialize (SEncParamBase* argv, const INIT_TYPE iInitT return cmInitParaError; } } + + return Initialize2 (&sConfig); +} + +int CWelsH264SVCEncoder::Initialize2 (SWelsSvcCodingParam* pCfg) { + if (NULL == pCfg) { + WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n", + pCfg); + return cmInitParaError; + } + + if (m_bInitialFlag) { + WelsLog (m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", + m_bInitialFlag); + Uninitialize(); + } + #ifdef REC_FRAME_COUNT - SWelsSvcCodingParam &sEncodingParam = sConfig; + SWelsSvcCodingParam &sEncodingParam = *pCfg; WelsLog (m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); WelsLog (m_pEncContext, WELS_LOG_INFO, @@ -277,22 +294,6 @@ int CWelsH264SVCEncoder::Initialize (SEncParamBase* argv, const INIT_TYPE iInitT } #endif//REC_FRAME_COUNT - return Initialize2 (&sConfig); -} - -int CWelsH264SVCEncoder::Initialize2 (SWelsSvcCodingParam* pCfg) { - if (NULL == pCfg) { - WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n", - pCfg); - return cmInitParaError; - } - - if (m_bInitialFlag) { - WelsLog (m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", - m_bInitialFlag); - Uninitialize(); - } - const int32_t iColorspace = pCfg->iInputCsp; if (0 == iColorspace) { WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n", iColorspace);