Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 3 files). Show all
Unified · Split
| @@ -104,9 +104,9 @@ CWelsDecoder::CWelsDecoder (void) · 103 unmodified lines | ||
| 104 | 104 | if (m_pWelsTrace != NULL) { |
| 105 | 105 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); |
| 106 | 106 | WelsSetLogCallback (welsCodecTrace::CODEC_TRACE); |
| 107 | − } | |
| 108 | 107 | |
| 109 | − WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry"); | |
| 108 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry"); | |
| 109 | + } | |
| 110 | 110 | |
| 111 | 111 | #ifdef OUTPUT_BIT_STREAM |
| 112 | 112 | SWelsTime sCurTime; |
| @@ -161,7 +161,9 @@ CWelsDecoder::CWelsDecoder (void) · 48 unmodified lines | ||
| 161 | 161 | * return: none |
| 162 | 162 | ***************************************************************************/ |
| 163 | 163 | CWelsDecoder::~CWelsDecoder() { |
| 164 | − WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::~CWelsDecoder()"); | |
| 164 | + if (m_pWelsTrace != NULL) { | |
| 165 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::~CWelsDecoder()"); | |
| 166 | + } | |
| 165 | 167 | |
| 166 | 168 | UninitDecoder(); |
| 167 | 169 | |
| @@ -183,8 +185,12 @@ CWelsDecoder::~CWelsDecoder() { · 15 unmodified lines | ||
| 183 | 185 | } |
| 184 | 186 | |
| 185 | 187 | long CWelsDecoder::Initialize (const SDecodingParam* pParam) { |
| 188 | + if (m_pWelsTrace == NULL) { | |
| 189 | + return cmMallocMemeError; | |
| 190 | + } | |
| 191 | + | |
| 186 | 192 | if (pParam == NULL) { |
| 187 | − WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::Initialize(), invalid input argument."); | |
| 193 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::Initialize(), invalid input argument."); | |
| 188 | 194 | return cmInitParaError; |
| 189 | 195 | } |
| 190 | 196 | |
| @@ -206,7 +212,7 @@ void CWelsDecoder::UninitDecoder (void) { · 15 unmodified lines | ||
| 206 | 212 | if (NULL == m_pDecContext) |
| 207 | 213 | return; |
| 208 | 214 | |
| 209 | − WelsLog (NULL, WELS_LOG_INFO, "into CWelsDecoder::uninit_decoder().."); | |
| 215 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "into CWelsDecoder::uninit_decoder().."); | |
| 210 | 216 | |
| 211 | 217 | WelsEndDecoder (m_pDecContext); |
| 212 | 218 | |
| @@ -216,19 +222,19 @@ void CWelsDecoder::UninitDecoder (void) { · 3 unmodified lines | ||
| 216 | 222 | m_pDecContext = NULL; |
| 217 | 223 | } |
| 218 | 224 | |
| 219 | − WelsLog (NULL , WELS_LOG_INFO, "left CWelsDecoder::uninit_decoder().."); | |
| 225 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "left CWelsDecoder::uninit_decoder().."); | |
| 220 | 226 | } |
| 221 | 227 | |
| 222 | 228 | // the return value of this function is not suitable, it need report failure info to upper layer. |
| 223 | 229 | void CWelsDecoder::InitDecoder (void) { |
| 224 | 230 | |
| 225 | − WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::init_decoder().."); | |
| 231 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::init_decoder().."); | |
| 226 | 232 | |
| 227 | 233 | m_pDecContext = (PWelsDecoderContext)WelsMalloc (sizeof (SWelsDecoderContext), "m_pDecContext"); |
| 228 | 234 | |
| 229 | − WelsInitDecoder (m_pDecContext); | |
| 235 | + WelsInitDecoder (m_pDecContext, &m_pWelsTrace->m_sLogCtx); | |
| 230 | 236 | |
| 231 | − WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::init_decoder().. left"); | |
| 237 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::init_decoder().. left"); | |
| 232 | 238 | } |
| 233 | 239 | |
| 234 | 240 | /* |
| @@ -392,7 +398,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 157 unmodified lines | ||
| 392 | 398 | } |
| 393 | 399 | } |
| 394 | 400 | |
| 395 | − WelsLog (NULL, WELS_LOG_INFO, "decode failed, failure type:%d \n", | |
| 401 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "decode failed, failure type:%d \n", | |
| 396 | 402 | m_pDecContext->iErrorCode); |
| 397 | 403 | return (DECODING_STATE)m_pDecContext->iErrorCode; |
| 398 | 404 | } |