释放相机会杀死任务中的所有活动

时间:2010-12-02 17:16:08

标签: android android-camera

我有一个视频录制应用,我在其中使用Camera对象设置相机参数。录制完成后,在onPause我使用方法

释放相机

camera.unlock();
camera.release();

我的相机发布的时刻我得到以下日志

12-02 22:23:05.824: INFO/DEBUG(4884): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-02 22:23:05.824: INFO/DEBUG(4884): Build fingerprint: 'google/passion/passion/mahimahi:2.2.1/FRG83D/75603:user/release-keys'
12-02 22:23:05.824: INFO/DEBUG(4884): pid: 7299, tid: 7299  >>> com.test.video.activity <<<
12-02 22:23:05.824: INFO/DEBUG(4884): signal 11 (SIGSEGV), fault addr 00000010
12-02 22:23:05.824: INFO/DEBUG(4884):  r0 00000000  r1 44a56890  r2 bef83514  r3 44a56890
12-02 22:23:05.824: INFO/DEBUG(4884):  r4 0002bbd8  r5 0000aa50  r6 bef83514  r7 4186bcb4
12-02 22:23:05.824: INFO/DEBUG(4884):  r8 bef83528  r9 4186bcac  10 4186bc94  fp bef83868
12-02 22:23:05.824: INFO/DEBUG(4884):  ip a930d670  sp bef83500  lr a93077dd  pc a9032798  cpsr 60000030
12-02 22:23:05.824: INFO/DEBUG(4884):  d0  643a64696f72646e  d1  6472656767756265
12-02 22:23:05.824: INFO/DEBUG(4884):  d2  0076006900740017  d3  004d007900740046
12-02 22:23:05.824: INFO/DEBUG(4884):  d4  0068006300720061  d5  007400630061002e
12-02 22:23:05.824: INFO/DEBUG(4884):  d6  0074006900760069  d7  00720050002e0079
12-02 22:23:05.824: INFO/DEBUG(4884):  d8  00000000422fc288  d9  00024053c1c00000
12-02 22:23:05.824: INFO/DEBUG(4884):  d10 44a4b3804383c890  d11 0000000042d1dcb0
12-02 22:23:05.824: INFO/DEBUG(4884):  d12 0000000000000000  d13 0000000000000000
12-02 22:23:05.824: INFO/DEBUG(4884):  d14 0000000000000000  d15 0000000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  d16 bef832a844a57c18  d17 0000000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  d18 0000000000000000  d19 0000000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  d20 3ff0000000000000  d21 8000000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  d22 0000000000000000  d23 0000000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  d24 0000000000000000  d25 0000000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  d26 0100010001000100  d27 0100010001000100
12-02 22:23:05.833: INFO/DEBUG(4884):  d28 0100010001000100  d29 3ff0000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  d30 0000000000000000  d31 3ff0000000000000
12-02 22:23:05.833: INFO/DEBUG(4884):  scr 80000012
12-02 22:23:05.893: INFO/DEBUG(4884):          #00  pc 00032798  /system/lib/libmedia.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #01  pc 000077da  /system/lib/libmedia_jni.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #02  pc 00016e34  /system/lib/libdvm.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #03  pc 000452c4  /system/lib/libdvm.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #04  pc 0001bd98  /system/lib/libdvm.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #05  pc 00022794  /system/lib/libdvm.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #06  pc 00021634  /system/lib/libdvm.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #07  pc 0005c78e  /system/lib/libdvm.so
12-02 22:23:05.893: INFO/DEBUG(4884):          #08  pc 00064e58  /system/lib/libdvm.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #09  pc 0001bd98  /system/lib/libdvm.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #10  pc 00022794  /system/lib/libdvm.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #11  pc 00021634  /system/lib/libdvm.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #12  pc 0005c5cc  /system/lib/libdvm.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #13  pc 00047c96  /system/lib/libdvm.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #14  pc 0002d894  /system/lib/libandroid_runtime.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #15  pc 0002e990  /system/lib/libandroid_runtime.so
12-02 22:23:05.904: INFO/DEBUG(4884):          #16  pc 00008ca8  /system/bin/app_process
12-02 22:23:05.904: INFO/DEBUG(4884):          #17  pc 0000d3c0  /system/lib/libc.so
12-02 22:23:05.904: INFO/DEBUG(4884): code around pc:
12-02 22:23:05.904: INFO/DEBUG(4884): a9032778 2001e001 461861a0 bf00bd70 0002bc44 
12-02 22:23:05.904: INFO/DEBUG(4884): a9032788 fffe90c3 fffe9105 fffe912a 4c1bb570 
12-02 22:23:05.904: INFO/DEBUG(4884): a9032798 bf006903 1864a100 b94b4605 4a194818 
12-02 22:23:05.904: INFO/DEBUG(4884): a90327a8 20061821 f7f318a2 f06fe9aa e0230025 
12-02 22:23:05.904: INFO/DEBUG(4884): a90327b8 fe5af7ff 2b1069ab 2201d815 c048f8df 
12-02 22:23:05.904: INFO/DEBUG(4884): code around lr:
12-02 22:23:05.904: INFO/DEBUG(4884): a93077bc bd10ffd3 4c0cb573 ae01a500 46051964 
12-02 22:23:05.904: INFO/DEBUG(4884): a93077cc 4630460a f7ff4629 9801ffa5 e8faf7fe 
12-02 22:23:05.904: INFO/DEBUG(4884): a93077dc 4b074a06 18e318a2 46284601 ff24f7ff 
12-02 22:23:05.904: INFO/DEBUG(4884): a93077ec f7ff4630 bd7cff3b 00005dd0 ffffce3d 
12-02 22:23:05.904: INFO/DEBUG(4884): a93077fc ffffd43b 4c0cb573 ae01a500 46051964 
12-02 22:23:05.904: INFO/DEBUG(4884): stack:
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834c0  00000007  
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834c4  a930dc98  /system/lib/libmedia_jni.so
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834c8  00000000  
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834cc  afd10280  /system/lib/libc.so
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834d0  a930d598  /system/lib/libmedia_jni.so
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834d4  000006f0  
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834d8  0000aa50  [heap]
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834dc  a930dc98  /system/lib/libmedia_jni.so
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834e0  bef83528  [stack]
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834e4  4186bcac  
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834e8  4186bc94  
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834ec  a9307759  /system/lib/libmedia_jni.so
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834f0  44a56890  /dev/ashmem/mspace/dalvik-heap/2 (deleted)
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834f4  bef83514  [stack]
12-02 22:23:05.904: INFO/DEBUG(4884):     bef834f8  df002777  
12-02 22:23:05.914: INFO/DEBUG(4884):     bef834fc  e3a070ad  
12-02 22:23:05.914: INFO/DEBUG(4884): #00 bef83500  a930d598  /system/lib/libmedia_jni.so
12-02 22:23:05.914: INFO/DEBUG(4884):     bef83504  0000aa50  [heap]
12-02 22:23:05.914: INFO/DEBUG(4884):     bef83508  bef83514  [stack]
12-02 22:23:05.914: INFO/DEBUG(4884):     bef8350c  a93077dd  /system/lib/libmedia_jni.so
12-02 22:23:05.914: INFO/DEBUG(4884): #01 bef83510  0000aa50  [heap]
12-02 22:23:05.914: INFO/DEBUG(4884):     bef83514  00000000  
12-02 22:23:05.914: INFO/DEBUG(4884):     bef83518  bef83548  [stack]
12-02 22:23:05.914: INFO/DEBUG(4884):     bef8351c  00000000  
12-02 22:23:05.914: INFO/DEBUG(4884):     bef83520  4186bca8  
12-02 22:23:05.914: INFO/DEBUG(4884):     bef83524  80816e38  /system/lib/libdvm.so
12-02 22:23:06.103: INFO/ActivityManager(90): Process com.test.video.activity (pid 7299) has died.
12-02 22:23:06.103: INFO/WindowManager(90): WIN DEATH: Window{44d8eef0 com.test.video.activity/com.test.video.activity.HomeScreen paused=false}
12-02 22:23:06.113: INFO/WindowManager(90): WIN DEATH: Window{44e06a90 com.test.video.activity/com.test.video.activity.VideoRecordingScreen paused=true}
12-02 22:23:06.113: INFO/WindowManager(90): WIN DEATH: Window{44e0f518 SurfaceView paused=false}

正如您在日志底部所看到的,发生了一些WIN DEATH,它基本上会杀死我之前未完成的所有活动。这给我带来了很多问题,因为它阻碍了我的应用程序流程。

任何想法可能是什么问题?

1 个答案:

答案 0 :(得分:0)

camera.setPreviewCallback(null)

之前尝试camera.unlock(); camera.release();