From 35a38acb7943b018c5d239d00c4ad48da5072b87 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Fri, 11 Sep 2015 00:52:56 +0300 Subject: Snap: Cleanup video profile handling * Fix camcorder crashes on older devices Revert "SnapdragonCamera: Fix compatibility issues with KK." This reverts commit 0d33346534a728a1f8efaec05fcdccbe3e5440e1. Revert "SnapdragonCamera: Throw error popup for unsupported video profile." This reverts commit 3e50703cff0bc243b922a2299c58a45a4cbd91a9. Change-Id: I1152180a590650a7583430936f3759d1831e91dd --- src/com/android/camera/VideoModule.java | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'src/com/android/camera/VideoModule.java') diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index fadd3ee6e..54aa86685 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -318,7 +318,6 @@ 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 @@ -772,16 +771,18 @@ public class VideoModule implements CameraModule, mParameters = mCameraDevice.getParameters(); String defaultQuality = mActivity.getResources().getString( R.string.pref_video_quality_default); - if (!defaultQuality.equals("")){ - videoQuality = defaultQuality; + if (!defaultQuality.equals("")) { + if (CamcorderProfile.hasProfile(Integer.parseInt(defaultQuality))) { + videoQuality = defaultQuality; + } } else { - // check for highest quality supported - videoQuality = CameraSettings.getSupportedHighestVideoQuality( - mCameraId, mParameters); + // check for highest quality supported + videoQuality = CameraSettings.getSupportedHighestVideoQuality( + mCameraId, mParameters); } mPreferences.edit().putString(CameraSettings.KEY_VIDEO_QUALITY, videoQuality).apply(); } - int quality = CameraSettings.VIDEO_QUALITY_TABLE.get(videoQuality); + int quality = Integer.valueOf(videoQuality); // Set video quality. Intent intent = mActivity.getIntent(); @@ -803,12 +804,6 @@ 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(mCameraId, quality); - if (!hasProfile) { - mUnsupportedProfile = true; - return; - } mProfile = CamcorderProfile.get(mCameraId, quality); getDesiredPreviewSize(); qcomReadVideoPreferences(); @@ -1678,13 +1673,6 @@ 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; -- cgit v1.2.3