diff options
-rw-r--r-- | res/values/qcomstrings.xml | 3 | ||||
-rw-r--r-- | src/com/android/camera/VideoModule.java | 14 |
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; |