summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanjith Kagathi Ananda <ranjith@codeaurora.org>2016-07-14 19:11:49 +0800
committerEino-Ville Talvala <etalvala@google.com>2016-07-21 20:01:15 +0000
commitc8849e0bfc3c85cc6f7269079157c2d135ade8ff (patch)
tree8cbd619ff09a1f9f93c15589d3bbedac93d58cf3
parentf13b58e637edccfba76af45715e60ba186104346 (diff)
downloadbullhead-c8849e0bfc3c85cc6f7269079157c2d135ade8ff.tar.gz
QCamera2: HAL3: correct timestamp calculation in HFR mode
When the phone powers up for several days, the timestamp (in ns, nano sec) of frames will exceed the precision of float data type. It will lead to incorrect timestamp calculation in HFR batch mode. Use double instead Ack-by: Gaoxiang Chen BUG=24842044 Change-Id: I63598e56178b980fa817c1c77f77f0e6a005767b (cherry picked from commit ece15b4fa7cc4c622e41cc9a4cd28187ae584e9e)
-rw-r--r--camera/QCamera2/HAL3/QCamera3HWI.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 59ef87b..490cd2e 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -2379,9 +2379,9 @@ void QCamera3HardwareInterface::handleBatchMetadata(
if (last_frame_capture_time) {
//Infer timestamp
first_frame_capture_time = last_frame_capture_time -
- (((loopCount - 1) * NSEC_PER_SEC) / mHFRVideoFps);
+ (((loopCount - 1) * NSEC_PER_SEC) / (double) mHFRVideoFps);
capture_time =
- first_frame_capture_time + (i * NSEC_PER_SEC / mHFRVideoFps);
+ first_frame_capture_time + (i * NSEC_PER_SEC / (double) mHFRVideoFps);
ADD_SET_PARAM_ENTRY_TO_BATCH(metadata,
CAM_INTF_META_SENSOR_TIMESTAMP, capture_time);
CDBG("%s: batch capture_time: %lld, capture_time: %lld",