Logging mechanism of video middleware is not Android conformant, which makes it difficult to capture or filter messages based on need.
Change tracing utilities to use Android's logging utilities.

BZ 6741

Change-Id: I9509612cfc502fe9fdef8de38e2c6f6ffe848aca
Signed-off-by: Andy Qiu <junhai.qiu@intel.com>
diff --git a/mix_vbp/viddec_fw/fw/codecs/vc1/parser/vc1.h b/mix_vbp/viddec_fw/fw/codecs/vc1/parser/vc1.h
index 21894c9..ca92d17 100644
--- a/mix_vbp/viddec_fw/fw/codecs/vc1/parser/vc1.h
+++ b/mix_vbp/viddec_fw/fw/codecs/vc1/parser/vc1.h
@@ -17,9 +17,11 @@
 typedef unsigned int size_t;
 #define LOG(...)
 #else
+
 #include <stdio.h>
 #include <unistd.h>
 #include <stdint.h>
+#ifndef VBP
 enum {
     NONE = 0,
     CRITICAL,
@@ -33,6 +35,7 @@
 #define LOG( log_lev, format, args ... ) \
       if (vc1_log_level >= log_lev) { OS_INFO("%s[%d]:: " format "\n", __FUNCTION__ , __LINE__ ,  ## args ); }
 #endif
+#endif
 
 #include "viddec_fw_workload.h"
 #include "vc1parse_common_defs.h"
@@ -42,10 +45,17 @@
 extern "C" {
 #endif
 
+#ifndef VBP
 #define LOG_CRIT(format, args ... )  LOG( CRITICAL, format, ## args)
 #define LOG_WARN(format, args ... )  LOG( WARNING,  format, ## args)
 #define LOG_INFO(format, args ... )  LOG( INFO,     format, ## args)
 #define LOG_DEBUG(format, args ... ) LOG( DEBUG,    format, ## args)
+#else
+#define LOG_CRIT(format, args ... )
+#define LOG_WARN(format, args ... )
+#define LOG_INFO(format, args ... )
+#define LOG_DEBUG(format, args ... )
+#endif
 
 // Seems to be hardware bug: DO NOT TRY TO SWAP BITPLANE0 and BITPLANE2
 // Block Control Register at offset 222C uses Bitplane_raw_ID0 to indicate directmb/fieldtx while
diff --git a/mix_vbp/viddec_fw/fw/parser/vbp_trace.h b/mix_vbp/viddec_fw/fw/parser/vbp_trace.h
index 253a85c..ba916b9 100644
--- a/mix_vbp/viddec_fw/fw/parser/vbp_trace.h
+++ b/mix_vbp/viddec_fw/fw/parser/vbp_trace.h
@@ -26,21 +26,30 @@
 #define VBP_TRACE_UTIL(cat, format, ...) \
 vbp_trace_util(cat, __FUNCTION__, __LINE__, format,  ##__VA_ARGS__)
 
-#else
-
-#include <utils/Log.h>
-#define VBP_TRACE_UTIL(cat, format,  ...) \
-__android_log_print(ANDROID_LOG_VERBOSE, "mixvbp : "cat, "%s() : %d: "format, \
-__FUNCTION__, __LINE__, ##__VA_ARGS__)
-
-#endif
-
 
 #define ETRACE(format, ...) VBP_TRACE_UTIL("ERROR:   ",  format, ##__VA_ARGS__)
 #define WTRACE(format, ...) VBP_TRACE_UTIL("WARNING: ",  format, ##__VA_ARGS__)
 #define ITRACE(format, ...) VBP_TRACE_UTIL("INFO:    ",  format, ##__VA_ARGS__)
 #define VTRACE(format, ...) VBP_TRACE_UTIL("VERBOSE: ",  format, ##__VA_ARGS__)
 
+
+#else
+
+// For Android OS
+
+//#define LOG_NDEBUG 0
+
+#define LOG_TAG "MixVBP"
+
+#include <utils/Log.h>
+#define ETRACE(...) LOGE(__VA_ARGS__)
+#define WTRACE(...) LOGW(__VA_ARGS__)
+#define ITRACE(...) LOGI(__VA_ARGS__)
+#define VTRACE(...) LOGV(__VA_ARGS__)
+
+#endif
+
+
 #else /* if VBP_TRACE is not defined */
 
 #define ETRACE(format, ...)
diff --git a/videodecoder/VideoDecoderTrace.h b/videodecoder/VideoDecoderTrace.h
index 809a9ad..8de40e0 100644
--- a/videodecoder/VideoDecoderTrace.h
+++ b/videodecoder/VideoDecoderTrace.h
@@ -42,21 +42,28 @@
 #define VIDEO_DECODER_TRACE(cat, format, ...) \
 TraceVideoDecoder(cat, __FUNCTION__, __LINE__, format,  ##__VA_ARGS__)
 
-#else
-
-#include <utils/Log.h>
-#define VIDEO_DECODER_TRACE(cat, format,  ...) \
-__android_log_print(ANDROID_LOG_VERBOSE, "VideoDecoder : "cat,format, ##__VA_ARGS__)
-
-#endif
-
-
 #define ETRACE(format, ...) VIDEO_DECODER_TRACE("ERROR:   ",  format, ##__VA_ARGS__)
 #define WTRACE(format, ...) VIDEO_DECODER_TRACE("WARNING: ",  format, ##__VA_ARGS__)
 #define ITRACE(format, ...) VIDEO_DECODER_TRACE("INFO:    ",  format, ##__VA_ARGS__)
 #define VTRACE(format, ...) VIDEO_DECODER_TRACE("VERBOSE: ",  format, ##__VA_ARGS__)
 
 #else
+// for Android OS
+
+//#define LOG_NDEBUG 0
+
+#define LOG_TAG "VideoDecoder"
+
+#include <utils/Log.h>
+#define ETRACE(...) LOGE(__VA_ARGS__)
+#define WTRACE(...) LOGW(__VA_ARGS__)
+#define ITRACE(...) LOGI(__VA_ARGS__)
+#define VTRACE(...) LOGV(__VA_ARGS__)
+
+#endif
+
+
+#else
 
 #define ETRACE(format, ...)
 #define WTRACE(format, ...)