2024年10月29日 第14讲 从CameraServer角度详解Camera启动性能 极客笔记
本讲是Android Camera性能分析专题的第14讲,我们介绍从CameraServer角度详解Camera启动性能,包括如下内容:
资源 | 描述 |
---|---|
在线课程 | 极客笔记在线课程 |
知识星球 | 星球名称:深入浅出Android Camera 星球ID: 17296815 |
极客笔记圈 |
模块 | 开始点 | 结束点 |
---|---|---|
App | 点击Camera App Icon | 开始调用connectDevice |
HAL | 开始调用connectDevice | 调用connectDevice结束 |
App | 调用connectDevice结束 | 开始调用endConfigure |
HAL | 开始调用endConfigure | 调用endConfigure结束 |
App | 调用endConfigure结束 | 调用submitRequestList |
HAL | 调用submitRequestList | CameraServer收到第一帧 |
1.shouldRejectSystemCameraConnection
2.getCameraCharacteristicsLocked // 从CameraProviderManager中获取CameraCharacteristics
3.getCameraCharacteristics::checkPermission
会调用到HAL的CameraHal::openSession
1.validateConnectLocked
2.CameraDeviceClient::initializeImpl
Camera2ClientBase::initializeImpl
Camera3Device::initialize
CameraHal::openSession
3.finishConnectLocked
会调用到HAL的CameraHal::constructDefaultRequestSettings
1.CameraDeviceClient::createDefaultRequest
Camera3Device::createDefaultRequest
CameraHal::constructDefaultRequestSettings
CameraDeviceClient::beginConfigure //Not implemented yet
核心在创建 Camera3OutputStream
CameraDeviceClient::createStream
SessionConfigurationUtils::createSurfaceFromGbp
query(width,height,format,dataspace)
Camera3Device::createStream
new Camera3OutputStream
setStreamTransformLocked
会调用到HAL的CameraHal::configureStreams
CameraDeviceClient::endConfigure
Camera3Device::configureStreams
Camera3Stream::startConfiguration
CameraHal::configureStreams
Camera3Stream::finishConfiguration
Boost priority of request thread to SCHED_FIFO
CaptureRequest送下来后会等待Active
CameraDeviceClient::submitRequestList
Camera3Device::setStreamingRequestList
Camera3Device::RequestThread::setRepeatingRequests
Camera3Device::waitUntilStateThenRelock
Request thread线程开始给HAL送Request,调用 CameraHal::processBatchCaptureRequests
Camera3Device::RequestThread::threadLoop
Camera3Device::RequestThread::waitForNextRequestBatch
Camera3Device::RequestThread::prepareHalRequests
Camera3Device::RequestThread::sendRequestsBatch
CameraHal::processBatchCaptureRequests
StatusTracker通知status变化:
Camera3Device::notifyStatus
Camera3Device::internalUpdateStatusLocked
mStatusChanged.broadcast
Camera2ClientBase::notifyActive
CameraService::BasicClient::startCameraStreamingOps
HAL回调processCaptureResult后,如果有Buffer,则取出来 queueBuffer给 Consumer
Camera3Device::processCaptureResult
Camera3OutputUtils::returnAndRemovePendingOutputBuffers
Camera3OutputUtils::returnOutputBuffers
Camera3Stream::returnBuffer
Camera3OutputStream::returnBufferLocked
Camera3IOStreamBase::returnAnyBufferLocked
Camera3OutputStream::returnBufferCheckedLocked
Camera3OutputStream::queueBufferToConsumer
本文链接:http://so.lmcjl.com/news/16486/