android-Camera 崩潰分析
阿新 • • 發佈:2019-01-31
ps:https://android.googlesource.com是google的git repositories on android可以下載需要的原始碼,需要翻牆進。
本文是對android攝像頭進行一些分析。在編譯的時候發現了錯誤,報出了w/CameraBase:An error occurred while connecting to camera:0 以及 W/System.error:java.lang.RuntimeException:Fail to connect to camera service;
(1)在java端掉用的程式碼如下:
private boolean safeCameraOpen(int id)
{
try{
ReleaseCamera();
mCamera = Camera.open(id);
}catch(Exception e){
log.e("failed to open Camera"+e);
}
}