2014-10-29 110 views
0

有沒有人有一個想法會導致下面的錯誤?安卓相機錯誤 - 錯誤排隊緩衝區到SurfaceTexture,-32

queueBuffer:錯誤排隊緩衝區表面紋理,-32

我使用的表面紋理和android.hardware.Camera在我的應用程序。當我嘗試啓動/停止預覽並打開/關閉相機太多次時,會發生上述錯誤。

下面是錯誤日誌:

10-27 15:39:54.173 I/ActivityManager(2329): Process com.google.process.gapps (pid 20050) (adj 1) has died. 
10-27 15:39:54.213 E/SELinux (23446): [DEBUG] seapp_context_lookup: seinfoCategory = default 
10-27 15:39:54.213 D/dalvikvm(23446): Process 23446 nice name: com.google.process.gapps 
10-27 15:39:54.213 D/dalvikvm(23446): Extra Options: not specified 
10-27 15:39:54.213 I/ActivityManager(2329): Process com.google.android.gms (pid 23282) (adj 1) has died. 
10-27 15:39:54.243 D/SecCameraCoreManager(1888): disableMsgType: 0xffff 
10-27 15:39:54.243 D/Camera_HAL(1888): atom_disable_msg_type msg_type=0x0000ffff 
10-27 15:39:54.243 D/SecCameraCoreManager(1888): stopPreview 
10-27 15:39:54.243 D/SecCameraCoreManager(1888): virtual void android::SecCameraCoreManager::stopPreview():stop IT Policy checking thread 
10-27 15:39:54.243 D/ShotSingle(1888): stopPreview 
10-27 15:39:54.243 D/Camera_HAL(1888): atom_disable_msg_type msg_type=0x000003c2 
10-27 15:39:54.243 V/ShotSingle(1888): stopPreview(1) 
10-27 15:39:54.243 D/Camera_HAL(1888): atom_stop_preview 
10-27 15:39:54.243 E/Surface (1888): queueBuffer: error queuing buffer to SurfaceTexture, -32 
10-27 15:39:54.243 E/Camera_PreviewThread(1888): Surface::queueBuffer returned error -32 
+1

https://android.googlesource.com/platform/system/core/+/kitkat-release/include/utils/Errors.h說-32是'DEAD_OBJECT'('-EPIPE')。不知道是什麼原因造成的。 – fadden 2014-10-29 15:28:38

回答

0

出現這種情況,如果你的表面紋理獲得,而你試圖給它餵食相機數據收集垃圾。

確保你堅持在應用程序中引用SurfaceTexture,而不僅僅是將它傳遞給相機實例並讓它超出範圍。

關閉時,請確保您在銷燬SurfaceTexture之前已停止預覽(通常這意味着不要在應用程序的onPause結束預覽並關閉相機之前停止預覽),並且在啓動時確保您的SurfaceTexture有效開始預覽。