summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Rassieur <rassb@google.com>2020-11-07 19:08:06 +0000
committerBill Rassieur <rassb@google.com>2020-11-07 19:08:06 +0000
commitfc3170d2e097b9844a682f54d55c58faac75a97a (patch)
tree4209a763da0de765b7614b9828c428e068f313e0
parentf6cfa8209826be13d4a4ba3aa18b67bdd98db95d (diff)
parentabfae01a3591d63c87dd9d08247e39b8296f0fe5 (diff)
downloadCamera2-fc3170d2e097b9844a682f54d55c58faac75a97a.tar.gz
Merge sc-d1-dev 6958804 into master.
Change-Id: I910291e8dca025fc0ba07c632f4f6a6f2ff6425f BUG:171916167
-rw-r--r--Android.mk2
-rw-r--r--src/com/android/camera/VideoModule.java13
-rw-r--r--src/com/android/camera/debug/DebugPropertyHelper.java7
3 files changed, 18 insertions, 4 deletions
diff --git a/Android.mk b/Android.mk
index b24a2df57..68c9cec12 100644
--- a/Android.mk
+++ b/Android.mk
@@ -34,7 +34,7 @@ LOCAL_USE_AAPT2 := true
LOCAL_PACKAGE_NAME := Camera2
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := system_current
LOCAL_PRODUCT_MODULE := true
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 6c9752e6e..427ad3543 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -56,6 +56,7 @@ import com.android.camera.app.MemoryManager;
import com.android.camera.app.MemoryManager.MemoryListener;
import com.android.camera.app.OrientationManager;
import com.android.camera.debug.Log;
+import com.android.camera.debug.DebugPropertyHelper;
import com.android.camera.exif.ExifInterface;
import com.android.camera.hardware.HardwareSpec;
import com.android.camera.hardware.HardwareSpecImpl;
@@ -1141,9 +1142,17 @@ public class VideoModule extends CameraModule
}
mMediaRecorder.setCamera(camera);
- mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
- mMediaRecorder.setProfile(mProfile);
+ if (DebugPropertyHelper.isAudioDisabled()) {
+ mMediaRecorder.setOutputFormat(mProfile.fileFormat);
+ mMediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);
+ mMediaRecorder.setVideoEncodingBitRate(mProfile.videoBitRate);
+ mMediaRecorder.setVideoEncoder(mProfile.videoCodec);
+ Log.w(TAG, "Audio is disabled");
+ } else {
+ mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
+ mMediaRecorder.setProfile(mProfile);
+ }
mMediaRecorder.setVideoSize(mProfile.videoFrameWidth, mProfile.videoFrameHeight);
mMediaRecorder.setMaxDuration(mMaxVideoDurationInMs);
diff --git a/src/com/android/camera/debug/DebugPropertyHelper.java b/src/com/android/camera/debug/DebugPropertyHelper.java
index 66ccaafee..cc8d2fb1d 100644
--- a/src/com/android/camera/debug/DebugPropertyHelper.java
+++ b/src/com/android/camera/debug/DebugPropertyHelper.java
@@ -16,7 +16,7 @@
package com.android.camera.debug;
-import com.android.camera.util.SystemProperties;
+import android.os.SystemProperties;
public class DebugPropertyHelper {
private static final String OFF_VALUE = "0";
@@ -38,6 +38,8 @@ public class DebugPropertyHelper {
private static final String PROP_WRITE_CAPTURE_DATA = PREFIX + ".capture_write";
/** Is RAW support enabled. */
private static final String PROP_CAPTURE_DNG = PREFIX + ".capture_dng";
+ /** Is audio disabled. */
+ private static final String PROP_DISABLE_AUDIO = PREFIX + ".disable_audio";
private static boolean isPropertyOn(String property) {
return ON_VALUE.equals(SystemProperties.get(property, OFF_VALUE));
@@ -58,4 +60,7 @@ public class DebugPropertyHelper {
public static boolean isCaptureDngEnabled() {
return isPropertyOn(PROP_CAPTURE_DNG);
}
+ public static boolean isAudioDisabled() {
+ return isPropertyOn(PROP_DISABLE_AUDIO);
+ }
}