I added
#define LOG_NDEBUG 0
#define LOG_TAG "StagefrightMediaScanner"
#include <utils/Log.h>
in the libstagefright/StagefrightMediaScanner.cpp
but can not print anything using LOGV and LOGE, does any other things can I need to do?
I added
#define LOG_NDEBUG 0
#define LOG_TAG "StagefrightMediaScanner"
#include <utils/Log.h>
in the libstagefright/StagefrightMediaScanner.cpp
but can not print anything using LOGV and LOGE, does any other things can I need to do?
You can use the following code to get Log
__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "%s", Str);
and add the following header file
#include <android/log.h>
Additional docs are here: https://developer.android.com/ndk/reference/group/logging
You can check frameworks/av/media/libstagefright/Android.mk, whether there is
LOCAL_SHARED_LIBRARIES += liblog
in it.
Then, under frameworks/av/media/libstagefright/
$ mm
$ adb push $OUT/system/lib/libstagefright.so /system/lib/
$ adb shell killall mediaserver
Then reboot your phone or am start a MEDIA_MOUNTED intent, MediaScanner will work, and the logs you just added(either ALOGE/ALOGV or LOGE/LOGV) should be shown.
No you have done right. Just check it whether you are using ALOGV() which is similar to printf(),if you want to print a integer with a log then you can write like this :" ALOGV("Integer is %d",integer);".