status_tCamAdapter::takePicture(){ status_t status = OK; // String8 const s8FlashMode = mpParamsMgr->getStr(CameraParameters::KEY_FLASH_MODE); uint32_t const u4ShotMode = getParamsManager()->getShotMode(); MUINT32 u4StrobeMode = 0; if ( ! s8FlashMode.isEmpty() ) { u4StrobeMode = PARAMSMANAGER_MAP_INST(eMapFlashMode)->valueFor(s8FlashMode); } //MY_LOGD("u4ShotMode=%d,eShotMode_NormalShot=%d,u4StrobeMode=%d/n",u4ShotMode,eShotMode_NormalShot,u4StrobeMode); if (mpStateManager->isState(IState::eState_Capture) && u4ShotMode == eShotMode_NormalShot && u4StrobeMode != 2) { usleep(1000 * 1500); goto lbExit; }......遇到一个三方apk,打开闪关灯,手动对焦后再拍照,会执行拉两次拍照命令导致报错。
10431 02-08 14:15:41.656765 296 1064 D CameraClient: autoFocus (pid 21428)11702 02-08 14:15:43.028126 296 1705 D CameraClient: takePicture (pid 21428): 0x10213937 02-08 14:15:44.907736 296 296 D CameraClient: takePicture (pid 21428): 0x10215112 02-08 14:15:45.711452 296 296 D CameraClient: disconnect E (pid 296)15113 02-08 14:15:45.711552 296 296 D CameraClient: hardware teardown
规避方法:status_t CamAdapter::takePicture()函数里面过滤,判断当前是否处于拍照状态
if (mpStateManager->isState(IState::eState_Capture),如果是,此次拍照不做任何操作,直接退出。
新闻热点
疑难解答