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>
This commit is contained in:
Kieran Bingham 2020-10-21 15:31:10 +01:00
parent 37c18c2eec
commit e1f9fdb8a5

View file

@ -1488,9 +1488,8 @@ void CameraDevice::requestComplete(Request *request)
* It might be appropriate to return a 'correct' (as determined by * It might be appropriate to return a 'correct' (as determined by
* pipeline handlers) timestamp in the Request itself. * pipeline handlers) timestamp in the Request itself.
*/ */
FrameBuffer *buffer = buffers.begin()->second; uint64_t timestamp = buffers.at(0)->metadata().timestamp;
resultMetadata = getResultMetadata(descriptor->frameNumber_, resultMetadata = getResultMetadata(descriptor->frameNumber_, timestamp);
buffer->metadata().timestamp);
/* Handle any JPEG compression. */ /* Handle any JPEG compression. */
for (unsigned int i = 0; i < descriptor->numBuffers_; ++i) { for (unsigned int i = 0; i < descriptor->numBuffers_; ++i) {
@ -1547,8 +1546,7 @@ void CameraDevice::requestComplete(Request *request)
if (status == CAMERA3_BUFFER_STATUS_OK) { if (status == CAMERA3_BUFFER_STATUS_OK) {
notifyShutter(descriptor->frameNumber_, notifyShutter(descriptor->frameNumber_, timestamp);
buffer->metadata().timestamp);
captureResult.partial_result = 1; captureResult.partial_result = 1;
captureResult.result = resultMetadata->get(); captureResult.result = resultMetadata->get();