Hi
I am porting one application in android2.1 eclair version .I need to
pass surface to native code
when i am doing this i am getting following error
signal 11 (SIGSEGV), fault addr deadbaad
I/DEBUG   ( 2175):  r0 00000000  r1 afe13389  r2 00000027  r3 00000054
I/DEBUG   ( 2175):  r4 afe3ae08  r5 00000000  r6 00000000  r7 ffff21b3
I/DEBUG   ( 2175):  r8 bea48930  r9 430cb3a4  10 430cb38c  fp 00000000
I/DEBUG   ( 2175):  ip 00002ee0  sp bea488e0  lr deadbaad  pc
afe10a40  cpsr 68000030
I/DEBUG   ( 2175):          #00  pc 00010a40  /system/lib/libc.so
I/DEBUG   ( 2175):          #01  pc 00007a9a  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):          #02  pc 0000ecb4  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #03  pc 00038890  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #04  pc 000319dc  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #05  pc 000139b8  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #06  pc 00019338  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #07  pc 00018804  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #08  pc 0004ea7a  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #09  pc 00056c98  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #10  pc 000139b8  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #11  pc 00019338  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #12  pc 00018804  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #13  pc 0004eda4  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #14  pc 0003ae9a  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #15  pc 0002bea4  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #16  pc 0002a448  /system/lib/
libandroid_runtime.so
I/DEBUG   ( 2175):          #17  pc 0002bbdc  /system/lib/
libandroid_runtime.so
I/DEBUG   ( 2175):          #18  pc 00008cd8  /system/bin/app_process
I/DEBUG   ( 2175):          #19  pc 0000c258  /system/lib/libc.so
I/DEBUG   ( 2175):
I/DEBUG   ( 2175): code around pc:
I/DEBUG   ( 2175): afe10a30 f8442001 4798000c e054f8df 26002227
I/DEBUG   ( 2175): afe10a40 2000f88e ef34f7fb f7fd2106 f04fe822
I/DEBUG   ( 2175): afe10a50 91035180 460aa901 96012006 f7fc9602
I/DEBUG   ( 2175):
I/DEBUG   ( 2175): code around lr:
I/DEBUG   ( 2175): deadba9c ffffffff ffffffff ffffffff ffffffff
I/DEBUG   ( 2175): deadbaac ffffffff ffffffff ffffffff ffffffff
I/DEBUG   ( 2175): deadbabc ffffffff ffffffff ffffffff ffffffff
I/DEBUG   ( 2175):
I/DEBUG   ( 2175): stack:
I/DEBUG   ( 2175):     bea488a0  00000015
I/DEBUG   ( 2175):     bea488a4  afe133b9  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488a8  afe3b02c  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488ac  afe3afd8  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488b0  00000000
I/DEBUG   ( 2175):     bea488b4  afe143d3  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488b8  afe13389  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488bc  afe13389  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488c0  00000054
I/DEBUG   ( 2175):     bea488c4  afe3ae08  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488c8  00000000
I/DEBUG   ( 2175):     bea488cc  bea488f4  [stack]
I/DEBUG   ( 2175):     bea488d0  ffff21b3
I/DEBUG   ( 2175):     bea488d4  afe1362b  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488d8  df002777
I/DEBUG   ( 2175):     bea488dc  e3a070ad
I/DEBUG   ( 2175): #00 bea488e0  485b61a0  /dev/ashmem/mspace/dalvik-
heap/2 (deleted)
I/DEBUG   ( 2175):     bea488e4  f36ff619
I/DEBUG   ( 2175):     bea488e8  001274d8  [heap]
I/DEBUG   ( 2175):     bea488ec  ffff2159
I/DEBUG   ( 2175):     bea488f0  8194f4b0  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):     bea488f4  fffffbdf
I/DEBUG   ( 2175):     bea488f8  ffff2159
I/DEBUG   ( 2175):     bea488fc  8194f4b0  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):     bea48900  ffff2225
I/DEBUG   ( 2175):     bea48904  81907a9d  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175): #01 bea48908  485b61a0  /dev/ashmem/mspace/dalvik-
heap/2 (deleted)
I/DEBUG   ( 2175):     bea4890c  819414e8  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):     bea48910  43355928  /dev/ashmem/dalvik-
LinearAlloc (deleted)
I/DEBUG   ( 2175):     bea48914  001274d8  [heap]
I/DEBUG   ( 2175):     bea48918  00000340
I/DEBUG   ( 2175):     bea4891c  bea48950  [stack]
I/DEBUG   ( 2175):     bea48920  00000000
I/DEBUG   ( 2175):     bea48924  00000000
I/DEBUG   ( 2175):     bea48928  430cb3ac
I/DEBUG   ( 2175):     bea4892c  ad00ecb8  /system/lib/libdvm.so
D/Zygote  ( 2183): Process 2700 terminated by signal (11)
I/WindowManager( 2222): WIN DEATH: Window{4865c520
com.android.dreamshot/com.android.dreamshot.DSMainActivity
paused=false}
I/ActivityManager( 2222): Process com.android.dreamshot (pid 2700) has
died.
I/WindowManager( 2222): WIN DEATH: Window{485f0f08
com.android.dreamshot/com.android.dreamshot.DreamShotUi paused=false}
I/WindowManager( 2222): WIN DEATH: Window{48637008 SurfaceView
paused=false}
I/ActivityManager( 2222): Start proc com.android.dreamshot for
activity com.android.dreamshot/.DreamShotUi: pid=2707 uid=10085
gids={1006}
I/UsageStats( 2222): Unexpected resume of com.android.dreamshot while
already resumed in com.android.dreamshot
D/dalvikvm( 2707): GC freed 954 objects / 71008 bytes in 26ms
W/InputManagerService( 2222): Got RemoteException sending
setActive(false) notification to pid 2700 uid 10085
I/ActivityManager( 2222): Displayed activity
com.android.dreamshot/.DreamShotUi: 338 ms (total 1360 ms)
I/KeyInputQueue( 2222): Input event: dev=0x0 type=0x1 scancode=28
keycode=4 value=1
I/PowerManagerService( 2222): ULight 3->7 f0



my code looks like this
in java .xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"

android:layout_width="fill_parent"
android:layout_height="fill_parent">

<SurfaceView android:id="@+id/mySurfaceView"

android:layout_width="fill_parent"
android:layout_height="fill_parent">

</SurfaceView>

</LinearLayout>

in .java
mSurfaceView =(SurfaceView)findViewById(R.id.mySurfaceView);
  mSurfaceHolder = mSurfaceView.getHolder();
  mSurfaceHolder.addCallback(this);
  mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

 public void surfaceChanged(SurfaceHolder holder, int format, int
width,
                          int height) {

                 if (holder.getSurface() == null) {
                  Log.d(TAG, "holder.getSurface() == null");

              }

              mSurfaceHolder = holder;
                   if(holder.isCreating())
              {

                 nativeDS.setPreviewSurface(holder.getSurface());

              }
my jni looks like this
static  void JNICALL
Java_com_android_dreamshot_DreamShot_setdsPreviewSurfaceNative(JNIEnv
*env, jobject object, jobject surface)
{
        if (surface != NULL) {
                 jclass clazz = env->FindClass("android/view/Surface");
                 LOGE("clazz=%d", clazz);
            if (clazz == NULL) {

                return ;
            }

            jfieldID fieldID = env->GetFieldID(clazz, "mSurface", "I");
                LOGE(" ...............fieldID is in native class %d", fieldID);

            if (fieldID == NULL) {
             LOGE(".................Can't find Surface
fields...................................................");
                return;
            }


    const sp<Surface>& native_surface=(Surface*)env-
>GetIntField(surface,fieldID);


        LOGE("objPreviewplayer=%p", objPreviewplayer);
        const sp<ISurface>& surface1 =
objPreviewplayer.getISurface(native_surface) ;
//      const sp<ISurface>& surface1 =NULL;
         LOGE("surface1=%p", surface1);
         // LOGE("native_surface=%d", native_surface);
         setdsPreviewSurface(surface1);

        }
}

I am getting error inside this function
what are all the system libs i should include in the makefile


i  got stuck up in this from past one week please help me out

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to