01-29 10:03:04.337 53320-53320 C02B01/com.exa...cation/CAMERA com.examp...lication I {Stop():1655} Stop is called
01-29 10:03:04.337 53320-53320 C02B01/com.exa...cation/CAMERA com.examp...lication I {Close():415} Close is called
01-29 10:03:04.338 53320-53320 C02B01/com.exa...cation/CAMERA com.examp...lication I {Release():469} PreviewOutputNapi::Release is called
01-29 10:03:04.338 53320-53320 C02B01/com.exa...cation/CAMERA com.examp...lication I {Release():1055} Release is called
01-29 10:03:04.338 53320-53320 C02B01/com.exa...cation/CAMERA com.examp...lication I {Release():1697} Release is called
01-29 10:03:04.343 53320-53609 C02B01/com.exa...cation/CAMERA com.examp...lication I {operator()():429} CameraInputNapi::Close running on worker
01-29 10:03:04.345 53320-53607 C02B01/com.exa...cation/CAMERA com.examp...lication I {operator()():483} PreviewOutputNapi::Release running on worker
01-29 10:03:04.346 53320-53602 C02B01/com.exa...cation/CAMERA com.examp...lication I {operator()():1069} PhotoOutputNapi::Release running on worker
01-29 10:03:04.346 53320-53599 C02B01/com.exa...cation/CAMERA com.examp...lication I {operator()():1711} CameraSessionNapi::Release running on worker
01-29 10:03:04.351 53320-53590 C02B01/com.exa...cation/CAMERA com.examp...lication I {operator()():1669} CameraSessionNapi::Stop running on worker
01-29 10:03:04.351 53320-53590 C02B01/com.exa...cation/CAMERA com.examp...lication E {Stop():1297} CaptureSession::Stop() captureSession is nullptr
01-29 10:03:04.351 53320-53590 C02B01/com.exa...cation/CAMERA com.examp...lication I {operator()():1676} CameraSessionNapi::Stop errorCode:7400201
01-29 10:03:04.351 53320-53590 C02B01/com.exa...cation/CAMERA com.examp...lication I {operator()():1676} CameraSessionNapi::Stop errorCode:7400201
01-29 10:03:04.351 53320-53609 C02B01/com.exa...cation/CAMERA com.examp...lication E {Close():382} CameraInput::Close() deviceObj is nullptr 从日志中可以看到应用调用Stop()接口时报错7400201,报错原因是Session已经释放,无法再次释放。
01-29 10:03:03.925 1606-53996 C02B01/camera_service/CAMERA camera_service I {Start():581} HStreamRepeat::Start streamId:599 hdiStreamId:1 With capture ID: 294, repeatStreamType:0
01-29 10:03:03.939 1606-1930 C02B01/camera_service/CAMERA camera_service I {Stop():1240} HStreamOperator::Stop prepare execute
01-29 10:03:03.939 1606-1930 C02B01/camera_service/CAMERA camera_service I {Stop():637} HStreamRepeat::Stop streamId:599 hdiStreamId:1 With capture ID: 294, repeatStreamType:0
01-29 10:03:03.940 1606-1930 C02B01/camera_service/CAMERA camera_service I {OnCaptureEndedExt_V1_4():2316} HStreamOperator::OnCaptureEndedExt_V1_4, captureId is 294
01-29 10:03:03.940 1606-1930 C02B01/camera_service/CAMERA camera_service I {ProcessRepeatStream():2349} ProcessRepeatStream is called
01-29 10:03:03.940 1606-1930 C02B01/camera_service/CAMERA camera_service I {ProcessRepeatStream():2366} HStreamOperator::OnCaptureEndedExt_V1_4 captureId:294 videoId: isDeferredVideo:0, deferredVideoEnhanceFlag:0
01-29 10:03:03.940 1606-1930 C02B01/camera_service/CAMERA camera_service I {OnDeferredVideoEnhancementInfo():757} HStreamRepeat::OnDeferredVideoEnhancementInfo
01-29 10:03:03.940 1606-1930 C02B01/camera_service/CAMERA camera_service I {Stop():637} HStreamRepeat::Stop streamId:601 hdiStreamId:3 With capture ID: 0, repeatStreamType:3
01-29 10:03:03.940 1606-1930 C02B01/camera_service/CAMERA camera_service E {Stop():639} HStreamRepeat::Stop, Stream not started yet 从日志可知,系统起了两个capture ID,结合频繁快速切换前后台的操作场景,猜测可能是申请相机资源冲突导致异常,排查代码得知代码onPageShow()和onPageHide()方法中申请/释放相机资源的函数未加await关键词,导致相机资源冲突。