summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSultanxda <sultanxda@gmail.com>2015-11-06 20:54:31 -0800
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-17 22:57:27 +0200
commit063146d46b7ca1b705bb826d1444f4386141f107 (patch)
treefcb4d5629b8d9570e3e3c4c1b20517a0e13b92ea
parentbc112a10f2a99fa76e95e93747d67fa0b103f313 (diff)
downloadandroid_packages_apps_Snap-063146d46b7ca1b705bb826d1444f4386141f107.tar.gz
android_packages_apps_Snap-063146d46b7ca1b705bb826d1444f4386141f107.tar.bz2
android_packages_apps_Snap-063146d46b7ca1b705bb826d1444f4386141f107.zip
SnapdragonCamera: Enable audio recording for HSR videos
Unlike HFR (slow-mo), HSR (high-speed) supports audio encoding at the normal rate (as HSR videos are full speed, and are thus not slowed to 30 FPS). Change-Id: I7b699ebb12fd1d84fc79979669a42c608e1aa7dd Signed-off-by: Sultanxda <sultanxda@gmail.com>
-rw-r--r--src/com/android/camera/VideoModule.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 34a83a351..3ca6db31a 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1582,11 +1582,16 @@ public class VideoModule implements CameraModule,
// Set params individually for HFR case, as we do not want to encode audio
if ((isHFR || isHSR) && captureRate > 0) {
- mMediaRecorder.setOutputFormat(mProfile.fileFormat);
- mMediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);
- mMediaRecorder.setVideoEncodingBitRate(mProfile.videoBitRate *
- ((isHSR ? captureRate : 30) / 30));
- mMediaRecorder.setVideoEncoder(mProfile.videoCodec);
+ 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);
+ }
} else {
if (!mCaptureTimeLapse) {
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);