diff options
author | Suman Mukherjee <sumam@codeaurora.org> | 2014-03-25 17:21:55 +0530 |
---|---|---|
committer | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2014-10-20 22:23:50 +0000 |
commit | 08a1edda789db5e55dda96d9518114cfa1daa698 (patch) | |
tree | ee0f32f7e0ecdfbf12e368b33486d5c890de977b | |
parent | 3b8cbff3d26c504e63b82044a8a264868f0d0db9 (diff) | |
download | android_packages_apps_Camera2-08a1edda789db5e55dda96d9518114cfa1daa698.tar.gz android_packages_apps_Camera2-08a1edda789db5e55dda96d9518114cfa1daa698.tar.bz2 android_packages_apps_Camera2-08a1edda789db5e55dda96d9518114cfa1daa698.zip |
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
-rw-r--r-- | src/com/android/camera/VideoModule.java | 14 |
1 files changed, 14 insertions, 0 deletions
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); |