From 05999715cc38365aa4751a2a355eb1af284573ab Mon Sep 17 00:00:00 2001 From: Angus Kong Date: Fri, 23 Sep 2011 18:08:00 +0800 Subject: Show the real resolution for quality settings. 1. Change the assets. 2. Change the strings from high/low/mms to 1080p/720p/480p. 3. Change the preference from customized string to the real values of CamcorderProfile.QUALITY_[1080|720|480]P bug:5141068 Change-Id: I294799bda8e873f828bbf4bd21330591f0859632 --- .../ic_viewfinder_video_quality_1080p.png | Bin 0 -> 561 bytes .../ic_viewfinder_video_quality_480p.png | Bin 0 -> 659 bytes .../ic_viewfinder_video_quality_720p.png | Bin 0 -> 553 bytes .../ic_viewfinder_video_quality_high.png | Bin 1464 -> 0 bytes .../ic_viewfinder_video_quality_low.png | Bin 1318 -> 0 bytes .../ic_viewfinder_video_quality_mms.png | Bin 1449 -> 0 bytes .../ic_viewfinder_video_quality_youtube.png | Bin 2289 -> 0 bytes .../ic_viewfinder_video_quality_1080p.png | Bin 0 -> 871 bytes .../ic_viewfinder_video_quality_480p.png | Bin 0 -> 981 bytes .../ic_viewfinder_video_quality_720p.png | Bin 0 -> 972 bytes .../ic_viewfinder_video_quality_high.png | Bin 988 -> 0 bytes .../ic_viewfinder_video_quality_low.png | Bin 842 -> 0 bytes .../ic_viewfinder_video_quality_mms.png | Bin 741 -> 0 bytes .../ic_viewfinder_video_quality_youtube.png | Bin 1415 -> 0 bytes .../ic_viewfinder_video_quality_high.png | Bin 629 -> 0 bytes .../ic_viewfinder_video_quality_low.png | Bin 793 -> 0 bytes .../ic_viewfinder_video_quality_youtube.png | Bin 1435 -> 0 bytes .../ic_viewfinder_video_quality_1080p.png | Bin 0 -> 1132 bytes .../ic_viewfinder_video_quality_480p.png | Bin 0 -> 1324 bytes .../ic_viewfinder_video_quality_720p.png | Bin 0 -> 1224 bytes res/values/arrays.xml | 21 +++-- res/values/strings.xml | 22 ++--- src/com/android/camera/CameraSettings.java | 88 ++++++++---------- src/com/android/camera/ListPreference.java | 2 - src/com/android/camera/VideoCamera.java | 100 +++++---------------- 25 files changed, 80 insertions(+), 153 deletions(-) create mode 100644 res/drawable-hdpi/ic_viewfinder_video_quality_1080p.png create mode 100644 res/drawable-hdpi/ic_viewfinder_video_quality_480p.png create mode 100644 res/drawable-hdpi/ic_viewfinder_video_quality_720p.png delete mode 100644 res/drawable-hdpi/ic_viewfinder_video_quality_high.png delete mode 100644 res/drawable-hdpi/ic_viewfinder_video_quality_low.png delete mode 100644 res/drawable-hdpi/ic_viewfinder_video_quality_mms.png delete mode 100644 res/drawable-hdpi/ic_viewfinder_video_quality_youtube.png create mode 100644 res/drawable-mdpi/ic_viewfinder_video_quality_1080p.png create mode 100644 res/drawable-mdpi/ic_viewfinder_video_quality_480p.png create mode 100644 res/drawable-mdpi/ic_viewfinder_video_quality_720p.png delete mode 100644 res/drawable-mdpi/ic_viewfinder_video_quality_high.png delete mode 100644 res/drawable-mdpi/ic_viewfinder_video_quality_low.png delete mode 100644 res/drawable-mdpi/ic_viewfinder_video_quality_mms.png delete mode 100644 res/drawable-mdpi/ic_viewfinder_video_quality_youtube.png delete mode 100644 res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_high.png delete mode 100644 res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_low.png delete mode 100644 res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_youtube.png create mode 100644 res/drawable-xhdpi/ic_viewfinder_video_quality_1080p.png create mode 100644 res/drawable-xhdpi/ic_viewfinder_video_quality_480p.png create mode 100644 res/drawable-xhdpi/ic_viewfinder_video_quality_720p.png diff --git a/res/drawable-hdpi/ic_viewfinder_video_quality_1080p.png b/res/drawable-hdpi/ic_viewfinder_video_quality_1080p.png new file mode 100644 index 0000000..d2a39e4 Binary files /dev/null and b/res/drawable-hdpi/ic_viewfinder_video_quality_1080p.png differ diff --git a/res/drawable-hdpi/ic_viewfinder_video_quality_480p.png b/res/drawable-hdpi/ic_viewfinder_video_quality_480p.png new file mode 100644 index 0000000..398a4b9 Binary files /dev/null and b/res/drawable-hdpi/ic_viewfinder_video_quality_480p.png differ diff --git a/res/drawable-hdpi/ic_viewfinder_video_quality_720p.png b/res/drawable-hdpi/ic_viewfinder_video_quality_720p.png new file mode 100644 index 0000000..5567eb0 Binary files /dev/null and b/res/drawable-hdpi/ic_viewfinder_video_quality_720p.png differ diff --git a/res/drawable-hdpi/ic_viewfinder_video_quality_high.png b/res/drawable-hdpi/ic_viewfinder_video_quality_high.png deleted file mode 100644 index 432cb4a..0000000 Binary files a/res/drawable-hdpi/ic_viewfinder_video_quality_high.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_viewfinder_video_quality_low.png b/res/drawable-hdpi/ic_viewfinder_video_quality_low.png deleted file mode 100644 index 45ada04..0000000 Binary files a/res/drawable-hdpi/ic_viewfinder_video_quality_low.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_viewfinder_video_quality_mms.png b/res/drawable-hdpi/ic_viewfinder_video_quality_mms.png deleted file mode 100644 index 9e517df..0000000 Binary files a/res/drawable-hdpi/ic_viewfinder_video_quality_mms.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_viewfinder_video_quality_youtube.png b/res/drawable-hdpi/ic_viewfinder_video_quality_youtube.png deleted file mode 100644 index 296ee75..0000000 Binary files a/res/drawable-hdpi/ic_viewfinder_video_quality_youtube.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_viewfinder_video_quality_1080p.png b/res/drawable-mdpi/ic_viewfinder_video_quality_1080p.png new file mode 100644 index 0000000..199e0ef Binary files /dev/null and b/res/drawable-mdpi/ic_viewfinder_video_quality_1080p.png differ diff --git a/res/drawable-mdpi/ic_viewfinder_video_quality_480p.png b/res/drawable-mdpi/ic_viewfinder_video_quality_480p.png new file mode 100644 index 0000000..e0b4974 Binary files /dev/null and b/res/drawable-mdpi/ic_viewfinder_video_quality_480p.png differ diff --git a/res/drawable-mdpi/ic_viewfinder_video_quality_720p.png b/res/drawable-mdpi/ic_viewfinder_video_quality_720p.png new file mode 100644 index 0000000..1104ce5 Binary files /dev/null and b/res/drawable-mdpi/ic_viewfinder_video_quality_720p.png differ diff --git a/res/drawable-mdpi/ic_viewfinder_video_quality_high.png b/res/drawable-mdpi/ic_viewfinder_video_quality_high.png deleted file mode 100644 index 2841baa..0000000 Binary files a/res/drawable-mdpi/ic_viewfinder_video_quality_high.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_viewfinder_video_quality_low.png b/res/drawable-mdpi/ic_viewfinder_video_quality_low.png deleted file mode 100644 index ca67404..0000000 Binary files a/res/drawable-mdpi/ic_viewfinder_video_quality_low.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_viewfinder_video_quality_mms.png b/res/drawable-mdpi/ic_viewfinder_video_quality_mms.png deleted file mode 100644 index 437e412..0000000 Binary files a/res/drawable-mdpi/ic_viewfinder_video_quality_mms.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_viewfinder_video_quality_youtube.png b/res/drawable-mdpi/ic_viewfinder_video_quality_youtube.png deleted file mode 100644 index c29a444..0000000 Binary files a/res/drawable-mdpi/ic_viewfinder_video_quality_youtube.png and /dev/null differ diff --git a/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_high.png b/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_high.png deleted file mode 100644 index 2fcbd8b..0000000 Binary files a/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_high.png and /dev/null differ diff --git a/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_low.png b/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_low.png deleted file mode 100644 index 9158059..0000000 Binary files a/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_low.png and /dev/null differ diff --git a/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_youtube.png b/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_youtube.png deleted file mode 100644 index 7d279af..0000000 Binary files a/res/drawable-w1024dp-mdpi/ic_viewfinder_video_quality_youtube.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_viewfinder_video_quality_1080p.png b/res/drawable-xhdpi/ic_viewfinder_video_quality_1080p.png new file mode 100644 index 0000000..606e66d Binary files /dev/null and b/res/drawable-xhdpi/ic_viewfinder_video_quality_1080p.png differ diff --git a/res/drawable-xhdpi/ic_viewfinder_video_quality_480p.png b/res/drawable-xhdpi/ic_viewfinder_video_quality_480p.png new file mode 100644 index 0000000..3dd4fb2 Binary files /dev/null and b/res/drawable-xhdpi/ic_viewfinder_video_quality_480p.png differ diff --git a/res/drawable-xhdpi/ic_viewfinder_video_quality_720p.png b/res/drawable-xhdpi/ic_viewfinder_video_quality_720p.png new file mode 100644 index 0000000..c4e08d9 Binary files /dev/null and b/res/drawable-xhdpi/ic_viewfinder_video_quality_720p.png differ diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 8ad433e..854bc22 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -18,21 +18,24 @@ - @string/pref_video_quality_entry_high - @string/pref_video_quality_entry_low - @string/pref_video_quality_entry_youtube + @string/pref_video_quality_entry_1080p + @string/pref_video_quality_entry_720p + @string/pref_video_quality_entry_480p - @string/pref_video_quality_high - @string/pref_video_quality_low - @string/pref_video_quality_youtube + + 6 + + @string/pref_video_quality_default + + 4 - @drawable/ic_viewfinder_video_quality_high - @drawable/ic_viewfinder_video_quality_low - @drawable/ic_viewfinder_video_quality_youtube + @drawable/ic_viewfinder_video_quality_1080p + @drawable/ic_viewfinder_video_quality_720p + @drawable/ic_viewfinder_video_quality_480p diff --git a/res/values/strings.xml b/res/values/strings.xml index 9ec1baf..4db1938 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -106,20 +106,14 @@ Video quality - high - - High - - Low - - MMS (Low, 30s) - - YouTube (High, 15m) - - high - low - mms - youtube + + 5 + + HD + + HD + + SD diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java index a465a19..eb0161a 100644 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -54,14 +54,10 @@ public class CameraSettings { public static final String EXPOSURE_DEFAULT_VALUE = "0"; - public static final int CURRENT_VERSION = 4; + public static final int CURRENT_VERSION = 5; public static final int CURRENT_LOCAL_VERSION = 1; - // max video duration in seconds for youtube. - private static final int YOUTUBE_VIDEO_DURATION = 15 * 60; // 15 mins - private static final int DEFAULT_VIDEO_DURATION = 0; // no limit - - public static final String DEFAULT_VIDEO_QUALITY_VALUE = "high"; + public static final int DEFAULT_VIDEO_DURATION = 0; // no limit private static final String TAG = "CameraSettings"; @@ -86,6 +82,14 @@ public class CameraSettings { return group; } + public String getDefaultVideoQuality(String defaultQuality) { + int quality = Integer.valueOf(defaultQuality); + if (CamcorderProfile.hasProfile(mCameraId, quality)) { + return defaultQuality; + } + return Integer.toString(CamcorderProfile.QUALITY_HIGH); + } + public static void initialCameraPictureSize( Context context, Parameters parameters) { // When launching the camera app first time, we will set the picture @@ -117,7 +121,7 @@ public class CameraSettings { if (index == NOT_FOUND) return false; int width = Integer.parseInt(candidate.substring(0, index)); int height = Integer.parseInt(candidate.substring(index + 1)); - for (Size size: supported) { + for (Size size : supported) { if (size.width == width && size.height == height) { parameters.setPictureSize(width, height); return true; @@ -136,7 +140,7 @@ public class CameraSettings { ListPreference focusMode = group.findPreference(KEY_FOCUS_MODE); ListPreference exposure = group.findPreference(KEY_EXPOSURE); IconListPreference cameraIdPref = - (IconListPreference)group.findPreference(KEY_CAMERA_ID); + (IconListPreference) group.findPreference(KEY_CAMERA_ID); ListPreference videoFlashMode = group.findPreference(KEY_VIDEOCAMERA_FLASH_MODE); ListPreference videoEffect = group.findPreference(KEY_VIDEO_EFFECT); @@ -144,7 +148,7 @@ public class CameraSettings { // Since the screen could be loaded from different resources, we need // to check if the preference is available here if (videoQuality != null) { - initVideoQuality(videoQuality); + filterUnsupportedOptions(group, videoQuality, getSupportedVideoQuality()); } if (pictureSize != null) { @@ -220,7 +224,7 @@ public class CameraSettings { } CharSequence[] entryValues = new CharSequence[2]; - for (int i = 0 ; i < mCameraInfo.length ; ++i) { + for (int i = 0; i < mCameraInfo.length; ++i) { int index = (mCameraInfo[i].facing == CameraInfo.CAMERA_FACING_FRONT) ? CameraInfo.CAMERA_FACING_FRONT @@ -338,27 +342,18 @@ public class CameraSettings { // ignore the current settings. editor.remove("pref_camera_videoquality_key"); editor.remove("pref_camera_video_duration_key"); + version = 4; + } + if (version == 4) { + // We use numbers to represent the quality now. The quality definition is identical to + // that of CamcorderProfile.java. + editor.remove("pref_video_quality_key"); } + editor.putInt(KEY_VERSION, CURRENT_VERSION); editor.apply(); } - public static boolean getVideoQuality(Context context, String quality) { - return context.getString(R.string.pref_video_quality_youtube).equals(quality) - || context.getString(R.string.pref_video_quality_high).equals(quality); - } - - public static int getVideoDurationInMillis(Context context, String quality, int cameraId) { - if (context.getString(R.string.pref_video_quality_mms).equals(quality)) { - int mmsVideoDuration = CamcorderProfile.get(cameraId, - CamcorderProfile.QUALITY_LOW).duration; - return mmsVideoDuration * 1000; - } else if (context.getString(R.string.pref_video_quality_youtube).equals(quality)) { - return YOUTUBE_VIDEO_DURATION * 1000; - } - return DEFAULT_VIDEO_DURATION; - } - public static int readPreferredCameraId(SharedPreferences pref) { return Integer.parseInt(pref.getString(KEY_CAMERA_ID, "0")); } @@ -462,38 +457,27 @@ public class CameraSettings { writePreferredCameraId(preferences, currentCameraId); } - private void initVideoQuality(ListPreference videoQuality) { - CharSequence[] entries = videoQuality.getEntries(); - CharSequence[] values = videoQuality.getEntryValues(); - if (Util.isMmsCapable(mContext)) { - int mmsVideoDuration = CamcorderProfile.get(mCameraId, - CamcorderProfile.QUALITY_LOW).duration; - // We need to fill in the device-dependent value (in seconds). - for (int i = 0; i < entries.length; ++i) { - if (mContext.getString(R.string.pref_video_quality_mms).equals(values[i])) { - entries[i] = entries[i].toString().replace( - "30", Integer.toString(mmsVideoDuration)); - break; - } - } - } else { - // The device does not support mms. Remove it. Using - // filterUnsupported is not efficient but adding a new method - // for remove is not worth it. - ArrayList supported = new ArrayList(); - for (int i = 0; i < entries.length; ++i) { - if (!mContext.getString(R.string.pref_video_quality_mms).equals(values[i])) { - supported.add(values[i].toString()); - } - } - videoQuality.filterUnsupported(supported); + private ArrayList getSupportedVideoQuality() { + ArrayList supported = new ArrayList(); + // Check for supported quality + if (CamcorderProfile.hasProfile(mCameraId, CamcorderProfile.QUALITY_1080P)) { + supported.add(Integer.toString(CamcorderProfile.QUALITY_1080P)); + } + if (CamcorderProfile.hasProfile(mCameraId, CamcorderProfile.QUALITY_720P)) { + supported.add(Integer.toString(CamcorderProfile.QUALITY_720P)); } + if (CamcorderProfile.hasProfile(mCameraId, CamcorderProfile.QUALITY_480P)) { + supported.add(Integer.toString(CamcorderProfile.QUALITY_480P)); + } + + return supported; } private void initVideoEffect(PreferenceGroup group, ListPreference videoEffect) { CharSequence[] values = videoEffect.getEntryValues(); - boolean goofyFaceSupported = EffectsRecorder.isEffectSupported(EffectsRecorder.EFFECT_GOOFY_FACE); + boolean goofyFaceSupported = + EffectsRecorder.isEffectSupported(EffectsRecorder.EFFECT_GOOFY_FACE); boolean backdropperSupported = EffectsRecorder.isEffectSupported(EffectsRecorder.EFFECT_BACKDROPPER) && mParameters.isAutoExposureLockSupported() && diff --git a/src/com/android/camera/ListPreference.java b/src/com/android/camera/ListPreference.java index 288c875..6885a37 100644 --- a/src/com/android/camera/ListPreference.java +++ b/src/com/android/camera/ListPreference.java @@ -22,8 +22,6 @@ import android.content.res.TypedArray; import android.util.AttributeSet; import android.util.Log; -import com.android.camera.R; - import java.util.ArrayList; import java.util.List; diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 8b6c328..74e217b 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -48,7 +48,6 @@ import android.os.ParcelFileDescriptor; import android.os.SystemClock; import android.provider.MediaStore; import android.provider.MediaStore.Video; -import android.provider.Settings; import android.util.Log; import android.view.GestureDetector; import android.view.Gravity; @@ -196,11 +195,6 @@ public class VideoCamera extends ActivityBase private ContentValues mCurrentVideoValues; private CamcorderProfile mProfile; - // The array of video quality profiles supported by each camera(s). Here the - // cameraId is the index of the array to get the profile map which contain - // the set of quality string and its real quality of a camera. - private HashMap[] mProfileQuality; - private HashMap[] mTimeLapseProfileQuality; // The video duration limit. 0 menas no limit. private int mMaxVideoDurationInMs; @@ -365,9 +359,9 @@ public class VideoCamera extends ActivityBase mCameraDevice = Util.openCamera(VideoCamera.this, mCameraId); readVideoPreferences(); startPreview(); - } catch(CameraHardwareException e) { + } catch (CameraHardwareException e) { mOpenCameraFail = true; - } catch(CameraDisabledException e) { + } catch (CameraDisabledException e) { mCameraDisabled = true; } } @@ -643,11 +637,14 @@ public class VideoCamera extends ActivityBase } private void readVideoPreferences() { - String quality = mPreferences.getString( + CameraSettings settings = new CameraSettings(this, mParameters, + mCameraId, CameraHolder.instance().getCameraInfo()); + // The preference stores values from ListPreference and is thus string type for all values. + // We need to convert it to int manually. + int quality = Integer.valueOf(mPreferences.getString( CameraSettings.KEY_VIDEO_QUALITY, - CameraSettings.DEFAULT_VIDEO_QUALITY_VALUE); - boolean videoQualityHigh = - CameraSettings.getVideoQuality(this, quality); + settings.getDefaultVideoQuality( + getResources().getString(R.string.pref_video_quality_default)))); // Set video quality. Intent intent = getIntent(); @@ -655,9 +652,9 @@ public class VideoCamera extends ActivityBase int extraVideoQuality = intent.getIntExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); if (extraVideoQuality > 0) { - quality = getString(R.string.pref_video_quality_high); + quality = CamcorderProfile.QUALITY_HIGH; } else { // 0 is mms. - quality = getString(R.string.pref_video_quality_mms); + quality = CamcorderProfile.QUALITY_LOW; } } @@ -668,8 +665,7 @@ public class VideoCamera extends ActivityBase intent.getIntExtra(MediaStore.EXTRA_DURATION_LIMIT, 0); mMaxVideoDurationInMs = 1000 * seconds; } else { - mMaxVideoDurationInMs = - CameraSettings.getVideoDurationInMillis(this, quality, mCameraId); + mMaxVideoDurationInMs = CameraSettings.DEFAULT_VIDEO_DURATION; } // Read time lapse recording interval. @@ -679,8 +675,9 @@ public class VideoCamera extends ActivityBase mTimeBetweenTimeLapseFrameCaptureMs = Integer.parseInt(frameIntervalStr); mCaptureTimeLapse = (mTimeBetweenTimeLapseFrameCaptureMs != 0); - int profileQuality = getProfileQuality(mCameraId, quality, mCaptureTimeLapse); - mProfile = CamcorderProfile.get(mCameraId, profileQuality); + // TODO: This should be checked instead directly +1000. + if (mCaptureTimeLapse) quality += 1000; + mProfile = CamcorderProfile.get(mCameraId, quality); getDesiredPreviewSize(); // Set effect @@ -706,55 +703,6 @@ public class VideoCamera extends ActivityBase } - int getProfileQuality(int cameraId, String quality, boolean captureTimeLapse) { - HashMap[] qualityMap; - if (captureTimeLapse) { - if (mTimeLapseProfileQuality == null) { - mTimeLapseProfileQuality = new HashMap[ - CameraHolder.instance().getNumberOfCameras()]; - } - qualityMap = mTimeLapseProfileQuality; - if (qualityMap[cameraId] == null) { - qualityMap[cameraId] = buildProfileQuality(cameraId, TIME_LAPSE_VIDEO_QUALITY); - } - } else { - if (mProfileQuality == null) { - mProfileQuality = new HashMap[ - CameraHolder.instance().getNumberOfCameras()]; - } - qualityMap = mProfileQuality; - if (qualityMap[cameraId] == null) { - qualityMap[cameraId] = buildProfileQuality(cameraId, VIDEO_QUALITY); - } - } - return qualityMap[cameraId].get(quality); - } - - HashMap buildProfileQuality(int cameraId, - int qualityList[]) { - HashMap qualityMap = new HashMap(); - int highestQuality = -1, secondHighestQuality = -1, - lastEffectiveQuality = -1; - for (int i = 0; i < qualityList.length; i++) { - if (CamcorderProfile.hasProfile(cameraId, qualityList[i])) { - if (highestQuality == -1) { - highestQuality = qualityList[i]; - } else if (secondHighestQuality == -1) { - secondHighestQuality = qualityList[i]; - } - lastEffectiveQuality = qualityList[i]; - } - } - if (secondHighestQuality == -1) { - secondHighestQuality = highestQuality; - } - qualityMap.put(getString(R.string.pref_video_quality_high), highestQuality); - qualityMap.put(getString(R.string.pref_video_quality_low), secondHighestQuality); - qualityMap.put(getString(R.string.pref_video_quality_youtube), highestQuality); - qualityMap.put(getString(R.string.pref_video_quality_mms), lastEffectiveQuality); - return qualityMap; - } - private void getDesiredPreviewSize() { mParameters = mCameraDevice.getParameters(); if (mParameters.getSupportedVideoSizes() == null) { @@ -804,10 +752,10 @@ public class VideoCamera extends ActivityBase readVideoPreferences(); resizeForPreviewAspectRatio(); startPreview(); - } catch(CameraHardwareException e) { + } catch (CameraHardwareException e) { Util.showErrorAndFinish(this, R.string.cannot_connect_camera); return; - } catch(CameraDisabledException e) { + } catch (CameraDisabledException e) { Util.showErrorAndFinish(this, R.string.camera_disabled); return; } @@ -1247,7 +1195,7 @@ public class VideoCamera extends ActivityBase mSurfaceHeight); if (mEffectType == EffectsRecorder.EFFECT_BACKDROPPER && - ((String)mEffectParameter).equals(EFFECT_BG_FROM_GALLERY) ) { + ((String) mEffectParameter).equals(EFFECT_BG_FROM_GALLERY)) { mEffectsRecorder.setEffect(mEffectType, mEffectUriFromGallery); } else { mEffectsRecorder.setEffect(mEffectType, mEffectParameter); @@ -1881,7 +1829,7 @@ public class VideoCamera extends ActivityBase if (resultCode == RESULT_OK) { // onActivityResult() runs before onResume(), so this parameter will be // seen by startPreview from onResume() - mEffectUriFromGallery = ((Uri)data.getData()).toString(); + mEffectUriFromGallery = ((Uri) data.getData()).toString(); Log.v(TAG, "Received URI from gallery: " + mEffectUriFromGallery); } break; @@ -2005,15 +1953,15 @@ public class VideoCamera extends ActivityBase if (mEffectType == EffectsRecorder.EFFECT_NONE) return false; if (mEffectParameter.equals(currentEffectParameter)) return false; } - Log.v(TAG, "New effect selection: " + mPreferences.getString(CameraSettings.KEY_VIDEO_EFFECT, "none") ); + Log.v(TAG, "New effect selection: " + mPreferences.getString(CameraSettings.KEY_VIDEO_EFFECT, "none")); - if ( mEffectType == EffectsRecorder.EFFECT_NONE ) { + if (mEffectType == EffectsRecorder.EFFECT_NONE) { // Stop effects and return to normal preview mEffectsRecorder.stopPreview(); return true; } if (mEffectType == EffectsRecorder.EFFECT_BACKDROPPER && - ((String)mEffectParameter).equals(EFFECT_BG_FROM_GALLERY)) { + ((String) mEffectParameter).equals(EFFECT_BG_FROM_GALLERY)) { // Request video from gallery to use for background Intent i = new Intent(Intent.ACTION_PICK); i.setDataAndType(Video.Media.EXTERNAL_CONTENT_URI, @@ -2114,7 +2062,7 @@ public class VideoCamera extends ActivityBase mZoomControl.setZoomMax(mZoomMax); mZoomControl.setZoomIndex(mParameters.getZoom()); mZoomControl.setSmoothZoomSupported(mSmoothZoomSupported); - mZoomControl.setOnZoomChangeListener(new ZoomChangeListener() ); + mZoomControl.setOnZoomChangeListener(new ZoomChangeListener()); mCameraDevice.setZoomChangeListener(mZoomListener); } @@ -2122,7 +2070,7 @@ public class VideoCamera extends ActivityBase implements android.hardware.Camera.OnZoomChangeListener { @Override public void onZoomChange(int value, boolean stopped, android.hardware.Camera camera) { - Log.v(TAG, "Zoom changed: value=" + value + ". stopped="+ stopped); + Log.v(TAG, "Zoom changed: value=" + value + ". stopped=" + stopped); mZoomValue = value; // Update the UI when we get zoom value. -- cgit v1.1