History

Add a log context to the encoder and decoder contexts

This will allow setting non-global logging callbacks, that are different for each encoder or decoder instance.

Martin Storsjö committed 12 years ago

Commit 4e428ab1 parent c8b81b44 files · +14 −1Browse files

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

Unified · Split

codec/common/src/utils.cpp+7−1
@@ -66,9 +66,15 @@ void WelsSetLogCallback (PWelsLogCallbackFunc _log) { · 65 unmodified lines
66}66}
67 67
68void WelsLog (void* pCtx, int32_t iLevel, const char* kpFmt, ...) {68void WelsLog (void* pCtx, int32_t iLevel, const char* kpFmt, ...) {
69 SLogContext* logCtx = (SLogContext*) pCtx;
70 PWelsLogCallbackFunc pfLog = wlog;
71 if (logCtx != NULL && logCtx->pfLog != NULL) {
72 pfLog = logCtx->pfLog;
73 pCtx = logCtx->pLogCtx;
74 }
69 va_list vl;75 va_list vl;
70 va_start (vl, kpFmt);76 va_start (vl, kpFmt);
71 wlog (pCtx, iLevel, kpFmt, vl);77 pfLog (pCtx, iLevel, kpFmt, vl);
72 va_end (vl);78 va_end (vl);
73}79}
74 80

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