summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSultanxda <sultanxda@gmail.com>2015-11-06 21:03:32 -0800
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-17 22:57:34 +0200
commit2ecc5b98821c847162c865fb7d798da79b7699f4 (patch)
tree5d6204189b87e5c2afddf20f86cd7a8971a21058
parent063146d46b7ca1b705bb826d1444f4386141f107 (diff)
downloadandroid_packages_apps_Snap-2ecc5b98821c847162c865fb7d798da79b7699f4.zip
android_packages_apps_Snap-2ecc5b98821c847162c865fb7d798da79b7699f4.tar.gz
android_packages_apps_Snap-2ecc5b98821c847162c865fb7d798da79b7699f4.tar.bz2
SnapdragonCamera: Fix timelapse recording
Audio should not be encoded when the timelapse feature is used. This fixes the force close when attempting to record a timelapse video. Change-Id: I376372b316a7a75b0883e6c93eb1d827e4007a04 Signed-off-by: Sultanxda <sultanxda@gmail.com>
-rw-r--r--src/com/android/camera/VideoModule.java28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 3ca6db3..c87a797 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1580,23 +1580,19 @@ public class VideoModule implements CameraModule,
mProfile.audioCodec = mAudioEncoder;
mProfile.duration = mMaxVideoDurationInMs;
- // Set params individually for HFR case, as we do not want to encode audio
- if ((isHFR || isHSR) && captureRate > 0) {
- if (isHFR) {
- mMediaRecorder.setOutputFormat(mProfile.fileFormat);
- mMediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);
- mMediaRecorder.setVideoEncodingBitRate(mProfile.videoBitRate);
- mMediaRecorder.setVideoEncoder(mProfile.videoCodec);
- } else if (isHSR) {
- mProfile.videoBitRate *= captureRate / 30;
- mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
- mMediaRecorder.setProfile(mProfile);
- }
+ // Set params individually for HFR and timelapse
+ // cases, as we do not want to encode audio
+ if (isHFR || mCaptureTimeLapse) {
+ mMediaRecorder.setOutputFormat(mProfile.fileFormat);
+ mMediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);
+ mMediaRecorder.setVideoEncodingBitRate(mProfile.videoBitRate);
+ mMediaRecorder.setVideoEncoder(mProfile.videoCodec);
+ } else if (isHSR) {
+ mProfile.videoBitRate *= captureRate / 30;
+ mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
+ mMediaRecorder.setProfile(mProfile);
} else {
- if (!mCaptureTimeLapse) {
- mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
- }
-
+ mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setProfile(mProfile);
}