shithub: openh264

Download patch

ref: 0628c9b190ba4f19c74fcf9caadb845e351e519e
parent: 573dad7d04533449372968dd7177ec3c5d3dc179
author: Martin Storsjö <martin@martin.st>
date: Tue Jun 10 11:02:24 EDT 2014

Set the trace level in the decoder console app via a proper option

--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -311,6 +311,7 @@
 
   SDecodingParam sDecParam = {0};
   string strInputFile (""), strOutputFile (""), strOptionFile ("");
+  int iLevelSetting = -1;
 
   sDecParam.sVideoProperty.size = sizeof (sDecParam.sVideoProperty);
 
@@ -391,7 +392,7 @@
           }
         } else if (!strcmp (cmd, "-trace")) {
           if (i + 1 < iArgC)
-            WelsStderrSetTraceLevel (atoi (pArgV[++i]));
+            iLevelSetting = atoi (pArgV[++i]);
           else {
             printf ("trace level not specified.\n");
             return 1;
@@ -417,6 +418,9 @@
   if (WelsCreateDecoder (&pDecoder)  || (NULL == pDecoder)) {
     printf ("Create Decoder failed.\n");
     return 1;
+  }
+  if (iLevelSetting >= 0) {
+    pDecoder->SetOption (DECODER_OPTION_TRACE_LEVEL, &iLevelSetting);
   }
 
   if (pDecoder->Initialize (&sDecParam)) {