summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-21 15:31:10 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-21 17:18:36 +0100
commite1f9fdb8a5bd096faa34d54804afa48d46d59b28 (patch)
treef951b8cf14eb488cf7b16bb2d3656388b5689396 /src
parent37c18c2eec1ed7c0df9fa4e9b31a7ea1f8e37292 (diff)
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 <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/android/camera_device.cpp8
1 files changed, 3 insertions, 5 deletions
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();