Monday, April 12, 2010

android emulator的cpu

http://groups.google.com/group/android-ndk/browse_thread/thread/b41d13b517abe69d?hl=en



不知道中間Dave Buther講的這段話
On the emulator I suspect it is being (correctly) treated as an
UNDEFINED instruction (the emulator is running as an ARM926 I
believe), under user-mode on an ARM1176 or an ARMv7-a processor it
will still be treated as an UNDEFINED
while in user mode. 



是什麼意思............

Thursday, April 1, 2010

gcc的extension

# define PLUGIN_LOG(A, B...) do { LOGI( A , ## B ); } while(0)

看得懂上面那段code嗎
不要以為##是多的

當你的arg只有一個時 PLUGIN_LOG(A) 你就發現它的重要性了

http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html

enable native WebKit log

最近一直試著要在native WebKit加log
但就是看不到

最後看到
external/webkit/WebCore/platform/android/ScreenAndroid.cpp
的一段話

35 #undef LOG // FIXME: Still have to do this to get the log to show up
36 #include "utils/Log.h"

照著他的方式來作

媽呀 真的log出現了

原來在WebCore/config.h 會去include
而這裡面也有定義LOG

所以我加的LOG[VDIWE]全都跑到wtf/Assertions.h裡面了
(事實上是空的 因為LOG_DISABLE被設為1了)

Friday, March 19, 2010

test

MediaPlayer::~MediaPlayer()
{
    LOGV("destructor");
    removeObitRecipient(this);
    disconnect();
    IPCThreadState::self()->flushCommands();
}

void MediaPlayer::disconnect()
{
    LOGV("disconnect");
    sp p;
    {
        Mutex::Autolock _l(mLock);
        p = mPlayer;
        mPlayer.clear();
    }

    if (p != 0) {
        p->disconnect();
    }
}

// always call with lock held
void MediaPlayer::clear_l()
{
    mDuration = -1;
    mCurrentPosition = -1;
    mSeekPosition = -1;
    mVideoWidth = mVideoHeight = 0;
}


神奇的preprocessor

gcc -x c++ -E -P

Tuesday, January 19, 2010

enable pv log

除了 make -j 4 ENABLE_PV_LOGGER=1後
發現 也要在opencore/android/Android.mk裡


LOCAL_CFLAGS += -UNDEBUG

因為opencore/android/裡的source並不會用到PV_CFLAGS

Tuesday, December 8, 2009

android ndk 的makefile

在Application.mk裡可以指定APP_BUILD_SCRIPT
來指定你要的Android.mk

可是在mydroid 跟ndk裡的Android.mk
發現在LOCAL_SHARED_LIBRARIES的用法不太一樣
所以要分開來使用
也就是在mydroid build時要一個Android.mk 而用ndk build時則要另一個

但我在Application.mk中設定APP_BUILD_SCRIPT時
發現取別的名字的話  總是會有LOCAL_MAKEFILE not defined 的error msg

最後看了一下他build 的script
local-makefile = $(lastword $(filter %Android.mk,$(MAKEFILE_LIST))

在這用了makefile的 % character

所以只要把APP_BUILD_SCRIPT設定成 Android.mk結尾的就好了
例如NdkAndroid.mk