From 08a1edda789db5e55dda96d9518114cfa1daa698 Mon Sep 17 00:00:00 2001 From: Suman Mukherjee Date: Tue, 25 Mar 2014 17:21:55 +0530 Subject: Camera: Change video capture duration with HFR While capturing a video with HFR, duration is getting stored properly in metadata but not in media database. While checking details, duration is showing actual captured duration, not the playback duration. After rebooting the phone, then media table is getting updated with proper duration. Fix made: After capture, change duration value as per user selected HFR option. CRs-Fixed: 627354 Change-Id: Ifb7c607e3545c4d2a2e0b1b7666cb0567640d416 --- src/com/android/camera/VideoModule.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 19fe119aa..caeb270c4 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -1528,6 +1528,20 @@ public class VideoModule implements CameraModule, return; } + /* Change the duration as per HFR selection */ + String hfr = mParameters.getVideoHighFrameRate(); + int defaultFps = 30; + int hfrRatio = 1; + if (!("off".equals(hfr))) { + try { + int hfrFps = Integer.parseInt(hfr); + hfrRatio = hfrFps / defaultFps; + } catch(Exception ex) { + // Do nothing + } + } + duration = duration * hfrRatio; + mActivity.getMediaSaveService().addVideo(mCurrentVideoFilename, duration, mCurrentVideoValues, mOnVideoSavedListener, mContentResolver); -- cgit v1.2.3