和你一起终身学习,这里是程序员Android
经典好文推荐,通过阅读本文,您将收获以下知识点:
1. open 阶段log
// connect call
06-26 12:24:01.054 1377 4534 I CameraService: CameraService::connect call (PID 5119 "com.android.camera", camera ID 0) and Camera API version 2
//FWK 调用open
06-26 12:24:01.065 1377 4534 I Camera2ClientBase: Camera 0: Opened. Client:
//HAL 开始open
06-26 12:24:01.066 954 954 I CamX : [CONFIG][HAL ] camxhal3.cpp:524 open() HalOp: Begin OPEN, logicalCameraId: 0, cameraId: 0
//perflock open camera 提频
06-26 12:24:01.066 954 954 I CHIUSECASE: [INFO ] chxperf.cpp:316 AcquirePerfLock() Acquire perflock type: 0
06-26 12:24:01.066 954 954 I CHIUSECASE: [INFO ] chxextensionmodule.cpp:892 ExtendOpen() Open Logical cameraId: 0 numPhysicalCameras: 1CameraOpen Mask = 0x1 CameraClose Mask 0x0 maxresourceCost 100
06-26 12:24:01.066 954 954 I CamX : [CONFIG][HAL ] camxhal3module.cpp:675 ProcessCameraOpen() number of Camera Opened 1
06-26 12:24:01.068 954 954 I CamX : [ INFO][HAL ] camxhal3.cpp:542 open() Open: overrideCameraClose is 0 , overrideCameraOpen is 1
//load so
06-26 12:24:01.079 954 954 V CamX : [ VERB][HAL ] camxhaldevice.cpp:169 AddLibNode() Added the lib into the list-libOpenCL.so
06-26 12:24:01.079 954 954 I CHIUSECASE: [INFO ] chxextensionmodule.cpp:1136 GetCameraIdIndex() AppId => LogicalId:0 => 0
06-26 12:24:01.079 954 954 I CamX : [ INFO][HAL ] camxhaldevice.cpp:1636 ConstructDefaultRequestSettings() Override specific tags added to construct default settings
//hal open end
06-26 12:24:01.080 954 954 I CamX : [CONFIG][HAL ] camxhal3.cpp:586 open() HalOp: End OPEN, logicalCameraId: 0, cameraId: 0
2. open 阶段trace
3.Camera3Devices 初始化并下发opensession
4.CameraProviderManger 响应OpenSession
framework/av/service/camera/libcameraservice/common/CameraProviderManager.cpp
5.CameraDevice.cpp Open
hardware/interface/camera/device/3.2/default/CameraDevice.cpp
6.camera_module open
hardware/interface/camera/common/1.0/default/CameraModule.cpp
camera_module_t 会调用 camxhal3entry.cpp的入口点
7.camera_module open 对应的trace
8.camxhal3entry.cpp HAL3Open
camx/src/core/hal/camxhal3entry.cpp
9.CamxHal3.cpp open
camx/src/core/hal/camxhal3.cpp
10.camxhal3module.cpp processCameraOpen
camx/src/core/hal/camxhal3module.cpp
CHI HAL entry
chi hal overrride entry
11.chiextensioninterface.cpp chi_extend_open
chi-cdk/core/chiframework/chiextensioninterface.cpp
12.chxextensionmodule.cpp extendopen
chi-cdk/core/chiframework/chxextensionmodule.cpp
13.camxhal3.cpp open HAlDevice create
camx/src/core/hal/camxhal3.cpp
14.camxhaldevice.cpp Create —>Initialize–>loadStaticlibs–> libmap , addlibnode 加载so
camx/src/core/hal/camxhaldevice.cpp
加载静态 so
15.HalDevice create 对应的trace
16.camerahal3.cpp open callback
camx/src/core/hal/camxhal3.cpp
17.CameraDevice.cpp createsession
hardware/interface/camera/device/3.2/default/CameraDevice.cpp
18.CameraDevice.cpp 创建CameraDeviceSession
hardware/interface/camera/device/3.2/default/CameraDevice.cpp
19.CameraDeviceSession.cpp CameraDeviceSession 实现
\hardware\interfaces\camera\device\3.2\default\CameraDeviceSession.cpp
调用CameraDeviceSession.cpp init
20.camxhal3entry.cpp init
\vendor\qcom\proprietary\camx\src\core\hal\camxhal3entry.cpp
21.camxhal3.cpp init
22.HAL3Initialize trace
23. openCamera 总体流程图
参考文献:
【腾讯文档】Camera学习知识库https://docs.qq.com/doc/DSWZ6dUlNemtUWndv
至此,本篇已结束。转载网络的文章,小编觉得很优秀,欢迎点击阅读原文,支持原创作者,如有侵权,恳请联系小编删除,欢迎您的建议与指正。同时期待您的关注,感谢您的阅读,谢谢!
点击阅读原文,为大佬点赞!