History

Remove the global log callback function

Now all logging should use a non-null log context, allowing to pass the messages to the right recipient.

Martin Storsjö committed 12 years ago

Commit cb5ee6c1 parent b2cf56c4 files · +1 −38Browse files

Unified · Split

4 files
  1. codec/common/inc/utils.h +0 −13
  2. codec/common/src/utils.cpp +1 −23
  3. codec/decoder/plus/src/welsDecoderExt.cpp +0 −1
  4. codec/encoder/plus/src/welsEncoderExt.cpp +0 −1
codec/common/inc/utils.h+0−13
@@ -77,19 +77,6 @@ extern void WelsLog (void* pCtx, int32_t iLevel, const char* kpFmt, ...) __attri · 76 unmodified lines
7777 extern void WelsLog (void* pCtx, int32_t iLevel, const char* kpFmt, ...);
7878 #endif
7979
80−/*!
81− *************************************************************************************
82− * \brief set log callback from external call
83− *
84− * \param _log log function routine
85− *
86− * \return NONE
87− *
88− * \note N/A
89− *************************************************************************************
90− */
91−void WelsSetLogCallback (PWelsLogCallbackFunc _log);
92−
9380 /*
9481 * PSNR calculation routines
9582 */
codec/common/src/utils.cpp+1−23
@@ -48,33 +48,11 @@ float WelsCalcPsnr (const void* kpTarPic, · 47 unmodified lines
4848 const int32_t kiHeight);
4949
5050
51−static PWelsLogCallbackFunc wlog;
52−
53−/*!
54− *************************************************************************************
55− * \brief set log callback from external call
56− *
57− * \param _log log function routine
58− *
59− * \return NONE
60− *
61− * \note N/A
62− *************************************************************************************
63− */
64−void WelsSetLogCallback (PWelsLogCallbackFunc _log) {
65− wlog = _log;
66−}
67−
6851 void WelsLog (void* pCtx, int32_t iLevel, const char* kpFmt, ...) {
6952 SLogContext* logCtx = (SLogContext*) pCtx;
70− PWelsLogCallbackFunc pfLog = wlog;
71− if (logCtx != NULL && logCtx->pfLog != NULL) {
72− pfLog = logCtx->pfLog;
73− pCtx = logCtx->pLogCtx;
74− }
7553 va_list vl;
7654 va_start (vl, kpFmt);
77− pfLog (pCtx, iLevel, kpFmt, vl);
55+ logCtx->pfLog (logCtx->pLogCtx, iLevel, kpFmt, vl);
7856 va_end (vl);
7957 }
8058
codec/decoder/plus/src/welsDecoderExt.cpp+0−1
@@ -103,7 +103,6 @@ CWelsDecoder::CWelsDecoder (void) · 102 unmodified lines
103103 m_pWelsTrace = new welsCodecTrace();
104104 if (m_pWelsTrace != NULL) {
105105 m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
106− WelsSetLogCallback (welsCodecTrace::CODEC_TRACE);
107106
108107 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry");
109108 }
codec/encoder/plus/src/welsEncoderExt.cpp+0−1
@@ -174,7 +174,6 @@ void CWelsH264SVCEncoder::InitEncoder (void) { · 173 unmodified lines
174174 }
175175
176176 m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
177− WelsSetLogCallback (welsCodecTrace::CODEC_TRACE);
178177
179178 #ifdef REC_FRAME_COUNT
180179 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,

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