History

Add public options for setting a log callback

Martin Storsjö committed 12 years ago

Commit 090229f1 parent dc91e093 files · +35 −3Browse files

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

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+14−1
@@ -242,7 +242,8 @@ void CWelsDecoder::InitDecoder (void) { · 241 unmodified lines
242242 long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) {
243243 int iVal = 0;
244244
245− if (m_pDecContext == NULL && eOptID != DECODER_OPTION_TRACE_LEVEL)
245+ if (m_pDecContext == NULL && eOptID != DECODER_OPTION_TRACE_LEVEL &&
246+ eOptID != DECODER_OPTION_TRACE_CALLBACK && eOptID != DECODER_OPTION_TRACE_CALLBACK_CONTEXT)
246247 return dsInitialOptExpected;
247248
248249 if (eOptID == DECODER_OPTION_DATAFORMAT) { // Set color space of decoding output frame
@@ -274,6 +275,18 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 25 unmodified lines
274275 m_pWelsTrace->SetTraceLevel (level);
275276 }
276277 return cmResultSuccess;
278+ } else if (eOptID == DECODER_OPTION_TRACE_CALLBACK) {
279+ if (m_pWelsTrace) {
280+ CM_WELS_TRACE callback = * ((CM_WELS_TRACE*)pOption);
281+ m_pWelsTrace->SetTraceCallback (callback);
282+ }
283+ return cmResultSuccess;
284+ } else if (eOptID == DECODER_OPTION_TRACE_CALLBACK_CONTEXT) {
285+ if (m_pWelsTrace) {
286+ void* ctx = * ((void**)pOption);
287+ m_pWelsTrace->SetTraceCallbackContext (ctx);
288+ }
289+ return cmResultSuccess;
277290 }
278291
279292 return cmInitParaError;

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