diff options
author | Rajaram Gudivada <rajaramg@codeaurora.org> | 2014-12-10 14:27:04 +0530 |
---|---|---|
committer | satyavaraprasad yerramsetti <satyav@codeaurora.org> | 2014-12-10 17:34:23 +0530 |
commit | e14d86362c467fd428bf0c951fbf3e7f35810dfa (patch) | |
tree | 744722790a8edb68e10c01c6fc7ba432cf6dddb6 /src | |
parent | 36dd26755a2fd13c20bc4267298f603e99c0e867 (diff) | |
download | android_packages_apps_Snap-e14d86362c467fd428bf0c951fbf3e7f35810dfa.tar.gz android_packages_apps_Snap-e14d86362c467fd428bf0c951fbf3e7f35810dfa.tar.bz2 android_packages_apps_Snap-e14d86362c467fd428bf0c951fbf3e7f35810dfa.zip |
SnapdragonCamera: Enable CPP duplication by default
Set NV12_VENUS for preview stream, when both the
below conditions are met
1. setprop "persist.camera.cpp.duplication" is
enabled(Default value is enabled)
2. If both preview & video resolution's are exactly
same
Change-Id: I2b58091071c36a624d986f14bbe1abe9c95a4c18
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index e66d529b3..ae429dd2d 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -177,6 +177,7 @@ 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 FORMAT_NV21 = "yuv420sp"; private static final String PERSIST_CAMERA_CPP_DUPLICATION = "persist.camera.cpp.duplication"; @@ -909,10 +910,7 @@ public class VideoModule implements CameraModule, return; } mParameters = mCameraDevice.getParameters(); - boolean isDuplicationEnabled = - SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, false); - if (mParameters.getSupportedVideoSizes() == null || ((is1080pEnabled() || - is720pEnabled()) && isDuplicationEnabled) || + if (mParameters.getSupportedVideoSizes() == null || isHFREnabled(mProfile.videoFrameWidth, mProfile.videoFrameHeight)) { mDesiredPreviewWidth = mProfile.videoFrameWidth; mDesiredPreviewHeight = mProfile.videoFrameHeight; @@ -2070,11 +2068,19 @@ public class VideoModule implements CameraModule, Log.v(TAG, "preview format set to YV12"); mParameters.setPreviewFormat (ImageFormat.YV12); } + + // Set NV12_VENUS for preview stream, when both the below conditions are met + // 1. setprop "persist.camera.cpp.duplication" is enabled(Default value is enabled) + // 2. If both preview & video resolution are exactly same 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"); + SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, true); + if (isDuplicationEnabled && (mDesiredPreviewWidth == mProfile.videoFrameWidth) && + (mDesiredPreviewHeight == mProfile.videoFrameHeight)) { + Log.v(TAG, "Preview is same as Video resolution, So preview format set to NV12_VENUS"); mParameters.set(KEY_PREVIEW_FORMAT, FORMAT_NV12_VENUS); + } else { + mParameters.set(KEY_PREVIEW_FORMAT, FORMAT_NV21); + Log.v(TAG, "preview format set to NV21"); } // Set High Frame Rate. |