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

Showing the changes to codec/common/src/utils.cpp (1 of 4 files). Show all

Unified · Split

codec/common/src/utils.cpp+1−23
@@ -48,33 +48,11 @@ float WelsCalcPsnr (const void* kpTarPic, · 47 unmodified lines
48 const int32_t kiHeight);48 const int32_t kiHeight);
49 49
50 50
51static 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 */
64void WelsSetLogCallback (PWelsLogCallbackFunc _log) {
65 wlog = _log;
66}
67
68void WelsLog (void* pCtx, int32_t iLevel, const char* kpFmt, ...) {51void WelsLog (void* pCtx, int32_t iLevel, const char* kpFmt, ...) {
69 SLogContext* logCtx = (SLogContext*) pCtx;52 SLogContext* logCtx = (SLogContext*) pCtx;
70 PWelsLogCallbackFunc pfLog = wlog;
71 if (logCtx != NULL && logCtx->pfLog != NULL) {
72 pfLog = logCtx->pfLog;
73 pCtx = logCtx->pLogCtx;
74 }
75 va_list vl;53 va_list vl;
76 va_start (vl, kpFmt);54 va_start (vl, kpFmt);
77 pfLog (pCtx, iLevel, kpFmt, vl);55 logCtx->pfLog (logCtx->pLogCtx, iLevel, kpFmt, vl);
78 va_end (vl);56 va_end (vl);
79}57}
80 58

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