summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r--src/com/android/camera/VideoModule.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index cbfe7b94a..96423044f 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -315,7 +315,13 @@ public class VideoModule implements CameraModule,
VIDEO_ENCODER_TABLE.put("h263", MediaRecorder.VideoEncoder.H263);
VIDEO_ENCODER_TABLE.put("h264", MediaRecorder.VideoEncoder.H264);
- VIDEO_ENCODER_TABLE.put("h265", MediaRecorder.VideoEncoder.HEVC);
+ int h265 = ApiHelper.getIntFieldIfExists(MediaRecorder.VideoEncoder.class,
+ "HEVC", null, MediaRecorder.VideoEncoder.DEFAULT);
+ if (h265 == MediaRecorder.VideoEncoder.DEFAULT) {
+ h265 = ApiHelper.getIntFieldIfExists(MediaRecorder.VideoEncoder.class,
+ "H265", null, MediaRecorder.VideoEncoder.DEFAULT);
+ }
+ VIDEO_ENCODER_TABLE.put("h265", h265);
VIDEO_ENCODER_TABLE.put("m4v", MediaRecorder.VideoEncoder.MPEG_4_SP);
VIDEO_ENCODER_TABLE.putDefault(MediaRecorder.VideoEncoder.DEFAULT);
@@ -1106,8 +1112,7 @@ public class VideoModule implements CameraModule,
mOrientationManager.resume();
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences,
- mContentResolver);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences);
mLocationManager.recordLocation(recordLocation);
if (mPreviewing) {
@@ -1487,6 +1492,10 @@ public class VideoModule implements CameraModule,
mProfile.audioCodec = mAudioEncoder;
mProfile.duration = mMaxVideoDurationInMs;
+ if ((mProfile.audioCodec == MediaRecorder.AudioEncoder.AMR_NB) &&
+ !mCaptureTimeLapse && !isHFR) {
+ mProfile.fileFormat = MediaRecorder.OutputFormat.THREE_GPP;
+ }
// Set params individually for HFR case, as we do not want to encode audio
if ((isHFR || isHSR) && captureRate > 0) {
if (isHSR) {
@@ -2701,8 +2710,7 @@ public class VideoModule implements CameraModule,
// startPreview().
if (mCameraDevice == null) return;
- boolean recordLocation = RecordLocationPreference.get(
- mPreferences, mContentResolver);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences);
mLocationManager.recordLocation(recordLocation);
readVideoPreferences();