summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
authorSanthosh Kumar H E <skhara@codeaurora.org>2014-12-29 19:12:19 +0530
committerMichael Bestas <mikeioannina@gmail.com>2015-08-29 04:15:51 +0300
commitd7afbe38bc2d9cf4f4738378f93a37777cdcc18a (patch)
treefe253a4db64fc25699b07f309c3587639070e1f6 /src/com/android/camera/VideoModule.java
parent98a0154904534298b111ba0e583c5edd1b4f7c31 (diff)
downloadandroid_packages_apps_Snap-d7afbe38bc2d9cf4f4738378f93a37777cdcc18a.tar.gz
android_packages_apps_Snap-d7afbe38bc2d9cf4f4738378f93a37777cdcc18a.tar.bz2
android_packages_apps_Snap-d7afbe38bc2d9cf4f4738378f93a37777cdcc18a.zip
Validate preview format before setting it to camera device.
For 720p and 1080p video resolutions, nv12_venus preview format is being set. But few targets doesn't support this preview format. So validate the preview format with supported list before setting it to camera device. Change-Id: I29b3b2b412b04abf82c61c732414e00aa1bff243
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r--src/com/android/camera/VideoModule.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 2b3e944b0..c6b1b0421 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2116,10 +2116,13 @@ public class VideoModule implements CameraModule,
boolean isDuplicationEnabled =
SystemProperties.getBoolean(PERSIST_CAMERA_CPP_DUPLICATION, true);
if (isDuplicationEnabled && (mDesiredPreviewWidth == mProfile.videoFrameWidth) &&
- (mDesiredPreviewHeight == mProfile.videoFrameHeight)) {
+ (mDesiredPreviewHeight == mProfile.videoFrameHeight)
+ && CameraUtil.isSupported(FORMAT_NV12_VENUS,
+ CameraSettings.getSupportedPreviewFormats(mParameters))) {
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 {
+ } else if (CameraUtil.isSupported(FORMAT_NV21,
+ CameraSettings.getSupportedPreviewFormats(mParameters))) {
mParameters.set(KEY_PREVIEW_FORMAT, FORMAT_NV21);
Log.v(TAG, "preview format set to NV21");
}