From e1f9fdb8a5bd096faa34d54804afa48d46d59b28 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 21 Oct 2020 15:31:10 +0100 Subject: android: camera_device: Remove shadowing FrameBuffer usage A FrameBuffer *buffer is used to obtain the 'first' buffer from a request which is used purely to identify the timestamp from the metadata in two locations. Rather than keep the FrameBuffer instance around, which then causes further usages of FrameBuffers to be shadowed, store the timestamp locally. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 9cf1c984..390f674f 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1488,9 +1488,8 @@ void CameraDevice::requestComplete(Request *request) * It might be appropriate to return a 'correct' (as determined by * pipeline handlers) timestamp in the Request itself. */ - FrameBuffer *buffer = buffers.begin()->second; - resultMetadata = getResultMetadata(descriptor->frameNumber_, - buffer->metadata().timestamp); + uint64_t timestamp = buffers.at(0)->metadata().timestamp; + resultMetadata = getResultMetadata(descriptor->frameNumber_, timestamp); /* Handle any JPEG compression. */ for (unsigned int i = 0; i < descriptor->numBuffers_; ++i) { @@ -1547,8 +1546,7 @@ void CameraDevice::requestComplete(Request *request) if (status == CAMERA3_BUFFER_STATUS_OK) { - notifyShutter(descriptor->frameNumber_, - buffer->metadata().timestamp); + notifyShutter(descriptor->frameNumber_, timestamp); captureResult.partial_result = 1; captureResult.result = resultMetadata->get(); -- cgit v1.2.1