aboutsummaryrefslogtreecommitdiff
path: root/camera/QCamera2/HAL3/QCamera3HWI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'camera/QCamera2/HAL3/QCamera3HWI.cpp')
-rw-r--r--camera/QCamera2/HAL3/QCamera3HWI.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 4e785f6..e5926fd 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -1293,6 +1293,39 @@ void QCamera3HardwareInterface::updateFpsInPreviewBuffer(metadata_buffer_t *meta
}
}
+#ifndef USE_HAL_3_3
+/*==============================================================================
+ * FUNCTION : updateTimeStampInPendingBuffers
+ *
+ * DESCRIPTION: update timestamp in display metadata for all pending buffers
+ * of a frame number
+ *
+ * PARAMETERS :
+ * @frame_number: frame_number. Timestamp will be set on pending buffers of this frame number
+ * @timestamp : timestamp to be set
+ *
+ * RETURN : None
+ *
+ *==========================================================================*/
+void QCamera3HardwareInterface::updateTimeStampInPendingBuffers(
+ uint32_t frameNumber, nsecs_t timestamp)
+{
+ for (auto req = mPendingBuffersMap.mPendingBuffersInRequest.begin();
+ req != mPendingBuffersMap.mPendingBuffersInRequest.end(); req++) {
+ if (req->frame_number != frameNumber)
+ continue;
+
+ for (auto k = req->mPendingBufferList.begin();
+ k != req->mPendingBufferList.end(); k++ ) {
+ struct private_handle_t *priv_handle =
+ (struct private_handle_t *) (*(k->buffer));
+ setMetaData(priv_handle, SET_VT_TIMESTAMP, &timestamp);
+ }
+ }
+ return;
+}
+#endif
+
/*===========================================================================
* FUNCTION : configureStreams
*
@@ -3017,6 +3050,13 @@ void QCamera3HardwareInterface::handleMetadataWithLock(
i->timestamp = capture_time;
+#ifndef USE_HAL_3_3
+ /* Set the timestamp in display metadata so that clients aware of
+ private_handle such as VT can use this un-modified timestamps.
+ Camera framework is unaware of this timestamp and cannot change this */
+ updateTimeStampInPendingBuffers(i->frame_number, i->timestamp);
+#endif
+
// Find channel requiring metadata, meaning internal offline postprocess
// is needed.
//TODO: for now, we don't support two streams requiring metadata at the same time.