summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
Diffstat (limited to 'camera')
-rw-r--r--camera/OMXCameraAdapter/OMXCameraAdapter.cpp15
-rw-r--r--camera/inc/OMXCameraAdapter/OMXCameraAdapter.h2
2 files changed, 10 insertions, 7 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index 2c1af45..3e94d1d 100644
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -3149,16 +3149,17 @@ status_t OMXCameraAdapter::initCameraFrame( CameraFrame &frame,
frame.mWidth = port->mWidth;
frame.mHeight = port->mHeight;
- // Calculating the time source delta of Ducati & system time only once at the start of camera.
- // It's seen that there is a one-time constant diff between the ducati source clock &
- // System monotonic timer, although both derived from the same 32KHz clock.
- // This delta is offsetted to/from ducati timestamp to match with system time so that
- // video timestamps are aligned with Audio with a periodic timestamp intervals.
- // Do timeset offset calculation only when recording is in progress, when nTimestamp
- // will be populated by Camera
+ // Timestamp in pBuffHeader->nTimeStamp is derived on DUCATI side, which is
+ // is not same time value as derived using systemTime. It would be ideal to use
+ // exactly same time source across Android and Ducati, which is limited by
+ // system now. So, workaround for now is to find the time offset between the two
+ // time sources and compensate the difference, along with the latency involved
+ // in camera buffer reaching CameraHal. Also, Do timeset offset calculation only
+ // when recording is in progress, when nTimestamp will be populated by Camera
if ( onlyOnce && mRecording )
{
mTimeSourceDelta = (pBuffHeader->nTimeStamp * 1000) - systemTime(SYSTEM_TIME_MONOTONIC);
+ mTimeSourceDelta += kCameraBufferLatencyNs;
onlyOnce = false;
}
diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
index 2a6ffc2..0cdd4bb 100644
--- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
+++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
@@ -137,6 +137,8 @@ namespace android {
} \
}
+const int64_t kCameraBufferLatencyNs = 250000000LL; // 250 ms
+
///OMX Specific Functions
static OMX_ERRORTYPE OMXCameraAdapterEventHandler(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_PTR pAppData,