History

cleanup trace module

ruil2 committed 12 years ago

Commit 4c12f891 parent eceb4e525 files · +240 −1021Browse files

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

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+27−15
@@ -86,7 +86,7 @@ namespace WelsDec { · 85 unmodified lines
8686 ***************************************************************************/
8787 CWelsDecoder::CWelsDecoder (void)
8888 : m_pDecContext (NULL),
89− m_pTrace (NULL) {
89+ m_pWelsTrace (NULL) {
9090 #ifdef OUTPUT_BIT_STREAM
9191 char chFileName[1024] = { 0 }; //for .264
9292 int iBufUsed = 0;
@@ -99,9 +99,20 @@ CWelsDecoder::CWelsDecoder (void) · 6 unmodified lines
9999 int iCurUsedSize;
100100 #endif//OUTPUT_BIT_STREAM
101101
102− m_pTrace = CreateWelsTrace (Wels_Trace_Type);
103102
104− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry");
103+ m_pWelsTrace = new welsCodecTrace();
104+ if (m_pWelsTrace != NULL) {
105+ const int32_t iWelsTraceExistingFlag = m_pWelsTrace->WelsTraceModuleIsExist();
106+ if (iWelsTraceExistingFlag) {
107+ m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
108+ WelsSetLogCallback (welsCodecTrace::CODEC_TRACE);
109+ }
110+ }
111+
112+ // initialization
113+ WelsSetLogLevel (WELS_LOG_ERROR); // no output, WELS_LOG_QUIET
114+
115+ WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry");
105116
106117 #ifdef OUTPUT_BIT_STREAM
107118 SWelsTime sCurTime;
@@ -156,7 +167,7 @@ CWelsDecoder::CWelsDecoder (void) · 48 unmodified lines
156167 * return: none
157168 ***************************************************************************/
158169 CWelsDecoder::~CWelsDecoder() {
159− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::~CWelsDecoder()");
170+ WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::~CWelsDecoder()");
160171
161172 UninitDecoder();
162173
@@ -171,15 +182,15 @@ CWelsDecoder::~CWelsDecoder() { · 8 unmodified lines
171182 }
172183 #endif//OUTPUT_BIT_STREAM
173184
174− if (NULL != m_pTrace) {
175− delete m_pTrace;
176− m_pTrace = NULL;
185+ if (m_pWelsTrace != NULL) {
186+ delete m_pWelsTrace;
187+ m_pWelsTrace = NULL;
177188 }
178189 }
179190
180191 long CWelsDecoder::Initialize (const SDecodingParam* pParam) {
181192 if (pParam == NULL) {
182− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::Initialize(), invalid input argument.");
193+ WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::Initialize(), invalid input argument.");
183194 return cmInitParaError;
184195 }
185196
@@ -201,7 +212,7 @@ void CWelsDecoder::UninitDecoder (void) { · 15 unmodified lines
201212 if (NULL == m_pDecContext)
202213 return;
203214
204− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "into CWelsDecoder::uninit_decoder()..");
215+ WelsLog (NULL, WELS_LOG_INFO, "into CWelsDecoder::uninit_decoder()..");
205216
206217 WelsEndDecoder (m_pDecContext);
207218
@@ -211,18 +222,19 @@ void CWelsDecoder::UninitDecoder (void) { · 3 unmodified lines
211222 m_pDecContext = NULL;
212223 }
213224
214− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "left CWelsDecoder::uninit_decoder()..");
225+ WelsLog (NULL , WELS_LOG_INFO, "left CWelsDecoder::uninit_decoder()..");
215226 }
216227
217228 // the return value of this function is not suitable, it need report failure info to upper layer.
218229 void CWelsDecoder::InitDecoder (void) {
219− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::init_decoder()..");
230+
231+ WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::init_decoder()..");
220232
221233 m_pDecContext = (PWelsDecoderContext)WelsMalloc (sizeof (SWelsDecoderContext), "m_pDecContext");
222234
223− WelsInitDecoder (m_pDecContext, m_pTrace, IWelsTrace::WelsTrace);
235+ WelsInitDecoder (m_pDecContext);
224236
225− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::init_decoder().. left");
237+ WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::init_decoder().. left");
226238 }
227239
228240 /*
@@ -380,8 +392,8 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 151 unmodified lines
380392 }
381393 }
382394
383− IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "decode failed, failure type:%d \n",
384− m_pDecContext->iErrorCode);
395+ WelsLog (NULL, WELS_LOG_INFO, "decode failed, failure type:%d \n",
396+ m_pDecContext->iErrorCode);
385397 return (DECODING_STATE)m_pDecContext->iErrorCode;
386398 }
387399

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