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
6666 }
6767
6868 void 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+ }
6975 va_list vl;
7076 va_start (vl, kpFmt);
71− wlog (pCtx, iLevel, kpFmt, vl);
77+ pfLog (pCtx, iLevel, kpFmt, vl);
7278 va_end (vl);
7379 }
7480

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