summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSai Kumar Sanagavarapu <ssanagav@codeaurora.org>2015-02-27 13:07:16 +0530
committerSai Kumar Sanagavarapu <ssanagav@codeaurora.org>2015-02-27 13:07:16 +0530
commit3e50703cff0bc243b922a2299c58a45a4cbd91a9 (patch)
tree6a8b40656cb22af6237755d29022025e82190259 /src
parentca6f7e139f4db45edc5e2d9b5ef7f827e1e94344 (diff)
downloadandroid_packages_apps_Snap-3e50703cff0bc243b922a2299c58a45a4cbd91a9.tar.gz
android_packages_apps_Snap-3e50703cff0bc243b922a2299c58a45a4cbd91a9.tar.bz2
android_packages_apps_Snap-3e50703cff0bc243b922a2299c58a45a4cbd91a9.zip
SnapdragonCamera: Throw error popup for unsupported video profile.
Check if the quality selected has a matching camcorder profile associated and show error popup if not supported. Change-Id: If3e1e3d62b4e2e9c8c16b9e4a346cbfa93c0f92b
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/VideoModule.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 7d7120953..84273dbda 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -317,6 +317,7 @@ public class VideoModule implements CameraModule,
private boolean mUnsupportedHSRVideoSize = false;
private boolean mUnsupportedHFRVideoCodec = false;
private String mDefaultAntibanding = null;
+ boolean mUnsupportedProfile = false;
// This Handler is used to post message back onto the main thread of the
// application
@@ -824,6 +825,12 @@ public class VideoModule implements CameraModule,
mCaptureTimeLapse = (mTimeBetweenTimeLapseFrameCaptureMs != 0);
// TODO: This should be checked instead directly +1000.
if (mCaptureTimeLapse) quality += 1000;
+ mUnsupportedProfile = false;
+ boolean hasProfile = CamcorderProfile.hasProfile(quality);
+ if (!hasProfile) {
+ mUnsupportedProfile = true;
+ return;
+ }
mProfile = CamcorderProfile.get(mCameraId, quality);
getDesiredPreviewSize();
qcomReadVideoPreferences();
@@ -1632,6 +1639,13 @@ public class VideoModule implements CameraModule,
mStartRecPending = false;
return;
}
+ if (mUnsupportedProfile == true) {
+ Log.e(TAG, "Unsupported video profile");
+ RotateTextToast.makeText(mActivity, R.string.error_app_unsupported_profile,
+ Toast.LENGTH_SHORT).show();
+ mStartRecPending = false;
+ return;
+ }
//??
//if (!mCameraDevice.waitDone()) return;
mCurrentVideoUri = null;