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:
parent
37c18c2eec
commit
e1f9fdb8a5
1 changed files with 3 additions and 5 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue