From c38d4f266ee016950bff2e08a8987e84f1d6461e Mon Sep 17 00:00:00 2001 From: Keith Mok Date: Fri, 15 Apr 2016 10:24:22 -0700 Subject: frameworks/av: Fix video recording breaks Change Id0af9c8aed1a983095275ac03f7f59abc31594cc using boot time for video recording start time as default, but it is specific on devices using qcom camera HAL3 and it breaks all devices using camera HAL1. Fix by changing the default behaviour when property media.camera.ts.monotonic is not set. And newer devices such as 8996 might need to setprop media.camera.ts.monotonic 0 in order to work properly when using camera HAL3. Change-Id: Iee07ed1147713a6397fff43e3bbd4f4ed08b56b7 --- media/libstagefright/CameraSource.cpp | 9 ++++----- media/libstagefright/MediaCodecSource.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'media/libstagefright') diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index 64e7f90..1f26872 100644 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -702,11 +702,10 @@ status_t CameraSource::start(MetaData *meta) { if (meta) { int64_t startTimeUs; - auto key = kKeyTimeBoot; - char value[PROPERTY_VALUE_MAX]; - if (property_get("media.camera.ts.monotonic", value, "0") && - atoi(value)) { - key = kKeyTime; + auto key = kKeyTime; + if (property_get_bool("persist.camera.HAL3.enabled", true) && + !property_get_bool("media.camera.ts.monotonic", true)) { + key = kKeyTimeBoot; } if (meta->findInt64(key, &startTimeUs)) { diff --git a/media/libstagefright/MediaCodecSource.cpp b/media/libstagefright/MediaCodecSource.cpp index b15ee64..94427ef 100644 --- a/media/libstagefright/MediaCodecSource.cpp +++ b/media/libstagefright/MediaCodecSource.cpp @@ -664,11 +664,10 @@ 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; + auto key = kKeyTime; + if (property_get_bool("persist.camera.HAL3.enabled", true) && + !property_get_bool("media.camera.ts.monotonic", true)) { + key = kKeyTimeBoot; } int64_t startTimeUs; -- cgit v1.1