summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--res/values/qcomstrings.xml3
-rw-r--r--src/com/android/camera/VideoModule.java14
2 files changed, 17 insertions, 0 deletions
diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml
index 6ba2af63f..c7d8df589 100644
--- a/res/values/qcomstrings.xml
+++ b/res/values/qcomstrings.xml
@@ -328,6 +328,9 @@
<!-- The message is shown in dialog when the app encounters an unsupported video resolution-->
<string name="error_app_unsupported">Unsupported video resolution for this encoder type</string>
+ <!-- The message is shown in dialog when the app encounters an unsupported video profile-->
+ <string name="error_app_unsupported_profile">Unsupported video profile</string>
+
<!--The message is shown in dialog when the raw snapshot is selected in zsl mode-->
<string name="error_app_unsupported_raw">Raw picture format is not supported
in zsl mode, change to JPEG
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;