From 063146d46b7ca1b705bb826d1444f4386141f107 Mon Sep 17 00:00:00 2001 From: Sultanxda Date: Fri, 6 Nov 2015 20:54:31 -0800 Subject: 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 --- src/com/android/camera/VideoModule.java | 15 ++++++++++----- 1 file 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); -- cgit v1.2.3