diff options
author | Surajit Podder <spodder@codeaurora.org> | 2016-02-25 20:23:24 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-04-13 13:54:55 -0700 |
commit | 51b3174ac272f146f7a4fb502103d8130b6f4703 (patch) | |
tree | 941d43998d3212a890acf30f52ccbf725f0c5a53 /media/libstagefright/MediaCodecSource.cpp | |
parent | 7262eae1402f3256606ad1776e35c4a08ed267c3 (diff) | |
download | frameworks_av-51b3174ac272f146f7a4fb502103d8130b6f4703.zip frameworks_av-51b3174ac272f146f7a4fb502103d8130b6f4703.tar.gz frameworks_av-51b3174ac272f146f7a4fb502103d8130b6f4703.tar.bz2 |
video: Use boot clock for recording start time
Camera HAL3 uses boot time for buffer timestamp, rather
than system monotonic time. This leads to issues as
framework uses system monotonic time as reference start
time for timestamp adjustment.
Add change to use boot time for reference start time.
CRs-Fixed: 946735
Change-Id: Id0af9c8aed1a983095275ac03f7f59abc31594cc
Diffstat (limited to 'media/libstagefright/MediaCodecSource.cpp')
-rw-r--r-- | media/libstagefright/MediaCodecSource.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/media/libstagefright/MediaCodecSource.cpp b/media/libstagefright/MediaCodecSource.cpp index adbde54..b15ee64 100644 --- a/media/libstagefright/MediaCodecSource.cpp +++ b/media/libstagefright/MediaCodecSource.cpp @@ -38,6 +38,7 @@ #include <media/stagefright/Utils.h> #include <OMX_Core.h> #include <stagefright/AVExtensions.h> +#include <cutils/properties.h> namespace android { @@ -663,8 +664,15 @@ status_t MediaCodecSource::onStart(MetaData *params) { status_t err = OK; if (mFlags & FLAG_USE_SURFACE_INPUT) { + auto key = kKeyTimeBoot; + char value[PROPERTY_VALUE_MAX]; + if (property_get("media.camera.ts.monotonic", value, "0") && + atoi(value)) { + key = kKeyTime; + } + int64_t startTimeUs; - if (!params || !params->findInt64(kKeyTime, &startTimeUs)) { + if (!params || !params->findInt64(key, &startTimeUs)) { startTimeUs = -1ll; } resume(startTimeUs); |