天天看點

[轉的]如何打開opencore/openmax裡的log及如何編譯opencore時顯示指令

1. 将檔案  external/opencore/oscl/oscl/osclbase/src/pvlogger.h  裡

PVLOGGER_INST_LEVEL  全部定義為 5

PVLOGGER_ENABLE  全部定義為 1

2. 在 /sdcard/ 建立一個檔案  pvlogger.txt ,将 8 寫入, echo 8 >/sdcard/pvlogger.txt

但是這裡有個問題,就是按照上述步驟更改以後編譯出來的庫,其他地方的log全部能列印,但是component裡面的卻沒法列印。

根據opencore的郵件組,component裡面的PVLOGGER_LOGMSG方式無法将消息正常列印出來,是由一個bug引起的。

我們有一個walk around。

采用LOGE來列印debug資訊。

具體做法是包含log.h,logd.h,android_log.h,uio.h檔案到你的檔案夾中,在你的檔案中加入

#define LOG_TAG "xxxx"

#include "log.h"

然後用LOGE列印,即可。

如何在自己編譯opencore的時候顯示指令

opencore預設make的時候不會顯示gcc的指令。

make SHOW_CMDS=1

=========================================================================================

首先看一下檔案pv_omxdefs.h(androidsrc/external/opencore/codecs_v2/omx /omx_common/include).有以下内容:

//Enable/disable this switch to build the workspace with or without proxy

// 1 – Enable,  0 – disable

// 1 – Multithreaded, 0 – AO

#define PROXY_INTERFACE 1  

#define PROFILING_ON 0  

#if PROFILING_ON

#if PROXY_INTERFACE

#undef PROXY_INTERFACE

#endif

#endif

#if (PROXY_INTERFACE) && (PVLOGGER_INST_LEVEL>0)

// Logging in pv omx components that run in separate threads can only be done by sending a log into

// a separate file. The file is created and logging works unless built for release mode

// By default – logging for multi-threaded components is ON in dbg build

// TO DISABLE LOGGING IN OMX COMPONENTS – SET THE #define below to 0  

#define PV_OMX_LOGGER_OUTPUT 0  

#endif

#define PROFILING_ON 0設定為1,改為:

#define PROXY_INTERFACE 0  

#define PROFILING_ON 1

再看logcat,列印資訊就如願出來。 這樣就可以使用opencore自己的PVLOGGER_LOGMSG添加列印資訊了,