History

Set a log context in the decoder

Martin Storsjö committed 12 years ago

Commit b2cf56c1 parent 9583ac43 files · +21 −14Browse files

Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 3 files). Show all

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+16−10
@@ -104,9 +104,9 @@ CWelsDecoder::CWelsDecoder (void) · 103 unmodified lines
104 if (m_pWelsTrace != NULL) {104 if (m_pWelsTrace != NULL) {
105 m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);105 m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
106 WelsSetLogCallback (welsCodecTrace::CODEC_TRACE);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#ifdef OUTPUT_BIT_STREAM111#ifdef OUTPUT_BIT_STREAM
112 SWelsTime sCurTime;112 SWelsTime sCurTime;
@@ -161,7 +161,9 @@ CWelsDecoder::CWelsDecoder (void) · 48 unmodified lines
161* return: none161* return: none
162***************************************************************************/162***************************************************************************/
163CWelsDecoder::~CWelsDecoder() {163CWelsDecoder::~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 UninitDecoder();168 UninitDecoder();
167 169
@@ -183,8 +185,12 @@ CWelsDecoder::~CWelsDecoder() { · 15 unmodified lines
183}185}
184 186
185long CWelsDecoder::Initialize (const SDecodingParam* pParam) {187long CWelsDecoder::Initialize (const SDecodingParam* pParam) {
188 if (m_pWelsTrace == NULL) {
189 return cmMallocMemeError;
190 }
191
186 if (pParam == NULL) {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 return cmInitParaError;194 return cmInitParaError;
189 }195 }
190 196
@@ -206,7 +212,7 @@ void CWelsDecoder::UninitDecoder (void) { · 15 unmodified lines
206 if (NULL == m_pDecContext)212 if (NULL == m_pDecContext)
207 return;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 WelsEndDecoder (m_pDecContext);217 WelsEndDecoder (m_pDecContext);
212 218
@@ -216,19 +222,19 @@ void CWelsDecoder::UninitDecoder (void) { · 3 unmodified lines
216 m_pDecContext = NULL;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// the return value of this function is not suitable, it need report failure info to upper layer.228// the return value of this function is not suitable, it need report failure info to upper layer.
223void CWelsDecoder::InitDecoder (void) {229void 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 m_pDecContext = (PWelsDecoderContext)WelsMalloc (sizeof (SWelsDecoderContext), "m_pDecContext");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 m_pDecContext->iErrorCode);402 m_pDecContext->iErrorCode);
397 return (DECODING_STATE)m_pDecContext->iErrorCode;403 return (DECODING_STATE)m_pDecContext->iErrorCode;
398 }404 }

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