Loading services/camera/libcameraservice/device3/Camera3Device.cpp +2 −60 Original line number Diff line number Diff line Loading @@ -4052,10 +4052,6 @@ void Camera3Device::HalInterface::clear() { mHidlSession.clear(); } bool Camera3Device::HalInterface::supportBatchRequest() { return mHidlSession != nullptr; } status_t Camera3Device::HalInterface::constructDefaultRequestSettings( camera3_request_template_t templateId, /*out*/ camera_metadata_t **requestTemplate) { Loading Loading @@ -4628,20 +4624,6 @@ status_t Camera3Device::HalInterface::processBatchCaptureRequests( return CameraProviderManager::mapToStatusT(status); } status_t Camera3Device::HalInterface::processCaptureRequest( camera3_capture_request_t *request) { ATRACE_NAME("CameraHal::processCaptureRequest"); if (!valid()) return INVALID_OPERATION; status_t res = OK; uint32_t numRequestProcessed = 0; std::vector<camera3_capture_request_t*> requests(1); requests[0] = request; res = processBatchCaptureRequests(requests, &numRequestProcessed); return res; } status_t Camera3Device::HalInterface::flush() { ATRACE_NAME("CameraHal::flush"); if (!valid()) return INVALID_OPERATION; Loading Loading @@ -5192,43 +5174,6 @@ bool Camera3Device::RequestThread::sendRequestsBatch() { return true; } bool Camera3Device::RequestThread::sendRequestsOneByOne() { status_t res; for (auto& nextRequest : mNextRequests) { // Submit request and block until ready for next one ATRACE_ASYNC_BEGIN("frame capture", nextRequest.halRequest.frame_number); res = mInterface->processCaptureRequest(&nextRequest.halRequest); if (res != OK) { // Should only get a failure here for malformed requests or device-level // errors, so consider all errors fatal. Bad metadata failures should // come through notify. SET_ERR("RequestThread: Unable to submit capture request %d to HAL" " device: %s (%d)", nextRequest.halRequest.frame_number, strerror(-res), res); cleanUpFailedRequests(/*sendRequestError*/ false); return false; } // Mark that the request has be submitted successfully. nextRequest.submitted = true; updateNextRequest(nextRequest); // Remove any previously queued triggers (after unlock) res = removeTriggers(mPrevRequest); if (res != OK) { SET_ERR("RequestThread: Unable to remove triggers " "(capture request %d, HAL device: %s (%d)", nextRequest.halRequest.frame_number, strerror(-res), res); cleanUpFailedRequests(/*sendRequestError*/ false); return false; } } return true; } nsecs_t Camera3Device::RequestThread::calculateMaxExpectedDuration(const camera_metadata_t *request) { nsecs_t maxExpectedDuration = kDefaultExpectedDuration; camera_metadata_ro_entry_t e = camera_metadata_ro_entry_t(); Loading Loading @@ -5482,11 +5427,8 @@ bool Camera3Device::RequestThread::threadLoop() { bool submitRequestSuccess = false; nsecs_t tRequestStart = systemTime(SYSTEM_TIME_MONOTONIC); if (mInterface->supportBatchRequest()) { submitRequestSuccess = sendRequestsBatch(); } else { submitRequestSuccess = sendRequestsOneByOne(); } nsecs_t tRequestEnd = systemTime(SYSTEM_TIME_MONOTONIC); mRequestLatency.add(tRequestStart, tRequestEnd); Loading services/camera/libcameraservice/device3/Camera3Device.h +5 −7 Original line number Diff line number Diff line Loading @@ -289,9 +289,6 @@ class Camera3Device : // Reset this HalInterface object (does not call close()) void clear(); // Check if HalInterface support sending requests in batch bool supportBatchRequest(); // Calls into the HAL interface // Caller takes ownership of requestTemplate Loading @@ -300,7 +297,11 @@ class Camera3Device : status_t configureStreams(const camera_metadata_t *sessionParams, /*inout*/ camera3_stream_configuration *config, const std::vector<uint32_t>& bufferSizes); status_t processCaptureRequest(camera3_capture_request_t *request); // When the call succeeds, the ownership of acquire fences in requests is transferred to // HalInterface. More specifically, the current implementation will send the fence to // HAL process and close the FD in cameraserver process. When the call fails, the ownership // of the acquire fence still belongs to the caller. status_t processBatchCaptureRequests( std::vector<camera3_capture_request_t*>& requests, /*out*/uint32_t* numRequestProcessed); Loading Loading @@ -895,9 +896,6 @@ class Camera3Device : // Clear repeating requests. Must be called with mRequestLock held. status_t clearRepeatingRequestsLocked(/*out*/ int64_t *lastFrameNumber = NULL); // send request in mNextRequests to HAL one by one. Return true = sucssess bool sendRequestsOneByOne(); // send request in mNextRequests to HAL in a batch. Return true = sucssess bool sendRequestsBatch(); Loading Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +2 −60 Original line number Diff line number Diff line Loading @@ -4052,10 +4052,6 @@ void Camera3Device::HalInterface::clear() { mHidlSession.clear(); } bool Camera3Device::HalInterface::supportBatchRequest() { return mHidlSession != nullptr; } status_t Camera3Device::HalInterface::constructDefaultRequestSettings( camera3_request_template_t templateId, /*out*/ camera_metadata_t **requestTemplate) { Loading Loading @@ -4628,20 +4624,6 @@ status_t Camera3Device::HalInterface::processBatchCaptureRequests( return CameraProviderManager::mapToStatusT(status); } status_t Camera3Device::HalInterface::processCaptureRequest( camera3_capture_request_t *request) { ATRACE_NAME("CameraHal::processCaptureRequest"); if (!valid()) return INVALID_OPERATION; status_t res = OK; uint32_t numRequestProcessed = 0; std::vector<camera3_capture_request_t*> requests(1); requests[0] = request; res = processBatchCaptureRequests(requests, &numRequestProcessed); return res; } status_t Camera3Device::HalInterface::flush() { ATRACE_NAME("CameraHal::flush"); if (!valid()) return INVALID_OPERATION; Loading Loading @@ -5192,43 +5174,6 @@ bool Camera3Device::RequestThread::sendRequestsBatch() { return true; } bool Camera3Device::RequestThread::sendRequestsOneByOne() { status_t res; for (auto& nextRequest : mNextRequests) { // Submit request and block until ready for next one ATRACE_ASYNC_BEGIN("frame capture", nextRequest.halRequest.frame_number); res = mInterface->processCaptureRequest(&nextRequest.halRequest); if (res != OK) { // Should only get a failure here for malformed requests or device-level // errors, so consider all errors fatal. Bad metadata failures should // come through notify. SET_ERR("RequestThread: Unable to submit capture request %d to HAL" " device: %s (%d)", nextRequest.halRequest.frame_number, strerror(-res), res); cleanUpFailedRequests(/*sendRequestError*/ false); return false; } // Mark that the request has be submitted successfully. nextRequest.submitted = true; updateNextRequest(nextRequest); // Remove any previously queued triggers (after unlock) res = removeTriggers(mPrevRequest); if (res != OK) { SET_ERR("RequestThread: Unable to remove triggers " "(capture request %d, HAL device: %s (%d)", nextRequest.halRequest.frame_number, strerror(-res), res); cleanUpFailedRequests(/*sendRequestError*/ false); return false; } } return true; } nsecs_t Camera3Device::RequestThread::calculateMaxExpectedDuration(const camera_metadata_t *request) { nsecs_t maxExpectedDuration = kDefaultExpectedDuration; camera_metadata_ro_entry_t e = camera_metadata_ro_entry_t(); Loading Loading @@ -5482,11 +5427,8 @@ bool Camera3Device::RequestThread::threadLoop() { bool submitRequestSuccess = false; nsecs_t tRequestStart = systemTime(SYSTEM_TIME_MONOTONIC); if (mInterface->supportBatchRequest()) { submitRequestSuccess = sendRequestsBatch(); } else { submitRequestSuccess = sendRequestsOneByOne(); } nsecs_t tRequestEnd = systemTime(SYSTEM_TIME_MONOTONIC); mRequestLatency.add(tRequestStart, tRequestEnd); Loading
services/camera/libcameraservice/device3/Camera3Device.h +5 −7 Original line number Diff line number Diff line Loading @@ -289,9 +289,6 @@ class Camera3Device : // Reset this HalInterface object (does not call close()) void clear(); // Check if HalInterface support sending requests in batch bool supportBatchRequest(); // Calls into the HAL interface // Caller takes ownership of requestTemplate Loading @@ -300,7 +297,11 @@ class Camera3Device : status_t configureStreams(const camera_metadata_t *sessionParams, /*inout*/ camera3_stream_configuration *config, const std::vector<uint32_t>& bufferSizes); status_t processCaptureRequest(camera3_capture_request_t *request); // When the call succeeds, the ownership of acquire fences in requests is transferred to // HalInterface. More specifically, the current implementation will send the fence to // HAL process and close the FD in cameraserver process. When the call fails, the ownership // of the acquire fence still belongs to the caller. status_t processBatchCaptureRequests( std::vector<camera3_capture_request_t*>& requests, /*out*/uint32_t* numRequestProcessed); Loading Loading @@ -895,9 +896,6 @@ class Camera3Device : // Clear repeating requests. Must be called with mRequestLock held. status_t clearRepeatingRequestsLocked(/*out*/ int64_t *lastFrameNumber = NULL); // send request in mNextRequests to HAL one by one. Return true = sucssess bool sendRequestsOneByOne(); // send request in mNextRequests to HAL in a batch. Return true = sucssess bool sendRequestsBatch(); Loading