diff options
author | Vijay kumar Tumati <vtumati@codeaurora.org> | 2014-11-12 17:27:11 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-12 03:59:13 -0800 |
commit | 60a0f1362bccb6c4a8300ccc73434d3cbdc04821 (patch) | |
tree | dd32cc9d68f8c3026378a5ea3e108ba59bfc5024 | |
parent | 03c26f1a95cf79a914e0d17b653e75b77b26abdc (diff) | |
download | android_packages_apps_Snap-60a0f1362bccb6c4a8300ccc73434d3cbdc04821.tar.gz android_packages_apps_Snap-60a0f1362bccb6c4a8300ccc73434d3cbdc04821.tar.bz2 android_packages_apps_Snap-60a0f1362bccb6c4a8300ccc73434d3cbdc04821.zip |
SnapdragonCamera: enable cpp duplication using system property
This changes allows user to enable 1080P and
720p mirroring conditionally based on a system
property (persist.camera.mirroring.enable)
Change-Id: I7ec2cf7140682e496622c5874bc6667c33b03ad8
-rwxr-xr-x | src/com/android/camera/VideoModule.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 34ce64388..c3fb44c29 100755 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -177,6 +177,8 @@ public class VideoModule implements CameraModule, private CameraProxy mCameraDevice; private static final String KEY_PREVIEW_FORMAT = "preview-format"; private static final String FORMAT_NV12_VENUS = "nv12-venus"; + private static final String PERSIST_CAMERA_CPP_DUPLICATION = + "persist.camera.cpp.duplication"; // The degrees of the device rotated clockwise from its natural orientation. private int mOrientation = OrientationEventListener.ORIENTATION_UNKNOWN; @@ -905,8 +907,11 @@ public class VideoModule implements CameraModule, return; } mParameters = mCameraDevice.getParameters(); - if (mParameters.getSupportedVideoSizes() == null || is1080pEnabled() || is720pEnabled() || - isHFREnabled(mProfile.videoFrameWidth, mProfile.videoFrameHeight)) { + boolean isDuplicationEnabled = + SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, false); + if (mParameters.getSupportedVideoSizes() == null || ((is1080pEnabled() || + is720pEnabled()) && isDuplicationEnabled) || + isHFREnabled(mProfile.videoFrameWidth, mProfile.videoFrameHeight)) { mDesiredPreviewWidth = mProfile.videoFrameWidth; mDesiredPreviewHeight = mProfile.videoFrameHeight; } else { // Driver supports separates outputs for preview and video. @@ -2055,8 +2060,9 @@ public class VideoModule implements CameraModule, Log.v(TAG, "preview format set to YV12"); mParameters.setPreviewFormat (ImageFormat.YV12); } - - if (is1080pEnabled() || is720pEnabled()) { + boolean isDuplicationEnabled = + SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, false); + if ((is1080pEnabled() || is720pEnabled()) && isDuplicationEnabled) { Log.v(TAG, "1080p or 720p enabled, preview format set to NV12_VENUS"); mParameters.set(KEY_PREVIEW_FORMAT, FORMAT_NV12_VENUS); } |