diff options
author | Devaraj Rangasamy <dev@ti.com> | 2011-09-21 16:21:58 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-09-21 16:49:43 -0700 |
commit | 0151734329a6b8f5b1b9e42ecb7dfcba8d1e4f03 (patch) | |
tree | 5ee198be50240b806c25eebeadc491bd40fc420e /camera | |
parent | 8cfb4cfb6a2ca81b527c3ffbcd2671c253aa017a (diff) | |
download | hardware_ti_omap4-0151734329a6b8f5b1b9e42ecb7dfcba8d1e4f03.zip hardware_ti_omap4-0151734329a6b8f5b1b9e42ecb7dfcba8d1e4f03.tar.gz hardware_ti_omap4-0151734329a6b8f5b1b9e42ecb7dfcba8d1e4f03.tar.bz2 |
OMXCameraAdapter: Update timstamp calculation and comment
In timestamp calculation, latency incurred in Ducati camera buffer
reaching CameraHal should be considered
Patchset 2:
- Updated variable name, migrated to header file
- Update comment description
Change-Id: Icc93c27a66477867e9c415b139a331646eb2fba8
Signed-off-by: Devaraj Rangasamy <dev@ti.com>
Diffstat (limited to 'camera')
-rw-r--r-- | camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 15 | ||||
-rw-r--r-- | camera/inc/OMXCameraAdapter/OMXCameraAdapter.h | 2 |
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, |